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