pad: remove comma at the end of the last enum value
[platform/upstream/gstreamer.git] / gst / gstpad.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wim.taymans@chello.be>
4  *
5  * gstpad.h: Header for GstPad object
6  *
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.
11  *
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.
16  *
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.
21  */
22
23
24 #ifndef __GST_PAD_H__
25 #define __GST_PAD_H__
26
27 #include <gst/gstconfig.h>
28
29 #include <gst/gstobject.h>
30 #include <gst/gstbuffer.h>
31 #include <gst/gstbufferlist.h>
32 #include <gst/gstcaps.h>
33 #include <gst/gstevent.h>
34 #include <gst/gstquery.h>
35 #include <gst/gsttask.h>
36
37 G_BEGIN_DECLS
38
39 /*
40  * Pad base class
41  */
42 #define GST_TYPE_PAD                    (gst_pad_get_type ())
43 #define GST_IS_PAD(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
44 #define GST_IS_PAD_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
45 #define GST_PAD(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
46 #define GST_PAD_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
47 #define GST_PAD_CAST(obj)               ((GstPad*)(obj))
48
49
50 typedef struct _GstPad GstPad;
51 typedef struct _GstPadPrivate GstPadPrivate;
52 typedef struct _GstPadClass GstPadClass;
53
54 /**
55  * GstPadLinkReturn:
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
63  *
64  * Result values from gst_pad_link and friends.
65  */
66 typedef enum {
67   GST_PAD_LINK_OK               =  0,
68   GST_PAD_LINK_WRONG_HIERARCHY  = -1,
69   GST_PAD_LINK_WAS_LINKED       = -2,
70   GST_PAD_LINK_WRONG_DIRECTION  = -3,
71   GST_PAD_LINK_NOFORMAT         = -4,
72   GST_PAD_LINK_NOSCHED          = -5,
73   GST_PAD_LINK_REFUSED          = -6
74 } GstPadLinkReturn;
75
76 /**
77  * GST_PAD_LINK_FAILED:
78  * @ret: the #GstPadLinkReturn value
79  *
80  * Macro to test if the given #GstPadLinkReturn value indicates a failed
81  * link step.
82  */
83 #define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)
84
85 /**
86  * GST_PAD_LINK_SUCCESSFUL:
87  * @ret: the #GstPadLinkReturn value
88  *
89  * Macro to test if the given #GstPadLinkReturn value indicates a successful
90  * link step.
91  */
92 #define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
93
94 /**
95  * GstFlowReturn:
96  * @GST_FLOW_RESEND:             Resend buffer, possibly with new caps (not
97  *                                 sent yet) (unused/unimplemented).
98  * @GST_FLOW_OK:                 Data passing was ok.
99  * @GST_FLOW_NOT_LINKED:         Pad is not linked.
100  * @GST_FLOW_WRONG_STATE:        Pad is in wrong state.
101  * @GST_FLOW_UNEXPECTED:         Did not expect anything, like after EOS.
102  * @GST_FLOW_NOT_NEGOTIATED:     Pad is not negotiated.
103  * @GST_FLOW_ERROR:              Some (fatal) error occured. Element generating
104  *                               this error should post an error message with more
105  *                               details.
106  * @GST_FLOW_NOT_SUPPORTED:      This operation is not supported.
107  * @GST_FLOW_CUSTOM_SUCCESS:     Elements can use values starting from
108  *                               this (and higher) to define custom success
109  *                               codes. Since 0.10.7.
110  * @GST_FLOW_CUSTOM_SUCCESS_1:   Pre-defined custom success code (define your
111  *                               custom success code to this to avoid compiler
112  *                               warnings). Since 0.10.29.
113  * @GST_FLOW_CUSTOM_SUCCESS_2:   Pre-defined custom success code. Since 0.10.29.
114  * @GST_FLOW_CUSTOM_ERROR:       Elements can use values starting from
115  *                               this (and lower) to define custom error codes.
116  *                               Since 0.10.7.
117  * @GST_FLOW_CUSTOM_ERROR_1:     Pre-defined custom error code (define your
118  *                               custom error code to this to avoid compiler
119  *                               warnings). Since 0.10.29.
120  * @GST_FLOW_CUSTOM_ERROR_2:     Pre-defined custom error code. Since 0.10.29.
121  *
122  * The result of passing data to a pad.
123  *
124  * Note that the custom return values should not be exposed outside of the
125  * element scope and are available since 0.10.7.
126  */
127 /* FIXME 0.11: remove custom flow returns */
128 typedef enum {
129   /* custom success starts here */
130   GST_FLOW_CUSTOM_SUCCESS_2 = 102,
131   GST_FLOW_CUSTOM_SUCCESS_1 = 101,
132   GST_FLOW_CUSTOM_SUCCESS = 100,
133
134   /* core predefined */
135   GST_FLOW_RESEND         =  1,
136   GST_FLOW_OK             =  0,
137   /* expected failures */
138   GST_FLOW_NOT_LINKED     = -1,
139   GST_FLOW_WRONG_STATE    = -2,
140   /* error cases */
141   GST_FLOW_UNEXPECTED     = -3,
142   GST_FLOW_NOT_NEGOTIATED = -4,
143   GST_FLOW_ERROR          = -5,
144   GST_FLOW_NOT_SUPPORTED  = -6,
145
146   /* custom error starts here */
147   GST_FLOW_CUSTOM_ERROR   = -100,
148   GST_FLOW_CUSTOM_ERROR_1 = -101,
149   GST_FLOW_CUSTOM_ERROR_2 = -102
150 } GstFlowReturn;
151
152 /**
153  * GST_FLOW_IS_FATAL:
154  * @ret: a #GstFlowReturn value
155  *
156  * Macro to test if the given #GstFlowReturn value indicates a fatal
157  * error. This macro is mainly used in elements driving the pipeline to decide
158  * whether an error message should be posted on the bus. Note that such
159  * elements may also need to post an error message in the #GST_FLOW_NOT_LINKED
160  * case which is not caught by this macro.
161  */
162 #define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
163
164 /**
165  * GST_FLOW_IS_SUCCESS:
166  * @ret: a #GstFlowReturn value
167  *
168  * Macro to test if the given #GstFlowReturn value indicates a
169  * successfull result
170  * This macro is mainly used in elements to decide if the processing
171  * of a buffer was successfull.
172  *
173  * Since: 0.10.7
174  */
175 #define GST_FLOW_IS_SUCCESS(ret) ((ret) >= GST_FLOW_OK)
176
177 G_CONST_RETURN gchar*   gst_flow_get_name       (GstFlowReturn ret);
178 GQuark                  gst_flow_to_quark       (GstFlowReturn ret);
179
180 /**
181  * GstPadLinkCheck:
182  * @GST_PAD_LINK_CHECK_NOTHING: Don't check hierarchy or caps compatibility.
183  * @GST_PAD_LINK_CHECK_HIERARCHY: Check the pads have same parents/grandparents.
184  *   Could be omitted if it is already known that the two elements that own the
185  *   pads are in the same bin. 
186  * @GST_PAD_LINK_CHECK_TEMPLATE_CAPS: Check if the pads are compatible by using
187  *   their template caps. This is much faster than @GST_PAD_LINK_CHECK_CAPS, but
188  *   would be unsafe e.g. if one pad has %GST_CAPS_ANY.
189  * @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the
190  *   caps returned by gst_pad_get_caps().
191  *
192  * The amount of checking to be done when linking pads. @GST_PAD_LINK_CHECK_CAPS
193  * and @GST_PAD_LINK_CHECK_TEMPLATE_CAPS are mutually exclusive. If both are
194  * specified, expensive but safe @GST_PAD_LINK_CHECK_CAPS are performed.
195  *
196  * <warning><para>
197  * Only disable some of the checks if you are 100% certain you know the link
198  * will not fail because of hierarchy/caps compatibility failures. If uncertain,
199  * use the default checks (%GST_PAD_LINK_CHECK_DEFAULT) or the regular methods
200  * for linking the pads.
201  * </para></warning>
202  *
203  * Since: 0.10.30
204  */
205
206 typedef enum {
207   GST_PAD_LINK_CHECK_NOTHING       = 0,
208   GST_PAD_LINK_CHECK_HIERARCHY     = 1 << 0,
209   GST_PAD_LINK_CHECK_TEMPLATE_CAPS = 1 << 1,
210   GST_PAD_LINK_CHECK_CAPS          = 1 << 2
211 } GstPadLinkCheck;
212
213 /**
214  * GST_PAD_LINK_CHECK_DEFAULT:
215  *
216  * The default checks done when linking pads (i.e. the ones used by 
217  * gst_pad_link()).
218  *
219  * Since: 0.10.30
220  */
221 #define GST_PAD_LINK_CHECK_DEFAULT (GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS)
222
223 /**
224  * GstActivateMode:
225  * @GST_ACTIVATE_NONE:           Pad will not handle dataflow
226  * @GST_ACTIVATE_PUSH:           Pad handles dataflow in downstream push mode
227  * @GST_ACTIVATE_PULL:           Pad handles dataflow in upstream pull mode
228  *
229  * The status of a GstPad. After activating a pad, which usually happens when the
230  * parent element goes from READY to PAUSED, the GstActivateMode defines if the
231  * pad operates in push or pull mode.
232  */
233 typedef enum {
234   GST_ACTIVATE_NONE,
235   GST_ACTIVATE_PUSH,
236   GST_ACTIVATE_PULL
237 } GstActivateMode;
238
239 /**
240  * GST_PAD_MODE_ACTIVATE:
241  * @mode: a #GstActivateMode
242  *
243  * Macro to test if the given #GstActivateMode value indicates that datapassing
244  * is possible or not.
245  */
246 #define GST_PAD_MODE_ACTIVATE(mode) ((mode) != GST_ACTIVATE_NONE)
247
248 /* pad states */
249 /**
250  * GstPadActivateFunction:
251  * @pad: a #GstPad
252  *
253  * This function is called when the pad is activated during the element
254  * READY to PAUSED state change. By default this function will call the
255  * activate function that puts the pad in push mode but elements can
256  * override this function to activate the pad in pull mode if they wish.
257  *
258  * Returns: TRUE if the pad could be activated.
259  */
260 typedef gboolean                (*GstPadActivateFunction)       (GstPad *pad);
261 /**
262  * GstPadActivateModeFunction:
263  * @pad: a #GstPad
264  * @active: activate or deactivate the pad.
265  *
266  * The prototype of the push and pull activate functions.
267  *
268  * Returns: TRUE if the pad could be activated or deactivated.
269  */
270 typedef gboolean                (*GstPadActivateModeFunction)   (GstPad *pad, gboolean active);
271
272
273 /* data passing */
274 /**
275  * GstPadChainFunction:
276  * @pad: the sink #GstPad that performed the chain.
277  * @buffer: the #GstBuffer that is chained, not %NULL.
278  *
279  * A function that will be called on sinkpads when chaining buffers.
280  * The function typically processes the data contained in the buffer and
281  * either consumes the data or passes it on to the internally linked pad(s).
282  *
283  * The implementer of this function receives a refcount to @buffer and should
284  * gst_buffer_unref() when the buffer is no longer needed.
285  *
286  * When a chain function detects an error in the data stream, it must post an
287  * error on the bus and return an appropriate #GstFlowReturn value.
288  *
289  * Returns: #GST_FLOW_OK for success
290  */
291 typedef GstFlowReturn           (*GstPadChainFunction)          (GstPad *pad, GstBuffer *buffer);
292
293 /**
294  * GstPadChainListFunction:
295  * @pad: the sink #GstPad that performed the chain.
296  * @list: the #GstBufferList that is chained, not %NULL.
297  *
298  * A function that will be called on sinkpads when chaining buffer lists.
299  * The function typically processes the data contained in the buffer list and
300  * either consumes the data or passes it on to the internally linked pad(s).
301  *
302  * The implementer of this function receives a refcount to @list and
303  * should gst_buffer_list_unref() when the list is no longer needed.
304  *
305  * When a chainlist function detects an error in the data stream, it must
306  * post an error on the bus and return an appropriate #GstFlowReturn value.
307  *
308  * Returns: #GST_FLOW_OK for success
309  */
310 typedef GstFlowReturn           (*GstPadChainListFunction)      (GstPad *pad, GstBufferList *list);
311
312 /**
313  * GstPadGetRangeFunction:
314  * @pad: the src #GstPad to perform the getrange on.
315  * @offset: the offset of the range
316  * @length: the length of the range
317  * @buffer: a memory location to hold the result buffer, cannot be NULL.
318  *
319  * This function will be called on source pads when a peer element
320  * request a buffer at the specified @offset and @length. If this function
321  * returns #GST_FLOW_OK, the result buffer will be stored in @buffer. The
322  * contents of @buffer is invalid for any other return value.
323  *
324  * This function is installed on a source pad with
325  * gst_pad_set_getrange_function() and can only be called on source pads after
326  * they are successfully activated with gst_pad_activate_pull().
327  *
328  * @offset and @length are always given in byte units. @offset must normally be a value
329  * between 0 and the length in bytes of the data available on @pad. The
330  * length (duration in bytes) can be retrieved with a #GST_QUERY_DURATION or with a
331  * #GST_QUERY_SEEKING.
332  *
333  * Any @offset larger or equal than the length will make the function return
334  * #GST_FLOW_UNEXPECTED, which corresponds to EOS. In this case @buffer does not
335  * contain a valid buffer.
336  *
337  * The buffer size of @buffer will only be smaller than @length when @offset is
338  * near the end of the stream. In all other cases, the size of @buffer must be
339  * exactly the requested size.
340  *
341  * It is allowed to call this function with a 0 @length and valid @offset, in
342  * which case @buffer will contain a 0-sized buffer and the function returns
343  * #GST_FLOW_OK.
344  *
345  * When this function is called with a -1 @offset, the sequentially next buffer
346  * of length @length in the stream is returned.
347  *
348  * When this function is called with a -1 @length, a buffer with a default
349  * optimal length is returned in @buffer. The length might depend on the value
350  * of @offset.
351  *
352  * Returns: #GST_FLOW_OK for success and a valid buffer in @buffer. Any other
353  * return value leaves @buffer undefined.
354  */
355 typedef GstFlowReturn           (*GstPadGetRangeFunction)       (GstPad *pad, guint64 offset,
356                                                                  guint length, GstBuffer **buffer);
357
358 /**
359  * GstPadEventFunction:
360  * @pad: the #GstPad to handle the event.
361  * @event: the #GstEvent to handle.
362  *
363  * Function signature to handle an event for the pad.
364  *
365  * Returns: TRUE if the pad could handle the event.
366  */
367 typedef gboolean                (*GstPadEventFunction)          (GstPad *pad, GstEvent *event);
368
369
370 /* FIXME: 0.11: deprecate me, check range should use seeking query */
371 /**
372  * GstPadCheckGetRangeFunction:
373  * @pad: a #GstPad
374  *
375  * Check if @pad can be activated in pull mode.
376  *
377  * This function will be deprecated after 0.10; use the seeking query to check
378  * if a pad can support random access.
379  *
380  * Returns: TRUE if the pad can operate in pull mode.
381  */
382 typedef gboolean                (*GstPadCheckGetRangeFunction)  (GstPad *pad);
383
384 /* internal links */
385 /**
386  * GstPadIntLinkFunction:
387  * @pad: The #GstPad to query.
388  *
389  * The signature of the internal pad link function.
390  *
391  * Returns: (element-type Gst.Pad) (transfer container): a newly allocated #GList of pads that are linked to the given pad on
392  * the inside of the parent element.
393  *
394  * The caller must call g_list_free() on it after use.
395  *
396  * Deprecated: use the threadsafe #GstPadIterIntLinkFunction instead.
397  */
398 typedef GList*                  (*GstPadIntLinkFunction)        (GstPad *pad);
399
400 /**
401  * GstPadIterIntLinkFunction:
402  * @pad: The #GstPad to query.
403  *
404  * The signature of the internal pad link iterator function.
405  *
406  * Returns: a new #GstIterator that will iterate over all pads that are
407  * linked to the given pad on the inside of the parent element.
408  *
409  * the caller must call gst_iterator_free() after usage.
410  *
411  * Since 0.10.21
412  */
413 typedef GstIterator*           (*GstPadIterIntLinkFunction)    (GstPad *pad);
414
415 /* generic query function */
416 /**
417  * GstPadQueryTypeFunction:
418  * @pad: a #GstPad to query
419  *
420  * The signature of the query types function.
421  *
422  * Returns: a constant array of query types
423  */
424 typedef const GstQueryType*     (*GstPadQueryTypeFunction)      (GstPad *pad);
425
426 /**
427  * GstPadQueryFunction:
428  * @pad: the #GstPad to query.
429  * @query: the #GstQuery object to execute
430  *
431  * The signature of the query function.
432  *
433  * Returns: TRUE if the query could be performed.
434  */
435 typedef gboolean                (*GstPadQueryFunction)          (GstPad *pad, GstQuery *query);
436
437
438 /* linking */
439 /**
440  * GstPadLinkFunction
441  * @pad: the #GstPad that is linked.
442  * @peer: the peer #GstPad of the link
443  *
444  * Function signature to handle a new link on the pad.
445  *
446  * Returns: the result of the link with the specified peer.
447  */
448 typedef GstPadLinkReturn        (*GstPadLinkFunction)           (GstPad *pad, GstPad *peer);
449 /**
450  * GstPadUnlinkFunction
451  * @pad: the #GstPad that is linked.
452  *
453  * Function signature to handle a unlinking the pad prom its peer.
454  */
455 typedef void                    (*GstPadUnlinkFunction)         (GstPad *pad);
456
457
458 /* caps nego */
459 /**
460  * GstPadGetCapsFunction:
461  * @pad: the #GstPad to get the capabilities of.
462  *
463  * Returns a copy of the capabilities of the specified pad. By default this
464  * function will return the pad template capabilities, but can optionally
465  * be overridden by elements.
466  *
467  * Returns: a newly allocated copy #GstCaps of the pad.
468  */
469 typedef GstCaps*                (*GstPadGetCapsFunction)        (GstPad *pad);
470
471 /**
472  * GstPadSetCapsFunction:
473  * @pad: the #GstPad to set the capabilities of.
474  * @caps: the #GstCaps to set
475  *
476  * Set @caps on @pad. By default this function updates the caps of the
477  * pad but the function can be overriden by elements to perform extra
478  * actions or verifications.
479  *
480  * Returns: TRUE if the caps could be set on the pad.
481  */
482 typedef gboolean                (*GstPadSetCapsFunction)        (GstPad *pad, GstCaps *caps);
483 /**
484  * GstPadAcceptCapsFunction:
485  * @pad: the #GstPad to check
486  * @caps: the #GstCaps to check
487  *
488  * Check if @pad can accept @caps. By default this function will see if @caps
489  * intersect with the result from gst_pad_get_caps() by can be overridden to
490  * perform extra checks.
491  *
492  * Returns: TRUE if the caps can be accepted by the pad.
493  */
494 typedef gboolean                (*GstPadAcceptCapsFunction)     (GstPad *pad, GstCaps *caps);
495 /**
496  * GstPadFixateCapsFunction:
497  * @pad: a #GstPad
498  * @caps: the #GstCaps to fixate
499  *
500  * Given possibly unfixed caps @caps, let @pad use its default prefered
501  * format to make a fixed caps. @caps should be writable. By default this
502  * function will pick the first value of any ranges or lists in the caps but
503  * elements can override this function to perform other behaviour.
504  */
505 typedef void                    (*GstPadFixateCapsFunction)     (GstPad *pad, GstCaps *caps);
506 /**
507  * GstPadBufferAllocFunction:
508  * @pad: a sink #GstPad
509  * @offset: the desired offset of the buffer
510  * @size: the desired size of the buffer
511  * @caps: the desired caps of the buffer
512  * @buf: pointer to hold the allocated buffer.
513  *
514  * Ask the sinkpad @pad to allocate a buffer with @offset, @size and @caps.
515  * The result will be stored in @buf.
516  *
517  * The purpose of this function is to allocate a buffer that is optimal to
518  * be processed by @pad. The function is mostly overridden by elements that can
519  * provide a hardware buffer in order to avoid additional memcpy operations.
520  *
521  * The function can return a buffer that has caps different from the requested
522  * @caps, in which case the upstream element requests a format change to this
523  * new caps.
524  * If a format change was requested, the returned buffer will be one to hold
525  * the data of said new caps, so its size might be different from the requested
526  * @size.
527  *
528  * When this function returns anything else than #GST_FLOW_OK, the buffer allocation
529  * failed and @buf does not contain valid data. If the function returns #GST_FLOW_OK and
530  * the @buf is NULL, a #GstBuffer will be created with @caps, @offset and @size.
531  *
532  * By default this function returns a new buffer of @size and with @caps containing
533  * purely malloced data. The buffer should be freed with gst_buffer_unref()
534  * after usage.
535  *
536  * Returns: #GST_FLOW_OK if @buf contains a valid buffer, any other return
537  *  value means @buf does not hold a valid buffer.
538  */
539 typedef GstFlowReturn           (*GstPadBufferAllocFunction)    (GstPad *pad, guint64 offset, guint size,
540                                                                  GstCaps *caps, GstBuffer **buf);
541
542 /* misc */
543 /**
544  * GstPadDispatcherFunction:
545  * @pad: the #GstPad that is dispatched.
546  * @data: the gpointer to optional user data.
547  *
548  * A dispatcher function is called for all internally linked pads, see
549  * gst_pad_dispatcher().
550  *
551  * Returns: TRUE if the dispatching procedure has to be stopped.
552  */
553 typedef gboolean                (*GstPadDispatcherFunction)     (GstPad *pad, gpointer data);
554
555 /**
556  * GstPadBlockCallback:
557  * @pad: the #GstPad that is blockend or unblocked.
558  * @blocked: blocking state for the pad
559  * @user_data: the gpointer to optional user data.
560  *
561  * Callback used by gst_pad_set_blocked_async(). Gets called when the blocking
562  * operation succeeds.
563  */
564 typedef void                    (*GstPadBlockCallback)          (GstPad *pad, gboolean blocked, gpointer user_data);
565
566 /**
567  * GstPadDirection:
568  * @GST_PAD_UNKNOWN: direction is unknown.
569  * @GST_PAD_SRC: the pad is a source pad.
570  * @GST_PAD_SINK: the pad is a sink pad.
571  *
572  * The direction of a pad.
573  */
574 typedef enum {
575   GST_PAD_UNKNOWN,
576   GST_PAD_SRC,
577   GST_PAD_SINK
578 } GstPadDirection;
579
580 /**
581  * GstPadFlags:
582  * @GST_PAD_BLOCKED: is dataflow on a pad blocked
583  * @GST_PAD_FLUSHING: is pad refusing buffers
584  * @GST_PAD_IN_GETCAPS: GstPadGetCapsFunction() is running now
585  * @GST_PAD_IN_SETCAPS: GstPadSetCapsFunction() is running now
586  * @GST_PAD_BLOCKING: is pad currently blocking on a buffer or event
587  * @GST_PAD_FLAG_LAST: offset to define more flags
588  *
589  * Pad state flags
590  */
591 typedef enum {
592   GST_PAD_BLOCKED       = (GST_OBJECT_FLAG_LAST << 0),
593   GST_PAD_FLUSHING      = (GST_OBJECT_FLAG_LAST << 1),
594   GST_PAD_IN_GETCAPS    = (GST_OBJECT_FLAG_LAST << 2),
595   GST_PAD_IN_SETCAPS    = (GST_OBJECT_FLAG_LAST << 3),
596   GST_PAD_BLOCKING      = (GST_OBJECT_FLAG_LAST << 4),
597   /* padding */
598   GST_PAD_FLAG_LAST     = (GST_OBJECT_FLAG_LAST << 8)
599 } GstPadFlags;
600
601 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
602 typedef struct _GstPadTemplate GstPadTemplate;
603
604 /**
605  * GstPad:
606  * @element_private: private data owned by the parent element
607  * @padtemplate: padtemplate for this pad
608  * @direction: the direction of the pad, cannot change after creating
609  *             the pad.
610  * @stream_rec_lock: recursive stream lock of the pad, used to protect
611  *                   the data used in streaming.
612  * @task: task for this pad if the pad is actively driving dataflow.
613  * @preroll_lock: lock used when prerolling
614  * @preroll_cond: conf to signal preroll
615  * @block_cond: conditional to signal pad block
616  * @block_callback: callback for the pad block if any
617  * @block_data: user data for @block_callback
618  * @caps: the current caps of the pad
619  * @getcapsfunc: function to get caps of the pad
620  * @setcapsfunc: function to set caps on the pad
621  * @acceptcapsfunc: function to check if pad can accept caps
622  * @fixatecapsfunc: function to fixate caps
623  * @activatefunc: pad activation function
624  * @activatepushfunc: function to activate/deactivate pad in push mode
625  * @activatepullfunc: function to activate/deactivate pad in pull mode
626  * @linkfunc: function called when pad is linked
627  * @unlinkfunc: function called when pad is unlinked
628  * @peer: the pad this pad is linked to
629  * @sched_private: private storage for the scheduler
630  * @chainfunc: function to chain buffer to pad
631  * @checkgetrangefunc: function to check if pad can operate in pull mode
632  * @getrangefunc: function to get a range of data from a pad
633  * @eventfunc: function to send an event to a pad
634  * @mode: current activation mode of the pad
635  * @querytypefunc: get list of supported queries
636  * @queryfunc: perform a query on the pad
637  * @intlinkfunc: get the internal links of this pad
638  * @bufferallocfunc: function to allocate a buffer for this pad
639  * @do_buffer_signals: counter counting installed buffer signals
640  * @do_event_signals: counter counting installed event signals
641  * @iterintlinkfunc: get the internal links iterator of this pad
642  * @block_destroy_data: notify function for gst_pad_set_blocked_async_full()
643  *
644  * The #GstPad structure. Use the functions to update the variables.
645  */
646 struct _GstPad {
647   GstObject                     object;
648
649   /*< public >*/
650   gpointer                      element_private;
651
652   GstPadTemplate                *padtemplate;
653
654   GstPadDirection                direction;
655
656   /*< public >*/ /* with STREAM_LOCK */
657   /* streaming rec_lock */
658   GStaticRecMutex               *stream_rec_lock;
659   GstTask                       *task;
660   /*< public >*/ /* with PREROLL_LOCK */
661   GMutex                        *preroll_lock;
662   GCond                         *preroll_cond;
663
664   /*< public >*/ /* with LOCK */
665   /* block cond, mutex is from the object */
666   GCond                         *block_cond;
667   GstPadBlockCallback            block_callback;
668   gpointer                       block_data;
669
670   /* the pad capabilities */
671   GstCaps                       *caps;
672   GstPadGetCapsFunction         getcapsfunc;
673   GstPadSetCapsFunction         setcapsfunc;
674   GstPadAcceptCapsFunction       acceptcapsfunc;
675   GstPadFixateCapsFunction       fixatecapsfunc;
676
677   GstPadActivateFunction         activatefunc;
678   GstPadActivateModeFunction     activatepushfunc;
679   GstPadActivateModeFunction     activatepullfunc;
680
681   /* pad link */
682   GstPadLinkFunction             linkfunc;
683   GstPadUnlinkFunction           unlinkfunc;
684   GstPad                        *peer;
685
686   gpointer                       sched_private;
687
688   /* data transport functions */
689   GstPadChainFunction            chainfunc;
690   GstPadCheckGetRangeFunction    checkgetrangefunc;
691   GstPadGetRangeFunction         getrangefunc;
692   GstPadEventFunction            eventfunc;
693
694   GstActivateMode                mode;
695
696   /* generic query method */
697   GstPadQueryTypeFunction        querytypefunc;
698   GstPadQueryFunction            queryfunc;
699
700   /* internal links */
701   GstPadIntLinkFunction          intlinkfunc;
702
703   GstPadBufferAllocFunction      bufferallocfunc;
704
705   /* whether to emit signals for have-data. counts number
706    * of handlers attached. */
707   gint                           do_buffer_signals;
708   gint                           do_event_signals;
709
710   /* ABI added */
711   /* iterate internal links */
712   GstPadIterIntLinkFunction     iterintlinkfunc;
713
714   /* free block_data */
715   GDestroyNotify block_destroy_data;
716
717   /*< private >*/
718   union {
719     struct {
720       gboolean                      block_callback_called;
721       GstPadPrivate                *priv;
722     } ABI;
723     gpointer _gst_reserved[GST_PADDING - 2];
724   } abidata;
725 };
726
727 struct _GstPadClass {
728   GstObjectClass        parent_class;
729
730   /* signal callbacks */
731   void          (*linked)               (GstPad *pad, GstPad *peer);
732   void          (*unlinked)             (GstPad *pad, GstPad *peer);
733   void          (*request_link)         (GstPad *pad);
734   gboolean      (*have_data)            (GstPad *pad, GstMiniObject *data);
735
736   /*< private >*/
737   gpointer _gst_reserved[GST_PADDING];
738 };
739
740
741 /***** helper macros *****/
742 /* GstPad */
743 #define GST_PAD_NAME(pad)               (GST_OBJECT_NAME(pad))
744 #define GST_PAD_PARENT(pad)             (GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad)))
745 #define GST_PAD_ELEMENT_PRIVATE(pad)    (GST_PAD_CAST(pad)->element_private)
746 #define GST_PAD_PAD_TEMPLATE(pad)       (GST_PAD_CAST(pad)->padtemplate)
747 #define GST_PAD_DIRECTION(pad)          (GST_PAD_CAST(pad)->direction)
748 #define GST_PAD_TASK(pad)               (GST_PAD_CAST(pad)->task)
749 #define GST_PAD_ACTIVATE_MODE(pad)      (GST_PAD_CAST(pad)->mode)
750
751 #define GST_PAD_ACTIVATEFUNC(pad)       (GST_PAD_CAST(pad)->activatefunc)
752 #define GST_PAD_ACTIVATEPUSHFUNC(pad)   (GST_PAD_CAST(pad)->activatepushfunc)
753 #define GST_PAD_ACTIVATEPULLFUNC(pad)   (GST_PAD_CAST(pad)->activatepullfunc)
754 #define GST_PAD_CHAINFUNC(pad)          (GST_PAD_CAST(pad)->chainfunc)
755 #define GST_PAD_CHECKGETRANGEFUNC(pad)  (GST_PAD_CAST(pad)->checkgetrangefunc)
756 #define GST_PAD_GETRANGEFUNC(pad)       (GST_PAD_CAST(pad)->getrangefunc)
757 #define GST_PAD_EVENTFUNC(pad)          (GST_PAD_CAST(pad)->eventfunc)
758 #define GST_PAD_QUERYTYPEFUNC(pad)      (GST_PAD_CAST(pad)->querytypefunc)
759 #define GST_PAD_QUERYFUNC(pad)          (GST_PAD_CAST(pad)->queryfunc)
760 #ifndef GST_DISABLE_DEPRECATED
761 #define GST_PAD_INTLINKFUNC(pad)        (GST_PAD_CAST(pad)->intlinkfunc)
762 #endif
763 #define GST_PAD_ITERINTLINKFUNC(pad)    (GST_PAD_CAST(pad)->iterintlinkfunc)
764
765 #define GST_PAD_PEER(pad)               (GST_PAD_CAST(pad)->peer)
766 #define GST_PAD_LINKFUNC(pad)           (GST_PAD_CAST(pad)->linkfunc)
767 #define GST_PAD_UNLINKFUNC(pad)         (GST_PAD_CAST(pad)->unlinkfunc)
768
769 /**
770  * GST_PAD_CAPS:
771  * @pad: a #GstPad.
772  *
773  * The caps for this pad.
774  */
775 #define GST_PAD_CAPS(pad)               (GST_PAD_CAST(pad)->caps)
776 #define GST_PAD_GETCAPSFUNC(pad)        (GST_PAD_CAST(pad)->getcapsfunc)
777 #define GST_PAD_SETCAPSFUNC(pad)        (GST_PAD_CAST(pad)->setcapsfunc)
778 #define GST_PAD_ACCEPTCAPSFUNC(pad)     (GST_PAD_CAST(pad)->acceptcapsfunc)
779 #define GST_PAD_FIXATECAPSFUNC(pad)     (GST_PAD_CAST(pad)->fixatecapsfunc)
780
781 #define GST_PAD_BUFFERALLOCFUNC(pad)    (GST_PAD_CAST(pad)->bufferallocfunc)
782
783 #define GST_PAD_DO_BUFFER_SIGNALS(pad)  (GST_PAD_CAST(pad)->do_buffer_signals)
784 #define GST_PAD_DO_EVENT_SIGNALS(pad)   (GST_PAD_CAST(pad)->do_event_signals)
785
786 #define GST_PAD_IS_LINKED(pad)          (GST_PAD_PEER(pad) != NULL)
787 #define GST_PAD_IS_BLOCKED(pad)         (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED))
788 #define GST_PAD_IS_BLOCKING(pad)        (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKING))
789 #define GST_PAD_IS_FLUSHING(pad)        (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLUSHING))
790 #define GST_PAD_IS_IN_GETCAPS(pad)      (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_GETCAPS))
791 #define GST_PAD_IS_IN_SETCAPS(pad)      (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_SETCAPS))
792 #define GST_PAD_IS_SRC(pad)             (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
793 #define GST_PAD_IS_SINK(pad)            (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
794
795 #define GST_PAD_SET_FLUSHING(pad)       (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLUSHING))
796 #define GST_PAD_UNSET_FLUSHING(pad)     (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLUSHING))
797
798 /**
799  * GST_PAD_GET_STREAM_LOCK:
800  * @pad: a #GstPad
801  *
802  * Get the stream lock of @pad. The stream lock is protecting the
803  * resources used in the data processing functions of @pad.
804  */
805 #define GST_PAD_GET_STREAM_LOCK(pad)    (GST_PAD_CAST(pad)->stream_rec_lock)
806 /**
807  * GST_PAD_STREAM_LOCK:
808  * @pad: a #GstPad
809  *
810  * Lock the stream lock of @pad.
811  */
812 #define GST_PAD_STREAM_LOCK(pad)        (g_static_rec_mutex_lock(GST_PAD_GET_STREAM_LOCK(pad)))
813 /**
814  * GST_PAD_STREAM_LOCK_FULL:
815  * @pad: a #GstPad
816  * @t: the number of times to recursively lock
817  *
818  * Lock the stream lock of @pad @t times.
819  */
820 #define GST_PAD_STREAM_LOCK_FULL(pad,t) (g_static_rec_mutex_lock_full(GST_PAD_GET_STREAM_LOCK(pad), t))
821 /**
822  * GST_PAD_STREAM_TRYLOCK:
823  * @pad: a #GstPad
824  *
825  * Try to Lock the stream lock of the pad, return TRUE if the lock could be
826  * taken.
827  */
828 #define GST_PAD_STREAM_TRYLOCK(pad)     (g_static_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad)))
829 /**
830  * GST_PAD_STREAM_UNLOCK:
831  * @pad: a #GstPad
832  *
833  * Unlock the stream lock of @pad.
834  */
835 #define GST_PAD_STREAM_UNLOCK(pad)      (g_static_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad)))
836 /**
837  * GST_PAD_STREAM_UNLOCK_FULL:
838  * @pad: a #GstPad
839  *
840  * Fully unlock the recursive stream lock of @pad, return the number of times
841  * @pad was locked.
842  */
843 #define GST_PAD_STREAM_UNLOCK_FULL(pad) (g_static_rec_mutex_unlock_full(GST_PAD_GET_STREAM_LOCK(pad)))
844
845 #define GST_PAD_GET_PREROLL_LOCK(pad)   (GST_PAD_CAST(pad)->preroll_lock)
846 #define GST_PAD_PREROLL_LOCK(pad)       (g_mutex_lock(GST_PAD_GET_PREROLL_LOCK(pad)))
847 #define GST_PAD_PREROLL_TRYLOCK(pad)    (g_mutex_trylock(GST_PAD_GET_PREROLL_LOCK(pad)))
848 #define GST_PAD_PREROLL_UNLOCK(pad)     (g_mutex_unlock(GST_PAD_GET_PREROLL_LOCK(pad)))
849
850 #define GST_PAD_GET_PREROLL_COND(pad)   (GST_PAD_CAST(pad)->preroll_cond)
851 #define GST_PAD_PREROLL_WAIT(pad)       \
852     g_cond_wait (GST_PAD_GET_PREROLL_COND (pad), GST_PAD_GET_PREROLL_LOCK (pad))
853 #define GST_PAD_PREROLL_TIMED_WAIT(pad, timeval) \
854     g_cond_timed_wait (GST_PAD_GET_PREROLL_COND (pad), GST_PAD_GET_PREROLL_LOCK (pad), timeval)
855 #define GST_PAD_PREROLL_SIGNAL(pad)     g_cond_signal (GST_PAD_GET_PREROLL_COND (pad));
856 #define GST_PAD_PREROLL_BROADCAST(pad)  g_cond_broadcast (GST_PAD_GET_PREROLL_COND (pad));
857
858 #define GST_PAD_BLOCK_GET_COND(pad)     (GST_PAD_CAST(pad)->block_cond)
859 #define GST_PAD_BLOCK_WAIT(pad)         (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_OBJECT_GET_LOCK (pad)))
860 #define GST_PAD_BLOCK_SIGNAL(pad)       (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad)))
861 #define GST_PAD_BLOCK_BROADCAST(pad)    (g_cond_broadcast(GST_PAD_BLOCK_GET_COND (pad)))
862
863 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
864 #include <gst/gstpadtemplate.h>
865
866 GType                   gst_pad_get_type                        (void);
867
868 /* creating pads */
869 GstPad*                 gst_pad_new                             (const gchar *name, GstPadDirection direction);
870 GstPad*                 gst_pad_new_from_template               (GstPadTemplate *templ, const gchar *name);
871 GstPad*                 gst_pad_new_from_static_template        (GstStaticPadTemplate *templ, const gchar *name);
872
873
874 /**
875  * gst_pad_get_name:
876  * @pad: the pad to get the name from
877  *
878  * Get a copy of the name of the pad. g_free() after usage.
879  *
880  * MT safe.
881  */
882 #define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))
883 /**
884  * gst_pad_get_parent:
885  * @pad: the pad to get the parent of
886  *
887  * Get the parent of @pad. This function increases the refcount
888  * of the parent object so you should gst_object_unref() it after usage.
889  * Can return NULL if the pad did not have a parent.
890  *
891  * MT safe.
892  */
893 #define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))
894
895 GstPadDirection         gst_pad_get_direction                   (GstPad *pad);
896
897 gboolean                gst_pad_set_active                      (GstPad *pad, gboolean active);
898 gboolean                gst_pad_is_active                       (GstPad *pad);
899 gboolean                gst_pad_activate_pull                   (GstPad *pad, gboolean active);
900 gboolean                gst_pad_activate_push                   (GstPad *pad, gboolean active);
901
902 gboolean                gst_pad_set_blocked                     (GstPad *pad, gboolean blocked);
903 gboolean                gst_pad_set_blocked_async               (GstPad *pad, gboolean blocked,
904                                                                  GstPadBlockCallback callback, gpointer user_data);
905 gboolean                gst_pad_set_blocked_async_full          (GstPad *pad, gboolean blocked,
906                                                                  GstPadBlockCallback callback, gpointer user_data,
907                                                                  GDestroyNotify destroy_data);
908 gboolean                gst_pad_is_blocked                      (GstPad *pad);
909 gboolean                gst_pad_is_blocking                     (GstPad *pad);
910
911 void                    gst_pad_set_element_private             (GstPad *pad, gpointer priv);
912 gpointer                gst_pad_get_element_private             (GstPad *pad);
913
914 GstPadTemplate*         gst_pad_get_pad_template                (GstPad *pad);
915
916 void                    gst_pad_set_bufferalloc_function        (GstPad *pad, GstPadBufferAllocFunction bufalloc);
917 GstFlowReturn           gst_pad_alloc_buffer                    (GstPad *pad, guint64 offset, gint size,
918                                                                  GstCaps *caps, GstBuffer **buf);
919 GstFlowReturn           gst_pad_alloc_buffer_and_set_caps       (GstPad *pad, guint64 offset, gint size,
920                                                                  GstCaps *caps, GstBuffer **buf);
921
922 /* data passing setup functions */
923 void                    gst_pad_set_activate_function           (GstPad *pad, GstPadActivateFunction activate);
924 void                    gst_pad_set_activatepull_function       (GstPad *pad, GstPadActivateModeFunction activatepull);
925 void                    gst_pad_set_activatepush_function       (GstPad *pad, GstPadActivateModeFunction activatepush);
926 void                    gst_pad_set_chain_function              (GstPad *pad, GstPadChainFunction chain);
927 void                    gst_pad_set_chain_list_function (GstPad *pad, GstPadChainListFunction chainlist);
928 void                    gst_pad_set_getrange_function           (GstPad *pad, GstPadGetRangeFunction get);
929 void                    gst_pad_set_checkgetrange_function      (GstPad *pad, GstPadCheckGetRangeFunction check);
930 void                    gst_pad_set_event_function              (GstPad *pad, GstPadEventFunction event);
931
932 /* pad links */
933 void                    gst_pad_set_link_function               (GstPad *pad, GstPadLinkFunction link);
934 void                    gst_pad_set_unlink_function             (GstPad *pad, GstPadUnlinkFunction unlink);
935
936 gboolean                gst_pad_can_link                        (GstPad *srcpad, GstPad *sinkpad);
937 GstPadLinkReturn        gst_pad_link                            (GstPad *srcpad, GstPad *sinkpad);
938 GstPadLinkReturn        gst_pad_link_full                       (GstPad *srcpad, GstPad *sinkpad, GstPadLinkCheck flags);
939 gboolean                gst_pad_unlink                          (GstPad *srcpad, GstPad *sinkpad);
940 gboolean                gst_pad_is_linked                       (GstPad *pad);
941
942 GstPad*                 gst_pad_get_peer                        (GstPad *pad);
943
944 /* capsnego functions */
945 void                    gst_pad_set_getcaps_function            (GstPad *pad, GstPadGetCapsFunction getcaps);
946 void                    gst_pad_set_acceptcaps_function         (GstPad *pad, GstPadAcceptCapsFunction acceptcaps);
947 void                    gst_pad_set_fixatecaps_function         (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
948 void                    gst_pad_set_setcaps_function            (GstPad *pad, GstPadSetCapsFunction setcaps);
949
950 G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps           (GstPad *pad);
951
952 /* capsnego function for linked/unlinked pads */
953 GstCaps *               gst_pad_get_caps_reffed                 (GstPad * pad);
954 GstCaps *               gst_pad_get_caps                        (GstPad * pad);
955 void                    gst_pad_fixate_caps                     (GstPad * pad, GstCaps *caps);
956 gboolean                gst_pad_accept_caps                     (GstPad * pad, GstCaps *caps);
957 gboolean                gst_pad_set_caps                        (GstPad * pad, GstCaps *caps);
958
959 GstCaps *               gst_pad_peer_get_caps_reffed            (GstPad * pad);
960 GstCaps *               gst_pad_peer_get_caps                   (GstPad * pad);
961 gboolean                gst_pad_peer_accept_caps                (GstPad * pad, GstCaps *caps);
962
963 /* capsnego for linked pads */
964 GstCaps *               gst_pad_get_allowed_caps                (GstPad * pad);
965 GstCaps *               gst_pad_get_negotiated_caps             (GstPad * pad);
966
967 /* data passing functions to peer */
968 GstFlowReturn           gst_pad_push                            (GstPad *pad, GstBuffer *buffer);
969 GstFlowReturn           gst_pad_push_list                       (GstPad *pad, GstBufferList *list);
970 gboolean                gst_pad_check_pull_range                (GstPad *pad);
971 GstFlowReturn           gst_pad_pull_range                      (GstPad *pad, guint64 offset, guint size,
972                                                                  GstBuffer **buffer);
973 gboolean                gst_pad_push_event                      (GstPad *pad, GstEvent *event);
974 gboolean                gst_pad_event_default                   (GstPad *pad, GstEvent *event);
975
976 /* data passing functions on pad */
977 GstFlowReturn           gst_pad_chain                           (GstPad *pad, GstBuffer *buffer);
978 GstFlowReturn           gst_pad_chain_list                      (GstPad *pad, GstBufferList *list);
979 GstFlowReturn           gst_pad_get_range                       (GstPad *pad, guint64 offset, guint size,
980                                                                  GstBuffer **buffer);
981 gboolean                gst_pad_send_event                      (GstPad *pad, GstEvent *event);
982
983 /* pad tasks */
984 gboolean                gst_pad_start_task                      (GstPad *pad, GstTaskFunction func,
985                                                                  gpointer data);
986 gboolean                gst_pad_pause_task                      (GstPad *pad);
987 gboolean                gst_pad_stop_task                       (GstPad *pad);
988
989 /* internal links */
990 #ifndef GST_DISABLE_DEPRECATED
991 void                    gst_pad_set_internal_link_function      (GstPad *pad, GstPadIntLinkFunction intlink);
992 GList*                  gst_pad_get_internal_links              (GstPad *pad);
993 GList*                  gst_pad_get_internal_links_default      (GstPad *pad);
994 #endif
995
996 void                    gst_pad_set_iterate_internal_links_function (GstPad * pad,
997                                                                  GstPadIterIntLinkFunction iterintlink);
998 GstIterator *           gst_pad_iterate_internal_links          (GstPad * pad);
999 GstIterator *           gst_pad_iterate_internal_links_default  (GstPad * pad);
1000
1001
1002 /* generic query function */
1003 void                    gst_pad_set_query_type_function         (GstPad *pad, GstPadQueryTypeFunction type_func);
1004 G_CONST_RETURN GstQueryType*
1005                         gst_pad_get_query_types                 (GstPad *pad);
1006 G_CONST_RETURN GstQueryType*
1007                         gst_pad_get_query_types_default         (GstPad *pad);
1008
1009 gboolean                gst_pad_query                           (GstPad *pad, GstQuery *query);
1010 gboolean                gst_pad_peer_query                      (GstPad *pad, GstQuery *query);
1011 void                    gst_pad_set_query_function              (GstPad *pad, GstPadQueryFunction query);
1012 gboolean                gst_pad_query_default                   (GstPad *pad, GstQuery *query);
1013
1014 /* misc helper functions */
1015 gboolean                gst_pad_dispatcher                      (GstPad *pad, GstPadDispatcherFunction dispatch,
1016                                                                  gpointer data);
1017
1018 #if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED)
1019 void                    gst_pad_load_and_link                   (xmlNodePtr self, GstObject *parent);
1020 #endif
1021
1022 G_END_DECLS
1023
1024 #endif /* __GST_PAD_H__ */