Documentation updates
[platform/upstream/gstreamer.git] / docs / gst / tmpl / gstpad.sgml
1 <!-- ##### SECTION Title ##### -->
2 GstPad
3
4 <!-- ##### SECTION Short_Description ##### -->
5 The connection between Elements
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 #GstElement are connected to each other via "pads", which are extremely light-weight generic 
10 connections. After two pad are retrieved from an element with gst_element_get_pad(), the pads
11 can be connected with gst_pad_connect().
12 </para>
13 <para>
14 Pads are typically created from a #GstPadTemplate with gst_pad_new_from_template().
15 </para>
16 <para>
17 Pad have #GstCaps attached to it to describe the media type they
18 are capable of dealing with. gst_pad_get_caps() and gst_pad_set_caps() are used to
19 manipulate the caps of the pads. 
20 Pads created from a padtemplate cannot set capabilities that are incompatible with
21 the padtemplates capabilities.
22 </para>
23 <para>
24 Pads without padtemplates can be created with gst_pad_new() which takes a direction and
25 a name as an argument.
26 </para>
27 <para>
28 gst_pad_get_parent() will retrieve the #GstElement that owns the pad.
29 </para>
30 <para>
31 GstElements creating a pad will typicilally use the various gst_pad_set_*_function() calls
32 to register callbacks for various events on the pads.
33 </para>
34 <para>
35 GstElements will use gst_pad_push() and gst_pad_pull() to push out or pull a buffer in. The
36 gst_pad_pullregion() function can be used to request for a buffer with a specific offset (in
37 time or in bytes). gst_pad_select() and gst_pad_selectv() are use by plugins to wait on a set
38 of pads for a new #GstBuffer or #GstEvent.
39 </para>
40 <para>
41 To send an event on a pad, use gst_pad_send_event().
42 </para>
43
44 <!-- ##### SECTION See_Also ##### -->
45 <para>
46 #GstPadTemplate, #GstElement, #GstEvent
47 </para>
48
49 <!-- ##### MACRO GST_PAD_NAME ##### -->
50 <para>
51 Get the name of the pad.
52 </para>
53
54 @pad: the pad to query
55
56
57 <!-- ##### MACRO GST_PAD_ELEMENT_PRIVATE ##### -->
58 <para>
59 Get the private data set by the element that owns the pad.
60 </para>
61
62 @pad: the pad to query
63
64
65 <!-- ##### MACRO GST_PAD_PARENT ##### -->
66 <para>
67 Get the parent element of this pad.
68 </para>
69
70 @pad: the pad to query
71
72
73 <!-- ##### MACRO GST_PAD_PADTEMPLATE ##### -->
74 <para>
75 Get the padtemplate that was used to create this pad. NULL if no padtemplate
76 was used.
77 </para>
78
79 @pad: the pad to query
80
81
82 <!-- ##### MACRO GST_PAD_REALIZE ##### -->
83 <para>
84 Return the real pad of this pad.
85 </para>
86
87 @pad: the pad to query
88
89
90 <!-- ##### MACRO GST_PAD_DIRECTION ##### -->
91 <para>
92 Get the pad direction.
93 </para>
94
95 @pad: the pad to query
96
97
98 <!-- ##### MACRO GST_PAD_CAPS ##### -->
99 <para>
100 Get the capabilities of a pad.
101 </para>
102
103 @pad: the pad to query
104
105
106 <!-- ##### MACRO GST_PAD_PEER ##### -->
107 <para>
108 Get the peerpad of this pad.
109 </para>
110
111 @pad: the pad to query
112
113
114 <!-- ##### MACRO GST_PAD_CAN_PULL ##### -->
115 <para>
116 Can this pad be used to pull a buffer.
117 </para>
118
119 @pad: the pad to check
120
121
122 <!-- ##### MACRO GST_PAD_IS_SINK ##### -->
123 <para>
124 Check if the pad is a sinkpad.
125 </para>
126
127 @pad: the pad to query
128
129
130 <!-- ##### MACRO GST_PAD_IS_SRC ##### -->
131 <para>
132 Check if the pad is a srcpad.
133 </para>
134
135 @pad: the pad to query
136
137
138 <!-- ##### MACRO GST_PAD_IS_CONNECTED ##### -->
139 <para>
140 Checks if the pad is connected
141 </para>
142
143 @pad: the pad to query
144
145
146 <!-- ##### STRUCT GstPad ##### -->
147 <para>
148
149 </para>
150
151
152 <!-- ##### USER_FUNCTION GstPadChainFunction ##### -->
153 <para>
154 The function that will be called when chaining buffers.
155 </para>
156
157 @pad: the pad that performed the chain
158 @buf: the buffer that is chained
159
160
161 <!-- ##### USER_FUNCTION GstPadGetFunction ##### -->
162 <para>
163 The function that will be called when pulling a buffer.
164 </para>
165
166 @pad: the pad to get a buffer from
167 @Returns: a #GstBuffer
168
169
170 <!-- ##### USER_FUNCTION GstPadGetRegionFunction ##### -->
171 <para>
172 The function that will be called when pulling a region buffer.
173 You can specify which buffer to get using an offset/length pair or
174 a start/stop timecode pair.
175 </para>
176
177 @pad: the pad to get a buffer from
178 @type: the type of region to get (time or offset based)
179 @offset: the offset of the region to get
180 @len: the length of the region to get
181 @Returns: a #GstBuffer
182
183
184 <!-- ##### USER_FUNCTION GstPadBufferPoolFunction ##### -->
185 <para>
186 The function that will be called when a bufferpool is requested
187 from this pad.
188 </para>
189
190 @pad: the pad with the bufferpool
191 @Returns: the GstBufferPool associated with this pad.
192
193
194 <!-- ##### USER_FUNCTION GstPadGetCapsFunction ##### -->
195 <para>
196 Return the caps of the specified pad. By default this function
197 will return the pad template caps but can optionally be overridden.
198 </para>
199
200 @pad: The pad to get the caps of
201 @caps: The peer caps, can be used to filter the caps.
202 @Returns: The caps of the pad.
203
204
205 <!-- ##### ENUM GstRegionType ##### -->
206 <para>
207 the region types for #gst_pad_pullregion.
208 </para>
209
210 @GST_REGION_VOID: 
211 @GST_REGION_OFFSET_LEN: an offet/length pair
212 @GST_REGION_TIME_LEN: a time start/length pair
213
214 <!-- ##### USER_FUNCTION GstPadPullRegionFunction ##### -->
215 <para>
216 The function that will be called when pulling a region buffer.
217 You can specify which buffer to get using an offset/length pair or
218 a start/stop timecode pair.
219 </para>
220
221 @pad: the pad to get a buffer from
222 @type: the type of region to get (time or offset based)
223 @offset: the offset of the region to get
224 @len: the length of the region to get
225 @Returns: a #GstBuffer
226
227
228 <!-- ##### USER_FUNCTION GstPadEventFunction ##### -->
229 <para>
230 Function signature to handle an event for the pad.
231 </para>
232
233 @pad: The pad to handle the event
234 @event: The event to handle
235 @Returns: TRUE if the pad could handle the event.
236
237
238 <!-- ##### USER_FUNCTION GstPadConnectFunction ##### -->
239 <para>
240 Function signature to handle a new connection on the pad.
241 </para>
242
243 @pad: The pad that is connected.
244 @caps: The peer caps.
245 @Returns: the result of the connection with the specified caps.
246
247
248 <!-- ##### ENUM GstPadConnectReturn ##### -->
249 <para>
250
251 </para>
252
253 @GST_PAD_CONNECT_REFUSED: 
254 @GST_PAD_CONNECT_DELAYED: 
255 @GST_PAD_CONNECT_OK: 
256 @GST_PAD_CONNECT_DONE: 
257
258 <!-- ##### ENUM GstPadDirection ##### -->
259 <para>
260 The direction this pad is.
261 </para>
262
263 @GST_PAD_UNKNOWN: direction is unknown
264 @GST_PAD_SRC: this is a source pad
265 @GST_PAD_SINK: this is a sink pad
266
267 <!-- ##### ENUM GstPadFlags ##### -->
268 <para>
269 Flags for the pad.
270 </para>
271
272 @GST_PAD_DISABLED: the pad is disabled
273 @GST_PAD_EOS: the pad is in end of stream state
274 @GST_PAD_FLAG_LAST: subclasses can use this number to enumerate their flags
275
276 <!-- ##### FUNCTION gst_pad_new ##### -->
277 <para>
278
279 </para>
280
281 @name: 
282 @direction: 
283 @Returns: 
284
285
286 <!-- ##### MACRO gst_pad_destroy ##### -->
287 <para>
288 Destroy the pad.
289 </para>
290
291 @pad: the pad to destroy
292
293
294 <!-- ##### FUNCTION gst_pad_new_from_template ##### -->
295 <para>
296
297 </para>
298
299 @templ: 
300 @name: 
301 @Returns: 
302 <!-- # Unused Parameters # -->
303 @temp: 
304
305
306 <!-- ##### FUNCTION gst_pad_get_direction ##### -->
307 <para>
308
309 </para>
310
311 @pad: 
312 @Returns: 
313
314
315 <!-- ##### FUNCTION gst_pad_set_chain_function ##### -->
316 <para>
317
318 </para>
319
320 @pad: 
321 @chain: 
322
323
324 <!-- ##### FUNCTION gst_pad_set_get_function ##### -->
325 <para>
326
327 </para>
328
329 @pad: 
330 @get: 
331
332
333 <!-- ##### FUNCTION gst_pad_set_getregion_function ##### -->
334 <para>
335
336 </para>
337
338 @pad: 
339 @getregion: 
340
341
342 <!-- ##### FUNCTION gst_pad_set_bufferpool_function ##### -->
343 <para>
344
345 </para>
346
347 @pad: 
348 @bufpool: 
349
350
351 <!-- ##### FUNCTION gst_pad_set_connect_function ##### -->
352 <para>
353
354 </para>
355
356 @pad: 
357 @connect: 
358
359
360 <!-- ##### FUNCTION gst_pad_set_getcaps_function ##### -->
361 <para>
362
363 </para>
364
365 @pad: 
366 @getcaps: 
367
368
369 <!-- ##### FUNCTION gst_pad_try_set_caps ##### -->
370 <para>
371
372 </para>
373
374 @pad: 
375 @caps: 
376 @Returns: 
377
378
379 <!-- ##### FUNCTION gst_pad_get_caps ##### -->
380 <para>
381
382 </para>
383
384 @pad: 
385 @Returns: 
386
387
388 <!-- ##### FUNCTION gst_pad_check_compatibility ##### -->
389 <para>
390
391 </para>
392
393 @srcpad: 
394 @sinkpad: 
395 @Returns: 
396
397
398 <!-- ##### FUNCTION gst_pad_set_name ##### -->
399 <para>
400
401 </para>
402
403 @pad: 
404 @name: 
405
406
407 <!-- ##### FUNCTION gst_pad_get_name ##### -->
408 <para>
409
410 </para>
411
412 @pad: 
413 @Returns: 
414
415
416 <!-- ##### FUNCTION gst_pad_set_element_private ##### -->
417 <para>
418
419 </para>
420
421 @pad: 
422 @priv: 
423
424
425 <!-- ##### FUNCTION gst_pad_get_element_private ##### -->
426 <para>
427
428 </para>
429
430 @pad: 
431 @Returns: 
432
433
434 <!-- ##### FUNCTION gst_pad_set_parent ##### -->
435 <para>
436
437 </para>
438
439 @pad: 
440 @parent: 
441
442
443 <!-- ##### FUNCTION gst_pad_get_parent ##### -->
444 <para>
445
446 </para>
447
448 @pad: 
449 @Returns: 
450
451
452 <!-- ##### FUNCTION gst_pad_get_sched ##### -->
453 <para>
454
455 </para>
456
457 @pad: 
458 @Returns: 
459
460
461 <!-- ##### FUNCTION gst_pad_set_sched ##### -->
462 <para>
463
464 </para>
465
466 @pad: 
467 @sched: 
468
469
470 <!-- ##### FUNCTION gst_pad_unset_sched ##### -->
471 <para>
472
473 </para>
474
475 @pad: 
476
477
478 <!-- ##### FUNCTION gst_pad_get_real_parent ##### -->
479 <para>
480
481 </para>
482
483 @pad: 
484 @Returns: 
485
486
487 <!-- ##### FUNCTION gst_pad_add_ghost_pad ##### -->
488 <para>
489
490 </para>
491
492 @pad: 
493 @ghostpad: 
494
495
496 <!-- ##### FUNCTION gst_pad_remove_ghost_pad ##### -->
497 <para>
498
499 </para>
500
501 @pad: 
502 @ghostpad: 
503
504
505 <!-- ##### FUNCTION gst_pad_get_ghost_pad_list ##### -->
506 <para>
507
508 </para>
509
510 @pad: 
511 @Returns: 
512
513
514 <!-- ##### FUNCTION gst_pad_get_peer ##### -->
515 <para>
516
517 </para>
518
519 @pad: 
520 @Returns: 
521
522
523 <!-- ##### FUNCTION gst_pad_connect ##### -->
524 <para>
525
526 </para>
527
528 @srcpad: 
529 @sinkpad: 
530 @Returns: 
531
532
533 <!-- ##### FUNCTION gst_pad_connect_filtered ##### -->
534 <para>
535
536 </para>
537
538 @srcpad: 
539 @sinkpad: 
540 @filtercaps: 
541 @Returns: 
542
543
544 <!-- ##### FUNCTION gst_pad_reconnect_filtered ##### -->
545 <para>
546
547 </para>
548
549 @srcpad: 
550 @sinkpad: 
551 @filtercaps: 
552 @Returns: 
553 <!-- # Unused Parameters # -->
554 @pad: 
555
556
557 <!-- ##### FUNCTION gst_pad_try_reconnect_filtered ##### -->
558 <para>
559
560 </para>
561
562 @srcpad: 
563 @sinkpad: 
564 @filtercaps: 
565 @Returns: 
566 <!-- # Unused Parameters # -->
567 @pad: 
568
569
570 <!-- ##### FUNCTION gst_pad_disconnect ##### -->
571 <para>
572
573 </para>
574
575 @srcpad: 
576 @sinkpad: 
577
578
579 <!-- ##### FUNCTION gst_pad_can_connect ##### -->
580 <para>
581
582 </para>
583
584 @srcpad: 
585 @sinkpad: 
586 @Returns: 
587
588
589 <!-- ##### FUNCTION gst_pad_can_connect_filtered ##### -->
590 <para>
591
592 </para>
593
594 @srcpad: 
595 @sinkpad: 
596 @filtercaps: 
597 @Returns: 
598
599
600 <!-- ##### FUNCTION gst_pad_push ##### -->
601 <para>
602
603 </para>
604
605 @pad: 
606 @buf: 
607 <!-- # Unused Parameters # -->
608 @buffer: 
609
610
611 <!-- ##### FUNCTION gst_pad_pull ##### -->
612 <para>
613
614 </para>
615
616 @pad: 
617 @Returns: 
618
619
620 <!-- ##### FUNCTION gst_pad_pullregion ##### -->
621 <para>
622
623 </para>
624
625 @pad: 
626 @type: 
627 @offset: 
628 @len: 
629 @Returns: 
630 <!-- # Unused Parameters # -->
631 @size: 
632
633
634 <!-- ##### FUNCTION gst_pad_get_bufferpool ##### -->
635 <para>
636
637 </para>
638
639 @pad: 
640 @Returns: 
641
642
643 <!-- ##### FUNCTION gst_pad_load_and_connect ##### -->
644 <para>
645
646 </para>
647
648 @self: 
649 @parent: 
650 <!-- # Unused Parameters # -->
651 @element: 
652 @elements: 
653
654
655 <!-- ##### FUNCTION gst_pad_proxy_connect ##### -->
656 <para>
657
658 </para>
659
660 @pad: 
661 @caps: 
662 @Returns: 
663
664
665 <!-- ##### FUNCTION gst_pad_get_padtemplate ##### -->
666 <para>
667
668 </para>
669
670 @pad: 
671 @Returns: 
672
673
674 <!-- ##### FUNCTION gst_pad_get_padtemplate_caps ##### -->
675 <para>
676
677 </para>
678
679 @pad: 
680 @Returns: 
681
682
683 <!-- ##### FUNCTION gst_pad_get_allowed_caps ##### -->
684 <para>
685
686 </para>
687
688 @pad: 
689 @Returns: 
690
691
692 <!-- ##### FUNCTION gst_pad_recalc_allowed_caps ##### -->
693 <para>
694
695 </para>
696
697 @pad: 
698 @Returns: 
699
700
701 <!-- ##### FUNCTION gst_pad_perform_negotiate ##### -->
702 <para>
703
704 </para>
705
706 @srcpad: 
707 @sinkpad: 
708 @Returns: 
709
710
711 <!-- ##### FUNCTION gst_pad_ghost_save_thyself ##### -->
712 <para>
713
714 </para>
715
716 @pad: 
717 @bin: 
718 @parent: 
719 @Returns: 
720
721
722 <!-- ##### FUNCTION gst_pad_peek ##### -->
723 <para>
724
725 </para>
726
727 @pad: 
728 @Returns: 
729
730
731 <!-- ##### FUNCTION gst_pad_select ##### -->
732 <para>
733
734 </para>
735
736 @padlist: 
737 @Returns: 
738
739
740 <!-- ##### FUNCTION gst_pad_selectv ##### -->
741 <para>
742
743 </para>
744
745 @pad: 
746 @Varargs: 
747 @Returns: 
748
749
750 <!-- ##### FUNCTION gst_pad_send_event ##### -->
751 <para>
752
753 </para>
754
755 @pad: 
756 @event: 
757 @Returns: 
758
759
760 <!-- ##### FUNCTION gst_pad_event_default ##### -->
761 <para>
762
763 </para>
764
765 @pad: 
766 @event: 
767
768
769 <!-- ##### FUNCTION gst_pad_set_event_function ##### -->
770 <para>
771
772 </para>
773
774 @pad: 
775 @event: 
776
777
778 <!-- ##### STRUCT GstRealPad ##### -->
779 <para>
780
781 </para>
782
783 @pad: 
784 @caps: 
785 @filter: 
786 @appfilter: 
787 @direction: 
788 @sched: 
789 @sched_private: 
790 @peer: 
791 @bufpen: 
792 @regiontype: 
793 @offset: 
794 @len: 
795 @chainfunc: 
796 @chainhandler: 
797 @getfunc: 
798 @gethandler: 
799 @eventfunc: 
800 @eventhandler: 
801 @getregionfunc: 
802 @pullregionfunc: 
803 @getcapsfunc: 
804 @connectfunc: 
805 @bufferpoolfunc: 
806 @ghostpads: 
807
808 <!-- ##### MACRO GST_RPAD_LEN ##### -->
809 <para>
810 Get the length of the region that is being pulled.
811 </para>
812
813 @pad: the real pad to query.
814
815
816 <!-- ##### MACRO GST_RPAD_OFFSET ##### -->
817 <para>
818 Get the offset of the region that is being pulled.
819 </para>
820
821 @pad: the real pad to query.
822
823
824 <!-- ##### MACRO GST_RPAD_SCHED ##### -->
825 <para>
826 Get the scheduler of this real pad.
827 </para>
828
829 @pad: the real pad to query.
830
831
832 <!-- ##### MACRO GST_RPAD_REGIONTYPE ##### -->
833 <para>
834 Get the type of the region that is being pulled.
835 </para>
836
837 @pad: the real pad to query.
838
839
840 <!-- ##### MACRO GST_RPAD_DIRECTION ##### -->
841 <para>
842 Get the direction of the real pad.
843 </para>
844
845 @pad: the realpad to query.
846
847
848 <!-- ##### MACRO GST_RPAD_CAPS ##### -->
849 <para>
850 Get the caps of the real pad.
851 </para>
852
853 @pad: the real pad to query.
854
855
856 <!-- ##### MACRO GST_RPAD_PEER ##### -->
857 <para>
858 Get the peer element of the real pad.
859 </para>
860
861 @pad: the real pad to query.
862
863
864 <!-- ##### MACRO GST_RPAD_BUFPEN ##### -->
865 <para>
866 Get the bufpen of the real pad.
867 </para>
868
869 @pad: the real pad to query.
870
871
872 <!-- ##### MACRO GST_RPAD_CHAINFUNC ##### -->
873 <para>
874 Get the chain function of the real pad.
875 </para>
876
877 @pad: the real pad to query.
878
879
880 <!-- ##### MACRO GST_RPAD_FILTER ##### -->
881 <para>
882 Get the filter from the pad
883 </para>
884
885 @pad: the pad to query
886
887
888 <!-- ##### MACRO GST_RPAD_APPFILTER ##### -->
889 <para>
890 Get the application filter for this pad
891 </para>
892
893 @pad: the pad to query
894
895
896 <!-- ##### MACRO GST_RPAD_GETFUNC ##### -->
897 <para>
898 Get get getfunction of the real pad.
899 </para>
900
901 @pad: the real pad to query.
902
903
904 <!-- ##### MACRO GST_RPAD_GETREGIONFUNC ##### -->
905 <para>
906 Get the getregion function of the real pad.
907 </para>
908
909 @pad: the real pad to query.
910
911
912 <!-- ##### MACRO GST_RPAD_PULLREGIONFUNC ##### -->
913 <para>
914 Get the pullregion function of the real pad.
915 </para>
916
917 @pad: the real pad to query.
918
919
920 <!-- ##### MACRO GST_RPAD_BUFFERPOOLFUNC ##### -->
921 <para>
922 Get the bufferpoolfunction from the real pad.
923 </para>
924
925 @pad: the real pad to query.
926
927
928 <!-- ##### MACRO GST_RPAD_CHAINHANDLER ##### -->
929 <para>
930 Get the eventhandler function from the real pad.
931 </para>
932
933 @pad: the real pad to query.
934
935
936 <!-- ##### MACRO GST_RPAD_EVENTFUNC ##### -->
937 <para>
938 Get the event function of this real pad.
939 </para>
940
941 @pad: the real pad to query.
942
943
944 <!-- ##### MACRO GST_RPAD_EVENTHANDLER ##### -->
945 <para>
946 Get the eventhandler function of this real pad.
947 </para>
948
949 @pad: the real pad to query.
950
951
952 <!-- ##### MACRO GST_RPAD_GETHANDLER ##### -->
953 <para>
954 Get the gethandler function of this real pad.
955 </para>
956
957 @pad: the real pad to query.
958
959
960 <!-- ##### MACRO GST_RPAD_CONNECTFUNC ##### -->
961 <para>
962 Get the connect function of the pad
963 </para>
964
965 @pad: the pad to query
966
967
968 <!-- ##### MACRO GST_RPAD_GETCAPSFUNC ##### -->
969 <para>
970 Get the getcaps function of this pad
971 </para>
972
973 @pad: the pad to query
974
975
976 <!-- ##### MACRO GST_GPAD_REALPAD ##### -->
977 <para>
978 Get the real pad of this ghost pad.
979 </para>
980
981 @pad: the real pad to query.
982
983
984 <!-- ##### STRUCT GstGhostPad ##### -->
985 <para>
986
987 </para>
988
989
990 <!-- ##### FUNCTION gst_ghost_pad_new ##### -->
991 <para>
992
993 </para>
994
995 @name: 
996 @pad: 
997 @Returns: 
998
999