pub trait VideoDecoderExtManual: Sealed + IsA<VideoDecoder> + 'static {
Show 16 methods
// Provided methods
fn allocate_output_frame(
&self,
frame: &mut VideoCodecFrame<'_>,
params: Option<&BufferPoolAcquireParams>,
) -> Result<FlowSuccess, FlowError> { ... }
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame<'_>> { ... }
fn frames(&self) -> Vec<VideoCodecFrame<'_>> { ... }
fn oldest_frame(&self) -> Option<VideoCodecFrame<'_>> { ... }
fn allocator(&self) -> (Option<Allocator>, AllocationParams) { ... }
fn latency(&self) -> (ClockTime, Option<ClockTime>) { ... }
fn set_latency(
&self,
min_latency: ClockTime,
max_latency: impl Into<Option<ClockTime>>,
) { ... }
fn output_state(&self) -> Option<VideoCodecState<'static, Readable>> { ... }
fn set_output_state(
&self,
fmt: VideoFormat,
width: u32,
height: u32,
reference: Option<&VideoCodecState<'_, Readable>>,
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, FlowError> { ... }
fn set_interlaced_output_state(
&self,
fmt: VideoFormat,
mode: VideoInterlaceMode,
width: u32,
height: u32,
reference: Option<&VideoCodecState<'_, Readable>>,
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, FlowError> { ... }
fn negotiate<'a>(
&'a self,
output_state: VideoCodecState<'a, InNegotiation<'a>>,
) -> Result<(), FlowError> { ... }
fn error<T: MessageErrorDomain>(
&self,
weight: i32,
code: T,
message: Option<&str>,
debug: Option<&str>,
file: &str,
function: &str,
line: u32,
) -> Result<FlowSuccess, FlowError> { ... }
fn sink_pad(&self) -> &Pad { ... }
fn src_pad(&self) -> &Pad { ... }
fn input_segment(&self) -> Segment { ... }
fn output_segment(&self) -> Segment { ... }
}
Provided Methods§
sourcefn allocate_output_frame(
&self,
frame: &mut VideoCodecFrame<'_>,
params: Option<&BufferPoolAcquireParams>,
) -> Result<FlowSuccess, FlowError>
fn allocate_output_frame( &self, frame: &mut VideoCodecFrame<'_>, params: Option<&BufferPoolAcquireParams>, ) -> Result<FlowSuccess, FlowError>
Helper function that allocates a buffer to hold a video frame for self
’s
current VideoCodecState
. Subclass should already have configured video
state and set src pad caps.
The buffer allocated here is owned by the frame and you should only keep references to the frame, not the buffer.
§frame
§Returns
gst::FlowReturn::Ok
if an output buffer could be allocated
sourcefn frame(&self, frame_number: i32) -> Option<VideoCodecFrame<'_>>
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame<'_>>
Get a pending unfinished VideoCodecFrame
§frame_number
system_frame_number of a frame
§Returns
pending unfinished VideoCodecFrame
identified by frame_number
.
sourcefn frames(&self) -> Vec<VideoCodecFrame<'_>>
fn frames(&self) -> Vec<VideoCodecFrame<'_>>
sourcefn oldest_frame(&self) -> Option<VideoCodecFrame<'_>>
fn oldest_frame(&self) -> Option<VideoCodecFrame<'_>>
Get the oldest pending unfinished VideoCodecFrame
§Returns
oldest pending unfinished VideoCodecFrame
.
sourcefn allocator(&self) -> (Option<Allocator>, AllocationParams)
fn allocator(&self) -> (Option<Allocator>, AllocationParams)
Lets VideoDecoder
sub-classes to know the memory allocator
used by the base class and its params
.
Unref the allocator
after use it.
§Returns
§allocator
the gst::Allocator
used
§params
the
gst::AllocationParams
of allocator
sourcefn set_latency(
&self,
min_latency: ClockTime,
max_latency: impl Into<Option<ClockTime>>,
)
fn set_latency( &self, min_latency: ClockTime, max_latency: impl Into<Option<ClockTime>>, )
Lets VideoDecoder
sub-classes tell the baseclass what the decoder latency
is. If the provided values changed from previously provided ones, this will
also post a LATENCY message on the bus so the pipeline can reconfigure its
global latency.
§min_latency
minimum latency
§max_latency
maximum latency
sourcefn output_state(&self) -> Option<VideoCodecState<'static, Readable>>
fn output_state(&self) -> Option<VideoCodecState<'static, Readable>>
Get the VideoCodecState
currently describing the output stream.
§Returns
VideoCodecState
describing format of video data.
sourcefn set_output_state(
&self,
fmt: VideoFormat,
width: u32,
height: u32,
reference: Option<&VideoCodecState<'_, Readable>>,
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, FlowError>
fn set_output_state( &self, fmt: VideoFormat, width: u32, height: u32, reference: Option<&VideoCodecState<'_, Readable>>, ) -> Result<VideoCodecState<'_, InNegotiation<'_>>, FlowError>
Creates a new VideoCodecState
with the specified fmt
, width
and height
as the output state for the decoder.
Any previously set output state on self
will be replaced by the newly
created one.
If the subclass wishes to copy over existing fields (like pixel aspec ratio,
or framerate) from an existing VideoCodecState
, it can be provided as a
reference
.
If the subclass wishes to override some fields from the output state (like
pixel-aspect-ratio or framerate) it can do so on the returned VideoCodecState
.
The new output state will only take effect (set on pads and buffers) starting
from the next call to VideoDecoderExt::finish_frame()
.
§fmt
§width
The width in pixels
§height
The height in pixels
§reference
An optional reference VideoCodecState
§Returns
the newly configured output state.
sourcefn set_interlaced_output_state(
&self,
fmt: VideoFormat,
mode: VideoInterlaceMode,
width: u32,
height: u32,
reference: Option<&VideoCodecState<'_, Readable>>,
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, FlowError>
fn set_interlaced_output_state( &self, fmt: VideoFormat, mode: VideoInterlaceMode, width: u32, height: u32, reference: Option<&VideoCodecState<'_, Readable>>, ) -> Result<VideoCodecState<'_, InNegotiation<'_>>, FlowError>
Same as set_output_state()
but also allows you to also set
the interlacing mode.
§fmt
§interlace_mode
§width
The width in pixels
§height
The height in pixels
§reference
An optional reference VideoCodecState
§Returns
the newly configured output state.
sourcefn negotiate<'a>(
&'a self,
output_state: VideoCodecState<'a, InNegotiation<'a>>,
) -> Result<(), FlowError>
fn negotiate<'a>( &'a self, output_state: VideoCodecState<'a, InNegotiation<'a>>, ) -> Result<(), FlowError>
Negotiate with downstream elements to currently configured VideoCodecState
.
Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if
negotiate fails.