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))
49 typedef struct _GstPad GstPad;
50 typedef struct _GstPadClass GstPadClass;
54 * @GST_PAD_LINK_OK : link succeeded
55 * @GST_PAD_LINK_WRONG_HIERARCHY: pads have no common grandparent
56 * @GST_PAD_LINK_WAS_LINKED : pad was already linked
57 * @GST_PAD_LINK_WRONG_DIRECTION: pads have wrong direction
58 * @GST_PAD_LINK_NOFORMAT : pads do not have common format
59 * @GST_PAD_LINK_NOSCHED : pads cannot cooperate in scheduling
60 * @GST_PAD_LINK_REFUSED : refused for some reason
64 GST_PAD_LINK_WRONG_HIERARCHY = -1,
65 GST_PAD_LINK_WAS_LINKED = -2,
66 GST_PAD_LINK_WRONG_DIRECTION = -3,
67 GST_PAD_LINK_NOFORMAT = -4,
68 GST_PAD_LINK_NOSCHED = -5,
69 GST_PAD_LINK_REFUSED = -6,
73 * GST_PAD_LINK_FAILED:
74 * @ret: the #GstPadLinkReturn value
76 * Macro to test if the given #GstPadLinkReturn value indicates a failed
79 #define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)
82 * GST_PAD_LINK_SUCCESSFUL:
83 * @ret: the #GstPadLinkReturn value
85 * Macro to test if the given #GstPadLinkReturn value indicates a successful
88 #define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
92 * @GST_FLOW_RESEND: Resend buffer, possibly with new caps.
93 * @GST_FLOW_OK: Data passing was ok.
94 * @GST_FLOW_NOT_LINKED: Pad is not linked.
95 * @GST_FLOW_WRONG_STATE: Pad is in wrong state.
96 * @GST_FLOW_UNEXPECTED: Did not expect anything, like after EOS.
97 * @GST_FLOW_NOT_NEGOTIATED: Pad is not negotiated.
98 * @GST_FLOW_ERROR: Some (fatal) error occured.
99 * @GST_FLOW_NOT_SUPPORTED: This operation is not supported.
101 * The result of passing data to a linked pad.
106 /* expected failures */
107 GST_FLOW_NOT_LINKED = -1,
108 GST_FLOW_WRONG_STATE = -2,
110 GST_FLOW_UNEXPECTED = -3,
111 GST_FLOW_NOT_NEGOTIATED = -4,
113 GST_FLOW_NOT_SUPPORTED = -6
118 * @ret: a #GstFlowReturn value
120 * Macro to test if the given #GstFlowReturn value indicates a fatal
121 * error. This macro is mainly used in elements to decide when an error
122 * message should be posted on the bus.
124 #define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
126 G_CONST_RETURN gchar* gst_flow_get_name (GstFlowReturn ret);
127 GQuark gst_flow_to_quark (GstFlowReturn ret);
131 * @GST_ACTIVATE_NONE: Pad will not handle dataflow
132 * @GST_ACTIVATE_PUSH: Pad handles dataflow in downstream push mode
133 * @GST_ACTIVATE_PULL: Pad handles dataflow in upstream pull mode
135 * The status of a GstPad. After activating a pad, which usually happens when the
136 * parent element goes from READY to PAUSED, the GstActivateMode defines if the
137 * pad operates in push or pull mode.
146 * GST_PAD_MODE_ACTIVATE:
147 * @mode: a #GstActivateMode
149 * Macro to test if the given #GstActivateMode value indicates that datapassing
150 * is possible or not.
152 #define GST_PAD_MODE_ACTIVATE(mode) ((mode) != GST_ACTIVATE_NONE)
155 typedef gboolean (*GstPadActivateFunction) (GstPad *pad);
156 typedef gboolean (*GstPadActivateModeFunction) (GstPad *pad, gboolean active);
161 * GstPadChainFunction:
162 * @pad: the #GstPad that performed the chain.
163 * @buffer: the #GstBuffer that is chained.
165 * A function that will be called on sinkpads when chaining buffers.
167 * Returns: GST_FLOW_OK for success
169 typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer);
171 * GstPadGetRangeFunction:
172 * @pad: the #GstPad to perform the getrange on.
173 * @offset: the offset of the range
174 * @length: the length of the range
175 * @buffer: a memory location to hold the result buffer
177 * This function will be called on sourcepads when a peer element
178 * request a buffer at the specified offset and length. If this function
179 * returns GST_FLOW_OK, the result buffer will be stored in @buffer. The
180 * contents of @buffer is invalid for any other return value.
182 * Returns: GST_FLOW_OK for success
184 typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset,
185 guint length, GstBuffer **buffer);
188 * GstPadEventFunction:
189 * @pad: the #GstPad to handle the event.
190 * @event: the #GstEvent to handle.
192 * Function signature to handle an event for the pad.
194 * Returns: TRUE if the pad could handle the event.
196 typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
199 /* deprecate me, check range should use seeking query */
200 typedef gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad);
205 * GstPadIntLinkFunction:
206 * @pad: The #GstPad to query.
208 * The signature of the internal pad link function.
210 * Returns: a newly allocated #GList of pads that are linked to the given pad on
211 * the inside of the parent element.
212 * The caller must call g_list_free() on it after use.
214 typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
217 /* generic query function */
219 * GstPadQueryTypeFunction:
220 * @pad: a #GstPad to query
222 * The signature of the query types function.
224 * Returns: a constant array of query types
226 typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
229 * GstPadQueryFunction:
230 * @pad: the #GstPad to query.
231 * @query: the #GstQuery object to execute
233 * The signature of the query function.
235 * Returns: TRUE if the query could be performed.
237 typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery *query);
243 * @pad: the #GstPad that is linked.
244 * @peer: the peer #GstPad of the link
246 * Function signature to handle a new link on the pad.
248 * Returns: the result of the link with the specified peer.
250 typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstPad *peer);
252 * GstPadUnlinkFunction
253 * @pad: the #GstPad that is linked.
255 * Function signature to handle a unlinking the pad prom its peer.
257 typedef void (*GstPadUnlinkFunction) (GstPad *pad);
262 * GstPadGetCapsFunction:
263 * @pad: the #GstPad to get the capabilities of.
265 * Returns a copy of the capabilities of the specified pad. By default this
266 * function will return the pad template capabilities, but can optionally
269 * Returns: a newly allocated copy #GstCaps of the pad.
271 typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad);
272 typedef gboolean (*GstPadSetCapsFunction) (GstPad *pad, GstCaps *caps);
273 typedef gboolean (*GstPadAcceptCapsFunction) (GstPad *pad, GstCaps *caps);
274 typedef void (*GstPadFixateCapsFunction) (GstPad *pad, GstCaps *caps);
275 typedef GstFlowReturn (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size,
276 GstCaps *caps, GstBuffer **buf);
280 * GstPadDispatcherFunction:
281 * @pad: the #GstPad that is dispatched.
282 * @data: the gpointer to optional user data.
284 * A dispatcher function is called for all internally linked pads, see
285 * gst_pad_dispatcher().
287 * Returns: TRUE if the dispatching procedure has to be stopped.
289 typedef gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
292 * GstPadBlockCallback:
293 * @pad: the #GstPad that is blockend or unblocked.
294 * @blocked: blocking state for the pad
295 * @user_data: the gpointer to optional user data.
297 * Callback used by gst_pad_set_blocked_async(). Gets called when the blocking
298 * operation succeeds.
300 typedef void (*GstPadBlockCallback) (GstPad *pad, gboolean blocked, gpointer user_data);
304 * @GST_PAD_UNKNOWN: direction is unknown.
305 * @GST_PAD_SRC: the pad is a source pad.
306 * @GST_PAD_SINK: the pad is a sink pad.
308 * The direction of a pad.
318 * @GST_PAD_BLOCKED: is dataflow on a pad blocked
319 * @GST_PAD_FLUSHING: is pad refusing buffers
320 * @GST_PAD_IN_GETCAPS: GstPadGetCapsFunction() is running now
321 * @GST_PAD_IN_SETCAPS: GstPadSetCapsFunction() is running now
322 * @GST_PAD_FLAG_LAST: offset to define more flags
327 GST_PAD_BLOCKED = (GST_OBJECT_FLAG_LAST << 0),
328 GST_PAD_FLUSHING = (GST_OBJECT_FLAG_LAST << 1),
329 GST_PAD_IN_GETCAPS = (GST_OBJECT_FLAG_LAST << 2),
330 GST_PAD_IN_SETCAPS = (GST_OBJECT_FLAG_LAST << 3),
332 GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 8)
335 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
336 typedef struct _GstPadTemplate GstPadTemplate;
341 gpointer element_private;
343 GstPadTemplate *padtemplate;
345 /* direction cannot change after creating the pad */
346 GstPadDirection direction;
348 /*< public >*/ /* with STREAM_LOCK */
349 /* streaming rec_lock */
350 GStaticRecMutex *stream_rec_lock;
352 /*< public >*/ /* with PREROLL_LOCK */
353 GMutex *preroll_lock;
356 /*< public >*/ /* with LOCK */
357 /* block cond, mutex is from the object */
359 GstPadBlockCallback block_callback;
362 /* the pad capabilities */
364 GstPadGetCapsFunction getcapsfunc;
365 GstPadSetCapsFunction setcapsfunc;
366 GstPadAcceptCapsFunction acceptcapsfunc;
367 GstPadFixateCapsFunction fixatecapsfunc;
369 GstPadActivateFunction activatefunc;
370 GstPadActivateModeFunction activatepushfunc;
371 GstPadActivateModeFunction activatepullfunc;
374 GstPadLinkFunction linkfunc;
375 GstPadUnlinkFunction unlinkfunc;
378 gpointer sched_private;
380 /* data transport functions */
381 GstPadChainFunction chainfunc;
382 GstPadCheckGetRangeFunction checkgetrangefunc;
383 GstPadGetRangeFunction getrangefunc;
384 GstPadEventFunction eventfunc;
386 GstActivateMode mode;
388 /* generic query method */
389 GstPadQueryTypeFunction querytypefunc;
390 GstPadQueryFunction queryfunc;
393 GstPadIntLinkFunction intlinkfunc;
395 GstPadBufferAllocFunction bufferallocfunc;
397 /* whether to emit signals for have-data. counts number
398 * of handlers attached. */
399 gint do_buffer_signals;
400 gint do_event_signals;
403 gpointer _gst_reserved[GST_PADDING];
406 struct _GstPadClass {
407 GstObjectClass parent_class;
409 /* signal callbacks */
410 void (*linked) (GstPad *pad, GstPad *peer);
411 void (*unlinked) (GstPad *pad, GstPad *peer);
412 void (*request_link) (GstPad *pad);
413 gboolean (*have_data) (GstPad *pad, GstMiniObject *data);
416 gpointer _gst_reserved[GST_PADDING];
420 /***** helper macros *****/
422 #define GST_PAD_NAME(pad) (GST_OBJECT_NAME(pad))
423 #define GST_PAD_PARENT(pad) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad)))
424 #define GST_PAD_ELEMENT_PRIVATE(pad) (GST_PAD_CAST(pad)->element_private)
425 #define GST_PAD_PAD_TEMPLATE(pad) (GST_PAD_CAST(pad)->padtemplate)
426 #define GST_PAD_DIRECTION(pad) (GST_PAD_CAST(pad)->direction)
427 #define GST_PAD_TASK(pad) (GST_PAD_CAST(pad)->task)
428 #define GST_PAD_ACTIVATE_MODE(pad) (GST_PAD_CAST(pad)->mode)
430 #define GST_PAD_ACTIVATEFUNC(pad) (GST_PAD_CAST(pad)->activatefunc)
431 #define GST_PAD_ACTIVATEPUSHFUNC(pad) (GST_PAD_CAST(pad)->activatepushfunc)
432 #define GST_PAD_ACTIVATEPULLFUNC(pad) (GST_PAD_CAST(pad)->activatepullfunc)
433 #define GST_PAD_CHAINFUNC(pad) (GST_PAD_CAST(pad)->chainfunc)
434 #define GST_PAD_CHECKGETRANGEFUNC(pad) (GST_PAD_CAST(pad)->checkgetrangefunc)
435 #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc)
436 #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc)
437 #define GST_PAD_QUERYTYPEFUNC(pad) (GST_PAD_CAST(pad)->querytypefunc)
438 #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc)
439 #define GST_PAD_INTLINKFUNC(pad) (GST_PAD_CAST(pad)->intlinkfunc)
441 #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer)
442 #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc)
443 #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc)
445 #define GST_PAD_CAPS(pad) (GST_PAD_CAST(pad)->caps)
446 #define GST_PAD_GETCAPSFUNC(pad) (GST_PAD_CAST(pad)->getcapsfunc)
447 #define GST_PAD_SETCAPSFUNC(pad) (GST_PAD_CAST(pad)->setcapsfunc)
448 #define GST_PAD_ACCEPTCAPSFUNC(pad) (GST_PAD_CAST(pad)->acceptcapsfunc)
449 #define GST_PAD_FIXATECAPSFUNC(pad) (GST_PAD_CAST(pad)->fixatecapsfunc)
451 #define GST_PAD_BUFFERALLOCFUNC(pad) (GST_PAD_CAST(pad)->bufferallocfunc)
453 #define GST_PAD_DO_BUFFER_SIGNALS(pad) (GST_PAD_CAST(pad)->do_buffer_signals)
454 #define GST_PAD_DO_EVENT_SIGNALS(pad) (GST_PAD_CAST(pad)->do_event_signals)
456 #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
457 #define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED))
458 #define GST_PAD_IS_FLUSHING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLUSHING))
459 #define GST_PAD_IS_IN_GETCAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_GETCAPS))
460 #define GST_PAD_IS_IN_SETCAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_SETCAPS))
461 #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
462 #define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
464 #define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLUSHING))
465 #define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLUSHING))
467 #define GST_STREAM_GET_LOCK(pad) (GST_PAD_CAST(pad)->stream_rec_lock)
468 #define GST_STREAM_LOCK(pad) (g_static_rec_mutex_lock(GST_STREAM_GET_LOCK(pad)))
469 #define GST_STREAM_TRYLOCK(pad) (g_static_rec_mutex_trylock(GST_STREAM_GET_LOCK(pad)))
470 #define GST_STREAM_UNLOCK(pad) (g_static_rec_mutex_unlock(GST_STREAM_GET_LOCK(pad)))
471 #define GST_STREAM_UNLOCK_FULL(pad) (g_static_rec_mutex_unlock_full(GST_STREAM_GET_LOCK(pad)))
472 #define GST_STREAM_LOCK_FULL(pad,t) (g_static_rec_mutex_lock_full(GST_STREAM_GET_LOCK(pad), t))
474 #define GST_PREROLL_GET_LOCK(pad) (GST_PAD_CAST(pad)->preroll_lock)
475 #define GST_PREROLL_LOCK(pad) (g_mutex_lock(GST_PREROLL_GET_LOCK(pad)))
476 #define GST_PREROLL_TRYLOCK(pad) (g_mutex_trylock(GST_PREROLL_GET_LOCK(pad)))
477 #define GST_PREROLL_UNLOCK(pad) (g_mutex_unlock(GST_PREROLL_GET_LOCK(pad)))
478 #define GST_PREROLL_GET_COND(pad) (GST_PAD_CAST(pad)->preroll_cond)
479 #define GST_PREROLL_WAIT(pad) g_cond_wait (GST_PREROLL_GET_COND (pad), GST_PREROLL_GET_LOCK (pad))
480 #define GST_PREROLL_TIMED_WAIT(pad, timeval) g_cond_timed_wait (GST_PREROLL_GET_COND (pad), GST_PREROLL_GET_LOCK (pad),\
482 #define GST_PREROLL_SIGNAL(pad) g_cond_signal (GST_PREROLL_GET_COND (pad));
483 #define GST_PREROLL_BROADCAST(pad) g_cond_broadcast (GST_PREROLL_GET_COND (pad));
485 #define GST_PAD_BLOCK_GET_COND(pad) (GST_PAD_CAST(pad)->block_cond)
486 #define GST_PAD_BLOCK_WAIT(pad) (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_OBJECT_GET_LOCK (pad)))
487 #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad)))
489 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
490 #include <gst/gstpadtemplate.h>
492 GType gst_pad_get_type (void);
495 GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
496 GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
497 GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name);
502 * @pad: the pad to get the name from
504 * Get a copy of the name of the pad. g_free() after usage.
508 #define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))
510 * gst_pad_get_parent:
511 * @pad: the pad to get the parent of
513 * Get the parent of @pad. This function increases the refcount
514 * of the parent object so you should gst_object_unref() it after usage.
515 * Can return NULL if the pad did not have a parent.
519 #define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))
521 GstPadDirection gst_pad_get_direction (GstPad *pad);
523 gboolean gst_pad_set_active (GstPad *pad, gboolean active);
524 gboolean gst_pad_is_active (GstPad *pad);
525 gboolean gst_pad_activate_pull (GstPad *pad, gboolean active);
526 gboolean gst_pad_activate_push (GstPad *pad, gboolean active);
528 gboolean gst_pad_set_blocked (GstPad *pad, gboolean blocked);
529 gboolean gst_pad_set_blocked_async (GstPad *pad, gboolean blocked,
530 GstPadBlockCallback callback, gpointer user_data);
531 gboolean gst_pad_is_blocked (GstPad *pad);
533 void gst_pad_set_element_private (GstPad *pad, gpointer priv);
534 gpointer gst_pad_get_element_private (GstPad *pad);
536 GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
538 void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufalloc);
539 GstFlowReturn gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size,
540 GstCaps *caps, GstBuffer **buf);
542 /* data passing setup functions */
543 void gst_pad_set_activate_function (GstPad *pad, GstPadActivateFunction activate);
544 void gst_pad_set_activatepull_function (GstPad *pad, GstPadActivateModeFunction activatepull);
545 void gst_pad_set_activatepush_function (GstPad *pad, GstPadActivateModeFunction activatepush);
546 void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);
547 void gst_pad_set_getrange_function (GstPad *pad, GstPadGetRangeFunction get);
548 void gst_pad_set_checkgetrange_function (GstPad *pad, GstPadCheckGetRangeFunction check);
549 void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
552 void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
553 void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
555 GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
556 gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
557 gboolean gst_pad_is_linked (GstPad *pad);
559 GstPad* gst_pad_get_peer (GstPad *pad);
561 /* capsnego functions */
562 void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
563 void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps);
564 void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
565 void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps);
567 G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
569 /* capsnego function for connected/unconnected pads */
570 GstCaps * gst_pad_get_caps (GstPad * pad);
571 void gst_pad_fixate_caps (GstPad * pad, GstCaps *caps);
572 gboolean gst_pad_accept_caps (GstPad * pad, GstCaps *caps);
573 gboolean gst_pad_set_caps (GstPad * pad, GstCaps *caps);
575 GstCaps * gst_pad_peer_get_caps (GstPad * pad);
576 gboolean gst_pad_peer_accept_caps (GstPad * pad, GstCaps *caps);
578 /* capsnego for connected pads */
579 GstCaps * gst_pad_get_allowed_caps (GstPad * srcpad);
580 GstCaps * gst_pad_get_negotiated_caps (GstPad * pad);
582 /* data passing functions to peer */
583 GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
584 gboolean gst_pad_check_pull_range (GstPad *pad);
585 GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
587 gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
588 gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
590 /* data passing functions on pad */
591 GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
592 GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size,
594 gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
597 gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func,
599 gboolean gst_pad_pause_task (GstPad *pad);
600 gboolean gst_pad_stop_task (GstPad *pad);
603 void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
604 GList* gst_pad_get_internal_links (GstPad *pad);
605 GList* gst_pad_get_internal_links_default (GstPad *pad);
607 /* generic query function */
608 void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func);
609 G_CONST_RETURN GstQueryType*
610 gst_pad_get_query_types (GstPad *pad);
611 G_CONST_RETURN GstQueryType*
612 gst_pad_get_query_types_default (GstPad *pad);
614 gboolean gst_pad_query (GstPad *pad, GstQuery *query);
615 void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
616 gboolean gst_pad_query_default (GstPad *pad, GstQuery *query);
618 /* misc helper functions */
619 gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
622 #ifndef GST_DISABLE_LOADSAVE
623 void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
628 #endif /* __GST_PAD_H__ */