Trait gstreamer_video::prelude::VideoDecoderExtManual

source ·
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§

source

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

a VideoCodecFrame

§Returns

gst::FlowReturn::Ok if an output buffer could be allocated

source

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.

source

fn frames(&self) -> Vec<VideoCodecFrame<'_>>

Get all pending unfinished VideoCodecFrame

§Returns

pending unfinished VideoCodecFrame.

source

fn oldest_frame(&self) -> Option<VideoCodecFrame<'_>>

Get the oldest pending unfinished VideoCodecFrame

§Returns

oldest pending unfinished VideoCodecFrame.

source

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

source

fn latency(&self) -> (ClockTime, Option<ClockTime>)

Query the configured decoder latency. Results will be returned via min_latency and max_latency.

§Returns
§min_latency

address of variable in which to store the configured minimum latency, or None

§max_latency

address of variable in which to store the configured mximum latency, or None

source

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

source

fn output_state(&self) -> Option<VideoCodecState<'static, Readable>>

Get the VideoCodecState currently describing the output stream.

§Returns

VideoCodecState describing format of video data.

source

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

a VideoFormat

§width

The width in pixels

§height

The height in pixels

§reference

An optional reference VideoCodecState

§Returns

the newly configured output state.

source

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

a VideoFormat

§interlace_mode

A VideoInterlaceMode

§width

The width in pixels

§height

The height in pixels

§reference

An optional reference VideoCodecState

§Returns

the newly configured output state.

source

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.

§Returns

true if the negotiation succeeded, else false.

source

fn error<T: MessageErrorDomain>( &self, weight: i32, code: T, message: Option<&str>, debug: Option<&str>, file: &str, function: &str, line: u32, ) -> Result<FlowSuccess, FlowError>

source

fn sink_pad(&self) -> &Pad

source

fn src_pad(&self) -> &Pad

source

fn input_segment(&self) -> Segment

source

fn output_segment(&self) -> Segment

Object Safety§

This trait is not object safe.

Implementors§