pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl {
const MODE: BaseTransformMode;
const PASSTHROUGH_ON_SAME_CAPS: bool;
const TRANSFORM_IP_ON_PASSTHROUGH: bool;
Show 22 methods
// Provided methods
fn start(&self) -> Result<(), ErrorMessage> { ... }
fn stop(&self) -> Result<(), ErrorMessage> { ... }
fn transform_caps(
&self,
direction: PadDirection,
caps: &Caps,
filter: Option<&Caps>,
) -> Option<Caps> { ... }
fn fixate_caps(
&self,
direction: PadDirection,
caps: &Caps,
othercaps: Caps,
) -> Caps { ... }
fn set_caps(
&self,
incaps: &Caps,
outcaps: &Caps,
) -> Result<(), LoggableError> { ... }
fn accept_caps(&self, direction: PadDirection, caps: &Caps) -> bool { ... }
fn query(&self, direction: PadDirection, query: &mut QueryRef) -> bool { ... }
fn transform_size(
&self,
direction: PadDirection,
caps: &Caps,
size: usize,
othercaps: &Caps,
) -> Option<usize> { ... }
fn unit_size(&self, caps: &Caps) -> Option<usize> { ... }
fn sink_event(&self, event: Event) -> bool { ... }
fn src_event(&self, event: Event) -> bool { ... }
fn prepare_output_buffer(
&self,
inbuf: InputBuffer<'_>,
) -> Result<PrepareOutputBufferSuccess, FlowError> { ... }
fn transform(
&self,
inbuf: &Buffer,
outbuf: &mut BufferRef,
) -> Result<FlowSuccess, FlowError> { ... }
fn transform_ip(
&self,
buf: &mut BufferRef,
) -> Result<FlowSuccess, FlowError> { ... }
fn transform_ip_passthrough(
&self,
buf: &Buffer,
) -> Result<FlowSuccess, FlowError> { ... }
fn propose_allocation(
&self,
decide_query: Option<&Allocation>,
query: &mut Allocation,
) -> Result<(), LoggableError> { ... }
fn decide_allocation(
&self,
query: &mut Allocation,
) -> Result<(), LoggableError> { ... }
fn copy_metadata(
&self,
inbuf: &BufferRef,
outbuf: &mut BufferRef,
) -> Result<(), LoggableError> { ... }
fn transform_meta<'a>(
&self,
outbuf: &mut BufferRef,
meta: MetaRef<'a, Meta>,
inbuf: &'a BufferRef,
) -> bool { ... }
fn before_transform(&self, inbuf: &BufferRef) { ... }
fn submit_input_buffer(
&self,
is_discont: bool,
inbuf: Buffer,
) -> Result<FlowSuccess, FlowError> { ... }
fn generate_output(&self) -> Result<GenerateOutputSuccess, FlowError> { ... }
}
Required Associated Constants§
const MODE: BaseTransformMode
const PASSTHROUGH_ON_SAME_CAPS: bool
const TRANSFORM_IP_ON_PASSTHROUGH: bool
Provided Methods§
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 transform_caps(
&self,
direction: PadDirection,
caps: &Caps,
filter: Option<&Caps>,
) -> Option<Caps>
fn transform_caps( &self, direction: PadDirection, caps: &Caps, filter: Option<&Caps>, ) -> Option<Caps>
Optional. Given the pad in this direction and the given caps, what caps are allowed on the other pad in this element ?
fn fixate_caps( &self, direction: PadDirection, caps: &Caps, othercaps: Caps, ) -> Caps
sourcefn set_caps(&self, incaps: &Caps, outcaps: &Caps) -> Result<(), LoggableError>
fn set_caps(&self, incaps: &Caps, outcaps: &Caps) -> Result<(), LoggableError>
Allows the subclass to be notified of the actual caps set.
sourcefn accept_caps(&self, direction: PadDirection, caps: &Caps) -> bool
fn accept_caps(&self, direction: PadDirection, caps: &Caps) -> bool
Optional.
Subclasses can override this method to check if caps
can be
handled by the element. The default implementation might not be
the most optimal way to check this in all cases.
sourcefn query(&self, direction: PadDirection, query: &mut QueryRef) -> bool
fn query(&self, direction: PadDirection, query: &mut QueryRef) -> bool
Optional. Handle a requested query. Subclasses that implement this must chain up to the parent if they didn’t handle the query
fn transform_size( &self, direction: PadDirection, caps: &Caps, size: usize, othercaps: &Caps, ) -> Option<usize>
fn unit_size(&self, caps: &Caps) -> Option<usize>
fn sink_event(&self, event: Event) -> bool
fn src_event(&self, event: Event) -> bool
fn prepare_output_buffer( &self, inbuf: InputBuffer<'_>, ) -> Result<PrepareOutputBufferSuccess, FlowError>
sourcefn transform(
&self,
inbuf: &Buffer,
outbuf: &mut BufferRef,
) -> Result<FlowSuccess, FlowError>
fn transform( &self, inbuf: &Buffer, outbuf: &mut BufferRef, ) -> Result<FlowSuccess, FlowError>
Required if the element does not operate in-place. Transforms one incoming buffer to one outgoing buffer. The function is allowed to change size/timestamp/duration of the outgoing buffer.
sourcefn transform_ip(&self, buf: &mut BufferRef) -> Result<FlowSuccess, FlowError>
fn transform_ip(&self, buf: &mut BufferRef) -> Result<FlowSuccess, FlowError>
Required if the element operates in-place. Transform the incoming buffer in-place.
fn transform_ip_passthrough( &self, buf: &Buffer, ) -> Result<FlowSuccess, FlowError>
sourcefn propose_allocation(
&self,
decide_query: Option<&Allocation>,
query: &mut Allocation,
) -> Result<(), LoggableError>
fn propose_allocation( &self, decide_query: Option<&Allocation>, query: &mut Allocation, ) -> Result<(), LoggableError>
Propose buffer allocation parameters for upstream elements.
This function must be implemented if the element reads or
writes the buffer content. The query that was passed to
the decide_allocation is passed in this method (or None
when the element is in passthrough mode). The default
implementation will pass the query downstream when in
passthrough mode and will copy all the filtered metadata
API in non-passthrough mode.
sourcefn decide_allocation(&self, query: &mut Allocation) -> Result<(), LoggableError>
fn decide_allocation(&self, query: &mut Allocation) -> Result<(), LoggableError>
Setup the allocation parameters for allocating output
buffers. The passed in query contains the result of the
downstream allocation query. This function is only called
when not operating in passthrough mode. The default
implementation will remove all memory dependent metadata.
If there is a filter_meta
method implementation, it will
be called for all metadata API in the downstream query,
otherwise the metadata API is removed.
sourcefn copy_metadata(
&self,
inbuf: &BufferRef,
outbuf: &mut BufferRef,
) -> Result<(), LoggableError>
fn copy_metadata( &self, inbuf: &BufferRef, outbuf: &mut BufferRef, ) -> Result<(), LoggableError>
Optional. Copy the metadata from the input buffer to the output buffer. The default implementation will copy the flags, timestamps and offsets of the buffer.
sourcefn transform_meta<'a>(
&self,
outbuf: &mut BufferRef,
meta: MetaRef<'a, Meta>,
inbuf: &'a BufferRef,
) -> bool
fn transform_meta<'a>( &self, outbuf: &mut BufferRef, meta: MetaRef<'a, Meta>, inbuf: &'a BufferRef, ) -> bool
Optional. Transform the metadata on the input buffer to the
output buffer. By default this method copies all meta without
tags. Subclasses can implement this method and return true
if
the metadata is to be copied.
sourcefn before_transform(&self, inbuf: &BufferRef)
fn before_transform(&self, inbuf: &BufferRef)
Optional. This method is called right before the base class will start processing. Dynamic properties or other delayed configuration could be performed in this method.
sourcefn submit_input_buffer(
&self,
is_discont: bool,
inbuf: Buffer,
) -> Result<FlowSuccess, FlowError>
fn submit_input_buffer( &self, is_discont: bool, inbuf: Buffer, ) -> Result<FlowSuccess, FlowError>
Function which accepts a new input buffer and pre-processes it.
The default implementation performs caps (re)negotiation, then
QoS if needed, and places the input buffer into the queued_buf
member variable. If the buffer is dropped due to QoS, it returns
GST_BASE_TRANSFORM_FLOW_DROPPED. If this input buffer is not
contiguous with any previous input buffer, then is_discont
is set to true
. (Since: 1.6)