Trait gstreamer_audio::prelude::AudioEncoderExt[][src]

pub trait AudioEncoderExt: 'static {
Show methods fn allocate_output_buffer(&self, size: usize) -> Result<Buffer, BoolError>;
fn audio_info(&self) -> Option<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 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_headers(&self, headers: &[&Buffer]);
fn set_latency(&self, min: ClockTime, max: 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;
}

Trait containing all AudioEncoder methods.

Implementors

crate::AudioEncoder

Required methods

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

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

fn audio_info(&self) -> Option<AudioInfo>[src]

Returns

a crate::AudioInfo describing the input audio format

fn is_drainable(&self) -> bool[src]

Queries encoder drain handling.

Returns

TRUE if drainable handling is enabled.

MT safe.

fn frame_max(&self) -> i32[src]

Returns

currently configured maximum handled frames

fn frame_samples_max(&self) -> i32[src]

Returns

currently maximum requested samples per frame

fn frame_samples_min(&self) -> i32[src]

Returns

currently minimum requested samples per frame

fn is_hard_min(&self) -> bool[src]

Queries encoder hard minimum handling.

Returns

TRUE if hard minimum handling is enabled.

MT safe.

fn is_hard_resync(&self) -> bool[src]

fn lookahead(&self) -> i32[src]

Returns

currently configured encoder lookahead

fn is_mark_granule(&self) -> bool[src]

Queries if the encoder will handle granule marking.

Returns

TRUE if granule marking is enabled.

MT safe.

fn is_perfect_timestamp(&self) -> bool[src]

Queries encoder perfect timestamp behaviour.

Returns

TRUE if perfect timestamp setting enabled.

MT safe.

fn tolerance(&self) -> ClockTime[src]

Queries current audio jitter tolerance threshold.

Returns

encoder audio jitter tolerance threshold.

MT safe.

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

Sets the audio encoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with Self::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 crate::gst::TagList to merge, or NULL to unset previously-set tags

mode

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

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

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 crate::gst::Caps owned by caller

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

This is supported on crate feature v1_10 only.

Sets a caps in allocation query which are different from the set pad’s caps. Use this function before calling [crate::AudioEncoder::negotiate()]. Setting to None the allocation query will use the caps from the pad.

allocation_caps

a crate::gst::Caps or None

fn set_drainable(&self, enabled: bool)[src]

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

fn set_frame_max(&self, num: i32)[src]

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 [crate::GstAudioEncoderClass.set_format()] is called.

num

number of frames

fn set_frame_samples_max(&self, num: i32)[src]

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, Self::set_frame_samples_min() must be called with the same number.

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

num

number of samples per frame

fn set_frame_samples_min(&self, num: i32)[src]

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, Self::set_frame_samples_max() must be called with the same number.

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

num

number of samples per frame

fn set_hard_min(&self, enabled: bool)[src]

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

fn set_hard_resync(&self, enabled: bool)[src]

fn set_headers(&self, headers: &[&Buffer])[src]

Set the codec headers to be sent downstream whenever requested.

headers

a list of crate::gst::Buffer containing the codec header

fn set_latency(&self, min: ClockTime, max: ClockTime)[src]

Sets encoder latency.

min

minimum latency

max

maximum latency

fn set_lookahead(&self, num: i32)[src]

Sets encoder lookahead (in units of input rate samples)

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

num

lookahead

fn set_mark_granule(&self, enabled: bool)[src]

Enable or disable encoder granule handling.

MT safe.

enabled

new state

fn set_perfect_timestamp(&self, enabled: bool)[src]

Enable or disable encoder perfect output timestamp preference.

MT safe.

enabled

new state

fn set_tolerance(&self, tolerance: ClockTime)[src]

Configures encoder audio jitter tolerance threshold.

MT safe.

tolerance

new tolerance

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

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

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

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

Loading content...

Implementors

impl<O: IsA<AudioEncoder>> AudioEncoderExt for O[src]

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

fn audio_info(&self) -> Option<AudioInfo>[src]

fn is_drainable(&self) -> bool[src]

fn frame_max(&self) -> i32[src]

fn frame_samples_max(&self) -> i32[src]

fn frame_samples_min(&self) -> i32[src]

fn is_hard_min(&self) -> bool[src]

fn is_hard_resync(&self) -> bool[src]

fn lookahead(&self) -> i32[src]

fn is_mark_granule(&self) -> bool[src]

fn is_perfect_timestamp(&self) -> bool[src]

fn tolerance(&self) -> ClockTime[src]

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

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

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

This is supported on crate feature v1_10 only.

fn set_drainable(&self, enabled: bool)[src]

fn set_frame_max(&self, num: i32)[src]

fn set_frame_samples_max(&self, num: i32)[src]

fn set_frame_samples_min(&self, num: i32)[src]

fn set_hard_min(&self, enabled: bool)[src]

fn set_hard_resync(&self, enabled: bool)[src]

fn set_headers(&self, headers: &[&Buffer])[src]

fn set_latency(&self, min: ClockTime, max: ClockTime)[src]

fn set_lookahead(&self, num: i32)[src]

fn set_mark_granule(&self, enabled: bool)[src]

fn set_perfect_timestamp(&self, enabled: bool)[src]

fn set_tolerance(&self, tolerance: ClockTime)[src]

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

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

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

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

Loading content...