- some pad.h reorg, better grouping of function
[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
34
35 G_BEGIN_DECLS
36
37 extern GType _gst_pad_type;
38 extern GType _gst_real_pad_type;
39 extern GType _gst_ghost_pad_type;
40
41 #define GST_TYPE_PARANOID 
42
43 /* 
44  * Pad base class
45  */
46 #define GST_TYPE_PAD                    (_gst_pad_type) 
47
48 #define GST_PAD_CAST(obj)               ((GstPad*)(obj))
49 #define GST_PAD_CLASS_CAST(klass)       ((GstPadClass*)(klass))
50 #define GST_IS_PAD(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
51 #define GST_IS_PAD_FAST(obj)            (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD || \
52                                          G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
53 #define GST_IS_PAD_CLASS(obj)           (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
54
55 #ifdef GST_TYPE_PARANOID
56 # define GST_PAD(obj)                   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
57 # define GST_PAD_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
58 #else
59 # define GST_PAD                        GST_PAD_CAST
60 # define GST_PAD_CLASS                  GST_PAD_CLASS_CAST
61 #endif
62
63 /* 
64  * Real Pads
65  */
66 #define GST_TYPE_REAL_PAD               (_gst_real_pad_type)
67
68 #define GST_REAL_PAD_CAST(obj)          ((GstRealPad*)(obj))
69 #define GST_REAL_PAD_CLASS_CAST(klass)  ((GstRealPadClass*)(klass))
70 #define GST_IS_REAL_PAD(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REAL_PAD))
71 #define GST_IS_REAL_PAD_FAST(obj)       (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD)
72 #define GST_IS_REAL_PAD_CLASS(obj)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD))
73
74 #ifdef GST_TYPE_PARANOID
75 # define GST_REAL_PAD(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad))
76 # define GST_REAL_PAD_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass))
77 #else
78 # define GST_REAL_PAD                   GST_REAL_PAD_CAST
79 # define GST_REAL_PAD_CLASS             GST_REAL_PAD_CLASS_CAST
80 #endif
81
82 /* 
83  * Ghost Pads
84  */
85 #define GST_TYPE_GHOST_PAD              (_gst_ghost_pad_type)
86
87 #define GST_GHOST_PAD_CAST(obj)         ((GstGhostPad*)(obj))
88 #define GST_GHOST_PAD_CLASS_CAST(klass) ((GstGhostPadClass*)(klass))
89 #define GST_IS_GHOST_PAD(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD))
90 #define GST_IS_GHOST_PAD_FAST(obj)      (G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
91 #define GST_IS_GHOST_PAD_CLASS(obj)     (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
92
93 #ifdef GST_TYPE_PARANOID
94 # define GST_GHOST_PAD(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad))
95 # define GST_GHOST_PAD_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass))
96 #else
97 # define GST_GHOST_PAD                  GST_GHOST_PAD_CAST
98 # define GST_GHOST_PAD_CLASS            GST_GHOST_PAD_CLASS_CAST
99 #endif
100
101
102 /*typedef struct _GstPad GstPad; */
103 /*typedef struct _GstPadClass GstPadClass;*/
104 typedef struct _GstRealPad GstRealPad;
105 typedef struct _GstRealPadClass GstRealPadClass;
106 typedef struct _GstGhostPad GstGhostPad;
107 typedef struct _GstGhostPadClass GstGhostPadClass;
108 /*typedef struct _GstPadTemplate GstPadTemplate;*/
109 /*typedef struct _GstPadTemplateClass GstPadTemplateClass;*/
110
111
112 typedef enum {
113   GST_PAD_CONNECT_REFUSED = -1,
114   GST_PAD_CONNECT_DELAYED =  0,
115   GST_PAD_CONNECT_OK      =  1,
116   GST_PAD_CONNECT_DONE    =  2
117 } GstPadConnectReturn;
118
119 typedef enum {
120   GST_PAD_QUERY_NONE = 0,
121   GST_PAD_QUERY_TOTAL,
122   GST_PAD_QUERY_POSITION,
123   GST_PAD_QUERY_LATENCY,
124   GST_PAD_QUERY_JITTER,
125   GST_PAD_QUERY_SEGMENT_END
126 } GstPadQueryType;
127  
128 /* this defines the functions used to chain buffers
129  * pad is the sink pad (so the same chain function can be used for N pads)
130  * buf is the buffer being passed */
131 typedef void                    (*GstPadChainFunction)          (GstPad *pad,GstBuffer *buf);
132 typedef GstBuffer*              (*GstPadGetFunction)            (GstPad *pad);
133 typedef gboolean                (*GstPadEventFunction)          (GstPad *pad, GstEvent *event);
134 typedef gboolean                (*GstPadConvertFunction)        (GstPad *pad, 
135                                                                  GstFormat src_format,  gint64  src_value,
136                                                                  GstFormat *dest_format, gint64 *dest_value);
137 typedef gboolean                (*GstPadQueryFunction)          (GstPad *pad, GstPadQueryType type,
138                                                                  GstFormat *format, gint64  *value);
139 typedef GList*                  (*GstPadIntConnFunction)        (GstPad *pad);
140 typedef const GstFormat*        (*GstPadFormatsFunction)        (GstPad *pad);
141 typedef const GstEventMask*     (*GstPadEventMaskFunction)      (GstPad *pad);
142 typedef const GstPadQueryType*  (*GstPadQueryTypeFunction)      (GstPad *pad);
143
144 typedef GstPadConnectReturn     (*GstPadConnectFunction)        (GstPad *pad, GstCaps *caps);
145 typedef GstCaps*                (*GstPadGetCapsFunction)        (GstPad *pad, GstCaps *caps);
146 typedef GstBufferPool*          (*GstPadBufferPoolFunction)     (GstPad *pad);
147
148 typedef gboolean                (*GstPadDispatcherFunction)     (GstPad *pad, gpointer data);
149
150 typedef enum {
151   GST_PAD_UNKNOWN,
152   GST_PAD_SRC,
153   GST_PAD_SINK
154 } GstPadDirection;
155
156 typedef enum {
157   GST_PAD_DISABLED              = GST_OBJECT_FLAG_LAST,
158   GST_PAD_EOS,
159
160   GST_PAD_FLAG_LAST             = GST_OBJECT_FLAG_LAST + 4
161 } GstPadFlags;
162
163 struct _GstPad {
164   GstObject             object;
165
166   gpointer              element_private;
167
168   GstPadTemplate        *padtemplate;   /* the template for this pad */
169 };
170
171 struct _GstPadClass {
172   GstObjectClass parent_class;
173 };
174
175 struct _GstRealPad {
176   GstPad                         pad;
177
178   /* the pad cpabilities */
179   GstCaps                       *caps;
180   GstCaps                       *filter;
181   GstCaps                       *appfilter;
182   GstPadGetCapsFunction          getcapsfunc;
183   
184   GstPadDirection                direction;
185
186   GstScheduler                  *sched;
187   gpointer                       sched_private;
188
189   GstPadConnectFunction          connectfunc;
190   GstRealPad                    *peer;
191
192   GstBuffer                     *bufpen;
193
194   /* data transport functions */
195   GstPadChainFunction            chainfunc;
196   GstPadChainFunction            chainhandler;
197   GstPadGetFunction              getfunc;
198   GstPadGetFunction              gethandler;
199   GstPadEventFunction            eventfunc;
200   GstPadEventFunction            eventhandler;
201   GstPadEventMaskFunction        eventmaskfunc;
202
203   GList                         *ghostpads;
204
205   /* query/convert/formats functions */
206   GstPadConvertFunction          convertfunc;
207   GstPadQueryFunction            queryfunc;
208   GstPadFormatsFunction          formatsfunc;
209   GstPadQueryTypeFunction        querytypefunc;
210   GstPadIntConnFunction          intconnfunc;
211
212   GstPadBufferPoolFunction       bufferpoolfunc;
213 };
214
215 struct _GstRealPadClass {
216   GstPadClass parent_class;
217
218   /* signal callbacks */
219   void (*set_active)            (GstPad *pad, gboolean active);
220   void (*caps_changed)          (GstPad *pad, GstCaps *newcaps);
221   void (*caps_nego_failed)      (GstPad *pad);
222   void (*connected)             (GstPad *pad, GstPad *peer);
223   void (*disconnected)          (GstPad *pad, GstPad *peer);
224   void (*event_received)        (GstPad *pad, GstEvent *event);
225
226   void (*eos)                   (GstPad *pad);
227 };
228
229 struct _GstGhostPad {
230   GstPad pad;
231
232   GstRealPad *realpad;
233 };
234
235 struct _GstGhostPadClass {
236   GstPadClass parent_class;
237 };
238
239
240 /***** helper macros *****/
241 /* GstPad */
242 #define GST_PAD_NAME(pad)               (GST_OBJECT_NAME(pad))
243 #define GST_PAD_PARENT(pad)             ((GstElement *)(GST_OBJECT_PARENT(pad)))
244 #define GST_PAD_ELEMENT_PRIVATE(pad)    (((GstPad *)(pad))->element_private)
245 #define GST_PAD_PAD_TEMPLATE(pad)       (((GstPad *)(pad))->padtemplate)
246
247 /* GstRealPad */
248 #define GST_RPAD_DIRECTION(pad)         (((GstRealPad *)(pad))->direction)
249 #define GST_RPAD_CAPS(pad)              (((GstRealPad *)(pad))->caps)
250 #define GST_RPAD_FILTER(pad)            (((GstRealPad *)(pad))->filter)
251 #define GST_RPAD_APPFILTER(pad)         (((GstRealPad *)(pad))->appfilter)
252 #define GST_RPAD_PEER(pad)              (((GstRealPad *)(pad))->peer)
253 #define GST_RPAD_BUFPEN(pad)            (((GstRealPad *)(pad))->bufpen)
254 #define GST_RPAD_SCHED(pad)             (((GstRealPad *)(pad))->sched)
255 #define GST_RPAD_CHAINFUNC(pad)         (((GstRealPad *)(pad))->chainfunc)
256 #define GST_RPAD_CHAINHANDLER(pad)      (((GstRealPad *)(pad))->chainhandler)
257 #define GST_RPAD_GETFUNC(pad)           (((GstRealPad *)(pad))->getfunc)
258 #define GST_RPAD_GETHANDLER(pad)        (((GstRealPad *)(pad))->gethandler)
259 #define GST_RPAD_EVENTFUNC(pad)         (((GstRealPad *)(pad))->eventfunc)
260 #define GST_RPAD_EVENTHANDLER(pad)      (((GstRealPad *)(pad))->eventhandler)
261 #define GST_RPAD_CONVERTFUNC(pad)       (((GstRealPad *)(pad))->convertfunc)
262 #define GST_RPAD_QUERYFUNC(pad)         (((GstRealPad *)(pad))->queryfunc)
263 #define GST_RPAD_INTCONNFUNC(pad)       (((GstRealPad *)(pad))->intconnfunc)
264 #define GST_RPAD_FORMATSFUNC(pad)       (((GstRealPad *)(pad))->formatsfunc)
265 #define GST_RPAD_QUERYTYPEFUNC(pad)     (((GstRealPad *)(pad))->querytypefunc)
266 #define GST_RPAD_EVENTMASKFUNC(pad)     (((GstRealPad *)(pad))->eventmaskfunc)
267
268 #define GST_RPAD_EVENT_MASKS(pad)       (((GstRealPad *)(pad))->event_masks)
269 #define GST_RPAD_QUERY_TYPES(pad)       (((GstRealPad *)(pad))->query_types)
270
271 #define GST_RPAD_CONNECTFUNC(pad)       (((GstRealPad *)(pad))->connectfunc)
272 #define GST_RPAD_GETCAPSFUNC(pad)       (((GstRealPad *)(pad))->getcapsfunc)
273 #define GST_RPAD_BUFFERPOOLFUNC(pad)    (((GstRealPad *)(pad))->bufferpoolfunc)
274
275 /* GstGhostPad */
276 #define GST_GPAD_REALPAD(pad)           (((GstGhostPad *)(pad))->realpad)
277
278 /* Generic */
279 #define GST_PAD_REALIZE(pad)            (GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad))
280 #define GST_PAD_DIRECTION(pad)          GST_RPAD_DIRECTION(GST_PAD_REALIZE(pad))
281 #define GST_PAD_CAPS(pad)               GST_RPAD_CAPS(GST_PAD_REALIZE(pad))
282 #define GST_PAD_PEER(pad)               GST_PAD_CAST(GST_RPAD_PEER(GST_PAD_REALIZE(pad)))
283
284 /* Some check functions (unused?) */
285 #define GST_PAD_IS_CONNECTED(pad)       (GST_PAD_PEER(pad) != NULL)
286 #define GST_PAD_IS_ACTIVE(pad)          (!GST_FLAG_IS_SET(pad, GST_PAD_DISABLED))
287 #define GST_PAD_IS_USABLE(pad)          (GST_PAD_IS_CONNECTED (pad) && \
288                                          GST_PAD_IS_ACTIVE(pad) && GST_PAD_IS_ACTIVE(GST_PAD_PEER (pad)))
289 #define GST_PAD_CAN_PULL(pad)           (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->gethandler != NULL)
290 #define GST_PAD_IS_SRC(pad)             (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
291 #define GST_PAD_IS_SINK(pad)            (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
292
293 /***** PadTemplate *****/
294 #define GST_TYPE_PAD_TEMPLATE           (gst_pad_template_get_type ())
295 #define GST_PAD_TEMPLATE(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD_TEMPLATE,GstPadTemplate))
296 #define GST_PAD_TEMPLATE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD_TEMPLATE,GstPadTemplateClass))
297 #define GST_IS_PAD_TEMPLATE(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD_TEMPLATE))
298 #define GST_IS_PAD_TEMPLATE_CLASS(obj)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD_TEMPLATE))
299
300 typedef enum {
301   GST_PAD_ALWAYS,
302   GST_PAD_SOMETIMES,
303   GST_PAD_REQUEST
304 } GstPadPresence;
305
306 #define GST_PAD_TEMPLATE_NAME_TEMPLATE(templ)   (((GstPadTemplate *)(templ))->name_template)
307 #define GST_PAD_TEMPLATE_DIRECTION(templ)       (((GstPadTemplate *)(templ))->direction)
308 #define GST_PAD_TEMPLATE_PRESENCE(templ)        (((GstPadTemplate *)(templ))->presence)
309 #define GST_PAD_TEMPLATE_CAPS(templ)            (((GstPadTemplate *)(templ))->caps)
310 #define GST_PAD_TEMPLATE_FIXED(templ)           (((GstPadTemplate *)(templ))->fixed)
311
312 #define GST_PAD_TEMPLATE_IS_FIXED(templ)        (GST_PAD_TEMPLATE_FIXED(templ) == TRUE)
313
314 struct _GstPadTemplate {
315   GstObject       object;
316
317   gchar           *name_template;
318   GstPadDirection direction;
319   GstPadPresence  presence;
320   GstCaps         *caps;
321   gboolean        fixed;
322 };
323
324 struct _GstPadTemplateClass {
325   GstObjectClass parent_class;
326
327   /* signal callbacks */
328   void (*pad_created)   (GstPadTemplate *templ, GstPad *pad);
329 };
330
331 /* CR1: the space after 'a' is necessary because of preprocessing in gcc */
332 #define GST_PAD_TEMPLATE_NEW(padname, dir, pres, a...) \
333   gst_pad_template_new (                        \
334     padname,                                    \
335     dir,                                        \
336     pres,                                       \
337     a ,                                         \
338     NULL)
339
340 #define GST_PAD_TEMPLATE_FACTORY(name, padname, dir, pres, a...)         \
341 static GstPadTemplate*                          \
342 name (void)                                     \
343 {                                               \
344   static GstPadTemplate *templ = NULL;          \
345   if (!templ) {                                 \
346     templ = GST_PAD_TEMPLATE_NEW (              \
347       padname,                                  \
348       dir,                                      \
349       pres,                                     \
350       a );                                      \
351   }                                             \
352   return templ;                                 \
353 }
354
355 #define GST_PAD_TEMPLATE_GET(fact) (fact)()
356
357 GType                   gst_pad_get_type                        (void);
358 GType                   gst_real_pad_get_type                   (void);
359 GType                   gst_ghost_pad_get_type                  (void);
360
361 /* creating pads */
362 GstPad*                 gst_pad_new                             (const gchar *name, GstPadDirection direction);
363 #define                 gst_pad_destroy(pad)                    gst_object_destroy (GST_OBJECT (pad))
364 GstPad*                 gst_pad_new_from_template               (GstPadTemplate *templ, const gchar *name);
365 GstPad*                 gst_pad_custom_new                      (GType type, const gchar *name, GstPadDirection direction);
366 GstPad*                 gst_pad_custom_new_from_template        (GType type, GstPadTemplate *templ, const gchar *name);
367
368 void                    gst_pad_set_name                        (GstPad *pad, const gchar *name);
369 const gchar*            gst_pad_get_name                        (GstPad *pad);
370
371 GstPadDirection         gst_pad_get_direction                   (GstPad *pad);
372
373 void                    gst_pad_set_active                      (GstPad *pad, gboolean active);
374 gboolean                gst_pad_is_active                       (GstPad *pad);
375
376 void                    gst_pad_set_element_private             (GstPad *pad, gpointer priv);
377 gpointer                gst_pad_get_element_private             (GstPad *pad);
378
379 void                    gst_pad_set_parent                      (GstPad *pad, GstObject *parent);
380 GstElement*             gst_pad_get_parent                      (GstPad *pad);
381 GstElement*             gst_pad_get_real_parent                 (GstPad *pad);
382
383 void                    gst_pad_set_scheduler                   (GstPad *pad, GstScheduler *sched);
384 GstScheduler*           gst_pad_get_scheduler                   (GstPad *pad);
385 void                    gst_pad_unset_scheduler                 (GstPad *pad);
386
387 void                    gst_pad_add_ghost_pad                   (GstPad *pad, GstPad *ghostpad);
388 void                    gst_pad_remove_ghost_pad                (GstPad *pad, GstPad *ghostpad);
389 GList*                  gst_pad_get_ghost_pad_list              (GstPad *pad);
390
391 GstPadTemplate*         gst_pad_get_pad_template                (GstPad *pad);
392
393 void                    gst_pad_set_bufferpool_function         (GstPad *pad, GstPadBufferPoolFunction bufpool);
394 GstBufferPool*          gst_pad_get_bufferpool                  (GstPad *pad);
395
396 /* data passing setup functions */
397 void                    gst_pad_set_chain_function              (GstPad *pad, GstPadChainFunction chain);
398 void                    gst_pad_set_get_function                (GstPad *pad, GstPadGetFunction get);
399 void                    gst_pad_set_event_function              (GstPad *pad, GstPadEventFunction event);
400 void                    gst_pad_set_event_mask_function         (GstPad *pad, GstPadEventMaskFunction mask_func);
401 const GstEventMask*     gst_pad_get_event_masks                 (GstPad *pad);
402 const GstEventMask*     gst_pad_get_event_masks_default         (GstPad *pad);
403 gboolean                gst_pad_handles_event                   (GstPad *pad, GstEventMask *mask);
404
405 /* pad connections */
406 void                    gst_pad_set_connect_function            (GstPad *pad, GstPadConnectFunction connect);
407 gboolean                gst_pad_can_connect                     (GstPad *srcpad, GstPad *sinkpad);
408 gboolean                gst_pad_can_connect_filtered            (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
409
410 gboolean                gst_pad_connect                         (GstPad *srcpad, GstPad *sinkpad);
411 gboolean                gst_pad_connect_filtered                (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
412 void                    gst_pad_disconnect                      (GstPad *srcpad, GstPad *sinkpad);
413
414 GstPad*                 gst_pad_get_peer                        (GstPad *pad);
415
416 /* capsnego functions */
417 GstCaps*                gst_pad_get_caps                        (GstPad *pad);
418 GstCaps*                gst_pad_get_pad_template_caps           (GstPad *pad);
419 gboolean                gst_pad_try_set_caps                    (GstPad *pad, GstCaps *caps);
420 gboolean                gst_pad_check_compatibility             (GstPad *srcpad, GstPad *sinkpad);
421
422 void                    gst_pad_set_getcaps_function            (GstPad *pad, GstPadGetCapsFunction getcaps);
423 GstPadConnectReturn     gst_pad_proxy_connect                   (GstPad *pad, GstCaps *caps);
424 gboolean                gst_pad_reconnect_filtered              (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
425 gboolean                gst_pad_perform_negotiate               (GstPad *srcpad, GstPad *sinkpad);
426 gboolean                gst_pad_try_reconnect_filtered          (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
427 GstCaps*                gst_pad_get_allowed_caps                (GstPad *pad);
428 gboolean                gst_pad_recalc_allowed_caps             (GstPad *pad);
429
430 /* data passing functions */
431 void                    gst_pad_push                            (GstPad *pad, GstBuffer *buf);
432 GstBuffer*              gst_pad_pull                            (GstPad *pad);
433 gboolean                gst_pad_send_event                      (GstPad *pad, GstEvent *event);
434 gboolean                gst_pad_event_default                   (GstPad *pad, GstEvent *event);
435 GstBuffer*              gst_pad_peek                            (GstPad *pad);
436 GstPad*                 gst_pad_select                          (GList *padlist);
437 GstPad*                 gst_pad_selectv                         (GstPad *pad, ...);
438
439
440 /* convert/query/format functions */
441 void                    gst_pad_set_formats_function            (GstPad *pad, GstPadFormatsFunction format);
442 gboolean                gst_pad_handles_format                  (GstPad *pad, GstFormat format);
443 const GstFormat*        gst_pad_get_formats                     (GstPad *pad);
444 const GstFormat*        gst_pad_get_formats_default             (GstPad *pad);
445
446 void                    gst_pad_set_convert_function            (GstPad *pad, GstPadConvertFunction convert);
447 gboolean                gst_pad_convert                         (GstPad *pad, 
448                                                                  GstFormat src_format,  gint64  src_value,
449                                                                  GstFormat *dest_format, gint64 *dest_value);
450 gboolean                gst_pad_convert_default                 (GstPad *pad,
451                                                                  GstFormat src_format,  gint64  src_value,
452                                                                  GstFormat *dest_format, gint64 *dest_value);
453
454 void                    gst_pad_set_query_function              (GstPad *pad, GstPadQueryFunction query);
455 void                    gst_pad_set_query_type_function         (GstPad *pad, GstPadQueryTypeFunction type_function);
456 const GstPadQueryType*  gst_pad_get_query_types                 (GstPad *pad);
457 const GstPadQueryType*  gst_pad_get_query_types_default         (GstPad *pad);
458 gboolean                gst_pad_query                           (GstPad *pad, GstPadQueryType type,
459                                                                  GstFormat *format, gint64 *value);
460 gboolean                gst_pad_query_default                   (GstPad *pad, GstPadQueryType type,
461                                                                  GstFormat *format, gint64 *value);
462
463 void                    gst_pad_set_internal_connection_function(GstPad *pad, GstPadIntConnFunction intconn);
464 GList*                  gst_pad_get_internal_connections        (GstPad *pad);
465 GList*                  gst_pad_get_internal_connections_default (GstPad *pad);
466         
467 /* misc helper functions */
468 gboolean                gst_pad_dispatcher                      (GstPad *pad, GstPadDispatcherFunction dispatch, 
469                                                                  gpointer data);
470
471
472 #ifndef GST_DISABLE_LOADSAVE
473 void                    gst_pad_load_and_connect                (xmlNodePtr self, GstObject *parent);
474 #endif
475
476
477 /* ghostpads */
478 GstPad*                 gst_ghost_pad_new                       (gchar *name,GstPad *pad);
479
480
481 /* templates and factories */
482 GType                   gst_pad_template_get_type               (void);
483
484 GstPadTemplate*         gst_pad_template_new                    (const gchar *name_template,
485                                                                  GstPadDirection direction, GstPadPresence presence,
486                                                                  GstCaps *caps, ...);
487
488 GstCaps*                gst_pad_template_get_caps               (GstPadTemplate *templ);
489 GstCaps*                gst_pad_template_get_caps_by_name       (GstPadTemplate *templ, const gchar *name);
490
491 xmlNodePtr              gst_pad_ghost_save_thyself              (GstPad *pad,
492                                                                  GstElement *bin,
493                                                                  xmlNodePtr parent);
494
495 G_END_DECLS
496
497
498 #endif /* __GST_PAD_H__ */
499