Trait gstreamer_video::subclass::prelude::VideoDecoderImpl
source · pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl {
Show 19 methods
// Provided methods
fn open(&self) -> Result<(), ErrorMessage> { ... }
fn close(&self) -> Result<(), ErrorMessage> { ... }
fn start(&self) -> Result<(), ErrorMessage> { ... }
fn stop(&self) -> Result<(), ErrorMessage> { ... }
fn finish(&self) -> Result<FlowSuccess, FlowError> { ... }
fn drain(&self) -> Result<FlowSuccess, FlowError> { ... }
fn set_format(
&self,
state: &VideoCodecState<'static, Readable>,
) -> Result<(), LoggableError> { ... }
fn parse(
&self,
frame: &VideoCodecFrame<'_>,
adapter: &Adapter,
at_eos: bool,
) -> Result<FlowSuccess, FlowError> { ... }
fn handle_frame(
&self,
frame: VideoCodecFrame<'_>,
) -> Result<FlowSuccess, FlowError> { ... }
fn flush(&self) -> bool { ... }
fn negotiate(&self) -> Result<(), LoggableError> { ... }
fn caps(&self, filter: Option<&Caps>) -> Caps { ... }
fn sink_event(&self, event: Event) -> bool { ... }
fn sink_query(&self, query: &mut QueryRef) -> bool { ... }
fn src_event(&self, event: Event) -> bool { ... }
fn src_query(&self, query: &mut QueryRef) -> bool { ... }
fn propose_allocation(
&self,
query: &mut Allocation,
) -> Result<(), LoggableError> { ... }
fn decide_allocation(
&self,
query: &mut Allocation,
) -> Result<(), LoggableError> { ... }
fn handle_missing_data(
&self,
timestamp: ClockTime,
duration: Option<ClockTime>,
) -> bool { ... }
}
Provided Methods§
sourcefn open(&self) -> Result<(), ErrorMessage>
fn open(&self) -> Result<(), ErrorMessage>
Optional. Called when the element changes to GST_STATE_READY. Allows opening external resources.
sourcefn close(&self) -> Result<(), ErrorMessage>
fn close(&self) -> Result<(), ErrorMessage>
Optional. Called when the element changes to GST_STATE_NULL. Allows closing external resources.
sourcefn start(&self) -> Result<(), ErrorMessage>
fn start(&self) -> Result<(), ErrorMessage>
Optional. Called when the element starts processing. Allows opening external resources.
sourcefn stop(&self) -> Result<(), ErrorMessage>
fn stop(&self) -> Result<(), ErrorMessage>
Optional. Called when the element stops processing. Allows closing external resources.
sourcefn finish(&self) -> Result<FlowSuccess, FlowError>
fn finish(&self) -> Result<FlowSuccess, FlowError>
Optional. Called to request subclass to dispatch any pending remaining data at EOS. Sub-classes can refuse to decode new data after.
sourcefn drain(&self) -> Result<FlowSuccess, FlowError>
fn drain(&self) -> Result<FlowSuccess, FlowError>
Optional. Called to request subclass to decode any data it can at this point, but that more data may arrive after. (e.g. at segment end). Sub-classes should be prepared to handle new data afterward, or seamless segment processing will break. Since: 1.6
sourcefn set_format(
&self,
state: &VideoCodecState<'static, Readable>,
) -> Result<(), LoggableError>
fn set_format( &self, state: &VideoCodecState<'static, Readable>, ) -> Result<(), LoggableError>
Notifies subclass of incoming data format (caps).
sourcefn parse(
&self,
frame: &VideoCodecFrame<'_>,
adapter: &Adapter,
at_eos: bool,
) -> Result<FlowSuccess, FlowError>
fn parse( &self, frame: &VideoCodecFrame<'_>, adapter: &Adapter, at_eos: bool, ) -> Result<FlowSuccess, FlowError>
Required for non-packetized input. Allows chopping incoming data into manageable units (frames) for subsequent decoding.
sourcefn handle_frame(
&self,
frame: VideoCodecFrame<'_>,
) -> Result<FlowSuccess, FlowError>
fn handle_frame( &self, frame: VideoCodecFrame<'_>, ) -> Result<FlowSuccess, FlowError>
§frame
The frame to handle
sourcefn flush(&self) -> bool
fn flush(&self) -> bool
Optional. Flush all remaining data from the decoder without pushing it downstream. Since: 1.2
sourcefn negotiate(&self) -> Result<(), LoggableError>
fn negotiate(&self) -> Result<(), LoggableError>
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
fn caps(&self, filter: Option<&Caps>) -> Caps
sourcefn sink_event(&self, event: Event) -> bool
fn sink_event(&self, event: Event) -> bool
Optional. Event handler on the sink pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref’ed). Subclasses should chain up to the parent implementation to invoke the default handler.
sourcefn sink_query(&self, query: &mut QueryRef) -> bool
fn sink_query(&self, query: &mut QueryRef) -> bool
Optional. Query handler on the sink pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4
sourcefn src_event(&self, event: Event) -> bool
fn src_event(&self, event: Event) -> bool
Optional. Event handler on the source pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref’ed). Subclasses should chain up to the parent implementation to invoke the default handler.
sourcefn src_query(&self, query: &mut QueryRef) -> bool
fn src_query(&self, query: &mut QueryRef) -> bool
Optional. Query handler on the source pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4
sourcefn propose_allocation(
&self,
query: &mut Allocation,
) -> Result<(), LoggableError>
fn propose_allocation( &self, query: &mut Allocation, ) -> Result<(), LoggableError>
Optional. Propose buffer allocation parameters for upstream elements. Subclasses should chain up to the parent implementation to invoke the default handler.
sourcefn decide_allocation(&self, query: &mut Allocation) -> Result<(), LoggableError>
fn decide_allocation(&self, query: &mut Allocation) -> Result<(), LoggableError>
Optional. Setup the allocation parameters for allocating output buffers. The passed in query contains the result of the downstream allocation query. Subclasses should chain up to the parent implementation to invoke the default handler.