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

pub trait VideoEncoderExt: 'static {
    fn allocate_output_buffer(&self, size: usize) -> Result<Buffer, BoolError>;
fn get_max_encode_time(&self, frame: &VideoCodecFrame) -> ClockTimeDiff;
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_pts(&self, min_pts: ClockTime);
fn set_qos_enabled(&self, enabled: bool);
fn get_property_qos(&self) -> bool;
fn set_property_qos(&self, qos: bool);
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all VideoEncoder methods.

Implementors

VideoEncoder

Required methods

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

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

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

Feature: v1_14

frame

a VideoCodecFrame

Returns

max decoding time.

fn is_qos_enabled(&self) -> bool

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

Feature: v1_14

Returns

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

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 VideoEncoderExt::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

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

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

Set the codec headers to be sent downstream whenever requested.

headers

a list of gst::Buffer containing the codec header

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

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

Feature: v1_14

enabled

the new qos value.

fn get_property_qos(&self) -> bool

fn set_property_qos(&self, qos: bool)

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

Loading content...

Implementors

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

Loading content...