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