Gst::Pad Class Reference

A class that represents objects contained by elements that allows links to other elements. More...

`#include <gstreamermm/pad.h>`

Inheritance diagram for Gst::Pad:
[legend]

## Public Types

typedef sigc::slot< PadProbeReturn, const Glib::RefPtr< Gst::Pad >&, const Gst::PadProbeInfo&> | SlotProbe
| For example, bool on_have_data(const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::MiniObjec>& data);. More...
typedef sigc::slot< Gst::FlowReturn, const Glib::RefPtr< Gst::Pad >&, Glib::RefPtr< Gst::Buffer >&> | SlotChain
typedef sigc::slot< gboolean, const Glib::RefPtr< Gst::Pad >&, Glib::RefPtr< Gst::Event >&> | SlotEvent
typedef sigc::slot< gboolean, const Glib::RefPtr< Gst::Pad >&, Glib::RefPtr< Gst::Query >&> | SlotQuery
typedef sigc::slot< bool, const Glib::RefPtr< Gst::Pad >&> | SlotActivate
typedef sigc::slot< bool, const Glib::RefPtr< Gst::Pad >&, Gst::PadMode, bool > | SlotActivatemode
typedef sigc::slot< Gst::FlowReturn, const Glib::RefPtr< Gst::Pad >&, guint64, guint, Glib::RefPtr< Gst::Buffer >&> | SlotGetrange

## Public Member Functions

| Pad (Pad&& src) noexcept
Pad& | operator= (Pad&& src) noexcept
| ~Pad () noexcept override
GstPad* | gobj ()
| Provides access to the underlying C GObject. More...
const GstPad* | gobj () const
| Provides access to the underlying C GObject. More...
GstPad* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Gst::PadMode | get_mode () const
Glib::RefPtr< Gst::Caps > | query_caps (Glib::RefPtr< Gst::Caps > caps)
| Gets the capabilities this pad can produce or consume. More...
Glib::RefPtr< const Gst::Caps > | query_caps (Glib::RefPtr< Gst::Caps > caps) const
| Gets the capabilities this pad can produce or consume. More...
PadDirection | get_direction () const
| Gets the direction of the pad. More...
Glib::RefPtr< Gst::Element > | get_parent_element ()
| Gets the parent of pad, cast to a Gst::Element. More...
Glib::RefPtr< const Gst::Element > | get_parent_element () const
| Gets the parent of pad, cast to a Gst::Element. More...
Glib::RefPtr< Gst::PadTemplate > | get_pad_template ()
| Gets the template for pad. More...
Glib::RefPtr< const Gst::PadTemplate > | get_pad_template () const
| Gets the template for pad. More...
PadLinkReturn | link (const Glib::RefPtr< Gst::Pad >& sink_pad)
| Links the source pad and the sink pad. More...
bool | unlink (const Glib::RefPtr< Gst::Pad >& sink_pad)
| Unlinks the source pad from the sink pad. More...
bool | is_linked () const
| Checks if a pad is linked to another pad or not. More...
bool | can_link (const Glib::RefPtr< const Gst::Pad >& other_pad) const
| Checks if the source pad and the sink pad are compatible so they can be linked. More...
Glib::RefPtr< Gst::Caps > | get_allowed_caps ()
| Gets the capabilities of the allowed media types that can flow through pad and its peer. More...
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. More...
Glib::RefPtr< Gst::Caps > | get_pad_template_caps ()
| Gets the capabilities for pad's template. More...
Glib::RefPtr< const Gst::Caps > | get_pad_template_caps () const
| Gets the capabilities for pad's template. More...
gulong | add_probe (PadProbeType mask, const SlotProbe& slot)
void | remove_probe (gulong id)
| Remove the probe with id from pad. More...
Glib::RefPtr< Gst::Pad > | get_peer ()
| Gets the peer of pad. More...
Glib::RefPtr< const Gst::Pad > | get_peer () const
| Gets the peer of pad. More...
void | use_fixed_caps ()
| 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. More...
bool | is_active () const
| Query if a pad is active. More...
bool | is_blocked () const
| Checks if the pad is blocked or not. More...
bool | is_blocking () const
| Checks if the pad is blocking or not. More...
void | mark_reconfigure ()
| Mark a pad for needing reconfiguration. More...
bool | needs_reconfigure () const
| Check the Gst::PAD_FLAG_NEED_RECONFIGURE flag on pad and return `true` if the flag was set. More...
bool | check_reconfigure ()
| Check and clear the Gst::PAD_FLAG_NEED_RECONFIGURE flag on pad and return `true` if the flag was set. More...
bool | has_current_caps () const
| Check if pad has caps set on it with a Gst::EVENT_CAPS event. More...
Glib::ustring | create_stream_id (const Glib::RefPtr< Gst::Element >& parent, const Glib::ustring& stream_id)
| 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. More...
Glib::ustring | get_stream_id () const
| Returns the current stream-id for the pad, or `nullptr` if none has been set yet, i.e. the pad has not received a stream-start event yet. More...
void | set_offset (gint64 offset)
| Set the offset that will be applied to the running time of pad. More...
gint64 | get_offset () const
| Get the offset applied to the running time of pad. More...
void | set_element_private (gpointer priv)
| Set the given private data gpointer on the pad. More...
gpointer | get_element_private ()
| Gets the private data of a pad. More...
FlowReturn | get_range (guint64 offset, guint size, Glib::RefPtr< Gst::Buffer >& buffer)
| When pad is flushing this function returns Gst::FLOW_WRONG_STATE immediatly. More...
bool | query_accept_caps (const Glib::RefPtr< const Gst::Caps >& caps) const
| Check if the given pad accepts the caps. More...
bool | proxy_query_caps (const Glib::RefPtr< Gst::Query >&query) const
| Calls query_caps() for all internally linked pads of pad and returns the intersection of the results. More...
bool | proxy_query_accept_caps (const Glib::RefPtr< Gst::Query >&query) const
| Checks if all internally linked pads of pad accepts the caps in query and returns the intersection of the results. More...
bool | peer_query_accept_caps (const Glib::RefPtr< const Gst::Caps >& caps) const
| Check if the peer of pad accepts caps. More...
bool | peer_query_position (Gst::Format format, gint64& cur) const
| Queries the peer of a given sink pad for the stream position. More...
bool | peer_query_duration (Gst::Format format, gint64& duration) const
| Queries the peer pad of a given sink pad for the total stream duration. More...
FlowReturn | push (Glib::RefPtr< Gst::Buffer >&& buffer)
| Pushes a buffer to the peer of pad. More...
bool | push_event (Glib::RefPtr< Gst::Event >&& event)
| Sends the event to the peer of the given pad. More...
bool | push_event (const Glib::RefPtr< Gst::Event >& event)
| A push_event() convenience overload. Allows to re-use event parameter after function call. More...
FlowReturn | pull_range (guint64 offset, guint size, Glib::RefPtr< Gst::Buffer >& buffer)
| Pulls a buffer from the peer pad. More...
bool | send_event (Glib::RefPtr< Gst::Event >&& event)
| Sends the event to the pad. More...
bool | send_event (const Glib::RefPtr< Gst::Event >& event)
| A send_event() convenience overload. Allows to re-use event parameter after function call. More...
bool | activate_mode (Gst::PadMode mode, bool active=true)
| Activates or deactivates the given pad in mode via dispatching to the pad's activatemodefunc. More...
bool | event_default (const Glib::RefPtr< Gst::Object >& parent, Glib::RefPtr< Gst::Event >&& event)
| Invokes the default event handler for the given pad. More...
bool | event_default (Glib::RefPtr< Gst::Event >&& event)
| A event_default() convenience overload. More...
bool | query (const Glib::RefPtr< Gst::Query >& query) const
| Dispatches a query to a pad. More...
bool | peer_query (const Glib::RefPtr< Gst::Query >&query) const
| Performs query() on the peer of pad. More...
Glib::RefPtr< Gst::Caps > | peer_query_caps (const Glib::RefPtr< Gst::Caps >& filter) const
| Gets the capabilities of the peer connected to this pad. More...
bool | query_default (const Glib::RefPtr< Gst::Object >& parent, const Glib::RefPtr< Gst::Query >&query) const
| Invokes the default query handler for the given pad. More...
bool | query_default (const Glib::RefPtr< Gst::Query >&query) const
| A query_default() convenience overload. More...
bool | query_position (Format format, gint64& position) const
| Queries a pad for the stream position. More...
bool | query_position (Format& format) const
| Queries a pad for the stream position parsing only the format. More...
bool | query_duration (Format format, gint64& duration) const
| Queries a pad for the total stream duration. More...
bool | query_duration (Format& format) const
| Queries a pad for the total stream duration parsing only the format. More...
bool | query_convert (Format src_format, gint64 src_value, Format dst_format, gint64& dst_value) const
| Queries a pad to convert src_value in src_format to dst_format. More...
bool | peer_query_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_value in src_format to dst_format. More...
Gst::Iterator< Gst::Pad > | iterate_internal_links ()
| Gets an iterator for the pads to which the given pad is linked to inside of the parent element. More...
Gst::Iterator< const Gst::Pad > | iterate_internal_links () const
| Gets an iterator for the pads to which the given pad is linked to inside of the parent element. More...
Gst::Iterator< Gst::Pad > | iterate_internal_links_default (const Glib::RefPtr< Gst::Object >& parent)
| Iterate the list of pads to which the given pad is linked to inside of the parent element. More...
Gst::Iterator< Gst::Pad > | iterate_internal_links_default ()
| A iterate_internal_links_default() convenience overload. More...
Gst::Iterator< const Gst::Pad > | iterate_internal_links_default (const Glib::RefPtr< Gst::Object >& parent) const
| Iterate the list of pads to which the given pad is linked to inside of the parent element. More...
Gst::Iterator< const Gst::Pad > | iterate_internal_links_default () const
| A iterate_internal_links_default() convenience overload. More...
Gst::FlowReturn | chain (Glib::RefPtr< Gst::Buffer >&& buffer)
| Chain a buffer to pad. More...
Glib::RefPtr< Gst::Caps > | get_current_caps ()
| Gets the capabilities currently configured on pad with the last Gst::EVENT_CAPS event. More...
bool | pause_task ()
| Pause the task of pad. More...
bool | stop_task ()
| Stop the task of pad. More...
bool | set_active (bool active=true)
| Activates or deactivates the given pad. More...
Gst::FlowReturn | get_last_flow_return () const
| Gets the Gst::FlowReturn return from the last data passed by this pad. More...
Glib::RefPtr< Gst::Event > | get_sticky_event (Gst::EventType event_type, guint idx) const
| Returns a new reference of the sticky event of type event_type from the event. More...
void | set_chain_function (const SlotChain& slot)
void | set_event_function (const SlotEvent& slot)
void | set_query_function (const SlotQuery& slot)
void | set_activate_function (const SlotActivate& slot)
void | set_activatemode_function (const SlotActivatemode& slot)
void | set_getrange_function (const SlotGetrange& slot)
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Pad >&> | signal_linked ()
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Pad >&> | signal_unlinked ()
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Caps > > | property_caps () const
| The capabilities of the pad. More...
Glib::PropertyProxy_ReadOnly< PadDirection > | property_direction () const
| The direction of the pad. More...
Glib::PropertyProxy< PadTemplate > | property_template ()
| The GstPadTemplate of this pad. More...
Glib::PropertyProxy_ReadOnly< PadTemplate > | property_template () const
| The GstPadTemplate of this pad. More...
Glib::PropertyProxy< gint64 > | property_offset ()
| The running time offset of the pad. More...
Glib::PropertyProxy_ReadOnly< gint64 > | property_offset () const
| The running time offset of the pad. More...
bool | is_ghost_pad () const
| Checks whether pad is a ghostpad. More...
bool | is_proxy_pad () const
void | exception_handler ()
| Handle exceptions occuring in callback methods. More...
Public Member Functions inherited from Gst::Object
| Object (Object&& src) noexcept
Object& | operator= (Object&& src) noexcept
| ~Object () noexcept override
GstObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GstObject* | gobj () const
| Provides access to the underlying C GObject. More...
GstObject* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | is_element () const
bool | is_element_factory () const
bool | is_pad () const
bool | is_pad_template () const
bool | is_bin () const
guint32 | get_flags () const
| Returns the entire set of flags for the object. More...
bool | set_name (const Glib::ustring& name)
| Sets the name of object, or gives object a guaranteed unique name (if name is `nullptr`). More...
Glib::ustring | get_name () const
| Returns a copy of the name of object. More...
bool | set_parent (const Glib::RefPtr< Gst::Object >& parent)
| Sets the parent of object to parent. More...
Glib::RefPtr< Gst::Object > | get_parent ()
| Returns the parent of object. More...
Glib::RefPtr< const Gst::Object > | get_parent () const
| Returns the parent of object. More...
void | unparent ()
| Clear the parent of object, removing the associated reference. More...
void | set_control_rate (Gst::ClockTime control_rate)
| Change the control-rate for this object. More...
Gst::ClockTime | get_control_rate () const
| Obtain the control-rate for this object. More...
Gst::ClockTime | suggest_next_sync () const
| Returns a suggestion for timestamps where buffers should be split to get best controller results. More...
bool | sync_values (Gst::ClockTime timestamp)
| Sets the properties of the object, according to the Gst::ControlSources that (maybe) handle them and for the given timestamp. More...
void | set_control_bindings_disabled (bool disabled)
| This function is used to disable all controlled properties of the object for some time, i.e. sync_values() will do nothing. More...
bool | has_asctive_control_bindings () const
| Check if the object has an active controlled properties. More...
bool | has_ancestor (const Glib::RefPtr< const Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_ancestor (const Glib::RefPtr< Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_parent (const Glib::RefPtr< Gst::Object >& parent) const
| Check if parent is the parent of object. More...
Glib::ustring | get_path_string ()
| Generates a string describing the path of object in the object hierarchy. More...
Glib::PropertyProxy< Glib::ustring > | property_name ()
| The name of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const
| The name of the object. More...
Glib::PropertyProxy< Glib::RefPtr< Gst::Object > > | property_parent ()
| The parent of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Object > > | property_parent () const
| The parent of the object. More...
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Object >&, GParamSpec*> | signal_deep_notify ()
int | get_refcount () const

## Static Public Member Functions

static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< Pad > | create (const Glib::ustring& name, PadDirection dir)
| Creates a new pad with the given name in the given direction. More...
static Glib::RefPtr< Pad > | create (PadDirection dir)
| Creates a new pad with a guaranteed unique name (across all pads) in the given direction. More...
static Glib::RefPtr< Pad > | create (const Glib::RefPtr< const Gst::PadTemplate >& pad_template)
| Creates a new pad with the given name from the given template. More...
static Glib::RefPtr< Pad > | create (const Glib::RefPtr< const Gst::PadTemplate >& pad_template, const Glib::ustring& name)
| Creates a new pad with a guaranteed unique name (across all pads) from the given template. More...
static GstFlowReturn | Pad_Chain_gstreamermm_callback (GstPad* pad, GstObject* parent, GstBuffer* buffer)
static gboolean | Pad_Event_gstreamermm_callback (GstPad* pad, GstObject* parent, GstEvent* event)
static gboolean | Pad_Query_gstreamermm_callback (GstPad* pad, GstObject* parent, GstQuery*query)
static gboolean | Pad_Activate_gstreamermm_callback (GstPad* pad, GstObject* parent)
static gboolean | Pad_Activatemode_gstreamermm_callback (GstPad* pad, GstObject* parent, GstPadMode mode, gboolean active)
static GstFlowReturn | Pad_Getrange_gstreamermm_callback (GstPad* pad, GstObject* parent, guint64 offset, guint length, GstBuffer** buffer)
Static Public Member Functions inherited from Gst::Object
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | check_uniqueness (const Glib::ListHandle< const Gst::Object >& list, const Glib::ustring& name)
| Checks to see if there is any object named name in list. More...

## Protected Member Functions

| Pad (const Glib::ustring& name, PadDirection direction)
| Constructs a Pad given a name and a direction. More...
| Pad (PadDirection direction)
| Constructs a Pad given a direction without specifying a name. More...
| Pad (const Glib::RefPtr< const Gst::PadTemplate >& templ, const Glib::ustring& name)
| Constructs a Pad from a PadTemplate with the specified name. More...
| Pad (const Glib::RefPtr< const Gst::PadTemplate >& templ)
| Constructs a Pad from a PadTemplate without specifying a name. More...
virtual void | on_linked (const Glib::RefPtr< Gst::Pad >& peer_pad)
| This is a default handler for the signal signal_linked(). More...
virtual void | on_unlinked (const Glib::RefPtr< Gst::Pad >& peer_pad)
| This is a default handler for the signal signal_unlinked(). More...
Protected Member Functions inherited from Gst::Object
virtual void | on_deep_notify (const Glib::RefPtr< Gst::Object >& prop_object, GParamSpec* prop)
| This is a default handler for the signal signal_deep_notify(). More...

## 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. More...
Related Functions inherited from Gst::Object
Glib::RefPtr< Gst::Object > | wrap (GstObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

A class that represents objects contained by elements that allows links to other elements.

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 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 2016-06-06 (1.8.0)

## Member Typedef Documentation

## SlotActivate

typedef sigc::slot< bool, const Glib::RefPtr<Gst::Pad>& > Gst::Pad::SlotActivate

## SlotActivatemode

typedef sigc::slot< bool, const Glib::RefPtr<Gst::Pad>&, Gst::PadMode, bool > Gst::Pad::SlotActivatemode

## SlotChain

typedef sigc::slot< Gst::FlowReturn, const Glib::RefPtr<Gst::Pad>&, Glib::RefPtr<Gst::Buffer>& > Gst::Pad::SlotChain

## SlotEvent

typedef sigc::slot< gboolean, const Glib::RefPtr<Gst::Pad>&, Glib::RefPtr<Gst::Event>& > Gst::Pad::SlotEvent

## SlotGetrange

typedef sigc::slot< Gst::FlowReturn, const Glib::RefPtr<Gst::Pad>&, guint64, guint, Glib::RefPtr<Gst::Buffer>& > Gst::Pad::SlotGetrange

## SlotProbe

typedef sigc::slot< PadProbeReturn, const Glib::RefPtr<Gst::Pad>&, const Gst::PadProbeInfo& > Gst::Pad::SlotProbe

For example, bool on_have_data(const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::MiniObjec>& data);.

## SlotQuery

typedef sigc::slot< gboolean, const Glib::RefPtr<Gst::Pad>&, Glib::RefPtr<Gst::Query>& > Gst::Pad::SlotQuery

## Constructor & Destructor Documentation

## Pad() [1/5]

Gst::Pad::Pad | ( | Pad&& | src | ) |

noexcept

## ~Pad()

Gst::Pad::~Pad | ( |  | ) |

override noexcept

## Pad() [2/5]

Gst::Pad::Pad | ( | const Glib::ustring & | name,
|  | PadDirection | direction
| ) |  |

explicit protected

Constructs a Pad given a name and a direction.

Parameters

  name | The desired name of the pad.
  direction | The desired direction of the pad.

## Pad() [3/5]

Gst::Pad::Pad | ( | PadDirection | direction | ) |

explicit protected

Constructs a Pad given a direction without specifying a name.

A unique name will be assigned to the pad.

Parameters

  direction | the direction of the pad.

## Pad() [4/5]

Gst::Pad::Pad | ( | const Glib::RefPtr< const Gst::PadTemplate >& | templ,
|  | const Glib::ustring & | name
| ) |  |

protected

Constructs a Pad from a PadTemplate with the specified name.

Parameters

  templ | The PadTemplate.
  name | The desired name of the pad.

Exceptions

  std::runtime_error | if construction fails.

## Pad() [5/5]

Gst::Pad::Pad | ( | const Glib::RefPtr< const Gst::PadTemplate >& | templ | ) |

explicit protected

Constructs a Pad from a PadTemplate without specifying a name.

A unique name will ge assigned to the pad.

Parameters

  templ | The PadTemplate.

Exceptions

  std::runtime_error | if construction fails.

## Member Function Documentation

## activate_mode()

bool Gst::Pad::activate_mode | ( | Gst::PadMode | mode,
|  | bool | active = `true`
| ) |  |

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.

Parameters

  mode | The requested activation mode.
  active | Whether or not the pad should be active.

Returns
  `true` if the operation was successful.

MT safe.

## add_probe()

gulong Gst::Pad::add_probe | ( | PadProbeType | mask,
|  | const SlotProbe& | slot
| ) |  |

## can_link()

bool Gst::Pad::can_link | ( | const Glib::RefPtr< const Gst::Pad >& | other_pad | ) | const

Checks if the source pad and the sink pad are compatible so they can be linked.

Parameters

  other_pad | The sink Gst::Pad.

Returns
  `true` if the pads can be linked.

## chain()

Gst::FlowReturn Gst::Pad::chain | ( | Glib::RefPtr< Gst::Buffer >&& | buffer | ) |

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.

Parameters

  buffer | The Gst::Buffer to send, return GST_FLOW_ERROR if not.

Returns
  A Gst::FlowReturn from the pad.

MT safe.

## check_reconfigure()

bool Gst::Pad::check_reconfigure | ( |  | ) |

Check and clear the Gst::PAD_FLAG_NEED_RECONFIGURE flag on pad and return `true` if the flag was set.

Returns
  `true` is the GST_PAD_FLAG_NEED_RECONFIGURE flag was set on pad.

## create() [1/4]

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.

Parameters

  name | The name of the new pad.
  dir | The PadDirection of the pad.

Returns
  A new Gst::Pad, or a null RefPtr<> in case of an error. MT safe.

## create() [2/4]

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.

Parameters

  dir | The PadDirection of the pad.

Returns
  A new Gst::Pad, or a null RefPtr<> in case of an error. MT safe.

## create() [3/4]

static Glib::RefPtr<Pad> Gst::Pad::create | ( | const Glib::RefPtr< const Gst::PadTemplate >& | pad_template | ) |

static

Creates a new pad with the given name from the given template.

Parameters

  pad_template | The pad template to use.

Returns
  A new Gst::Pad, or a null RefPtr<> in case of an error.

Exceptions

  std::runtime_error | if construction fails.

## create() [4/4]

static Glib::RefPtr<Pad> Gst::Pad::create | ( | const Glib::RefPtr< const 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.

Parameters

  pad_template | The pad template to use.
  name | The name of the pad.

Returns
  A new Gst::Pad, or a null RefPtr<> in case of an error.

Exceptions

  std::runtime_error | if construction fails.

## create_stream_id()

Glib::ustring Gst::Pad::create_stream_id | ( | const Glib::RefPtr< Gst::Element >& | parent,
|  | const Glib::ustring & | stream_id
| ) |  |

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 `nullptr` 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.

Parameters

  parent | Parent Gst::Element of pad.
  stream_id | The stream-id.

Returns
  A stream-id for pad.

## event_default() [1/2]

bool Gst::Pad::event_default | ( | const Glib::RefPtr< Gst::Object >& | parent,
|  | Glib::RefPtr< Gst::Event >&& | event
| ) |  |

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.

Parameters

  parent | The parent of pad or `nullptr`.
  event | The Gst::Event to handle.

Returns
  `true` if the event was sent successfully.

## event_default() [2/2]

bool Gst::Pad::event_default | ( | Glib::RefPtr< Gst::Event >&& | event | ) |

A event_default() convenience overload.

## exception_handler()

void Gst::Pad::exception_handler | ( |  | ) |

Handle exceptions occuring in callback methods.

## get_allowed_caps() [1/2]

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 query_caps() on pad and its peer. The caller owns a reference on the resulting caps.

Returns
  The allowed Gst::Caps of the pad link. Unref the caps when you no longer need it. This function returns `nullptr` when pad has no peer.

MT safe.

## get_allowed_caps() [2/2]

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 query_caps() on pad and its peer. The caller owns a reference on the resulting caps.

Returns
  The allowed Gst::Caps of the pad link. Unref the caps when you no longer need it. This function returns `nullptr` when pad has no peer.

MT safe.

## get_current_caps()

Glib::RefPtr<Gst::Caps> Gst::Pad::get_current_caps | ( |  | ) |

Gets the capabilities currently configured on pad with the last Gst::EVENT_CAPS event.

Returns
  The current caps of the pad with incremented ref-count or `nullptr` when pad has no caps. Unref after usage.

## get_direction()

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.

Returns
  The Gst::PadDirection of the pad.

MT safe.

## get_element_private()

gpointer Gst::Pad::get_element_private | ( |  | ) |

Gets the private data of a pad.

No locking is performed in this function.

Returns
  A #gpointer to the private data.

## get_last_flow_return()

Gst::FlowReturn Gst::Pad::get_last_flow_return | ( |  | ) | const

Gets the Gst::FlowReturn return from the last data passed by this pad.

## get_mode()

Gst::PadMode Gst::Pad::get_mode | ( |  | ) | const

## get_offset()

gint64 Gst::Pad::get_offset | ( |  | ) | const

Get the offset applied to the running time of pad.

pad has to be a source pad.

Returns
  The offset.

## get_pad_template() [1/2]

Glib::RefPtr<Gst::PadTemplate> Gst::Pad::get_pad_template | ( |  | ) |

Gets the template for pad.

Returns
  The Gst::PadTemplate from which this pad was instantiated, or `nullptr` if this pad has no template. Unref after usage.

## get_pad_template() [2/2]

Glib::RefPtr<const Gst::PadTemplate> Gst::Pad::get_pad_template | ( |  | ) | const

Gets the template for pad.

Returns
  The Gst::PadTemplate from which this pad was instantiated, or `nullptr` if this pad has no template. Unref after usage.

## get_pad_template_caps() [1/2]

Glib::RefPtr<Gst::Caps> Gst::Pad::get_pad_template_caps | ( |  | ) |

Gets the capabilities for pad's template.

Returns
  The Gst::Caps of this pad template. Unref after usage.

## get_pad_template_caps() [2/2]

Glib::RefPtr<const Gst::Caps> Gst::Pad::get_pad_template_caps | ( |  | ) | const

Gets the capabilities for pad's template.

Returns
  The Gst::Caps of this pad template. Unref after usage.

## get_parent_element() [1/2]

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 `nullptr`.

Returns
  The parent of the pad. The caller has a reference on the parent, so unref when you're finished with it.

MT safe.

## get_parent_element() [2/2]

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 `nullptr`.

Returns
  The parent of the pad. The caller has a reference on the parent, so unref when you're finished with it.

MT safe.

## get_peer() [1/2]

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.

Returns
  The peer Gst::Pad. Unref after usage.

MT safe.

## get_peer() [2/2]

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.

Returns
  The peer Gst::Pad. Unref after usage.

MT safe.

## get_range()

FlowReturn Gst::Pad::get_range | ( | guint64 | offset,
|  | guint | size,
|  | Glib::RefPtr< Gst::Buffer >& | buffer
| ) |  |

When pad is flushing this function returns Gst::FLOW_WRONG_STATE immediatly.

Calls the getrange function of pad. If pad has no getrange function installed this function returns Gst::FLOW_NOT_SUPPORTED.

This is a lowlevel function. Usually pull_range() is used. This function is designed to be used with a source pad only.

Parameters

  offset | The start offset of the buffer.
  size | The length of the buffer.
  buffer | An unitialized Glib::RefPtr<> in which to store the Gst::Buffer.

Returns
  A Gst::FlowReturn from the pad (Gst::FLOW_NOT_SUPPORTED if pad is not a source pad). MT safe.

## get_sticky_event()

Glib::RefPtr<Gst::Event> Gst::Pad::get_sticky_event | ( | Gst::EventType | event_type,
|  | guint | idx
| ) |  | const

Returns a new reference of the sticky event of type event_type from the event.

Parameters

  event_type | The Gst::EventType that should be retrieved.
  idx | The index of the event.

Returns
  A Gst::Event of type event_type or `nullptr` when no event of event_type was on pad. Unref after usage.

## get_stream_id()

Glib::ustring Gst::Pad::get_stream_id | ( |  | ) | const

Returns the current stream-id for the pad, or `nullptr` if none has been set yet, i.e. the pad has not received a stream-start event yet.

This is a convenience wrapper around 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.

Returns
  A newly-allocated copy of the stream-id for pad, or `nullptr`.

## get_type()

static GType Gst::Pad::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

## gobj() [1/2]

GstPad* Gst::Pad::gobj | ( |  | ) |

inline

Provides access to the underlying C GObject.

## gobj() [2/2]

const GstPad* Gst::Pad::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

## gobj_copy()

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.

## has_current_caps()

bool Gst::Pad::has_current_caps | ( |  | ) | const

Check if pad has caps set on it with a Gst::EVENT_CAPS event.

Returns
  `true` when pad has caps associated with it.

## is_active()

bool Gst::Pad::is_active | ( |  | ) | const

Query if a pad is active.

Returns
  `true` if the pad is active.

MT safe.

## is_blocked()

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()).

Returns
  `true` if the pad is blocked.

MT safe.

## is_blocking()

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.

Returns
  `true` if the pad is blocking.

MT safe.

## is_ghost_pad()

bool Gst::Pad::is_ghost_pad | ( |  | ) | const

Checks whether pad is a ghostpad.

## is_linked()

bool Gst::Pad::is_linked | ( |  | ) | const

Checks if a pad is linked to another pad or not.

Returns
  `true` if the pad is linked, `false` otherwise.

MT safe.

## is_proxy_pad()

bool Gst::Pad::is_proxy_pad | ( |  | ) | const

## iterate_internal_links() [1/2]

Gst::Iterator<Gst::Pad> Gst::Pad::iterate_internal_links | ( |  | ) |

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

Returns
  A new Gst::Iterator of Gst::Pad or `nullptr` when the pad does not have an iterator function configured. Use Gst::Iterator::free() after usage.

## iterate_internal_links() [2/2]

Gst::Iterator<const Gst::Pad> Gst::Pad::iterate_internal_links | ( |  | ) | const

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

Returns
  A new Gst::Iterator of Gst::Pad or `nullptr` when the pad does not have an iterator function configured. Use Gst::Iterator::free() after usage.

## iterate_internal_links_default() [1/4]

Gst::Iterator<Gst::Pad> Gst::Pad::iterate_internal_links_default | ( | const Glib::RefPtr< Gst::Object >& | parent | ) |

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().

Parameters

  parent | The parent of pad or `nullptr`.

Returns
  A Gst::Iterator of Gst::Pad, or `nullptr` if pad has no parent. Unref each returned pad with Gst::Object::unref().

## iterate_internal_links_default() [2/4]

Gst::Iterator<Gst::Pad> Gst::Pad::iterate_internal_links_default | ( |  | ) |

A iterate_internal_links_default() convenience overload.

## iterate_internal_links_default() [3/4]

Gst::Iterator<const Gst::Pad> Gst::Pad::iterate_internal_links_default | ( | const Glib::RefPtr< Gst::Object >& | parent | ) | const

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().

Parameters

  parent | The parent of pad or `nullptr`.

Returns
  A Gst::Iterator of Gst::Pad, or `nullptr` if pad has no parent. Unref each returned pad with Gst::Object::unref().

## iterate_internal_links_default() [4/4]

Gst::Iterator<const Gst::Pad> Gst::Pad::iterate_internal_links_default | ( |  | ) | const

A iterate_internal_links_default() convenience overload.

## link()

PadLinkReturn Gst::Pad::link | ( | const Glib::RefPtr< Gst::Pad >& | sink_pad | ) |

Links the source pad and the sink pad.

Parameters

  sink_pad | The sink Gst::Pad to link.

Returns
  A result code indicating if the connection worked or what went wrong.

MT Safe.

## mark_reconfigure()

void Gst::Pad::mark_reconfigure | ( |  | ) |

Mark a pad for needing reconfiguration.

The next call to check_reconfigure() will return `true` after this call.

## needs_reconfigure()

bool Gst::Pad::needs_reconfigure | ( |  | ) | const

Check the Gst::PAD_FLAG_NEED_RECONFIGURE flag on pad and return `true` if the flag was set.

Returns
  `true` is the GST_PAD_FLAG_NEED_RECONFIGURE flag is set on pad.

## on_linked()

virtual void Gst::Pad::on_linked | ( | const Glib::RefPtr< Gst::Pad >& | peer_pad | ) |

protected virtual

This is a default handler for the signal signal_linked().

## on_unlinked()

virtual void Gst::Pad::on_unlinked | ( | const Glib::RefPtr< Gst::Pad >& | peer_pad | ) |

protected virtual

This is a default handler for the signal signal_unlinked().

## operator=()

Pad& Gst::Pad::operator= | ( | Pad&& | src | ) |

noexcept

## Pad_Activate_gstreamermm_callback()

static gboolean Gst::Pad::Pad_Activate_gstreamermm_callback | ( | GstPad * | pad,
|  | GstObject * | parent
| ) |  |

static

## Pad_Activatemode_gstreamermm_callback()

static gboolean Gst::Pad::Pad_Activatemode_gstreamermm_callback | ( | GstPad * | pad,
|  | GstObject * | parent,
|  | GstPadMode | mode,
|  | gboolean | active
| ) |  |

static

## Pad_Chain_gstreamermm_callback()

static GstFlowReturn Gst::Pad::Pad_Chain_gstreamermm_callback | ( | GstPad * | pad,
|  | GstObject * | parent,
|  | GstBuffer * | buffer
| ) |  |

static

## Pad_Event_gstreamermm_callback()

static gboolean Gst::Pad::Pad_Event_gstreamermm_callback | ( | GstPad * | pad,
|  | GstObject * | parent,
|  | GstEvent * | event
| ) |  |

static

## Pad_Getrange_gstreamermm_callback()

static GstFlowReturn Gst::Pad::Pad_Getrange_gstreamermm_callback | ( | GstPad * | pad,
|  | GstObject * | parent,
|  | guint64 | offset,
|  | guint | length,
|  | GstBuffer ** | buffer
| ) |  |

static

## Pad_Query_gstreamermm_callback()

static gboolean Gst::Pad::Pad_Query_gstreamermm_callback | ( | GstPad * | pad,
|  | GstObject * | parent,
|  | GstQuery * | query
| ) |  |

static

## pause_task()

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.

Returns
  A `true` if the task could be paused or `false` when the pad has no task.

## peer_query()

bool Gst::Pad::peer_query | ( | const Glib::RefPtr< Gst::Query >& | query | ) | const

Performs query() on the peer of pad.

The caller is responsible for both the allocation and deallocation of the query structure.

Parameters

  query | The Gst::Query to perform.

Returns
  `true` if the query could be performed. This function returns `false` if pad has no peer.

## peer_query_accept_caps()

bool Gst::Pad::peer_query_accept_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const

Check if the peer of pad accepts caps.

If pad has no peer, this function returns `true`.

Parameters

  caps | A Gst::Caps to check on the pad.

Returns
  `true` if the peer of pad can accept the caps or pad has no peer.

## peer_query_caps()

Glib::RefPtr<Gst::Caps> Gst::Pad::peer_query_caps | ( | const Glib::RefPtr< Gst::Caps >& | filter | ) | const

Gets the capabilities of the peer connected to this pad.

Similar to 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 `nullptr` but if it is not `nullptr` the returned caps will be a subset of filter.

Parameters

  filter | A Gst::Caps filter, or `nullptr`.

Returns
  The caps of the peer pad with incremented ref-count. When there is no peer pad, this function returns filter or, when filter is `nullptr`, ANY caps.

## peer_query_convert()

bool Gst::Pad::peer_query_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_value in src_format to dst_format.

Parameters

  src_format | A Gst::Format to convert from.
  src_value | A value to convert.
  dst_format | The Gst::Format to convert to.
  dst_value | A pointer to the result.

Returns
  `true` if the query could be performed.

## peer_query_duration()

bool Gst::Pad::peer_query_duration | ( | Gst::Format | format,
|  | gint64 & | duration
| ) |  | const

Queries the peer pad of a given sink pad for the total stream duration.

Parameters

  format | The Gst::Format requested.
  duration | A location in which to store the total duration, or `nullptr`.

Returns
  `true` if the query could be performed.

## peer_query_position()

bool Gst::Pad::peer_query_position | ( | Gst::Format | format,
|  | gint64 & | cur
| ) |  | const

Queries the peer of a given sink pad for the stream position.

Parameters

  format | The Gst::Format requested.
  cur | A location in which to store the current position, or `nullptr`.

Returns
  `true` if the query could be performed.

## property_caps()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> > Gst::Pad::property_caps | ( |  | ) | const

The capabilities of the pad.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_direction()

Glib::PropertyProxy_ReadOnly< PadDirection > Gst::Pad::property_direction | ( |  | ) | const

The direction of the pad.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_offset() [1/2]

Glib::PropertyProxy< gint64 > Gst::Pad::property_offset | ( |  | ) |

The running time offset of the pad.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_offset() [2/2]

Glib::PropertyProxy_ReadOnly< gint64 > Gst::Pad::property_offset | ( |  | ) | const

The running time offset of the pad.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_template() [1/2]

Glib::PropertyProxy< PadTemplate > Gst::Pad::property_template | ( |  | ) |

The GstPadTemplate of this pad.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_template() [2/2]

Glib::PropertyProxy_ReadOnly< PadTemplate > Gst::Pad::property_template | ( |  | ) | const

The GstPadTemplate of this pad.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## proxy_query_accept_caps()

bool Gst::Pad::proxy_query_accept_caps | ( | const Glib::RefPtr< Gst::Query >& | query | ) | const

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.

Parameters

  query | An ACCEPT_CAPS Gst::Query.

Returns
  `true` if query could be executed.

## proxy_query_caps()

bool Gst::Pad::proxy_query_caps | ( | const Glib::RefPtr< Gst::Query >& | query | ) | const

Calls 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.

Parameters

  query | A CAPS Gst::Query.

Returns
  `true` if query could be executed.

## pull_range()

FlowReturn Gst::Pad::pull_range | ( | guint64 | offset,
|  | guint | size,
|  | Glib::RefPtr< Gst::Buffer >& | buffer
| ) |  |

Pulls a buffer from the peer pad.

This function will first trigger the pad block signal if it was installed. This method works only on sink pads.

When pad is not linked Gst::FLOW_NOT_LINKED is returned else this function returns the result of get_range() on the peer pad.

buffer's caps must either be unset or the same as what is already configured on pad. Renegotiation within a running pull-mode pipeline is not supported.

Parameters

  offset | The start offset of the buffer.
  size | The length of the buffer.
  buffer | An uninitialized Glib::RefPtr<> in which to hold the Gst::Buffer.

Returns
  A Gst::FlowReturn from the peer pad (Gst::FLOW_ERROR if pad is not a sink pad). When this function returns Gst::FLOW_OK, buffer will contain a valid Gst::Buffer. buffer may not be used when any other return value than Gst::FLOW_OK is returned. MT safe.

## push()

FlowReturn Gst::Pad::push | ( | Glib::RefPtr< Gst::Buffer >&& | buffer | ) |

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 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.

Parameters

  buffer | The Gst::Buffer to push returns GST_FLOW_ERROR if not.

Returns
  A Gst::FlowReturn from the peer pad.

MT safe.

## push_event() [1/2]

bool Gst::Pad::push_event | ( | Glib::RefPtr< Gst::Event >&& | event | ) |

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.

Parameters

  event | The Gst::Event to send to the pad.

Returns
  `true` if the event was handled.

MT safe.

## push_event() [2/2]

bool Gst::Pad::push_event | ( | const Glib::RefPtr< Gst::Event >& | event | ) |

A push_event() convenience overload. Allows to re-use event parameter after function call.

## query()

bool Gst::Pad::query | ( | const Glib::RefPtr< Gst::Query >& | query | ) | const

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.

Parameters

  query | The Gst::Query to perform.

Returns
  `true` if the query could be performed.

## query_accept_caps()

bool Gst::Pad::query_accept_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const

Check if the given pad accepts the caps.

Parameters

  caps | A Gst::Caps to check on the pad.

Returns
  `true` if the pad can accept the caps.

## query_caps() [1/2]

Glib::RefPtr<Gst::Caps> Gst::Pad::query_caps | ( | Glib::RefPtr< Gst::Caps > | 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 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 caps, if not `nullptr`, otherwise ANY.

When called on sinkpads caps contains the caps that upstream could produce in the order preferred by upstream. When called on srcpads caps contains the caps accepted by downstream in the preferred order. caps might be `nullptr` but if it is not `nullptr` the returned caps will be a subset of caps.

Note that this function does not return writable Gst::Caps, use gst_caps_make_writable() before modifying the caps.

Parameters

  caps | Suggested Gst::Caps, or `nullptr`.

Returns
  The caps of the pad with incremented ref-count.

## query_caps() [2/2]

Glib::RefPtr<const Gst::Caps> Gst::Pad::query_caps | ( | Glib::RefPtr< Gst::Caps > | caps | ) | const

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 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 caps, if not `nullptr`, otherwise ANY.

When called on sinkpads caps contains the caps that upstream could produce in the order preferred by upstream. When called on srcpads caps contains the caps accepted by downstream in the preferred order. caps might be `nullptr` but if it is not `nullptr` the returned caps will be a subset of caps.

Note that this function does not return writable Gst::Caps, use gst_caps_make_writable() before modifying the caps.

Parameters

  caps | Suggested Gst::Caps, or `nullptr`.

Returns
  The caps of the pad with incremented ref-count.

## query_convert()

bool Gst::Pad::query_convert | ( | Format | src_format,
|  | gint64 | src_value,
|  | Format | dst_format,
|  | gint64 & | dst_value
| ) |  | const

Queries a pad to convert src_value in src_format to dst_format.

Parameters

  src_format | A Gst::Format to convert from.
  src_value | A value to convert.
  dst_format | The Gst::Format to convert to.
  dst_value | A pointer to the result.

Returns
  `true` if the query could be performed.

## query_default() [1/2]

bool Gst::Pad::query_default | ( | const Glib::RefPtr< Gst::Object >& | parent,
|  | const Glib::RefPtr< Gst::Query >& | query
| ) |  | const

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.

Parameters

  parent | The parent of pad or `nullptr`.
  query | The Gst::Query to handle.

Returns
  `true` if the query was performed successfully.

## query_default() [2/2]

bool Gst::Pad::query_default | ( | const Glib::RefPtr< Gst::Query >& | query | ) | const

A query_default() convenience overload.

## query_duration() [1/2]

bool Gst::Pad::query_duration | ( | Format | format,
|  | gint64 & | duration
| ) |  | const

Queries a pad for the total stream duration.

Parameters

  format | The Gst::Format requested.
  duration | A location in which to store the total duration, or `nullptr`.

Returns
  `true` if the query could be performed.

## query_duration() [2/2]

bool Gst::Pad::query_duration | ( | Format& | format | ) | const

Queries a pad for the total stream duration parsing only the format.

Parameters

  format | A reference to the Gst::Format asked for. On return contains the GstFormat used.

Returns
  true if the query could be performed.

## query_position() [1/2]

bool Gst::Pad::query_position | ( | Format | format,
|  | gint64 & | position
| ) |  | const

Queries a pad for the stream position.

Parameters

  format | The Gst::Format requested.
  position | A location in which to store the current position, or `nullptr`.

Returns
  `true` if the query could be performed.

## query_position() [2/2]

bool Gst::Pad::query_position | ( | Format& | format | ) | const

Queries a pad for the stream position parsing only the format.

Parameters

  format | A reference to the Gst::Format asked for. On return contains the Gst::Format used.

Returns
  true if the query could be performed.

## remove_probe()

void Gst::Pad::remove_probe | ( | gulong | id | ) |

Remove the probe with id from pad.

MT safe.

Parameters

  id | The probe id to remove.

## send_event() [1/2]

bool Gst::Pad::send_event | ( | 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 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.

Parameters

  event | The Gst::Event to send to the pad.

Returns
  `true` if the event was handled.

## send_event() [2/2]

bool Gst::Pad::send_event | ( | const Glib::RefPtr< Gst::Event >& | event | ) |

A send_event() convenience overload. Allows to re-use event parameter after function call.

## set_activate_function()

void Gst::Pad::set_activate_function | ( | const SlotActivate& | slot | ) |

## set_activatemode_function()

void Gst::Pad::set_activatemode_function | ( | const SlotActivatemode& | slot | ) |

## set_active()

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, calls activate_mode() with the pad's current mode and a `false` argument.

Parameters

  active | Whether or not the pad should be active.

Returns
  `true` if the operation was successful.

MT safe.

## set_chain_function()

void Gst::Pad::set_chain_function | ( | const SlotChain& | slot | ) |

## set_element_private()

void Gst::Pad::set_element_private | ( | gpointer | priv | ) |

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.

Parameters

  priv | The private data to attach to the pad.

## set_event_function()

void Gst::Pad::set_event_function | ( | const SlotEvent& | slot | ) |

## set_getrange_function()

void Gst::Pad::set_getrange_function | ( | const SlotGetrange& | slot | ) |

## set_offset()

void Gst::Pad::set_offset | ( | gint64 | offset | ) |

Set the offset that will be applied to the running time of pad.

Parameters

  offset | The offset.

## set_query_function()

void Gst::Pad::set_query_function | ( | const SlotQuery& | slot | ) |

## signal_linked()

Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& > Gst::Pad::signal_linked | ( |  | ) |

Slot Prototype:
  `void on_my_linked(const Glib::RefPtr<Gst::Pad>& peer_pad)`

Signals that a pad has been linked to the peer pad.

Parameters

  peer_pad | The peer pad that has been connected.

## signal_unlinked()

Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& > Gst::Pad::signal_unlinked | ( |  | ) |

Slot Prototype:
  `void on_my_unlinked(const Glib::RefPtr<Gst::Pad>& peer_pad)`

Signals that a pad has been unlinked from the peer pad.

Parameters

  peer_pad | The peer pad that has been disconnected.

## stop_task()

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.

Returns
  A `true` if the task could be stopped or `false` on error.

## unlink()

bool Gst::Pad::unlink | ( | const Glib::RefPtr< Gst::Pad >& | sink_pad | ) |

Unlinks the source pad from the sink pad.

Will emit the Gst::Pad::signal_unlinked() signal on both pads.

Parameters

  sink_pad | The sink Gst::Pad to unlink.

Returns
  `true` if the pads were unlinked. This function returns `false` if the pads were not linked together.

MT safe.

## use_fixed_caps()

void Gst::Pad::use_fixed_caps | ( |  | ) |

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.

## Friends And Related Function Documentation

## wrap()

Glib::RefPtr< Gst::Pad > wrap | ( | GstPad * | object,
|  | bool | take_copy = `false`
| ) |  |

related

A Glib::wrap() method for this object.

Parameters

  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.

Returns
  A C++ instance that wraps this C instance.