[][src]Trait gstreamer_audio::AudioDecoderExt

pub trait AudioDecoderExt: 'static {
    fn allocate_output_buffer(&self, size: usize) -> Result<Buffer, BoolError>;
fn get_audio_info(&self) -> Option<AudioInfo>;
fn get_delay(&self) -> i32;
fn get_drainable(&self) -> bool;
fn get_estimate_rate(&self) -> i32;
fn get_latency(&self) -> (ClockTime, ClockTime);
fn get_max_errors(&self) -> i32;
fn get_min_latency(&self) -> ClockTime;
fn get_needs_format(&self) -> bool;
fn get_parse_state(&self) -> (bool, bool);
fn get_plc(&self) -> bool;
fn get_plc_aware(&self) -> i32;
fn get_tolerance(&self) -> ClockTime;
fn merge_tags(&self, tags: Option<&TagList>, mode: TagMergeMode);
fn proxy_getcaps(&self, caps: Option<&Caps>, filter: Option<&Caps>) -> Caps;
fn set_allocation_caps(&self, allocation_caps: Option<&Caps>);
fn set_drainable(&self, enabled: bool);
fn set_estimate_rate(&self, enabled: bool);
fn set_latency(&self, min: ClockTime, max: ClockTime);
fn set_max_errors(&self, num: i32);
fn set_min_latency(&self, num: ClockTime);
fn set_needs_format(&self, enabled: bool);
fn set_plc(&self, enabled: bool);
fn set_plc_aware(&self, plc: bool);
fn set_tolerance(&self, tolerance: ClockTime);
fn set_use_default_pad_acceptcaps(&self, use_: bool);
fn connect_property_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_min_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_plc_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all AudioDecoder methods.

Implementors

AudioDecoder

Required methods

fn allocate_output_buffer(&self, size: usize) -> Result<Buffer, BoolError>

Helper function that allocates a buffer to hold an audio frame for self's current output format.

size

size of the buffer

Returns

allocated buffer

fn get_audio_info(&self) -> Option<AudioInfo>

Returns

a AudioInfo describing the input audio format

fn get_delay(&self) -> i32

Returns

currently configured decoder delay

fn get_drainable(&self) -> bool

Queries decoder drain handling.

Returns

TRUE if drainable handling is enabled.

MT safe.

fn get_estimate_rate(&self) -> i32

Returns

currently configured byte to time conversion setting

fn get_latency(&self) -> (ClockTime, ClockTime)

Sets the variables pointed to by min and max to the currently configured latency.

min

a pointer to storage to hold minimum latency

max

a pointer to storage to hold maximum latency

fn get_max_errors(&self) -> i32

Returns

currently configured decoder tolerated error count.

fn get_min_latency(&self) -> ClockTime

Queries decoder's latency aggregation.

Returns

aggregation latency.

MT safe.

fn get_needs_format(&self) -> bool

Queries decoder required format handling.

Returns

TRUE if required format handling is enabled.

MT safe.

fn get_parse_state(&self) -> (bool, bool)

Return current parsing (sync and eos) state.

sync

a pointer to a variable to hold the current sync state

eos

a pointer to a variable to hold the current eos state

fn get_plc(&self) -> bool

Queries decoder packet loss concealment handling.

Returns

TRUE if packet loss concealment is enabled.

MT safe.

fn get_plc_aware(&self) -> i32

Returns

currently configured plc handling

fn get_tolerance(&self) -> ClockTime

Queries current audio jitter tolerance threshold.

Returns

decoder audio jitter tolerance threshold.

MT safe.

fn merge_tags(&self, tags: Option<&TagList>, mode: TagMergeMode)

Sets the audio decoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with AudioDecoderExt::merge_tags.

Note that this is provided for convenience, and the subclass is not required to use this and can still do tag handling on its own.

tags

a gst::TagList to merge, or NULL

mode

the gst::TagMergeMode to use, usually gst::TagMergeMode::Replace

fn proxy_getcaps(&self, caps: Option<&Caps>, filter: Option<&Caps>) -> Caps

Returns caps that express caps (or sink template caps if caps == NULL) restricted to rate/channels/... combinations supported by downstream elements.

caps

initial caps

filter

filter caps

Returns

a gst::Caps owned by caller

fn set_allocation_caps(&self, allocation_caps: Option<&Caps>)

Sets a caps in allocation query which are different from the set pad's caps. Use this function before calling AudioDecoder::negotiate. Setting to None the allocation query will use the caps from the pad.

Feature: v1_10

allocation_caps

a gst::Caps or None

fn set_drainable(&self, enabled: bool)

Configures decoder drain handling. If drainable, subclass might be handed a NULL buffer to have it return any leftover decoded data. Otherwise, it is not considered so capable and will only ever be passed real data.

MT safe.

enabled

new state

fn set_estimate_rate(&self, enabled: bool)

Allows baseclass to perform byte to time estimated conversion.

enabled

whether to enable byte to time conversion

fn set_latency(&self, min: ClockTime, max: ClockTime)

Sets decoder latency.

min

minimum latency

max

maximum latency

fn set_max_errors(&self, num: i32)

Sets numbers of tolerated decoder errors, where a tolerated one is then only warned about, but more than tolerated will lead to fatal error. You can set -1 for never returning fatal errors. Default is set to GST_AUDIO_DECODER_MAX_ERRORS.

num

max tolerated errors

fn set_min_latency(&self, num: ClockTime)

Sets decoder minimum aggregation latency.

MT safe.

num

new minimum latency

fn set_needs_format(&self, enabled: bool)

Configures decoder format needs. If enabled, subclass needs to be negotiated with format caps before it can process any data. It will then never be handed any data before it has been configured. Otherwise, it might be handed data without having been configured and is then expected being able to do so either by default or based on the input data.

MT safe.

enabled

new state

fn set_plc(&self, enabled: bool)

Enable or disable decoder packet loss concealment, provided subclass and codec are capable and allow handling plc.

MT safe.

enabled

new state

fn set_plc_aware(&self, plc: bool)

Indicates whether or not subclass handles packet loss concealment (plc).

plc

new plc state

fn set_tolerance(&self, tolerance: ClockTime)

Configures decoder audio jitter tolerance threshold.

MT safe.

tolerance

new tolerance

fn set_use_default_pad_acceptcaps(&self, use_: bool)

Lets AudioDecoder sub-classes decide if they want the sink pad to use the default pad query handler to reply to accept-caps queries.

By setting this to true it is possible to further customize the default handler with GST_PAD_SET_ACCEPT_INTERSECT and GST_PAD_SET_ACCEPT_TEMPLATE

use_

if the default pad accept-caps query handling should be used

fn connect_property_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_min_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_plc_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Loading content...

Implementors

impl<O: IsA<AudioDecoder>> AudioDecoderExt for O[src]

Loading content...