typedef struct _GstPad GstPad;
typedef struct _GstPadPrivate GstPadPrivate;
typedef struct _GstPadClass GstPadClass;
+typedef struct _GstPadProbeInfo GstPadProbeInfo;
/**
* GstPadDirection:
/**
* GstFlowReturn:
- * @GST_FLOW_RESEND: Resend buffer, possibly with new caps (not
- * sent yet) (unused/unimplemented).
* @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_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,
+ GST_FLOW_FLUSHING = -2,
/* error cases */
GST_FLOW_EOS = -3,
GST_FLOW_NOT_NEGOTIATED = -4,
* #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
* @GST_PAD_PROBE_TYPE_BUFFER_LIST: probe buffer lists
* @GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM: probe downstream events
* @GST_PAD_PROBE_TYPE_EVENT_UPSTREAM: probe upstream events
+ * @GST_PAD_PROBE_TYPE_EVENT_FLUSH: probe flush events. This probe has to be
+ * explicitly enabled and is not included in the
+ * @@GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM or
+ * @@GST_PAD_PROBE_TYPE_EVENT_UPSTREAM probe types.
* @GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM: probe downstream queries
* @GST_PAD_PROBE_TYPE_QUERY_UPSTREAM: probe upstream queries
* @GST_PAD_PROBE_TYPE_PUSH: probe push
GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 5),
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM = (1 << 6),
GST_PAD_PROBE_TYPE_EVENT_UPSTREAM = (1 << 7),
- GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM = (1 << 8),
- GST_PAD_PROBE_TYPE_QUERY_UPSTREAM = (1 << 9),
+ GST_PAD_PROBE_TYPE_EVENT_FLUSH = (1 << 8),
+ GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM = (1 << 9),
+ 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)
} GstPadProbeType;
#define GST_PAD_PROBE_TYPE_BLOCKING (GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK)
/**
* 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
+ * returns #GST_FLOW_OK or %TRUE 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
/**
* 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.
* @offset: offset of pull probe, this field is valid when @type contains
*
* 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))
/**
* 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
* @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_LAST: offset to define more flags
*
* Pad state flags
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),
/* padding */
GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16)
} GstPadFlags;
/*< 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 */
/* generic query method */
GstPadQueryFunction queryfunc;
+ gpointer querydata;
GDestroyNotify querynotify;
/* internal links */
GstPadIterIntLinkFunction iterintlinkfunc;
+ gpointer iterintlinkdata;
GDestroyNotify iterintlinknotify;
/* counts number of probes attached. */
#define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_FLUSHING))
#define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_FLUSHING))
+#define GST_PAD_IS_EOS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_EOS))
+
#define GST_PAD_NEEDS_RECONFIGURE(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_RECONFIGURE))
#define GST_PAD_HAS_PENDING_EVENTS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PENDING_EVENTS))
#define GST_PAD_IS_FIXED_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FIXED_CAPS))
#define GST_PAD_SET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_CAPS))
#define GST_PAD_UNSET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_CAPS))
+#define GST_PAD_IS_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
+#define GST_PAD_SET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
+#define GST_PAD_UNSET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
+
/**
* GST_PAD_GET_STREAM_LOCK:
* @pad: a #GstPad
*
* Lock the stream lock of @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.
*/
-#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.
*/
-#define GST_PAD_STREAM_UNLOCK(pad) (g_static_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad)))
+#define GST_PAD_STREAM_UNLOCK(pad) g_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad))
-#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)))
/* 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);
/* 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,