gstbase.collect_pads

Module for [CollectPads] class

Types 3

Manages a set of pads that operate in collect mode. This means that control is given to the manager of this object when all pads have data.

  • Collectpads are created with [gstbase.collect_pads.CollectPads.new_]. A callback should then

be installed with gst_collect_pads_set_function ().

  • Pads are added to the collection with [gstbase.collect_pads.CollectPads.addPad]/

[gstbase.collect_pads.CollectPads.removePad]. The pad has to be a sinkpad. When added, the chain, event and query functions of the pad are overridden. The element_private of the pad is used to store private information for the collectpads.

  • For each pad, data is queued in the _chain function or by

performing a pull_range.

  • When data is queued on all pads in waiting mode, the callback function is called.
  • Data can be dequeued from the pad with the [gstbase.collect_pads.CollectPads.pop] method.

One can peek at the data with the [gstbase.collect_pads.CollectPads.peek] function. These functions will return null if the pad received an EOS event. When all pads return null from a [gstbase.collect_pads.CollectPads.peek], the element can emit an EOS event itself.

  • Data can also be dequeued in byte units using the [gstbase.collect_pads.CollectPads.available],

[gstbase.collect_pads.CollectPads.readBuffer] and [gstbase.collect_pads.CollectPads.flush] calls.

  • Elements should call [gstbase.collect_pads.CollectPads.start] and [gstbase.collect_pads.CollectPads.stop] in

their state change functions to start and stop the processing of the collectpads. The [gstbase.collect_pads.CollectPads.stop] call should be called before calling the parent element state change function in the PAUSED_TO_READY state change to ensure no pad is blocked and the element can finish streaming.

  • [gstbase.collect_pads.CollectPads.setWaiting] sets a pad to waiting or non-waiting mode.

CollectPads element is not waiting for data to be collected on non-waiting pads. Thus these pads may but need not have data when the callback is called. All pads are in waiting mode by default.

Methods
GType _gType() @property
CollectPads self()Returns `this`, for use in `with` statements.
CollectPadsGidBuilder builder()Get builder for [gstbase.collect_pads.CollectPads] Returns: New builder object
uint available()Query how much bytes can be read from each queued buffer. This means that the result of this call is the maximum number of bytes that can be read from each of the pads.
gst.types.FlowReturn clipRunningTime(gstbase.collect_data.CollectData cdata, gst.buffer.Buffer buf, out gst.buffer.Buffer outbuf, void * userData = null)Convenience clipping function that converts incoming buffer's timestamp to running time, or clips the buffer if outside configured segment.
bool eventDefault(gstbase.collect_data.CollectData data, gst.event.Event event, bool discard)Default #GstCollectPads event handling that elements should always chain up to to ensure proper operation. Element might however indicate event should not be forwarded downstream.
uint flush(gstbase.collect_data.CollectData data, uint size)Flush size bytes from the pad data.
gst.buffer.Buffer peek(gstbase.collect_data.CollectData data)Peek at the buffer currently queued in data. This function should be called with the pads STREAM_LOCK held, such as in the callback handler.
gst.buffer.Buffer pop(gstbase.collect_data.CollectData data)Pop the buffer currently queued in data. This function should be called with the pads STREAM_LOCK held, such as in the callback handler.
bool queryDefault(gstbase.collect_data.CollectData data, gst.query.Query query, bool discard)Default #GstCollectPads query handling that elements should always chain up to to ensure proper operation. Element might however indicate query should not be forwarded downstream.
gst.buffer.Buffer readBuffer(gstbase.collect_data.CollectData data, uint size)Get a subbuffer of size bytes from the given pad data.
bool removePad(gst.pad.Pad pad)Remove a pad from the collection of collect pads. This function will also free the #GstCollectData and all the resources that were allocated with [gstbase.collect_pads.CollectPads.addPad].
void setBufferFunction(gstbase.types.CollectPadsBufferFunction func)Set the callback function and user data that will be called with the oldest buffer when all pads have been collected, or null on EOS. If a buffer is passed, the callback owns a reference and must u...
void setClipFunction(gstbase.types.CollectPadsClipFunction clipfunc)Install a clipping function that is called right after a buffer is received on a pad managed by pads. See #GstCollectPadsClipFunction for more info.
void setCompareFunction(gstbase.types.CollectPadsCompareFunction func)Set the timestamp comparison function.
void setEventFunction(gstbase.types.CollectPadsEventFunction func)Set the event callback function and user data that will be called when collectpads has received an event originating from one of the collected pads. If the event being processed is a serialized on...
void setFlushFunction(gstbase.types.CollectPadsFlushFunction func)Install a flush function that is called when the internal state of all pads should be flushed as part of flushing seek handling. See #GstCollectPadsFlushFunction for more info.
void setFlushing(bool flushing)Change the flushing state of all the pads in the collection. No pad is able to accept anymore data when flushing is true. Calling this function with flushing false makes pads accept data again. Cal...
void setFunction(gstbase.types.CollectPadsFunction func)CollectPads provides a default collection algorithm that will determine the oldest buffer available on all of its pads, and then delegate to a configured callback. However, if circumstances are mor...
void setQueryFunction(gstbase.types.CollectPadsQueryFunction func)Set the query callback function and user data that will be called after collectpads has received a query originating from one of the collected pads. If the query being processed is a serialized on...
void setWaiting(gstbase.collect_data.CollectData data, bool waiting)Sets a pad to waiting or non-waiting mode, if at least this pad has not been created with locked waiting state, in which case nothing happens.
bool srcEventDefault(gst.pad.Pad pad, gst.event.Event event)Default #GstCollectPads event handling for the src pad of elements. Elements can chain up to this to let flushing seek event handling be done by #GstCollectPads.
void start()Starts the processing of data in the collect_pads.
void stop()Stops the processing of data in the collect_pads. this function will also unblock any blocking operations.
gst.buffer.Buffer takeBuffer(gstbase.collect_data.CollectData data, uint size)Get a subbuffer of size bytes from the given pad data. Flushes the amount of read bytes.
Constructors
this(void * ptr, Flag!"Take" take)
this()Create a new instance of #GstCollectPads.

Fluent builder for [gstbase.collect_pads.CollectPads]