fix doc build fix autogen
[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/gstcaps.h>
32 #include <gst/gstevent.h>
33 #include <gst/gstprobe.h>
34 #include <gst/gstquery.h>
35
36
37 G_BEGIN_DECLS
38
39 extern GType _gst_pad_type;
40 extern GType _gst_real_pad_type;
41 extern GType _gst_ghost_pad_type;
42
43 /* 
44  * Pad base class
45  */
46 #define GST_TYPE_PAD                    (_gst_pad_type) 
47 #define GST_IS_PAD(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
48 #define GST_IS_PAD_FAST(obj)            (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD || \
49                                          G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
50 #define GST_IS_PAD_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
51 #define GST_PAD(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
52 #define GST_PAD_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
53
54 /* 
55  * Real Pads
56  */
57 #define GST_TYPE_REAL_PAD               (_gst_real_pad_type)
58 #define GST_IS_REAL_PAD(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REAL_PAD))
59 #define GST_IS_REAL_PAD_FAST(obj)       (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD)
60 #define GST_IS_REAL_PAD_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD))
61 #define GST_REAL_PAD(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad))
62 #define GST_REAL_PAD_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass))
63
64 /* 
65  * Ghost Pads
66  */
67 #define GST_TYPE_GHOST_PAD              (_gst_ghost_pad_type)
68 #define GST_IS_GHOST_PAD(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD))
69 #define GST_IS_GHOST_PAD_FAST(obj)      (G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
70 #define GST_IS_GHOST_PAD_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
71 #define GST_GHOST_PAD(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad))
72 #define GST_GHOST_PAD_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass))
73
74
75 /*typedef struct _GstPad GstPad; */
76 /*typedef struct _GstPadClass GstPadClass;*/
77 typedef struct _GstRealPad GstRealPad;
78 typedef struct _GstRealPadClass GstRealPadClass;
79 typedef struct _GstGhostPad GstGhostPad;
80 typedef struct _GstGhostPadClass GstGhostPadClass;
81 /*typedef struct _GstPadTemplate GstPadTemplate;*/
82 /*typedef struct _GstPadTemplateClass GstPadTemplateClass;*/
83 typedef struct _GstStaticPadTemplate GstStaticPadTemplate;
84 typedef struct _GstPadLink GstPadLink;
85
86 typedef enum {
87   GST_PAD_LINK_REFUSED = -1,
88   GST_PAD_LINK_DELAYED =  0,
89   GST_PAD_LINK_OK      =  1,
90   GST_PAD_LINK_DONE    =  2
91 } GstPadLinkReturn;
92
93 #define GST_PAD_LINK_FAILED(ret) (ret < GST_PAD_LINK_OK)
94 #define GST_PAD_LINK_SUCCESSFUL(ret) (ret >= GST_PAD_LINK_OK)
95
96 /* convenience functions */
97 #ifdef G_HAVE_ISO_VARARGS
98 #define GST_PAD_QUERY_TYPE_FUNCTION(functionname, ...)  GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, __VA_ARGS__);
99 #define GST_PAD_FORMATS_FUNCTION(functionname, ...)     GST_FORMATS_FUNCTION (GstPad *, functionname, __VA_ARGS__);
100 #define GST_PAD_EVENT_MASK_FUNCTION(functionname, ...)  GST_EVENT_MASK_FUNCTION (GstPad *, functionname, __VA_ARGS__);
101 #elif defined(G_HAVE_GNUC_VARARGS)
102 #define GST_PAD_QUERY_TYPE_FUNCTION(functionname, a...) GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, a);
103 #define GST_PAD_FORMATS_FUNCTION(functionname, a...)    GST_FORMATS_FUNCTION (GstPad *, functionname, a);
104 #define GST_PAD_EVENT_MASK_FUNCTION(functionname, a...) GST_EVENT_MASK_FUNCTION (GstPad *, functionname, a);
105 #endif
106
107  
108 /* this defines the functions used to chain buffers
109  * pad is the sink pad (so the same chain function can be used for N pads)
110  * buf is the buffer being passed */
111 typedef void                    (*GstPadChainFunction)          (GstPad *pad,GstData *data);
112 typedef GstData*                (*GstPadGetFunction)            (GstPad *pad);
113 typedef gboolean                (*GstPadEventFunction)          (GstPad *pad, GstEvent *event);
114 typedef gboolean                (*GstPadConvertFunction)        (GstPad *pad, 
115                                                                  GstFormat src_format,  gint64  src_value,
116                                                                  GstFormat *dest_format, gint64 *dest_value);
117 typedef gboolean                (*GstPadQueryFunction)          (GstPad *pad, GstQueryType type,
118                                                                  GstFormat *format, gint64  *value);
119 typedef GList*                  (*GstPadIntLinkFunction)        (GstPad *pad);
120 typedef const GstFormat*        (*GstPadFormatsFunction)        (GstPad *pad);
121 typedef const GstEventMask*     (*GstPadEventMaskFunction)      (GstPad *pad);
122 typedef const GstQueryType*     (*GstPadQueryTypeFunction)      (GstPad *pad);
123
124 typedef GstPadLinkReturn        (*GstPadLinkFunction)           (GstPad *pad, const GstCaps *caps);
125 typedef void                    (*GstPadUnlinkFunction)         (GstPad *pad);
126 typedef GstCaps*                (*GstPadGetCapsFunction)        (GstPad *pad);
127 typedef GstCaps*                (*GstPadFixateFunction)         (GstPad *pad, const GstCaps *caps);
128 typedef GstBuffer*              (*GstPadBufferAllocFunction)    (GstPad *pad, guint64 offset, guint size);
129
130 typedef gboolean                (*GstPadDispatcherFunction)     (GstPad *pad, gpointer data);
131
132 typedef enum {
133   GST_PAD_UNKNOWN,
134   GST_PAD_SRC,
135   GST_PAD_SINK
136 } GstPadDirection;
137
138 typedef enum {
139   GST_PAD_DISABLED              = GST_OBJECT_FLAG_LAST,
140   GST_PAD_NEGOTIATING,
141
142   GST_PAD_FLAG_LAST             = GST_OBJECT_FLAG_LAST + 4
143 } GstPadFlags;
144
145 struct _GstPad {
146   GstObject             object;
147
148   gpointer              element_private;
149
150   GstPadTemplate        *padtemplate;   /* the template for this pad */
151
152   gpointer _gst_reserved[GST_PADDING];
153 };
154
155 struct _GstPadClass {
156   GstObjectClass parent_class;
157
158   gpointer _gst_reserved[GST_PADDING];
159 };
160
161 struct _GstRealPad {
162   GstPad                         pad;
163
164   /* the pad capabilities */
165   GstCaps                       *caps;
166   GstPadFixateFunction           appfixatefunc;
167   GstCaps                       *appfilter;
168   GstPadGetCapsFunction          getcapsfunc;
169   GstPadFixateFunction           fixatefunc;
170   
171   GstPadDirection                direction;
172
173   GstPadLinkFunction             linkfunc;
174   GstPadUnlinkFunction           unlinkfunc;
175   GstRealPad                    *peer;
176
177   gpointer                       sched_private;
178
179   /* data transport functions */
180   GstPadChainFunction            chainfunc;
181   GstPadChainFunction            chainhandler;
182   GstPadGetFunction              getfunc;
183   GstPadGetFunction              gethandler;
184   GstPadEventFunction            eventfunc;
185   GstPadEventFunction            eventhandler;
186   GstPadEventMaskFunction        eventmaskfunc;
187
188   GList                         *ghostpads;
189
190   /* query/convert/formats functions */
191   GstPadConvertFunction          convertfunc;
192   GstPadQueryFunction            queryfunc;
193   GstPadFormatsFunction          formatsfunc;
194   GstPadQueryTypeFunction        querytypefunc;
195   GstPadIntLinkFunction          intlinkfunc;
196
197   GstPadBufferAllocFunction        bufferallocfunc;
198
199   GstProbeDispatcher             probedisp;
200
201   GstPadLink                    *link;
202   GstCaps                       *explicit_caps;
203
204   gpointer _gst_reserved[GST_PADDING - 2];
205 };
206
207 struct _GstRealPadClass {
208   GstPadClass   parent_class;
209
210   /* signal callbacks */
211   void          (*caps_nego_failed)     (GstPad *pad, GstCaps *caps);
212
213   void          (*linked)               (GstPad *pad, GstPad *peer);
214   void          (*unlinked)             (GstPad *pad, GstPad *peer);
215   GstPadFixateFunction           appfixatefunc;
216
217   gpointer _gst_reserved[GST_PADDING - 1];
218 };
219
220 struct _GstGhostPad {
221   GstPad pad;
222
223   GstRealPad *realpad;
224
225   gpointer _gst_reserved[GST_PADDING];
226 };
227
228 struct _GstGhostPadClass {
229   GstPadClass parent_class;
230
231   gpointer _gst_reserved[GST_PADDING];
232 };
233
234
235 /***** helper macros *****/
236 /* GstPad */
237 #define GST_PAD_NAME(pad)               (GST_OBJECT_NAME(pad))
238 #define GST_PAD_PARENT(pad)             ((GstElement *)(GST_OBJECT_PARENT(pad)))
239 #define GST_PAD_ELEMENT_PRIVATE(pad)    (((GstPad *)(pad))->element_private)
240 #define GST_PAD_PAD_TEMPLATE(pad)       (((GstPad *)(pad))->padtemplate)
241
242 /* GstRealPad */
243 #define GST_RPAD_DIRECTION(pad)         (((GstRealPad *)(pad))->direction)
244 #define GST_RPAD_CAPS(pad)              (((GstRealPad *)(pad))->caps)
245 #define GST_RPAD_APPFILTER(pad)         (((GstRealPad *)(pad))->appfilter)
246 #define GST_RPAD_PEER(pad)              (((GstRealPad *)(pad))->peer)
247 #define GST_RPAD_CHAINFUNC(pad)         (((GstRealPad *)(pad))->chainfunc)
248 #define GST_RPAD_CHAINHANDLER(pad)      (((GstRealPad *)(pad))->chainhandler)
249 #define GST_RPAD_GETFUNC(pad)           (((GstRealPad *)(pad))->getfunc)
250 #define GST_RPAD_GETHANDLER(pad)        (((GstRealPad *)(pad))->gethandler)
251 #define GST_RPAD_EVENTFUNC(pad)         (((GstRealPad *)(pad))->eventfunc)
252 #define GST_RPAD_EVENTHANDLER(pad)      (((GstRealPad *)(pad))->eventhandler)
253 #define GST_RPAD_CONVERTFUNC(pad)       (((GstRealPad *)(pad))->convertfunc)
254 #define GST_RPAD_QUERYFUNC(pad)         (((GstRealPad *)(pad))->queryfunc)
255 #define GST_RPAD_INTLINKFUNC(pad)       (((GstRealPad *)(pad))->intlinkfunc)
256 #define GST_RPAD_FORMATSFUNC(pad)       (((GstRealPad *)(pad))->formatsfunc)
257 #define GST_RPAD_QUERYTYPEFUNC(pad)     (((GstRealPad *)(pad))->querytypefunc)
258 #define GST_RPAD_EVENTMASKFUNC(pad)     (((GstRealPad *)(pad))->eventmaskfunc)
259
260 #define GST_RPAD_LINKFUNC(pad)          (((GstRealPad *)(pad))->linkfunc)
261 #define GST_RPAD_UNLINKFUNC(pad)        (((GstRealPad *)(pad))->unlinkfunc)
262 #define GST_RPAD_GETCAPSFUNC(pad)       (((GstRealPad *)(pad))->getcapsfunc)
263 #define GST_RPAD_FIXATEFUNC(pad)        (((GstRealPad *)(pad))->fixatefunc)
264 #define GST_RPAD_BUFFERALLOCFUNC(pad)   (((GstRealPad *)(pad))->bufferallocfunc)
265 #define GST_RPAD_LINK(pad)              (((GstRealPad *)(pad))->link)
266 #define GST_RPAD_EXPLICIT_CAPS(pad)     (((GstRealPad *)(pad))->explicit_caps)
267
268 /* GstGhostPad */
269 #define GST_GPAD_REALPAD(pad)           (((GstGhostPad *)(pad))->realpad)
270
271 /* Generic */
272 #define GST_PAD_REALIZE(pad)            (GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad))
273 #define GST_PAD_DIRECTION(pad)          GST_RPAD_DIRECTION(GST_PAD_REALIZE(pad))
274 #define GST_PAD_CAPS(pad)               (gst_pad_get_negotiated_caps(GST_PAD (pad)))
275 #define GST_PAD_PEER(pad)               GST_PAD(GST_RPAD_PEER(GST_PAD_REALIZE(pad)))
276
277 /* Some check functions (unused?) */
278 #define GST_PAD_IS_LINKED(pad)          (GST_PAD_PEER(pad) != NULL)
279 #define GST_PAD_IS_ACTIVE(pad)          (!GST_FLAG_IS_SET(GST_PAD_REALIZE(pad), GST_PAD_DISABLED))
280 #define GST_PAD_IS_USABLE(pad)          (GST_PAD_IS_LINKED (pad) && \
281                                          GST_PAD_IS_ACTIVE(pad) && GST_PAD_IS_ACTIVE(GST_PAD_PEER (pad)))
282 #define GST_PAD_CAN_PULL(pad)           (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->gethandler != NULL)
283 #define GST_PAD_IS_SRC(pad)             (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
284 #define GST_PAD_IS_SINK(pad)            (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
285
286 /***** PadTemplate *****/
287 #define GST_TYPE_PAD_TEMPLATE           (gst_pad_template_get_type ())
288 #define GST_PAD_TEMPLATE(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD_TEMPLATE,GstPadTemplate))
289 #define GST_PAD_TEMPLATE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD_TEMPLATE,GstPadTemplateClass))
290 #define GST_IS_PAD_TEMPLATE(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD_TEMPLATE))
291 #define GST_IS_PAD_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD_TEMPLATE))
292
293 typedef enum {
294   GST_PAD_ALWAYS,
295   GST_PAD_SOMETIMES,
296   GST_PAD_REQUEST
297 } GstPadPresence;
298
299 #define GST_PAD_TEMPLATE_NAME_TEMPLATE(templ)   (((GstPadTemplate *)(templ))->name_template)
300 #define GST_PAD_TEMPLATE_DIRECTION(templ)       (((GstPadTemplate *)(templ))->direction)
301 #define GST_PAD_TEMPLATE_PRESENCE(templ)        (((GstPadTemplate *)(templ))->presence)
302 #define GST_PAD_TEMPLATE_CAPS(templ)            (((GstPadTemplate *)(templ))->caps)
303
304 typedef enum {
305   GST_PAD_TEMPLATE_FIXED        = GST_OBJECT_FLAG_LAST,
306
307   GST_PAD_TEMPLATE_FLAG_LAST    = GST_OBJECT_FLAG_LAST + 4
308 } GstPadTemplateFlags;
309
310 #define GST_PAD_TEMPLATE_IS_FIXED(templ)        (GST_FLAG_IS_SET(templ, GST_PAD_TEMPLATE_FIXED))
311
312 struct _GstPadTemplate {
313   GstObject        object;
314
315   gchar           *name_template;
316   GstPadDirection  direction;
317   GstPadPresence   presence;
318   GstCaps         *caps;
319
320   gpointer _gst_reserved[GST_PADDING];
321 };
322
323 struct _GstPadTemplateClass {
324   GstObjectClass   parent_class;
325
326   /* signal callbacks */
327   void (*pad_created)   (GstPadTemplate *templ, GstPad *pad);
328
329   gpointer _gst_reserved[GST_PADDING];
330 };
331
332 struct _GstStaticPadTemplate {
333   gchar           *name_template;
334   GstPadDirection  direction;
335   GstPadPresence   presence;
336   GstStaticCaps   static_caps;
337 };
338
339 #define GST_STATIC_PAD_TEMPLATE(padname, dir, pres, caps) \
340   { \
341   /* name_template */    padname, \
342   /* direction */        dir, \
343   /* presence */         pres, \
344   /* caps */             caps \
345   }
346
347
348 GType                   gst_pad_get_type                        (void);
349 GType                   gst_real_pad_get_type                   (void);
350 GType                   gst_ghost_pad_get_type                  (void);
351
352 /* creating pads */
353 GstPad*                 gst_pad_new                             (const gchar *name, GstPadDirection direction);
354 GstPad*                 gst_pad_new_from_template               (GstPadTemplate *templ, const gchar *name);
355 GstPad*                 gst_pad_custom_new                      (GType type, const gchar *name, GstPadDirection direction);
356 GstPad*                 gst_pad_custom_new_from_template        (GType type, GstPadTemplate *templ, const gchar *name);
357
358 void                    gst_pad_set_name                        (GstPad *pad, const gchar *name);
359 G_CONST_RETURN gchar*   gst_pad_get_name                        (GstPad *pad);
360
361 GstPadDirection         gst_pad_get_direction                   (GstPad *pad);
362
363 void                    gst_pad_set_active                      (GstPad *pad, gboolean active);
364 gboolean                gst_pad_is_active                       (GstPad *pad);
365
366 void                    gst_pad_set_element_private             (GstPad *pad, gpointer priv);
367 gpointer                gst_pad_get_element_private             (GstPad *pad);
368
369 void                    gst_pad_set_parent                      (GstPad *pad, GstElement *parent);
370 GstElement*             gst_pad_get_parent                      (GstPad *pad);
371 GstElement*             gst_pad_get_real_parent                 (GstPad *pad);
372
373 GstScheduler*           gst_pad_get_scheduler                   (GstPad *pad);
374
375 void                    gst_pad_add_ghost_pad                   (GstPad *pad, GstPad *ghostpad);
376 void                    gst_pad_remove_ghost_pad                (GstPad *pad, GstPad *ghostpad);
377 GList*                  gst_pad_get_ghost_pad_list              (GstPad *pad);
378
379 GstPadTemplate*         gst_pad_get_pad_template                (GstPad *pad);
380
381 void                    gst_pad_set_bufferalloc_function                (GstPad *pad, GstPadBufferAllocFunction bufferalloc);
382 GstBuffer*              gst_pad_alloc_buffer                    (GstPad *pad, guint64 offset, gint size);
383
384 /* data passing setup functions */
385 void                    gst_pad_set_chain_function              (GstPad *pad, GstPadChainFunction chain);
386 void                    gst_pad_set_get_function                (GstPad *pad, GstPadGetFunction get);
387 void                    gst_pad_set_event_function              (GstPad *pad, GstPadEventFunction event);
388 void                    gst_pad_set_event_mask_function         (GstPad *pad, GstPadEventMaskFunction mask_func);
389 G_CONST_RETURN GstEventMask*
390                         gst_pad_get_event_masks                 (GstPad *pad);
391 G_CONST_RETURN GstEventMask*
392                         gst_pad_get_event_masks_default         (GstPad *pad);
393
394 /* pad links */
395 void                    gst_pad_set_link_function               (GstPad *pad, GstPadLinkFunction link);
396 gboolean                gst_pad_can_link                        (GstPad *srcpad, GstPad *sinkpad);
397 gboolean                gst_pad_can_link_filtered               (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
398 void                    gst_pad_set_unlink_function             (GstPad *pad, GstPadUnlinkFunction unlink);
399
400 gboolean                gst_pad_link                            (GstPad *srcpad, GstPad *sinkpad);
401 gboolean                gst_pad_link_filtered                   (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
402 void                    gst_pad_unlink                          (GstPad *srcpad, GstPad *sinkpad);
403 gboolean                gst_pad_is_linked                       (GstPad *pad);
404
405 GstPad*                 gst_pad_get_peer                        (GstPad *pad);
406
407 /* capsnego functions */
408 G_CONST_RETURN GstCaps* gst_pad_get_negotiated_caps             (GstPad *pad);
409 gboolean                gst_pad_is_negotiated                   (GstPad *pad);
410 GstCaps*                gst_pad_get_caps                        (GstPad *pad);
411 G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps           (GstPad *pad);
412 GstPadLinkReturn        gst_pad_try_set_caps                    (GstPad *pad, const GstCaps *caps);
413 gboolean                gst_pad_check_compatibility             (GstPad *srcpad, GstPad *sinkpad);
414
415 void                    gst_pad_set_getcaps_function            (GstPad *pad, GstPadGetCapsFunction getcaps);
416 void                    gst_pad_set_fixate_function             (GstPad *pad, GstPadFixateFunction fixate);
417 GstCaps *               gst_pad_proxy_getcaps                   (GstPad *pad);
418 GstPadLinkReturn        gst_pad_proxy_pad_link                  (GstPad *pad, const GstCaps *caps);
419 GstCaps *               gst_pad_proxy_fixate                    (GstPad *pad, const GstCaps *caps);
420 #ifndef GST_DISABLE_DEPRECATED
421 GstPadLinkReturn        gst_pad_proxy_link                      (GstPad *pad, const GstCaps *caps);
422 #endif
423 gboolean                gst_pad_set_explicit_caps               (GstPad *pad, const GstCaps *caps);
424 void                    gst_pad_use_explicit_caps               (GstPad *pad);
425 gboolean                gst_pad_relink_filtered                 (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
426 #ifndef GST_DISABLE_DEPRECATED
427 gboolean                gst_pad_perform_negotiate               (GstPad *srcpad, GstPad *sinkpad);
428 #endif
429 GstPadLinkReturn        gst_pad_renegotiate                     (GstPad *pad);
430 void                    gst_pad_unnegotiate                     (GstPad *pad);
431 gboolean                gst_pad_try_relink_filtered             (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
432 GstCaps*                gst_pad_get_allowed_caps                (GstPad *pad);
433 void                    gst_pad_caps_change_notify              (GstPad *pad);
434
435 gboolean                gst_pad_recover_caps_error              (GstPad *pad, const GstCaps *allowed);
436
437 /* data passing functions */
438 void                    gst_pad_push                            (GstPad *pad, GstData *data);
439 GstData*                gst_pad_pull                            (GstPad *pad);
440 gboolean                gst_pad_send_event                      (GstPad *pad, GstEvent *event);
441 gboolean                gst_pad_event_default                   (GstPad *pad, GstEvent *event);
442 GstPad*                 gst_pad_selectv                         (GList *padlist);
443 GstPad*                 gst_pad_select                          (GstPad *pad, ...);
444 GstPad*                 gst_pad_select_valist                   (GstPad *pad, va_list varargs);
445
446
447 /* convert/query/format functions */
448 void                    gst_pad_set_formats_function            (GstPad *pad, 
449                                                                  GstPadFormatsFunction formats);
450 G_CONST_RETURN GstFormat*
451                         gst_pad_get_formats                     (GstPad *pad);
452 G_CONST_RETURN GstFormat*
453                         gst_pad_get_formats_default             (GstPad *pad);
454
455 void                    gst_pad_set_convert_function            (GstPad *pad, GstPadConvertFunction convert);
456 gboolean                gst_pad_convert                         (GstPad *pad, 
457                                                                  GstFormat src_format,  gint64  src_value,
458                                                                  GstFormat *dest_format, gint64 *dest_value);
459 gboolean                gst_pad_convert_default                 (GstPad *pad,
460                                                                  GstFormat src_format,  gint64  src_value,
461                                                                  GstFormat *dest_format, gint64 *dest_value);
462
463 void                    gst_pad_set_query_function              (GstPad *pad, GstPadQueryFunction query);
464 void                    gst_pad_set_query_type_function         (GstPad *pad, GstPadQueryTypeFunction type_func);
465 G_CONST_RETURN GstQueryType*
466                         gst_pad_get_query_types                 (GstPad *pad);
467 G_CONST_RETURN GstQueryType*
468                         gst_pad_get_query_types_default         (GstPad *pad);
469 gboolean                gst_pad_query                           (GstPad *pad, GstQueryType type,
470                                                                  GstFormat *format, gint64 *value);
471 gboolean                gst_pad_query_default                   (GstPad *pad, GstQueryType type,
472                                                                  GstFormat *format, gint64 *value);
473
474 void                    gst_pad_set_internal_link_function      (GstPad *pad, GstPadIntLinkFunction intlink);
475 GList*                  gst_pad_get_internal_links              (GstPad *pad);
476 GList*                  gst_pad_get_internal_links_default      (GstPad *pad);
477         
478 /* misc helper functions */
479 gboolean                gst_pad_dispatcher                      (GstPad *pad, GstPadDispatcherFunction dispatch, 
480                                                                  gpointer data);
481
482 #define                 gst_pad_add_probe(pad, probe) \
483                         (gst_probe_dispatcher_add_probe (&(GST_REAL_PAD (pad)->probedisp), probe))
484 #define                 gst_pad_remove_probe(pad, probe) \
485                         (gst_probe_dispatcher_remove_probe (&(GST_REAL_PAD (pad)->probedisp), probe))
486
487 #ifndef GST_DISABLE_LOADSAVE
488 void                    gst_pad_load_and_link                   (xmlNodePtr self, GstObject *parent);
489 #endif
490
491
492 /* ghostpads */
493 GstPad*                 gst_ghost_pad_new                       (const gchar *name, GstPad *pad);
494
495
496 /* templates and factories */
497 GType                   gst_pad_template_get_type               (void);
498
499 GstPadTemplate*         gst_pad_template_new                    (const gchar *name_template,
500                                                                  GstPadDirection direction, GstPadPresence presence,
501                                                                  GstCaps *caps);
502
503 GstPadTemplate *        gst_static_pad_template_get             (GstStaticPadTemplate *templ);
504 const GstCaps*          gst_pad_template_get_caps               (GstPadTemplate *templ);
505 const GstCaps*          gst_pad_template_get_caps_by_name       (GstPadTemplate *templ, const gchar *name);
506
507 #ifndef GST_DISABLE_LOADSAVE
508 xmlNodePtr              gst_ghost_pad_save_thyself              (GstPad *pad,
509                                                                  xmlNodePtr parent);
510 #endif
511
512 G_END_DECLS
513
514
515 #endif /* __GST_PAD_H__ */
516