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., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
27 #include <gst/gstconfig.h>
29 #include <gst/gstobject.h>
30 #include <gst/gstbuffer.h>
31 #include <gst/gstcaps.h>
32 #include <gst/gstevent.h>
33 #include <gst/gstquery.h>
34 #include <gst/gsttask.h>
41 #define GST_TYPE_PAD (gst_pad_get_type ())
42 #define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
43 #define GST_IS_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
44 #define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
45 #define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
46 #define GST_PAD_CAST(obj) ((GstPad*)(obj))
48 /* FIXME: remove - its unused */
49 #define GST_IS_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_PAD)
51 typedef struct _GstPad GstPad;
52 typedef struct _GstPadClass GstPadClass;
56 * @GST_PAD_LINK_OK : link succeeded
57 * @GST_PAD_LINK_WRONG_HIERARCHY: pads have no common grandparent
58 * @GST_PAD_LINK_WAS_LINKED : pad was already linked
59 * @GST_PAD_LINK_WRONG_DIRECTION: pads have wrong direction
60 * @GST_PAD_LINK_NOFORMAT : pads do not have common format
61 * @GST_PAD_LINK_NOSCHED : pads cannot cooperate in scheduling
62 * @GST_PAD_LINK_REFUSED : refused for some reason
66 GST_PAD_LINK_WRONG_HIERARCHY = -1,
67 GST_PAD_LINK_WAS_LINKED = -2,
68 GST_PAD_LINK_WRONG_DIRECTION = -3,
69 GST_PAD_LINK_NOFORMAT = -4,
70 GST_PAD_LINK_NOSCHED = -5,
71 GST_PAD_LINK_REFUSED = -6,
75 * GST_PAD_LINK_FAILED:
76 * @ret: the #GstPadLinkReturn value
78 * Macro to test if the given #GstPadLinkReturn value indicates a failed
81 #define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)
84 * GST_PAD_LINK_SUCCESSFUL:
85 * @ret: the #GstPadLinkReturn value
87 * Macro to test if the given #GstPadLinkReturn value indicates a successful
90 #define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
94 * @GST_FLOW_RESEND: Resend buffer, possibly with new caps.
95 * @GST_FLOW_OK: Data passing was ok.
96 * @GST_FLOW_NOT_LINKED: Pad is not linked.
97 * @GST_FLOW_WRONG_STATE: Pad is in wrong state.
98 * @GST_FLOW_UNEXPECTED: Did not expect anything, like after EOS.
99 * @GST_FLOW_NOT_NEGOTIATED: Pad is not negotiated.
100 * @GST_FLOW_ERROR: Some (fatal) error occured.
101 * @GST_FLOW_NOT_SUPPORTED: This operation is not supported.
103 * The result of passing data to a linked pad.
108 /* expected failures */
109 GST_FLOW_NOT_LINKED = -1,
110 GST_FLOW_WRONG_STATE = -2,
112 GST_FLOW_UNEXPECTED = -3,
113 GST_FLOW_NOT_NEGOTIATED = -4,
115 GST_FLOW_NOT_SUPPORTED = -6
120 * @ret: a #GstFlowReturn value
122 * Macro to test if the given #GstFlowReturn value indicates a fatal
123 * error. This macro is mainly used in elements to decide when an error
124 * message should be posted on the bus.
126 #define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
128 G_CONST_RETURN gchar* gst_flow_get_name (GstFlowReturn ret);
129 GQuark gst_flow_to_quark (GstFlowReturn ret);
133 * @GST_ACTIVATE_NONE: Pad will not handle dataflow
134 * @GST_ACTIVATE_PUSH: Pad handles dataflow in downstream push mode
135 * @GST_ACTIVATE_PULL: Pad handles dataflow in upstream pull mode
137 * The status of a GstPad. After activating a pad, which usually happens when the
138 * parent element goes from READY to PAUSED, the GstActivateMode defines if the
139 * pad operates in push or pull mode.
148 * GST_PAD_MODE_ACTIVATE:
149 * @mode: a #GstActivateMode
151 * Macro to test if the given #GstActivateMode value indicates that datapassing
152 * is possible or not.
154 #define GST_PAD_MODE_ACTIVATE(mode) ((mode) != GST_ACTIVATE_NONE)
157 typedef gboolean (*GstPadActivateFunction) (GstPad *pad);
158 typedef gboolean (*GstPadActivateModeFunction) (GstPad *pad, gboolean active);
163 * GstPadChainFunction:
164 * @pad: the #GstPad that performed the chain.
165 * @buffer: the #GstBuffer that is chained.
167 * A function that will be called on sinkpads when chaining buffers.
169 * Returns: GST_FLOW_OK for success
171 typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer);
173 * GstPadGetRangeFunction:
174 * @pad: the #GstPad to perform the getrange on.
175 * @offset: the offset of the range
176 * @length: the length of the range
177 * @buffer: a memory location to hold the result buffer
179 * This function will be called on sourcepads when a peer element
180 * request a buffer at the specified offset and length. If this function
181 * returns GST_FLOW_OK, the result buffer will be stored in @buffer. The
182 * contents of @buffer is invalid for any other return value.
184 * Returns: GST_FLOW_OK for success
186 typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset,
187 guint length, GstBuffer **buffer);
190 * GstPadEventFunction:
191 * @pad: the #GstPad to handle the event.
192 * @event: the #GstEvent to handle.
194 * Function signature to handle an event for the pad.
196 * Returns: TRUE if the pad could handle the event.
198 typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
201 /* deprecate me, check range should use seeking query */
202 typedef gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad);
207 * GstPadIntLinkFunction:
208 * @pad: The #GstPad to query.
210 * The signature of the internal pad link function.
212 * Returns: a newly allocated #GList of pads that are linked to the given pad on
213 * the inside of the parent element.
214 * The caller must call g_list_free() on it after use.
216 typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
219 /* generic query function */
221 * GstPadQueryTypeFunction:
222 * @pad: a #GstPad to query
224 * The signature of the query types function.
226 * Returns: a constant array of query types
228 typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
231 * GstPadQueryFunction:
232 * @pad: the #GstPad to query.
233 * @query: the #GstQuery object to execute
235 * The signature of the query function.
237 * Returns: TRUE if the query could be performed.
239 typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery *query);
245 * @pad: the #GstPad that is linked.
246 * @peer: the peer #GstPad of the link
248 * Function signature to handle a new link on the pad.
250 * Returns: the result of the link with the specified peer.
252 typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstPad *peer);
254 * GstPadUnlinkFunction
255 * @pad: the #GstPad that is linked.
257 * Function signature to handle a unlinking the pad prom its peer.
259 typedef void (*GstPadUnlinkFunction) (GstPad *pad);
264 * GstPadGetCapsFunction:
265 * @pad: the #GstPad to get the capabilities of.
267 * Returns a copy of the capabilities of the specified pad. By default this
268 * function will return the pad template capabilities, but can optionally
271 * Returns: a newly allocated copy #GstCaps of the pad.
273 typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad);
274 typedef gboolean (*GstPadSetCapsFunction) (GstPad *pad, GstCaps *caps);
275 typedef gboolean (*GstPadAcceptCapsFunction) (GstPad *pad, GstCaps *caps);
276 typedef void (*GstPadFixateCapsFunction) (GstPad *pad, GstCaps *caps);
277 typedef GstFlowReturn (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size,
278 GstCaps *caps, GstBuffer **buf);
282 * GstPadDispatcherFunction:
283 * @pad: the #GstPad that is dispatched.
284 * @data: the gpointer to optional user data.
286 * A dispatcher function is called for all internally linked pads, see
287 * gst_pad_dispatcher().
289 * Returns: TRUE if the dispatching procedure has to be stopped.
291 typedef gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
294 * GstPadBlockCallback:
295 * @pad: the #GstPad that is blockend or unblocked.
296 * @blocked: blocking state for the pad
297 * @user_data: the gpointer to optional user data.
299 * Callback used by gst_pad_set_blocked_async(). Gets called when the blocking
300 * operation succeeds.
302 typedef void (*GstPadBlockCallback) (GstPad *pad, gboolean blocked, gpointer user_data);
306 * @GST_PAD_UNKNOWN: direction is unknown.
307 * @GST_PAD_SRC: the pad is a source pad.
308 * @GST_PAD_SINK: the pad is a sink pad.
310 * The direction of a pad.
320 * @GST_PAD_BLOCKED: is dataflow on a pad blocked
321 * @GST_PAD_FLUSHING: is pad refusing buffers
322 * @GST_PAD_IN_GETCAPS: GstPadGetCapsFunction() is running now
323 * @GST_PAD_IN_SETCAPS: GstPadSetCapsFunction() is running now
324 * @GST_PAD_FLAG_LAST: offset to define more flags
329 GST_PAD_BLOCKED = (GST_OBJECT_FLAG_LAST << 0),
330 GST_PAD_FLUSHING = (GST_OBJECT_FLAG_LAST << 1),
331 GST_PAD_IN_GETCAPS = (GST_OBJECT_FLAG_LAST << 2),
332 GST_PAD_IN_SETCAPS = (GST_OBJECT_FLAG_LAST << 3),
334 GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 8)
337 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
338 typedef struct _GstPadTemplate GstPadTemplate;
343 gpointer element_private;
345 GstPadTemplate *padtemplate;
347 /* direction cannot change after creating the pad */
348 GstPadDirection direction;
350 /*< public >*/ /* with STREAM_LOCK */
351 /* streaming rec_lock */
352 GStaticRecMutex *stream_rec_lock;
354 /*< public >*/ /* with PREROLL_LOCK */
355 GMutex *preroll_lock;
358 /*< public >*/ /* with LOCK */
359 /* block cond, mutex is from the object */
361 GstPadBlockCallback block_callback;
364 /* the pad capabilities */
366 GstPadGetCapsFunction getcapsfunc;
367 GstPadSetCapsFunction setcapsfunc;
368 GstPadAcceptCapsFunction acceptcapsfunc;
369 GstPadFixateCapsFunction fixatecapsfunc;
371 GstPadActivateFunction activatefunc;
372 GstPadActivateModeFunction activatepushfunc;
373 GstPadActivateModeFunction activatepullfunc;
376 GstPadLinkFunction linkfunc;
377 GstPadUnlinkFunction unlinkfunc;
380 gpointer sched_private;
382 /* data transport functions */
383 GstPadChainFunction chainfunc;
384 GstPadCheckGetRangeFunction checkgetrangefunc;
385 GstPadGetRangeFunction getrangefunc;
386 GstPadEventFunction eventfunc;
388 GstActivateMode mode;
390 /* generic query method */
391 GstPadQueryTypeFunction querytypefunc;
392 GstPadQueryFunction queryfunc;
395 GstPadIntLinkFunction intlinkfunc;
397 GstPadBufferAllocFunction bufferallocfunc;
399 /* whether to emit signals for have-data. counts number
400 * of handlers attached. */
401 gint do_buffer_signals;
402 gint do_event_signals;
405 gpointer _gst_reserved[GST_PADDING];
408 struct _GstPadClass {
409 GstObjectClass parent_class;
411 /* signal callbacks */
412 void (*linked) (GstPad *pad, GstPad *peer);
413 void (*unlinked) (GstPad *pad, GstPad *peer);
414 void (*request_link) (GstPad *pad);
415 gboolean (*have_data) (GstPad *pad, GstMiniObject *data);
418 gpointer _gst_reserved[GST_PADDING];
422 /***** helper macros *****/
424 #define GST_PAD_NAME(pad) (GST_OBJECT_NAME(pad))
425 #define GST_PAD_PARENT(pad) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad)))
426 #define GST_PAD_ELEMENT_PRIVATE(pad) (GST_PAD_CAST(pad)->element_private)
427 #define GST_PAD_PAD_TEMPLATE(pad) (GST_PAD_CAST(pad)->padtemplate)
428 #define GST_PAD_DIRECTION(pad) (GST_PAD_CAST(pad)->direction)
429 #define GST_PAD_TASK(pad) (GST_PAD_CAST(pad)->task)
430 #define GST_PAD_ACTIVATE_MODE(pad) (GST_PAD_CAST(pad)->mode)
432 #define GST_PAD_ACTIVATEFUNC(pad) (GST_PAD_CAST(pad)->activatefunc)
433 #define GST_PAD_ACTIVATEPUSHFUNC(pad) (GST_PAD_CAST(pad)->activatepushfunc)
434 #define GST_PAD_ACTIVATEPULLFUNC(pad) (GST_PAD_CAST(pad)->activatepullfunc)
435 #define GST_PAD_CHAINFUNC(pad) (GST_PAD_CAST(pad)->chainfunc)
436 #define GST_PAD_CHECKGETRANGEFUNC(pad) (GST_PAD_CAST(pad)->checkgetrangefunc)
437 #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc)
438 #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc)
439 #define GST_PAD_QUERYTYPEFUNC(pad) (GST_PAD_CAST(pad)->querytypefunc)
440 #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc)
441 #define GST_PAD_INTLINKFUNC(pad) (GST_PAD_CAST(pad)->intlinkfunc)
443 #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer)
444 #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc)
445 #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc)
447 #define GST_PAD_CAPS(pad) (GST_PAD_CAST(pad)->caps)
448 #define GST_PAD_GETCAPSFUNC(pad) (GST_PAD_CAST(pad)->getcapsfunc)
449 #define GST_PAD_SETCAPSFUNC(pad) (GST_PAD_CAST(pad)->setcapsfunc)
450 #define GST_PAD_ACCEPTCAPSFUNC(pad) (GST_PAD_CAST(pad)->acceptcapsfunc)
451 #define GST_PAD_FIXATECAPSFUNC(pad) (GST_PAD_CAST(pad)->fixatecapsfunc)
453 #define GST_PAD_BUFFERALLOCFUNC(pad) (GST_PAD_CAST(pad)->bufferallocfunc)
455 #define GST_PAD_DO_BUFFER_SIGNALS(pad) (GST_PAD_CAST(pad)->do_buffer_signals)
456 #define GST_PAD_DO_EVENT_SIGNALS(pad) (GST_PAD_CAST(pad)->do_event_signals)
458 #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
459 #define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED))
460 #define GST_PAD_IS_FLUSHING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLUSHING))
461 #define GST_PAD_IS_IN_GETCAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_GETCAPS))
462 #define GST_PAD_IS_IN_SETCAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_SETCAPS))
463 #define GST_PAD_IS_USABLE(pad) (GST_PAD_IS_LINKED (pad) && \
464 !GST_PAD_IS_FLUSHING(pad) && !GST_PAD_IS_FLUSHING(GST_PAD_PEER (pad)))
465 #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
466 #define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
468 #define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLUSHING))
469 #define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLUSHING))
471 #define GST_STREAM_GET_LOCK(pad) (GST_PAD_CAST(pad)->stream_rec_lock)
472 #define GST_STREAM_LOCK(pad) (g_static_rec_mutex_lock(GST_STREAM_GET_LOCK(pad)))
473 #define GST_STREAM_TRYLOCK(pad) (g_static_rec_mutex_trylock(GST_STREAM_GET_LOCK(pad)))
474 #define GST_STREAM_UNLOCK(pad) (g_static_rec_mutex_unlock(GST_STREAM_GET_LOCK(pad)))
475 #define GST_STREAM_UNLOCK_FULL(pad) (g_static_rec_mutex_unlock_full(GST_STREAM_GET_LOCK(pad)))
476 #define GST_STREAM_LOCK_FULL(pad,t) (g_static_rec_mutex_lock_full(GST_STREAM_GET_LOCK(pad), t))
478 #define GST_PREROLL_GET_LOCK(pad) (GST_PAD_CAST(pad)->preroll_lock)
479 #define GST_PREROLL_LOCK(pad) (g_mutex_lock(GST_PREROLL_GET_LOCK(pad)))
480 #define GST_PREROLL_TRYLOCK(pad) (g_mutex_trylock(GST_PREROLL_GET_LOCK(pad)))
481 #define GST_PREROLL_UNLOCK(pad) (g_mutex_unlock(GST_PREROLL_GET_LOCK(pad)))
482 #define GST_PREROLL_GET_COND(pad) (GST_PAD_CAST(pad)->preroll_cond)
483 #define GST_PREROLL_WAIT(pad) g_cond_wait (GST_PREROLL_GET_COND (pad), GST_PREROLL_GET_LOCK (pad))
484 #define GST_PREROLL_TIMED_WAIT(pad, timeval) g_cond_timed_wait (GST_PREROLL_GET_COND (pad), GST_PREROLL_GET_LOCK (pad),\
486 #define GST_PREROLL_SIGNAL(pad) g_cond_signal (GST_PREROLL_GET_COND (pad));
487 #define GST_PREROLL_BROADCAST(pad) g_cond_broadcast (GST_PREROLL_GET_COND (pad));
489 #define GST_PAD_BLOCK_GET_COND(pad) (GST_PAD_CAST(pad)->block_cond)
490 #define GST_PAD_BLOCK_WAIT(pad) (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_GET_LOCK (pad)))
491 #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad)))
493 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
494 #include <gst/gstpadtemplate.h>
496 GType gst_pad_get_type (void);
499 GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
500 GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
504 * @pad: the pad to get the name from
506 * Get a copy of the name of the pad. g_free() after usage.
510 #define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))
512 * gst_pad_get_parent:
513 * @pad: the pad to get the parent of
515 * Get the parent of @pad. This function increases the refcount
516 * of the parent object so you should gst_object_unref() it after usage.
517 * Can return NULL if the pad did not have a parent.
521 #define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))
523 GstPadDirection gst_pad_get_direction (GstPad *pad);
525 gboolean gst_pad_set_active (GstPad *pad, gboolean active);
526 gboolean gst_pad_is_active (GstPad *pad);
527 gboolean gst_pad_activate_pull (GstPad *pad, gboolean active);
528 gboolean gst_pad_activate_push (GstPad *pad, gboolean active);
530 gboolean gst_pad_set_blocked (GstPad *pad, gboolean blocked);
531 gboolean gst_pad_set_blocked_async (GstPad *pad, gboolean blocked,
532 GstPadBlockCallback callback, gpointer user_data);
533 gboolean gst_pad_is_blocked (GstPad *pad);
535 void gst_pad_set_element_private (GstPad *pad, gpointer priv);
536 gpointer gst_pad_get_element_private (GstPad *pad);
538 GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
540 void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufalloc);
541 GstFlowReturn gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size,
542 GstCaps *caps, GstBuffer **buf);
544 /* data passing setup functions */
545 void gst_pad_set_activate_function (GstPad *pad, GstPadActivateFunction activate);
546 void gst_pad_set_activatepull_function (GstPad *pad, GstPadActivateModeFunction activatepull);
547 void gst_pad_set_activatepush_function (GstPad *pad, GstPadActivateModeFunction activatepush);
548 void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);
549 void gst_pad_set_getrange_function (GstPad *pad, GstPadGetRangeFunction get);
550 void gst_pad_set_checkgetrange_function (GstPad *pad, GstPadCheckGetRangeFunction check);
551 void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
554 void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
555 void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
557 GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
558 gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
559 gboolean gst_pad_is_linked (GstPad *pad);
561 GstPad* gst_pad_get_peer (GstPad *pad);
563 /* capsnego functions */
564 void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
565 void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps);
566 void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
567 void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps);
569 G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
571 /* capsnego function for connected/unconnected pads */
572 GstCaps * gst_pad_get_caps (GstPad * pad);
573 void gst_pad_fixate_caps (GstPad * pad, GstCaps *caps);
574 gboolean gst_pad_accept_caps (GstPad * pad, GstCaps *caps);
575 gboolean gst_pad_set_caps (GstPad * pad, GstCaps *caps);
577 GstCaps * gst_pad_peer_get_caps (GstPad * pad);
578 gboolean gst_pad_peer_accept_caps (GstPad * pad, GstCaps *caps);
580 /* capsnego for connected pads */
581 GstCaps * gst_pad_get_allowed_caps (GstPad * srcpad);
582 GstCaps * gst_pad_get_negotiated_caps (GstPad * pad);
584 /* data passing functions to peer */
585 GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
586 gboolean gst_pad_check_pull_range (GstPad *pad);
587 GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
589 gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
590 gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
592 /* data passing functions on pad */
593 GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
594 GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size,
596 gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
599 gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func,
601 gboolean gst_pad_pause_task (GstPad *pad);
602 gboolean gst_pad_stop_task (GstPad *pad);
605 void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
606 GList* gst_pad_get_internal_links (GstPad *pad);
607 GList* gst_pad_get_internal_links_default (GstPad *pad);
609 /* generic query function */
610 void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func);
611 G_CONST_RETURN GstQueryType*
612 gst_pad_get_query_types (GstPad *pad);
613 G_CONST_RETURN GstQueryType*
614 gst_pad_get_query_types_default (GstPad *pad);
616 gboolean gst_pad_query (GstPad *pad, GstQuery *query);
617 void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
618 gboolean gst_pad_query_default (GstPad *pad, GstQuery *query);
620 /* misc helper functions */
621 gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
624 #ifndef GST_DISABLE_LOADSAVE
625 void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
630 #endif /* __GST_PAD_H__ */