Trait gstreamer_audio::prelude::AudioEncoderExt

source ·
pub trait AudioEncoderExt:
    IsA<AudioEncoder>
    + Sealed
    + 'static {
Show 32 methods // Provided methods fn allocate_output_buffer(&self, size: usize) -> Buffer { ... } fn finish_frame( &self, buffer: Option<Buffer>, samples: i32, ) -> Result<FlowSuccess, FlowError> { ... } fn audio_info(&self) -> AudioInfo { ... } fn is_drainable(&self) -> bool { ... } fn frame_max(&self) -> i32 { ... } fn frame_samples_max(&self) -> i32 { ... } fn frame_samples_min(&self) -> i32 { ... } fn is_hard_min(&self) -> bool { ... } fn is_hard_resync(&self) -> bool { ... } fn latency(&self) -> (ClockTime, Option<ClockTime>) { ... } fn lookahead(&self) -> i32 { ... } fn is_mark_granule(&self) -> bool { ... } fn is_perfect_timestamp(&self) -> bool { ... } 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_frame_max(&self, num: i32) { ... } fn set_frame_samples_max(&self, num: i32) { ... } fn set_frame_samples_min(&self, num: i32) { ... } fn set_hard_min(&self, enabled: bool) { ... } fn set_hard_resync(&self, enabled: bool) { ... } fn set_latency(&self, min: ClockTime, max: impl Into<Option<ClockTime>>) { ... } fn set_lookahead(&self, num: i32) { ... } fn set_mark_granule(&self, enabled: bool) { ... } fn set_perfect_timestamp(&self, enabled: bool) { ... } fn set_tolerance(&self, tolerance: ClockTime) { ... } fn connect_hard_resync_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_mark_granule_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_perfect_timestamp_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

Trait containing all AudioEncoder methods.

§Implementors

AudioEncoder

Provided Methods§

source

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

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

§size

size of the buffer

§Returns

allocated buffer

source

fn finish_frame( &self, buffer: Option<Buffer>, samples: i32, ) -> Result<FlowSuccess, FlowError>

Collects encoded data and pushes encoded data downstream. Source pad caps must be set when this is called.

If samples < 0, then best estimate is all samples provided to encoder (subclass) so far. buf may be NULL, in which case next number of samples are considered discarded, e.g. as a result of discontinuous transmission, and a discontinuity is marked.

Note that samples received in GstAudioEncoderClass.handle_frame() may be invalidated by a call to this function.

§buffer

encoded data

§samples

number of samples (per channel) represented by encoded data

§Returns

a gst::FlowReturn that should be escalated to caller (of caller)

source

fn audio_info(&self) -> AudioInfo

§Returns

a AudioInfo describing the input audio format

source

fn is_drainable(&self) -> bool

Queries encoder drain handling.

§Returns

TRUE if drainable handling is enabled.

MT safe.

source

fn frame_max(&self) -> i32

§Returns

currently configured maximum handled frames

source

fn frame_samples_max(&self) -> i32

§Returns

currently maximum requested samples per frame

source

fn frame_samples_min(&self) -> i32

§Returns

currently minimum requested samples per frame

source

fn is_hard_min(&self) -> bool

Queries encoder hard minimum handling.

§Returns

TRUE if hard minimum handling is enabled.

MT safe.

source

fn is_hard_resync(&self) -> bool

source

fn latency(&self) -> (ClockTime, Option<ClockTime>)

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

§Returns
§min

a pointer to storage to hold minimum latency

§max

a pointer to storage to hold maximum latency

source

fn lookahead(&self) -> i32

§Returns

currently configured encoder lookahead

source

fn is_mark_granule(&self) -> bool

Queries if the encoder will handle granule marking.

§Returns

TRUE if granule marking is enabled.

MT safe.

source

fn is_perfect_timestamp(&self) -> bool

Queries encoder perfect timestamp behaviour.

§Returns

TRUE if perfect timestamp setting enabled.

MT safe.

source

fn tolerance(&self) -> ClockTime

Queries current audio jitter tolerance threshold.

§Returns

encoder audio jitter tolerance threshold.

MT safe.

source

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

Sets the audio encoder 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.

MT safe.

§tags

a gst::TagList to merge, or NULL to unset previously-set tags

§mode

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

source

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 channel/rate combinations supported by downstream elements (e.g. muxers).

§caps

initial caps

§filter

filter caps

§Returns

a gst::Caps owned by caller

source

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 AudioEncoderExtManual::negotiate(). Setting to None the allocation query will use the caps from the pad.

§allocation_caps

a gst::Caps or None

source

fn set_drainable(&self, enabled: bool)

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

MT safe.

§enabled

new state

source

fn set_frame_max(&self, num: i32)

Sets max number of frames accepted at once (assumed minimally 1). Requires frame_samples_min and frame_samples_max to be the equal.

Note: This value will be reset to 0 every time before GstAudioEncoderClass.set_format() is called.

§num

number of frames

source

fn set_frame_samples_max(&self, num: i32)

Sets number of samples (per channel) subclass needs to be handed, at most or will be handed all available if 0.

If an exact number of samples is required, set_frame_samples_min() must be called with the same number.

Note: This value will be reset to 0 every time before GstAudioEncoderClass.set_format() is called.

§num

number of samples per frame

source

fn set_frame_samples_min(&self, num: i32)

Sets number of samples (per channel) subclass needs to be handed, at least or will be handed all available if 0.

If an exact number of samples is required, set_frame_samples_max() must be called with the same number.

Note: This value will be reset to 0 every time before GstAudioEncoderClass.set_format() is called.

§num

number of samples per frame

source

fn set_hard_min(&self, enabled: bool)

Configures encoder hard minimum handling. If enabled, subclass will never be handed less samples than it configured, which otherwise might occur near end-of-data handling. Instead, the leftover samples will simply be discarded.

MT safe.

§enabled

new state

source

fn set_hard_resync(&self, enabled: bool)

source

fn set_latency(&self, min: ClockTime, max: impl Into<Option<ClockTime>>)

Sets encoder latency. If the provided values changed from previously provided ones, this will also post a LATENCY message on the bus so the pipeline can reconfigure its global latency.

§min

minimum latency

§max

maximum latency

source

fn set_lookahead(&self, num: i32)

Sets encoder lookahead (in units of input rate samples)

Note: This value will be reset to 0 every time before GstAudioEncoderClass.set_format() is called.

§num

lookahead

source

fn set_mark_granule(&self, enabled: bool)

Enable or disable encoder granule handling.

MT safe.

§enabled

new state

source

fn set_perfect_timestamp(&self, enabled: bool)

Enable or disable encoder perfect output timestamp preference.

MT safe.

§enabled

new state

source

fn set_tolerance(&self, tolerance: ClockTime)

Configures encoder audio jitter tolerance threshold.

MT safe.

§tolerance

new tolerance

source

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

source

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

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§