Trait gstreamer_video::prelude::VideoDecoderExt[][src]

pub trait VideoDecoderExt: 'static {
Show methods fn add_to_frame(&self, n_bytes: i32);
fn allocate_output_buffer(&self) -> Result<Buffer, BoolError>;
fn buffer_pool(&self) -> Option<BufferPool>;
fn estimate_rate(&self) -> i32;
fn max_decode_time(&self, frame: &VideoCodecFrame<'_>) -> ClockTimeDiff;
fn max_errors(&self) -> i32;
fn needs_format(&self) -> bool;
fn needs_sync_point(&self) -> bool;
fn is_packetized(&self) -> bool;
fn pending_frame_size(&self) -> usize;
fn qos_proportion(&self) -> f64;
fn have_frame(&self) -> FlowReturn;
fn merge_tags(&self, tags: Option<&TagList>, mode: TagMergeMode);
fn proxy_getcaps(&self, caps: Option<&Caps>, filter: Option<&Caps>) -> Caps;
fn request_sync_point(
        &self,
        frame: &VideoCodecFrame<'_>,
        flags: VideoDecoderRequestSyncPointFlags
    );
fn set_estimate_rate(&self, enabled: bool);
fn set_max_errors(&self, num: i32);
fn set_needs_format(&self, enabled: bool);
fn set_needs_sync_point(&self, enabled: bool);
fn set_packetized(&self, packetized: bool);
fn set_use_default_pad_acceptcaps(&self, use_: bool);
fn is_discard_corrupted_frames(&self) -> bool;
fn set_discard_corrupted_frames(&self, discard_corrupted_frames: bool);
fn min_force_key_unit_interval(&self) -> u64;
fn set_min_force_key_unit_interval(&self, min_force_key_unit_interval: u64);
fn is_qos(&self) -> bool;
fn set_qos(&self, qos: bool);
fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
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 VideoDecoder methods.

Implementors

VideoDecoder

Required methods

Removes next n_bytes of input data and adds it to currently parsed frame.

n_bytes

the number of bytes to add

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

You should use VideoDecoderExtManual::allocate_output_frame() instead of this function, if possible at all.

Returns

allocated buffer, or NULL if no buffer could be allocated (e.g. when downstream is flushing or shutting down)

Returns

the instance of the gst::BufferPool used by the decoder; free it after use it

Returns

currently configured byte to time conversion setting

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

frame

a VideoCodecFrame

Returns

max decoding time.

Returns

currently configured decoder tolerated error count.

Queries decoder required format handling.

Returns

true if required format handling is enabled.

This is supported on crate feature v1_20 only.

Queries if the decoder requires a sync point before it starts outputting data in the beginning.

Returns

true if a sync point is required in the beginning.

Queries whether input data is considered packetized or not by the base class.

Returns

TRUE if input data is considered packetized.

Returns the number of bytes previously added to the current frame by calling add_to_frame().

Returns

The number of bytes pending for the current frame

Returns

The current QoS proportion.

Gathers all data collected for currently parsed frame, gathers corresponding metadata and passes it along for further processing, i.e. handle_frame.

Returns

a gst::FlowReturn

Sets the audio decoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with gst_audio_decoder_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.

caps

initial caps

filter

filter caps

Returns

a gst::Caps owned by caller

This is supported on crate feature v1_20 only.

Allows the VideoDecoder subclass to request from the base class that a new sync should be requested from upstream, and that frame was the frame when the subclass noticed that a new sync point is required. A reason for the subclass to do this could be missing reference frames, for example.

The base class will then request a new sync point from upstream as long as the time that passed since the last one is exceeding property::VideoDecoder::min-force-key-unit-interval.

The subclass can signal via flags how the frames until the next sync point should be handled:

frame

a VideoCodecFrame

flags

VideoDecoderRequestSyncPointFlags

Allows baseclass to perform byte to time estimated conversion.

enabled

whether to enable byte to time conversion

Sets numbers of tolerated decoder errors, where a tolerated one is then only warned about, but more than tolerated will lead to fatal error. You can set -1 for never returning fatal errors. Default is set to GST_VIDEO_DECODER_MAX_ERRORS.

The ‘-1’ option was added in 1.4

num

max tolerated errors

Configures decoder format needs. If enabled, subclass needs to be negotiated with format caps before it can process any data. It will then never be handed any data before it has been configured. Otherwise, it might be handed data without having been configured and is then expected being able to do so either by default or based on the input data.

enabled

new state

This is supported on crate feature v1_20 only.

Configures whether the decoder requires a sync point before it starts outputting data in the beginning. If enabled, the base class will discard all non-sync point frames in the beginning and after a flush and does not pass it to the subclass.

If the first frame is not a sync point, the base class will request a sync point via the force-key-unit event.

enabled

new state

Allows baseclass to consider input data as packetized or not. If the input is packetized, then the parse method will not be called.

packetized

whether the input data should be considered as packetized.

Lets VideoDecoder sub-classes decide if they want the sink pad to use the default pad query handler to reply to accept-caps queries.

By setting this to true it is possible to further customize the default handler with GST_PAD_SET_ACCEPT_INTERSECT and GST_PAD_SET_ACCEPT_TEMPLATE

use_

if the default pad accept-caps query handling should be used

This is supported on crate feature v1_20 only.

If set to true the decoder will discard frames that are marked as corrupted instead of outputting them.

This is supported on crate feature v1_20 only.

If set to true the decoder will discard frames that are marked as corrupted instead of outputting them.

This is supported on crate feature v1_20 only.

Minimum interval between force-key-unit events sent upstream by the decoder. Setting this to 0 will cause every event to be handled, setting this to GST_CLOCK_TIME_NONE will cause every event to be ignored.

See gst_video_event_new_upstream_force_key_unit() for more details about force-key-unit events.

This is supported on crate feature v1_20 only.

Minimum interval between force-key-unit events sent upstream by the decoder. Setting this to 0 will cause every event to be handled, setting this to GST_CLOCK_TIME_NONE will cause every event to be ignored.

See gst_video_event_new_upstream_force_key_unit() for more details about force-key-unit events.

This is supported on crate feature v1_18 only.

If set to true the decoder will handle QoS events received from downstream elements. This includes dropping output frames which are detected as late using the metrics reported by those events.

This is supported on crate feature v1_18 only.

If set to true the decoder will handle QoS events received from downstream elements. This includes dropping output frames which are detected as late using the metrics reported by those events.

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

Implementors

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