GstBase.BaseTransformClass¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
accept_caps |
r |
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. |
|
before_transform |
r |
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. |
|
copy_metadata |
r |
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. |
|
decide_allocation |
r |
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. |
|
filter_meta |
r |
Return |
|
fixate_caps |
r |
Optional. Given the pad in this direction and the given caps, fixate the caps on the other pad. The function takes ownership of othercaps and returns a fixated version of othercaps. othercaps is not guaranteed to be writable. |
|
generate_output |
r |
Called after each new input buffer is submitted repeatedly until it either generates an error or fails to generate an output buffer. The default implementation takes the contents of the queued_buf variable, generates an output buffer if needed by calling the class prepare_output_buffer, and then calls either transform or transform_ip. Elements that don’t do 1-to-1 transformations of input to output buffers can either return GST_BASE_TRANSFORM_FLOW_DROPPED or simply not generate an output buffer until they are ready to do so. |
|
get_unit_size |
r |
Required if the transform is not in-place. Get the size in bytes of one unit for the given caps. |
|
parent_class |
r |
Element parent class |
|
passthrough_on_same_caps |
r |
If set to |
|
prepare_output_buffer |
r |
Optional. Subclasses can override this to do their own allocation of output buffers. Elements that only do analysis can return a subbuffer or even just return a reference to the input buffer (if in passthrough mode). The default implementation will use the negotiated allocator or bufferpool and transform_size to allocate an output buffer or it will return the input buffer in passthrough mode. |
|
propose_allocation |
r |
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 |
|
query |
r |
Optional. Handle a requested query. Subclasses that implement this must chain up to the parent if they didn’t handle the query |
|
set_caps |
r |
Allows the subclass to be notified of the actual caps set. |
|
sink_event |
r |
Optional. Event handler on the sink pad. The default implementation handles the event and forwards it downstream. |
|
src_event |
r |
Optional. Event handler on the source pad. The default implementation handles the event and forwards it upstream. |
|
start |
r |
Optional. Called when the element starts processing. Allows opening external resources. |
|
stop |
r |
Optional. Called when the element stops processing. Allows closing external resources. |
|
submit_input_buffer |
r |
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 |
|
transform |
r |
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. |
|
transform_caps |
r |
Optional. Given the pad in this direction and the given caps, what caps are allowed on the other pad in this element ? |
|
transform_ip |
r |
Required if the element operates in-place. Transform the incoming buffer in-place. |
|
transform_ip_on_passthrough |
r |
If set to |
|
transform_meta |
r |
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 |
|
transform_size |
r |
Optional. Given the size of a buffer in the given direction with the given caps, calculate the size in bytes of a buffer on the other pad with the given other caps. The default implementation uses get_unit_size and keeps the number of units the same. |
Methods¶
None
Details¶
- class GstBase.BaseTransformClass¶
Subclasses can override any of the available virtual methods or not, as needed. At minimum either transform or transform_ip need to be overridden. If the element can overwrite the input data with the results (data is of the same type and quantity) it should provide transform_ip.