2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wim.taymans@chello.be>
5 * gstpad.h: Header for GstPad object
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
27 #include <gst/gstconfig.h>
29 typedef struct _GstPad GstPad;
30 typedef struct _GstPadPrivate GstPadPrivate;
31 typedef struct _GstPadClass GstPadClass;
32 typedef struct _GstPadProbeInfo GstPadProbeInfo;
36 * @GST_PAD_UNKNOWN: direction is unknown.
37 * @GST_PAD_SRC: the pad is a source pad.
38 * @GST_PAD_SINK: the pad is a sink pad.
40 * The direction of a pad.
50 * @GST_PAD_MODE_NONE: Pad will not handle dataflow
51 * @GST_PAD_MODE_PUSH: Pad handles dataflow in downstream push mode
52 * @GST_PAD_MODE_PULL: Pad handles dataflow in upstream pull mode
54 * The status of a GstPad. After activating a pad, which usually happens when the
55 * parent element goes from READY to PAUSED, the GstPadMode defines if the
56 * pad operates in push or pull mode.
64 const gchar * gst_pad_mode_get_name (GstPadMode mode);
66 #include <gst/gstobject.h>
67 #include <gst/gstbuffer.h>
68 #include <gst/gstbufferlist.h>
69 #include <gst/gstcaps.h>
70 #include <gst/gstpadtemplate.h>
71 #include <gst/gstevent.h>
72 #include <gst/gstquery.h>
73 #include <gst/gsttask.h>
80 #define GST_TYPE_PAD (gst_pad_get_type ())
81 #define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
82 #define GST_IS_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
83 #define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
84 #define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
85 #define GST_PAD_CAST(obj) ((GstPad*)(obj))
91 * @GST_PAD_LINK_OK : link succeeded
92 * @GST_PAD_LINK_WRONG_HIERARCHY: pads have no common grandparent
93 * @GST_PAD_LINK_WAS_LINKED : pad was already linked
94 * @GST_PAD_LINK_WRONG_DIRECTION: pads have wrong direction
95 * @GST_PAD_LINK_NOFORMAT : pads do not have common format
96 * @GST_PAD_LINK_NOSCHED : pads cannot cooperate in scheduling
97 * @GST_PAD_LINK_REFUSED : refused for some reason
99 * Result values from gst_pad_link and friends.
103 GST_PAD_LINK_WRONG_HIERARCHY = -1,
104 GST_PAD_LINK_WAS_LINKED = -2,
105 GST_PAD_LINK_WRONG_DIRECTION = -3,
106 GST_PAD_LINK_NOFORMAT = -4,
107 GST_PAD_LINK_NOSCHED = -5,
108 GST_PAD_LINK_REFUSED = -6
112 * GST_PAD_LINK_FAILED:
113 * @ret: the #GstPadLinkReturn value
115 * Macro to test if the given #GstPadLinkReturn value indicates a failed
118 #define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)
121 * GST_PAD_LINK_SUCCESSFUL:
122 * @ret: the #GstPadLinkReturn value
124 * Macro to test if the given #GstPadLinkReturn value indicates a successful
127 #define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
131 * @GST_FLOW_OK: Data passing was ok.
132 * @GST_FLOW_NOT_LINKED: Pad is not linked.
133 * @GST_FLOW_FLUSHING: Pad is flushing.
134 * @GST_FLOW_EOS: Pad is EOS.
135 * @GST_FLOW_NOT_NEGOTIATED: Pad is not negotiated.
136 * @GST_FLOW_ERROR: Some (fatal) error occurred. Element generating
137 * this error should post an error message with more
139 * @GST_FLOW_NOT_SUPPORTED: This operation is not supported.
140 * @GST_FLOW_CUSTOM_SUCCESS: Elements can use values starting from
141 * this (and higher) to define custom success
143 * @GST_FLOW_CUSTOM_SUCCESS_1: Pre-defined custom success code (define your
144 * custom success code to this to avoid compiler
146 * @GST_FLOW_CUSTOM_SUCCESS_2: Pre-defined custom success code.
147 * @GST_FLOW_CUSTOM_ERROR: Elements can use values starting from
148 * this (and lower) to define custom error codes.
149 * @GST_FLOW_CUSTOM_ERROR_1: Pre-defined custom error code (define your
150 * custom error code to this to avoid compiler
152 * @GST_FLOW_CUSTOM_ERROR_2: Pre-defined custom error code.
154 * The result of passing data to a pad.
156 * Note that the custom return values should not be exposed outside of the
160 /* custom success starts here */
161 GST_FLOW_CUSTOM_SUCCESS_2 = 102,
162 GST_FLOW_CUSTOM_SUCCESS_1 = 101,
163 GST_FLOW_CUSTOM_SUCCESS = 100,
165 /* core predefined */
167 /* expected failures */
168 GST_FLOW_NOT_LINKED = -1,
169 GST_FLOW_FLUSHING = -2,
172 GST_FLOW_NOT_NEGOTIATED = -4,
174 GST_FLOW_NOT_SUPPORTED = -6,
176 /* custom error starts here */
177 GST_FLOW_CUSTOM_ERROR = -100,
178 GST_FLOW_CUSTOM_ERROR_1 = -101,
179 GST_FLOW_CUSTOM_ERROR_2 = -102
182 const gchar* gst_flow_get_name (GstFlowReturn ret);
183 GQuark gst_flow_to_quark (GstFlowReturn ret);
184 const gchar* gst_pad_link_get_name (GstPadLinkReturn ret);
188 * @GST_PAD_LINK_CHECK_NOTHING: Don't check hierarchy or caps compatibility.
189 * @GST_PAD_LINK_CHECK_HIERARCHY: Check the pads have same parents/grandparents.
190 * Could be omitted if it is already known that the two elements that own the
191 * pads are in the same bin.
192 * @GST_PAD_LINK_CHECK_TEMPLATE_CAPS: Check if the pads are compatible by using
193 * their template caps. This is much faster than @GST_PAD_LINK_CHECK_CAPS, but
194 * would be unsafe e.g. if one pad has %GST_CAPS_ANY.
195 * @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the
196 * caps returned by gst_pad_query_caps().
197 * @GST_PAD_LINK_CHECK_DEFAULT: The default checks done when linking
198 * pads (i.e. the ones used by gst_pad_link()).
200 * The amount of checking to be done when linking pads. @GST_PAD_LINK_CHECK_CAPS
201 * and @GST_PAD_LINK_CHECK_TEMPLATE_CAPS are mutually exclusive. If both are
202 * specified, expensive but safe @GST_PAD_LINK_CHECK_CAPS are performed.
205 * Only disable some of the checks if you are 100% certain you know the link
206 * will not fail because of hierarchy/caps compatibility failures. If uncertain,
207 * use the default checks (%GST_PAD_LINK_CHECK_DEFAULT) or the regular methods
208 * for linking the pads.
213 GST_PAD_LINK_CHECK_NOTHING = 0,
214 GST_PAD_LINK_CHECK_HIERARCHY = 1 << 0,
215 GST_PAD_LINK_CHECK_TEMPLATE_CAPS = 1 << 1,
216 GST_PAD_LINK_CHECK_CAPS = 1 << 2,
218 GST_PAD_LINK_CHECK_DEFAULT = GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS
223 * GstPadActivateFunction:
225 * @parent: the parent of @pad
227 * This function is called when the pad is activated during the element
228 * READY to PAUSED state change. By default this function will call the
229 * activate function that puts the pad in push mode but elements can
230 * override this function to activate the pad in pull mode if they wish.
232 * Returns: TRUE if the pad could be activated.
234 typedef gboolean (*GstPadActivateFunction) (GstPad *pad, GstObject *parent);
236 * GstPadActivateModeFunction:
238 * @parent: the parent of @pad
239 * @mode: the requested activation mode of @pad
240 * @active: activate or deactivate the pad.
242 * The prototype of the push and pull activate functions.
244 * Returns: TRUE if the pad could be activated or deactivated.
246 typedef gboolean (*GstPadActivateModeFunction) (GstPad *pad, GstObject *parent,
247 GstPadMode mode, gboolean active);
252 * GstPadChainFunction:
253 * @pad: the sink #GstPad that performed the chain.
254 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
255 * @parent is guaranteed to be not-NULL and remain valid during the
256 * execution of this function.
257 * @buffer: the #GstBuffer that is chained, not %NULL.
259 * A function that will be called on sinkpads when chaining buffers.
260 * The function typically processes the data contained in the buffer and
261 * either consumes the data or passes it on to the internally linked pad(s).
263 * The implementer of this function receives a refcount to @buffer and should
264 * gst_buffer_unref() when the buffer is no longer needed.
266 * When a chain function detects an error in the data stream, it must post an
267 * error on the bus and return an appropriate #GstFlowReturn value.
269 * Returns: #GST_FLOW_OK for success
271 typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstObject *parent,
275 * GstPadChainListFunction:
276 * @pad: the sink #GstPad that performed the chain.
277 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
278 * @parent is guaranteed to be not-NULL and remain valid during the
279 * execution of this function.
280 * @list: the #GstBufferList that is chained, not %NULL.
282 * A function that will be called on sinkpads when chaining buffer lists.
283 * The function typically processes the data contained in the buffer list and
284 * either consumes the data or passes it on to the internally linked pad(s).
286 * The implementer of this function receives a refcount to @list and
287 * should gst_buffer_list_unref() when the list is no longer needed.
289 * When a chainlist function detects an error in the data stream, it must
290 * post an error on the bus and return an appropriate #GstFlowReturn value.
292 * Returns: #GST_FLOW_OK for success
294 typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstObject *parent,
295 GstBufferList *list);
298 * GstPadGetRangeFunction:
299 * @pad: the src #GstPad to perform the getrange on.
300 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
301 * @parent is guaranteed to be not-NULL and remain valid during the
302 * execution of this function.
303 * @offset: the offset of the range
304 * @length: the length of the range
305 * @buffer: a memory location to hold the result buffer, cannot be NULL.
307 * This function will be called on source pads when a peer element
308 * request a buffer at the specified @offset and @length. If this function
309 * returns #GST_FLOW_OK, the result buffer will be stored in @buffer. The
310 * contents of @buffer is invalid for any other return value.
312 * This function is installed on a source pad with
313 * gst_pad_set_getrange_function() and can only be called on source pads after
314 * they are successfully activated with gst_pad_activate_mode() with the
315 * #GST_PAD_MODE_PULL.
317 * @offset and @length are always given in byte units. @offset must normally be a value
318 * between 0 and the length in bytes of the data available on @pad. The
319 * length (duration in bytes) can be retrieved with a #GST_QUERY_DURATION or with a
320 * #GST_QUERY_SEEKING.
322 * Any @offset larger or equal than the length will make the function return
323 * #GST_FLOW_EOS, which corresponds to EOS. In this case @buffer does not
324 * contain a valid buffer.
326 * The buffer size of @buffer will only be smaller than @length when @offset is
327 * near the end of the stream. In all other cases, the size of @buffer must be
328 * exactly the requested size.
330 * It is allowed to call this function with a 0 @length and valid @offset, in
331 * which case @buffer will contain a 0-sized buffer and the function returns
334 * When this function is called with a -1 @offset, the sequentially next buffer
335 * of length @length in the stream is returned.
337 * When this function is called with a -1 @length, a buffer with a default
338 * optimal length is returned in @buffer. The length might depend on the value
341 * Returns: #GST_FLOW_OK for success and a valid buffer in @buffer. Any other
342 * return value leaves @buffer undefined.
344 typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, GstObject *parent,
345 guint64 offset, guint length,
349 * GstPadEventFunction:
350 * @pad: the #GstPad to handle the event.
351 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
352 * @parent is guaranteed to be not-NULL and remain valid during the
353 * execution of this function.
354 * @event: the #GstEvent to handle.
356 * Function signature to handle an event for the pad.
358 * Returns: TRUE if the pad could handle the event.
360 typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstObject *parent,
366 * GstPadIterIntLinkFunction:
367 * @pad: The #GstPad to query.
368 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
369 * @parent is guaranteed to be not-NULL and remain valid during the
370 * execution of this function.
372 * The signature of the internal pad link iterator function.
374 * Returns: a new #GstIterator that will iterate over all pads that are
375 * linked to the given pad on the inside of the parent element.
377 * the caller must call gst_iterator_free() after usage.
379 typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad, GstObject *parent);
381 /* generic query function */
383 * GstPadQueryFunction:
384 * @pad: the #GstPad to query.
385 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
386 * @parent is guaranteed to be not-NULL and remain valid during the
387 * execution of this function.
388 * @query: the #GstQuery object to execute
390 * The signature of the query function.
392 * Returns: TRUE if the query could be performed.
394 typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstObject *parent,
400 * GstPadLinkFunction:
401 * @pad: the #GstPad that is linked.
402 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
403 * @parent is guaranteed to be not-NULL and remain valid during the
404 * execution of this function.
405 * @peer: the peer #GstPad of the link
407 * Function signature to handle a new link on the pad.
409 * Returns: the result of the link with the specified peer.
411 typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstObject *parent, GstPad *peer);
413 * GstPadUnlinkFunction:
414 * @pad: the #GstPad that is linked.
415 * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
416 * @parent is guaranteed to be not-NULL and remain valid during the
417 * execution of this function.
419 * Function signature to handle a unlinking the pad prom its peer.
421 typedef void (*GstPadUnlinkFunction) (GstPad *pad, GstObject *parent);
426 * GstPadForwardFunction:
427 * @pad: the #GstPad that is forwarded.
428 * @user_data: the gpointer to optional user data.
430 * A forward function is called for all internally linked pads, see
433 * Returns: TRUE if the dispatching procedure has to be stopped.
435 typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data);
439 * @GST_PAD_PROBE_TYPE_INVALID: invalid probe type
440 * @GST_PAD_PROBE_TYPE_IDLE: probe idle pads and block
441 * @GST_PAD_PROBE_TYPE_BLOCK: probe and block pads
442 * @GST_PAD_PROBE_TYPE_BUFFER: probe buffers
443 * @GST_PAD_PROBE_TYPE_BUFFER_LIST: probe buffer lists
444 * @GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM: probe downstream events
445 * @GST_PAD_PROBE_TYPE_EVENT_UPSTREAM: probe upstream events
446 * @GST_PAD_PROBE_TYPE_EVENT_FLUSH: probe flush events. This probe has to be
447 * explicitly enabled and is not included in the
448 * @@GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM or
449 * @@GST_PAD_PROBE_TYPE_EVENT_UPSTREAM probe types.
450 * @GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM: probe downstream queries
451 * @GST_PAD_PROBE_TYPE_QUERY_UPSTREAM: probe upstream queries
452 * @GST_PAD_PROBE_TYPE_PUSH: probe push
453 * @GST_PAD_PROBE_TYPE_PULL: probe pull
454 * @GST_PAD_PROBE_TYPE_BLOCKING: probe and block at the next opportunity, at data flow or when idle
455 * @GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM: probe downstream data (buffers, buffer lists, and events)
456 * @GST_PAD_PROBE_TYPE_DATA_UPSTREAM: probe upstream data (events)
457 * @GST_PAD_PROBE_TYPE_DATA_BOTH: probe upstream and downstream data (buffers, buffer lists, and events)
458 * @GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM: probe and block downstream data (buffers, buffer lists, and events)
459 * @GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM: probe and block upstream data (events)
460 * @GST_PAD_PROBE_TYPE_EVENT_BOTH: probe upstream and downstream events
461 * @GST_PAD_PROBE_TYPE_QUERY_BOTH: probe upstream and downstream queries
462 * @GST_PAD_PROBE_TYPE_ALL_BOTH: probe upstream events and queries and downstream buffers, buffer lists, events and queries
463 * @GST_PAD_PROBE_TYPE_SCHEDULING: probe push and pull
465 * The different probing types that can occur. When either one of
466 * @GST_PAD_PROBE_TYPE_IDLE or @GST_PAD_PROBE_TYPE_BLOCK is used, the probe will be a
471 GST_PAD_PROBE_TYPE_INVALID = 0,
472 /* flags to control blocking */
473 GST_PAD_PROBE_TYPE_IDLE = (1 << 0),
474 GST_PAD_PROBE_TYPE_BLOCK = (1 << 1),
475 /* flags to select datatypes */
476 GST_PAD_PROBE_TYPE_BUFFER = (1 << 4),
477 GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 5),
478 GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM = (1 << 6),
479 GST_PAD_PROBE_TYPE_EVENT_UPSTREAM = (1 << 7),
480 GST_PAD_PROBE_TYPE_EVENT_FLUSH = (1 << 8),
481 GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM = (1 << 9),
482 GST_PAD_PROBE_TYPE_QUERY_UPSTREAM = (1 << 10),
483 /* flags to select scheduling mode */
484 GST_PAD_PROBE_TYPE_PUSH = (1 << 12),
485 GST_PAD_PROBE_TYPE_PULL = (1 << 13),
487 /* flag combinations */
488 GST_PAD_PROBE_TYPE_BLOCKING = GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK,
489 GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM = GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
490 GST_PAD_PROBE_TYPE_DATA_UPSTREAM = GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
491 GST_PAD_PROBE_TYPE_DATA_BOTH = GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM | GST_PAD_PROBE_TYPE_DATA_UPSTREAM,
492 GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM = GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
493 GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM = GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_UPSTREAM,
494 GST_PAD_PROBE_TYPE_EVENT_BOTH = GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
495 GST_PAD_PROBE_TYPE_QUERY_BOTH = GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | GST_PAD_PROBE_TYPE_QUERY_UPSTREAM,
496 GST_PAD_PROBE_TYPE_ALL_BOTH = GST_PAD_PROBE_TYPE_DATA_BOTH | GST_PAD_PROBE_TYPE_QUERY_BOTH,
497 GST_PAD_PROBE_TYPE_SCHEDULING = GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_PULL
503 * @GST_PAD_PROBE_OK: normal probe return value
504 * @GST_PAD_PROBE_DROP: drop data in data probes. For push mode this means that
505 * the data item is not sent downstream. For pull mode, it means that the
506 * data item is not passed upstream. In both cases, this result code
507 * means that #GST_FLOW_OK or %TRUE is returned to the caller.
508 * @GST_PAD_PROBE_REMOVE: remove probe
509 * @GST_PAD_PROBE_PASS: pass the data item in the block probe and block on
512 * Different return values for the #GstPadProbeCallback.
518 GST_PAD_PROBE_REMOVE,
525 * @type: the current probe type
526 * @id: the id of the probe
527 * @data: type specific data, check the @type field to know the datatype.
528 * This field can be NULL.
529 * @offset: offset of pull probe, this field is valid when @type contains
530 * #GST_PAD_PROBE_TYPE_PULL
531 * @size: size of pull probe, this field is valid when @type contains
532 * #GST_PAD_PROBE_TYPE_PULL
534 * Info passed in the #GstPadProbeCallback.
536 struct _GstPadProbeInfo
538 GstPadProbeType type;
545 gpointer _gst_reserved[GST_PADDING];
548 #define GST_PAD_PROBE_INFO_TYPE(d) ((d)->type)
549 #define GST_PAD_PROBE_INFO_ID(d) ((d)->id)
550 #define GST_PAD_PROBE_INFO_DATA(d) ((d)->data)
552 #define GST_PAD_PROBE_INFO_BUFFER(d) GST_BUFFER_CAST(GST_PAD_PROBE_INFO_DATA(d))
553 #define GST_PAD_PROBE_INFO_BUFFER_LIST(d) GST_BUFFER_LIST_CAST(GST_PAD_PROBE_INFO_DATA(d))
554 #define GST_PAD_PROBE_INFO_EVENT(d) GST_EVENT_CAST(GST_PAD_PROBE_INFO_DATA(d))
555 #define GST_PAD_PROBE_INFO_QUERY(d) GST_QUERY_CAST(GST_PAD_PROBE_INFO_DATA(d))
557 #define GST_PAD_PROBE_INFO_OFFSET(d) ((d)->offset)
558 #define GST_PAD_PROBE_INFO_SIZE(d) ((d)->size)
560 GstEvent* gst_pad_probe_info_get_event (GstPadProbeInfo * info);
561 GstQuery* gst_pad_probe_info_get_query (GstPadProbeInfo * info);
562 GstBuffer* gst_pad_probe_info_get_buffer (GstPadProbeInfo * info);
563 GstBufferList* gst_pad_probe_info_get_buffer_list (GstPadProbeInfo * info);
566 * GstPadProbeCallback:
567 * @pad: the #GstPad that is blocked
568 * @info: #GstPadProbeInfo
569 * @user_data: the gpointer to optional user data.
571 * Callback used by gst_pad_add_probe(). Gets called to notify about the current
574 * The callback is allowed to modify the data pointer in @info.
576 * Returns: a #GstPadProbeReturn
578 typedef GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeInfo *info,
582 * GstPadStickyEventsForeachFunction:
584 * @event: a sticky #GstEvent.
585 * @user_data: the #gpointer to optional user data.
587 * Callback used by gst_pad_sticky_events_foreach().
589 * When this function returns %TRUE, the next event will be
590 * returned. When %FALSE is returned, gst_pad_sticky_events_foreach() will return.
592 * When @event is set to NULL, the item will be removed from the list of sticky events.
593 * @event can be replaced by assigning a new reference to it.
594 * This function is responsible for unreffing the old event when
595 * removing or modifying.
597 * Returns: %TRUE if the iteration should continue
599 typedef gboolean (*GstPadStickyEventsForeachFunction) (GstPad *pad, GstEvent **event,
604 * @GST_PAD_FLAG_BLOCKED: is dataflow on a pad blocked
605 * @GST_PAD_FLAG_FLUSHING: is pad flushing
606 * @GST_PAD_FLAG_EOS: is pad in EOS state
607 * @GST_PAD_FLAG_BLOCKING: is pad currently blocking on a buffer or event
608 * @GST_PAD_FLAG_NEED_PARENT: ensure that there is a parent object before calling
609 * into the pad callbacks.
610 * @GST_PAD_FLAG_NEED_RECONFIGURE: the pad should be reconfigured/renegotiated.
611 * The flag has to be unset manually after
612 * reconfiguration happened.
613 * @GST_PAD_FLAG_PENDING_EVENTS: the pad has pending events
614 * @GST_PAD_FLAG_FIXED_CAPS: the pad is using fixed caps. This means that
615 * once the caps are set on the pad, the default caps query function
616 * will only return those caps.
617 * @GST_PAD_FLAG_PROXY_CAPS: the default event and query handler will forward
618 * all events and queries to the internally linked pads
619 * instead of discarding them.
620 * @GST_PAD_FLAG_PROXY_ALLOCATION: the default query handler will forward
621 * allocation queries to the internally linked pads
622 * instead of discarding them.
623 * @GST_PAD_FLAG_PROXY_SCHEDULING: the default query handler will forward
624 * scheduling queries to the internally linked pads
625 * instead of discarding them.
626 * @GST_PAD_FLAG_ACCEPT_INTERSECT: the default accept-caps handler will check
627 * it the caps intersect the query-caps result instead
628 * of checking for a subset. This is interesting for
629 * parsers that can accept incompletely specified caps.
630 * @GST_PAD_FLAG_LAST: offset to define more flags
635 GST_PAD_FLAG_BLOCKED = (GST_OBJECT_FLAG_LAST << 0),
636 GST_PAD_FLAG_FLUSHING = (GST_OBJECT_FLAG_LAST << 1),
637 GST_PAD_FLAG_EOS = (GST_OBJECT_FLAG_LAST << 2),
638 GST_PAD_FLAG_BLOCKING = (GST_OBJECT_FLAG_LAST << 3),
639 GST_PAD_FLAG_NEED_PARENT = (GST_OBJECT_FLAG_LAST << 4),
640 GST_PAD_FLAG_NEED_RECONFIGURE = (GST_OBJECT_FLAG_LAST << 5),
641 GST_PAD_FLAG_PENDING_EVENTS = (GST_OBJECT_FLAG_LAST << 6),
642 GST_PAD_FLAG_FIXED_CAPS = (GST_OBJECT_FLAG_LAST << 7),
643 GST_PAD_FLAG_PROXY_CAPS = (GST_OBJECT_FLAG_LAST << 8),
644 GST_PAD_FLAG_PROXY_ALLOCATION = (GST_OBJECT_FLAG_LAST << 9),
645 GST_PAD_FLAG_PROXY_SCHEDULING = (GST_OBJECT_FLAG_LAST << 10),
646 GST_PAD_FLAG_ACCEPT_INTERSECT = (GST_OBJECT_FLAG_LAST << 11),
648 GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16)
653 * @element_private: private data owned by the parent element
654 * @padtemplate: padtemplate for this pad
655 * @direction: the direction of the pad, cannot change after creating
658 * The #GstPad structure. Use the functions to update the variables.
664 gpointer element_private;
666 GstPadTemplate *padtemplate;
668 GstPadDirection direction;
671 /* streaming rec_lock */
672 GRecMutex stream_rec_lock;
675 /* block cond, mutex is from the object */
680 GstPadActivateFunction activatefunc;
681 gpointer activatedata;
682 GDestroyNotify activatenotify;
683 GstPadActivateModeFunction activatemodefunc;
684 gpointer activatemodedata;
685 GDestroyNotify activatemodenotify;
689 GstPadLinkFunction linkfunc;
691 GDestroyNotify linknotify;
692 GstPadUnlinkFunction unlinkfunc;
694 GDestroyNotify unlinknotify;
696 /* data transport functions */
697 GstPadChainFunction chainfunc;
699 GDestroyNotify chainnotify;
700 GstPadChainListFunction chainlistfunc;
701 gpointer chainlistdata;
702 GDestroyNotify chainlistnotify;
703 GstPadGetRangeFunction getrangefunc;
704 gpointer getrangedata;
705 GDestroyNotify getrangenotify;
706 GstPadEventFunction eventfunc;
708 GDestroyNotify eventnotify;
713 /* generic query method */
714 GstPadQueryFunction queryfunc;
716 GDestroyNotify querynotify;
719 GstPadIterIntLinkFunction iterintlinkfunc;
720 gpointer iterintlinkdata;
721 GDestroyNotify iterintlinknotify;
723 /* counts number of probes attached. */
730 gpointer _gst_reserved[GST_PADDING];
732 GstFlowReturn last_flowret;
737 struct _GstPadClass {
738 GstObjectClass parent_class;
740 /* signal callbacks */
741 void (*linked) (GstPad *pad, GstPad *peer);
742 void (*unlinked) (GstPad *pad, GstPad *peer);
745 gpointer _gst_reserved[GST_PADDING];
749 /***** helper macros *****/
756 * Get name of the given pad.
757 * No locking is performed in this function, use gst_pad_get_name() instead.
759 #define GST_PAD_NAME(pad) (GST_OBJECT_NAME(pad))
764 * Get the @pad parent.
765 * No locking is performed in this function, use gst_pad_get_parent() instead.
767 #define GST_PAD_PARENT(pad) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad)))
769 * GST_PAD_ELEMENT_PRIVATE:
772 * Get the private data of @pad, which is usually some pad- or stream-specific
773 * structure created by the element and set on the pad when creating it.
774 * No locking is performed in this function.
776 #define GST_PAD_ELEMENT_PRIVATE(pad) (GST_PAD_CAST(pad)->element_private)
778 * GST_PAD_PAD_TEMPLATE:
781 * Get the @pad #GstPadTemplate. It describes the possible media types
782 * a @pad or an element factory can handle.
784 #define GST_PAD_PAD_TEMPLATE(pad) (GST_PAD_CAST(pad)->padtemplate)
789 * Get the #GstPadDirection of the given @pad. Accessor macro, use
790 * gst_pad_get_direction() instead.
792 #define GST_PAD_DIRECTION(pad) (GST_PAD_CAST(pad)->direction)
797 * Get the #GstTask of @pad. Accessor macro used by GStreamer. Use the
798 * gst_pad_start_task(), gst_pad_stop_task() and gst_pad_pause_task()
801 #define GST_PAD_TASK(pad) (GST_PAD_CAST(pad)->task)
806 * Get the #GstPadMode of pad, which will be GST_PAD_MODE_NONE if the pad
807 * has not been activated yet, and otherwise either GST_PAD_MODE_PUSH or
808 * GST_PAD_MODE_PULL depending on which mode the pad was activated in.
810 #define GST_PAD_MODE(pad) (GST_PAD_CAST(pad)->mode)
812 * GST_PAD_ACTIVATEFUNC:
815 * Get the #GstPadActivateFunction from @pad.
817 #define GST_PAD_ACTIVATEFUNC(pad) (GST_PAD_CAST(pad)->activatefunc)
819 * GST_PAD_ACTIVATEMODEFUNC:
822 * Get the #GstPadActivateModeFunction from the given @pad.
824 #define GST_PAD_ACTIVATEMODEFUNC(pad) (GST_PAD_CAST(pad)->activatemodefunc)
829 * Get the #GstPadChainFunction from the given @pad.
831 #define GST_PAD_CHAINFUNC(pad) (GST_PAD_CAST(pad)->chainfunc)
833 * GST_PAD_CHAINLISTFUNC:
836 * Get the #GstPadChainListFunction from the given @pad.
838 #define GST_PAD_CHAINLISTFUNC(pad) (GST_PAD_CAST(pad)->chainlistfunc)
840 * GST_PAD_GETRANGEFUNC:
843 * Get the #GstPadGetRangeFunction from the given @pad.
845 #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc)
850 * Get the #GstPadEventFunction from the given @pad, which
851 * is the function that handles events on the pad. You can
852 * use this to set your own event handling function on a pad
853 * after you create it. If your element derives from a base
854 * class, use the base class's virtual functions instead.
856 #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc)
861 * Get the #GstPadQueryFunction from @pad, which is the function
862 * that handles queries on the pad. You can use this to set your
863 * own query handling function on a pad after you create it. If your
864 * element derives from a base class, use the base class's virtual
867 #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc)
869 * GST_PAD_ITERINTLINKFUNC:
872 * Get the #GstPadIterIntLinkFunction from the given @pad.
874 #define GST_PAD_ITERINTLINKFUNC(pad) (GST_PAD_CAST(pad)->iterintlinkfunc)
879 * Return the pad's peer member. This member is a pointer to the linked @pad.
880 * No locking is performed in this function, use gst_pad_get_peer() instead.
882 #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer)
887 * Get the #GstPadLinkFunction for the given @pad.
889 #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc)
891 * GST_PAD_UNLINKFUNC:
894 * Get the #GstPadUnlinkFunction from the given @pad.
896 #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc)
901 * Returns: TRUE if the pad is a source pad (i.e. produces data).
903 #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
908 * Returns: TRUE if the pad is a sink pad (i.e. consumes data).
910 #define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
915 * Returns: TRUE if the pad is linked to another pad. Use gst_pad_is_linked()
918 #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
923 * Returns: TRUE if the pad has been activated.
925 #define GST_PAD_IS_ACTIVE(pad) (GST_PAD_MODE(pad) != GST_PAD_MODE_NONE)
927 * GST_PAD_IS_BLOCKED:
930 * Check if the dataflow on a @pad is blocked. Use gst_pad_is_blocked() instead.
932 #define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKED))
934 * GST_PAD_IS_BLOCKING:
937 * Check if the @pad is currently blocking on a buffer or event. Use
938 * gst_pad_is_blocking() instead.
940 #define GST_PAD_IS_BLOCKING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKING))
942 * GST_PAD_IS_FLUSHING:
945 * Check if the given @pad is flushing.
947 #define GST_PAD_IS_FLUSHING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FLUSHING))
949 * GST_PAD_SET_FLUSHING:
952 * Set the given @pad to flushing state, which means it will not accept any
953 * more events, queries or buffers, and return GST_FLOW_FLUSHING if any buffers
954 * are pushed on it. This usually happens when the pad is shut down or when
955 * a flushing seek happens. This is used inside GStreamer when flush start/stop
956 * events pass through pads, or when an element state is changed and pads are
957 * activated or deactivated.
959 #define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_FLUSHING))
961 * GST_PAD_UNSET_FLUSHING:
964 * Unset the flushing flag.
966 #define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_FLUSHING))
971 * Check if the @pad is in EOS state.
973 #define GST_PAD_IS_EOS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_EOS))
975 * GST_PAD_NEEDS_RECONFIGURE:
978 * Check if the @pad should be reconfigured/renegotiated.
979 * The flag has to be unset manually after reconfiguration happened.
980 * Use gst_pad_needs_reconfigure() or gst_pad_check_reconfigure() instead.
982 #define GST_PAD_NEEDS_RECONFIGURE(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_RECONFIGURE))
984 * GST_PAD_HAS_PENDING_EVENTS:
987 * Check if the given @pad has pending events. This is used internally by
990 #define GST_PAD_HAS_PENDING_EVENTS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PENDING_EVENTS))
992 * GST_PAD_IS_FIXED_CAPS:
995 * Check if the given @pad is using fixed caps, which means that
996 * once the caps are set on the @pad, the caps query function will
997 * only return those caps. See gst_pad_use_fixed_caps().
999 #define GST_PAD_IS_FIXED_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FIXED_CAPS))
1001 * GST_PAD_NEEDS_PARENT:
1004 * Check if there is a parent object before calling into the @pad callbacks.
1005 * This is used internally by GStreamer.
1007 #define GST_PAD_NEEDS_PARENT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_PARENT))
1009 * GST_PAD_IS_PROXY_CAPS:
1012 * Check if the given @pad is set to proxy caps. This means that the default
1013 * event and query handler will forward all events and queries to the
1014 * internally linked @pads instead of discarding them.
1016 #define GST_PAD_IS_PROXY_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_CAPS))
1018 * GST_PAD_SET_PROXY_CAPS:
1021 * Set @pad to proxy caps, so that all caps-related events and queries are
1022 * proxied down- or upstream to the other side of the element automatically.
1023 * Set this if the element always outputs data in the exact same format as it
1024 * receives as input. This is just for convenience to avoid implementing some
1025 * standard event and query handling code in an element.
1027 #define GST_PAD_SET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_CAPS))
1029 * GST_PAD_UNSET_PROXY_CAPS:
1032 * Unset proxy caps flag.
1034 #define GST_PAD_UNSET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_CAPS))
1036 * GST_PAD_IS_PROXY_ALLOCATION:
1039 * Check if the given @pad is set as proxy allocation which means
1040 * that the default query handler will forward allocation queries to the
1041 * internally linked @pads instead of discarding them.
1043 #define GST_PAD_IS_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
1045 * GST_PAD_SET_PROXY_ALLOCATION:
1048 * Set @pad to proxy allocation queries, which means that the default query
1049 * handler will forward allocation queries to the internally linked @pads
1050 * instead of discarding them.
1051 * Set this if the element always outputs data in the exact same format as it
1052 * receives as input. This is just for convenience to avoid implementing some
1053 * standard query handling code in an element.
1055 #define GST_PAD_SET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
1057 * GST_PAD_UNSET_PROXY_ALLOCATION:
1060 * Unset proxy allocation flag.
1062 #define GST_PAD_UNSET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
1064 * GST_PAD_IS_PROXY_SCHEDULING:
1067 * Check if the given @pad is set to proxy scheduling queries, which means that
1068 * the default query handler will forward scheduling queries to the internally
1069 * linked @pads instead of discarding them.
1071 #define GST_PAD_IS_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
1073 * GST_PAD_SET_PROXY_SCHEDULING:
1076 * Set @pad to proxy scheduling queries, which means that the default query
1077 * handler will forward scheduling queries to the internally linked @pads
1078 * instead of discarding them. You will usually want to handle scheduling
1079 * queries explicitly if your element supports multiple scheduling modes.
1081 #define GST_PAD_SET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
1083 * GST_PAD_UNSET_PROXY_SCHEDULING:
1086 * Unset proxy scheduling flag.
1088 #define GST_PAD_UNSET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
1090 * GST_PAD_IS_ACCEPT_INTERSECT:
1093 * Check if the pad's accept intersect flag is set. The default accept-caps
1094 * handler will check it the caps intersect the query-caps result instead of
1095 * checking for a subset. This is interesting for parser elements that can
1096 * accept incompletely specified caps.
1098 #define GST_PAD_IS_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
1100 * GST_PAD_SET_ACCEPT_INTERSECT:
1103 * Set @pad to by default accept caps by intersecting the result instead of
1104 * checking for a subset. This is interesting for parser elements that can
1105 * accept incompletely specified caps.
1107 #define GST_PAD_SET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
1109 * GST_PAD_UNSET_ACCEPT_INTERSECT:
1112 * Unset accept intersect flag.
1114 #define GST_PAD_UNSET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
1116 * GST_PAD_GET_STREAM_LOCK:
1119 * Get the stream lock of @pad. The stream lock is protecting the
1120 * resources used in the data processing functions of @pad. Accessor
1121 * macro, use GST_PAD_STREAM_LOCK() and GST_PAD_STREAM_UNLOCK() instead
1122 * to take/release the pad's stream lock.
1124 #define GST_PAD_GET_STREAM_LOCK(pad) (&(GST_PAD_CAST(pad)->stream_rec_lock))
1126 * GST_PAD_STREAM_LOCK:
1129 * Take the pad's stream lock. The stream lock is recursive and will be taken
1130 * when buffers or serialized downstream events are pushed on a pad.
1132 #define GST_PAD_STREAM_LOCK(pad) g_rec_mutex_lock(GST_PAD_GET_STREAM_LOCK(pad))
1134 * GST_PAD_STREAM_TRYLOCK:
1137 * Try to take the pad's stream lock, and return TRUE if the lock could be
1138 * taken, and otherwise FALSE.
1140 #define GST_PAD_STREAM_TRYLOCK(pad) g_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad))
1142 * GST_PAD_STREAM_UNLOCK:
1145 * Release the pad's stream lock.
1147 #define GST_PAD_STREAM_UNLOCK(pad) g_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad))
1149 * GST_PAD_LAST_FLOW_RETURN:
1152 * Gets the last flow return on this pad
1156 #define GST_PAD_LAST_FLOW_RETURN(pad) (GST_PAD_CAST(pad)->ABI.abi.last_flowret)
1158 #define GST_PAD_BLOCK_GET_COND(pad) (&GST_PAD_CAST(pad)->block_cond)
1159 #define GST_PAD_BLOCK_WAIT(pad) (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_OBJECT_GET_LOCK (pad)))
1160 #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad)))
1161 #define GST_PAD_BLOCK_BROADCAST(pad) (g_cond_broadcast(GST_PAD_BLOCK_GET_COND (pad)))
1163 GType gst_pad_get_type (void);
1166 GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
1167 GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
1168 GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name);
1173 * @pad: the pad to get the name from
1175 * Get a copy of the name of the pad. g_free() after usage.
1179 #define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))
1181 * gst_pad_get_parent:
1182 * @pad: the pad to get the parent of
1184 * Get the parent of @pad. This function increases the refcount
1185 * of the parent object so you should gst_object_unref() it after usage.
1186 * Can return NULL if the pad did not have a parent.
1190 #define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))
1192 GstPadDirection gst_pad_get_direction (GstPad *pad);
1194 gboolean gst_pad_set_active (GstPad *pad, gboolean active);
1195 gboolean gst_pad_is_active (GstPad *pad);
1196 gboolean gst_pad_activate_mode (GstPad *pad, GstPadMode mode,
1199 gulong gst_pad_add_probe (GstPad *pad,
1200 GstPadProbeType mask,
1201 GstPadProbeCallback callback,
1203 GDestroyNotify destroy_data);
1204 void gst_pad_remove_probe (GstPad *pad, gulong id);
1206 gboolean gst_pad_is_blocked (GstPad *pad);
1207 gboolean gst_pad_is_blocking (GstPad *pad);
1209 void gst_pad_mark_reconfigure (GstPad *pad);
1210 gboolean gst_pad_needs_reconfigure (GstPad *pad);
1211 gboolean gst_pad_check_reconfigure (GstPad *pad);
1213 void gst_pad_set_element_private (GstPad *pad, gpointer priv);
1214 gpointer gst_pad_get_element_private (GstPad *pad);
1216 GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
1218 GstFlowReturn gst_pad_store_sticky_event (GstPad *pad, GstEvent *event);
1219 GstEvent* gst_pad_get_sticky_event (GstPad *pad, GstEventType event_type,
1221 void gst_pad_sticky_events_foreach (GstPad *pad, GstPadStickyEventsForeachFunction foreach_func, gpointer user_data);
1223 /* data passing setup functions */
1224 void gst_pad_set_activate_function_full (GstPad *pad,
1225 GstPadActivateFunction activate,
1227 GDestroyNotify notify);
1228 void gst_pad_set_activatemode_function_full (GstPad *pad,
1229 GstPadActivateModeFunction activatemode,
1231 GDestroyNotify notify);
1232 /* data passing functions */
1233 void gst_pad_set_chain_function_full (GstPad *pad,
1234 GstPadChainFunction chain,
1236 GDestroyNotify notify);
1237 void gst_pad_set_chain_list_function_full (GstPad *pad,
1238 GstPadChainListFunction chainlist,
1240 GDestroyNotify notify);
1241 void gst_pad_set_getrange_function_full (GstPad *pad,
1242 GstPadGetRangeFunction get,
1244 GDestroyNotify notify);
1245 void gst_pad_set_event_function_full (GstPad *pad,
1246 GstPadEventFunction event,
1248 GDestroyNotify notify);
1250 #define gst_pad_set_activate_function(p,f) gst_pad_set_activate_function_full((p),(f),NULL,NULL)
1251 #define gst_pad_set_activatemode_function(p,f) gst_pad_set_activatemode_function_full((p),(f),NULL,NULL)
1252 #define gst_pad_set_chain_function(p,f) gst_pad_set_chain_function_full((p),(f),NULL,NULL)
1253 #define gst_pad_set_chain_list_function(p,f) gst_pad_set_chain_list_function_full((p),(f),NULL,NULL)
1254 #define gst_pad_set_getrange_function(p,f) gst_pad_set_getrange_function_full((p),(f),NULL,NULL)
1255 #define gst_pad_set_event_function(p,f) gst_pad_set_event_function_full((p),(f),NULL,NULL)
1258 void gst_pad_set_link_function_full (GstPad *pad,
1259 GstPadLinkFunction link,
1261 GDestroyNotify notify);
1262 void gst_pad_set_unlink_function_full (GstPad *pad,
1263 GstPadUnlinkFunction unlink,
1265 GDestroyNotify notify);
1267 #define gst_pad_set_link_function(p,f) gst_pad_set_link_function_full((p),(f),NULL,NULL)
1268 #define gst_pad_set_unlink_function(p,f) gst_pad_set_unlink_function_full((p),(f),NULL,NULL)
1270 gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
1271 GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
1272 GstPadLinkReturn gst_pad_link_full (GstPad *srcpad, GstPad *sinkpad, GstPadLinkCheck flags);
1273 gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
1274 gboolean gst_pad_is_linked (GstPad *pad);
1276 GstPad* gst_pad_get_peer (GstPad *pad);
1278 GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
1280 /* capsnego function for linked/unlinked pads */
1281 GstCaps * gst_pad_get_current_caps (GstPad * pad);
1282 gboolean gst_pad_has_current_caps (GstPad * pad);
1284 /* capsnego for linked pads */
1285 GstCaps * gst_pad_get_allowed_caps (GstPad * pad);
1288 gint64 gst_pad_get_offset (GstPad *pad);
1289 void gst_pad_set_offset (GstPad *pad, gint64 offset);
1291 /* data passing functions to peer */
1292 GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
1293 GstFlowReturn gst_pad_push_list (GstPad *pad, GstBufferList *list);
1294 GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
1295 GstBuffer **buffer);
1296 gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
1297 gboolean gst_pad_event_default (GstPad *pad, GstObject *parent,
1299 GstFlowReturn gst_pad_get_last_flow_return (GstPad *pad);
1301 /* data passing functions on pad */
1302 GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
1303 GstFlowReturn gst_pad_chain_list (GstPad *pad, GstBufferList *list);
1304 GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size,
1305 GstBuffer **buffer);
1306 gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
1309 gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func,
1310 gpointer user_data, GDestroyNotify notify);
1311 gboolean gst_pad_pause_task (GstPad *pad);
1312 gboolean gst_pad_stop_task (GstPad *pad);
1314 /* internal links */
1315 void gst_pad_set_iterate_internal_links_function_full (GstPad * pad,
1316 GstPadIterIntLinkFunction iterintlink,
1318 GDestroyNotify notify);
1319 GstIterator * gst_pad_iterate_internal_links (GstPad * pad);
1320 GstIterator * gst_pad_iterate_internal_links_default (GstPad * pad, GstObject *parent);
1322 #define gst_pad_set_iterate_internal_links_function(p,f) gst_pad_set_iterate_internal_links_function_full((p),(f),NULL,NULL)
1324 /* generic query function */
1325 gboolean gst_pad_query (GstPad *pad, GstQuery *query);
1326 gboolean gst_pad_peer_query (GstPad *pad, GstQuery *query);
1327 void gst_pad_set_query_function_full (GstPad *pad, GstPadQueryFunction query,
1329 GDestroyNotify notify);
1330 gboolean gst_pad_query_default (GstPad *pad, GstObject *parent,
1333 #define gst_pad_set_query_function(p,f) gst_pad_set_query_function_full((p),(f),NULL,NULL)
1335 /* misc helper functions */
1336 gboolean gst_pad_forward (GstPad *pad, GstPadForwardFunction forward,
1337 gpointer user_data);
1341 #endif /* __GST_PAD_H__ */