pub trait VideoEncoderExt: IsA<VideoEncoder> + Sealed + 'static {
Show 14 methods // Provided methods fn allocate_output_buffer(&self, size: usize) -> Buffer { ... } fn finish_frame( &self, frame: VideoCodecFrame<'_> ) -> Result<FlowSuccess, FlowError> { ... } fn max_encode_time(&self, frame: &VideoCodecFrame<'_>) -> ClockTimeDiff { ... } fn min_force_key_unit_interval(&self) -> Option<ClockTime> { ... } fn is_qos_enabled(&self) -> bool { ... } fn merge_tags(&self, tags: Option<&TagList>, mode: TagMergeMode) { ... } fn proxy_getcaps(&self, caps: Option<&Caps>, filter: Option<&Caps>) -> Caps { ... } fn set_min_force_key_unit_interval( &self, interval: impl Into<Option<ClockTime>> ) { ... } fn set_min_pts(&self, min_pts: impl Into<Option<ClockTime>>) { ... } fn set_qos_enabled(&self, enabled: bool) { ... } fn is_qos(&self) -> bool { ... } fn set_qos(&self, qos: bool) { ... } fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all VideoEncoder methods.

§Implementors

VideoEncoder

Provided Methods§

source

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

Helper function that allocates a buffer to hold an encoded video frame for self’s current VideoCodecState.

§size

size of the buffer

§Returns

allocated buffer

source

fn finish_frame( &self, frame: VideoCodecFrame<'_> ) -> Result<FlowSuccess, FlowError>

frame must have a valid encoded data buffer, whose metadata fields are then appropriately set according to frame data or no buffer at all if the frame should be dropped. It is subsequently pushed downstream or provided to pre_push. In any case, the frame is considered finished and released.

After calling this function the output buffer of the frame is to be considered read-only. This function will also change the metadata of the buffer.

§frame

an encoded VideoCodecFrame

§Returns

a gst::FlowReturn resulting from sending data downstream

source

fn max_encode_time(&self, frame: &VideoCodecFrame<'_>) -> ClockTimeDiff

Determines maximum possible encoding time for frame that will allow it to encode and arrive in time (as determined by QoS events). In particular, a negative result means encoding in time is no longer possible and should therefore occur as soon/skippy as possible.

If no QoS events have been received from downstream, or if qos is disabled this function returns G_MAXINT64.

§frame

a VideoCodecFrame

§Returns

max decoding time.

source

fn min_force_key_unit_interval(&self) -> Option<ClockTime>

Returns the minimum force-keyunit interval, see set_min_force_key_unit_interval() for more details.

§Returns

the minimum force-keyunit interval

source

fn is_qos_enabled(&self) -> bool

Checks if self is currently configured to handle Quality-of-Service events from downstream.

§Returns

true if the encoder is configured to perform Quality-of-Service.

source

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

Sets the video 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 resolution/format/… combinations supported by downstream elements (e.g. muxers).

§caps

initial caps

§filter

filter caps

§Returns

a gst::Caps owned by caller

source

fn set_min_force_key_unit_interval( &self, interval: impl Into<Option<ClockTime>> )

Sets the minimum interval for requesting keyframes based on force-keyunit events. Setting this to 0 will allow to handle every event, setting this to GST_CLOCK_TIME_NONE causes force-keyunit events to be ignored.

§interval

minimum interval

source

fn set_min_pts(&self, min_pts: impl Into<Option<ClockTime>>)

Request minimal value for PTS passed to handle_frame.

For streams with reordered frames this can be used to ensure that there is enough time to accommodate first DTS, which may be less than first PTS

§min_pts

minimal PTS that will be passed to handle_frame

source

fn set_qos_enabled(&self, enabled: bool)

Configures self to handle Quality-of-Service events from downstream.

§enabled

the new qos value.

source

fn is_qos(&self) -> bool

source

fn set_qos(&self, qos: bool)

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§