GstBaseTransform
This base class is for filter elements that process data. Elements that are suitable for implementation using GstBaseTransform are ones where the size and caps of the output is known entirely from the input caps and buffer sizes. These include elements that directly transform one buffer into another, modify the contents of a buffer in-place, as well as elements that collate multiple input buffers into one output buffer, or that expand one input buffer into multiple output buffers. See below for more concrete use cases.
It provides for:
-
one sinkpad and one srcpad
-
Possible formats on sink and source pad implemented with custom transform_caps function. By default uses same format on sink and source.
-
Handles state changes
-
Does flushing
-
Push mode
-
Pull mode if the sub-class transform can operate on arbitrary data
Use Cases
Passthrough mode
-
Element has no interest in modifying the buffer. It may want to inspect it, in which case the element should have a transform_ip function. If there is no transform_ip function in passthrough mode, the buffer is pushed intact.
-
The passthrough_on_same_caps variable will automatically set/unset passthrough based on whether the element negotiates the same caps on both pads.
-
passthrough_on_same_caps on an element that doesn't implement a transform_caps function is useful for elements that only inspect data (such as level)
-
Example elements
- Level
- Videoscale, audioconvert, videoconvert, audioresample in certain modes.
Modifications in-place - input buffer and output buffer are the same thing.
-
The element must implement a transform_ip function.
-
Output buffer size must <= input buffer size
-
If the always_in_place flag is set, non-writable buffers will be copied and passed to the transform_ip function, otherwise a new buffer will be created and the transform function called.
-
Incoming writable buffers will be passed to the transform_ip function immediately.
-
only implementing transform_ip and not transform implies always_in_place = TRUE
- Example elements:
- Volume
- Audioconvert in certain modes (signed/unsigned conversion)
- videoconvert in certain modes (endianness swapping)
- Example elements:
Modifications only to the caps/metadata of a buffer
-
The element does not require writable data, but non-writable buffers should be subbuffered so that the meta-information can be replaced.
-
Elements wishing to operate in this mode should replace the prepare_output_buffer method to create subbuffers of the input buffer and set always_in_place to TRUE
-
Example elements
- Capsfilter when setting caps on outgoing buffers that have none.
- identity when it is going to re-timestamp buffers by datarate.
Normal mode
- always_in_place flag is not set, or there is no transform_ip function
- Element will receive an input buffer and output buffer to operate on.
- Output buffer is allocated by calling the prepare_output_buffer function.
- Example elements:
- Videoscale, videoconvert, audioconvert when doing scaling/conversions
Special output buffer allocations
-
Elements which need to do special allocation of their output buffers beyond allocating output buffers via the negotiated allocator or buffer pool should implement the prepare_output_buffer method.
-
Example elements:
- efence
Sub-class settable flags on GstBaseTransform
-
passthrough
- Implies that in the current configuration, the sub-class is not interested in modifying the buffers.
- Elements which are always in passthrough mode whenever the same caps has been negotiated on both pads can set the class variable passthrough_on_same_caps to have this behaviour automatically.
-
always_in_place
GstBaseTransform
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBaseTransform
The opaque GstBaseTransform data structure.
Members
element
(GstElement)
–
sinkpad
(GstPad *)
–
srcpad
(GstPad *)
–
have_segment
(gboolean)
–
segment
(GstSegment)
–
queued_buf
(GstBuffer *)
–
Class structure
GstBaseTransformClass
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.
Fields
parent_class
(GstElementClass)
–
Element parent 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.
Attributes
parent_class
(Gst.ElementClass)
–
Element parent 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.
Attributes
parent_class
(Gst.ElementClass)
–
Element parent class
GstBase.BaseTransform
GObject.Object ╰──GObject.InitiallyUnowned ╰──Gst.Object ╰──Gst.Element ╰──GstBase.BaseTransform
The opaque GstBase.BaseTransform data structure.
Members
element
(Gst.Element)
–
sinkpad
(Gst.Pad)
–
srcpad
(Gst.Pad)
–
have_segment
(Number)
–
segment
(Gst.Segment)
–
queued_buf
(Gst.Buffer)
–
GstBase.BaseTransform
GObject.Object ╰──GObject.InitiallyUnowned ╰──Gst.Object ╰──Gst.Element ╰──GstBase.BaseTransform
The opaque GstBase.BaseTransform data structure.
Members
element
(Gst.Element)
–
sinkpad
(Gst.Pad)
–
srcpad
(Gst.Pad)
–
have_segment
(bool)
–
segment
(Gst.Segment)
–
queued_buf
(Gst.Buffer)
–
Methods
gst_base_transform_get_allocator
gst_base_transform_get_allocator (GstBaseTransform * trans, GstAllocator ** allocator, GstAllocationParams * params)
Lets GstBaseTransform sub-classes know the memory allocator used by the base class and its params.
Unref the allocator after use.
Parameters:
trans
–
allocator
(
[out][optional][nullable][transfer: full])
–
the GstAllocator used
params
(
[out][optional])
–
the GstAllocationParams of allocator
GstBase.BaseTransform.prototype.get_allocator
function GstBase.BaseTransform.prototype.get_allocator(): {
// javascript wrapper for 'gst_base_transform_get_allocator'
}
Lets GstBase.BaseTransform sub-classes know the memory allocator used by the base class and its params.
Unref the allocator after use.
Parameters:
GstBase.BaseTransform.get_allocator
def GstBase.BaseTransform.get_allocator (self):
#python wrapper for 'gst_base_transform_get_allocator'
Lets GstBase.BaseTransform sub-classes know the memory allocator used by the base class and its params.
Unref the allocator after use.
Parameters:
gst_base_transform_get_buffer_pool
GstBufferPool * gst_base_transform_get_buffer_pool (GstBaseTransform * trans)
Parameters:
trans
–
the instance of the GstBufferPool used by trans; free it after use
GstBase.BaseTransform.prototype.get_buffer_pool
function GstBase.BaseTransform.prototype.get_buffer_pool(): {
// javascript wrapper for 'gst_base_transform_get_buffer_pool'
}
Parameters:
the instance of the Gst.BufferPool used by trans; free it after use
GstBase.BaseTransform.get_buffer_pool
def GstBase.BaseTransform.get_buffer_pool (self):
#python wrapper for 'gst_base_transform_get_buffer_pool'
Parameters:
the instance of the Gst.BufferPool used by trans; free it after use
gst_base_transform_is_in_place
gboolean gst_base_transform_is_in_place (GstBaseTransform * trans)
See if trans is configured as a in_place transform.
Parameters:
trans
–
the GstBaseTransform to query
GstBase.BaseTransform.prototype.is_in_place
function GstBase.BaseTransform.prototype.is_in_place(): {
// javascript wrapper for 'gst_base_transform_is_in_place'
}
See if trans is configured as a in_place transform.
Parameters:
the GstBase.BaseTransform to query
GstBase.BaseTransform.is_in_place
def GstBase.BaseTransform.is_in_place (self):
#python wrapper for 'gst_base_transform_is_in_place'
See if trans is configured as a in_place transform.
Parameters:
the GstBase.BaseTransform to query
gst_base_transform_is_passthrough
gboolean gst_base_transform_is_passthrough (GstBaseTransform * trans)
See if trans is configured as a passthrough transform.
Parameters:
trans
–
the GstBaseTransform to query
GstBase.BaseTransform.prototype.is_passthrough
function GstBase.BaseTransform.prototype.is_passthrough(): {
// javascript wrapper for 'gst_base_transform_is_passthrough'
}
See if trans is configured as a passthrough transform.
Parameters:
the GstBase.BaseTransform to query
GstBase.BaseTransform.is_passthrough
def GstBase.BaseTransform.is_passthrough (self):
#python wrapper for 'gst_base_transform_is_passthrough'
See if trans is configured as a passthrough transform.
Parameters:
the GstBase.BaseTransform to query
gst_base_transform_is_qos_enabled
gboolean gst_base_transform_is_qos_enabled (GstBaseTransform * trans)
Queries if the transform will handle QoS.
Parameters:
trans
–
GstBase.BaseTransform.prototype.is_qos_enabled
function GstBase.BaseTransform.prototype.is_qos_enabled(): {
// javascript wrapper for 'gst_base_transform_is_qos_enabled'
}
Queries if the transform will handle QoS.
Parameters:
GstBase.BaseTransform.is_qos_enabled
def GstBase.BaseTransform.is_qos_enabled (self):
#python wrapper for 'gst_base_transform_is_qos_enabled'
Queries if the transform will handle QoS.
Parameters:
gst_base_transform_reconfigure
gboolean gst_base_transform_reconfigure (GstBaseTransform * trans)
Negotiates src pad caps with downstream elements if the source pad is marked as needing reconfiguring. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again if negotiation fails.
Do not call this in the transform or transform_ip vmethod. Call this in submit_input_buffer, prepare_output_buffer or in generate_output before any output buffer is allocated.
It will be default be called when handling an ALLOCATION query or at the very beginning of the default submit_input_buffer implementation.
Parameters:
trans
–
the GstBaseTransform to set
Since : 1.18
GstBase.BaseTransform.prototype.reconfigure
function GstBase.BaseTransform.prototype.reconfigure(): {
// javascript wrapper for 'gst_base_transform_reconfigure'
}
Negotiates src pad caps with downstream elements if the source pad is marked as needing reconfiguring. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again if negotiation fails.
Do not call this in the vfunc_transform or vfunc_transform_ip vmethod. Call this in vfunc_submit_input_buffer, vfunc_prepare_output_buffer or in vfunc_generate_output before any output buffer is allocated.
It will be default be called when handling an ALLOCATION query or at the very beginning of the default vfunc_submit_input_buffer implementation.
Parameters:
the GstBase.BaseTransform to set
Since : 1.18
GstBase.BaseTransform.reconfigure
def GstBase.BaseTransform.reconfigure (self):
#python wrapper for 'gst_base_transform_reconfigure'
Negotiates src pad caps with downstream elements if the source pad is marked as needing reconfiguring. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again if negotiation fails.
Do not call this in the do_transform or do_transform_ip vmethod. Call this in do_submit_input_buffer, do_prepare_output_buffer or in do_generate_output before any output buffer is allocated.
It will be default be called when handling an ALLOCATION query or at the very beginning of the default do_submit_input_buffer implementation.
Parameters:
the GstBase.BaseTransform to set
Since : 1.18
gst_base_transform_reconfigure_sink
gst_base_transform_reconfigure_sink (GstBaseTransform * trans)
Instructs trans to request renegotiation upstream. This function is typically called after properties on the transform were set that influence the input format.
Parameters:
trans
–
GstBase.BaseTransform.prototype.reconfigure_sink
function GstBase.BaseTransform.prototype.reconfigure_sink(): {
// javascript wrapper for 'gst_base_transform_reconfigure_sink'
}
Instructs trans to request renegotiation upstream. This function is typically called after properties on the transform were set that influence the input format.
Parameters:
GstBase.BaseTransform.reconfigure_sink
def GstBase.BaseTransform.reconfigure_sink (self):
#python wrapper for 'gst_base_transform_reconfigure_sink'
Instructs trans to request renegotiation upstream. This function is typically called after properties on the transform were set that influence the input format.
Parameters:
gst_base_transform_reconfigure_src
gst_base_transform_reconfigure_src (GstBaseTransform * trans)
Instructs trans to renegotiate a new downstream transform on the next buffer. This function is typically called after properties on the transform were set that influence the output format.
Parameters:
trans
–
GstBase.BaseTransform.prototype.reconfigure_src
function GstBase.BaseTransform.prototype.reconfigure_src(): {
// javascript wrapper for 'gst_base_transform_reconfigure_src'
}
Instructs trans to renegotiate a new downstream transform on the next buffer. This function is typically called after properties on the transform were set that influence the output format.
Parameters:
GstBase.BaseTransform.reconfigure_src
def GstBase.BaseTransform.reconfigure_src (self):
#python wrapper for 'gst_base_transform_reconfigure_src'
Instructs trans to renegotiate a new downstream transform on the next buffer. This function is typically called after properties on the transform were set that influence the output format.
Parameters:
gst_base_transform_set_gap_aware
gst_base_transform_set_gap_aware (GstBaseTransform * trans, gboolean gap_aware)
If gap_aware is FALSE (the default), output buffers will have the GST_BUFFER_FLAG_GAP flag unset.
If set to TRUE, the element must handle output buffers with this flag set correctly, i.e. it can assume that the buffer contains neutral data but must unset the flag if the output is no neutral data.
MT safe.
GstBase.BaseTransform.prototype.set_gap_aware
function GstBase.BaseTransform.prototype.set_gap_aware(gap_aware: Number): {
// javascript wrapper for 'gst_base_transform_set_gap_aware'
}
If gap_aware is false (the default), output buffers will have the Gst.BufferFlags.GAP flag unset.
If set to true, the element must handle output buffers with this flag set correctly, i.e. it can assume that the buffer contains neutral data but must unset the flag if the output is no neutral data.
MT safe.
GstBase.BaseTransform.set_gap_aware
def GstBase.BaseTransform.set_gap_aware (self, gap_aware):
#python wrapper for 'gst_base_transform_set_gap_aware'
If gap_aware is False (the default), output buffers will have the Gst.BufferFlags.GAP flag unset.
If set to True, the element must handle output buffers with this flag set correctly, i.e. it can assume that the buffer contains neutral data but must unset the flag if the output is no neutral data.
MT safe.
gst_base_transform_set_in_place
gst_base_transform_set_in_place (GstBaseTransform * trans, gboolean in_place)
Determines whether a non-writable buffer will be copied before passing to the transform_ip function.
- Always TRUE if no transform function is implemented.
- Always FALSE if ONLY transform function is implemented.
MT safe.
Parameters:
trans
–
the GstBaseTransform to modify
in_place
–
Boolean value indicating that we would like to operate on in_place buffers.
GstBase.BaseTransform.prototype.set_in_place
function GstBase.BaseTransform.prototype.set_in_place(in_place: Number): {
// javascript wrapper for 'gst_base_transform_set_in_place'
}
Determines whether a non-writable buffer will be copied before passing to the transform_ip function.
- Always true if no transform function is implemented.
- Always false if ONLY transform function is implemented.
MT safe.
Parameters:
the GstBase.BaseTransform to modify
Boolean value indicating that we would like to operate on in_place buffers.
GstBase.BaseTransform.set_in_place
def GstBase.BaseTransform.set_in_place (self, in_place):
#python wrapper for 'gst_base_transform_set_in_place'
Determines whether a non-writable buffer will be copied before passing to the transform_ip function.
- Always True if no transform function is implemented.
- Always False if ONLY transform function is implemented.
MT safe.
Parameters:
the GstBase.BaseTransform to modify
Boolean value indicating that we would like to operate on in_place buffers.
gst_base_transform_set_passthrough
gst_base_transform_set_passthrough (GstBaseTransform * trans, gboolean passthrough)
Set passthrough mode for this filter by default. This is mostly useful for filters that do not care about negotiation.
Always TRUE for filters which don't implement either a transform or transform_ip or generate_output method.
MT safe.
GstBase.BaseTransform.prototype.set_passthrough
function GstBase.BaseTransform.prototype.set_passthrough(passthrough: Number): {
// javascript wrapper for 'gst_base_transform_set_passthrough'
}
Set passthrough mode for this filter by default. This is mostly useful for filters that do not care about negotiation.
Always true for filters which don't implement either a transform or transform_ip or generate_output method.
MT safe.
GstBase.BaseTransform.set_passthrough
def GstBase.BaseTransform.set_passthrough (self, passthrough):
#python wrapper for 'gst_base_transform_set_passthrough'
Set passthrough mode for this filter by default. This is mostly useful for filters that do not care about negotiation.
Always True for filters which don't implement either a transform or transform_ip or generate_output method.
MT safe.
gst_base_transform_set_prefer_passthrough
gst_base_transform_set_prefer_passthrough (GstBaseTransform * trans, gboolean prefer_passthrough)
If prefer_passthrough is TRUE (the default), trans will check and prefer passthrough caps from the list of caps returned by the transform_caps vmethod.
If set to FALSE, the element must order the caps returned from the transform_caps function in such a way that the preferred format is first in the list. This can be interesting for transforms that can do passthrough transforms but prefer to do something else, like a capsfilter.
MT safe.
Since : 1.0.1
GstBase.BaseTransform.prototype.set_prefer_passthrough
function GstBase.BaseTransform.prototype.set_prefer_passthrough(prefer_passthrough: Number): {
// javascript wrapper for 'gst_base_transform_set_prefer_passthrough'
}
If prefer_passthrough is true (the default), trans will check and prefer passthrough caps from the list of caps returned by the transform_caps vmethod.
If set to false, the element must order the caps returned from the transform_caps function in such a way that the preferred format is first in the list. This can be interesting for transforms that can do passthrough transforms but prefer to do something else, like a capsfilter.
MT safe.
Parameters:
New state
Since : 1.0.1
GstBase.BaseTransform.set_prefer_passthrough
def GstBase.BaseTransform.set_prefer_passthrough (self, prefer_passthrough):
#python wrapper for 'gst_base_transform_set_prefer_passthrough'
If prefer_passthrough is True (the default), trans will check and prefer passthrough caps from the list of caps returned by the transform_caps vmethod.
If set to False, the element must order the caps returned from the transform_caps function in such a way that the preferred format is first in the list. This can be interesting for transforms that can do passthrough transforms but prefer to do something else, like a capsfilter.
MT safe.
Parameters:
New state
Since : 1.0.1
gst_base_transform_set_qos_enabled
gst_base_transform_set_qos_enabled (GstBaseTransform * trans, gboolean enabled)
Enable or disable QoS handling in the transform.
MT safe.
GstBase.BaseTransform.prototype.set_qos_enabled
function GstBase.BaseTransform.prototype.set_qos_enabled(enabled: Number): {
// javascript wrapper for 'gst_base_transform_set_qos_enabled'
}
Enable or disable QoS handling in the transform.
MT safe.
GstBase.BaseTransform.set_qos_enabled
def GstBase.BaseTransform.set_qos_enabled (self, enabled):
#python wrapper for 'gst_base_transform_set_qos_enabled'
Enable or disable QoS handling in the transform.
MT safe.
gst_base_transform_update_qos
gst_base_transform_update_qos (GstBaseTransform * trans, gdouble proportion, GstClockTimeDiff diff, GstClockTime timestamp)
Set the QoS parameters in the transform. This function is called internally when a QOS event is received but subclasses can provide custom information when needed.
MT safe.
Parameters:
trans
–
proportion
–
the proportion
diff
–
the diff against the clock
timestamp
–
the timestamp of the buffer generating the QoS expressed in running_time.
GstBase.BaseTransform.prototype.update_qos
function GstBase.BaseTransform.prototype.update_qos(proportion: Number, diff: Number, timestamp: Number): {
// javascript wrapper for 'gst_base_transform_update_qos'
}
Set the QoS parameters in the transform. This function is called internally when a QOS event is received but subclasses can provide custom information when needed.
MT safe.
Parameters:
the proportion
the diff against the clock
the timestamp of the buffer generating the QoS expressed in running_time.
GstBase.BaseTransform.update_qos
def GstBase.BaseTransform.update_qos (self, proportion, diff, timestamp):
#python wrapper for 'gst_base_transform_update_qos'
Set the QoS parameters in the transform. This function is called internally when a QOS event is received but subclasses can provide custom information when needed.
MT safe.
Parameters:
the proportion
the diff against the clock
the timestamp of the buffer generating the QoS expressed in running_time.
gst_base_transform_update_src_caps
gboolean gst_base_transform_update_src_caps (GstBaseTransform * trans, GstCaps * updated_caps)
Updates the srcpad caps and sends the caps downstream. This function can be used by subclasses when they have already negotiated their caps but found a change in them (or computed new information). This way, they can notify downstream about that change without losing any buffer.
Parameters:
trans
–
updated_caps
–
An updated version of the srcpad caps to be pushed downstream
Since : 1.6
GstBase.BaseTransform.prototype.update_src_caps
function GstBase.BaseTransform.prototype.update_src_caps(updated_caps: Gst.Caps): {
// javascript wrapper for 'gst_base_transform_update_src_caps'
}
Updates the srcpad caps and sends the caps downstream. This function can be used by subclasses when they have already negotiated their caps but found a change in them (or computed new information). This way, they can notify downstream about that change without losing any buffer.
Parameters:
An updated version of the srcpad caps to be pushed downstream
Since : 1.6
GstBase.BaseTransform.update_src_caps
def GstBase.BaseTransform.update_src_caps (self, updated_caps):
#python wrapper for 'gst_base_transform_update_src_caps'
Updates the srcpad caps and sends the caps downstream. This function can be used by subclasses when they have already negotiated their caps but found a change in them (or computed new information). This way, they can notify downstream about that change without losing any buffer.
Parameters:
An updated version of the srcpad caps to be pushed downstream
Since : 1.6
Properties
Virtual Methods
accept_caps
gboolean accept_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps)
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.
Parameters:
trans
–
direction
–
caps
–
vfunc_accept_caps
function vfunc_accept_caps(trans: GstBase.BaseTransform, direction: Gst.PadDirection, caps: Gst.Caps): {
// javascript implementation of the 'accept_caps' virtual method
}
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.
Parameters:
do_accept_caps
def do_accept_caps (trans, direction, caps):
#python implementation of the 'accept_caps' virtual method
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.
Parameters:
before_transform
before_transform (GstBaseTransform * trans, GstBuffer * buffer)
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.
Parameters:
trans
–
buffer
–
vfunc_before_transform
function vfunc_before_transform(trans: GstBase.BaseTransform, buffer: Gst.Buffer): {
// javascript implementation of the 'before_transform' virtual method
}
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.
Parameters:
do_before_transform
def do_before_transform (trans, buffer):
#python implementation of the 'before_transform' virtual method
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.
Parameters:
copy_metadata
gboolean copy_metadata (GstBaseTransform * trans, GstBuffer * input, GstBuffer * outbuf)
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.
Parameters:
trans
–
input
–
outbuf
–
vfunc_copy_metadata
function vfunc_copy_metadata(trans: GstBase.BaseTransform, input: Gst.Buffer, outbuf: Gst.Buffer): {
// javascript implementation of the 'copy_metadata' virtual method
}
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.
Parameters:
do_copy_metadata
def do_copy_metadata (trans, input, outbuf):
#python implementation of the 'copy_metadata' virtual method
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.
Parameters:
decide_allocation
gboolean decide_allocation (GstBaseTransform * trans, GstQuery * query)
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.
Parameters:
trans
–
query
–
vfunc_decide_allocation
function vfunc_decide_allocation(trans: GstBase.BaseTransform, query: Gst.Query): {
// javascript implementation of the 'decide_allocation' virtual method
}
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.
Parameters:
do_decide_allocation
def do_decide_allocation (trans, query):
#python implementation of the 'decide_allocation' virtual method
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.
Parameters:
filter_meta
gboolean filter_meta (GstBaseTransform * trans, GstQuery * query, GType api, const GstStructure * params)
Return TRUE if the metadata API should be proposed in the upstream allocation query. The default implementation is NULL and will cause all metadata to be removed.
Parameters:
trans
–
query
–
api
–
params
–
vfunc_filter_meta
function vfunc_filter_meta(trans: GstBase.BaseTransform, query: Gst.Query, api: GObject.Type, params: Gst.Structure): {
// javascript implementation of the 'filter_meta' virtual method
}
Return true if the metadata API should be proposed in the upstream allocation query. The default implementation is null and will cause all metadata to be removed.
Parameters:
do_filter_meta
def do_filter_meta (trans, query, api, params):
#python implementation of the 'filter_meta' virtual method
Return True if the metadata API should be proposed in the upstream allocation query. The default implementation is None and will cause all metadata to be removed.
Parameters:
fixate_caps
GstCaps * fixate_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
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.
Parameters:
trans
–
direction
–
caps
–
othercaps
–
vfunc_fixate_caps
function vfunc_fixate_caps(trans: GstBase.BaseTransform, direction: Gst.PadDirection, caps: Gst.Caps, othercaps: Gst.Caps): {
// javascript implementation of the 'fixate_caps' virtual method
}
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.
Parameters:
do_fixate_caps
def do_fixate_caps (trans, direction, caps, othercaps):
#python implementation of the 'fixate_caps' virtual method
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.
Parameters:
generate_output
GstFlowReturn generate_output (GstBaseTransform * trans, GstBuffer ** outbuf)
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. (Since: 1.6)
Parameters:
trans
–
outbuf
–
vfunc_generate_output
function vfunc_generate_output(trans: GstBase.BaseTransform): {
// javascript implementation of the 'generate_output' virtual method
}
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. (Since: 1.6)
Parameters:
Returns a tuple made of:
do_generate_output
def do_generate_output (trans):
#python implementation of the 'generate_output' virtual method
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. (Since: 1.6)
Parameters:
Returns a tuple made of:
get_unit_size
gboolean get_unit_size (GstBaseTransform * trans, GstCaps * caps, gsize * size)
Required if the transform is not in-place. Get the size in bytes of one unit for the given caps.
Parameters:
trans
–
caps
–
size
–
vfunc_get_unit_size
function vfunc_get_unit_size(trans: GstBase.BaseTransform, caps: Gst.Caps): {
// javascript implementation of the 'get_unit_size' virtual method
}
Required if the transform is not in-place. Get the size in bytes of one unit for the given caps.
Parameters:
Returns a tuple made of:
do_get_unit_size
def do_get_unit_size (trans, caps):
#python implementation of the 'get_unit_size' virtual method
Required if the transform is not in-place. Get the size in bytes of one unit for the given caps.
Parameters:
prepare_output_buffer
GstFlowReturn prepare_output_buffer (GstBaseTransform * trans, GstBuffer * input, GstBuffer ** outbuf)
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.
Parameters:
trans
–
input
–
outbuf
–
vfunc_prepare_output_buffer
function vfunc_prepare_output_buffer(trans: GstBase.BaseTransform, input: Gst.Buffer): {
// javascript implementation of the 'prepare_output_buffer' virtual method
}
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.
Parameters:
Returns a tuple made of:
do_prepare_output_buffer
def do_prepare_output_buffer (trans, input):
#python implementation of the 'prepare_output_buffer' virtual method
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.
Parameters:
Returns a tuple made of:
propose_allocation
gboolean propose_allocation (GstBaseTransform * trans, GstQuery * decide_query, GstQuery * query)
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 NULL 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.
Parameters:
trans
–
decide_query
–
query
–
vfunc_propose_allocation
function vfunc_propose_allocation(trans: GstBase.BaseTransform, decide_query: Gst.Query, query: Gst.Query): {
// javascript implementation of the 'propose_allocation' virtual method
}
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 null 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.
Parameters:
do_propose_allocation
def do_propose_allocation (trans, decide_query, query):
#python implementation of the 'propose_allocation' virtual method
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.
Parameters:
query
gboolean query (GstBaseTransform * trans, GstPadDirection direction, GstQuery * query)
Optional. Handle a requested query. Subclasses that implement this must chain up to the parent if they didn't handle the query
Parameters:
trans
–
direction
–
query
–
vfunc_query
function vfunc_query(trans: GstBase.BaseTransform, direction: Gst.PadDirection, query: Gst.Query): {
// javascript implementation of the 'query' virtual method
}
Optional. Handle a requested query. Subclasses that implement this must chain up to the parent if they didn't handle the query
Parameters:
do_query
def do_query (trans, direction, query):
#python implementation of the 'query' virtual method
Optional. Handle a requested query. Subclasses that implement this must chain up to the parent if they didn't handle the query
Parameters:
set_caps
gboolean set_caps (GstBaseTransform * trans, GstCaps * incaps, GstCaps * outcaps)
Allows the subclass to be notified of the actual caps set.
Parameters:
trans
–
incaps
–
outcaps
–
vfunc_set_caps
function vfunc_set_caps(trans: GstBase.BaseTransform, incaps: Gst.Caps, outcaps: Gst.Caps): {
// javascript implementation of the 'set_caps' virtual method
}
Allows the subclass to be notified of the actual caps set.
Parameters:
do_set_caps
def do_set_caps (trans, incaps, outcaps):
#python implementation of the 'set_caps' virtual method
Allows the subclass to be notified of the actual caps set.
Parameters:
sink_event
gboolean sink_event (GstBaseTransform * trans, GstEvent * event)
Optional. Event handler on the sink pad. The default implementation handles the event and forwards it downstream.
Parameters:
trans
–
event
–
vfunc_sink_event
function vfunc_sink_event(trans: GstBase.BaseTransform, event: Gst.Event): {
// javascript implementation of the 'sink_event' virtual method
}
Optional. Event handler on the sink pad. The default implementation handles the event and forwards it downstream.
Parameters:
do_sink_event
def do_sink_event (trans, event):
#python implementation of the 'sink_event' virtual method
Optional. Event handler on the sink pad. The default implementation handles the event and forwards it downstream.
Parameters:
src_event
gboolean src_event (GstBaseTransform * trans, GstEvent * event)
Optional. Event handler on the source pad. The default implementation handles the event and forwards it upstream.
Parameters:
trans
–
event
–
vfunc_src_event
function vfunc_src_event(trans: GstBase.BaseTransform, event: Gst.Event): {
// javascript implementation of the 'src_event' virtual method
}
Optional. Event handler on the source pad. The default implementation handles the event and forwards it upstream.
Parameters:
do_src_event
def do_src_event (trans, event):
#python implementation of the 'src_event' virtual method
Optional. Event handler on the source pad. The default implementation handles the event and forwards it upstream.
Parameters:
start
gboolean start (GstBaseTransform * trans)
Optional. Called when the element starts processing. Allows opening external resources.
Parameters:
trans
–
vfunc_start
function vfunc_start(trans: GstBase.BaseTransform): {
// javascript implementation of the 'start' virtual method
}
Optional. Called when the element starts processing. Allows opening external resources.
Parameters:
do_start
def do_start (trans):
#python implementation of the 'start' virtual method
Optional. Called when the element starts processing. Allows opening external resources.
Parameters:
stop
gboolean stop (GstBaseTransform * trans)
Optional. Called when the element stops processing. Allows closing external resources.
Parameters:
trans
–
vfunc_stop
function vfunc_stop(trans: GstBase.BaseTransform): {
// javascript implementation of the 'stop' virtual method
}
Optional. Called when the element stops processing. Allows closing external resources.
Parameters:
do_stop
def do_stop (trans):
#python implementation of the 'stop' virtual method
Optional. Called when the element stops processing. Allows closing external resources.
Parameters:
submit_input_buffer
GstFlowReturn submit_input_buffer (GstBaseTransform * trans, gboolean is_discont, GstBuffer * input)
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)
Parameters:
trans
–
is_discont
–
input
–
vfunc_submit_input_buffer
function vfunc_submit_input_buffer(trans: GstBase.BaseTransform, is_discont: Number, input: Gst.Buffer): {
// javascript implementation of the 'submit_input_buffer' virtual method
}
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)
Parameters:
do_submit_input_buffer
def do_submit_input_buffer (trans, is_discont, input):
#python implementation of the 'submit_input_buffer' virtual method
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)
Parameters:
transform
GstFlowReturn transform (GstBaseTransform * trans, GstBuffer * inbuf, GstBuffer * outbuf)
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.
Parameters:
trans
–
inbuf
–
outbuf
–
vfunc_transform
function vfunc_transform(trans: GstBase.BaseTransform, inbuf: Gst.Buffer, outbuf: Gst.Buffer): {
// javascript implementation of the 'transform' virtual method
}
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.
Parameters:
do_transform
def do_transform (trans, inbuf, outbuf):
#python implementation of the 'transform' virtual method
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.
Parameters:
transform_caps
GstCaps * transform_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps, GstCaps * filter)
Optional. Given the pad in this direction and the given caps, what caps are allowed on the other pad in this element ?
Parameters:
trans
–
direction
–
caps
–
filter
–
vfunc_transform_caps
function vfunc_transform_caps(trans: GstBase.BaseTransform, direction: Gst.PadDirection, caps: Gst.Caps, filter: Gst.Caps): {
// javascript implementation of the 'transform_caps' virtual method
}
Optional. Given the pad in this direction and the given caps, what caps are allowed on the other pad in this element ?
Parameters:
do_transform_caps
def do_transform_caps (trans, direction, caps, filter):
#python implementation of the 'transform_caps' virtual method
Optional. Given the pad in this direction and the given caps, what caps are allowed on the other pad in this element ?
Parameters:
transform_ip
GstFlowReturn transform_ip (GstBaseTransform * trans, GstBuffer * buf)
Required if the element operates in-place. Transform the incoming buffer in-place.
Parameters:
trans
–
buf
–
vfunc_transform_ip
function vfunc_transform_ip(trans: GstBase.BaseTransform, buf: Gst.Buffer): {
// javascript implementation of the 'transform_ip' virtual method
}
Required if the element operates in-place. Transform the incoming buffer in-place.
Parameters:
do_transform_ip
def do_transform_ip (trans, buf):
#python implementation of the 'transform_ip' virtual method
Required if the element operates in-place. Transform the incoming buffer in-place.
Parameters:
transform_meta
gboolean transform_meta (GstBaseTransform * trans, GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf)
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.
Parameters:
trans
–
outbuf
–
meta
–
inbuf
–
vfunc_transform_meta
function vfunc_transform_meta(trans: GstBase.BaseTransform, outbuf: Gst.Buffer, meta: Gst.Meta, inbuf: Gst.Buffer): {
// javascript implementation of the 'transform_meta' virtual method
}
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.
Parameters:
do_transform_meta
def do_transform_meta (trans, outbuf, meta, inbuf):
#python implementation of the 'transform_meta' virtual method
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.
Parameters:
transform_size
gboolean transform_size (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps, gsize size, GstCaps * othercaps, gsize * othersize)
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.
Parameters:
trans
–
direction
–
caps
–
size
–
othercaps
–
othersize
–
vfunc_transform_size
function vfunc_transform_size(trans: GstBase.BaseTransform, direction: Gst.PadDirection, caps: Gst.Caps, size: Number, othercaps: Gst.Caps): {
// javascript implementation of the 'transform_size' virtual method
}
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.
Parameters:
Returns a tuple made of:
do_transform_size
def do_transform_size (trans, direction, caps, size, othercaps):
#python implementation of the 'transform_size' virtual method
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.
Parameters:
Returns a tuple made of:
Function Macros
GST_BASE_TRANSFORM_CAST
#define GST_BASE_TRANSFORM_CAST(obj) ((GstBaseTransform *)(obj))
GST_BASE_TRANSFORM_SINK_PAD
#define GST_BASE_TRANSFORM_SINK_PAD(obj) (GST_BASE_TRANSFORM_CAST (obj)->sinkpad)
Gives the pointer to the sink GstPad object of the element.
Parameters:
obj
–
base transform instance
GST_BASE_TRANSFORM_SRC_PAD
#define GST_BASE_TRANSFORM_SRC_PAD(obj) (GST_BASE_TRANSFORM_CAST (obj)->srcpad)
Gives the pointer to the source GstPad object of the element.
Parameters:
obj
–
base transform instance
Constants
GST_BASE_TRANSFORM_FLOW_DROPPED
#define GST_BASE_TRANSFORM_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS
A GstFlowReturn that can be returned from transform and transform_ip to indicate that no output buffer was generated.
GST_BASE_TRANSFORM_SINK_NAME
#define GST_BASE_TRANSFORM_SINK_NAME "sink"
The name of the templates for the sink pad.
GstBase.BASE_TRANSFORM_SINK_NAME
The name of the templates for the sink pad.
GstBase.BASE_TRANSFORM_SINK_NAME
The name of the templates for the sink pad.
GST_BASE_TRANSFORM_SRC_NAME
#define GST_BASE_TRANSFORM_SRC_NAME "src"
The name of the templates for the source pad.
GstBase.BASE_TRANSFORM_SRC_NAME
The name of the templates for the source pad.
GstBase.BASE_TRANSFORM_SRC_NAME
The name of the templates for the source pad.
The results of the search are