![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
#include <gst/gst.h> GstPad; enum GstPadDirection; enum GstPadFlags; enum GstPadLinkReturn; #define GST_PAD_LINK_FAILED (ret) #define GST_PAD_LINK_SUCCESSFUL (ret) enum GstFlowReturn; enum GstActivateMode; #define gst_pad_get_name (pad) GstPadDirection gst_pad_get_direction (GstPad *pad); #define gst_pad_get_parent (pad) GstElement* gst_pad_get_parent_element (GstPad *pad); GstPadTemplate* gst_pad_get_pad_template (GstPad *pad); GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad); gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad); gboolean gst_pad_is_linked (GstPad *pad); gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad); GstCaps* gst_pad_get_caps (GstPad *pad); GstCaps* gst_pad_get_allowed_caps (GstPad *srcpad); GstCaps* gst_pad_get_negotiated_caps (GstPad *pad); const GstCaps* gst_pad_get_pad_template_caps (GstPad *pad); gboolean gst_pad_set_caps (GstPad *pad, GstCaps *caps); GstPad* gst_pad_get_peer (GstPad *pad); GstCaps* gst_pad_peer_get_caps (GstPad *pad); void gst_pad_use_fixed_caps (GstPad *pad); gboolean gst_pad_is_active (GstPad *pad); gboolean gst_pad_set_blocked (GstPad *pad, gboolean blocked); gboolean gst_pad_set_blocked_async (GstPad *pad, gboolean blocked, GstPadBlockCallback callback, gpointer user_data); void (*GstPadBlockCallback) (GstPad *pad, gboolean blocked, gpointer user_data); gboolean gst_pad_is_blocked (GstPad *pad); gboolean gst_pad_is_blocking (GstPad *pad); gulong gst_pad_add_data_probe (GstPad *pad, GCallback handler, gpointer data); gulong gst_pad_add_buffer_probe (GstPad *pad, GCallback handler, gpointer data); gulong gst_pad_add_event_probe (GstPad *pad, GCallback handler, gpointer data); void gst_pad_remove_data_probe (GstPad *pad, guint handler_id); void gst_pad_remove_buffer_probe (GstPad *pad, guint handler_id); void gst_pad_remove_event_probe (GstPad *pad, guint handler_id); GstPad* gst_pad_new (const gchar *name, GstPadDirection direction); GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name); GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name); GstFlowReturn gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **buf); GstFlowReturn gst_pad_alloc_buffer_and_set_caps (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **buf); void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufalloc); GstFlowReturn (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size, GstCaps *caps, GstBuffer **buf); void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain); GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer); void gst_pad_set_checkgetrange_function (GstPad *pad, GstPadCheckGetRangeFunction check); gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad); GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer); void gst_pad_set_getrange_function (GstPad *pad, GstPadGetRangeFunction get); GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset, guint length, GstBuffer **buffer); void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event); gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event); void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link); GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstPad *peer); void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink); void (*GstPadUnlinkFunction) (GstPad *pad); gboolean gst_pad_accept_caps (GstPad *pad, GstCaps *caps); void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps); gboolean (*GstPadAcceptCapsFunction) (GstPad *pad, GstCaps *caps); void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps); GstCaps* (*GstPadGetCapsFunction) (GstPad *pad); GstCaps* gst_pad_proxy_getcaps (GstPad *pad); void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps); gboolean (*GstPadSetCapsFunction) (GstPad *pad, GstCaps *caps); gboolean gst_pad_proxy_setcaps (GstPad *pad, GstCaps *caps); void gst_pad_fixate_caps (GstPad *pad, GstCaps *caps); void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps); void (*GstPadFixateCapsFunction) (GstPad *pad, GstCaps *caps); GstCaps* gst_pad_get_fixed_caps_func (GstPad *pad); gboolean gst_pad_peer_accept_caps (GstPad *pad, GstCaps *caps); void gst_pad_set_activate_function (GstPad *pad, GstPadActivateFunction activate); gboolean (*GstPadActivateFunction) (GstPad *pad); void gst_pad_set_activatepush_function (GstPad *pad, GstPadActivateModeFunction activatepush); void gst_pad_set_activatepull_function (GstPad *pad, GstPadActivateModeFunction activatepull); gboolean (*GstPadActivateModeFunction) (GstPad *pad, gboolean active); GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer); gboolean gst_pad_push_event (GstPad *pad, GstEvent *event); gboolean gst_pad_check_pull_range (GstPad *pad); GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer); gboolean gst_pad_activate_pull (GstPad *pad, gboolean active); gboolean gst_pad_activate_push (GstPad *pad, gboolean active); gboolean gst_pad_send_event (GstPad *pad, GstEvent *event); gboolean gst_pad_event_default (GstPad *pad, GstEvent *event); gboolean gst_pad_query (GstPad *pad, GstQuery *query); gboolean gst_pad_query_default (GstPad *pad, GstQuery *query); gboolean gst_pad_query_position (GstPad *pad, GstFormat *format, gint64 *cur); gboolean gst_pad_query_duration (GstPad *pad, GstFormat *format, gint64 *duration); gboolean gst_pad_query_convert (GstPad *pad, GstFormat src_format, gint64 src_val, GstFormat *dest_format, gint64 *dest_val); gboolean gst_pad_query_peer_position (GstPad *pad, GstFormat *format, gint64 *cur); gboolean gst_pad_query_peer_duration (GstPad *pad, GstFormat *format, gint64 *duration); gboolean gst_pad_query_peer_convert (GstPad *pad, GstFormat src_format, gint64 src_val, GstFormat *dest_format, gint64 *dest_val); void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query); gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery *query); void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func); const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad); const GstQueryType* gst_pad_get_query_types (GstPad *pad); const GstQueryType* gst_pad_get_query_types_default (GstPad *pad); void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink); GList* (*GstPadIntLinkFunction) (GstPad *pad); GList* gst_pad_get_internal_links (GstPad *pad); GList* gst_pad_get_internal_links_default (GstPad *pad); void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent); gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, gpointer data); gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data); void gst_pad_set_element_private (GstPad *pad, gpointer priv); gpointer gst_pad_get_element_private (GstPad *pad); GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer); gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func, gpointer data); gboolean gst_pad_pause_task (GstPad *pad); gboolean gst_pad_stop_task (GstPad *pad); gboolean gst_pad_set_active (GstPad *pad, gboolean active); #define GST_PAD_GET_STREAM_LOCK (pad) #define GST_PAD_STREAM_LOCK (pad) #define GST_PAD_STREAM_LOCK_FULL (pad,t) #define GST_PAD_STREAM_TRYLOCK (pad) #define GST_PAD_STREAM_UNLOCK (pad) #define GST_PAD_STREAM_UNLOCK_FULL (pad) #define GST_FLOW_IS_FATAL (ret) #define GST_FLOW_IS_SUCCESS (ret)
"caps" GstCaps : Read "direction" GstPadDirection : Read / Write / Construct Only "template" GstPadTemplate : Read / Write
"have-data" gboolean user_function (GstPad *pad, GstMiniObject *mini_obj, gpointer user_data) : Run last / Has details "linked" void user_function (GstPad *pad, GstPad *peer, gpointer user_data) : Run last "request-link" void user_function (GstPad *pad, gpointer user_data) : Run last "unlinked" void user_function (GstPad *pad, GstPad *peer, gpointer user_data) : Run last
A GstElement is linked to other elements via "pads", which are extremely
light-weight generic link points.
After two pads are retrieved from an element with gst_element_get_pad()
,
the pads can be link with gst_pad_link()
. (For quick links,
you can also use gst_element_link()
, which will make the obvious
link for you if it's straightforward.)
Pads are typically created from a GstPadTemplate with
gst_pad_new_from_template()
.
Pads have GstCaps attached to it to describe the media type they are
capable of dealing with. gst_pad_get_caps()
and gst_pad_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 gst_pad_new()
,
which takes a direction and a name as an argument. If the name is NULL,
then a guaranteed unique name will be assigned to it.
gst_pad_get_parent()
will retrieve the GstElement that owns the pad.
A GstElement creating a pad will typically use the various
gst_pad_set_*_function()
calls to register callbacks for various events
on the pads.
GstElements will use gst_pad_push()
and gst_pad_pull_range()
to push out
or pull in a buffer.
To send a GstEvent on a pad, use gst_pad_send_event()
and
gst_pad_push_event()
.
Last reviewed on 2006-07-06 (0.10.9)
typedef struct { gpointer element_private; GstPadTemplate *padtemplate; GstPadDirection direction; /* streaming rec_lock */ GStaticRecMutex *stream_rec_lock; GstTask *task; GMutex *preroll_lock; GCond *preroll_cond; /* block cond, mutex is from the object */ GCond *block_cond; GstPadBlockCallback block_callback; gpointer block_data; /* the pad capabilities */ GstCaps *caps; GstPadGetCapsFunction getcapsfunc; GstPadSetCapsFunction setcapsfunc; GstPadAcceptCapsFunction acceptcapsfunc; GstPadFixateCapsFunction fixatecapsfunc; GstPadActivateFunction activatefunc; GstPadActivateModeFunction activatepushfunc; GstPadActivateModeFunction activatepullfunc; /* pad link */ GstPadLinkFunction linkfunc; GstPadUnlinkFunction unlinkfunc; GstPad *peer; gpointer sched_private; /* data transport functions */ GstPadChainFunction chainfunc; GstPadCheckGetRangeFunction checkgetrangefunc; GstPadGetRangeFunction getrangefunc; GstPadEventFunction eventfunc; GstActivateMode mode; /* generic query method */ GstPadQueryTypeFunction querytypefunc; GstPadQueryFunction queryfunc; /* internal links */ GstPadIntLinkFunction intlinkfunc; GstPadBufferAllocFunction bufferallocfunc; /* whether to emit signals for have-data. counts number * of handlers attached. */ gint do_buffer_signals; gint do_event_signals; } GstPad;
The GstPad structure. Use the functions to update the variables.
element_private
;gpointerelement_private
private data owned by the parent element
private data owned by the parent element
GstPadTemplate *padtemplate
;GstPadTemplatepadtemplate
padtemplate for this pad
padtemplate for this pad
GstPadDirection direction
;GstPadDirectiondirection
the direction of the pad, cannot change after creating
the pad.
the direction of the pad, cannot change after creating
the pad.
GStaticRecMutex *stream_rec_lock
;GStaticRecMutexstream_rec_lock
recursive stream lock of the pad, used to protect
the data used in streaming.
recursive stream lock of the pad, used to protect
the data used in streaming.
GstTask *task
;GstTasktask
task for this pad if the pad is actively driving dataflow.
task for this pad if the pad is actively driving dataflow.
GMutex *preroll_lock
;GMutexpreroll_lock
lock used when prerolling
lock used when prerolling
GCond *preroll_cond
;GCondpreroll_cond
conf to signal preroll
conf to signal preroll
GCond *block_cond
;GCondblock_cond
conditional to signal pad block
conditional to signal pad block
GstPadBlockCallback block_callback
;GstPadBlockCallbackblock_callback
callback for the pad block if any
callback for the pad block if any
gpointer block_data
;gpointerblock_data
user data for block_callback
user data for block_callback
block_callback
GstCaps *caps
;GstCapscaps
the current caps of the pad
the current caps of the pad
GstPadGetCapsFunction getcapsfunc
;GstPadGetCapsFunctiongetcapsfunc
function to get caps of the pad
function to get caps of the pad
GstPadSetCapsFunction setcapsfunc
;GstPadSetCapsFunctionsetcapsfunc
function to set caps on the pad
function to set caps on the pad
GstPadAcceptCapsFunction acceptcapsfunc
;GstPadAcceptCapsFunctionacceptcapsfunc
function to check if pad can accept caps
function to check if pad can accept caps
GstPadFixateCapsFunction fixatecapsfunc
;GstPadFixateCapsFunctionfixatecapsfunc
function to fixate caps
function to fixate caps
GstPadActivateFunction activatefunc
;GstPadActivateFunctionactivatefunc
pad activation function
pad activation function
GstPadActivateModeFunction activatepushfunc
;GstPadActivateModeFunctionactivatepushfunc
function to activate/deactivate pad in push mode
function to activate/deactivate pad in push mode
GstPadActivateModeFunction activatepullfunc
;GstPadActivateModeFunctionactivatepullfunc
function to activate/deactivate pad in pull mode
function to activate/deactivate pad in pull mode
GstPadLinkFunction linkfunc
;GstPadLinkFunctionlinkfunc
function called when pad is linked
function called when pad is linked
GstPadUnlinkFunction unlinkfunc
;GstPadUnlinkFunctionunlinkfunc
function called when pad is unlinked
function called when pad is unlinked
GstPad *peer
;GstPadpeer
the pad this pad is linked to
the pad this pad is linked to
gpointer sched_private
;gpointersched_private
private storage for the scheduler
private storage for the scheduler
GstPadChainFunction chainfunc
;GstPadChainFunctionchainfunc
function to chain data to pad
function to chain data to pad
GstPadCheckGetRangeFunction checkgetrangefunc
;GstPadCheckGetRangeFunctioncheckgetrangefunc
function to check if pad can operate in pull mode
function to check if pad can operate in pull mode
GstPadGetRangeFunction getrangefunc
;GstPadGetRangeFunctiongetrangefunc
function to get a range of data from a pad
function to get a range of data from a pad
GstPadEventFunction eventfunc
;GstPadEventFunctioneventfunc
function to send an event to a pad
function to send an event to a pad
GstActivateMode mode
;GstActivateModemode
current activation mode of the pad
current activation mode of the pad
GstPadQueryTypeFunction querytypefunc
;GstPadQueryTypeFunctionquerytypefunc
get list of supported queries
get list of supported queries
GstPadQueryFunction queryfunc
;GstPadQueryFunctionqueryfunc
perform a query on the pad
perform a query on the pad
GstPadIntLinkFunction intlinkfunc
;GstPadIntLinkFunctionintlinkfunc
get the internal links of this pad
get the internal links of this pad
GstPadBufferAllocFunction bufferallocfunc
;GstPadBufferAllocFunctionbufferallocfunc
function to allocate a buffer for this pad
function to allocate a buffer for this pad
gint do_buffer_signals
;gintdo_buffer_signals
counter counting installed buffer signals
counter counting installed buffer signals
gint do_event_signals
;gintdo_event_signals
counter counting installed event signals
counter counting installed event signals
gpointer element_private ; |
private data owned by the parent element |
GstPadTemplate *padtemplate ; |
padtemplate for this pad |
GstPadDirection direction ; |
the direction of the pad, cannot change after creating the pad. |
GStaticRecMutex *stream_rec_lock ; |
recursive stream lock of the pad, used to protect the data used in streaming. |
GstTask *task ; |
task for this pad if the pad is actively driving dataflow. |
GMutex *preroll_lock ; |
lock used when prerolling |
GCond *preroll_cond ; |
conf to signal preroll |
GCond *block_cond ; |
conditional to signal pad block |
GstPadBlockCallback block_callback ; |
callback for the pad block if any |
gpointer block_data ; |
user data for block_callback
|
GstCaps *caps ; |
the current caps of the pad |
GstPadGetCapsFunction getcapsfunc ; |
function to get caps of the pad |
GstPadSetCapsFunction setcapsfunc ; |
function to set caps on the pad |
GstPadAcceptCapsFunction acceptcapsfunc ; |
function to check if pad can accept caps |
GstPadFixateCapsFunction fixatecapsfunc ; |
function to fixate caps |
GstPadActivateFunction activatefunc ; |
pad activation function |
GstPadActivateModeFunction activatepushfunc ; |
function to activate/deactivate pad in push mode |
GstPadActivateModeFunction activatepullfunc ; |
function to activate/deactivate pad in pull mode |
GstPadLinkFunction linkfunc ; |
function called when pad is linked |
GstPadUnlinkFunction unlinkfunc ; |
function called when pad is unlinked |
GstPad *peer ; |
the pad this pad is linked to |
gpointer sched_private ; |
private storage for the scheduler |
GstPadChainFunction chainfunc ; |
function to chain data to pad |
GstPadCheckGetRangeFunction checkgetrangefunc ; |
function to check if pad can operate in pull mode |
GstPadGetRangeFunction getrangefunc ; |
function to get a range of data from a pad |
GstPadEventFunction eventfunc ; |
function to send an event to a pad |
GstActivateMode mode ; |
current activation mode of the pad |
GstPadQueryTypeFunction querytypefunc ; |
get list of supported queries |
GstPadQueryFunction queryfunc ; |
perform a query on the pad |
GstPadIntLinkFunction intlinkfunc ; |
get the internal links of this pad |
GstPadBufferAllocFunction bufferallocfunc ; |
function to allocate a buffer for this pad |
gint do_buffer_signals ; |
counter counting installed buffer signals |
gint do_event_signals ; |
counter counting installed event signals |
typedef enum { GST_PAD_UNKNOWN, GST_PAD_SRC, GST_PAD_SINK } GstPadDirection;
The direction of a pad.
GST_PAD_UNKNOWN
GST_PAD_UNKNOWN
direction is unknown.
direction is unknown.
GST_PAD_SRC
GST_PAD_SRC
the pad is a source pad.
the pad is a source pad.
GST_PAD_SINK
GST_PAD_SINK
the pad is a sink pad.
the pad is a sink pad.
GST_PAD_UNKNOWN |
direction is unknown. |
GST_PAD_SRC |
the pad is a source pad. |
GST_PAD_SINK |
the pad is a sink pad. |
typedef enum { GST_PAD_BLOCKED = (GST_OBJECT_FLAG_LAST << 0), GST_PAD_FLUSHING = (GST_OBJECT_FLAG_LAST << 1), GST_PAD_IN_GETCAPS = (GST_OBJECT_FLAG_LAST << 2), GST_PAD_IN_SETCAPS = (GST_OBJECT_FLAG_LAST << 3), GST_PAD_BLOCKING = (GST_OBJECT_FLAG_LAST << 4), /* padding */ GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 8) } GstPadFlags;
Pad state flags
GST_PAD_BLOCKED
GST_PAD_BLOCKED
is dataflow on a pad blocked
is dataflow on a pad blocked
GST_PAD_FLUSHING
GST_PAD_FLUSHING
is pad refusing buffers
is pad refusing buffers
GST_PAD_IN_GETCAPS
GST_PAD_IN_GETCAPS
GstPadGetCapsFunction()
is running now
GstPadGetCapsFunction()
is running now
GstPadGetCapsFunction()
GstPadGetCapsFunction()
GST_PAD_IN_SETCAPS
GST_PAD_IN_SETCAPS
GstPadSetCapsFunction()
is running now
GstPadSetCapsFunction()
is running now
GstPadSetCapsFunction()
GstPadSetCapsFunction()
GST_PAD_BLOCKING
GST_PAD_BLOCKING
is pad currently blocking on a buffer or event
is pad currently blocking on a buffer or event
GST_PAD_FLAG_LAST
GST_PAD_FLAG_LAST
offset to define more flags
offset to define more flags
GST_PAD_BLOCKED |
is dataflow on a pad blocked |
GST_PAD_FLUSHING |
is pad refusing buffers |
GST_PAD_IN_GETCAPS |
GstPadGetCapsFunction() is running now
|
GST_PAD_IN_SETCAPS |
GstPadSetCapsFunction() is running now
|
GST_PAD_BLOCKING |
is pad currently blocking on a buffer or event |
GST_PAD_FLAG_LAST |
offset to define more flags |
typedef enum { GST_PAD_LINK_OK = 0, GST_PAD_LINK_WRONG_HIERARCHY = -1, GST_PAD_LINK_WAS_LINKED = -2, GST_PAD_LINK_WRONG_DIRECTION = -3, GST_PAD_LINK_NOFORMAT = -4, GST_PAD_LINK_NOSCHED = -5, GST_PAD_LINK_REFUSED = -6 } GstPadLinkReturn;
Result values from gst_pad_link and friends.
GST_PAD_LINK_OK
GST_PAD_LINK_OK
link succeeded
link succeeded
GST_PAD_LINK_WRONG_HIERARCHY
GST_PAD_LINK_WRONG_HIERARCHY
pads have no common grandparent
pads have no common grandparent
GST_PAD_LINK_WAS_LINKED
GST_PAD_LINK_WAS_LINKED
pad was already linked
pad was already linked
GST_PAD_LINK_WRONG_DIRECTION
GST_PAD_LINK_WRONG_DIRECTION
pads have wrong direction
pads have wrong direction
GST_PAD_LINK_NOFORMAT
GST_PAD_LINK_NOFORMAT
pads do not have common format
pads do not have common format
GST_PAD_LINK_NOSCHED
GST_PAD_LINK_NOSCHED
pads cannot cooperate in scheduling
pads cannot cooperate in scheduling
GST_PAD_LINK_REFUSED
GST_PAD_LINK_REFUSED
refused for some reason
refused for some reason
#define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)
Macro to test if the given GstPadLinkReturn value indicates a failed link step.
ret
:ret
the GstPadLinkReturn value
the GstPadLinkReturn value
GstPadLinkReturnGstPadLinkReturn
ret : |
the GstPadLinkReturn value |
#define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
Macro to test if the given GstPadLinkReturn value indicates a successful link step.
ret
:ret
the GstPadLinkReturn value
the GstPadLinkReturn value
GstPadLinkReturnGstPadLinkReturn
ret : |
the GstPadLinkReturn value |
typedef enum { /* custom success starts here */ GST_FLOW_CUSTOM_SUCCESS = 100, /* core predefined */ GST_FLOW_RESEND = 1, GST_FLOW_OK = 0, /* expected failures */ GST_FLOW_NOT_LINKED = -1, GST_FLOW_WRONG_STATE = -2, /* error cases */ GST_FLOW_UNEXPECTED = -3, GST_FLOW_NOT_NEGOTIATED = -4, GST_FLOW_ERROR = -5, GST_FLOW_NOT_SUPPORTED = -6, /* custom error starts here */ GST_FLOW_CUSTOM_ERROR = -100 } GstFlowReturn;
The result of passing data to a pad.
Note that the custom return values should not be exposed outside of the element scope and are available since 0.10.7.
GST_FLOW_CUSTOM_SUCCESS
GST_FLOW_CUSTOM_SUCCESS
Elements can use values starting from
this to define custom success codes.
Since 0.10.7.
Elements can use values starting from
this to define custom success codes.
Since 0.10.7.
GST_FLOW_RESEND
GST_FLOW_RESEND
Resend buffer, possibly with new caps.
Resend buffer, possibly with new caps.
GST_FLOW_OK
GST_FLOW_OK
Data passing was ok.
Data passing was ok.
GST_FLOW_NOT_LINKED
GST_FLOW_NOT_LINKED
Pad is not linked.
Pad is not linked.
GST_FLOW_WRONG_STATE
GST_FLOW_WRONG_STATE
Pad is in wrong state.
Pad is in wrong state.
GST_FLOW_UNEXPECTED
GST_FLOW_UNEXPECTED
Did not expect anything, like after EOS.
Did not expect anything, like after EOS.
GST_FLOW_NOT_NEGOTIATED
GST_FLOW_NOT_NEGOTIATED
Pad is not negotiated.
Pad is not negotiated.
GST_FLOW_ERROR
GST_FLOW_ERROR
Some (fatal) error occured. Element generating
this error should post an error message with more
details.
Some (fatal) error occured. Element generating
this error should post an error message with more
details.
GST_FLOW_NOT_SUPPORTED
GST_FLOW_NOT_SUPPORTED
This operation is not supported.
This operation is not supported.
GST_FLOW_CUSTOM_ERROR
GST_FLOW_CUSTOM_ERROR
Elements can use values starting from
this to define custom error codes. Since 0.10.7.
Elements can use values starting from
this to define custom error codes. Since 0.10.7.
typedef enum { GST_ACTIVATE_NONE, GST_ACTIVATE_PUSH, GST_ACTIVATE_PULL } GstActivateMode;
The status of a GstPad. After activating a pad, which usually happens when the parent element goes from READY to PAUSED, the GstActivateMode defines if the pad operates in push or pull mode.
GST_ACTIVATE_NONE
GST_ACTIVATE_NONE
Pad will not handle dataflow
Pad will not handle dataflow
GST_ACTIVATE_PUSH
GST_ACTIVATE_PUSH
Pad handles dataflow in downstream push mode
Pad handles dataflow in downstream push mode
GST_ACTIVATE_PULL
GST_ACTIVATE_PULL
Pad handles dataflow in upstream pull mode
Pad handles dataflow in upstream pull mode
GST_ACTIVATE_NONE |
Pad will not handle dataflow |
GST_ACTIVATE_PUSH |
Pad handles dataflow in downstream push mode |
GST_ACTIVATE_PULL |
Pad handles dataflow in upstream pull mode |
#define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))
Get a copy of the name of the pad. g_free()
after usage.
MT safe.
pad
:pad
the pad to get the name from
the pad to get the name from
pad : |
the pad to get the name from |
GstPadDirection gst_pad_get_direction (GstPad *pad);
Gets the direction of the pad. The direction of the pad is decided at construction time so this function does not take the LOCK.
pad
:pad
a GstPad to get the direction of.
a GstPad to get the direction of.
GstPadGstPadReturns :Returns the GstPadDirection of the pad.
MT safe.
the GstPadDirection of the pad.
MT safe.
GstPadDirectionGstPadDirection
pad : |
a GstPad to get the direction of. |
Returns : | the GstPadDirection of the pad. MT safe. |
#define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))
Get the parent of pad
. This function increases the refcount
of the parent object so you should gst_object_unref()
it after usage.
Can return NULL if the pad did not have a parent.
MT safe.
pad
:pad
the pad to get the parent of
the pad to get the parent of
pad : |
the pad to get the parent of |
GstElement* gst_pad_get_parent_element (GstPad *pad);
Gets the parent of pad
, cast to a GstElement. If a pad
has no parent or
its parent is not an element, return NULL.
pad
:pad
a pad
a pad
Returns :Returns The parent of the pad. The caller has a reference on the parent, so
unref when you're finished with it.
MT safe.
The parent of the pad. The caller has a reference on the parent, so
unref when you're finished with it.
MT safe.
pad : |
a pad |
Returns : | The parent of the pad. The caller has a reference on the parent, so unref when you're finished with it. MT safe. |
GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
Gets the template for pad
.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadReturns :Returns the GstPadTemplate from which this pad was instantiated, or NULL
if this pad has no template.
FIXME: currently returns an unrefcounted padtemplate.
the GstPadTemplate from which this pad was instantiated, or NULL
if this pad has no template.
FIXME: currently returns an unrefcounted padtemplate.
GstPadTemplateGstPadTemplateNULL
NULL
pad : |
a GstPad. |
Returns : | the GstPadTemplate from which this pad was instantiated, or NULL
if this pad has no template.
FIXME: currently returns an unrefcounted padtemplate.
|
GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
Links the source pad and the sink pad.
srcpad
:srcpad
the source GstPad to link.
the source GstPad to link.
GstPadGstPadsinkpad
:sinkpad
the sink GstPad to link.
the sink GstPad to link.
GstPadGstPadReturns :Returns A result code indicating if the connection worked or
what went wrong.
MT Safe.
A result code indicating if the connection worked or
what went wrong.
MT Safe.
srcpad : |
the source GstPad to link. |
sinkpad : |
the sink GstPad to link. |
Returns : | A result code indicating if the connection worked or what went wrong. MT Safe. |
gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
Unlinks the source pad from the sink pad. Will emit the "unlinked" signal on both pads.
srcpad
:srcpad
the source GstPad to unlink.
the source GstPad to unlink.
GstPadGstPadsinkpad
:sinkpad
the sink GstPad to unlink.
the sink GstPad to unlink.
GstPadGstPadReturns :Returns TRUE if the pads were unlinked. This function returns FALSE if
the pads were not linked together.
MT safe.
TRUE if the pads were unlinked. This function returns FALSE if
the pads were not linked together.
MT safe.
srcpad : |
the source GstPad to unlink. |
sinkpad : |
the sink GstPad to unlink. |
Returns : | TRUE if the pads were unlinked. This function returns FALSE if the pads were not linked together. MT safe. |
gboolean gst_pad_is_linked (GstPad *pad);
Checks if a pad
is linked to another pad or not.
pad
:pad
pad to check
pad to check
Returns :Returns TRUE if the pad is linked, FALSE otherwise.
MT safe.
TRUE if the pad is linked, FALSE otherwise.
MT safe.
pad : |
pad to check |
Returns : | TRUE if the pad is linked, FALSE otherwise. MT safe. |
gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
Checks if the source pad and the sink pad can be linked.
Both srcpad
and sinkpad
must be unlinked.
srcpad
:srcpad
the source GstPad to link.
the source GstPad to link.
GstPadGstPadsinkpad
:sinkpad
the sink GstPad to link.
the sink GstPad to link.
GstPadGstPadReturns :Returns TRUE if the pads can be linked, FALSE otherwise.
TRUE if the pads can be linked, FALSE otherwise.
srcpad : |
the source GstPad to link. |
sinkpad : |
the sink GstPad to link. |
Returns : | TRUE if the pads can be linked, FALSE otherwise. |
GstCaps* gst_pad_get_caps (GstPad *pad);
Gets the capabilities this pad can produce or consume.
Note that this method doesn't necessarily return the caps set by
gst_pad_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.
pad
:pad
a GstPad to get the capabilities of.
a GstPad to get the capabilities of.
GstPadGstPadReturns :Returns a newly allocated copy of the GstCaps of this pad.
MT safe.
a newly allocated copy of the GstCaps of this pad.
MT safe.
GstCapsGstCaps
pad : |
a GstPad to get the capabilities of. |
Returns : | a newly allocated copy of the GstCaps of this pad. MT safe. |
GstCaps* gst_pad_get_allowed_caps (GstPad *srcpad);
Gets the capabilities of the allowed media types that can flow through
srcpad
and its peer. The pad must be a source pad.
The caller must free the resulting caps.
srcpad
:srcpad
a GstPad, it must a a source pad.
a GstPad, it must a a source pad.
GstPadGstPadReturns :Returns the allowed GstCaps of the pad link. Free the caps when
you no longer need it. This function returns NULL when the srcpad
has no
peer.
MT safe.
the allowed GstCaps of the pad link. Free the caps when
you no longer need it. This function returns NULL when the srcpad
has no
peer.
MT safe.
GstCapsGstCapssrcpad
srcpad : |
a GstPad, it must a a source pad. |
Returns : | the allowed GstCaps of the pad link. Free the caps when
you no longer need it. This function returns NULL when the srcpad has no
peer.
MT safe.
|
GstCaps* gst_pad_get_negotiated_caps (GstPad *pad);
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.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadReturns :Returns the negotiated GstCaps of the pad link. Free the caps when
you no longer need it. This function returns NULL when the pad
has no
peer or is not negotiated yet.
MT safe.
the negotiated GstCaps of the pad link. Free the caps when
you no longer need it. This function returns NULL when the pad
has no
peer or is not negotiated yet.
MT safe.
GstCapsGstCapspad
pad : |
a GstPad. |
Returns : | the negotiated GstCaps of the pad link. Free the caps when
you no longer need it. This function returns NULL when the pad has no
peer or is not negotiated yet.
MT safe.
|
const GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
Gets the capabilities for pad
's template.
pad
:pad
a GstPad to get the template capabilities from.
a GstPad to get the template capabilities from.
GstPadGstPadReturns :Returns the GstCaps of this pad template. If you intend to keep a reference
on the caps, make a copy (see gst_caps_copy()
).
the GstCaps of this pad template. If you intend to keep a reference
on the caps, make a copy (see gst_caps_copy()
).
GstCapsGstCapsgst_caps_copy()
gst_caps_copy()
pad : |
a GstPad to get the template capabilities from. |
Returns : | the GstCaps of this pad template. If you intend to keep a reference
on the caps, make a copy (see gst_caps_copy() ).
|
gboolean gst_pad_set_caps (GstPad *pad, GstCaps *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 NULL caps, which will make the pad unnegotiated again.
pad
:pad
a GstPad to set the capabilities of.
a GstPad to set the capabilities of.
GstPadGstPadcaps
:caps
a GstCaps to set.
a GstCaps to set.
GstCapsGstCapsReturns :Returns TRUE if the caps could be set. FALSE if the caps were not fixed
or bad parameters were provided to this function.
MT safe.
TRUE if the caps could be set. FALSE if the caps were not fixed
or bad parameters were provided to this function.
MT safe.
pad : |
a GstPad to set the capabilities of. |
caps : |
a GstCaps to set. |
Returns : | TRUE if the caps could be set. FALSE if the caps were not fixed or bad parameters were provided to this function. MT safe. |
GstPad* gst_pad_get_peer (GstPad *pad);
Gets the peer of pad
. This function refs the peer pad so
you need to unref it after use.
GstCaps* gst_pad_peer_get_caps (GstPad *pad);
Gets the capabilities of the peer connected to this pad.
pad
:pad
a GstPad to get the peer capabilities of.
a GstPad to get the peer capabilities of.
GstPadGstPadReturns :Returns the GstCaps of the peer pad. This function returns a new caps, so use
gst_caps_unref to get rid of it. this function returns NULL if there is no
peer pad.
the GstCaps of the peer pad. This function returns a new caps, so use
gst_caps_unref to get rid of it. this function returns NULL if there is no
peer pad.
GstCapsGstCaps
pad : |
a GstPad to get the peer capabilities of. |
Returns : | the GstCaps of the peer pad. This function returns a new caps, so use gst_caps_unref to get rid of it. this function returns NULL if there is no peer pad. |
void gst_pad_use_fixed_caps (GstPad *pad);
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.
pad
:pad
the pad to use
the pad to use
pad : |
the pad to use |
gboolean gst_pad_set_blocked (GstPad *pad, gboolean blocked);
Blocks or unblocks the dataflow on a pad. This function is
a shortcut for gst_pad_set_blocked_async()
with a NULL
callback.
pad
:pad
the GstPad to block or unblock
the GstPad to block or unblock
GstPadGstPadblocked
:blocked
boolean indicating we should block or unblock
boolean indicating we should block or unblock
Returns :Returns TRUE if the pad could be blocked. This function can fail
wrong parameters were passed or the pad was already in the
requested state.
MT safe.
TRUE if the pad could be blocked. This function can fail
wrong parameters were passed or the pad was already in the
requested state.
MT safe.
pad : |
the GstPad to block or unblock |
blocked : |
boolean indicating we should block or unblock |
Returns : | TRUE if the pad could be blocked. This function can fail wrong parameters were passed or the pad was already in the requested state. MT safe. |
gboolean gst_pad_set_blocked_async (GstPad *pad, gboolean blocked, GstPadBlockCallback callback, gpointer user_data);
Blocks or unblocks the dataflow on a pad. The provided callback 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. You can pass NULL as the callback to make this call block. Be careful with this blocking call as it might not return for reasons stated above.
pad
:pad
the GstPad to block or unblock
the GstPad to block or unblock
GstPadGstPadblocked
:blocked
boolean indicating whether the pad should be blocked or unblocked
boolean indicating whether the pad should be blocked or unblocked
callback
:callback
GstPadBlockCallback that will be called when the
operation succeeds
GstPadBlockCallback that will be called when the
operation succeeds
GstPadBlockCallbackGstPadBlockCallbackuser_data
:user_data
user data passed to the callback
user data passed to the callback
Returns :Returns TRUE if the pad could be blocked. This function can fail
if wrong parameters were passed or the pad was already in the
requested state.
MT safe.
TRUE if the pad could be blocked. This function can fail
if wrong parameters were passed or the pad was already in the
requested state.
MT safe.
pad : |
the GstPad to block or unblock |
blocked : |
boolean indicating whether the pad should be blocked or unblocked |
callback : |
GstPadBlockCallback that will be called when the operation succeeds |
user_data : |
user data passed to the callback |
Returns : | TRUE if the pad could be blocked. This function can fail if wrong parameters were passed or the pad was already in the requested state. MT safe. |
void (*GstPadBlockCallback) (GstPad *pad, gboolean blocked, gpointer user_data);
Callback used by gst_pad_set_blocked_async()
. Gets called when the blocking
operation succeeds.
pad
:pad
the GstPad that is blockend or unblocked.
the GstPad that is blockend or unblocked.
GstPadGstPadblocked
:blocked
blocking state for the pad
blocking state for the pad
user_data
:user_data
the gpointer to optional user data.
the gpointer to optional user data.
pad : |
the GstPad that is blockend or unblocked. |
blocked : |
blocking state for the pad |
user_data : |
the gpointer to optional user data. |
gboolean gst_pad_is_blocked (GstPad *pad);
Checks if the pad is blocked or not. This function returns the
last requested state of the pad. It is not certain that the pad
is actually blocking at this point (see gst_pad_is_blocking()
).
gboolean gst_pad_is_blocking (GstPad *pad);
Checks if the pad is blocking or not. This is a guaranteed state of whether the pad is actually blocking on a GstBuffer or a GstEvent.
pad
:pad
the GstPad to query
the GstPad to query
GstPadGstPadReturns :Returns TRUE if the pad is blocking.
MT safe.
TRUE if the pad is blocking.
MT safe.
pad : |
the GstPad to query |
Returns : | TRUE if the pad is blocking. MT safe. |
Since 0.10.11
gulong gst_pad_add_data_probe (GstPad *pad, GCallback handler, gpointer data);
Adds a "data probe" to a pad. This function 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, meaning handler
should
have the same callback signature as the 'have-data' signal of GstPad.
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 gst_pad_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.
Although probes are implemented internally by connecting handler
to the
have-data signal on the pad, if you want to remove a probe it is insufficient
to only call g_signal_handler_disconnect on the returned handler id. To
remove a probe, use the appropriate function, such as
gst_pad_remove_data_probe()
.
pad
:pad
pad to add the data probe handler to
pad to add the data probe handler to
handler
:handler
function to call when data is passed over pad
function to call when data is passed over pad
data
:data
data to pass along with the handler
data to pass along with the handler
Returns :Returns The handler id.
The handler id.
pad : |
pad to add the data probe handler to |
handler : |
function to call when data is passed over pad |
data : |
data to pass along with the handler |
Returns : | The handler id. |
gulong gst_pad_add_buffer_probe (GstPad *pad, GCallback handler, gpointer data);
Adds a probe that will be called for all buffers passing through a pad. See
gst_pad_add_data_probe()
for more information.
pad
:pad
pad to add the buffer probe handler to
pad to add the buffer probe handler to
handler
:handler
function to call when data is passed over pad
function to call when data is passed over pad
data
:data
data to pass along with the handler
data to pass along with the handler
Returns :Returns The handler id
The handler id
pad : |
pad to add the buffer probe handler to |
handler : |
function to call when data is passed over pad |
data : |
data to pass along with the handler |
Returns : | The handler id |
gulong gst_pad_add_event_probe (GstPad *pad, GCallback handler, gpointer data);
Adds a probe that will be called for all events passing through a pad. See
gst_pad_add_data_probe()
for more information.
pad
:pad
pad to add the event probe handler to
pad to add the event probe handler to
handler
:handler
function to call when data is passed over pad
function to call when data is passed over pad
data
:data
data to pass along with the handler
data to pass along with the handler
Returns :Returns The handler id
The handler id
pad : |
pad to add the event probe handler to |
handler : |
function to call when data is passed over pad |
data : |
data to pass along with the handler |
Returns : | The handler id |
void gst_pad_remove_data_probe (GstPad *pad, guint handler_id);
Removes a data probe from pad
.
pad
:pad
pad to remove the data probe handler from
pad to remove the data probe handler from
handler_id
:handler_id
handler id returned from gst_pad_add_data_probe
handler id returned from gst_pad_add_data_probe
pad : |
pad to remove the data probe handler from |
handler_id : |
handler id returned from gst_pad_add_data_probe |
void gst_pad_remove_buffer_probe (GstPad *pad, guint handler_id);
Removes a buffer probe from pad
.
pad
:pad
pad to remove the buffer probe handler from
pad to remove the buffer probe handler from
handler_id
:handler_id
handler id returned from gst_pad_add_buffer_probe
handler id returned from gst_pad_add_buffer_probe
pad : |
pad to remove the buffer probe handler from |
handler_id : |
handler id returned from gst_pad_add_buffer_probe |
void gst_pad_remove_event_probe (GstPad *pad, guint handler_id);
Removes an event probe from pad
.
pad
:pad
pad to remove the event probe handler from
pad to remove the event probe handler from
handler_id
:handler_id
handler id returned from gst_pad_add_event_probe
handler id returned from gst_pad_add_event_probe
pad : |
pad to remove the event probe handler from |
handler_id : |
handler id returned from gst_pad_add_event_probe |
GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
Creates a new pad with the given name in the given direction. If name is NULL, a guaranteed unique name (across all pads) will be assigned. This function makes a copy of the name so you can safely free the name.
name
:name
the name of the new pad.
the name of the new pad.
direction
:direction
the GstPadDirection of the pad.
the GstPadDirection of the pad.
GstPadDirectionGstPadDirectionReturns :Returns a new GstPad, or NULL in case of an error.
MT safe.
a new GstPad, or NULL in case of an error.
MT safe.
GstPadGstPad
name : |
the name of the new pad. |
direction : |
the GstPadDirection of the pad. |
Returns : | a new GstPad, or NULL in case of an error. MT safe. |
GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
Creates a new pad with the given name from the given template. If name is NULL, a guaranteed unique name (across all pads) will be assigned. This function makes a copy of the name so you can safely free the name.
templ
:templ
the pad template to use
the pad template to use
name
:name
the name of the element
the name of the element
Returns :Returns a new GstPad, or NULL in case of an error.
a new GstPad, or NULL in case of an error.
GstPadGstPad
templ : |
the pad template to use |
name : |
the name of the element |
Returns : | a new GstPad, or NULL in case of an error. |
GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name);
Creates a new pad with the given name from the given static template. If name is NULL, a guaranteed unique name (across all pads) will be assigned. This function makes a copy of the name so you can safely free the name.
templ
:templ
the GstStaticPadTemplate to use
the GstStaticPadTemplate to use
GstStaticPadTemplateGstStaticPadTemplatename
:name
the name of the element
the name of the element
Returns :Returns a new GstPad, or NULL in case of an error.
a new GstPad, or NULL in case of an error.
GstPadGstPad
templ : |
the GstStaticPadTemplate to use |
name : |
the name of the element |
Returns : | a new GstPad, or NULL in case of an error. |
GstFlowReturn gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **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 GstBuffer 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.
pad
:pad
a source GstPad
a source GstPad
GstPadGstPadoffset
:offset
the offset of the new buffer in the stream
the offset of the new buffer in the stream
size
:size
the size of the new buffer
the size of the new buffer
caps
:caps
the caps of the new buffer
the caps of the new buffer
buf
:buf
a newly allocated buffer
a newly allocated buffer
Returns :Returns a result code indicating success of the operation. Any
result code other than GST_FLOW_OK is an error and buf
should
not be used.
An error can occur if the pad is not connected or when the downstream
peer elements cannot provide an acceptable buffer.
MT safe.
a result code indicating success of the operation. Any
result code other than GST_FLOW_OK is an error and buf
should
not be used.
An error can occur if the pad is not connected or when the downstream
peer elements cannot provide an acceptable buffer.
MT safe.
GST_FLOW_OKGST_FLOW_OKbuf
pad : |
a source GstPad |
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 |
Returns : | a result code indicating success of the operation. Any
result code other than GST_FLOW_OK is an error and buf should
not be used.
An error can occur if the pad is not connected or when the downstream
peer elements cannot provide an acceptable buffer.
MT safe.
|
GstFlowReturn gst_pad_alloc_buffer_and_set_caps (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **buf);
In addition to the function gst_pad_alloc_buffer()
, this function
automatically calls gst_pad_set_caps()
when the caps of the
newly allocated buffer are different from the pad
caps.
pad
:pad
a source GstPad
a source GstPad
GstPadGstPadoffset
:offset
the offset of the new buffer in the stream
the offset of the new buffer in the stream
size
:size
the size of the new buffer
the size of the new buffer
caps
:caps
the caps of the new buffer
the caps of the new buffer
buf
:buf
a newly allocated buffer
a newly allocated buffer
Returns :Returns a result code indicating success of the operation. Any
result code other than GST_FLOW_OK is an error and buf
should
not be used.
An error can occur if the pad is not connected or when the downstream
peer elements cannot provide an acceptable buffer.
MT safe.
a result code indicating success of the operation. Any
result code other than GST_FLOW_OK is an error and buf
should
not be used.
An error can occur if the pad is not connected or when the downstream
peer elements cannot provide an acceptable buffer.
MT safe.
GST_FLOW_OKGST_FLOW_OKbuf
pad : |
a source GstPad |
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 |
Returns : | a result code indicating success of the operation. Any
result code other than GST_FLOW_OK is an error and buf should
not be used.
An error can occur if the pad is not connected or when the downstream
peer elements cannot provide an acceptable buffer.
MT safe.
|
void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufalloc);
Sets the given bufferalloc function for the pad. Note that the bufferalloc function can only be set on sinkpads.
pad
:pad
a sink GstPad.
a sink GstPad.
GstPadGstPadbufalloc
:bufalloc
the GstPadBufferAllocFunction to set.
the GstPadBufferAllocFunction to set.
GstPadBufferAllocFunctionGstPadBufferAllocFunction
pad : |
a sink GstPad. |
bufalloc : |
the GstPadBufferAllocFunction to set. |
GstFlowReturn (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size, GstCaps *caps, GstBuffer **buf);
Ask the sinkpad pad
to allocate a buffer with offset
, size
and caps
.
The result will be stored in buf
.
The purpose of this function is to allocate a buffer that is optimal to
be processed by pad
. The function is mostly overridden by elements that can
provide a hardware buffer in order to avoid additional memcpy operations.
The function can return a buffer that does not have caps
, in which case the
upstream element requests a format change. If a format change was requested,
the returned buffer will be one to hold the data of said new caps, so its
size might be different from size
.
When this function returns anything else than GST_FLOW_OK, the buffer allocation
failed and buf
does not contain valid data.
By default this function returns a new buffer of size
and with caps
containing
purely malloced data. The buffer should be freed with gst_buffer_unref()
after usage.
pad
:pad
a sink GstPad
a sink GstPad
GstPadGstPadoffset
:offset
the desired offset of the buffer
the desired offset of the buffer
size
:size
the desired size of the buffer
the desired size of the buffer
caps
:caps
the desired caps of the buffer
the desired caps of the buffer
buf
:buf
pointer to hold the allocated buffer.
pointer to hold the allocated buffer.
Returns :Returns GST_FLOW_OK if buf
contains a valid buffer, any other return
value means buf
does not hold a valid buffer.
GST_FLOW_OK if buf
contains a valid buffer, any other return
value means buf
does not hold a valid buffer.
GST_FLOW_OKGST_FLOW_OKbuf
buf
pad : |
a sink GstPad |
offset : |
the desired offset of the buffer |
size : |
the desired size of the buffer |
caps : |
the desired caps of the buffer |
buf : |
pointer to hold the allocated buffer. |
Returns : | GST_FLOW_OK if buf contains a valid buffer, any other return
value means buf does not hold a valid buffer.
|
void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);
Sets the given chain function for the pad. The chain function is called to process a GstBuffer input buffer. see GstPadChainFunction for more details.
pad
:pad
a sink GstPad.
a sink GstPad.
GstPadGstPadchain
:chain
the GstPadChainFunction to set.
the GstPadChainFunction to set.
GstPadChainFunctionGstPadChainFunction
pad : |
a sink GstPad. |
chain : |
the GstPadChainFunction to set. |
GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer);
A function that will be called on sinkpads when chaining buffers. The function typically processes the data contained in the buffer and either consumes the data or passes it on to the internally linked pad(s).
The implementer of this function receives a refcount to buffer
and should
gst_buffer_unref()
when the buffer is no longer needed.
When a chain function detects an error in the data stream, it must post an error on the buffer and return an appropriate GstFlowReturn value.
pad
:pad
the sink GstPad that performed the chain.
the sink GstPad that performed the chain.
GstPadGstPadbuffer
:buffer
the GstBuffer that is chained, not NULL
.
the GstBuffer that is chained, not NULL
.
GstBufferGstBufferNULL
NULL
Returns :Returns GST_FLOW_OK for success
GST_FLOW_OK for success
GST_FLOW_OKGST_FLOW_OK
pad : |
the sink GstPad that performed the chain. |
buffer : |
the GstBuffer that is chained, not NULL .
|
Returns : | GST_FLOW_OK for success |
void gst_pad_set_checkgetrange_function (GstPad *pad, GstPadCheckGetRangeFunction check);
Sets the given checkgetrange function for the pad. Implement this function on a pad if you dynamically support getrange based scheduling on the pad.
pad
:pad
a source GstPad.
a source GstPad.
GstPadGstPadcheck
:check
the GstPadCheckGetRangeFunction to set.
the GstPadCheckGetRangeFunction to set.
GstPadCheckGetRangeFunctionGstPadCheckGetRangeFunction
pad : |
a source GstPad. |
check : |
the GstPadCheckGetRangeFunction to set. |
gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad);
Check if pad
can be activated in pull mode.
This function will be deprecated after 0.10; use the seeking query to check if a pad can support random access.
GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer);
When pad
is flushing this function returns GST_FLOW_WRONG_STATE
immediatly.
Calls the getrange function of pad
, see GstPadGetRangeFunction for a
description of a getrange function. If pad
has no getrange function
installed (see gst_pad_set_getrange_function()
) this function returns
GST_FLOW_NOT_SUPPORTED.
pad
:pad
a src GstPad, returns GST_FLOW_ERROR if not.
a src GstPad, returns GST_FLOW_ERROR if not.
GstPadGstPadGST_FLOW_ERRORGST_FLOW_ERRORoffset
:offset
The start offset of the buffer
The start offset of the buffer
size
:size
The length of the buffer
The length of the buffer
buffer
:buffer
a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL
.
a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL
.
GstBufferGstBufferGST_FLOW_ERRORGST_FLOW_ERRORNULL
NULL
Returns :Returns a GstFlowReturn from the pad.
MT safe.
a GstFlowReturn from the pad.
MT safe.
GstFlowReturnGstFlowReturn
pad : |
a src GstPad, returns GST_FLOW_ERROR if not. |
offset : |
The start offset of the buffer |
size : |
The length of the buffer |
buffer : |
a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL .
|
Returns : | a GstFlowReturn from the pad. MT safe. |
void gst_pad_set_getrange_function (GstPad *pad, GstPadGetRangeFunction get);
Sets the given getrange function for the pad. The getrange function is called to produce a new GstBuffer to start the processing pipeline. see GstPadGetRangeFunction for a description of the getrange function.
pad
:pad
a source GstPad.
a source GstPad.
GstPadGstPadget
:get
the GstPadGetRangeFunction to set.
the GstPadGetRangeFunction to set.
GstPadGetRangeFunctionGstPadGetRangeFunction
pad : |
a source GstPad. |
get : |
the GstPadGetRangeFunction to set. |
GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset, guint length, GstBuffer **buffer);
This function will be called on source pads when a peer element
request a buffer at the specified offset
and length
. If this function
returns GST_FLOW_OK, the result buffer will be stored in buffer
. The
contents of buffer
is invalid for any other return value.
This function is installed on a source pad with
gst_pad_set_getrange_function()
and can only be called on source pads after
they are successfully activated with gst_pad_activate_pull()
.
offset
and length
are always given in byte units. offset
must normally be a value
between 0 and the length in bytes of the data available on pad
. The
length (duration in bytes) can be retrieved with a GST_QUERY_DURATION or with a
GST_QUERY_SEEKING.
Any offset
larger or equal than the length will make the function return
GST_FLOW_UNEXPECTED, which corresponds to EOS. In this case buffer
does not
contain a valid buffer.
The buffer size of buffer
might be smaller than length
when offset
is near
the end of the stream.
It is allowed to call this function with a 0 length
and valid offset
, in
which case buffer
will contain a 0-sized buffer and the function returns
GST_FLOW_OK.
When this function is called with a -1 offset
, the sequentially next buffer
of length length
in the stream is returned.
When this function is called with a -1 length
, a buffer with a default
optimal length is returned in buffer
. The length might depend on the value
of offset
.
pad
:pad
the src GstPad to perform the getrange on.
the src GstPad to perform the getrange on.
GstPadGstPadoffset
:offset
the offset of the range
the offset of the range
length
:length
the length of the range
the length of the range
buffer
:buffer
a memory location to hold the result buffer, cannot be NULL.
a memory location to hold the result buffer, cannot be NULL.
Returns :Returns GST_FLOW_OK for success
GST_FLOW_OK for success
GST_FLOW_OKGST_FLOW_OK
pad : |
the src GstPad to perform the getrange on. |
offset : |
the offset of the range |
length : |
the length of the range |
buffer : |
a memory location to hold the result buffer, cannot be NULL. |
Returns : | GST_FLOW_OK for success |
void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
Sets the given event handler for the pad.
pad
:pad
a source GstPad.
a source GstPad.
GstPadGstPadevent
:event
the GstPadEventFunction to set.
the GstPadEventFunction to set.
GstPadEventFunctionGstPadEventFunction
pad : |
a source GstPad. |
event : |
the GstPadEventFunction to set. |
gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
Function signature to handle an event for the pad.
pad
:pad
the GstPad to handle the event.
the GstPad to handle the event.
GstPadGstPadevent
:event
the GstEvent to handle.
the GstEvent to handle.
GstEventGstEventReturns :Returns TRUE if the pad could handle the event.
TRUE if the pad could handle the event.
pad : |
the GstPad to handle the event. |
event : |
the GstEvent to handle. |
Returns : | TRUE if the pad could handle the event. |
void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
Sets the given link function for the pad. It will be called when the pad is linked with another pad.
The return value GST_PAD_LINK_OK should be used when the connection can be made.
The return value GST_PAD_LINK_REFUSED should be used when the connection cannot be made for some reason.
If link
is installed on a source pad, it should call the GstPadLinkFunction
of the peer sink pad, if present.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadlink
:link
the GstPadLinkFunction to set.
the GstPadLinkFunction to set.
GstPadLinkFunctionGstPadLinkFunction
pad : |
a GstPad. |
link : |
the GstPadLinkFunction to set. |
GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstPad *peer);
Function signature to handle a new link on the pad.
pad
:pad
the GstPad that is linked.
the GstPad that is linked.
GstPadGstPadpeer
:peer
the peer GstPad of the link
the peer GstPad of the link
GstPadGstPadReturns :Returns the result of the link with the specified peer.
the result of the link with the specified peer.
pad : |
the GstPad that is linked. |
peer : |
the peer GstPad of the link |
Returns : | the result of the link with the specified peer. |
void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
Sets the given unlink function for the pad. It will be called when the pad is unlinked.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadunlink
:unlink
the GstPadUnlinkFunction to set.
the GstPadUnlinkFunction to set.
GstPadUnlinkFunctionGstPadUnlinkFunction
pad : |
a GstPad. |
unlink : |
the GstPadUnlinkFunction to set. |
void (*GstPadUnlinkFunction) (GstPad *pad);
Function signature to handle a unlinking the pad prom its peer.
gboolean gst_pad_accept_caps (GstPad *pad, GstCaps *caps);
Check if the given pad accepts the caps.
pad
:pad
a GstPad to check
a GstPad to check
GstPadGstPadcaps
:caps
a GstCaps to check on the pad
a GstCaps to check on the pad
GstCapsGstCapsReturns :Returns TRUE if the pad can accept the caps.
TRUE if the pad can accept the caps.
pad : |
a GstPad to check |
caps : |
a GstCaps to check on the pad |
Returns : | TRUE if the pad can accept the caps. |
void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps);
Sets the given acceptcaps function for the pad. The acceptcaps function will be called to check if the pad can accept the given caps. Setting the acceptcaps function to NULL restores the default behaviour of allowing any caps that matches the caps from gst_pad_get_caps.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadacceptcaps
:acceptcaps
the GstPadAcceptCapsFunction to set.
the GstPadAcceptCapsFunction to set.
GstPadAcceptCapsFunctionGstPadAcceptCapsFunction
pad : |
a GstPad. |
acceptcaps : |
the GstPadAcceptCapsFunction to set. |
gboolean (*GstPadAcceptCapsFunction) (GstPad *pad, GstCaps *caps);
Check if pad
can accept caps
. By default this function will see if caps
intersect with the result from gst_pad_get_caps()
by can be overridden to
perform extra checks.
pad
:pad
the GstPad to check
the GstPad to check
GstPadGstPadcaps
:caps
the GstCaps to check
the GstCaps to check
GstCapsGstCapsReturns :Returns TRUE if the caps can be accepted by the pad.
TRUE if the caps can be accepted by the pad.
pad : |
the GstPad to check |
caps : |
the GstCaps to check |
Returns : | TRUE if the caps can be accepted by the pad. |
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
Sets the given getcaps function for the pad. getcaps
should return the
allowable caps for a pad in the context of the element's state, its link to
other elements, and the devices or files it has opened. These caps must be a
subset of the pad template caps. In the NULL state with no links, getcaps
should ideally return the same caps as the pad template. In rare
circumstances, an object property can affect the caps returned by getcaps
,
but this is discouraged.
You do not need to call this function if pad
's allowed caps are always the
same as the pad template caps. This can only be true if the padtemplate
has fixed simple caps.
For most filters, the caps returned by getcaps
is directly affected by the
allowed caps on other pads. For demuxers and decoders, the caps returned by
the srcpad's getcaps function is directly related to the stream data. Again,
getcaps
should return the most specific caps it reasonably can, since this
helps with autoplugging.
Note that the return value from getcaps
is owned by the caller, so the caller
should unref the caps after usage.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadgetcaps
:getcaps
the GstPadGetCapsFunction to set.
the GstPadGetCapsFunction to set.
GstPadGetCapsFunctionGstPadGetCapsFunction
pad : |
a GstPad. |
getcaps : |
the GstPadGetCapsFunction to set. |
GstCaps* (*GstPadGetCapsFunction) (GstPad *pad);
Returns a copy of the capabilities of the specified pad. By default this function will return the pad template capabilities, but can optionally be overridden by elements.
pad
:pad
the GstPad to get the capabilities of.
the GstPad to get the capabilities of.
GstPadGstPadReturns :Returns a newly allocated copy GstCaps of the pad.
a newly allocated copy GstCaps of the pad.
GstCapsGstCaps
pad : |
the GstPad to get the capabilities of. |
Returns : | a newly allocated copy GstCaps of the pad. |
GstCaps* gst_pad_proxy_getcaps (GstPad *pad);
Calls gst_pad_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.
void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps);
Sets the given setcaps function for the pad. The setcaps function will be called whenever a buffer with a new media type is pushed or pulled from the pad. The pad/element needs to update its internal structures to process the new media type. If this new type is not acceptable, the setcaps function should return FALSE.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadsetcaps
:setcaps
the GstPadSetCapsFunction to set.
the GstPadSetCapsFunction to set.
GstPadSetCapsFunctionGstPadSetCapsFunction
pad : |
a GstPad. |
setcaps : |
the GstPadSetCapsFunction to set. |
gboolean (*GstPadSetCapsFunction) (GstPad *pad, GstCaps *caps);
Set caps
on pad
. By default this function updates the caps of the
pad but the function can be overriden by elements to perform extra
actions or verifications.
pad
:pad
the GstPad to set the capabilities of.
the GstPad to set the capabilities of.
GstPadGstPadcaps
:caps
the GstCaps to set
the GstCaps to set
GstCapsGstCapsReturns :Returns TRUE if the caps could be set on the pad.
TRUE if the caps could be set on the pad.
pad : |
the GstPad to set the capabilities of. |
caps : |
the GstCaps to set |
Returns : | TRUE if the caps could be set on the pad. |
gboolean gst_pad_proxy_setcaps (GstPad *pad, GstCaps *caps);
Calls gst_pad_set_caps()
for every other pad belonging to the
same element as pad
. If gst_pad_set_caps()
fails on any pad,
the proxy setcaps fails. May be used only during negotiation.
void gst_pad_fixate_caps (GstPad *pad, GstCaps *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()
).
void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
Sets the given fixatecaps function for the pad. The fixatecaps function will be called whenever the default values for a GstCaps needs to be filled in.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadfixatecaps
:fixatecaps
the GstPadFixateCapsFunction to set.
the GstPadFixateCapsFunction to set.
GstPadFixateCapsFunctionGstPadFixateCapsFunction
pad : |
a GstPad. |
fixatecaps : |
the GstPadFixateCapsFunction to set. |
void (*GstPadFixateCapsFunction) (GstPad *pad, GstCaps *caps);
Given possibly unfixed caps caps
, let pad
use its default prefered
format to make a fixed caps. caps
should be writable. By default this
function will pick the first value of any ranges or lists in the caps but
elements can override this function to perform other behaviour.
GstCaps* gst_pad_get_fixed_caps_func (GstPad *pad);
A helper function you can use as a GetCaps function that will return the currently negotiated caps or the padtemplate when NULL.
pad
:pad
the pad to use
the pad to use
Returns :Returns The currently negotiated caps or the padtemplate.
The currently negotiated caps or the padtemplate.
pad : |
the pad to use |
Returns : | The currently negotiated caps or the padtemplate. |
gboolean gst_pad_peer_accept_caps (GstPad *pad, GstCaps *caps);
Check if the peer of pad
accepts caps
. If pad
has no peer, this function
returns TRUE.
pad
:pad
a GstPad to check the peer of
a GstPad to check the peer of
GstPadGstPadcaps
:caps
a GstCaps to check on the pad
a GstCaps to check on the pad
GstCapsGstCapsReturns :Returns TRUE if the peer of pad
can accept the caps or pad
has no peer.
TRUE if the peer of pad
can accept the caps or pad
has no peer.
pad
pad
pad : |
a GstPad to check the peer of |
caps : |
a GstCaps to check on the pad |
Returns : | TRUE if the peer of pad can accept the caps or pad has no peer.
|
void gst_pad_set_activate_function (GstPad *pad, GstPadActivateFunction activate);
Sets the given activate function for pad
. The activate function will
dispatch to gst_pad_activate_push()
or gst_pad_activate_pull()
to perform
the actual activation. Only makes sense to set on sink pads.
Call this function if your sink pad can start a pull-based task.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadactivate
:activate
the GstPadActivateFunction to set.
the GstPadActivateFunction to set.
GstPadActivateFunctionGstPadActivateFunction
pad : |
a GstPad. |
activate : |
the GstPadActivateFunction to set. |
gboolean (*GstPadActivateFunction) (GstPad *pad);
This function is called when the pad is activated during the element READY to PAUSED state change. By default this function will call the activate function that puts the pad in push mode but elements can override this function to activate the pad in pull mode if they wish.
void gst_pad_set_activatepush_function (GstPad *pad, GstPadActivateModeFunction activatepush);
Sets the given activate_push function for the pad. An activate_push function prepares the element for pushing. See XXX part-activation.txt for details.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadactivatepush
:activatepush
the GstPadActivateModeFunction to set.
the GstPadActivateModeFunction to set.
GstPadActivateModeFunctionGstPadActivateModeFunction
pad : |
a GstPad. |
activatepush : |
the GstPadActivateModeFunction to set. |
void gst_pad_set_activatepull_function (GstPad *pad, GstPadActivateModeFunction activatepull);
Sets the given activate_pull function for the pad. An activate_pull function prepares the element and any upstream connections for pulling. See XXX part-activation.txt for details.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadactivatepull
:activatepull
the GstPadActivateModeFunction to set.
the GstPadActivateModeFunction to set.
GstPadActivateModeFunctionGstPadActivateModeFunction
pad : |
a GstPad. |
activatepull : |
the GstPadActivateModeFunction to set. |
gboolean (*GstPadActivateModeFunction) (GstPad *pad, gboolean active);
The prototype of the push and pull activate functions.
pad
:pad
a GstPad
a GstPad
GstPadGstPadactive
:active
activate or deactivate the pad.
activate or deactivate the pad.
Returns :Returns TRUE if the pad could be activated or deactivated.
TRUE if the pad could be activated or deactivated.
pad : |
a GstPad |
active : |
activate or deactivate the pad. |
Returns : | TRUE if the pad could be activated or deactivated. |
GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
Pushes a buffer to the peer of pad
.
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
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 gst_pad_chain()
on the peer pad and returns the
value from that function. If pad
has no peer, GST_FLOW_NOT_LINKED will be
returned.
In all cases, success or failure, the caller loses its reference to buffer
after calling this function.
pad
:pad
a source GstPad, returns GST_FLOW_ERROR if not.
a source GstPad, returns GST_FLOW_ERROR if not.
GstPadGstPadGST_FLOW_ERRORGST_FLOW_ERRORbuffer
:buffer
the GstBuffer to push returns GST_FLOW_ERROR if not.
the GstBuffer to push returns GST_FLOW_ERROR if not.
GstBufferGstBufferReturns :Returns a GstFlowReturn from the peer pad.
MT safe.
a GstFlowReturn from the peer pad.
MT safe.
GstFlowReturnGstFlowReturn
pad : |
a source GstPad, returns GST_FLOW_ERROR if not. |
buffer : |
the GstBuffer to push returns GST_FLOW_ERROR if not. |
Returns : | a GstFlowReturn from the peer pad. MT safe. |
gboolean gst_pad_push_event (GstPad *pad, GstEvent *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 owership of the provided event so you should
gst_event_ref()
it if you want to reuse the event after this call.
pad
:pad
a GstPad to push the event to.
a GstPad to push the event to.
GstPadGstPadevent
:event
the GstEvent to send to the pad.
the GstEvent to send to the pad.
GstEventGstEventReturns :Returns TRUE if the event was handled.
MT safe.
TRUE if the event was handled.
MT safe.
pad : |
a GstPad to push the event to. |
event : |
the GstEvent to send to the pad. |
Returns : | TRUE if the event was handled. MT safe. |
gboolean gst_pad_check_pull_range (GstPad *pad);
Checks if a gst_pad_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 GstPadCheckGetRangeFunction if it needs to perform some logic to determine if pull_range is possible.
GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer);
Pulls a buffer from the peer pad.
This function will first trigger the pad block signal if it was installed.
When pad
is not linked GST_FLOW_NOT_LINKED is returned else this
function returns the result of gst_pad_get_range()
on the peer pad.
See gst_pad_get_range()
for a list of return values and for the
semantics of the arguments of this function.
pad
:pad
a sink GstPad, returns GST_FLOW_ERROR if not.
a sink GstPad, returns GST_FLOW_ERROR if not.
GstPadGstPadoffset
:offset
The start offset of the buffer
The start offset of the buffer
size
:size
The length of the buffer
The length of the buffer
buffer
:buffer
a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL
.
a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL
.
GstBufferGstBufferNULL
NULL
Returns :Returns a GstFlowReturn from the peer pad.
When this function returns GST_FLOW_OK, buffer
will contain a valid
GstBuffer that should be freed with gst_buffer_unref()
after usage.
buffer
may not be used or freed when any other return value than
GST_FLOW_OK is returned.
MT safe.
a GstFlowReturn from the peer pad.
When this function returns GST_FLOW_OK, buffer
will contain a valid
GstBuffer that should be freed with gst_buffer_unref()
after usage.
buffer
may not be used or freed when any other return value than
GST_FLOW_OK is returned.
MT safe.
GstFlowReturnGstFlowReturnGST_FLOW_OKGST_FLOW_OKbuffer
GstBufferGstBuffergst_buffer_unref()
gst_buffer_unref()
buffer
GST_FLOW_OKGST_FLOW_OK
pad : |
a sink GstPad, returns GST_FLOW_ERROR if not. |
offset : |
The start offset of the buffer |
size : |
The length of the buffer |
buffer : |
a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL .
|
Returns : | a GstFlowReturn from the peer pad.
When this function returns GST_FLOW_OK, buffer will contain a valid
GstBuffer that should be freed with gst_buffer_unref() after usage.
buffer may not be used or freed when any other return value than
GST_FLOW_OK is returned.
MT safe.
|
gboolean gst_pad_activate_pull (GstPad *pad, gboolean active);
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.
pad
:pad
the GstPad to activate or deactivate.
the GstPad to activate or deactivate.
GstPadGstPadactive
:active
whether or not the pad should be active.
whether or not the pad should be active.
Returns :Returns TRUE if the operation was successful.
MT safe.
TRUE if the operation was successful.
MT safe.
pad : |
the GstPad to activate or deactivate. |
active : |
whether or not the pad should be active. |
Returns : | TRUE if the operation was successful. MT safe. |
gboolean gst_pad_activate_push (GstPad *pad, gboolean active);
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.
pad
:pad
the GstPad to activate or deactivate.
the GstPad to activate or deactivate.
GstPadGstPadactive
:active
whether the pad should be active or not.
whether the pad should be active or not.
Returns :Returns TRUE
if the operation was successful.
MT safe.
TRUE
if the operation was successful.
MT safe.
TRUE
TRUE
pad : |
the GstPad to activate or deactivate. |
active : |
whether the pad should be active or not. |
Returns : | TRUE if the operation was successful.
MT safe.
|
gboolean gst_pad_send_event (GstPad *pad, GstEvent *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 GstEventTypeFlags, 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 owership of the provided event so you should
gst_event_ref()
it if you want to reuse the event after this call.
pad
:pad
a GstPad to send the event to.
a GstPad to send the event to.
GstPadGstPadevent
:event
the GstEvent to send to the pad.
the GstEvent to send to the pad.
GstEventGstEventReturns :Returns TRUE if the event was handled.
TRUE if the event was handled.
pad : |
a GstPad to send the event to. |
event : |
the GstEvent to send to the pad. |
Returns : | TRUE if the event was handled. |
gboolean gst_pad_event_default (GstPad *pad, GstEvent *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.
pad
:pad
a GstPad to call the default event handler on.
a GstPad to call the default event handler on.
GstPadGstPadevent
:event
the GstEvent to handle.
the GstEvent to handle.
GstEventGstEventReturns :Returns TRUE if the event was sent succesfully.
TRUE if the event was sent succesfully.
pad : |
a GstPad to call the default event handler on. |
event : |
the GstEvent to handle. |
Returns : | TRUE if the event was sent succesfully. |
gboolean gst_pad_query (GstPad *pad, GstQuery *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.
pad
:pad
a GstPad to invoke the default query on.
a GstPad to invoke the default query on.
GstPadGstPadquery
:query
the GstQuery to perform.
the GstQuery to perform.
GstQueryGstQueryReturns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad to invoke the default query on. |
query : |
the GstQuery to perform. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_default (GstPad *pad, GstQuery *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.
pad
:pad
a GstPad to call the default query handler on.
a GstPad to call the default query handler on.
GstPadGstPadquery
:query
the GstQuery to handle.
the GstQuery to handle.
GstQueryGstQueryReturns :Returns TRUE if the query was performed succesfully.
TRUE if the query was performed succesfully.
pad : |
a GstPad to call the default query handler on. |
query : |
the GstQuery to handle. |
Returns : | TRUE if the query was performed succesfully. |
gboolean gst_pad_query_position (GstPad *pad, GstFormat *format, gint64 *cur);
Queries a pad for the stream position.
pad
:pad
a GstPad to invoke the position query on.
a GstPad to invoke the position query on.
GstPadGstPadformat
:format
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
GstFormatGstFormatGstFormatGstFormatcur
:cur
A location in which to store the current position, or NULL.
A location in which to store the current position, or NULL.
Returns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad to invoke the position query on. |
format : |
a pointer to the GstFormat asked for. On return contains the GstFormat used. |
cur : |
A location in which to store the current position, or NULL. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_duration (GstPad *pad, GstFormat *format, gint64 *duration);
Queries a pad for the total stream duration.
pad
:pad
a GstPad to invoke the duration query on.
a GstPad to invoke the duration query on.
GstPadGstPadformat
:format
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
GstFormatGstFormatGstFormatGstFormatduration
:duration
A location in which to store the total duration, or NULL.
A location in which to store the total duration, or NULL.
Returns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad to invoke the duration query on. |
format : |
a pointer to the GstFormat asked for. On return contains the GstFormat used. |
duration : |
A location in which to store the total duration, or NULL. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_convert (GstPad *pad, GstFormat src_format, gint64 src_val, GstFormat *dest_format, gint64 *dest_val);
Queries a pad to convert src_val
in src_format
to dest_format
.
pad
:pad
a GstPad to invoke the convert query on.
a GstPad to invoke the convert query on.
GstPadGstPadsrc_format
:src_format
a GstFormat to convert from.
a GstFormat to convert from.
GstFormatGstFormatsrc_val
:src_val
a value to convert.
a value to convert.
dest_format
:dest_format
a pointer to the GstFormat to convert to.
a pointer to the GstFormat to convert to.
GstFormatGstFormatdest_val
:dest_val
a pointer to the result.
a pointer to the result.
Returns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad to invoke the convert query on. |
src_format : |
a GstFormat to convert from. |
src_val : |
a value to convert. |
dest_format : |
a pointer to the GstFormat to convert to. |
dest_val : |
a pointer to the result. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_peer_position (GstPad *pad, GstFormat *format, gint64 *cur);
Queries the peer of a given sink pad for the stream position.
pad
:pad
a GstPad on whose peer to invoke the position query on.
Must be a sink pad.
a GstPad on whose peer to invoke the position query on.
Must be a sink pad.
GstPadGstPadformat
:format
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
GstFormatGstFormatGstFormatGstFormatcur
:cur
A location in which to store the current position, or NULL.
A location in which to store the current position, or NULL.
Returns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad on whose peer to invoke the position query on. Must be a sink pad. |
format : |
a pointer to the GstFormat asked for. On return contains the GstFormat used. |
cur : |
A location in which to store the current position, or NULL. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_peer_duration (GstPad *pad, GstFormat *format, gint64 *duration);
Queries the peer pad of a given sink pad for the total stream duration.
pad
:pad
a GstPad on whose peer pad to invoke the duration query on.
Must be a sink pad.
a GstPad on whose peer pad to invoke the duration query on.
Must be a sink pad.
GstPadGstPadformat
:format
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
a pointer to the GstFormat asked for.
On return contains the GstFormat used.
GstFormatGstFormatGstFormatGstFormatduration
:duration
A location in which to store the total duration, or NULL.
A location in which to store the total duration, or NULL.
Returns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad on whose peer pad to invoke the duration query on. Must be a sink pad. |
format : |
a pointer to the GstFormat asked for. On return contains the GstFormat used. |
duration : |
A location in which to store the total duration, or NULL. |
Returns : | TRUE if the query could be performed. |
gboolean gst_pad_query_peer_convert (GstPad *pad, GstFormat src_format, gint64 src_val, GstFormat *dest_format, gint64 *dest_val);
Queries the peer pad of a given sink pad to convert src_val
in src_format
to dest_format
.
pad
:pad
a GstPad, on whose peer pad to invoke the convert query on.
Must be a sink pad.
a GstPad, on whose peer pad to invoke the convert query on.
Must be a sink pad.
GstPadGstPadsrc_format
:src_format
a GstFormat to convert from.
a GstFormat to convert from.
GstFormatGstFormatsrc_val
:src_val
a value to convert.
a value to convert.
dest_format
:dest_format
a pointer to the GstFormat to convert to.
a pointer to the GstFormat to convert to.
GstFormatGstFormatdest_val
:dest_val
a pointer to the result.
a pointer to the result.
Returns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
a GstPad, on whose peer pad to invoke the convert query on. Must be a sink pad. |
src_format : |
a GstFormat to convert from. |
src_val : |
a value to convert. |
dest_format : |
a pointer to the GstFormat to convert to. |
dest_val : |
a pointer to the result. |
Returns : | TRUE if the query could be performed. |
void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
Set the given query function for the pad.
pad
:pad
a GstPad of either direction.
a GstPad of either direction.
GstPadGstPadquery
:query
the GstPadQueryFunction to set.
the GstPadQueryFunction to set.
GstPadQueryFunctionGstPadQueryFunction
pad : |
a GstPad of either direction. |
query : |
the GstPadQueryFunction to set. |
gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery *query);
The signature of the query function.
pad
:pad
the GstPad to query.
the GstPad to query.
GstPadGstPadquery
:query
the GstQuery object to execute
the GstQuery object to execute
GstQueryGstQueryReturns :Returns TRUE if the query could be performed.
TRUE if the query could be performed.
pad : |
the GstPad to query. |
query : |
the GstQuery object to execute |
Returns : | TRUE if the query could be performed. |
void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func);
Set the given query type function for the pad.
pad
:pad
a GstPad of either direction.
a GstPad of either direction.
GstPadGstPadtype_func
:type_func
the GstPadQueryTypeFunction to set.
the GstPadQueryTypeFunction to set.
GstPadQueryTypeFunctionGstPadQueryTypeFunction
pad : |
a GstPad of either direction. |
type_func : |
the GstPadQueryTypeFunction to set. |
const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
The signature of the query types function.
const GstQueryType* gst_pad_get_query_types (GstPad *pad);
Get an array of supported queries that can be performed on this pad.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadReturns :Returns a zero-terminated array of GstQueryType.
a zero-terminated array of GstQueryType.
GstQueryTypeGstQueryType
pad : |
a GstPad. |
Returns : | a zero-terminated array of GstQueryType. |
const GstQueryType* gst_pad_get_query_types_default (GstPad *pad);
Invoke the default dispatcher for the query types on the pad.
pad
:pad
a GstPad.
a GstPad.
GstPadGstPadReturns :Returns an zero-terminated array of GstQueryType, or NULL if none of the
internally-linked pads has a query types function.
an zero-terminated array of GstQueryType, or NULL if none of the
internally-linked pads has a query types function.
GstQueryTypeGstQueryType
pad : |
a GstPad. |
Returns : | an zero-terminated array of GstQueryType, or NULL if none of the internally-linked pads has a query types function. |
void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
Sets the given internal link function for the pad.
pad
:pad
a GstPad of either direction.
a GstPad of either direction.
GstPadGstPadintlink
:intlink
the GstPadIntLinkFunction to set.
the GstPadIntLinkFunction to set.
GstPadIntLinkFunctionGstPadIntLinkFunction
pad : |
a GstPad of either direction. |
intlink : |
the GstPadIntLinkFunction to set. |
GList* (*GstPadIntLinkFunction) (GstPad *pad);
The signature of the internal pad link function.
pad
:pad
The GstPad to query.
The GstPad to query.
GstPadGstPadReturns :Returns a newly allocated GList of pads that are linked to the given pad on
the inside of the parent element.
The caller must call g_list_free()
on it after use.
a newly allocated GList of pads that are linked to the given pad on
the inside of the parent element.
The caller must call g_list_free()
on it after use.
GListGListg_list_free()
g_list_free()
pad : |
The GstPad to query. |
Returns : | a newly allocated GList of pads that are linked to the given pad on
the inside of the parent element.
The caller must call g_list_free() on it after use.
|
GList* gst_pad_get_internal_links (GstPad *pad);
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.
pad
:pad
the GstPad to get the internal links of.
the GstPad to get the internal links of.
GstPadGstPadReturns :Returns a newly allocated GList of pads.
Not MT safe.
a newly allocated GList of pads.
Not MT safe.
GListGList
pad : |
the GstPad to get the internal links of. |
Returns : | a newly allocated GList of pads. Not MT safe. |
GList* gst_pad_get_internal_links_default (GstPad *pad);
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.
pad
:pad
the GstPad to get the internal links of.
the GstPad to get the internal links of.
GstPadGstPadReturns :Returns a newly allocated GList of pads, or NULL if the pad has no parent.
Not MT safe.
a newly allocated GList of pads, or NULL if the pad has no parent.
Not MT safe.
GListGList
pad : |
the GstPad to get the internal links of. |
Returns : | a newly allocated GList of pads, or NULL if the pad has no parent. Not MT safe. |
void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
Reads the pad definition from the XML node and links the given pad in the element to a pad of an element up in the hierarchy.
self
:self
an xmlNodePtr to read the description from.
an xmlNodePtr to read the description from.
xmlNodePtrxmlNodePtrparent
:parent
the GstObject element that owns the pad.
the GstObject element that owns the pad.
GstObjectGstObject
self : |
an xmlNodePtr to read the description from. |
parent : |
the GstObject element that owns the pad. |
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, gpointer data);
Invokes the given dispatcher function on each respective peer of all pads that are internally linked to the given pad. The GstPadDispatcherFunction should return TRUE when no further pads need to be processed.
pad
:pad
a GstPad to dispatch.
a GstPad to dispatch.
GstPadGstPaddispatch
:dispatch
the GstDispatcherFunction to call.
the GstDispatcherFunction to call.
GstDispatcherFunctionGstDispatcherFunctiondata
:data
gpointer user data passed to the dispatcher function.
gpointer user data passed to the dispatcher function.
Returns :Returns TRUE if one of the dispatcher functions returned TRUE.
TRUE if one of the dispatcher functions returned TRUE.
pad : |
a GstPad to dispatch. |
dispatch : |
the GstDispatcherFunction to call. |
data : |
gpointer user data passed to the dispatcher function. |
Returns : | TRUE if one of the dispatcher functions returned TRUE. |
gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
A dispatcher function is called for all internally linked pads, see
gst_pad_dispatcher()
.
pad
:pad
the GstPad that is dispatched.
the GstPad that is dispatched.
GstPadGstPaddata
:data
the gpointer to optional user data.
the gpointer to optional user data.
Returns :Returns TRUE if the dispatching procedure has to be stopped.
TRUE if the dispatching procedure has to be stopped.
pad : |
the GstPad that is dispatched. |
data : |
the gpointer to optional user data. |
Returns : | TRUE if the dispatching procedure has to be stopped. |
void gst_pad_set_element_private (GstPad *pad, 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.
gpointer gst_pad_get_element_private (GstPad *pad);
Gets the private data of a pad. No locking is performed in this function.
GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
Chain a buffer to pad
.
The function returns GST_FLOW_WRONG_STATE if the pad was flushing.
If the caps on buffer
are different from the current caps on pad
, this
function will call any setcaps function (see gst_pad_set_setcaps_function()
)
installed on pad
. If the new caps are not acceptable for pad
, 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.
pad
:pad
a sink GstPad, returns GST_FLOW_ERROR if not.
a sink GstPad, returns GST_FLOW_ERROR if not.
GstPadGstPadbuffer
:buffer
the GstBuffer to send, return GST_FLOW_ERROR if not.
the GstBuffer to send, return GST_FLOW_ERROR if not.
GstBufferGstBufferReturns :Returns a GstFlowReturn from the pad.
MT safe.
a GstFlowReturn from the pad.
MT safe.
GstFlowReturnGstFlowReturn
pad : |
a sink GstPad, returns GST_FLOW_ERROR if not. |
buffer : |
the GstBuffer to send, return GST_FLOW_ERROR if not. |
Returns : | a GstFlowReturn from the pad. MT safe. |
gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func, gpointer data);
Starts a task that repeadedly calls func
with data
. This function
is nostly used in the pad activation function to start the
dataflow. This function will automatically acquire the GST_PAD_STREAM_LOCK
of the pad before calling func
.
pad
:pad
the GstPad to start the task of
the GstPad to start the task of
GstPadGstPadfunc
:func
the task function to call
the task function to call
data
:data
data passed to the task function
data passed to the task function
Returns :Returns a TRUE
if the task could be started.
a TRUE
if the task could be started.
TRUE
TRUE
pad : |
the GstPad to start the task of |
func : |
the task function to call |
data : |
data passed to the task function |
Returns : | a TRUE if the task could be started.
|
gboolean gst_pad_pause_task (GstPad *pad);
Pause the task of pad
. This function will also make sure that the
function executed by the task will effectively stop.
pad
:pad
the GstPad to pause the task of
the GstPad to pause the task of
GstPadGstPadReturns :Returns a TRUE if the task could be paused or FALSE when the pad
has no task.
a TRUE if the task could be paused or FALSE when the pad
has no task.
pad : |
the GstPad to pause the task of |
Returns : | a TRUE if the task could be paused or FALSE when the pad has no task. |
gboolean gst_pad_stop_task (GstPad *pad);
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.
pad
:pad
the GstPad to stop the task of
the GstPad to stop the task of
GstPadGstPadReturns :Returns a TRUE if the task could be stopped or FALSE on error.
a TRUE if the task could be stopped or FALSE on error.
pad : |
the GstPad to stop the task of |
Returns : | a TRUE if the task could be stopped or FALSE on error. |
gboolean gst_pad_set_active (GstPad *pad, gboolean active);
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
gst_pad_activate_push()
or gst_pad_activate_pull()
, as appropriate, with a
FALSE argument.
pad
:pad
the GstPad to activate or deactivate.
the GstPad to activate or deactivate.
GstPadGstPadactive
:active
whether or not the pad should be active.
whether or not the pad should be active.
Returns :Returns TRUE if the operation was successful.
MT safe.
TRUE if the operation was successful.
MT safe.
TRUETRUE
pad : |
the GstPad to activate or deactivate. |
active : |
whether or not the pad should be active. |
Returns : | TRUE if the operation was successful. MT safe. |
#define GST_PAD_GET_STREAM_LOCK(pad) (GST_PAD_CAST(pad)->stream_rec_lock)
Get the stream lock of pad
. The stream lock is protecting the
resources used in the data processing functions of pad
.
#define GST_PAD_STREAM_LOCK(pad) (g_static_rec_mutex_lock(GST_PAD_GET_STREAM_LOCK(pad)))
Lock the stream lock of pad
.
#define GST_PAD_STREAM_LOCK_FULL(pad,t) (g_static_rec_mutex_lock_full(GST_PAD_GET_STREAM_LOCK(pad), t))
Lock the stream lock of pad
t
times.
#define GST_PAD_STREAM_TRYLOCK(pad) (g_static_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad)))
Try to Lock the stream lock of the pad, return TRUE if the lock could be taken.
#define GST_PAD_STREAM_UNLOCK(pad) (g_static_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad)))
Unlock the stream lock of pad
.
#define GST_PAD_STREAM_UNLOCK_FULL(pad) (g_static_rec_mutex_unlock_full(GST_PAD_GET_STREAM_LOCK(pad)))
Fully unlock the recursive stream lock of pad
, return the number of times
pad
was locked.
#define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
Macro to test if the given GstFlowReturn value indicates a fatal error. This macro is mainly used in elements to decide when an error message should be posted on the bus.
ret
:ret
a GstFlowReturn value
a GstFlowReturn value
GstFlowReturnGstFlowReturn
ret : |
a GstFlowReturn value |
#define GST_FLOW_IS_SUCCESS(ret) ((ret) >= GST_FLOW_OK)
Macro to test if the given GstFlowReturn value indicates a successfull result This macro is mainly used in elements to decide if the processing of a buffer was successfull.
ret
:ret
a GstFlowReturn value
a GstFlowReturn value
GstFlowReturnGstFlowReturn
ret : |
a GstFlowReturn value |
Since 0.10.7
direction
" property"direction" GstPadDirection : Read / Write / Construct Only
The direction of the pad.
Default value: GST_PAD_UNKNOWN
gboolean user_function (GstPad *pad, GstMiniObject *mini_obj, gpointer user_data) : Run last / Has details
Signals that new data is available on the pad. This signal is used internally for implementing pad probes. See gst_pad_add_*_probe functions.
pad
:pad
the pad that emitted the signal
the pad that emitted the signal
mini_obj
:mini_obj
new data
new data
user_data
:user_data
user data set when the signal handler was connected.user data set when the signal handler was connected.Returns :Returns TRUE
to keep the data, FALSE
to drop it
TRUE
to keep the data, FALSE
to drop it
TRUE
TRUE
FALSE
FALSE
pad : |
the pad that emitted the signal |
mini_obj : |
new data |
user_data : |
user data set when the signal handler was connected. |
Returns : | TRUE to keep the data, FALSE to drop it
|
void user_function (GstPad *pad, GstPad *peer, gpointer user_data) : Run last
Signals that a pad has been linked to the peer pad.
pad
:pad
the pad that emitted the signal
the pad that emitted the signal
peer
:peer
the peer pad that has been connected
the peer pad that has been connected
user_data
:user_data
user data set when the signal handler was connected.user data set when the signal handler was connected.
pad : |
the pad that emitted the signal |
peer : |
the peer pad that has been connected |
user_data : |
user data set when the signal handler was connected. |
void user_function (GstPad *pad, gpointer user_data) : Run last
Signals that a pad connection has been requested.
pad
:pad
the pad that emitted the signal
the pad that emitted the signal
peer
:peer
the peer pad for which a connection is requested
the peer pad for which a connection is requested
user_data
:user_data
user data set when the signal handler was connected.user data set when the signal handler was connected.
pad : |
the pad that emitted the signal |
peer : |
the peer pad for which a connection is requested |
user_data : |
user data set when the signal handler was connected. |
void user_function (GstPad *pad, GstPad *peer, gpointer user_data) : Run last
Signals that a pad has been unlinked from the peer pad.
pad
:pad
the pad that emitted the signal
the pad that emitted the signal
peer
:peer
the peer pad that has been disconnected
the peer pad that has been disconnected
user_data
:user_data
user data set when the signal handler was connected.user data set when the signal handler was connected.
pad : |
the pad that emitted the signal |
peer : |
the peer pad that has been disconnected |
user_data : |
user data set when the signal handler was connected. |