26 |
26 |
27 #include <gst/gstconfig.h> |
27 #include <gst/gstconfig.h> |
28 |
28 |
29 #include <gst/gstobject.h> |
29 #include <gst/gstobject.h> |
30 #include <gst/gstbuffer.h> |
30 #include <gst/gstbuffer.h> |
31 #include <gst/gstbufferlist.h> |
|
32 #include <gst/gstcaps.h> |
31 #include <gst/gstcaps.h> |
33 #include <gst/gstevent.h> |
32 #include <gst/gstevent.h> |
34 #include <gst/gstquery.h> |
33 #include <gst/gstquery.h> |
35 #include <gst/gsttask.h> |
34 #include <gst/gsttask.h> |
36 |
35 |
46 #define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass)) |
45 #define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass)) |
47 #define GST_PAD_CAST(obj) ((GstPad*)(obj)) |
46 #define GST_PAD_CAST(obj) ((GstPad*)(obj)) |
48 |
47 |
49 |
48 |
50 typedef struct _GstPad GstPad; |
49 typedef struct _GstPad GstPad; |
51 typedef struct _GstPadPrivate GstPadPrivate; |
|
52 typedef struct _GstPadClass GstPadClass; |
50 typedef struct _GstPadClass GstPadClass; |
53 |
51 |
54 /** |
52 /** |
55 * GstPadLinkReturn: |
53 * GstPadLinkReturn: |
56 * @GST_PAD_LINK_OK : link succeeded |
54 * @GST_PAD_LINK_OK : link succeeded |
232 * |
227 * |
233 * The implementer of this function receives a refcount to @buffer and should |
228 * The implementer of this function receives a refcount to @buffer and should |
234 * gst_buffer_unref() when the buffer is no longer needed. |
229 * gst_buffer_unref() when the buffer is no longer needed. |
235 * |
230 * |
236 * When a chain function detects an error in the data stream, it must post an |
231 * When a chain function detects an error in the data stream, it must post an |
237 * error on the bus and return an appropriate #GstFlowReturn value. |
232 * error on the buffer and return an appropriate #GstFlowReturn value. |
238 * |
233 * |
239 * Returns: #GST_FLOW_OK for success |
234 * Returns: #GST_FLOW_OK for success |
240 */ |
235 */ |
241 typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer); |
236 typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer); |
242 |
|
243 /** |
|
244 * GstPadChainListFunction: |
|
245 * @pad: the sink #GstPad that performed the chain. |
|
246 * @list: the #GstBufferList that is chained, not %NULL. |
|
247 * |
|
248 * A function that will be called on sinkpads when chaining buffer lists. |
|
249 * The function typically processes the data contained in the buffer list and |
|
250 * either consumes the data or passes it on to the internally linked pad(s). |
|
251 * |
|
252 * The implementer of this function receives a refcount to @list and |
|
253 * should gst_buffer_list_unref() when the list is no longer needed. |
|
254 * |
|
255 * When a chainlist function detects an error in the data stream, it must |
|
256 * post an error on the bus and return an appropriate #GstFlowReturn value. |
|
257 * |
|
258 * Returns: #GST_FLOW_OK for success |
|
259 */ |
|
260 typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstBufferList *list); |
|
261 |
|
262 /** |
237 /** |
263 * GstPadGetRangeFunction: |
238 * GstPadGetRangeFunction: |
264 * @pad: the src #GstPad to perform the getrange on. |
239 * @pad: the src #GstPad to perform the getrange on. |
265 * @offset: the offset of the range |
240 * @offset: the offset of the range |
266 * @length: the length of the range |
241 * @length: the length of the range |
335 * @pad: The #GstPad to query. |
310 * @pad: The #GstPad to query. |
336 * |
311 * |
337 * The signature of the internal pad link function. |
312 * The signature of the internal pad link function. |
338 * |
313 * |
339 * Returns: a newly allocated #GList of pads that are linked to the given pad on |
314 * Returns: a newly allocated #GList of pads that are linked to the given pad on |
340 * the inside of the parent element. |
315 * the inside of the parent element. |
341 * |
316 * The caller must call g_list_free() on it after use. |
342 * The caller must call g_list_free() on it after use. |
|
343 * |
|
344 * Deprecated: use the threadsafe #GstPadIterIntLinkFunction instead. |
|
345 */ |
317 */ |
346 typedef GList* (*GstPadIntLinkFunction) (GstPad *pad); |
318 typedef GList* (*GstPadIntLinkFunction) (GstPad *pad); |
347 |
319 |
348 /** |
|
349 * GstPadIterIntLinkFunction: |
|
350 * @pad: The #GstPad to query. |
|
351 * |
|
352 * The signature of the internal pad link iterator function. |
|
353 * |
|
354 * Returns: a new #GstIterator that will iterate over all pads that are |
|
355 * linked to the given pad on the inside of the parent element. |
|
356 * |
|
357 * the caller must call gst_iterator_free() after usage. |
|
358 * |
|
359 * Since 0.10.21 |
|
360 */ |
|
361 typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad); |
|
362 |
320 |
363 /* generic query function */ |
321 /* generic query function */ |
364 /** |
322 /** |
365 * GstPadQueryTypeFunction: |
323 * GstPadQueryTypeFunction: |
366 * @pad: a #GstPad to query |
324 * @pad: a #GstPad to query |
464 * |
422 * |
465 * The purpose of this function is to allocate a buffer that is optimal to |
423 * The purpose of this function is to allocate a buffer that is optimal to |
466 * be processed by @pad. The function is mostly overridden by elements that can |
424 * be processed by @pad. The function is mostly overridden by elements that can |
467 * provide a hardware buffer in order to avoid additional memcpy operations. |
425 * provide a hardware buffer in order to avoid additional memcpy operations. |
468 * |
426 * |
469 * The function can return a buffer that has caps different from the requested |
427 * The function can return a buffer that does not have @caps, in which case the |
470 * @caps, in which case the upstream element requests a format change to this |
428 * upstream element requests a format change. If a format change was requested, |
471 * new caps. |
429 * the returned buffer will be one to hold the data of said new caps, so its |
472 * If a format change was requested, the returned buffer will be one to hold |
430 * size might be different from @size. |
473 * the data of said new caps, so its size might be different from the requested |
|
474 * @size. |
|
475 * |
431 * |
476 * When this function returns anything else than #GST_FLOW_OK, the buffer allocation |
432 * When this function returns anything else than #GST_FLOW_OK, the buffer allocation |
477 * failed and @buf does not contain valid data. If the function returns #GST_FLOW_OK and |
433 * failed and @buf does not contain valid data. |
478 * the @buf is NULL, a #GstBuffer will be created with @caps, @offset and @size. |
|
479 * |
434 * |
480 * By default this function returns a new buffer of @size and with @caps containing |
435 * By default this function returns a new buffer of @size and with @caps containing |
481 * purely malloced data. The buffer should be freed with gst_buffer_unref() |
436 * purely malloced data. The buffer should be freed with gst_buffer_unref() |
482 * after usage. |
437 * after usage. |
483 * |
438 * |
573 * @activatepullfunc: function to activate/deactivate pad in pull mode |
528 * @activatepullfunc: function to activate/deactivate pad in pull mode |
574 * @linkfunc: function called when pad is linked |
529 * @linkfunc: function called when pad is linked |
575 * @unlinkfunc: function called when pad is unlinked |
530 * @unlinkfunc: function called when pad is unlinked |
576 * @peer: the pad this pad is linked to |
531 * @peer: the pad this pad is linked to |
577 * @sched_private: private storage for the scheduler |
532 * @sched_private: private storage for the scheduler |
578 * @chainfunc: function to chain buffer to pad |
533 * @chainfunc: function to chain data to pad |
579 * @checkgetrangefunc: function to check if pad can operate in pull mode |
534 * @checkgetrangefunc: function to check if pad can operate in pull mode |
580 * @getrangefunc: function to get a range of data from a pad |
535 * @getrangefunc: function to get a range of data from a pad |
581 * @eventfunc: function to send an event to a pad |
536 * @eventfunc: function to send an event to a pad |
582 * @mode: current activation mode of the pad |
537 * @mode: current activation mode of the pad |
583 * @querytypefunc: get list of supported queries |
538 * @querytypefunc: get list of supported queries |
584 * @queryfunc: perform a query on the pad |
539 * @queryfunc: perform a query on the pad |
585 * @intlinkfunc: get the internal links of this pad |
540 * @intlinkfunc: get the internal links of this pad |
586 * @bufferallocfunc: function to allocate a buffer for this pad |
541 * @bufferallocfunc: function to allocate a buffer for this pad |
587 * @do_buffer_signals: counter counting installed buffer signals |
542 * @do_buffer_signals: counter counting installed buffer signals |
588 * @do_event_signals: counter counting installed event signals |
543 * @do_event_signals: counter counting installed event signals |
589 * @iterintlinkfunc: get the internal links iterator of this pad |
|
590 * @block_destroy_data: notify function for gst_pad_set_blocked_async_full() |
|
591 * |
544 * |
592 * The #GstPad structure. Use the functions to update the variables. |
545 * The #GstPad structure. Use the functions to update the variables. |
593 */ |
546 */ |
594 struct _GstPad { |
547 struct _GstPad { |
595 GstObject object; |
548 GstObject object; |
653 /* whether to emit signals for have-data. counts number |
606 /* whether to emit signals for have-data. counts number |
654 * of handlers attached. */ |
607 * of handlers attached. */ |
655 gint do_buffer_signals; |
608 gint do_buffer_signals; |
656 gint do_event_signals; |
609 gint do_event_signals; |
657 |
610 |
658 /* ABI added */ |
|
659 /* iterate internal links */ |
|
660 GstPadIterIntLinkFunction iterintlinkfunc; |
|
661 |
|
662 /* free block_data */ |
|
663 GDestroyNotify block_destroy_data; |
|
664 |
|
665 /*< private >*/ |
611 /*< private >*/ |
666 union { |
612 gpointer _gst_reserved[GST_PADDING]; |
667 struct { |
|
668 gboolean block_callback_called; |
|
669 GstPadPrivate *priv; |
|
670 } ABI; |
|
671 gpointer _gst_reserved[GST_PADDING - 2]; |
|
672 } abidata; |
|
673 }; |
613 }; |
674 |
614 |
675 struct _GstPadClass { |
615 struct _GstPadClass { |
676 GstObjectClass parent_class; |
616 GstObjectClass parent_class; |
677 |
617 |
704 #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc) |
644 #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc) |
705 #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc) |
645 #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc) |
706 #define GST_PAD_QUERYTYPEFUNC(pad) (GST_PAD_CAST(pad)->querytypefunc) |
646 #define GST_PAD_QUERYTYPEFUNC(pad) (GST_PAD_CAST(pad)->querytypefunc) |
707 #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc) |
647 #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc) |
708 #define GST_PAD_INTLINKFUNC(pad) (GST_PAD_CAST(pad)->intlinkfunc) |
648 #define GST_PAD_INTLINKFUNC(pad) (GST_PAD_CAST(pad)->intlinkfunc) |
709 #define GST_PAD_ITERINTLINKFUNC(pad) (GST_PAD_CAST(pad)->iterintlinkfunc) |
|
710 |
649 |
711 #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer) |
650 #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer) |
712 #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc) |
651 #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc) |
713 #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc) |
652 #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc) |
714 |
653 |
715 /** |
|
716 * GST_PAD_CAPS: |
|
717 * @pad: a #GstPad. |
|
718 * |
|
719 * The caps for this pad. |
|
720 */ |
|
721 #define GST_PAD_CAPS(pad) (GST_PAD_CAST(pad)->caps) |
654 #define GST_PAD_CAPS(pad) (GST_PAD_CAST(pad)->caps) |
722 #define GST_PAD_GETCAPSFUNC(pad) (GST_PAD_CAST(pad)->getcapsfunc) |
655 #define GST_PAD_GETCAPSFUNC(pad) (GST_PAD_CAST(pad)->getcapsfunc) |
723 #define GST_PAD_SETCAPSFUNC(pad) (GST_PAD_CAST(pad)->setcapsfunc) |
656 #define GST_PAD_SETCAPSFUNC(pad) (GST_PAD_CAST(pad)->setcapsfunc) |
724 #define GST_PAD_ACCEPTCAPSFUNC(pad) (GST_PAD_CAST(pad)->acceptcapsfunc) |
657 #define GST_PAD_ACCEPTCAPSFUNC(pad) (GST_PAD_CAST(pad)->acceptcapsfunc) |
725 #define GST_PAD_FIXATECAPSFUNC(pad) (GST_PAD_CAST(pad)->fixatecapsfunc) |
658 #define GST_PAD_FIXATECAPSFUNC(pad) (GST_PAD_CAST(pad)->fixatecapsfunc) |
806 #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad))) |
739 #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad))) |
807 #define GST_PAD_BLOCK_BROADCAST(pad) (g_cond_broadcast(GST_PAD_BLOCK_GET_COND (pad))) |
740 #define GST_PAD_BLOCK_BROADCAST(pad) (g_cond_broadcast(GST_PAD_BLOCK_GET_COND (pad))) |
808 |
741 |
809 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */ |
742 /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */ |
810 #include <gst/gstpadtemplate.h> |
743 #include <gst/gstpadtemplate.h> |
811 #ifdef __SYMBIAN32__ |
744 |
812 IMPORT_C |
|
813 #endif |
|
814 GType gst_pad_get_type (void); |
745 GType gst_pad_get_type (void); |
815 |
746 |
816 /* creating pads */ |
747 /* creating pads */ |
817 #ifdef __SYMBIAN32__ |
748 #ifdef __SYMBIAN32__ |
818 IMPORT_C |
749 IMPORT_C |
891 GstPadBlockCallback callback, gpointer user_data); |
819 GstPadBlockCallback callback, gpointer user_data); |
892 #ifdef __SYMBIAN32__ |
820 #ifdef __SYMBIAN32__ |
893 IMPORT_C |
821 IMPORT_C |
894 #endif |
822 #endif |
895 |
823 |
896 gboolean gst_pad_set_blocked_async_full (GstPad *pad, gboolean blocked, |
|
897 GstPadBlockCallback callback, gpointer user_data, |
|
898 GDestroyNotify destroy_data); |
|
899 #ifdef __SYMBIAN32__ |
|
900 IMPORT_C |
|
901 #endif |
|
902 |
|
903 gboolean gst_pad_is_blocked (GstPad *pad); |
824 gboolean gst_pad_is_blocked (GstPad *pad); |
904 #ifdef __SYMBIAN32__ |
825 #ifdef __SYMBIAN32__ |
905 IMPORT_C |
826 IMPORT_C |
906 #endif |
827 #endif |
907 |
828 |
1100 #ifdef __SYMBIAN32__ |
1011 #ifdef __SYMBIAN32__ |
1101 IMPORT_C |
1012 IMPORT_C |
1102 #endif |
1013 #endif |
1103 |
1014 |
1104 GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer); |
1015 GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer); |
1105 #ifdef __SYMBIAN32__ |
|
1106 IMPORT_C |
|
1107 #endif |
|
1108 |
|
1109 GstFlowReturn gst_pad_push_list (GstPad *pad, GstBufferList *list); |
|
1110 #ifdef __SYMBIAN32__ |
1016 #ifdef __SYMBIAN32__ |
1111 IMPORT_C |
1017 IMPORT_C |
1112 #endif |
1018 #endif |
1113 |
1019 |
1114 gboolean gst_pad_check_pull_range (GstPad *pad); |
1020 gboolean gst_pad_check_pull_range (GstPad *pad); |
1137 GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer); |
1043 GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer); |
1138 #ifdef __SYMBIAN32__ |
1044 #ifdef __SYMBIAN32__ |
1139 IMPORT_C |
1045 IMPORT_C |
1140 #endif |
1046 #endif |
1141 |
1047 |
1142 GstFlowReturn gst_pad_chain_list (GstPad *pad, GstBufferList *list); |
|
1143 #ifdef __SYMBIAN32__ |
|
1144 IMPORT_C |
|
1145 #endif |
|
1146 |
|
1147 GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size, |
1048 GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size, |
1148 GstBuffer **buffer); |
1049 GstBuffer **buffer); |
1149 #ifdef __SYMBIAN32__ |
1050 #ifdef __SYMBIAN32__ |
1150 IMPORT_C |
1051 IMPORT_C |
1151 #endif |
1052 #endif |
1184 #ifdef __SYMBIAN32__ |
1085 #ifdef __SYMBIAN32__ |
1185 IMPORT_C |
1086 IMPORT_C |
1186 #endif |
1087 #endif |
1187 |
1088 |
1188 GList* gst_pad_get_internal_links_default (GstPad *pad); |
1089 GList* gst_pad_get_internal_links_default (GstPad *pad); |
1189 #ifdef __SYMBIAN32__ |
|
1190 IMPORT_C |
|
1191 #endif |
|
1192 |
|
1193 |
|
1194 void gst_pad_set_iterate_internal_links_function (GstPad * pad, |
|
1195 GstPadIterIntLinkFunction iterintlink); |
|
1196 #ifdef __SYMBIAN32__ |
|
1197 IMPORT_C |
|
1198 #endif |
|
1199 |
|
1200 GstIterator * gst_pad_iterate_internal_links (GstPad * pad); |
|
1201 #ifdef __SYMBIAN32__ |
|
1202 IMPORT_C |
|
1203 #endif |
|
1204 |
|
1205 GstIterator * gst_pad_iterate_internal_links_default (GstPad * pad); |
|
1206 |
|
1207 |
1090 |
1208 /* generic query function */ |
1091 /* generic query function */ |
1209 #ifdef __SYMBIAN32__ |
1092 #ifdef __SYMBIAN32__ |
1210 IMPORT_C |
1093 IMPORT_C |
1211 #endif |
1094 #endif |