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 connect to pads on
24 other elements. Buffers flow between these connected 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 connected through their pads.
37 If the connection is straightforward, use the gst_element_connect()
38 convenience function to connect two elements, or gst_element_connect_many()
39 for more elements in a row.
40 Use gst_element_connect_filtered() to connect two elements constrained by
41 a specified set of #GstCaps.
42 For finer control, use gst_element_connect_pads() and
43 gst_element_connect_pads_filtered() to specify the pads to connect 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 <!-- ##### MACRO gst_element_destroy ##### -->
76 Destroys the element (without taking the refcount into account).
77 An application programmer should use #gst_object_unref instead to dispose
78 of an element he doesn't need anymore.
81 @element: a #GstElement to destroy
84 <!-- ##### MACRO gst_element_set_name ##### -->
86 Sets the name of the element, getting rid of the old name if there was one.
89 @element: a #GstElement to set the name of.
90 @name: the new name of the element.
92 <!-- ##### MACRO gst_element_get_name ##### -->
94 Gets the name of the element.
97 @element: a #GstElement to get the name of.
98 @Returns: the name of the element.
104 <!-- ##### FUNCTION gst_element_get_factory ##### -->
113 <!-- ##### FUNCTION gst_element_add_pad ##### -->
122 <!-- ##### FUNCTION gst_element_remove_pad ##### -->
131 <!-- ##### FUNCTION gst_element_add_ghost_pad ##### -->
142 <!-- ##### FUNCTION gst_element_remove_ghost_pad ##### -->
151 <!-- pad template manipulation -->
154 <!-- ##### FUNCTION gst_element_get_pad ##### -->
161 @Returns: GList of #GstPads
164 <!-- ##### FUNCTION gst_element_get_static_pad ##### -->
174 <!-- ##### FUNCTION gst_element_get_request_pad ##### -->
184 <!-- ##### FUNCTION gst_element_release_request_pad ##### -->
193 <!-- ##### FUNCTION gst_element_get_pad_list ##### -->
202 <!-- ##### FUNCTION gst_element_get_pad_template ##### -->
212 <!-- ##### FUNCTION gst_element_get_pad_template_list ##### -->
225 <!-- ##### FUNCTION gst_element_class_add_pad_template ##### -->
232 <!-- # Unused Parameters # -->
236 <!-- ##### FUNCTION gst_element_connect ##### -->
246 <!-- ##### FUNCTION gst_element_connect_many ##### -->
257 <!-- ##### FUNCTION gst_element_connect_filtered ##### -->
268 <!-- ##### FUNCTION gst_element_connect_pads ##### -->
280 <!-- ##### FUNCTION gst_element_connect_pads_filtered ##### -->
293 <!-- ##### FUNCTION gst_element_disconnect ##### -->
300 <!-- # Unused Parameters # -->
305 <!-- ##### FUNCTION gst_element_disconnect_many ##### -->
315 <!-- ##### FUNCTION gst_element_disconnect_pads ##### -->
326 <!-- pad manipulation -->
329 <!-- ##### FUNCTION gst_element_get_compatible_pad ##### -->
339 <!-- ##### FUNCTION gst_element_get_compatible_pad_filtered ##### -->
350 <!-- ##### FUNCTION gst_element_get_compatible_pad_template ##### -->
360 <!-- ##### FUNCTION gst_element_set_state ##### -->
370 <!-- ##### FUNCTION gst_element_get_state ##### -->
377 <!-- # Unused Parameters # -->
381 <!-- ##### FUNCTION gst_element_state_get_name ##### -->
390 <!-- ##### FUNCTION gst_element_wait_state_change ##### -->
398 <!-- ##### FUNCTION gst_element_error ##### -->
408 <!-- ##### FUNCTION gst_element_set_eos ##### -->
416 <!-- ##### FUNCTION gst_element_interrupt ##### -->
425 <!-- ##### FUNCTION gst_element_yield ##### -->
433 <!-- ##### FUNCTION gst_element_release_locks ##### -->
442 <!-- ##### FUNCTION gst_element_get_clock ##### -->
451 <!-- ##### FUNCTION gst_element_set_clock ##### -->
460 <!-- ##### FUNCTION gst_element_clock_wait ##### -->
472 <!-- ##### FUNCTION gst_element_set_loop_function ##### -->
481 <!-- ##### USER_FUNCTION GstElementLoopFunction ##### -->
483 This function type is used to specify a loop function for the element. It
484 is passed the element in question, and is expect to return only in error
488 @element: The element in question.
491 <!-- ##### FUNCTION gst_element_get_scheduler ##### -->
500 <!-- ##### FUNCTION gst_element_set_scheduler ##### -->
509 <!-- ##### MACRO gst_element_get_parent ##### -->
511 Gets the parent of an element.
514 @element: a #GstElement to get the parent of.
515 @Returns: the #GstObject parent of the element.
518 <!-- ##### MACRO gst_element_set_parent ##### -->
520 Sets the parent of an element.
523 @element: a #GstElement to set the parent of.
524 @parent: the new #GstObject parent of the object.
527 <!-- ##### FUNCTION gst_element_get_managing_bin ##### -->
538 <!-- ##### USER_FUNCTION GstElementPostRunFunction ##### -->
540 The signature of the function to execute before this element
544 @element: The element
547 <!-- ##### USER_FUNCTION GstElementPreRunFunction ##### -->
549 The signature of the function to execute after this element
553 @element: The element
556 <!-- ##### FUNCTION gst_element_disable_threadsafe_properties ##### -->
564 <!-- ##### FUNCTION gst_element_enable_threadsafe_properties ##### -->
572 <!-- ##### FUNCTION gst_element_get ##### -->
578 @first_property_name:
582 <!-- ##### FUNCTION gst_element_get_property ##### -->
592 <!-- ##### FUNCTION gst_element_get_valist ##### -->
598 @first_property_name:
602 <!-- ##### FUNCTION gst_element_set ##### -->
608 @first_property_name:
612 <!-- ##### FUNCTION gst_element_set_pending_properties ##### -->
620 <!-- ##### FUNCTION gst_element_set_property ##### -->
630 <!-- ##### FUNCTION gst_element_set_valist ##### -->
636 @first_property_name:
640 <!-- ##### FUNCTION gst_element_query ##### -->
652 <!-- ##### FUNCTION gst_element_send_event ##### -->
662 <!-- ##### ENUM GstElementState ##### -->
664 This enum defines the standard states an element may be in. You will normally
665 use gst_element_set_state() to change the state of an element.
669 @GST_STATE_VOID_PENDING:
670 @GST_STATE_NULL: Reset the state of an element.
671 @GST_STATE_READY: will make the element ready to start processing data. some
672 elements might have a non trivial way to initialize themselves.
673 @GST_STATE_PAUSED: means there really is data flowing temporary stops the data flow.
674 @GST_STATE_PLAYING: means there really is data flowing through the graph.
676 <!-- ##### ENUM GstElementStateReturn ##### -->
678 This enum defines the standard return values that an element
679 can return after a state change.
683 @GST_STATE_FAILURE: the element could not perform the state change
684 @GST_STATE_SUCCESS: the element successfully changed its state
685 @GST_STATE_ASYNC: the element will asynchronously change its state as soon as possible
687 <!-- ##### MACRO GST_NUM_STATES ##### -->
689 The maximun number of states.
694 <!-- ##### MACRO GST_STATE ##### -->
696 This macro returns the current state of the element.
699 @obj: Element to return state for.
702 <!-- ##### MACRO GST_STATE_PENDING ##### -->
704 This macro returns the currently pending state of the element.
707 @obj: Element to return the pending state for.
710 <!-- ##### MACRO GST_STATE_TRANSITION ##### -->
712 Returns the state transition this object is going through.
715 @obj: the Element to return the state transition for
718 <!-- ##### MACRO GST_STATE_NULL_TO_READY ##### -->
720 The Element is going from the NULL state to the READY state.
725 <!-- ##### MACRO GST_STATE_READY_TO_PAUSED ##### -->
727 The Element is going from the READY state to the PAUSED state.
732 <!-- ##### MACRO GST_STATE_PAUSED_TO_READY ##### -->
734 The Element is going from the PAUSED state to the READY state.
739 <!-- ##### MACRO GST_STATE_PLAYING_TO_PAUSED ##### -->
741 The Element is going from the PLAYING state to the PAUSED state.
746 <!-- ##### MACRO GST_STATE_PAUSED_TO_PLAYING ##### -->
748 The Element is going from the PAUSED state to the PLAYING state.
753 <!-- ##### MACRO GST_STATE_READY_TO_NULL ##### -->
755 The Element is going from the READY state to the NULL state.
760 <!-- ##### ENUM GstElementFlags ##### -->
762 This enum defines the standard flags that an element may have.
765 @GST_ELEMENT_COMPLEX:
766 @GST_ELEMENT_DECOUPLED:
767 @GST_ELEMENT_THREAD_SUGGESTED:
768 @GST_ELEMENT_INFINITE_LOOP:
769 @GST_ELEMENT_NEW_LOOPFUNC:
770 @GST_ELEMENT_EVENT_AWARE:
771 @GST_ELEMENT_USE_THREADSAFE_PROPERTIES:
772 @GST_ELEMENT_SCHEDULER_PRIVATE1:
773 @GST_ELEMENT_SCHEDULER_PRIVATE2:
774 @GST_ELEMENT_FLAG_LAST:
776 <!-- ##### MACRO GST_ELEMENT_IS_THREAD_SUGGESTED ##### -->
778 Queries whether the Element should be placed in a thread.
781 @obj: a #GstElement to query
784 <!-- ##### MACRO GST_ELEMENT_IS_DECOUPLED ##### -->
786 Queries if the Element is decoupled.
789 @obj: a #GstElement to query
792 <!-- ##### MACRO GST_ELEMENT_IS_EOS ##### -->
794 Query wether this element is in the End Of Stream state.
797 @obj: a #GstElement to query
800 <!-- ##### MACRO GST_ELEMENT_IS_EVENT_AWARE ##### -->
802 Query wether this element can handle events.
805 @obj: a #GstElement to query
808 <!-- ##### MACRO GST_ELEMENT_PARENT ##### -->
810 Get the parent object of this element.
813 @obj: a #GstElement to query
816 <!-- ##### MACRO GST_ELEMENT_NAME ##### -->
818 Gets the name of this element. Used in the core. Not ABI-compatible.
821 @obj: A #GstElement to query
824 <!-- ##### MACRO GST_ELEMENT_PADS ##### -->
826 Get the pads of this elements.
829 @obj: a #GstElement to query
832 <!-- ##### MACRO GST_ELEMENT_SCHED ##### -->
834 Get the scheduler of this element.
837 @obj: a #GstElement to query
840 <!-- ##### MACRO GST_ELEMENT_MANAGER ##### -->
842 Get the manager of this element.
845 @obj: a #GstElement to query
848 <!-- ##### MACRO GST_ELEMENT_CLOCK ##### -->
850 Get the clock of this element
853 @obj: a #GstElement to query
856 <!-- ##### SIGNAL GstElement::eos ##### -->
861 @gstelement: the object which received the signal.
863 <!-- ##### SIGNAL GstElement::error ##### -->
865 Is trigered whenever an error occured
869 @gstelement: the object which received the signal.
870 @arg1: the error message
873 <!-- ##### SIGNAL GstElement::new-pad ##### -->
875 Is trigered whenever a new pad is added to an element
878 @gstelement: the object which received the signal.
879 @arg1: the new pad that was added
881 <!-- ##### SIGNAL GstElement::pad-removed ##### -->
886 @gstelement: the object which received the signal.
887 @arg1: The pad that was removed.
889 <!-- ##### SIGNAL GstElement::state-change ##### -->
891 Is trigered whenever the state of an element changes
894 @gstelement: the object which received the signal.
895 @arg1: the new state of the object