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) -> 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: ClockTime);
fn set_min_pts(&self, min_pts: 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;
}

Trait containing all VideoEncoder methods.

Implementors

crate::VideoEncoder

Required methods

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

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

size

size of the buffer

Returns

allocated buffer

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

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

frame

a crate::VideoCodecFrame

Returns

max decoding time.

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

This is supported on crate feature v1_18 only.

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

Returns

the minimum force-keyunit interval

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

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.

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

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

caps

initial caps

filter

filter caps

Returns

a crate::gst::Caps owned by caller

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_min_force_key_unit_interval(&self, interval: ClockTime)[src]

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

fn set_min_pts(&self, min_pts: ClockTime)[src]

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

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

This is supported on crate feature v1_14 only.

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

enabled

the new qos value.

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

fn set_qos(&self, qos: bool)[src]

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

This is supported on crate feature v1_18 only.

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

Loading content...

Implementors

impl<O: IsA<VideoEncoder>> VideoEncoderExt for O[src]

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

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

This is supported on crate feature v1_14 only.

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

This is supported on crate feature v1_18 only.

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

This is supported on crate feature v1_14 only.

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

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

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

fn set_min_force_key_unit_interval(&self, interval: ClockTime)[src]

This is supported on crate feature v1_18 only.

fn set_min_pts(&self, min_pts: ClockTime)[src]

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

This is supported on crate feature v1_14 only.

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

fn set_qos(&self, qos: bool)[src]

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

This is supported on crate feature v1_18 only.

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

Loading content...