Trait gstreamer_base::prelude::BaseParseExtManual
source · pub trait BaseParseExtManual: Sealed + IsA<BaseParse> + 'static {
// Provided methods
fn sink_pad(&self) -> &Pad { ... }
fn src_pad(&self) -> &Pad { ... }
fn segment(&self) -> Segment { ... }
fn lost_sync(&self) -> bool { ... }
fn is_draining(&self) -> bool { ... }
fn set_duration(&self, duration: impl FormattedValue, interval: u32) { ... }
fn set_frame_rate(&self, fps: Fraction, lead_in: u32, lead_out: u32) { ... }
fn convert_default<U: SpecificFormattedValueFullRange>(
&self,
src_val: impl FormattedValue,
) -> Option<U> { ... }
fn convert_default_generic(
&self,
src_val: impl FormattedValue,
dest_format: Format,
) -> Option<GenericFormattedValue> { ... }
fn finish_frame(
&self,
frame: BaseParseFrame<'_>,
size: u32,
) -> Result<FlowSuccess, FlowError> { ... }
}
Provided Methods§
fn sink_pad(&self) -> &Pad
fn src_pad(&self) -> &Pad
fn segment(&self) -> Segment
fn lost_sync(&self) -> bool
fn is_draining(&self) -> bool
sourcefn set_duration(&self, duration: impl FormattedValue, interval: u32)
fn set_duration(&self, duration: impl FormattedValue, interval: u32)
Sets the duration of the currently playing media. Subclass can use this
when it is able to determine duration and/or notices a change in the media
duration. Alternatively, if interval
is non-zero (default), then stream
duration is determined based on estimated bitrate, and updated every interval
frames.
§fmt
§duration
duration value.
§interval
how often to update the duration estimate based on bitrate, or 0.
sourcefn set_frame_rate(&self, fps: Fraction, lead_in: u32, lead_out: u32)
fn set_frame_rate(&self, fps: Fraction, lead_in: u32, lead_out: u32)
If frames per second is configured, parser can take care of buffer duration
and timestamping. When performing segment clipping, or seeking to a specific
location, a corresponding decoder might need an initial lead_in
and a
following lead_out
number of frames to ensure the desired segment is
entirely filled upon decoding.
§fps_num
frames per second (numerator).
§fps_den
frames per second (denominator).
§lead_in
frames needed before a segment for subsequent decode
§lead_out
frames needed after a segment
sourcefn convert_default<U: SpecificFormattedValueFullRange>(
&self,
src_val: impl FormattedValue,
) -> Option<U>
fn convert_default<U: SpecificFormattedValueFullRange>( &self, src_val: impl FormattedValue, ) -> Option<U>
Default implementation of GstBaseParseClass::convert
.
§src_format
gst::Format
describing the source format.
§src_value
Source value to be converted.
§dest_format
gst::Format
defining the converted format.
§Returns
true
if conversion was successful.
§dest_value
Pointer where the conversion result will be put.
fn convert_default_generic( &self, src_val: impl FormattedValue, dest_format: Format, ) -> Option<GenericFormattedValue>
sourcefn finish_frame(
&self,
frame: BaseParseFrame<'_>,
size: u32,
) -> Result<FlowSuccess, FlowError>
fn finish_frame( &self, frame: BaseParseFrame<'_>, size: u32, ) -> Result<FlowSuccess, FlowError>
Collects parsed data and pushes it downstream. Source pad caps must be set when this is called.
If frame
’s out_buffer is set, that will be used as subsequent frame data,
and size
amount will be flushed from the input data. The output_buffer size
can differ from the consumed size indicated by size
.
Otherwise, size
samples will be taken from the input and used for output,
and the output’s metadata (timestamps etc) will be taken as (optionally)
set by the subclass on frame
’s (input) buffer (which is otherwise
ignored for any but the above purpose/information).
Note that the latter buffer is invalidated by this call, whereas the
caller retains ownership of frame
.
§frame
§size
consumed input data represented by frame
§Returns
a gst::FlowReturn
that should be escalated to caller (of caller)