parts of the patch submitted in bug #113913
[platform/upstream/gstreamer.git] / docs / gst / tmpl / gstelement.sgml
1 <!-- ##### SECTION Title ##### -->
2 GstElement
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Base class for all pipeline elements
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 GstElement is the base class needed to construct an element that can be
10 used in a GStreamer pipeline.  As such, it is not a functional entity, and
11 cannot do anything when placed in a pipeline.
12 </para>
13
14 <para>
15 The name of a GstElement can be get with gst_element_get_name() and set with
16 gst_element_set_name().  For speed, GST_ELEMENT_NAME() can be used in the 
17 core.
18 Do not use this in plug-ins or applications in order to retain ABI 
19 compatibility.
20 </para>
21
22 <para>
23 All elements have pads (of the type #GstPad).  These pads link to pads on
24 other elements.  Buffers flow between these linked pads.
25 A GstElement has a GList of #GstPad structures for all their input (or sink)
26 and output (or source) pads.  
27 Core and plug-in writers can add and remove pads with gst_element_add_pad()
28 and gst_element_remove_pad().
29 Application writers can manipulate ghost pads (copies of real pads inside a bin)
30 with gst_element_add_ghost_pad() and gst_element_remove_ghost_pad().
31 A pad of an element can be retrieved by name with gst_element_get_pad().
32 A GList of all pads can be retrieved with gst_element_get_pad_list().
33 </para>
34
35 <para>
36 Elements can be linked through their pads.
37 If the link is straightforward, use the gst_element_link() 
38 convenience function to link two elements, or gst_element_link_many() 
39 for more elements in a row.
40 Use gst_element_link_filtered() to link two elements constrained by
41 a specified set of #GstCaps.
42 For finer control, use gst_element_link_pads() and 
43 gst_element_link_pads_filtered() to specify the pads to link on 
44 each element by name.
45 </para>
46
47 <para>
48 Each element has a state (see #GstElementState).  You can get and set the state
49 of an element with gst_element_get_state() and gst_element_set_state().  
50 You can wait for an element to change it's state with gst_element_wait_state_change().
51 To get a string representation of a #GstElementState, use 
52 gst_element_state_get_name().
53 </para>
54
55 <para>
56 You can get and set a #GstClock on an element using gst_element_get_clock()
57 and gst_element_set_clock().  You can wait for the clock to reach a given
58 #GstClockTime using gst_element_clock_wait().
59 </para>
60
61 <!-- ##### SECTION See_Also ##### -->
62 <para>
63 #GstElementFactory, #GstPad
64 </para>
65
66 <!-- basic object functions -->
67
68 <!-- ##### STRUCT GstElement ##### -->
69 <para>
70 The element object
71 </para>
72
73
74 <!-- ##### SIGNAL GstElement::eos ##### -->
75 <para>
76 Signal emited when the element goes to PAUSED due to an end-of-stream
77 condition.
78 </para>
79
80 @gstelement: the object which received the signal.
81
82 <!-- ##### SIGNAL GstElement::error ##### -->
83 <para>
84 Is triggered whenever an error occured.
85
86 </para>
87
88 @gstelement: the object which received the signal.
89 @arg1: the error message
90 @arg2: 
91 @:
92 @:
93 @:
94 @:
95 @:
96 @:
97 @:
98 @:
99 @:
100 @:
101 @:
102 @:
103 @:
104 @:
105 @:
106 @:
107 @:
108 @:
109 @: 
110
111 <!-- ##### SIGNAL GstElement::found-tag ##### -->
112 <para>
113
114 </para>
115
116 @gstelement: the object which received the signal.
117 @arg1: 
118 @arg2: 
119
120 <!-- ##### SIGNAL GstElement::new-pad ##### -->
121 <para>
122 Is triggered whenever a new pad is added to an element.
123 </para>
124
125 @gstelement: the object which received the signal.
126 @arg1: the new pad that was added
127
128 <!-- ##### SIGNAL GstElement::pad-removed ##### -->
129 <para>
130 Is triggered whenever a pad has been removed from the element.
131 </para>
132
133 @gstelement: the object which received the signal.
134 @arg1: The pad that was removed.
135
136 <!-- ##### SIGNAL GstElement::state-change ##### -->
137 <para>
138 Is triggered whenever the state of an element changes.
139 </para>
140
141 @gstelement: the object which received the signal.
142 @arg1: the new state of the object
143 @arg2: 
144
145 <!-- ##### MACRO gst_element_get_name ##### -->
146 <para>
147 Gets the name of the element.
148 </para>
149
150 @elem: 
151 @Returns: the name of the element.
152
153
154 <!-- link -->
155
156
157 <!-- ##### MACRO gst_element_set_name ##### -->
158 <para>
159 Sets the name of the element, getting rid of the old name if there was one.
160 </para>
161
162 @elem: a #GstElement to set the name of.
163 @name: the new name of the element.
164
165
166 <!-- ##### FUNCTION gst_element_get_factory ##### -->
167 <para>
168
169 </para>
170
171 @element: 
172 @Returns: 
173
174
175 <!-- ##### FUNCTION gst_element_add_pad ##### -->
176 <para>
177
178 </para>
179
180 @element: 
181 @pad: 
182
183
184 <!-- ##### FUNCTION gst_element_remove_pad ##### -->
185 <para>
186
187 </para>
188
189 @element: 
190 @pad: 
191
192
193 <!-- ##### FUNCTION gst_element_add_ghost_pad ##### -->
194 <para>
195
196 </para>
197
198 @element: 
199 @pad: 
200 @name: 
201 @Returns: 
202
203
204 <!-- ##### FUNCTION gst_element_remove_ghost_pad ##### -->
205 <para>
206
207 </para>
208
209 @element: 
210 @pad: 
211
212
213 <!-- pad template manipulation -->
214
215
216 <!-- ##### FUNCTION gst_element_get_pad ##### -->
217 <para>
218
219 </para>
220
221 @element: 
222 @name: 
223 @Returns: GList of #GstPads
224
225
226 <!-- ##### FUNCTION gst_element_get_static_pad ##### -->
227 <para>
228
229 </para>
230
231 @element: 
232 @name: 
233 @Returns: 
234
235
236 <!-- ##### FUNCTION gst_element_get_request_pad ##### -->
237 <para>
238
239 </para>
240
241 @element: 
242 @name: 
243 @Returns: 
244
245
246 <!-- ##### FUNCTION gst_element_release_request_pad ##### -->
247 <para>
248
249 </para>
250
251 @element: 
252 @pad: 
253
254
255 <!-- ##### FUNCTION gst_element_get_pad_list ##### -->
256 <para>
257
258 </para>
259
260 @element: 
261 @Returns: 
262
263
264 <!-- ##### FUNCTION gst_element_get_pad_template ##### -->
265 <para>
266
267 </para>
268
269 @element: 
270 @name: 
271 @Returns: 
272
273
274 <!-- ##### FUNCTION gst_element_get_pad_template_list ##### -->
275 <para>
276
277 </para>
278
279 @element: 
280 @Returns: 
281
282
283
284 <!-- scheduling -->
285
286
287 <!-- ##### FUNCTION gst_element_class_add_pad_template ##### -->
288 <para>
289
290 </para>
291
292 @klass: 
293 @templ: 
294
295
296 <!-- ##### FUNCTION gst_element_link ##### -->
297 <para>
298
299 </para>
300
301 @src: 
302 @dest: 
303 @Returns: 
304
305
306 <!-- ##### FUNCTION gst_element_link_many ##### -->
307 <para>
308
309 </para>
310
311 @element_1: 
312 @element_2: 
313 @Varargs: 
314 @Returns: 
315
316
317 <!-- ##### FUNCTION gst_element_link_filtered ##### -->
318 <para>
319
320 </para>
321
322 @src: 
323 @dest: 
324 @filtercaps: 
325 @Returns: 
326
327
328 <!-- ##### FUNCTION gst_element_link_pads ##### -->
329 <para>
330
331 </para>
332
333 @src: 
334 @srcpadname: 
335 @dest: 
336 @destpadname: 
337 @Returns: 
338
339
340 <!-- ##### FUNCTION gst_element_link_pads_filtered ##### -->
341 <para>
342
343 </para>
344
345 @src: 
346 @srcpadname: 
347 @dest: 
348 @destpadname: 
349 @filtercaps: 
350 @Returns: 
351
352
353 <!-- ##### FUNCTION gst_element_unlink ##### -->
354 <para>
355
356 </para>
357
358 @src: 
359 @dest: 
360
361
362 <!-- ##### FUNCTION gst_element_unlink_many ##### -->
363 <para>
364
365 </para>
366
367 @element_1: 
368 @element_2: 
369 @Varargs: 
370
371
372 <!-- ##### FUNCTION gst_element_unlink_pads ##### -->
373 <para>
374
375 </para>
376
377 @src: 
378 @srcpadname: 
379 @dest: 
380 @destpadname: 
381
382
383 <!-- pad manipulation -->
384
385
386 <!-- ##### FUNCTION gst_element_get_compatible_pad ##### -->
387 <para>
388
389 </para>
390
391 @element: 
392 @pad: 
393 @Returns: 
394
395
396 <!-- ##### FUNCTION gst_element_get_compatible_pad_filtered ##### -->
397 <para>
398
399 </para>
400
401 @element: 
402 @pad: 
403 @filtercaps: 
404 @Returns: 
405
406
407 <!-- ##### FUNCTION gst_element_get_compatible_pad_template ##### -->
408 <para>
409
410 </para>
411
412 @element: 
413 @compattempl: 
414 @Returns: 
415
416
417 <!-- ##### FUNCTION gst_element_set_state ##### -->
418 <para>
419
420 </para>
421
422 @element: 
423 @state: 
424 @Returns: 
425
426
427 <!-- ##### FUNCTION gst_element_get_state ##### -->
428 <para>
429
430 </para>
431
432 @element: 
433 @Returns: 
434
435
436 <!-- ##### FUNCTION gst_element_state_get_name ##### -->
437 <para>
438
439 </para>
440
441 @state: 
442 @Returns: 
443
444
445 <!-- ##### FUNCTION gst_element_wait_state_change ##### -->
446 <para>
447
448 </para>
449
450 @element: 
451
452
453 <!-- ##### FUNCTION gst_element_set_eos ##### -->
454 <para>
455
456 </para>
457
458 @element: 
459
460
461 <!-- ##### FUNCTION gst_element_interrupt ##### -->
462 <para>
463
464 </para>
465
466 @element: 
467 @Returns: 
468
469
470 <!-- ##### FUNCTION gst_element_yield ##### -->
471 <para>
472
473 </para>
474
475 @element: 
476
477
478 <!-- ##### FUNCTION gst_element_release_locks ##### -->
479 <para>
480
481 </para>
482
483 @element: 
484 @Returns: 
485
486
487 <!-- ##### FUNCTION gst_element_get_clock ##### -->
488 <para>
489
490 </para>
491
492 @element: 
493 @Returns: 
494
495
496 <!-- ##### FUNCTION gst_element_set_clock ##### -->
497 <para>
498
499 </para>
500
501 @element: 
502 @clock: 
503
504
505 <!-- ##### FUNCTION gst_element_clock_wait ##### -->
506 <para>
507
508 </para>
509
510 @element: 
511 @id: 
512 @jitter: 
513 @Returns: 
514 <!-- # Unused Parameters # -->
515 @clock: 
516 @time: 
517
518
519 <!-- ##### FUNCTION gst_element_provides_clock ##### -->
520 <para>
521
522 </para>
523
524 @element: 
525 @Returns: 
526
527
528 <!-- ##### FUNCTION gst_element_requires_clock ##### -->
529 <para>
530
531 </para>
532
533 @element: 
534 @Returns: 
535
536
537 <!-- ##### FUNCTION gst_element_set_index ##### -->
538 <para>
539
540 </para>
541
542 @element: 
543 @index: 
544
545
546 <!-- ##### FUNCTION gst_element_get_index ##### -->
547 <para>
548
549 </para>
550
551 @element: 
552 @Returns: 
553
554
555 <!-- ##### FUNCTION gst_element_is_indexable ##### -->
556 <para>
557
558 </para>
559
560 @element: 
561 @Returns: 
562
563
564 <!-- ##### FUNCTION gst_element_set_loop_function ##### -->
565 <para>
566
567 </para>
568
569 @element: 
570 @loop: 
571
572
573 <!-- ##### USER_FUNCTION GstElementLoopFunction ##### -->
574 <para>
575 This function type is used to specify a loop function for the element.  It
576 is passed the element in question, and is expect to return only in error
577 circumstances.
578 </para>
579
580 @element: The element in question.
581
582
583 <!-- ##### FUNCTION gst_element_get_scheduler ##### -->
584 <para>
585
586 </para>
587
588 @element: 
589 @Returns: 
590
591
592 <!-- ##### FUNCTION gst_element_set_scheduler ##### -->
593 <para>
594
595 </para>
596
597 @element: 
598 @sched: 
599
600
601 <!-- ##### MACRO gst_element_get_parent ##### -->
602 <para>
603 Gets the parent of an element.
604 </para>
605
606 @elem: a #GstElement to get the parent of.
607 @Returns: the #GstObject parent of the element.
608
609
610 <!-- ##### MACRO gst_element_set_parent ##### -->
611 <para>
612 Sets the parent of an element.
613 </para>
614
615 @elem: a #GstElement to set the parent of.
616 @parent:  the new #GstObject parent of the object.
617
618
619 <!-- ##### FUNCTION gst_element_get_managing_bin ##### -->
620 <para>
621
622 </para>
623
624 @element: 
625 @Returns: 
626
627 <!-- clocking -->
628
629
630 <!-- ##### USER_FUNCTION GstElementPostRunFunction ##### -->
631 <para>
632 The signature of the function to execute before this element
633 is scheduled.
634 </para>
635
636 @element: The element
637
638
639 <!-- ##### USER_FUNCTION GstElementPreRunFunction ##### -->
640 <para>
641 The signature of the function to execute after this element
642 is scheduled.
643 </para>
644
645 @element: The element
646
647
648 <!-- ##### FUNCTION gst_element_disable_threadsafe_properties ##### -->
649 <para>
650
651 </para>
652
653 @element: 
654
655
656 <!-- ##### FUNCTION gst_element_enable_threadsafe_properties ##### -->
657 <para>
658
659 </para>
660
661 @element: 
662
663
664 <!-- ##### FUNCTION gst_element_get ##### -->
665 <para>
666
667 </para>
668
669 @element: 
670 @first_property_name: 
671 @Varargs: 
672
673
674 <!-- ##### FUNCTION gst_element_get_property ##### -->
675 <para>
676
677 </para>
678
679 @element: 
680 @property_name: 
681 @value: 
682
683
684 <!-- ##### FUNCTION gst_element_get_valist ##### -->
685 <para>
686
687 </para>
688
689 @element: 
690 @first_property_name: 
691 @var_args: 
692
693
694 <!-- ##### FUNCTION gst_element_set ##### -->
695 <para>
696
697 </para>
698
699 @element: 
700 @first_property_name: 
701 @Varargs: 
702
703
704 <!-- ##### FUNCTION gst_element_set_pending_properties ##### -->
705 <para>
706
707 </para>
708
709 @element: 
710
711
712 <!-- ##### FUNCTION gst_element_set_property ##### -->
713 <para>
714
715 </para>
716
717 @element: 
718 @property_name: 
719 @value: 
720
721
722 <!-- ##### FUNCTION gst_element_set_valist ##### -->
723 <para>
724
725 </para>
726
727 @element: 
728 @first_property_name: 
729 @var_args: 
730
731
732 <!-- ##### FUNCTION gst_element_query ##### -->
733 <para>
734
735 </para>
736
737 @element: 
738 @type: 
739 @format: 
740 @value: 
741 @Returns: 
742
743
744 <!-- ##### FUNCTION gst_element_send_event ##### -->
745 <para>
746
747 </para>
748
749 @element: 
750 @event: 
751 @Returns: 
752
753
754 <!-- ##### FUNCTION gst_element_get_event_masks ##### -->
755 <para>
756
757 </para>
758
759 @element: 
760 @Returns: 
761
762
763 <!-- ##### FUNCTION gst_element_get_formats ##### -->
764 <para>
765
766 </para>
767
768 @element: 
769 @Returns: 
770
771
772 <!-- ##### FUNCTION gst_element_get_query_types ##### -->
773 <para>
774
775 </para>
776
777 @element: 
778 @Returns: 
779
780
781 <!-- ##### FUNCTION gst_element_convert ##### -->
782 <para>
783
784 </para>
785
786 @element: 
787 @src_format: 
788 @src_value: 
789 @dest_format: 
790 @dest_value: 
791 @Returns: 
792
793
794 <!-- ##### MACRO gst_element_default_deep_notify ##### -->
795 <para>
796 The default deep notify handler that prints out the property change
797 notifications to stdout.
798 </para>
799
800
801
802 <!-- ##### FUNCTION gst_element_default_error ##### -->
803 <para>
804
805 </para>
806
807 @object: 
808 @orig: 
809 @error: 
810 @debug: 
811
812
813 <!-- ##### ENUM GstElementState ##### -->
814 <para>
815 This enum defines the standard states an element may be in.  You will normally
816 use gst_element_set_state() to change the state of an element.
817
818 </para>
819
820 @GST_STATE_VOID_PENDING: 
821 @GST_STATE_NULL: Reset the state of an element.
822 @GST_STATE_READY: will make the element ready to start processing data. some
823 elements might have a non trivial way to initialize themselves.
824 @GST_STATE_PAUSED: means there really is data flowing temporary stops the data flow.
825 @GST_STATE_PLAYING: means there really is data flowing through the graph.
826
827 <!-- ##### ENUM GstElementStateReturn ##### -->
828 <para>
829 This enum defines the standard return values that an element
830 can return after a state change.
831
832 </para>
833
834 @GST_STATE_FAILURE: the element could not perform the state change
835 @GST_STATE_SUCCESS: the element successfully changed its state
836 @GST_STATE_ASYNC: the element will asynchronously change its state as soon as possible
837
838 <!-- ##### MACRO GST_NUM_STATES ##### -->
839 <para>
840 The maximun number of states.
841 </para>
842
843
844
845 <!-- ##### MACRO GST_STATE ##### -->
846 <para>
847 This macro returns the current state of the element.
848 </para>
849
850 @obj: Element to return state for.
851
852
853 <!-- ##### MACRO GST_STATE_PENDING ##### -->
854 <para>
855 This macro returns the currently pending state of the element.
856 </para>
857
858 @obj: Element to return the pending state for.
859
860
861 <!-- ##### MACRO GST_STATE_TRANSITION ##### -->
862 <para>
863 Returns the state transition this object is going through.
864 </para>
865
866 @obj: the Element to return the state transition for
867
868
869 <!-- ##### MACRO GST_STATE_NULL_TO_READY ##### -->
870 <para>
871 The Element is going from the NULL state to the READY state.
872 </para>
873
874
875
876 <!-- ##### MACRO GST_STATE_READY_TO_PAUSED ##### -->
877 <para>
878 The Element is going from the READY state to the PAUSED state.
879 </para>
880
881
882
883 <!-- ##### MACRO GST_STATE_PAUSED_TO_READY ##### -->
884 <para>
885 The Element is going from the PAUSED state to the READY state.
886 </para>
887
888
889
890 <!-- ##### MACRO GST_STATE_PLAYING_TO_PAUSED ##### -->
891 <para>
892 The Element is going from the PLAYING state to the PAUSED state.
893 </para>
894
895
896
897 <!-- ##### MACRO GST_STATE_PAUSED_TO_PLAYING ##### -->
898 <para>
899 The Element is going from the PAUSED state to the PLAYING state.
900 </para>
901
902
903
904 <!-- ##### MACRO GST_STATE_READY_TO_NULL ##### -->
905 <para>
906 The Element is going from the READY state to the NULL state.
907 </para>
908
909
910
911 <!-- ##### ENUM GstElementFlags ##### -->
912 <para>
913 This enum defines the standard flags that an element may have.
914 </para>
915
916 @GST_ELEMENT_COMPLEX: 
917 @GST_ELEMENT_DECOUPLED: 
918 @GST_ELEMENT_THREAD_SUGGESTED: 
919 @GST_ELEMENT_INFINITE_LOOP: 
920 @GST_ELEMENT_NEW_LOOPFUNC: 
921 @GST_ELEMENT_EVENT_AWARE: 
922 @GST_ELEMENT_USE_THREADSAFE_PROPERTIES: 
923 @GST_ELEMENT_SCHEDULER_PRIVATE1: 
924 @GST_ELEMENT_SCHEDULER_PRIVATE2: 
925 @GST_ELEMENT_LOCKED_STATE: 
926 @GST_ELEMENT_IN_ERROR: 
927 @GST_ELEMENT_FLAG_LAST: 
928
929 <!-- ##### MACRO GST_ELEMENT_IS_THREAD_SUGGESTED ##### -->
930 <para>
931 Queries whether the Element should be placed in a thread.
932 </para>
933
934 @obj: a #GstElement to query
935
936
937 <!-- ##### MACRO GST_ELEMENT_IS_DECOUPLED ##### -->
938 <para>
939 Queries if the Element is decoupled.
940 </para>
941
942 @obj: a #GstElement to query
943
944
945 <!-- ##### MACRO GST_ELEMENT_IS_EVENT_AWARE ##### -->
946 <para>
947 Query wether this element can handle events.
948 </para>
949
950 @obj: a #GstElement to query
951
952
953 <!-- ##### MACRO GST_ELEMENT_PARENT ##### -->
954 <para>
955 Get the parent object of this element.
956 </para>
957
958 @obj: a #GstElement to query
959
960
961 <!-- ##### MACRO GST_ELEMENT_NAME ##### -->
962 <para>
963 Gets the name of this element.  Used in the core.  Not ABI-compatible.
964 </para>
965
966 @obj: A #GstElement to query
967
968
969 <!-- ##### MACRO GST_ELEMENT_PADS ##### -->
970 <para>
971 Get the pads of this elements.
972 </para>
973
974 @obj: a #GstElement to query
975
976
977 <!-- ##### MACRO GST_ELEMENT_SCHED ##### -->
978 <para>
979 Get the scheduler of this element.
980 </para>
981
982 @obj: a #GstElement to query
983
984
985 <!-- ##### MACRO GST_ELEMENT_MANAGER ##### -->
986 <para>
987 Get the manager of this element.
988 </para>
989
990 @obj: a #GstElement to query
991
992
993 <!-- ##### MACRO GST_ELEMENT_CLOCK ##### -->
994 <para>
995 Get the clock of this element
996 </para>
997
998 @obj: a #GstElement to query
999
1000
1001 <!-- ##### MACRO GST_ELEMENT_EVENT_MASK_FUNCTION ##### -->
1002 <para>
1003 A helper macro to create a mask function
1004 </para>
1005
1006 @functionname: the name of the mask function
1007 @...: Masks
1008
1009
1010 <!-- ##### MACRO GST_ELEMENT_FORMATS_FUNCTION ##### -->
1011 <para>
1012 Halper macro to create element format functions
1013 </para>
1014
1015 @functionname: The function name
1016 @...: formats
1017
1018
1019 <!-- ##### MACRO GST_ELEMENT_QUERY_TYPE_FUNCTION ##### -->
1020 <para>
1021 Helper macro to create query type functions
1022 </para>
1023
1024 @functionname: The function name
1025 @...: list of query types.
1026
1027