1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Base class for all pipeline elements
7 <!-- ##### SECTION Long_Description ##### -->
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.
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
18 Do not use this in plug-ins or applications in order to retain ABI
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().
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
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().
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().
61 <!-- ##### SECTION See_Also ##### -->
63 #GstElementFactory, #GstPad
66 <!-- basic object functions -->
68 <!-- ##### STRUCT GstElement ##### -->
74 <!-- ##### SIGNAL GstElement::eos ##### -->
76 Signal emited when the element goes to PAUSED due to an end-of-stream
80 @gstelement: the object which received the signal.
82 <!-- ##### SIGNAL GstElement::error ##### -->
84 Is triggered whenever an error occured.
88 @gstelement: the object which received the signal.
89 @arg1: the error message
111 <!-- ##### SIGNAL GstElement::found-tag ##### -->
116 @gstelement: the object which received the signal.
120 <!-- ##### SIGNAL GstElement::new-pad ##### -->
122 Is triggered whenever a new pad is added to an element.
125 @gstelement: the object which received the signal.
126 @arg1: the new pad that was added
128 <!-- ##### SIGNAL GstElement::pad-removed ##### -->
130 Is triggered whenever a pad has been removed from the element.
133 @gstelement: the object which received the signal.
134 @arg1: The pad that was removed.
136 <!-- ##### SIGNAL GstElement::state-change ##### -->
138 Is triggered whenever the state of an element changes.
141 @gstelement: the object which received the signal.
142 @arg1: the new state of the object
145 <!-- ##### MACRO gst_element_get_name ##### -->
147 Gets the name of the element.
151 @Returns: the name of the element.
157 <!-- ##### MACRO gst_element_set_name ##### -->
159 Sets the name of the element, getting rid of the old name if there was one.
162 @elem: a #GstElement to set the name of.
163 @name: the new name of the element.
166 <!-- ##### FUNCTION gst_element_get_factory ##### -->
175 <!-- ##### FUNCTION gst_element_add_pad ##### -->
184 <!-- ##### FUNCTION gst_element_remove_pad ##### -->
193 <!-- ##### FUNCTION gst_element_add_ghost_pad ##### -->
204 <!-- ##### FUNCTION gst_element_remove_ghost_pad ##### -->
213 <!-- pad template manipulation -->
216 <!-- ##### FUNCTION gst_element_get_pad ##### -->
223 @Returns: GList of #GstPads
226 <!-- ##### FUNCTION gst_element_get_static_pad ##### -->
236 <!-- ##### FUNCTION gst_element_get_request_pad ##### -->
246 <!-- ##### FUNCTION gst_element_release_request_pad ##### -->
255 <!-- ##### FUNCTION gst_element_get_pad_list ##### -->
264 <!-- ##### FUNCTION gst_element_get_pad_template ##### -->
274 <!-- ##### FUNCTION gst_element_get_pad_template_list ##### -->
287 <!-- ##### FUNCTION gst_element_class_add_pad_template ##### -->
296 <!-- ##### FUNCTION gst_element_link ##### -->
306 <!-- ##### FUNCTION gst_element_link_many ##### -->
317 <!-- ##### FUNCTION gst_element_link_filtered ##### -->
328 <!-- ##### FUNCTION gst_element_link_pads ##### -->
340 <!-- ##### FUNCTION gst_element_link_pads_filtered ##### -->
353 <!-- ##### FUNCTION gst_element_unlink ##### -->
362 <!-- ##### FUNCTION gst_element_unlink_many ##### -->
372 <!-- ##### FUNCTION gst_element_unlink_pads ##### -->
383 <!-- pad manipulation -->
386 <!-- ##### FUNCTION gst_element_get_compatible_pad ##### -->
396 <!-- ##### FUNCTION gst_element_get_compatible_pad_filtered ##### -->
407 <!-- ##### FUNCTION gst_element_get_compatible_pad_template ##### -->
417 <!-- ##### FUNCTION gst_element_set_state ##### -->
427 <!-- ##### FUNCTION gst_element_get_state ##### -->
436 <!-- ##### FUNCTION gst_element_state_get_name ##### -->
445 <!-- ##### FUNCTION gst_element_wait_state_change ##### -->
453 <!-- ##### FUNCTION gst_element_set_eos ##### -->
461 <!-- ##### FUNCTION gst_element_interrupt ##### -->
470 <!-- ##### FUNCTION gst_element_yield ##### -->
478 <!-- ##### FUNCTION gst_element_release_locks ##### -->
487 <!-- ##### FUNCTION gst_element_get_clock ##### -->
496 <!-- ##### FUNCTION gst_element_set_clock ##### -->
505 <!-- ##### FUNCTION gst_element_clock_wait ##### -->
514 <!-- # Unused Parameters # -->
519 <!-- ##### FUNCTION gst_element_provides_clock ##### -->
528 <!-- ##### FUNCTION gst_element_requires_clock ##### -->
537 <!-- ##### FUNCTION gst_element_set_index ##### -->
546 <!-- ##### FUNCTION gst_element_get_index ##### -->
555 <!-- ##### FUNCTION gst_element_is_indexable ##### -->
564 <!-- ##### FUNCTION gst_element_set_loop_function ##### -->
573 <!-- ##### USER_FUNCTION GstElementLoopFunction ##### -->
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
580 @element: The element in question.
583 <!-- ##### FUNCTION gst_element_get_scheduler ##### -->
592 <!-- ##### FUNCTION gst_element_set_scheduler ##### -->
601 <!-- ##### MACRO gst_element_get_parent ##### -->
603 Gets the parent of an element.
606 @elem: a #GstElement to get the parent of.
607 @Returns: the #GstObject parent of the element.
610 <!-- ##### MACRO gst_element_set_parent ##### -->
612 Sets the parent of an element.
615 @elem: a #GstElement to set the parent of.
616 @parent: the new #GstObject parent of the object.
619 <!-- ##### FUNCTION gst_element_get_managing_bin ##### -->
630 <!-- ##### USER_FUNCTION GstElementPostRunFunction ##### -->
632 The signature of the function to execute before this element
636 @element: The element
639 <!-- ##### USER_FUNCTION GstElementPreRunFunction ##### -->
641 The signature of the function to execute after this element
645 @element: The element
648 <!-- ##### FUNCTION gst_element_disable_threadsafe_properties ##### -->
656 <!-- ##### FUNCTION gst_element_enable_threadsafe_properties ##### -->
664 <!-- ##### FUNCTION gst_element_get ##### -->
670 @first_property_name:
674 <!-- ##### FUNCTION gst_element_get_property ##### -->
684 <!-- ##### FUNCTION gst_element_get_valist ##### -->
690 @first_property_name:
694 <!-- ##### FUNCTION gst_element_set ##### -->
700 @first_property_name:
704 <!-- ##### FUNCTION gst_element_set_pending_properties ##### -->
712 <!-- ##### FUNCTION gst_element_set_property ##### -->
722 <!-- ##### FUNCTION gst_element_set_valist ##### -->
728 @first_property_name:
732 <!-- ##### FUNCTION gst_element_query ##### -->
744 <!-- ##### FUNCTION gst_element_send_event ##### -->
754 <!-- ##### FUNCTION gst_element_get_event_masks ##### -->
763 <!-- ##### FUNCTION gst_element_get_formats ##### -->
772 <!-- ##### FUNCTION gst_element_get_query_types ##### -->
781 <!-- ##### FUNCTION gst_element_convert ##### -->
794 <!-- ##### MACRO gst_element_default_deep_notify ##### -->
796 The default deep notify handler that prints out the property change
797 notifications to stdout.
802 <!-- ##### FUNCTION gst_element_default_error ##### -->
813 <!-- ##### ENUM GstElementState ##### -->
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.
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.
827 <!-- ##### ENUM GstElementStateReturn ##### -->
829 This enum defines the standard return values that an element
830 can return after a state change.
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
838 <!-- ##### MACRO GST_NUM_STATES ##### -->
840 The maximun number of states.
845 <!-- ##### MACRO GST_STATE ##### -->
847 This macro returns the current state of the element.
850 @obj: Element to return state for.
853 <!-- ##### MACRO GST_STATE_PENDING ##### -->
855 This macro returns the currently pending state of the element.
858 @obj: Element to return the pending state for.
861 <!-- ##### MACRO GST_STATE_TRANSITION ##### -->
863 Returns the state transition this object is going through.
866 @obj: the Element to return the state transition for
869 <!-- ##### MACRO GST_STATE_NULL_TO_READY ##### -->
871 The Element is going from the NULL state to the READY state.
876 <!-- ##### MACRO GST_STATE_READY_TO_PAUSED ##### -->
878 The Element is going from the READY state to the PAUSED state.
883 <!-- ##### MACRO GST_STATE_PAUSED_TO_READY ##### -->
885 The Element is going from the PAUSED state to the READY state.
890 <!-- ##### MACRO GST_STATE_PLAYING_TO_PAUSED ##### -->
892 The Element is going from the PLAYING state to the PAUSED state.
897 <!-- ##### MACRO GST_STATE_PAUSED_TO_PLAYING ##### -->
899 The Element is going from the PAUSED state to the PLAYING state.
904 <!-- ##### MACRO GST_STATE_READY_TO_NULL ##### -->
906 The Element is going from the READY state to the NULL state.
911 <!-- ##### ENUM GstElementFlags ##### -->
913 This enum defines the standard flags that an element may have.
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:
929 <!-- ##### MACRO GST_ELEMENT_IS_THREAD_SUGGESTED ##### -->
931 Queries whether the Element should be placed in a thread.
934 @obj: a #GstElement to query
937 <!-- ##### MACRO GST_ELEMENT_IS_DECOUPLED ##### -->
939 Queries if the Element is decoupled.
942 @obj: a #GstElement to query
945 <!-- ##### MACRO GST_ELEMENT_IS_EVENT_AWARE ##### -->
947 Query wether this element can handle events.
950 @obj: a #GstElement to query
953 <!-- ##### MACRO GST_ELEMENT_PARENT ##### -->
955 Get the parent object of this element.
958 @obj: a #GstElement to query
961 <!-- ##### MACRO GST_ELEMENT_NAME ##### -->
963 Gets the name of this element. Used in the core. Not ABI-compatible.
966 @obj: A #GstElement to query
969 <!-- ##### MACRO GST_ELEMENT_PADS ##### -->
971 Get the pads of this elements.
974 @obj: a #GstElement to query
977 <!-- ##### MACRO GST_ELEMENT_SCHED ##### -->
979 Get the scheduler of this element.
982 @obj: a #GstElement to query
985 <!-- ##### MACRO GST_ELEMENT_MANAGER ##### -->
987 Get the manager of this element.
990 @obj: a #GstElement to query
993 <!-- ##### MACRO GST_ELEMENT_CLOCK ##### -->
995 Get the clock of this element
998 @obj: a #GstElement to query
1001 <!-- ##### MACRO GST_ELEMENT_EVENT_MASK_FUNCTION ##### -->
1003 A helper macro to create a mask function
1006 @functionname: the name of the mask function
1010 <!-- ##### MACRO GST_ELEMENT_FORMATS_FUNCTION ##### -->
1012 Halper macro to create element format functions
1015 @functionname: The function name
1019 <!-- ##### MACRO GST_ELEMENT_QUERY_TYPE_FUNCTION ##### -->
1021 Helper macro to create query type functions
1024 @functionname: The function name
1025 @...: list of query types.