Class: GstBase::CollectPads
- Inherits:
-
Gst::Object
- Object
- GObject::InitiallyUnowned
- Gst::Object
- GstBase::CollectPads
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#add_pad(pad, size, destroy_notify, lock) ⇒ GstBase::CollectData
Add a pad to the collection of collect pads.
-
#available ⇒ Integer
Query how much bytes can be read from each queued buffer.
-
#clip_running_time(cdata, buf, outbuf, user_data) ⇒ Gst::FlowReturn
Convenience clipping function that converts incoming buffer's timestamp to running time, or clips the buffer if outside configured segment.
-
#event_default(data, event, discard) ⇒ Boolean
Default Gst::CollectPads event handling that elements should always chain up to to ensure proper operation.
-
#flush(data, size) ⇒ Integer
Flush size bytes from the pad data.
-
#flushing=(flushing) ⇒ nil
Change the flushing state of all the pads in the collection.
-
#initialize ⇒ GstBase::CollectPads
constructor
Create a new instance of Gst::CollectPads.
-
#peek(data) ⇒ Gst::Buffer
Peek at the buffer currently queued in data.
-
#pop(data) ⇒ Gst::Buffer
Pop the buffer currently queued in data.
-
#query_default(data, query, discard) ⇒ Boolean
Default Gst::CollectPads query handling that elements should always chain up to to ensure proper operation.
-
#read_buffer(data, size) ⇒ Gst::Buffer
Get a subbuffer of size bytes from the given pad data.
-
#remove_pad(pad) ⇒ Boolean
Remove a pad from the collection of collect pads.
-
#set_buffer_function(func, user_data) ⇒ nil
Set the callback function and user data that will be called with the oldest buffer when all pads have been collected, or nil on EOS.
-
#set_clip_function(clipfunc, user_data) ⇒ nil
Install a clipping function that is called right after a buffer is received on a pad managed by pads.
-
#set_compare_function(func, user_data) ⇒ nil
Set the timestamp comparison function.
-
#set_event_function(func, user_data) ⇒ nil
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.
-
#set_flush_function(func, user_data) ⇒ nil
Install a flush function that is called when the internal state of all pads should be flushed as part of flushing seek handling.
-
#set_function(func, user_data) ⇒ nil
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.
-
#set_query_function(func, user_data) ⇒ nil
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.
-
#set_waiting(data, waiting) ⇒ nil
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.
-
#src_event_default(pad, event) ⇒ Boolean
Default Gst::CollectPads event handling for the src pad of elements.
-
#start ⇒ nil
Starts the processing of data in the collect_pads.
-
#stop ⇒ nil
Stops the processing of data in the collect_pads.
-
#take_buffer(data, size) ⇒ Gst::Buffer
Get a subbuffer of size bytes from the given pad data.
Methods inherited from Gst::Object
#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref
Constructor Details
#initialize ⇒ GstBase::CollectPads
Create a new instance of Gst::CollectPads.
MT safe.
Instance Method Details
#add_pad(pad, size, destroy_notify, lock) ⇒ GstBase::CollectData
Add a pad to the collection of collect pads. The pad has to be
a sinkpad. The refcount of the pad is incremented. Use
gst_collect_pads_remove_pad() to remove the pad from the collection
again.
You specify a size for the returned Gst::CollectData structure
so that you can use it to store additional information.
You can also specify a Gst::CollectDataDestroyNotify that will be called
just before the Gst::CollectData structure is freed. It is passed the
pointer to the structure and should free any custom memory and resources
allocated for it.
Keeping a pad locked in waiting state is only relevant when using
the default collection algorithm (providing the oldest buffer).
It ensures a buffer must be available on this pad for a collection
to take place. This is of typical use to a muxer element where
non-subtitle streams should always be in waiting state,
e.g. to assure that caps information is available on all these streams
when initial headers have to be written.
The pad will be automatically activated in push mode when pads is
started.
MT safe.
#available ⇒ Integer
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.
This function should be called with pads STREAM_LOCK held, such as
in the callback.
MT safe.
returns 0 if a pad has no queued buffer.
#clip_running_time(cdata, buf, outbuf, user_data) ⇒ Gst::FlowReturn
Convenience clipping function that converts incoming buffer's timestamp
to running time, or clips the buffer if outside configured segment.
Since 1.6, this clipping function also sets the DTS parameter of the
GstCollectData structure. This version of the running time DTS can be
negative. G_MININT64 is used to indicate invalid value.
#event_default(data, event, discard) ⇒ Boolean
Default Gst::CollectPads event handling that elements should always
chain up to to ensure proper operation. Element might however indicate
event should not be forwarded downstream.
#flush(data, size) ⇒ Integer
Flush size bytes from the pad data.
This function should be called with pads STREAM_LOCK held, such as
in the callback.
MT safe.
is 0 if the pad was end-of-stream.
#flushing=(flushing) ⇒ nil
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.
Caller must ensure that downstream streaming (thread) is not blocked,
e.g. by sending a FLUSH_START downstream.
MT safe.
#peek(data) ⇒ Gst::Buffer
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.
MT safe.
buffer is queued. should unref the buffer after usage.
#pop(data) ⇒ Gst::Buffer
Pop the buffer currently queued in data. This function
should be called with the pads STREAM_LOCK held, such as in the callback
handler.
MT safe.
buffer was queued. You should unref the buffer after usage.
#query_default(data, query, discard) ⇒ Boolean
Default Gst::CollectPads query handling that elements should always
chain up to to ensure proper operation. Element might however indicate
query should not be forwarded downstream.
#read_buffer(data, size) ⇒ Gst::Buffer
Get a subbuffer of size bytes from the given pad data.
This function should be called with pads STREAM_LOCK held, such as in the
callback.
MT safe.
be less that requested. A return of nil signals that the pad is
end-of-stream. Unref the buffer after use.
#remove_pad(pad) ⇒ Boolean
Remove a pad from the collection of collect pads. This function will also
free the Gst::CollectData and all the resources that were allocated with
gst_collect_pads_add_pad().
The pad will be deactivated automatically when pads is stopped.
MT safe.
#set_buffer_function(func, user_data) ⇒ nil
Set the callback function and user data that will be called with
the oldest buffer when all pads have been collected, or nil on EOS.
If a buffer is passed, the callback owns a reference and must unref
it.
MT safe.
#set_clip_function(clipfunc, user_data) ⇒ nil
Install a clipping function that is called right after a buffer is received
on a pad managed by pads. See Gst::CollectPadsClipFunction for more info.
#set_compare_function(func, user_data) ⇒ nil
Set the timestamp comparison function.
MT safe.
#set_event_function(func, user_data) ⇒ nil
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 one, this callback is
called with pads STREAM_LOCK held, otherwise not. As this lock should be
held when calling a number of CollectPads functions, it should be acquired
if so (unusually) needed.
MT safe.
#set_flush_function(func, user_data) ⇒ nil
Install a flush function that is called when the internal
state of all pads should be flushed as part of flushing seek
handling. See Gst::CollectPadsFlushFunction for more info.
#set_function(func, user_data) ⇒ nil
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 more complicated and/or more control
is desired, this sets a callback that will be invoked instead when
all the pads added to the collection have buffers queued.
Evidently, this callback is not compatible with
gst_collect_pads_set_buffer_function() callback.
If this callback is set, the former will be unset.
MT safe.
#set_query_function(func, user_data) ⇒ nil
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 one, this callback is
called with pads STREAM_LOCK held, otherwise not. As this lock should be
held when calling a number of CollectPads functions, it should be acquired
if so (unusually) needed.
MT safe.
#set_waiting(data, waiting) ⇒ nil
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.
This function should be called with pads STREAM_LOCK held, such as
in the callback.
MT safe.
#src_event_default(pad, event) ⇒ Boolean
Default Gst::CollectPads event handling for the src pad of elements.
Elements can chain up to this to let flushing seek event handling
be done by Gst::CollectPads.
#start ⇒ nil
Starts the processing of data in the collect_pads.
MT safe.
#stop ⇒ nil
Stops the processing of data in the collect_pads. this function
will also unblock any blocking operations.
MT safe.
#take_buffer(data, size) ⇒ Gst::Buffer
Get a subbuffer of size bytes from the given pad data. Flushes the amount
of read bytes.
This function should be called with pads STREAM_LOCK held, such as in the
callback.
MT safe.
be less that requested. A return of nil signals that the pad is
end-of-stream. Unref the buffer after use.