#include <pad.h>
Public Types | |
typedef sigc::slot< void, const Glib::RefPtr<Gst::Pad> &, bool > | SlotBlock |
For example, void on_block(const Glib::RefPtr<Gst::Pad>& pad, bool blocked);. | |
typedef sigc::slot< bool, const Glib::RefPtr<Gst::Pad> &, const Glib::RefPtr <Gst::MiniObject >&> | SlotData |
For example, bool on_have_data(const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::MiniObjec>& data);. | |
Public Member Functions | |
virtual | ~Pad () |
GstPad* | gobj () |
Provides access to the underlying C GObject. | |
const GstPad* | gobj () const |
Provides access to the underlying C GObject. | |
GstPad* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
PadDirection | get_direction () const |
Gets the direction of the pad. | |
Glib::RefPtr<Gst::Element> | get_parent_element () |
Gets the parent of pad, cast to a Gst::Element. | |
Glib::RefPtr<const Gst::Element> | get_parent_element () const |
Gets the parent of pad, cast to a Gst::Element. | |
Glib::RefPtr<Gst::PadTemplate> | get_pad_template () const |
Gets the template for pad. | |
PadLinkReturn | link (const Glib::RefPtr<Gst::Pad>& sink_pad) |
Links the source pad and the sink pad. | |
bool | unlink (const Glib::RefPtr<Gst::Pad>& sink_pad) |
Unlinks the source pad from the sink pad. | |
bool | is_linked () const |
Checks if a pad is linked to another pad or not. | |
bool | can_link (const Glib::RefPtr<Gst::Pad>& other_pad) |
Checks if the source pad and the sink pad can be linked. | |
Glib::RefPtr<Gst::Caps> | get_caps () |
Gets the capabilities this pad can produce or consume. | |
Glib::RefPtr<const Gst::Caps> | get_caps () const |
Gets the capabilities this pad can produce or consume. | |
Glib::RefPtr<Gst::Caps> | get_allowed_caps () |
Gets the capabilities of the allowed media types that can flow through pad and its peer. | |
Glib::RefPtr<const Gst::Caps> | get_allowed_caps () const |
Gets the capabilities of the allowed media types that can flow through pad and its peer. | |
Glib::RefPtr<Gst::Caps> | get_negotiated_caps () |
Gets the capabilities of the media type that currently flows through pad and its peer. | |
Glib::RefPtr<const Gst::Caps> | get_negotiated_caps () const |
Gets the capabilities of the media type that currently flows through pad and its peer. | |
Glib::RefPtr<const Gst::Caps> | get_pad_template_caps () const |
Gets the capabilities for pad's template. | |
bool | set_caps (const Glib::RefPtr<Gst::Caps>& caps) |
Sets the capabilities of this pad. | |
Glib::RefPtr<Gst::Pad> | get_peer () |
Gets the peer of pad. | |
Glib::RefPtr<const Gst::Pad> | get_peer () const |
Gets the peer of pad. | |
Glib::RefPtr<Gst::Caps> | peer_get_caps () |
Gets the capabilities of the peer connected to this pad. | |
Glib::RefPtr<const Gst::Caps> | peer_get_caps () const |
Gets the capabilities of the peer connected to this pad. | |
void | use_fixed_caps () |
A helper function you can use that sets the gst_pad_get_fixed_caps_func as the getcaps function for the pad. | |
bool | is_active () const |
Query if a pad is active. | |
bool | set_blocked (bool blocked=true) |
Blocks or unblocks the dataflow on a pad. | |
bool | set_blocked_async (const SlotBlock& slot, bool blocked=true) |
Blocks or unblocks the dataflow on a pad asynchronously. | |
bool | is_blocked () const |
Checks if the pad is blocked or not. | |
bool | is_blocking () const |
Checks if the pad is blocking or not. | |
gulong | add_data_probe (const SlotData& slot) |
Adds a "data probe" to a pad. | |
gulong | add_buffer_probe (const SlotData& slot) |
Adds a probe that will be called for all buffers passing through a pad. | |
gulong | add_event_probe (const SlotData& slot) |
Adds a probe that will be called for all events passing through a pad. | |
void | remove_data_probe (guint handler_id) |
Removes a data probe from pad. | |
void | remove_buffer_probe (guint handler_id) |
Removes a buffer probe from pad. | |
void | remove_event_probe (guint handler_id) |
Removes an event probe from pad. | |
FlowReturn | alloc_buffer (guint64 offset, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buf) |
Allocates a new, empty buffer optimized to push to pad pad. | |
FlowReturn | alloc_buffer_and_set_caps (guint64 offset, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buf) |
In addition to the function alloc_buffer(), this function automatically calls set_caps() when the caps of the newly allocated buffer are different from the pad caps. | |
FlowReturn | get_range (guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer) |
bool | accept_caps (const Glib::RefPtr<Gst::Caps>& caps) |
Check if the given pad accepts the caps. | |
Glib::RefPtr<Gst::Caps> | proxy_getcaps () |
Calls get_allowed_caps() for every other pad belonging to the same element as pad, and returns the intersection of the results. | |
Glib::RefPtr<const Gst::Caps> | proxy_getcaps () const |
Calls get_allowed_caps() for every other pad belonging to the same element as pad, and returns the intersection of the results. | |
bool | proxy_setcaps (const Glib::RefPtr<Gst::Caps>& caps) |
Calls set_caps() for every other pad belonging to the same element as pad. | |
void | fixate_caps (const Glib::RefPtr<Gst::Caps>& caps) |
Fixate a caps on the given pad. | |
bool | peer_accept_caps (const Glib::RefPtr<Gst::Caps>& caps) |
Check if the peer of pad accepts caps. | |
FlowReturn | push (const Glib::RefPtr<Gst::Buffer>& buffer) |
Pushes a buffer to the peer of the pad. | |
bool | push_event (const Glib::RefPtr<Gst::Event>& event) |
Sends the event to the peer of the pad. | |
bool | check_pull_range () const |
Checks if a pull_range() can be performed on the peer source pad. | |
FlowReturn | pull_range (guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer) |
bool | activate_pull (bool active=true) |
Activates or deactivates the given pad in pull mode via dispatching to the pad's activatepullfunc. | |
bool | activate_push (bool active=true) |
Activates or deactivates the given pad in push mode via dispatching to the pad's activatepushfunc. | |
bool | send_event (const Glib::RefPtr<Gst::Event>& event) |
Sends the event to the pad. | |
bool | event_default (const Glib::RefPtr<Gst::Event>& event) |
Invokes the default event handler for the given pad. | |
bool | query (const Glib::RefPtr<Gst::Query>& query) |
Dispatches a query to a pad. | |
bool | peer_query (const Glib::RefPtr<Gst::Query>& query) |
Performs query() on the peer of pad. | |
bool | query_default (const Glib::RefPtr<Gst::Query>& query) |
Invokes the default query handler for the given pad. | |
bool | query_position (Format& format, gint64& position) const |
Queries a pad for the stream position. | |
bool | query_position (Format& format) const |
Queries a pad for the stream position parsing only the format. | |
bool | query_duration (Format& format, gint64& duration) const |
Queries a pad for the total stream duration. | |
bool | query_duration (Format& format) const |
Queries a pad for the total stream duration parsing only the format. | |
bool | query_convert (Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const |
Queries a pad to convert src_val in src_format to dest_format. | |
bool | query_peer_position (Format& format, gint64& position) const |
Queries the peer of a given sink pad for the stream position. | |
bool | query_peer_position (Format& format) const |
Queries the peer of a given sink pad for the stream position parsing only the format. | |
bool | query_peer_duration (Format& format, gint64& duration) const |
Queries the peer pad of a given sink pad for the total stream duration. | |
bool | query_peer_duration (Format& format) const |
Queries the peer pad of a given sink pad for the total stream duration. | |
bool | query_peer_convert (Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const |
Queries the peer pad of a given sink pad to convert src_val in src_format to dest_format. | |
Glib::ArrayHandle<QueryType> | get_query_types () const |
Get an array of supported queries that can be performed on this pad. | |
Glib::ArrayHandle<QueryType> | get_query_types_default () const |
Invoke the default dispatcher for the query types on the pad. | |
Glib::ListHandle< Glib::RefPtr <Gst::Pad >> | get_internal_links () |
Gets a list of pads to which the given pad is linked to inside of the parent element. | |
Glib::ListHandle< Glib::RefPtr <Gst::Pad >> | get_internal_links_default () |
Gets a list of pads to which the given pad is linked to inside of the parent element. | |
FlowReturn | chain (const Glib::RefPtr<Gst::Buffer>& buffer) |
bool | pause_task () |
Pause the task of pad. | |
bool | stop_task () |
Stop the task of pad. | |
bool | set_active (bool active=true) |
Activates or deactivates the given pad. | |
Glib::SignalProxy1< void, const Glib::RefPtr<Gst::Pad >&> | signal_linked () |
Signals that a pad has been linked to the peer pad. | |
Glib::SignalProxy0<void> | signal_request_link () |
Signals that a pad connection has been requested. | |
Glib::SignalProxy1< void, const Glib::RefPtr<Gst::Pad >&> | signal_unlinked () |
Signals that a pad has been unlinked from the peer pad. | |
Glib::PropertyProxy_ReadOnly <Glib::RefPtr<Gst::Caps>> | property_caps () const |
The capabilities of the pad. | |
Glib::PropertyProxy_ReadOnly <PadDirection> | property_direction () const |
The direction of the pad. | |
Glib::PropertyProxy<PadTemplate> | property_template () |
The GstPadTemplate of this pad. | |
Glib::PropertyProxy_ReadOnly <PadTemplate> | property_template () const |
The GstPadTemplate of this pad. | |
Static Public Member Functions | |
static Glib::RefPtr<Pad> | create (const Glib::ustring& name, PadDirection dir) |
Creates a new pad with the given name in the given direction. | |
static Glib::RefPtr<Pad> | create (PadDirection dir) |
Creates a new pad with a guaranteed unique name (across all pads) in the given direction. | |
static Glib::RefPtr<Pad> | create (const Glib::RefPtr<Gst::PadTemplate>& pad_template) |
Creates a new pad with the given name from the given template. | |
static Glib::RefPtr<Pad> | create (const Glib::RefPtr<Gst::PadTemplate>& pad_template, const Glib::ustring& name) |
Creates a new pad with a guaranteed unique name (across all pads) from the given template. | |
Protected Member Functions | |
Pad (const Glib::ustring& name, PadDirection direction) | |
Pad (PadDirection dir) | |
Pad (const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name) | |
Pad (const Glib::RefPtr<Gst::PadTemplate>& templ) | |
virtual void | on_linked (const Glib::RefPtr<Gst::Pad>& peer_pad) |
virtual void | on_request_link () |
virtual void | on_unlinked (const Glib::RefPtr<Gst::Pad>& peer_pad) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gst::Pad> | wrap (GstPad* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
A Gst::Element is linked to other elements via "pads", which are extremely light-weight generic link points. After two pads are retrieved from an element with Element::get_pad(), the pads can be link with link(). (For quick links, you can also use Element::link(), which will make the obvious link for you if it's straightforward.)
Pads are typically created from a Gst::PadTemplate with the create() method that takes a Gst::PadTemplate.
Pads have Gst::Caps attached to it to describe the media type they are capable of dealing with. get_caps() and set_caps() are used to manipulate the caps of the pads. Pads created from a pad template cannot set capabilities that are incompatible with the pad template capabilities.
Pads without pad templates can be created with create(), which takes a direction and a name as an argument.
get_parent_element() will retrieve the Gst::Element that owns the pad.
A Gst::Element creating a pad will typically use the underlying C API to register callbacks for various events on the pads.
Elements will use push() and pull_range() to push out or pull in a buffer.
To send a Gst::Event on a pad, use send_event() and push_event().
Last reviewed on 2006-07-06 (0.10.9)
typedef sigc::slot<void, const Glib::RefPtr<Gst::Pad>&, bool> Gst::Pad::SlotBlock |
For example, void on_block(const Glib::RefPtr<Gst::Pad>& pad, bool blocked);.
typedef sigc::slot<bool, const Glib::RefPtr<Gst::Pad>&, const Glib::RefPtr<Gst::MiniObject>&> Gst::Pad::SlotData |
For example, bool on_have_data(const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::MiniObjec>& data);.
The data method should return true to keep the data in the pipeline, false to drop it (throw it away).
virtual Gst::Pad::~Pad | ( | ) | [virtual] |
Gst::Pad::Pad | ( | const Glib::ustring & | name, | |
PadDirection | direction | |||
) | [explicit, protected] |
Gst::Pad::Pad | ( | PadDirection | dir | ) | [protected] |
Gst::Pad::Pad | ( | const Glib::RefPtr<Gst::PadTemplate>& | templ, | |
const Glib::ustring & | name | |||
) | [protected] |
Gst::Pad::Pad | ( | const Glib::RefPtr<Gst::PadTemplate>& | templ | ) | [protected] |
bool Gst::Pad::accept_caps | ( | const Glib::RefPtr<Gst::Caps>& | caps | ) |
Check if the given pad accepts the caps.
caps | A Gst::Caps to check on the pad. |
true
if the pad can accept the caps. bool Gst::Pad::activate_pull | ( | bool | active = true |
) |
Activates or deactivates the given pad in pull mode via dispatching to the pad's activatepullfunc.
For use from within pad activation functions only. When called on sink pads, will first proxy the call to the peer pad, which is expected to activate its internally linked pads from within its activate_pull function.
If you don't know what this is, you probably don't want to call it.
active | Whether or not the pad should be active. |
true
if the operation was successful.bool Gst::Pad::activate_push | ( | bool | active = true |
) |
Activates or deactivates the given pad in push mode via dispatching to the pad's activatepushfunc.
For use from within pad activation functions only.
If you don't know what this is, you probably don't want to call it.
active | Whether the pad should be active or not. |
true
if the operation was successful.gulong Gst::Pad::add_buffer_probe | ( | const SlotData& | slot | ) |
Adds a probe that will be called for all buffers passing through a pad.
See add_data_probe() for more information.
slot | The slot to call when buffers are passed over pad. |
gulong Gst::Pad::add_data_probe | ( | const SlotData& | slot | ) |
Adds a "data probe" to a pad.
The slot will be called whenever data passes through a pad. In this case data means both events and buffers. The probe will be called with the data as an argument. Note that the data will have a reference count greater than 1, so it will be immutable -- you must not change it.
For source pads, the probe will be called after the blocking function, if any (see set_blocked_async()), but before looking up the peer to chain to. For sink pads, the probe function will be called before configuring the sink with new caps, if any, and before calling the pad's chain function.
Your data probe should return true to let the data continue to flow, or false to drop it. Dropping data is rarely useful, but occasionally comes in handy with events.
To remove a probe, use the appropriate function, such as remove_data_probe().
slot | The slot to call when data is passed over pad (note: slot is not copied because it is connected to a signal). |
gulong Gst::Pad::add_event_probe | ( | const SlotData& | slot | ) |
Adds a probe that will be called for all events passing through a pad.
See add_data_probe() for more information.
slot | The slot to call when events are passed over pad. |
FlowReturn Gst::Pad::alloc_buffer | ( | guint64 | offset, | |
int | size, | |||
const Glib::RefPtr<Gst::Caps>& | caps, | |||
Glib::RefPtr<Gst::Buffer>& | buf | |||
) |
Allocates a new, empty buffer optimized to push to pad pad.
This function only works if pad is a source pad and has a peer.
A new, empty Gst::Buffer will be put in the buf argument. You need to check the caps of the buffer after performing this function and renegotiate to the format if needed.
offset | The offset of the new buffer in the stream. | |
size | The size of the new buffer. | |
caps | The caps of the new buffer. | |
buf | A newly allocated buffer. |
FlowReturn Gst::Pad::alloc_buffer_and_set_caps | ( | guint64 | offset, | |
int | size, | |||
const Glib::RefPtr<Gst::Caps>& | caps, | |||
Glib::RefPtr<Gst::Buffer>& | buf | |||
) |
In addition to the function alloc_buffer(), this function automatically calls set_caps() when the caps of the newly allocated buffer are different from the pad caps.
Again, the pad must be a source pad.
offset | The offset of the new buffer in the stream. | |
size | The size of the new buffer. | |
caps | The caps of the new buffer. | |
buf | A newly allocated buffer. |
bool Gst::Pad::can_link | ( | const Glib::RefPtr<Gst::Pad>& | other_pad | ) |
Checks if the source pad and the sink pad can be linked.
Both srcpad and sinkpad must be unlinked.
sinkpad | The sink Gst::Pad to link. |
true
if the pads can be linked, false
otherwise. FlowReturn Gst::Pad::chain | ( | const Glib::RefPtr<Gst::Buffer>& | buffer | ) |
bool Gst::Pad::check_pull_range | ( | ) | const |
Checks if a pull_range() can be performed on the peer source pad.
This function is used by plugins that want to check if they can use random access on the peer source pad.
The peer sourcepad can implement a custom Gst::PadCheckGetRangeFunction if it needs to perform some logic to determine if pull_range is possible.
bool
with the result.static Glib::RefPtr<Pad> Gst::Pad::create | ( | const Glib::RefPtr<Gst::PadTemplate>& | pad_template, | |
const Glib::ustring & | name | |||
) | [static] |
Creates a new pad with a guaranteed unique name (across all pads) from the given template.
templ | The pad template to use. |
static Glib::RefPtr<Pad> Gst::Pad::create | ( | const Glib::RefPtr<Gst::PadTemplate>& | pad_template | ) | [static] |
Creates a new pad with the given name from the given template.
templ | The pad template to use. | |
name | The name of the element. |
static Glib::RefPtr<Pad> Gst::Pad::create | ( | PadDirection | dir | ) | [static] |
Creates a new pad with a guaranteed unique name (across all pads) in the given direction.
direction | The GstPadDirection of the pad. |
static Glib::RefPtr<Pad> Gst::Pad::create | ( | const Glib::ustring & | name, | |
PadDirection | dir | |||
) | [static] |
Creates a new pad with the given name in the given direction.
name | The name of the new pad. | |
direction | The GstPadDirection of the pad. |
bool Gst::Pad::event_default | ( | const Glib::RefPtr<Gst::Event>& | event | ) |
Invokes the default event handler for the given pad.
End-of-stream and discontinuity events are handled specially, and then the event 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 an event. Multi-sinkpad elements should implement custom event handlers.
event | The Gst::Event to handle. |
true
if the event was sent succesfully. void Gst::Pad::fixate_caps | ( | const Glib::RefPtr<Gst::Caps>& | caps | ) |
Fixate a caps on the given pad.
Modifies the caps in place, so you should make sure that the caps are actually writable (see gst_caps_make_writable()).
caps | The Gst::Caps to fixate. |
Glib::RefPtr<const Gst::Caps> Gst::Pad::get_allowed_caps | ( | ) | const |
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 get_caps() on pad and its peer. The caller owns a reference on the resulting caps.
0
when pad has no peer.Glib::RefPtr<Gst::Caps> Gst::Pad::get_allowed_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 get_caps() on pad and its peer. The caller owns a reference on the resulting caps.
0
when pad has no peer.Glib::RefPtr<const Gst::Caps> Gst::Pad::get_caps | ( | ) | const |
Gets the capabilities this pad can produce or consume.
Note that this method doesn't necessarily return the caps set by set_caps() - use GST_PAD_CAPS() for that instead. gst_pad_get_caps returns all possible caps a pad can operate with, using the pad's get_caps function; this returns the pad template caps if not explicitly set.
Glib::RefPtr<Gst::Caps> Gst::Pad::get_caps | ( | ) |
Gets the capabilities this pad can produce or consume.
Note that this method doesn't necessarily return the caps set by set_caps() - use GST_PAD_CAPS() for that instead. gst_pad_get_caps returns all possible caps a pad can operate with, using the pad's get_caps function; this returns the pad template caps if not explicitly set.
PadDirection Gst::Pad::get_direction | ( | ) | const |
Gets the direction of the pad.
The direction of the pad is decided at construction time so this function does not take the LOCK.
Glib::ListHandle<Glib::RefPtr<Gst::Pad>> Gst::Pad::get_internal_links | ( | ) |
Gets a list of pads to which the given pad is linked to inside of the parent element.
The caller must free this list after use.
Deprecated: This function does not ref the pads in the list so that they could become invalid by the time the application accesses them. It's also possible that the list changes while handling the pads, which the caller of this function is unable to know. Use the thread-safe iterate_internal_links() instead.
Glib::ListHandle<Glib::RefPtr<Gst::Pad>> Gst::Pad::get_internal_links_default | ( | ) |
Gets a list of pads to which the given pad is linked to inside of the parent element.
This is the default handler, and thus returns a list of all of the pads inside the parent element with opposite direction.
The caller must free this list after use with Glib::list_free().
0
if the pad has no parent.Deprecated: This function does not ref the pads in the list so that they could become invalid by the time the application accesses them. It's also possible that the list changes while handling the pads, which the caller of this function is unable to know. Use the thread-safe iterate_internal_links_default() instead.
Glib::RefPtr<const Gst::Caps> Gst::Pad::get_negotiated_caps | ( | ) | const |
Gets the capabilities of the media type that currently flows through pad and its peer.
This function can be used on both src and sinkpads. Note that srcpads are always negotiated before sinkpads so it is possible that the negotiated caps on the srcpad do not match the negotiated caps of the peer.
0
when the pad has no peer or is not negotiated yet.Glib::RefPtr<Gst::Caps> Gst::Pad::get_negotiated_caps | ( | ) |
Gets the capabilities of the media type that currently flows through pad and its peer.
This function can be used on both src and sinkpads. Note that srcpads are always negotiated before sinkpads so it is possible that the negotiated caps on the srcpad do not match the negotiated caps of the peer.
0
when the pad has no peer or is not negotiated yet.Glib::RefPtr<Gst::PadTemplate> Gst::Pad::get_pad_template | ( | ) | const |
Gets the template for pad.
0
if this pad has no template.Glib::RefPtr<const Gst::Caps> Gst::Pad::get_pad_template_caps | ( | ) | const |
Glib::RefPtr<const Gst::Element> Gst::Pad::get_parent_element | ( | ) | const |
Gets the parent of pad, cast to a Gst::Element.
If a pad has no parent or its parent is not an element, return 0
.
Glib::RefPtr<Gst::Element> Gst::Pad::get_parent_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 0
.
Glib::RefPtr<const Gst::Pad> Gst::Pad::get_peer | ( | ) | const |
Gets the peer of pad.
This function refs the peer pad so you need to unref it after use.
Glib::RefPtr<Gst::Pad> Gst::Pad::get_peer | ( | ) |
Gets the peer of pad.
This function refs the peer pad so you need to unref it after use.
Glib::ArrayHandle<QueryType> Gst::Pad::get_query_types | ( | ) | const |
Get an array of supported queries that can be performed on this pad.
Glib::ArrayHandle<QueryType> Gst::Pad::get_query_types_default | ( | ) | const |
Invoke the default dispatcher for the query types on the pad.
0
if none of the internally-linked pads has a query types function. FlowReturn Gst::Pad::get_range | ( | guint64 | offset, | |
guint | size, | |||
Glib::RefPtr<Gst::Buffer>& | buffer | |||
) |
const GstPad* Gst::Pad::gobj | ( | ) | const [inline] |
GstPad* Gst::Pad::gobj | ( | ) | [inline] |
GstPad* Gst::Pad::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gst::Object.
bool Gst::Pad::is_active | ( | ) | const |
bool Gst::Pad::is_blocked | ( | ) | const |
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 is_blocking()).
true
if the pad is blocked.bool Gst::Pad::is_blocking | ( | ) | const |
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 Gst::Event.
true
if the pad is blocking.Since: 0.10.11.
bool Gst::Pad::is_linked | ( | ) | const |
Checks if a pad is linked to another pad or not.
true
if the pad is linked, false
otherwise.PadLinkReturn Gst::Pad::link | ( | const Glib::RefPtr<Gst::Pad>& | sink_pad | ) |
Links the source pad and the sink pad.
sinkpad | The sink Gst::Pad to link. |
virtual void Gst::Pad::on_linked | ( | const Glib::RefPtr<Gst::Pad>& | peer_pad | ) | [protected, virtual] |
virtual void Gst::Pad::on_request_link | ( | ) | [protected, virtual] |
virtual void Gst::Pad::on_unlinked | ( | const Glib::RefPtr<Gst::Pad>& | peer_pad | ) | [protected, virtual] |
bool Gst::Pad::pause_task | ( | ) |
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.
true
if the task could be paused or false
when the pad has no task. bool Gst::Pad::peer_accept_caps | ( | const Glib::RefPtr<Gst::Caps>& | caps | ) |
Check if the peer of pad accepts caps.
If pad has no peer, this function Returns: true
if the peer of pad can accept the caps or pad has no peer.
caps | A Gst::Caps to check on the pad. |
true
if the peer of pad can accept the caps or pad has no peer. Glib::RefPtr<const Gst::Caps> Gst::Pad::peer_get_caps | ( | ) | const |
Gets the capabilities of the peer connected to this pad.
0
if there is no peer pad. Glib::RefPtr<Gst::Caps> Gst::Pad::peer_get_caps | ( | ) |
Gets the capabilities of the peer connected to this pad.
0
if there is no peer pad. bool Gst::Pad::peer_query | ( | const Glib::RefPtr<Gst::Query>& | query | ) |
Performs query() on the peer of pad.
The caller is responsible for both the allocation and deallocation of the query structure.
query | The Gst::Query to perform. |
true
if the query could be performed. This function returns false
if pad has no peer.Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Gst::Caps>> Gst::Pad::property_caps | ( | ) | const |
The capabilities of the pad.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<PadDirection> Gst::Pad::property_direction | ( | ) | const |
The direction of the pad.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<PadTemplate> Gst::Pad::property_template | ( | ) | const |
The GstPadTemplate of this pad.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<PadTemplate> Gst::Pad::property_template | ( | ) |
The GstPadTemplate of this pad.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::RefPtr<const Gst::Caps > Gst::Pad::proxy_getcaps | ( | ) | const |
Calls get_allowed_caps() for every other pad belonging to the same element as pad, and returns the intersection of the results.
This function is useful as a default getcaps 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 aggregator.
Glib::RefPtr<Gst::Caps> Gst::Pad::proxy_getcaps | ( | ) |
Calls get_allowed_caps() for every other pad belonging to the same element as pad, and returns the intersection of the results.
This function is useful as a default getcaps 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 aggregator.
bool Gst::Pad::proxy_setcaps | ( | const Glib::RefPtr<Gst::Caps>& | caps | ) |
Calls set_caps() for every other pad belonging to the same element as pad.
If set_caps() fails on any pad, the proxy setcaps fails. May be used only during negotiation.
caps | The Gst::Caps to link with. |
true
if sucessful. FlowReturn Gst::Pad::pull_range | ( | guint64 | offset, | |
guint | size, | |||
Glib::RefPtr<Gst::Buffer>& | buffer | |||
) |
FlowReturn Gst::Pad::push | ( | const Glib::RefPtr<Gst::Buffer>& | buffer | ) |
Pushes a buffer to the peer of the pad.
The pad must be a source pad, otherwise this method returns Gst::FLOW_ERROR.
This function will call an installed pad block before triggering any installed pad probes.
If the caps on buffer are different from the currently configured caps on pad, this function will call any installed setcaps function on pad (see the C API gst_pad_set_setcaps_function()). In case of failure to renegotiate the new format, this function returns Gst::FLOW_NOT_NEGOTIATED.
The function proceeds calling chain() on the peer pad and returns the value from that function. If pad has no peer, Gst::FLOW_NOT_LINKED will be returned.
buffer | The Gst::Buffer to push. |
bool Gst::Pad::push_event | ( | const Glib::RefPtr<Gst::Event>& | event | ) |
Sends the event to the peer of the pad.
This function is mainly used by elements to send events to their peer elements.
event | The GstEvent to send to the pad. |
bool Gst::Pad::query | ( | const Glib::RefPtr<Gst::Query>& | query | ) |
Dispatches a query to a pad.
The query should have been allocated by the caller via one of the type-specific allocation functions in gstquery.h. The element 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.
query | The Gst::Query to perform. |
true
if the query could be performed. bool Gst::Pad::query_convert | ( | Format | src_format, | |
gint64 | src_value, | |||
Format& | dst_format, | |||
gint64 & | dst_value | |||
) | const |
Queries a pad to convert src_val in src_format to dest_format.
src_format | A Gst::Format to convert from. | |
src_val | A value to convert. | |
dest_format | A pointer to the Gst::Format to convert to. | |
dest_val | A pointer to the result. |
true
if the query could be performed. bool Gst::Pad::query_default | ( | const Glib::RefPtr<Gst::Query>& | query | ) |
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 | The Gst::Query to handle. |
true
if the query was performed succesfully. bool Gst::Pad::query_duration | ( | Format& | format | ) | const |
Queries a pad for the total stream duration parsing only the format.
format | A reference to the Gst::Format asked for. On return contains the GstFormat used. |
bool Gst::Pad::query_duration | ( | Format& | format, | |
gint64 & | duration | |||
) | const |
Queries a pad for the total stream duration.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. | |
duration | A location in which to store the total duration, or 0 . |
true
if the query could be performed. bool Gst::Pad::query_peer_convert | ( | Format | src_format, | |
gint64 | src_value, | |||
Format& | dst_format, | |||
gint64 & | dst_value | |||
) | const |
Queries the peer pad of a given sink pad to convert src_val in src_format to dest_format.
src_format | A Gst::Format to convert from. | |
src_val | A value to convert. | |
dest_format | A pointer to the Gst::Format to convert to. | |
dest_val | A pointer to the result. |
true
if the query could be performed. bool Gst::Pad::query_peer_duration | ( | Format& | format | ) | const |
Queries the peer pad of a given sink pad for the total stream duration.
format | A reference to the Gst::Format asked for. On return contains the Gst::Format used. |
bool Gst::Pad::query_peer_duration | ( | Format& | format, | |
gint64 & | duration | |||
) | const |
Queries the peer pad of a given sink pad for the total stream duration.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. | |
duration | A location in which to store the total duration, or 0 . |
true
if the query could be performed. bool Gst::Pad::query_peer_position | ( | Format& | format | ) | const |
Queries the peer of a given sink pad for the stream position parsing only the format.
format | A reference to the Gst::Format asked for. On return contains the Gst::Format used. |
bool Gst::Pad::query_peer_position | ( | Format& | format, | |
gint64 & | position | |||
) | const |
Queries the peer of a given sink pad for the stream position.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. | |
cur | A location in which to store the current position, or 0 . |
true
if the query could be performed. bool Gst::Pad::query_position | ( | Format& | format | ) | const |
Queries a pad for the stream position parsing only the format.
format | A reference to the Gst::Format asked for. On return contains the Gst::Format used. |
bool Gst::Pad::query_position | ( | Format& | format, | |
gint64 & | position | |||
) | const |
Queries a pad for the stream position.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. | |
cur | A location in which to store the current position, or 0 . |
true
if the query could be performed. void Gst::Pad::remove_buffer_probe | ( | guint | handler_id | ) |
Removes a buffer probe from pad.
handler_id | Handler id returned from gst_pad_add_buffer_probe. |
void Gst::Pad::remove_data_probe | ( | guint | handler_id | ) |
Removes a data probe from pad.
handler_id | Handler id returned from gst_pad_add_data_probe. |
void Gst::Pad::remove_event_probe | ( | guint | handler_id | ) |
Removes an event probe from pad.
handler_id | Handler id returned from gst_pad_add_event_probe. |
bool Gst::Pad::send_event | ( | const Glib::RefPtr<Gst::Event>& | event | ) |
Sends the event to the pad.
This function can be used by applications to send events in the pipeline.
If the pad is a source pad, event should be an upstream event. If the pad is a sink pad, the 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::Enums::get_flags(), 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.
event | The Gst::Event to send to the pad. |
bool Gst::Pad::set_active | ( | bool | active = true |
) |
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, checks the pad's current mode and calls activate_push() or activate_pull(), as appropriate, with a false
argument.
active | Whether or not the pad should be active. |
true
if the operation was successful.bool Gst::Pad::set_blocked | ( | bool | blocked = true |
) |
Blocks or unblocks the dataflow on a pad.
This function is a shortcut for set_blocked_async() with a 0
callback.
blocked | Boolean indicating we should block or unblock. |
true
if the pad could be blocked. This function can fail if the wrong parameters were passed or the pad was already in the requested state.bool Gst::Pad::set_blocked_async | ( | const SlotBlock& | slot, | |
bool | blocked = true | |||
) |
Blocks or unblocks the dataflow on a pad asynchronously.
The provided slot is called when the operation succeeds; this happens right before the next attempt at pushing a buffer on the pad.
This can take a while as the pad can only become blocked when real dataflow is happening. When the pipeline is stalled, for example in PAUSED, this can take an indeterminate amount of time. Be careful with this blocking call as it might not return for reasons stated above.
slot | SlotBlock that will be called when the operation succeeds. | |
blocked | boolean indicating whether the pad should be blocked or unblocked. |
bool Gst::Pad::set_caps | ( | const Glib::RefPtr<Gst::Caps>& | caps | ) |
Sets the capabilities of this pad.
The caps must be fixed. Any previous caps on the pad will be unreffed. This function refs the caps so you should unref if as soon as you don't need it anymore. It is possible to set 0
caps, which will make the pad unnegotiated again.
caps | A Gst::Caps to set. |
true
if the caps could be set. false
if the caps were not fixed or bad parameters were provided to this function.Glib::SignalProxy1<void,const Glib::RefPtr<Gst::Pad>&> Gst::Pad::signal_linked | ( | ) |
Signals that a pad has been linked to the peer pad.
void on_my_linked(const Glib::RefPtr<Gst::Pad>& peer_pad)
Glib::SignalProxy0< void > Gst::Pad::signal_request_link | ( | ) |
Signals that a pad connection has been requested.
void on_my_request_link()
Glib::SignalProxy1<void,const Glib::RefPtr<Gst::Pad>&> Gst::Pad::signal_unlinked | ( | ) |
Signals that a pad has been unlinked from the peer pad.
void on_my_unlinked(const Glib::RefPtr<Gst::Pad>& peer_pad)
bool Gst::Pad::stop_task | ( | ) |
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.
true
if the task could be stopped or false
on error. bool Gst::Pad::unlink | ( | const Glib::RefPtr<Gst::Pad>& | sink_pad | ) |
Unlinks the source pad from the sink pad.
Will emit the Gst::Pad::unlinked signal on both pads.
sinkpad | The sink Gst::Pad to unlink. |
true
if the pads were unlinked. This function returns false
if the pads were not linked together.void Gst::Pad::use_fixed_caps | ( | ) |
A helper function you can use that sets the gst_pad_get_fixed_caps_func as the getcaps function for the pad.
This way the function will always return the negotiated caps or in case the pad is not negotiated, the padtemplate caps.
Use this function on a pad that, once _set_caps() has been called on it, cannot be renegotiated to something else.
Glib::RefPtr<Gst::Pad> wrap | ( | GstPad * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |