Trait gstreamer_video::prelude::VideoEncoderExt[][src]

pub trait VideoEncoderExt: 'static {
Show methods fn allocate_output_buffer(&self, size: usize) -> Result<Buffer, BoolError>;
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_headers(&self, headers: &[&Buffer]);
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

Required methods

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

This is supported on crate feature v1_14 only.

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 property::VideoEncoder::qos is disabled this function returns G_MAXINT64.

frame

a VideoCodecFrame

Returns

max decoding time.

This is supported on crate feature v1_18 only.

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

Returns

the minimum force-keyunit interval

This is supported on crate feature v1_14 only.

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.

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

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

Set the codec headers to be sent downstream whenever requested.

headers

a list of gst::Buffer containing the codec header

This is supported on crate feature v1_18 only.

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

This is supported on crate feature v1_14 only.
This is supported on crate feature v1_18 only.

Implementors

This is supported on crate feature v1_14 only.
This is supported on crate feature v1_18 only.
This is supported on crate feature v1_14 only.
This is supported on crate feature v1_18 only.
This is supported on crate feature v1_14 only.
This is supported on crate feature v1_18 only.