Class: Gst::Pad
Direct Known Subclasses
Class Method Summary collapse
-
.link_get_name(ret) ⇒ String
Gets a string representing the given pad-link return.
Instance Method Summary collapse
-
#activate_mode(mode, active) ⇒ Boolean
Activates or deactivates the given pad in mode via dispatching to the pad's activatemodefunc.
-
#active=(active) ⇒ Boolean
Activates or deactivates the given pad.
-
#add_probe(mask, callback, user_data, destroy_data) ⇒ Gst::gulong
Be notified of different states of pads.
-
#allowed_caps ⇒ Gst::Caps
Gets the capabilities of the allowed media types that can flow through pad and its peer.
-
#can_link(sinkpad) ⇒ Boolean
Checks if the source pad and the sink pad are compatible so they can be linked.
-
#caps ⇒ Gst::Caps
Caps.
- #caps=(caps) ⇒ Gst::Caps
-
#chain(buffer) ⇒ Gst::FlowReturn
Chain a buffer to pad.
-
#chain_list(list) ⇒ Gst::FlowReturn
Chain a bufferlist to pad.
-
#check_reconfigure ⇒ Boolean
Check and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on pad and return true if the flag was set.
-
#create_stream_id(parent, stream_id) ⇒ String
Creates a stream-id for the source Gst::Pad pad by combining the upstream information with the optional stream_id of the stream of pad.
-
#create_stream_id_printf(parent, stream_id, array) ⇒ String
Creates a stream-id for the source Gst::Pad pad by combining the upstream information with the optional stream_id of the stream of pad.
-
#create_stream_id_printf_valist(parent, stream_id, var_args) ⇒ String
Creates a stream-id for the source Gst::Pad pad by combining the upstream information with the optional stream_id of the stream of pad.
-
#current_caps ⇒ Gst::Caps
Gets the capabilities currently configured on pad with the last #GST_EVENT_CAPS event.
-
#direction ⇒ Gst::PadDirection
Direction.
- #direction=(direction) ⇒ Gst::PadDirection
-
#element_private ⇒ GObject
Gets the private data of a pad.
-
#element_private=(priv) ⇒ nil
Set the given private data gpointer on the pad.
-
#event_default(parent, event) ⇒ Boolean
Invokes the default event handler for the given pad.
-
#forward(forward, user_data) ⇒ Boolean
Calls forward for all internally linked pads of pad.
-
#get_range(offset, size, buffer) ⇒ Gst::FlowReturn
When pad is flushing this function returns #GST_FLOW_FLUSHING immediately and buffer is nil.
-
#get_sticky_event(event_type, idx) ⇒ Gst::Event
Returns a new reference of the sticky event of type event_type from the event.
-
#has_current_caps ⇒ Boolean
Check if pad has caps set on it with a #GST_EVENT_CAPS event.
-
#initialize(templ, name) ⇒ Gst::Pad
constructor
Creates a new pad with the given name from the given template.
-
#is_active ⇒ Boolean
Query if a pad is active MT safe.
-
#is_blocked ⇒ Boolean
Checks if the pad is blocked or not.
-
#is_blocking ⇒ Boolean
Checks if the pad is blocking or not.
-
#is_linked ⇒ Boolean
Checks if a pad is linked to another pad or not.
-
#iterate_internal_links ⇒ Gst::Iterator
Gets an iterator for the pads to which the given pad is linked to inside of the parent element.
-
#iterate_internal_links_default(parent) ⇒ Gst::Iterator
Iterate the list of pads to which the given pad is linked to inside of the parent element.
-
#last_flow_return ⇒ Gst::FlowReturn
Gets the Gst::FlowReturn return from the last data passed by this pad.
-
#link(sinkpad) ⇒ Gst::PadLinkReturn
Links the source pad and the sink pad.
-
#link_full(sinkpad, flags) ⇒ Gst::PadLinkReturn
Links the source pad and the sink pad.
-
#link_maybe_ghosting(sink) ⇒ Boolean
Links src to sink, creating any Gst::GhostPad's in between as necessary.
-
#link_maybe_ghosting_full(sink, flags) ⇒ Boolean
Links src to sink, creating any Gst::GhostPad's in between as necessary.
-
#mark_reconfigure ⇒ nil
Mark a pad for needing reconfiguration.
-
#needs_reconfigure ⇒ Boolean
Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on pad and return true if the flag was set.
-
#offset ⇒ Integer
The offset that will be applied to the running time of the pad.
-
#offset=(offset) ⇒ Integer
The offset that will be applied to the running time of the pad.
-
#pad_template ⇒ Gst::PadTemplate
Gets the template for pad.
-
#pad_template_caps ⇒ Gst::Caps
Gets the capabilities for pad's template.
-
#parent_element ⇒ Gst::Element
Gets the parent of pad, cast to a Gst::Element.
-
#pause_task ⇒ Boolean
Pause the task of pad.
-
#peer ⇒ Gst::Pad
Gets the peer of pad.
-
#peer_query(query) ⇒ Boolean
Performs gst_pad_query() on the peer of pad.
-
#peer_query_accept_caps(caps) ⇒ Boolean
Check if the peer of pad accepts caps.
-
#peer_query_caps(filter) ⇒ Gst::Caps
Gets the capabilities of the peer connected to this pad.
-
#peer_query_convert(src_format, src_val, dest_format, dest_val) ⇒ Boolean
Queries the peer pad of a given sink pad to convert src_val in src_format to dest_format.
-
#peer_query_duration(format, duration) ⇒ Boolean
Queries the peer pad of a given sink pad for the total stream duration.
-
#peer_query_position(format, cur) ⇒ Boolean
Queries the peer of a given sink pad for the stream position.
-
#proxy_query_accept_caps(query) ⇒ Boolean
Checks if all internally linked pads of pad accepts the caps in query and returns the intersection of the results.
-
#proxy_query_caps(query) ⇒ Boolean
Calls gst_pad_query_caps() for all internally linked pads of pad and returns the intersection of the results.
-
#pull_range(offset, size, buffer) ⇒ Gst::FlowReturn
Pulls a buffer from the peer pad or fills up a provided buffer.
-
#push(buffer) ⇒ Gst::FlowReturn
Pushes a buffer to the peer of pad.
-
#push_event(event) ⇒ Boolean
Sends the event to the peer of the given pad.
-
#push_list(list) ⇒ Gst::FlowReturn
Pushes a buffer list to the peer of pad.
-
#query(query) ⇒ Boolean
Dispatches a query to a pad.
-
#query_accept_caps(caps) ⇒ Boolean
Check if the given pad accepts the caps.
-
#query_caps(filter) ⇒ Gst::Caps
Gets the capabilities this pad can produce or consume.
-
#query_convert(src_format, src_val, dest_format, dest_val) ⇒ Boolean
Queries a pad to convert src_val in src_format to dest_format.
-
#query_default(parent, query) ⇒ Boolean
Invokes the default query handler for the given pad.
-
#query_duration(format, duration) ⇒ Boolean
Queries a pad for the total stream duration.
-
#query_position(format, cur) ⇒ Boolean
Queries a pad for the stream position.
-
#remove_probe(id) ⇒ nil
Remove the probe with id from pad.
-
#send_event(event) ⇒ Boolean
Sends the event to the pad.
-
#set_activate_function_full(activate, user_data, notify) ⇒ nil
Sets the given activate function for pad.
-
#set_activatemode_function_full(activatemode, user_data, notify) ⇒ nil
Sets the given activate_mode function for the pad.
-
#set_chain_function_full(chain, user_data, notify) ⇒ nil
Sets the given chain function for the pad.
-
#set_chain_list_function_full(chainlist, user_data, notify) ⇒ nil
Sets the given chain list function for the pad.
-
#set_event_full_function_full(event, user_data, notify) ⇒ nil
Sets the given event handler for the pad.
-
#set_event_function_full(event, user_data, notify) ⇒ nil
Sets the given event handler for the pad.
-
#set_getrange_function_full(get, user_data, notify) ⇒ nil
Sets the given getrange function for the pad.
-
#set_iterate_internal_links_function_full(iterintlink, user_data, notify) ⇒ nil
Sets the given internal link iterator function for the pad.
-
#set_link_function_full(link, user_data, notify) ⇒ nil
Sets the given link function for the pad.
-
#set_query_function_full(query, user_data, notify) ⇒ nil
Set the given query function for the pad.
-
#set_unlink_function_full(unlink, user_data, notify) ⇒ nil
Sets the given unlink function for the pad.
-
#single_internal_link ⇒ Gst::Pad
If there is a single internal link of the given pad, this function will return it.
-
#start_task(func, user_data, notify) ⇒ Boolean
Starts a task that repeatedly calls func with user_data.
-
#sticky_events_foreach(foreach_func, user_data) ⇒ nil
Iterates all sticky events on pad and calls foreach_func for every event.
-
#stop_task ⇒ Boolean
Stop the task of pad.
-
#store_sticky_event(event) ⇒ Gst::FlowReturn
Store the sticky event on pad was flushing or #GST_FLOW_EOS when the pad was EOS.
-
#stream ⇒ Gst::Stream
Returns the current Gst::Stream for the pad, or nil if none has been set yet, i.e.
-
#stream_id ⇒ String
Returns the current stream-id for the pad, or nil if none has been set yet, i.e.
-
#task_state ⇒ Gst::TaskState
Get pad task state.
-
#template ⇒ Gst::PadTemplate
Template.
- #template=(template) ⇒ Gst::PadTemplate
-
#unlink(sinkpad) ⇒ Boolean
Unlinks the source pad from the sink pad.
-
#use_fixed_caps ⇒ nil
A helper function you can use that sets the FIXED_CAPS flag This way the default CAPS query will always return the negotiated caps or in case the pad is not negotiated, the padtemplate caps.
Methods inherited from 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(templ, name) ⇒ Gst::Pad
Creates a new pad with the given name from the given template.
If name is nil, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.
Class Method Details
.link_get_name(ret) ⇒ String
Gets a string representing the given pad-link return.
Instance Method Details
#activate_mode(mode, active) ⇒ Boolean
Activates or deactivates the given pad in mode via dispatching to the
pad's activatemodefunc. For use from within pad activation functions only.
If you don't know what this is, you probably don't want to call it.
MT safe.
#active=(active) ⇒ Boolean
Activates or deactivates the given pad.
Normally called from within core state change functions.
If active, makes sure the pad is active. If it is already active, either in
push or pull mode, just return. Otherwise dispatches to the pad's activate
function to perform the actual activation.
If not active, calls gst_pad_activate_mode() with the pad's current mode
and a false argument.
MT safe.
#add_probe(mask, callback, user_data, destroy_data) ⇒ Gst::gulong
Be notified of different states of pads. The provided callback is called for
every state that matches mask.
Probes are called in groups: First GST_PAD_PROBE_TYPE_BLOCK probes are
called, then others, then finally GST_PAD_PROBE_TYPE_IDLE. The only
exception here are GST_PAD_PROBE_TYPE_IDLE probes that are called
immediately if the pad is already idle while calling gst_pad_add_probe().
In each of the groups, probes are called in the order in which they were
added.
probe with gst_pad_remove_probe(). When using GST_PAD_PROBE_TYPE_IDLE it can
happen that the probe can be run immediately and if the probe returns
GST_PAD_PROBE_REMOVE this functions returns 0.
MT safe.
#allowed_caps ⇒ Gst::Caps
Gets the capabilities of the allowed media types that can flow through
pad and its peer.
The allowed capabilities is calculated as the intersection of the results of
calling gst_pad_query_caps() on pad and its peer. The caller owns a reference
on the resulting caps.
MT safe.
#can_link(sinkpad) ⇒ Boolean
Checks if the source pad and the sink pad are compatible so they can be
linked.
#caps ⇒ Gst::Caps
Returns caps.
#caps=(caps) ⇒ Gst::Caps
#chain(buffer) ⇒ Gst::FlowReturn
Chain a buffer to pad.
The function returns #GST_FLOW_FLUSHING if the pad was flushing.
If the buffer type is not acceptable for pad (as negotiated with a
preceding GST_EVENT_CAPS event), this function returns
#GST_FLOW_NOT_NEGOTIATED.
The function proceeds calling the chain function installed on pad (see
gst_pad_set_chain_function()) and the return value of that function is
returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if pad has no
chain function.
In all cases, success or failure, the caller loses its reference to buffer
after calling this function.
MT safe.
#chain_list(list) ⇒ Gst::FlowReturn
Chain a bufferlist to pad.
The function returns #GST_FLOW_FLUSHING if the pad was flushing.
If pad was not negotiated properly with a CAPS event, this function
returns #GST_FLOW_NOT_NEGOTIATED.
The function proceeds calling the chainlist function installed on pad (see
gst_pad_set_chain_list_function()) and the return value of that function is
returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if pad has no
chainlist function.
In all cases, success or failure, the caller loses its reference to list
after calling this function.
MT safe.
#check_reconfigure ⇒ Boolean
Check and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on pad and return true
if the flag was set.
#create_stream_id(parent, stream_id) ⇒ String
Creates a stream-id for the source Gst::Pad pad by combining the
upstream information with the optional stream_id of the stream
of pad. pad must have a parent Gst::Element and which must have zero
or one sinkpad. stream_id can only be nil if the parent element
of pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.
Since stream IDs are sorted alphabetically, any numbers in the
stream ID should be printed with a fixed number of characters,
preceded by 0's, such as by using the format %03u instead of %u.
#create_stream_id_printf(parent, stream_id, array) ⇒ String
Creates a stream-id for the source Gst::Pad pad by combining the
upstream information with the optional stream_id of the stream
of pad. pad must have a parent Gst::Element and which must have zero
or one sinkpad. stream_id can only be nil if the parent element
of pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.
#create_stream_id_printf_valist(parent, stream_id, var_args) ⇒ String
Creates a stream-id for the source Gst::Pad pad by combining the
upstream information with the optional stream_id of the stream
of pad. pad must have a parent Gst::Element and which must have zero
or one sinkpad. stream_id can only be nil if the parent element
of pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.
#current_caps ⇒ Gst::Caps
Gets the capabilities currently configured on pad with the last
#GST_EVENT_CAPS event.
incremented ref-count or nil when pad has no caps. Unref after usage.
#direction ⇒ Gst::PadDirection
Returns direction.
#direction=(direction) ⇒ Gst::PadDirection
#element_private ⇒ GObject
Gets the private data of a pad.
No locking is performed in this function.
#element_private=(priv) ⇒ nil
Set the given private data gpointer on the pad.
This function can only be used by the element that owns the pad.
No locking is performed in this function.
#event_default(parent, event) ⇒ Boolean
Invokes the default event handler for the given pad.
The EOS event will pause the task associated with pad before it is forwarded
to all internally linked pads,
The event is sent to all pads internally linked to pad. This function
takes ownership of event.
#forward(forward, user_data) ⇒ Boolean
Calls forward for all internally linked pads of pad. This function deals with
dynamically changing internal pads and will make sure that the forward
function is only called once for each pad.
When forward returns true, no further pads will be processed.
#get_range(offset, size, buffer) ⇒ Gst::FlowReturn
When pad is flushing this function returns #GST_FLOW_FLUSHING
immediately and buffer is nil.
Calls the getrange function of pad, see Gst::PadGetRangeFunction for a
description of a getrange function. If pad has no getrange function
installed (see gst_pad_set_getrange_function()) this function returns
#GST_FLOW_NOT_SUPPORTED.
If buffer points to a variable holding nil, a valid new Gst::Buffer will be
placed in buffer when this function returns #GST_FLOW_OK. The new buffer
must be freed with gst_buffer_unref() after usage.
When buffer points to a variable that points to a valid Gst::Buffer, the
buffer will be filled with the result data when this function returns
#GST_FLOW_OK. If the provided buffer is larger than size, only
size bytes will be filled in the result buffer and its size will be updated
accordingly.
Note that less than size bytes can be returned in buffer when, for example,
an EOS condition is near or when buffer is not large enough to hold size
bytes. The caller should check the result buffer size to get the result size.
When this function returns any other result value than #GST_FLOW_OK, buffer
will be unchanged.
This is a lowlevel function. Usually gst_pad_pull_range() is used.
MT safe.
#get_sticky_event(event_type, idx) ⇒ Gst::Event
Returns a new reference of the sticky event of type event_type
from the event.
event_type or nil when no event of event_type was on
pad. Unref after usage.
#has_current_caps ⇒ Boolean
Check if pad has caps set on it with a #GST_EVENT_CAPS event.
#is_active ⇒ Boolean
Query if a pad is active
MT safe.
#is_blocked ⇒ Boolean
Checks if the pad is blocked or not. This function returns the
last requested state of the pad. It is not certain that the pad
is actually blocking at this point (see gst_pad_is_blocking()).
MT safe.
#is_blocking ⇒ Boolean
Checks if the pad is blocking or not. This is a guaranteed state
of whether the pad is actually blocking on a Gst::Buffer or a #GstEvent.
MT safe.
#is_linked ⇒ Boolean
Checks if a pad is linked to another pad or not.
MT safe.
#iterate_internal_links ⇒ Gst::Iterator
Gets an iterator for the pads to which the given pad is linked to inside
of the parent element.
Each Gst::Pad element yielded by the iterator will have its refcount increased,
so unref after use.
Free-function: gst_iterator_free
#iterate_internal_links_default(parent) ⇒ Gst::Iterator
Iterate the list of pads to which the given pad is linked to inside of
the parent element.
This is the default handler, and thus returns an iterator of all of the
pads inside the parent element with opposite direction.
The caller must free this iterator after use with gst_iterator_free().
has no parent. Unref each returned pad with gst_object_unref().
#last_flow_return ⇒ Gst::FlowReturn
Gets the Gst::FlowReturn return from the last data passed by this pad.
#link(sinkpad) ⇒ Gst::PadLinkReturn
Links the source pad and the sink pad.
MT Safe.
#link_full(sinkpad, flags) ⇒ Gst::PadLinkReturn
Links the source pad and the sink pad.
This variant of #gst_pad_link provides a more granular control on the
checks being done when linking. While providing some considerable speedups
the caller of this method must be aware that wrong usage of those flags
can cause severe issues. Refer to the documentation of Gst::PadLinkCheck
for more information.
MT Safe.
#link_maybe_ghosting(sink) ⇒ Boolean
Links src to sink, creating any Gst::GhostPad's in between as necessary.
This is a convenience function to save having to create and add intermediate
Gst::GhostPad's as required for linking across #GstBin boundaries.
If src or sink pads don't have parent elements or do not share a common
ancestor, the link will fail.
#link_maybe_ghosting_full(sink, flags) ⇒ Boolean
Links src to sink, creating any Gst::GhostPad's in between as necessary.
This is a convenience function to save having to create and add intermediate
Gst::GhostPad's as required for linking across #GstBin boundaries.
If src or sink pads don't have parent elements or do not share a common
ancestor, the link will fail.
Calling gst_pad_link_maybe_ghosting_full() with
flags == %GST_PAD_LINK_CHECK_DEFAULT is the recommended way of linking
pads with safety checks applied.
#mark_reconfigure ⇒ nil
Mark a pad for needing reconfiguration. The next call to
gst_pad_check_reconfigure() will return true after this call.
#needs_reconfigure ⇒ Boolean
Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on pad and return true
if the flag was set.
#offset ⇒ Integer
The offset that will be applied to the running time of the pad.
#offset=(offset) ⇒ Integer
The offset that will be applied to the running time of the pad.
#pad_template ⇒ Gst::PadTemplate
Gets the template for pad.
#pad_template_caps ⇒ Gst::Caps
Gets the capabilities for pad's template.
Unref after usage.
#parent_element ⇒ Gst::Element
Gets the parent of pad, cast to a Gst::Element. If a pad has no parent or
its parent is not an element, return nil.
caller has a reference on the parent, so unref when you're finished
with it.
MT safe.
#pause_task ⇒ Boolean
Pause the task of pad. This function will also wait until the
function executed by the task is finished if this function is not
called from the task function.
has no task.
#peer ⇒ Gst::Pad
Gets the peer of pad. This function refs the peer pad so
you need to unref it after use.
MT safe.
#peer_query(query) ⇒ Boolean
Performs gst_pad_query() on the peer of pad.
The caller is responsible for both the allocation and deallocation of
the query structure.
if pad has no peer.
#peer_query_accept_caps(caps) ⇒ Boolean
Check if the peer of pad accepts caps. If pad has no peer, this function
returns true.
#peer_query_caps(filter) ⇒ Gst::Caps
Gets the capabilities of the peer connected to this pad. Similar to
gst_pad_query_caps().
When called on srcpads filter contains the caps that
upstream could produce in the order preferred by upstream. When
called on sinkpads filter contains the caps accepted by
downstream in the preferred order. filter might be nil but
if it is not nil the returned caps will be a subset of filter.
ref-count. When there is no peer pad, this function returns filter or,
when filter is nil, ANY caps.
#peer_query_convert(src_format, src_val, dest_format, dest_val) ⇒ Boolean
Queries the peer pad of a given sink pad to convert src_val in src_format
to dest_format.
#peer_query_duration(format, duration) ⇒ Boolean
Queries the peer pad of a given sink pad for the total stream duration.
#peer_query_position(format, cur) ⇒ Boolean
Queries the peer of a given sink pad for the stream position.
#proxy_query_accept_caps(query) ⇒ Boolean
Checks if all internally linked pads of pad accepts the caps in query and
returns the intersection of the results.
This function is useful as a default accept caps query function for an element
that can handle any stream format, but requires caps that are acceptable for
all opposite pads.
#proxy_query_caps(query) ⇒ Boolean
Calls gst_pad_query_caps() for all internally linked pads of pad and returns
the intersection of the results.
This function is useful as a default caps query function for an element
that can handle any stream format, but requires all its pads to have
the same caps. Two such elements are tee and adder.
#pull_range(offset, size, buffer) ⇒ Gst::FlowReturn
Pulls a buffer from the peer pad or fills up a provided buffer.
This function will first trigger the pad block signal if it was
installed.
When pad is not linked #GST_FLOW_NOT_LINKED is returned else this
function returns the result of gst_pad_get_range() on the peer pad.
See gst_pad_get_range() for a list of return values and for the
semantics of the arguments of this function.
If buffer points to a variable holding nil, a valid new Gst::Buffer will be
placed in buffer when this function returns #GST_FLOW_OK. The new buffer
must be freed with gst_buffer_unref() after usage. When this function
returns any other result value, buffer will still point to nil.
When buffer points to a variable that points to a valid Gst::Buffer, the
buffer will be filled with the result data when this function returns
#GST_FLOW_OK. When this function returns any other result value,
buffer will be unchanged. If the provided buffer is larger than size, only
size bytes will be filled in the result buffer and its size will be updated
accordingly.
Note that less than size bytes can be returned in buffer when, for example,
an EOS condition is near or when buffer is not large enough to hold size
bytes. The caller should check the result buffer size to get the result size.
MT safe.
#push(buffer) ⇒ Gst::FlowReturn
Pushes a buffer to the peer of pad.
This function will call installed block probes before triggering any
installed data probes.
The function proceeds calling gst_pad_chain() on the peer pad and returns
the value from that function. If pad has no peer, #GST_FLOW_NOT_LINKED will
be returned.
In all cases, success or failure, the caller loses its reference to buffer
after calling this function.
MT safe.
#push_event(event) ⇒ Boolean
Sends the event to the peer of the given pad. This function is
mainly used by elements to send events to their peer
elements.
This function takes ownership of the provided event so you should
gst_event_ref() it if you want to reuse the event after this call.
MT safe.
#push_list(list) ⇒ Gst::FlowReturn
Pushes a buffer list to the peer of pad.
This function will call installed block probes before triggering any
installed data probes.
The function proceeds calling the chain function on the peer pad and returns
the value from that function. If pad has no peer, #GST_FLOW_NOT_LINKED will
be returned. If the peer pad does not have any installed chainlist function
every group buffer of the list will be merged into a normal Gst::Buffer and
chained via gst_pad_chain().
In all cases, success or failure, the caller loses its reference to list
after calling this function.
MT safe.
#query(query) ⇒ Boolean
Dispatches a query to a pad. The query should have been allocated by the
caller via one of the type-specific allocation functions. The element that
the pad belongs to is responsible for filling the query with an appropriate
response, which should then be parsed with a type-specific query parsing
function.
Again, the caller is responsible for both the allocation and deallocation of
the query structure.
Please also note that some queries might need a running pipeline to work.
#query_accept_caps(caps) ⇒ Boolean
Check if the given pad accepts the caps.
#query_caps(filter) ⇒ Gst::Caps
Gets the capabilities this pad can produce or consume.
Note that this method doesn't necessarily return the caps set by sending a
gst_event_new_caps() - use gst_pad_get_current_caps() for that instead.
gst_pad_query_caps returns all possible caps a pad can operate with, using
the pad's CAPS query function, If the query fails, this function will return
filter, if not nil, otherwise ANY.
When called on sinkpads filter contains the caps that
upstream could produce in the order preferred by upstream. When
called on srcpads filter contains the caps accepted by
downstream in the preferred order. filter might be nil but
if it is not nil the returned caps will be a subset of filter.
Note that this function does not return writable Gst::Caps, use
gst_caps_make_writable() before modifying the caps.
#query_convert(src_format, src_val, dest_format, dest_val) ⇒ Boolean
Queries a pad to convert src_val in src_format to dest_format.
#query_default(parent, query) ⇒ Boolean
Invokes the default query handler for the given pad.
The query is sent to all pads internally linked to pad. Note that
if there are many possible sink pads that are internally linked to
pad, only one will be sent the query.
Multi-sinkpad elements should implement custom query handlers.
#query_duration(format, duration) ⇒ Boolean
Queries a pad for the total stream duration.
#query_position(format, cur) ⇒ Boolean
Queries a pad for the stream position.
#remove_probe(id) ⇒ nil
Remove the probe with id from pad.
MT safe.
#send_event(event) ⇒ Boolean
Sends the event to the pad. This function can be used
by applications to send events in the pipeline.
If pad is a source pad, event should be an upstream event. If pad is a
sink pad, event should be a downstream event. For example, you would not
send a #GST_EVENT_EOS on a src pad; EOS events only propagate downstream.
Furthermore, some downstream events have to be serialized with data flow,
like EOS, while some can travel out-of-band, like #GST_EVENT_FLUSH_START. If
the event needs to be serialized with data flow, this function will take the
pad's stream lock while calling its event function.
To find out whether an event type is upstream, downstream, or downstream and
serialized, see Gst::EventTypeFlags, gst_event_type_get_flags(),
#GST_EVENT_IS_UPSTREAM, #GST_EVENT_IS_DOWNSTREAM, and
#GST_EVENT_IS_SERIALIZED. Note that in practice that an application or
plugin doesn't need to bother itself with this information; the core handles
all necessary locks and checks.
This function takes ownership of the provided event so you should
gst_event_ref() it if you want to reuse the event after this call.
#set_activate_function_full(activate, user_data, notify) ⇒ nil
Sets the given activate function for pad. The activate function will
dispatch to gst_pad_activate_mode() to perform the actual activation.
Only makes sense to set on sink pads.
Call this function if your sink pad can start a pull-based task.
#set_activatemode_function_full(activatemode, user_data, notify) ⇒ nil
Sets the given activate_mode function for the pad. An activate_mode function
prepares the element for data passing.
#set_chain_function_full(chain, user_data, notify) ⇒ nil
Sets the given chain function for the pad. The chain function is called to
process a Gst::Buffer input buffer. see #GstPadChainFunction for more details.
#set_chain_list_function_full(chainlist, user_data, notify) ⇒ nil
Sets the given chain list function for the pad. The chainlist function is
called to process a Gst::BufferList input buffer list. See
Gst::PadChainListFunction for more details.
#set_event_full_function_full(event, user_data, notify) ⇒ nil
Sets the given event handler for the pad.
#set_event_function_full(event, user_data, notify) ⇒ nil
Sets the given event handler for the pad.
#set_getrange_function_full(get, user_data, notify) ⇒ nil
Sets the given getrange function for the pad. The getrange function is
called to produce a new Gst::Buffer to start the processing pipeline. see
Gst::PadGetRangeFunction for a description of the getrange function.
#set_iterate_internal_links_function_full(iterintlink, user_data, notify) ⇒ nil
Sets the given internal link iterator function for the pad.
#set_link_function_full(link, user_data, notify) ⇒ nil
Sets the given link function for the pad. It will be called when
the pad is linked with another pad.
The return value #GST_PAD_LINK_OK should be used when the connection can be
made.
The return value #GST_PAD_LINK_REFUSED should be used when the connection
cannot be made for some reason.
If link is installed on a source pad, it should call the Gst::PadLinkFunction
of the peer sink pad, if present.
#set_query_function_full(query, user_data, notify) ⇒ nil
Set the given query function for the pad.
#set_unlink_function_full(unlink, user_data, notify) ⇒ nil
Sets the given unlink function for the pad. It will be called
when the pad is unlinked.
Note that the pad's lock is already held when the unlink
function is called, so most pad functions cannot be called
from within the callback.
#single_internal_link ⇒ Gst::Pad
If there is a single internal link of the given pad, this function will
return it. Otherwise, it will return NULL.
or more than one internal links. Unref returned pad with
gst_object_unref().
#start_task(func, user_data, notify) ⇒ Boolean
Starts a task that repeatedly calls func with user_data. This function
is mostly used in pad activation functions to start the dataflow.
The #GST_PAD_STREAM_LOCK of pad will automatically be acquired
before func is called.
#sticky_events_foreach(foreach_func, user_data) ⇒ nil
Iterates all sticky events on pad and calls foreach_func for every
event. If foreach_func returns false the iteration is immediately stopped.
#stop_task ⇒ Boolean
Stop the task of pad. This function will also make sure that the
function executed by the task will effectively stop if not called
from the GstTaskFunction.
This function will deadlock if called from the GstTaskFunction of
the task. Use gst_task_pause() instead.
Regardless of whether the pad has a task, the stream lock is acquired and
released so as to ensure that streaming through this pad has finished.
#store_sticky_event(event) ⇒ Gst::FlowReturn
Store the sticky event on pad
was flushing or #GST_FLOW_EOS when the pad was EOS.
#stream ⇒ Gst::Stream
Returns the current Gst::Stream for the pad, or nil if none has been
set yet, i.e. the pad has not received a stream-start event yet.
This is a convenience wrapper around gst_pad_get_sticky_event() and
gst_event_parse_stream().
#stream_id ⇒ String
Returns the current stream-id for the pad, or nil if none has been
set yet, i.e. the pad has not received a stream-start event yet.
This is a convenience wrapper around gst_pad_get_sticky_event() and
gst_event_parse_stream_start().
The returned stream-id string should be treated as an opaque string, its
contents should not be interpreted.
#task_state ⇒ Gst::TaskState
Get pad task state. If no task is currently
set, #GST_TASK_STOPPED is returned.
#template ⇒ Gst::PadTemplate
Returns template.
#template=(template) ⇒ Gst::PadTemplate
#unlink(sinkpad) ⇒ Boolean
Unlinks the source pad from the sink pad. Will emit the Gst::Pad::unlinked
signal on both pads.
the pads were not linked together.
MT safe.
#use_fixed_caps ⇒ nil
A helper function you can use that sets the FIXED_CAPS flag
This way the default CAPS query will always return the negotiated caps
or in case the pad is not negotiated, the padtemplate caps.
The negotiated caps are the caps of the last CAPS event that passed on the
pad. Use this function on a pad that, once it negotiated to a CAPS, cannot
be renegotiated to something else.