X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstpad.h;h=bfb8b1a29036ac12db5b6a38dc9c881d60c847d1;hb=e10266e3f3cf9b05b69198b1ac6faa9a62840e30;hp=45b6a3789379eb100ca7d8f2a41534c7d65c36bb;hpb=629a8d03ce6aa49f6bb98c2cfc66896f27da09ea;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstpad.h b/gst/gstpad.h index 45b6a37..bfb8b1a 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -16,8 +16,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ @@ -29,6 +29,7 @@ typedef struct _GstPad GstPad; typedef struct _GstPadPrivate GstPadPrivate; typedef struct _GstPadClass GstPadClass; +typedef struct _GstPadProbeInfo GstPadProbeInfo; /** * GstPadDirection: @@ -60,6 +61,8 @@ typedef enum { GST_PAD_MODE_PULL } GstPadMode; +const gchar * gst_pad_mode_get_name (GstPadMode mode); + #include #include #include @@ -127,34 +130,32 @@ typedef enum { * GstFlowReturn: * @GST_FLOW_OK: Data passing was ok. * @GST_FLOW_NOT_LINKED: Pad is not linked. - * @GST_FLOW_WRONG_STATE: Pad is in wrong state. + * @GST_FLOW_FLUSHING: Pad is flushing. * @GST_FLOW_EOS: Pad is EOS. * @GST_FLOW_NOT_NEGOTIATED: Pad is not negotiated. - * @GST_FLOW_ERROR: Some (fatal) error occured. Element generating + * @GST_FLOW_ERROR: Some (fatal) error occurred. Element generating * this error should post an error message with more * details. * @GST_FLOW_NOT_SUPPORTED: This operation is not supported. * @GST_FLOW_CUSTOM_SUCCESS: Elements can use values starting from * this (and higher) to define custom success - * codes. Since 0.10.7. + * codes. * @GST_FLOW_CUSTOM_SUCCESS_1: Pre-defined custom success code (define your * custom success code to this to avoid compiler - * warnings). Since 0.10.29. - * @GST_FLOW_CUSTOM_SUCCESS_2: Pre-defined custom success code. Since 0.10.29. + * warnings). + * @GST_FLOW_CUSTOM_SUCCESS_2: Pre-defined custom success code. * @GST_FLOW_CUSTOM_ERROR: Elements can use values starting from * this (and lower) to define custom error codes. - * Since 0.10.7. * @GST_FLOW_CUSTOM_ERROR_1: Pre-defined custom error code (define your * custom error code to this to avoid compiler - * warnings). Since 0.10.29. - * @GST_FLOW_CUSTOM_ERROR_2: Pre-defined custom error code. Since 0.10.29. + * warnings). + * @GST_FLOW_CUSTOM_ERROR_2: Pre-defined custom error code. * * 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. + * element scope. */ -/* FIXME 0.11: remove custom flow returns */ typedef enum { /* custom success starts here */ GST_FLOW_CUSTOM_SUCCESS_2 = 102, @@ -165,7 +166,7 @@ typedef enum { GST_FLOW_OK = 0, /* expected failures */ GST_FLOW_NOT_LINKED = -1, - GST_FLOW_WRONG_STATE = -2, + GST_FLOW_FLUSHING = -2, /* error cases */ GST_FLOW_EOS = -3, GST_FLOW_NOT_NEGOTIATED = -4, @@ -178,8 +179,9 @@ typedef enum { GST_FLOW_CUSTOM_ERROR_2 = -102 } GstFlowReturn; -const gchar* gst_flow_get_name (GstFlowReturn ret); -GQuark gst_flow_to_quark (GstFlowReturn ret); +const gchar* gst_flow_get_name (GstFlowReturn ret); +GQuark gst_flow_to_quark (GstFlowReturn ret); +const gchar* gst_pad_link_get_name (GstPadLinkReturn ret); /** * GstPadLinkCheck: @@ -192,6 +194,8 @@ GQuark gst_flow_to_quark (GstFlowReturn ret); * would be unsafe e.g. if one pad has %GST_CAPS_ANY. * @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the * caps returned by gst_pad_query_caps(). + * @GST_PAD_LINK_CHECK_DEFAULT: The default checks done when linking + * pads (i.e. the ones used by gst_pad_link()). * * The amount of checking to be done when linking pads. @GST_PAD_LINK_CHECK_CAPS * and @GST_PAD_LINK_CHECK_TEMPLATE_CAPS are mutually exclusive. If both are @@ -203,26 +207,16 @@ GQuark gst_flow_to_quark (GstFlowReturn ret); * use the default checks (%GST_PAD_LINK_CHECK_DEFAULT) or the regular methods * for linking the pads. * - * - * Since: 0.10.30 */ typedef enum { GST_PAD_LINK_CHECK_NOTHING = 0, GST_PAD_LINK_CHECK_HIERARCHY = 1 << 0, GST_PAD_LINK_CHECK_TEMPLATE_CAPS = 1 << 1, - GST_PAD_LINK_CHECK_CAPS = 1 << 2 -} GstPadLinkCheck; + GST_PAD_LINK_CHECK_CAPS = 1 << 2, -/** - * GST_PAD_LINK_CHECK_DEFAULT: - * - * The default checks done when linking pads (i.e. the ones used by - * gst_pad_link()). - * - * Since: 0.10.30 - */ -#define GST_PAD_LINK_CHECK_DEFAULT ((GstPadLinkCheck) (GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS)) + GST_PAD_LINK_CHECK_DEFAULT = GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS +} GstPadLinkCheck; /* pad states */ /** @@ -235,7 +229,7 @@ typedef enum { * 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. * - * Returns: TRUE if the pad could be activated. + * Returns: %TRUE if the pad could be activated. */ typedef gboolean (*GstPadActivateFunction) (GstPad *pad, GstObject *parent); /** @@ -247,7 +241,7 @@ typedef gboolean (*GstPadActivateFunction) (GstPad *pad, GstObject *parent); * * The prototype of the push and pull activate functions. * - * Returns: TRUE if the pad could be activated or deactivated. + * Returns: %TRUE if the pad could be activated or deactivated. */ typedef gboolean (*GstPadActivateModeFunction) (GstPad *pad, GstObject *parent, GstPadMode mode, gboolean active); @@ -258,7 +252,7 @@ typedef gboolean (*GstPadActivateModeFunction) (GstPad *pad, GstObject *parent, * GstPadChainFunction: * @pad: the sink #GstPad that performed the chain. * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, - * @parent is guaranteed to be not-NULL and remain valid during the + * @parent is guaranteed to be not-%NULL and remain valid during the * execution of this function. * @buffer: the #GstBuffer that is chained, not %NULL. * @@ -281,7 +275,7 @@ typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstObject *parent, * GstPadChainListFunction: * @pad: the sink #GstPad that performed the chain. * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, - * @parent is guaranteed to be not-NULL and remain valid during the + * @parent is guaranteed to be not-%NULL and remain valid during the * execution of this function. * @list: the #GstBufferList that is chained, not %NULL. * @@ -304,11 +298,11 @@ typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstObject *paren * GstPadGetRangeFunction: * @pad: the src #GstPad to perform the getrange on. * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, - * @parent is guaranteed to be not-NULL and remain valid during the + * @parent is guaranteed to be not-%NULL and remain valid during the * execution of this function. * @offset: the offset of the range * @length: the length of the range - * @buffer: a memory location to hold the result buffer, cannot be NULL. + * @buffer: a memory location to hold the result buffer, cannot be %NULL. * * This function will be called on source pads when a peer element * request a buffer at the specified @offset and @length. If this function @@ -317,7 +311,8 @@ typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstObject *paren * * 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(). + * they are successfully activated with gst_pad_activate_mode() with the + * #GST_PAD_MODE_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 @@ -325,7 +320,7 @@ typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstObject *paren * #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 + * #GST_FLOW_EOS, which corresponds to EOS. In this case @buffer does not * contain a valid buffer. * * The buffer size of @buffer will only be smaller than @length when @offset is @@ -354,13 +349,13 @@ typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, GstObject *parent * GstPadEventFunction: * @pad: the #GstPad to handle the event. * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, - * @parent is guaranteed to be not-NULL and remain valid during the + * @parent is guaranteed to be not-%NULL and remain valid during the * execution of this function. * @event: the #GstEvent to handle. * * Function signature to handle an event for the pad. * - * Returns: TRUE if the pad could handle the event. + * Returns: %TRUE if the pad could handle the event. */ typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstObject *parent, GstEvent *event); @@ -371,7 +366,7 @@ typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstObject *parent, * GstPadIterIntLinkFunction: * @pad: The #GstPad to query. * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, - * @parent is guaranteed to be not-NULL and remain valid during the + * @parent is guaranteed to be not-%NULL and remain valid during the * execution of this function. * * The signature of the internal pad link iterator function. @@ -380,8 +375,6 @@ typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstObject *parent, * linked to the given pad on the inside of the parent element. * * the caller must call gst_iterator_free() after usage. - * - * Since 0.10.21 */ typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad, GstObject *parent); @@ -390,13 +383,13 @@ typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad, Gst * GstPadQueryFunction: * @pad: the #GstPad to query. * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, - * @parent is guaranteed to be not-NULL and remain valid during the + * @parent is guaranteed to be not-%NULL and remain valid during the * execution of this function. * @query: the #GstQuery object to execute * * The signature of the query function. * - * Returns: TRUE if the query could be performed. + * Returns: %TRUE if the query could be performed. */ typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstObject *parent, GstQuery *query); @@ -404,22 +397,28 @@ typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstObject *parent, /* linking */ /** - * GstPadLinkFunction + * GstPadLinkFunction: * @pad: the #GstPad that is linked. + * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, + * @parent is guaranteed to be not-%NULL and remain valid during the + * execution of this function. * @peer: the peer #GstPad of the link * * Function signature to handle a new link on the pad. * * Returns: the result of the link with the specified peer. */ -typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstPad *peer); +typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstObject *parent, GstPad *peer); /** - * GstPadUnlinkFunction + * GstPadUnlinkFunction: * @pad: the #GstPad that is linked. + * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set, + * @parent is guaranteed to be not-%NULL and remain valid during the + * execution of this function. * * Function signature to handle a unlinking the pad prom its peer. */ -typedef void (*GstPadUnlinkFunction) (GstPad *pad); +typedef void (*GstPadUnlinkFunction) (GstPad *pad, GstObject *parent); /* misc */ @@ -431,7 +430,7 @@ typedef void (*GstPadUnlinkFunction) (GstPad *pad); * A forward function is called for all internally linked pads, see * gst_pad_forward(). * - * Returns: TRUE if the dispatching procedure has to be stopped. + * Returns: %TRUE if the dispatching procedure has to be stopped. */ typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data); @@ -452,6 +451,16 @@ typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data); * @GST_PAD_PROBE_TYPE_QUERY_UPSTREAM: probe upstream queries * @GST_PAD_PROBE_TYPE_PUSH: probe push * @GST_PAD_PROBE_TYPE_PULL: probe pull + * @GST_PAD_PROBE_TYPE_BLOCKING: probe and block at the next opportunity, at data flow or when idle + * @GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM: probe downstream data (buffers, buffer lists, and events) + * @GST_PAD_PROBE_TYPE_DATA_UPSTREAM: probe upstream data (events) + * @GST_PAD_PROBE_TYPE_DATA_BOTH: probe upstream and downstream data (buffers, buffer lists, and events) + * @GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM: probe and block downstream data (buffers, buffer lists, and events) + * @GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM: probe and block upstream data (events) + * @GST_PAD_PROBE_TYPE_EVENT_BOTH: probe upstream and downstream events + * @GST_PAD_PROBE_TYPE_QUERY_BOTH: probe upstream and downstream queries + * @GST_PAD_PROBE_TYPE_ALL_BOTH: probe upstream events and queries and downstream buffers, buffer lists, events and queries + * @GST_PAD_PROBE_TYPE_SCHEDULING: probe push and pull * * The different probing types that can occur. When either one of * @GST_PAD_PROBE_TYPE_IDLE or @GST_PAD_PROBE_TYPE_BLOCK is used, the probe will be a @@ -473,29 +482,29 @@ typedef enum GST_PAD_PROBE_TYPE_QUERY_UPSTREAM = (1 << 10), /* flags to select scheduling mode */ GST_PAD_PROBE_TYPE_PUSH = (1 << 12), - GST_PAD_PROBE_TYPE_PULL = (1 << 13) + GST_PAD_PROBE_TYPE_PULL = (1 << 13), + + /* flag combinations */ + GST_PAD_PROBE_TYPE_BLOCKING = GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK, + GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM = GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, + GST_PAD_PROBE_TYPE_DATA_UPSTREAM = GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, + GST_PAD_PROBE_TYPE_DATA_BOTH = GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM | GST_PAD_PROBE_TYPE_DATA_UPSTREAM, + GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM = GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM, + GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM = GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_UPSTREAM, + GST_PAD_PROBE_TYPE_EVENT_BOTH = GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, + GST_PAD_PROBE_TYPE_QUERY_BOTH = GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | GST_PAD_PROBE_TYPE_QUERY_UPSTREAM, + GST_PAD_PROBE_TYPE_ALL_BOTH = GST_PAD_PROBE_TYPE_DATA_BOTH | GST_PAD_PROBE_TYPE_QUERY_BOTH, + GST_PAD_PROBE_TYPE_SCHEDULING = GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_PULL } GstPadProbeType; -#define GST_PAD_PROBE_TYPE_BLOCKING (GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK) -#define GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM (GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM) -#define GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM (GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_UPSTREAM) -#define GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM (GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | \ - GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) -#define GST_PAD_PROBE_TYPE_DATA_UPSTREAM (GST_PAD_PROBE_TYPE_EVENT_UPSTREAM) -#define GST_PAD_PROBE_TYPE_DATA_BOTH (GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM | \ - GST_PAD_PROBE_TYPE_DATA_UPSTREAM) -#define GST_PAD_PROBE_TYPE_EVENT_BOTH (GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | \ - GST_PAD_PROBE_TYPE_EVENT_UPSTREAM) -#define GST_PAD_PROBE_TYPE_QUERY_BOTH (GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | \ - GST_PAD_PROBE_TYPE_QUERY_UPSTREAM) -#define GST_PAD_PROBE_TYPE_ALL_BOTH (GST_PAD_PROBE_TYPE_DATA_BOTH | \ - GST_PAD_PROBE_TYPE_QUERY_BOTH) -#define GST_PAD_PROBE_TYPE_SCHEDULING (GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_PULL) /** * GstPadProbeReturn: * @GST_PAD_PROBE_OK: normal probe return value - * @GST_PAD_PROBE_DROP: drop data in data probes + * @GST_PAD_PROBE_DROP: drop data in data probes. For push mode this means that + * the data item is not sent downstream. For pull mode, it means that the + * data item is not passed upstream. In both cases, this result code + * means that #GST_FLOW_OK or %TRUE is returned to the caller. * @GST_PAD_PROBE_REMOVE: remove probe * @GST_PAD_PROBE_PASS: pass the data item in the block probe and block on * the next item @@ -514,8 +523,9 @@ typedef enum /** * GstPadProbeInfo: * @type: the current probe type + * @id: the id of the probe * @data: type specific data, check the @type field to know the datatype. - * This field can be NULL. + * This field can be %NULL. * @offset: offset of pull probe, this field is valid when @type contains * #GST_PAD_PROBE_TYPE_PULL * @size: size of pull probe, this field is valid when @type contains @@ -523,17 +533,20 @@ typedef enum * * Info passed in the #GstPadProbeCallback. */ -typedef struct +struct _GstPadProbeInfo { GstPadProbeType type; + gulong id; gpointer data; guint64 offset; guint size; + /*< private >*/ gpointer _gst_reserved[GST_PADDING]; -} GstPadProbeInfo; +}; #define GST_PAD_PROBE_INFO_TYPE(d) ((d)->type) +#define GST_PAD_PROBE_INFO_ID(d) ((d)->id) #define GST_PAD_PROBE_INFO_DATA(d) ((d)->data) #define GST_PAD_PROBE_INFO_BUFFER(d) GST_BUFFER_CAST(GST_PAD_PROBE_INFO_DATA(d)) @@ -544,8 +557,13 @@ typedef struct #define GST_PAD_PROBE_INFO_OFFSET(d) ((d)->offset) #define GST_PAD_PROBE_INFO_SIZE(d) ((d)->size) +GstEvent* gst_pad_probe_info_get_event (GstPadProbeInfo * info); +GstQuery* gst_pad_probe_info_get_query (GstPadProbeInfo * info); +GstBuffer* gst_pad_probe_info_get_buffer (GstPadProbeInfo * info); +GstBufferList* gst_pad_probe_info_get_buffer_list (GstPadProbeInfo * info); + /** - * GstPadProbeCallback + * GstPadProbeCallback: * @pad: the #GstPad that is blocked * @info: #GstPadProbeInfo * @user_data: the gpointer to optional user data. @@ -554,6 +572,8 @@ typedef struct * blocking type. * * The callback is allowed to modify the data pointer in @info. + * + * Returns: a #GstPadProbeReturn */ typedef GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeInfo *info, gpointer user_data); @@ -569,9 +589,9 @@ typedef GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeIn * When this function returns %TRUE, the next event will be * returned. When %FALSE is returned, gst_pad_sticky_events_foreach() will return. * - * When @event is set to NULL, the item will be removed from the list of sticky events. - * When @event has been made writable, the new buffer reference can be assigned - * to @event. This function is responsible for unreffing the old event when + * When @event is set to %NULL, the item will be removed from the list of sticky events. + * @event can be replaced by assigning a new reference to it. + * This function is responsible for unreffing the old event when * removing or modifying. * * Returns: %TRUE if the iteration should continue @@ -582,21 +602,31 @@ typedef gboolean (*GstPadStickyEventsForeachFunction) (GstPad *pad, GstEvent ** /** * GstPadFlags: * @GST_PAD_FLAG_BLOCKED: is dataflow on a pad blocked - * @GST_PAD_FLAG_FLUSHING: is pad refusing buffers + * @GST_PAD_FLAG_FLUSHING: is pad flushing + * @GST_PAD_FLAG_EOS: is pad in EOS state * @GST_PAD_FLAG_BLOCKING: is pad currently blocking on a buffer or event + * @GST_PAD_FLAG_NEED_PARENT: ensure that there is a parent object before calling + * into the pad callbacks. * @GST_PAD_FLAG_NEED_RECONFIGURE: the pad should be reconfigured/renegotiated. * The flag has to be unset manually after * reconfiguration happened. - * Since: 0.10.34. * @GST_PAD_FLAG_PENDING_EVENTS: the pad has pending events - * @GST_PAD_FLAG_FIXED_CAPS: the pad is using fixed caps this means that once the - * caps are set on the pad, the caps query function only - * returns those caps. + * @GST_PAD_FLAG_FIXED_CAPS: the pad is using fixed caps. This means that + * once the caps are set on the pad, the default caps query function + * will only return those caps. * @GST_PAD_FLAG_PROXY_CAPS: the default event and query handler will forward * all events and queries to the internally linked pads * instead of discarding them. - * @GST_PAD_FLAG_NEED_PARENT: ensure that there is a parent object before calling - * into the pad callbacks. + * @GST_PAD_FLAG_PROXY_ALLOCATION: the default query handler will forward + * allocation queries to the internally linked pads + * instead of discarding them. + * @GST_PAD_FLAG_PROXY_SCHEDULING: the default query handler will forward + * scheduling queries to the internally linked pads + * instead of discarding them. + * @GST_PAD_FLAG_ACCEPT_INTERSECT: the default accept-caps handler will check + * it the caps intersect the query-caps result instead + * of checking for a subset. This is interesting for + * parsers that can accept incompletely specified caps. * @GST_PAD_FLAG_LAST: offset to define more flags * * Pad state flags @@ -604,12 +634,16 @@ typedef gboolean (*GstPadStickyEventsForeachFunction) (GstPad *pad, GstEvent ** typedef enum { GST_PAD_FLAG_BLOCKED = (GST_OBJECT_FLAG_LAST << 0), GST_PAD_FLAG_FLUSHING = (GST_OBJECT_FLAG_LAST << 1), - GST_PAD_FLAG_BLOCKING = (GST_OBJECT_FLAG_LAST << 2), - GST_PAD_FLAG_NEED_RECONFIGURE = (GST_OBJECT_FLAG_LAST << 3), - GST_PAD_FLAG_PENDING_EVENTS = (GST_OBJECT_FLAG_LAST << 4), - GST_PAD_FLAG_FIXED_CAPS = (GST_OBJECT_FLAG_LAST << 5), - GST_PAD_FLAG_PROXY_CAPS = (GST_OBJECT_FLAG_LAST << 6), - GST_PAD_FLAG_NEED_PARENT = (GST_OBJECT_FLAG_LAST << 7), + GST_PAD_FLAG_EOS = (GST_OBJECT_FLAG_LAST << 2), + GST_PAD_FLAG_BLOCKING = (GST_OBJECT_FLAG_LAST << 3), + GST_PAD_FLAG_NEED_PARENT = (GST_OBJECT_FLAG_LAST << 4), + GST_PAD_FLAG_NEED_RECONFIGURE = (GST_OBJECT_FLAG_LAST << 5), + GST_PAD_FLAG_PENDING_EVENTS = (GST_OBJECT_FLAG_LAST << 6), + GST_PAD_FLAG_FIXED_CAPS = (GST_OBJECT_FLAG_LAST << 7), + GST_PAD_FLAG_PROXY_CAPS = (GST_OBJECT_FLAG_LAST << 8), + GST_PAD_FLAG_PROXY_ALLOCATION = (GST_OBJECT_FLAG_LAST << 9), + GST_PAD_FLAG_PROXY_SCHEDULING = (GST_OBJECT_FLAG_LAST << 10), + GST_PAD_FLAG_ACCEPT_INTERSECT = (GST_OBJECT_FLAG_LAST << 11), /* padding */ GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16) } GstPadFlags; @@ -635,34 +669,42 @@ struct _GstPad { /*< private >*/ /* streaming rec_lock */ - GStaticRecMutex stream_rec_lock; + GRecMutex stream_rec_lock; GstTask *task; /* block cond, mutex is from the object */ - GCond *block_cond; + GCond block_cond; GHookList probes; GstPadMode mode; GstPadActivateFunction activatefunc; + gpointer activatedata; GDestroyNotify activatenotify; GstPadActivateModeFunction activatemodefunc; + gpointer activatemodedata; GDestroyNotify activatemodenotify; /* pad link */ GstPad *peer; GstPadLinkFunction linkfunc; + gpointer linkdata; GDestroyNotify linknotify; GstPadUnlinkFunction unlinkfunc; + gpointer unlinkdata; GDestroyNotify unlinknotify; /* data transport functions */ GstPadChainFunction chainfunc; + gpointer chaindata; GDestroyNotify chainnotify; GstPadChainListFunction chainlistfunc; + gpointer chainlistdata; GDestroyNotify chainlistnotify; GstPadGetRangeFunction getrangefunc; + gpointer getrangedata; GDestroyNotify getrangenotify; GstPadEventFunction eventfunc; + gpointer eventdata; GDestroyNotify eventnotify; /* pad offset */ @@ -670,10 +712,12 @@ struct _GstPad { /* generic query method */ GstPadQueryFunction queryfunc; + gpointer querydata; GDestroyNotify querynotify; /* internal links */ GstPadIterIntLinkFunction iterintlinkfunc; + gpointer iterintlinkdata; GDestroyNotify iterintlinknotify; /* counts number of probes attached. */ @@ -682,7 +726,12 @@ struct _GstPad { GstPadPrivate *priv; - gpointer _gst_reserved[GST_PADDING]; + union { + gpointer _gst_reserved[GST_PADDING]; + struct { + GstFlowReturn last_flowret; + } abi; + } ABI; }; struct _GstPadClass { @@ -699,82 +748,414 @@ struct _GstPadClass { /***** helper macros *****/ /* GstPad */ + +/** + * GST_PAD_NAME: + * @pad: a #GstPad + * + * Get name of the given pad. + * No locking is performed in this function, use gst_pad_get_name() instead. + */ #define GST_PAD_NAME(pad) (GST_OBJECT_NAME(pad)) +/** + * GST_PAD_PARENT: + * @pad: a #GstPad + * + * Get the @pad parent. + * No locking is performed in this function, use gst_pad_get_parent() instead. + */ #define GST_PAD_PARENT(pad) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad))) +/** + * GST_PAD_ELEMENT_PRIVATE: + * @pad: a #GstPad + * + * Get the private data of @pad, which is usually some pad- or stream-specific + * structure created by the element and set on the pad when creating it. + * No locking is performed in this function. + */ #define GST_PAD_ELEMENT_PRIVATE(pad) (GST_PAD_CAST(pad)->element_private) +/** + * GST_PAD_PAD_TEMPLATE: + * @pad: a #GstPad + * + * Get the @pad #GstPadTemplate. It describes the possible media types + * a @pad or an element factory can handle. + */ #define GST_PAD_PAD_TEMPLATE(pad) (GST_PAD_CAST(pad)->padtemplate) +/** + * GST_PAD_DIRECTION: + * @pad: a #GstPad + * + * Get the #GstPadDirection of the given @pad. Accessor macro, use + * gst_pad_get_direction() instead. + */ #define GST_PAD_DIRECTION(pad) (GST_PAD_CAST(pad)->direction) +/** + * GST_PAD_TASK: + * @pad: a #GstPad + * + * Get the #GstTask of @pad. Accessor macro used by GStreamer. Use the + * gst_pad_start_task(), gst_pad_stop_task() and gst_pad_pause_task() + * functions instead. + */ #define GST_PAD_TASK(pad) (GST_PAD_CAST(pad)->task) +/** + * GST_PAD_MODE: + * @pad: a #GstPad + * + * Get the #GstPadMode of pad, which will be GST_PAD_MODE_NONE if the pad + * has not been activated yet, and otherwise either GST_PAD_MODE_PUSH or + * GST_PAD_MODE_PULL depending on which mode the pad was activated in. + */ #define GST_PAD_MODE(pad) (GST_PAD_CAST(pad)->mode) - +/** + * GST_PAD_ACTIVATEFUNC: + * @pad: a #GstPad + * + * Get the #GstPadActivateFunction from @pad. + */ #define GST_PAD_ACTIVATEFUNC(pad) (GST_PAD_CAST(pad)->activatefunc) +/** + * GST_PAD_ACTIVATEMODEFUNC: + * @pad: a #GstPad + * + * Get the #GstPadActivateModeFunction from the given @pad. + */ #define GST_PAD_ACTIVATEMODEFUNC(pad) (GST_PAD_CAST(pad)->activatemodefunc) +/** + * GST_PAD_CHAINFUNC: + * @pad: a #GstPad + * + * Get the #GstPadChainFunction from the given @pad. + */ #define GST_PAD_CHAINFUNC(pad) (GST_PAD_CAST(pad)->chainfunc) +/** + * GST_PAD_CHAINLISTFUNC: + * @pad: a #GstPad + * + * Get the #GstPadChainListFunction from the given @pad. + */ #define GST_PAD_CHAINLISTFUNC(pad) (GST_PAD_CAST(pad)->chainlistfunc) +/** + * GST_PAD_GETRANGEFUNC: + * @pad: a #GstPad + * + * Get the #GstPadGetRangeFunction from the given @pad. + */ #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc) +/** + * GST_PAD_EVENTFUNC: + * @pad: a #GstPad + * + * Get the #GstPadEventFunction from the given @pad, which + * is the function that handles events on the pad. You can + * use this to set your own event handling function on a pad + * after you create it. If your element derives from a base + * class, use the base class's virtual functions instead. + */ #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc) +/** + * GST_PAD_QUERYFUNC: + * @pad: a #GstPad + * + * Get the #GstPadQueryFunction from @pad, which is the function + * that handles queries on the pad. You can use this to set your + * own query handling function on a pad after you create it. If your + * element derives from a base class, use the base class's virtual + * functions instead. + */ #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc) +/** + * GST_PAD_ITERINTLINKFUNC: + * @pad: a #GstPad + * + * Get the #GstPadIterIntLinkFunction from the given @pad. + */ #define GST_PAD_ITERINTLINKFUNC(pad) (GST_PAD_CAST(pad)->iterintlinkfunc) - +/** + * GST_PAD_PEER: + * @pad: a #GstPad + * + * Return the pad's peer member. This member is a pointer to the linked @pad. + * No locking is performed in this function, use gst_pad_get_peer() instead. + */ #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer) +/** + * GST_PAD_LINKFUNC: + * @pad: a #GstPad + * + * Get the #GstPadLinkFunction for the given @pad. + */ #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc) +/** + * GST_PAD_UNLINKFUNC: + * @pad: a #GstPad + * + * Get the #GstPadUnlinkFunction from the given @pad. + */ #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc) - +/** + * GST_PAD_IS_SRC: + * @pad: a #GstPad + * + * Returns: %TRUE if the pad is a source pad (i.e. produces data). + */ #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC) +/** + * GST_PAD_IS_SINK: + * @pad: a #GstPad + * + * Returns: %TRUE if the pad is a sink pad (i.e. consumes data). + */ #define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK) - +/** + * GST_PAD_IS_LINKED: + * @pad: a #GstPad + * + * Returns: %TRUE if the pad is linked to another pad. Use gst_pad_is_linked() + * instead. + */ #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL) - +/** + * GST_PAD_IS_ACTIVE: + * @pad: a #GstPad + * + * Returns: %TRUE if the pad has been activated. + */ #define GST_PAD_IS_ACTIVE(pad) (GST_PAD_MODE(pad) != GST_PAD_MODE_NONE) - +/** + * GST_PAD_IS_BLOCKED: + * @pad: a #GstPad + * + * Check if the dataflow on a @pad is blocked. Use gst_pad_is_blocked() instead. + */ #define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKED)) +/** + * GST_PAD_IS_BLOCKING: + * @pad: a #GstPad + * + * Check if the @pad is currently blocking on a buffer or event. Use + * gst_pad_is_blocking() instead. + */ #define GST_PAD_IS_BLOCKING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKING)) - +/** + * GST_PAD_IS_FLUSHING: + * @pad: a #GstPad + * + * Check if the given @pad is flushing. + */ #define GST_PAD_IS_FLUSHING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FLUSHING)) +/** + * GST_PAD_SET_FLUSHING: + * @pad: a #GstPad + * + * Set the given @pad to flushing state, which means it will not accept any + * more events, queries or buffers, and return GST_FLOW_FLUSHING if any buffers + * are pushed on it. This usually happens when the pad is shut down or when + * a flushing seek happens. This is used inside GStreamer when flush start/stop + * events pass through pads, or when an element state is changed and pads are + * activated or deactivated. + */ #define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_FLUSHING)) +/** + * GST_PAD_UNSET_FLUSHING: + * @pad: a #GstPad + * + * Unset the flushing flag. + */ #define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_FLUSHING)) - +/** + * GST_PAD_IS_EOS: + * @pad: a #GstPad + * + * Check if the @pad is in EOS state. + */ +#define GST_PAD_IS_EOS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_EOS)) +/** + * GST_PAD_NEEDS_RECONFIGURE: + * @pad: a #GstPad + * + * Check if the @pad should be reconfigured/renegotiated. + * The flag has to be unset manually after reconfiguration happened. + * Use gst_pad_needs_reconfigure() or gst_pad_check_reconfigure() instead. + */ #define GST_PAD_NEEDS_RECONFIGURE(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_RECONFIGURE)) +/** + * GST_PAD_HAS_PENDING_EVENTS: + * @pad: a #GstPad + * + * Check if the given @pad has pending events. This is used internally by + * GStreamer. + */ #define GST_PAD_HAS_PENDING_EVENTS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PENDING_EVENTS)) +/** + * GST_PAD_IS_FIXED_CAPS: + * @pad: a #GstPad + * + * Check if the given @pad is using fixed caps, which means that + * once the caps are set on the @pad, the caps query function will + * only return those caps. See gst_pad_use_fixed_caps(). + */ #define GST_PAD_IS_FIXED_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FIXED_CAPS)) +/** + * GST_PAD_NEEDS_PARENT: + * @pad: a #GstPad + * + * Check if there is a parent object before calling into the @pad callbacks. + * This is used internally by GStreamer. + */ #define GST_PAD_NEEDS_PARENT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_PARENT)) - +/** + * GST_PAD_IS_PROXY_CAPS: + * @pad: a #GstPad + * + * Check if the given @pad is set to proxy caps. This means that the default + * event and query handler will forward all events and queries to the + * internally linked @pads instead of discarding them. + */ #define GST_PAD_IS_PROXY_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_CAPS)) +/** + * GST_PAD_SET_PROXY_CAPS: + * @pad: a #GstPad + * + * Set @pad to proxy caps, so that all caps-related events and queries are + * proxied down- or upstream to the other side of the element automatically. + * Set this if the element always outputs data in the exact same format as it + * receives as input. This is just for convenience to avoid implementing some + * standard event and query handling code in an element. + */ #define GST_PAD_SET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_CAPS)) +/** + * GST_PAD_UNSET_PROXY_CAPS: + * @pad: a #GstPad + * + * Unset proxy caps flag. + */ #define GST_PAD_UNSET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_CAPS)) - +/** + * GST_PAD_IS_PROXY_ALLOCATION: + * @pad: a #GstPad + * + * Check if the given @pad is set as proxy allocation which means + * that the default query handler will forward allocation queries to the + * internally linked @pads instead of discarding them. + */ +#define GST_PAD_IS_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION)) +/** + * GST_PAD_SET_PROXY_ALLOCATION: + * @pad: a #GstPad + * + * Set @pad to proxy allocation queries, which means that the default query + * handler will forward allocation queries to the internally linked @pads + * instead of discarding them. + * Set this if the element always outputs data in the exact same format as it + * receives as input. This is just for convenience to avoid implementing some + * standard query handling code in an element. + */ +#define GST_PAD_SET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION)) +/** + * GST_PAD_UNSET_PROXY_ALLOCATION: + * @pad: a #GstPad + * + * Unset proxy allocation flag. + */ +#define GST_PAD_UNSET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_ALLOCATION)) +/** + * GST_PAD_IS_PROXY_SCHEDULING: + * @pad: a #GstPad + * + * Check if the given @pad is set to proxy scheduling queries, which means that + * the default query handler will forward scheduling queries to the internally + * linked @pads instead of discarding them. + */ +#define GST_PAD_IS_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING)) +/** + * GST_PAD_SET_PROXY_SCHEDULING: + * @pad: a #GstPad + * + * Set @pad to proxy scheduling queries, which means that the default query + * handler will forward scheduling queries to the internally linked @pads + * instead of discarding them. You will usually want to handle scheduling + * queries explicitly if your element supports multiple scheduling modes. + */ +#define GST_PAD_SET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING)) +/** + * GST_PAD_UNSET_PROXY_SCHEDULING: + * @pad: a #GstPad + * + * Unset proxy scheduling flag. + */ +#define GST_PAD_UNSET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_SCHEDULING)) +/** + * GST_PAD_IS_ACCEPT_INTERSECT: + * @pad: a #GstPad + * + * Check if the pad's accept intersect flag is set. The default accept-caps + * handler will check it the caps intersect the query-caps result instead of + * checking for a subset. This is interesting for parser elements that can + * accept incompletely specified caps. + */ +#define GST_PAD_IS_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT)) +/** + * GST_PAD_SET_ACCEPT_INTERSECT: + * @pad: a #GstPad + * + * Set @pad to by default accept caps by intersecting the result instead of + * checking for a subset. This is interesting for parser elements that can + * accept incompletely specified caps. + */ +#define GST_PAD_SET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT)) +/** + * GST_PAD_UNSET_ACCEPT_INTERSECT: + * @pad: a #GstPad + * + * Unset accept intersect flag. + */ +#define GST_PAD_UNSET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT)) /** * GST_PAD_GET_STREAM_LOCK: * @pad: a #GstPad * * Get the stream lock of @pad. The stream lock is protecting the - * resources used in the data processing functions of @pad. + * resources used in the data processing functions of @pad. Accessor + * macro, use GST_PAD_STREAM_LOCK() and GST_PAD_STREAM_UNLOCK() instead + * to take/release the pad's stream lock. */ #define GST_PAD_GET_STREAM_LOCK(pad) (&(GST_PAD_CAST(pad)->stream_rec_lock)) /** * GST_PAD_STREAM_LOCK: * @pad: a #GstPad * - * Lock the stream lock of @pad. + * Take the pad's stream lock. The stream lock is recursive and will be taken + * when buffers or serialized downstream events are pushed on a pad. */ -#define GST_PAD_STREAM_LOCK(pad) (g_static_rec_mutex_lock(GST_PAD_GET_STREAM_LOCK(pad))) +#define GST_PAD_STREAM_LOCK(pad) g_rec_mutex_lock(GST_PAD_GET_STREAM_LOCK(pad)) /** * GST_PAD_STREAM_TRYLOCK: * @pad: a #GstPad * - * Try to Lock the stream lock of the pad, return TRUE if the lock could be - * taken. + * Try to take the pad's stream lock, and return %TRUE if the lock could be + * taken, and otherwise %FALSE. */ -#define GST_PAD_STREAM_TRYLOCK(pad) (g_static_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad))) +#define GST_PAD_STREAM_TRYLOCK(pad) g_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad)) /** * GST_PAD_STREAM_UNLOCK: * @pad: a #GstPad * - * Unlock the stream lock of @pad. + * Release the pad's stream lock. + */ +#define GST_PAD_STREAM_UNLOCK(pad) g_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad)) +/** + * GST_PAD_LAST_FLOW_RETURN: + * @pad: a #GstPad + * + * Gets the last flow return on this pad + * + * Since: 1.4 */ -#define GST_PAD_STREAM_UNLOCK(pad) (g_static_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad))) +#define GST_PAD_LAST_FLOW_RETURN(pad) (GST_PAD_CAST(pad)->ABI.abi.last_flowret) -#define GST_PAD_BLOCK_GET_COND(pad) (GST_PAD_CAST(pad)->block_cond) +#define GST_PAD_BLOCK_GET_COND(pad) (&GST_PAD_CAST(pad)->block_cond) #define GST_PAD_BLOCK_WAIT(pad) (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_OBJECT_GET_LOCK (pad))) #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad))) #define GST_PAD_BLOCK_BROADCAST(pad) (g_cond_broadcast(GST_PAD_BLOCK_GET_COND (pad))) @@ -802,7 +1183,7 @@ GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const g * * 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. + * Can return %NULL if the pad did not have a parent. * * MT safe. */ @@ -826,6 +1207,7 @@ gboolean gst_pad_is_blocked (GstPad *pad); gboolean gst_pad_is_blocking (GstPad *pad); void gst_pad_mark_reconfigure (GstPad *pad); +gboolean gst_pad_needs_reconfigure (GstPad *pad); gboolean gst_pad_check_reconfigure (GstPad *pad); void gst_pad_set_element_private (GstPad *pad, gpointer priv); @@ -833,6 +1215,7 @@ gpointer gst_pad_get_element_private (GstPad *pad); GstPadTemplate* gst_pad_get_pad_template (GstPad *pad); +GstFlowReturn gst_pad_store_sticky_event (GstPad *pad, GstEvent *event); GstEvent* gst_pad_get_sticky_event (GstPad *pad, GstEventType event_type, guint idx); void gst_pad_sticky_events_foreach (GstPad *pad, GstPadStickyEventsForeachFunction foreach_func, gpointer user_data); @@ -840,41 +1223,49 @@ void gst_pad_sticky_events_foreach (GstPad *pad, Gs /* data passing setup functions */ void gst_pad_set_activate_function_full (GstPad *pad, GstPadActivateFunction activate, + gpointer user_data, GDestroyNotify notify); void gst_pad_set_activatemode_function_full (GstPad *pad, GstPadActivateModeFunction activatemode, + gpointer user_data, GDestroyNotify notify); /* data passing functions */ void gst_pad_set_chain_function_full (GstPad *pad, GstPadChainFunction chain, + gpointer user_data, GDestroyNotify notify); void gst_pad_set_chain_list_function_full (GstPad *pad, GstPadChainListFunction chainlist, + gpointer user_data, GDestroyNotify notify); void gst_pad_set_getrange_function_full (GstPad *pad, GstPadGetRangeFunction get, + gpointer user_data, GDestroyNotify notify); void gst_pad_set_event_function_full (GstPad *pad, GstPadEventFunction event, + gpointer user_data, GDestroyNotify notify); -#define gst_pad_set_activate_function(p,f) gst_pad_set_activate_function_full((p),(f),NULL) -#define gst_pad_set_activatemode_function(p,f) gst_pad_set_activatemode_function_full((p),(f),NULL) -#define gst_pad_set_chain_function(p,f) gst_pad_set_chain_function_full((p),(f),NULL) -#define gst_pad_set_chain_list_function(p,f) gst_pad_set_chain_list_function_full((p),(f),NULL) -#define gst_pad_set_getrange_function(p,f) gst_pad_set_getrange_function_full((p),(f),NULL) -#define gst_pad_set_event_function(p,f) gst_pad_set_event_function_full((p),(f),NULL) +#define gst_pad_set_activate_function(p,f) gst_pad_set_activate_function_full((p),(f),NULL,NULL) +#define gst_pad_set_activatemode_function(p,f) gst_pad_set_activatemode_function_full((p),(f),NULL,NULL) +#define gst_pad_set_chain_function(p,f) gst_pad_set_chain_function_full((p),(f),NULL,NULL) +#define gst_pad_set_chain_list_function(p,f) gst_pad_set_chain_list_function_full((p),(f),NULL,NULL) +#define gst_pad_set_getrange_function(p,f) gst_pad_set_getrange_function_full((p),(f),NULL,NULL) +#define gst_pad_set_event_function(p,f) gst_pad_set_event_function_full((p),(f),NULL,NULL) /* pad links */ void gst_pad_set_link_function_full (GstPad *pad, GstPadLinkFunction link, + gpointer user_data, GDestroyNotify notify); void gst_pad_set_unlink_function_full (GstPad *pad, GstPadUnlinkFunction unlink, + gpointer user_data, GDestroyNotify notify); -#define gst_pad_set_link_function(p,f) gst_pad_set_link_function_full((p),(f),NULL) -#define gst_pad_set_unlink_function(p,f) gst_pad_set_unlink_function_full((p),(f),NULL) +#define gst_pad_set_link_function(p,f) gst_pad_set_link_function_full((p),(f),NULL,NULL) +#define gst_pad_set_unlink_function(p,f) gst_pad_set_unlink_function_full((p),(f),NULL,NULL) gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad); GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad); @@ -889,7 +1280,6 @@ GstCaps* gst_pad_get_pad_template_caps (GstPad *pad); /* capsnego function for linked/unlinked pads */ GstCaps * gst_pad_get_current_caps (GstPad * pad); gboolean gst_pad_has_current_caps (GstPad * pad); -gboolean gst_pad_set_caps (GstPad * pad, GstCaps *caps); /* capsnego for linked pads */ GstCaps * gst_pad_get_allowed_caps (GstPad * pad); @@ -906,6 +1296,7 @@ GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size, gboolean gst_pad_push_event (GstPad *pad, GstEvent *event); gboolean gst_pad_event_default (GstPad *pad, GstObject *parent, GstEvent *event); +GstFlowReturn gst_pad_get_last_flow_return (GstPad *pad); /* data passing functions on pad */ GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer); @@ -916,28 +1307,30 @@ gboolean gst_pad_send_event (GstPad *pad, GstEvent *event); /* pad tasks */ gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func, - gpointer data); + gpointer user_data, GDestroyNotify notify); gboolean gst_pad_pause_task (GstPad *pad); gboolean gst_pad_stop_task (GstPad *pad); /* internal links */ void gst_pad_set_iterate_internal_links_function_full (GstPad * pad, GstPadIterIntLinkFunction iterintlink, + gpointer user_data, GDestroyNotify notify); GstIterator * gst_pad_iterate_internal_links (GstPad * pad); GstIterator * gst_pad_iterate_internal_links_default (GstPad * pad, GstObject *parent); -#define gst_pad_set_iterate_internal_links_function(p,f) gst_pad_set_iterate_internal_links_function_full((p),(f),NULL) +#define gst_pad_set_iterate_internal_links_function(p,f) gst_pad_set_iterate_internal_links_function_full((p),(f),NULL,NULL) /* generic query function */ gboolean gst_pad_query (GstPad *pad, GstQuery *query); gboolean gst_pad_peer_query (GstPad *pad, GstQuery *query); void gst_pad_set_query_function_full (GstPad *pad, GstPadQueryFunction query, + gpointer user_data, GDestroyNotify notify); gboolean gst_pad_query_default (GstPad *pad, GstObject *parent, GstQuery *query); -#define gst_pad_set_query_function(p,f) gst_pad_set_query_function_full((p),(f),NULL) +#define gst_pad_set_query_function(p,f) gst_pad_set_query_function_full((p),(f),NULL,NULL) /* misc helper functions */ gboolean gst_pad_forward (GstPad *pad, GstPadForwardFunction forward,