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
Required methods
fn add_to_frame(&self, n_bytes: i32)
[src]
fn add_to_frame(&self, n_bytes: i32)
[src]Removes next n_bytes
of input data and adds it to currently parsed frame.
n_bytes
the number of bytes to add
fn allocate_output_buffer(&self) -> Result<Buffer, BoolError>
[src]
fn allocate_output_buffer(&self) -> Result<Buffer, BoolError>
[src]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)
fn buffer_pool(&self) -> Option<BufferPool>
[src]
fn buffer_pool(&self) -> Option<BufferPool>
[src]Returns
the instance of the gst::BufferPool
used
by the decoder; free it after use it
fn estimate_rate(&self) -> i32
[src]
fn estimate_rate(&self) -> i32
[src]Returns
currently configured byte to time conversion setting
fn max_decode_time(&self, frame: &VideoCodecFrame<'_>) -> ClockTimeDiff
[src]
fn max_decode_time(&self, frame: &VideoCodecFrame<'_>) -> ClockTimeDiff
[src]fn max_errors(&self) -> i32
[src]
fn max_errors(&self) -> i32
[src]Returns
currently configured decoder tolerated error count.
fn needs_format(&self) -> bool
[src]
fn needs_format(&self) -> bool
[src]fn needs_sync_point(&self) -> bool
[src]
fn needs_sync_point(&self) -> bool
[src]v1_20
only.fn is_packetized(&self) -> bool
[src]
fn is_packetized(&self) -> bool
[src]Queries whether input data is considered packetized or not by the base class.
Returns
TRUE if input data is considered packetized.
fn pending_frame_size(&self) -> usize
[src]
fn pending_frame_size(&self) -> usize
[src]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
fn qos_proportion(&self) -> f64
[src]
fn qos_proportion(&self) -> f64
[src]Returns
The current QoS proportion.
fn have_frame(&self) -> FlowReturn
[src]
fn have_frame(&self) -> FlowReturn
[src]Gathers all data collected for currently parsed frame, gathers corresponding
metadata and passes it along for further processing, i.e. handle_frame
.
Returns
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
fn request_sync_point(
&self,
frame: &VideoCodecFrame<'_>,
flags: VideoDecoderRequestSyncPointFlags
)
[src]
fn request_sync_point(
&self,
frame: &VideoCodecFrame<'_>,
flags: VideoDecoderRequestSyncPointFlags
)
[src]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:
- If
VideoDecoderRequestSyncPointFlags::DISCARD_INPUT
is selected then all following input frames until the next sync point are discarded. This can be useful if the lack of a sync point will prevent all further decoding and the decoder implementation is not very robust in handling missing references frames. - If
VideoDecoderRequestSyncPointFlags::CORRUPT_OUTPUT
is selected then all output frames followingframe
are marked as corrupted viaGST_BUFFER_FLAG_CORRUPTED
. Corrupted frames can be automatically dropped by the base class, seeproperty::VideoDecoder::discard-corrupted-frames
. Subclasses can manually mark frames as corrupted viaVideoCodecFrameFlags::CORRUPTED
before callingVideoDecoderExtManual::finish_frame()
.
frame
flags
fn set_estimate_rate(&self, enabled: bool)
[src]
fn set_estimate_rate(&self, enabled: bool)
[src]Allows baseclass to perform byte to time estimated conversion.
enabled
whether to enable byte to time conversion
fn set_max_errors(&self, num: i32)
[src]
fn set_max_errors(&self, num: i32)
[src]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
fn set_needs_format(&self, enabled: bool)
[src]
fn set_needs_format(&self, enabled: bool)
[src]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
fn set_needs_sync_point(&self, enabled: bool)
[src]
fn set_needs_sync_point(&self, enabled: bool)
[src]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
fn set_packetized(&self, packetized: bool)
[src]
fn set_packetized(&self, packetized: bool)
[src]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.
fn set_use_default_pad_acceptcaps(&self, use_: bool)
[src]
fn set_use_default_pad_acceptcaps(&self, use_: bool)
[src]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
fn is_discard_corrupted_frames(&self) -> bool
[src]
fn is_discard_corrupted_frames(&self) -> bool
[src]v1_20
only.If set to true
the decoder will discard frames that are marked as
corrupted instead of outputting them.
fn set_discard_corrupted_frames(&self, discard_corrupted_frames: bool)
[src]
fn set_discard_corrupted_frames(&self, discard_corrupted_frames: bool)
[src]v1_20
only.If set to true
the decoder will discard frames that are marked as
corrupted instead of outputting them.
fn min_force_key_unit_interval(&self) -> u64
[src]
fn min_force_key_unit_interval(&self) -> u64
[src]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.
fn set_min_force_key_unit_interval(&self, min_force_key_unit_interval: u64)
[src]
fn set_min_force_key_unit_interval(&self, min_force_key_unit_interval: u64)
[src]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.
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.
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.
fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_20
only.fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_18
only.fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_20
only.fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_18
only.Implementors
v1_20
only.fn request_sync_point(
&self,
frame: &VideoCodecFrame<'_>,
flags: VideoDecoderRequestSyncPointFlags
)
[src]
fn request_sync_point(
&self,
frame: &VideoCodecFrame<'_>,
flags: VideoDecoderRequestSyncPointFlags
)
[src]v1_20
only.v1_20
only.v1_20
only.v1_20
only.v1_20
only.v1_20
only.fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_20
only.fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_18
only.fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_20
only.v1_18
only.