Trait gstreamer_audio::prelude::AudioDecoderExt
source · pub trait AudioDecoderExt: IsA<AudioDecoder> + Sealed + 'static {
Show 32 methods
// Provided methods
fn allocate_output_buffer(&self, size: usize) -> Buffer { ... }
fn finish_frame(
&self,
buf: Option<Buffer>,
frames: i32,
) -> Result<FlowSuccess, FlowError> { ... }
fn finish_subframe(
&self,
buf: Option<Buffer>,
) -> Result<FlowSuccess, FlowError> { ... }
fn audio_info(&self) -> AudioInfo { ... }
fn delay(&self) -> i32 { ... }
fn is_drainable(&self) -> bool { ... }
fn estimate_rate(&self) -> i32 { ... }
fn latency(&self) -> (ClockTime, Option<ClockTime>) { ... }
fn max_errors(&self) -> i32 { ... }
fn min_latency(&self) -> ClockTime { ... }
fn needs_format(&self) -> bool { ... }
fn parse_state(&self) -> (bool, bool) { ... }
fn is_plc(&self) -> bool { ... }
fn plc_aware(&self) -> i32 { ... }
fn 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: impl Into<Option<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_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_min_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_plc_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn allocate_output_buffer(&self, size: usize) -> Buffer
fn allocate_output_buffer(&self, size: usize) -> Buffer
sourcefn finish_frame(
&self,
buf: Option<Buffer>,
frames: i32,
) -> Result<FlowSuccess, FlowError>
fn finish_frame( &self, buf: Option<Buffer>, frames: i32, ) -> Result<FlowSuccess, FlowError>
Collects decoded data and pushes it downstream.
buf
may be NULL in which case the indicated number of frames
are discarded and considered to have produced no output
(e.g. lead-in or setup frames).
Otherwise, source pad caps must be set when it is called with valid
data in buf
.
Note that a frame received in GstAudioDecoderClass.handle_frame()
may be
invalidated by a call to this function.
§buf
decoded data
§frames
number of decoded frames represented by decoded data
§Returns
a gst::FlowReturn
that should be escalated to caller (of caller)
sourcefn finish_subframe(&self, buf: Option<Buffer>) -> Result<FlowSuccess, FlowError>
fn finish_subframe(&self, buf: Option<Buffer>) -> Result<FlowSuccess, FlowError>
Collects decoded data and pushes it downstream. This function may be called multiple times for a given input frame.
buf
may be NULL in which case it is assumed that the current input frame is
finished. This is equivalent to calling finish_subframe()
with a NULL buffer and frames=1 after having pushed out all decoded audio
subframes using this function.
When called with valid data in buf
the source pad caps must have been set
already.
Note that a frame received in GstAudioDecoderClass.handle_frame()
may be
invalidated by a call to this function.
§buf
decoded data
§Returns
a gst::FlowReturn
that should be escalated to caller (of caller)
sourcefn audio_info(&self) -> AudioInfo
fn audio_info(&self) -> AudioInfo
sourcefn is_drainable(&self) -> bool
fn is_drainable(&self) -> bool
sourcefn estimate_rate(&self) -> i32
fn estimate_rate(&self) -> i32
§Returns
currently configured byte to time conversion setting
sourcefn max_errors(&self) -> i32
fn max_errors(&self) -> i32
§Returns
currently configured decoder tolerated error count.
sourcefn min_latency(&self) -> ClockTime
fn min_latency(&self) -> ClockTime
sourcefn needs_format(&self) -> bool
fn needs_format(&self) -> bool
Queries decoder required format handling.
§Returns
TRUE if required format handling is enabled.
MT safe.
sourcefn parse_state(&self) -> (bool, bool)
fn parse_state(&self) -> (bool, bool)
sourcefn is_plc(&self) -> bool
fn is_plc(&self) -> bool
Queries decoder packet loss concealment handling.
§Returns
TRUE if packet loss concealment is enabled.
MT safe.
sourcefn tolerance(&self) -> ClockTime
fn tolerance(&self) -> ClockTime
Queries current audio jitter tolerance threshold.
§Returns
decoder audio jitter tolerance threshold.
MT safe.
Sets the audio decoder tags and how they should be merged with any
upstream stream tags. This will override any tags previously-set
with 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
sourcefn set_allocation_caps(&self, allocation_caps: Option<&Caps>)
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
AudioDecoderExtManual::negotiate()
. Setting to None
the allocation
query will use the caps from the pad.
§allocation_caps
sourcefn set_drainable(&self, enabled: bool)
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
sourcefn set_estimate_rate(&self, enabled: bool)
fn set_estimate_rate(&self, enabled: bool)
Allows baseclass to perform byte to time estimated conversion.
§enabled
whether to enable byte to time conversion
sourcefn set_max_errors(&self, num: i32)
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
sourcefn set_min_latency(&self, num: ClockTime)
fn set_min_latency(&self, num: ClockTime)
sourcefn set_needs_format(&self, enabled: bool)
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
sourcefn set_plc(&self, enabled: bool)
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
sourcefn set_plc_aware(&self, plc: bool)
fn set_plc_aware(&self, plc: bool)
sourcefn set_tolerance(&self, tolerance: ClockTime)
fn set_tolerance(&self, tolerance: ClockTime)
sourcefn set_use_default_pad_acceptcaps(&self, use_: bool)
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