Klasse Element

Alle implementierten Schnittstellen:
PointerInterface
Bekannte direkte Unterklassen:
Bin

public class Element extends PropertyHolder
GstElement is the abstract base class needed to construct an element that
can be used in a GStreamer pipeline. Please refer to the plugin writers
guide for more information on creating #GstElement subclasses.

The name of a #GstElement can be get with gst_element_get_name() and set with
gst_element_set_name(). For speed, GST_ELEMENT_NAME() can be used in the
core when using the appropriate locking. Do not use this in plug-ins or
applications in order to retain ABI compatibility.

Elements can have pads (of the type #GstPad). These pads link to pads on
other elements. #GstBuffer flow between these linked pads.
A #GstElement has a #GList of #GstPad structures for all their input (or sink)
and output (or source) pads.
Core and plug-in writers can add and remove pads with gst_element_add_pad()
and gst_element_remove_pad().

An existing pad of an element can be retrieved by name with
gst_element_get_static_pad(). A new dynamic pad can be created using
gst_element_request_pad() with a #GstPadTemplate.
An iterator of all pads can be retrieved with gst_element_iterate_pads().

Elements can be linked through their pads.
If the link is straightforward, use the gst_element_link()
convenience function to link two elements, or gst_element_link_many()
for more elements in a row.
Use gst_element_link_filtered() to link two elements constrained by
a specified set of #GstCaps.
For finer control, use gst_element_link_pads() and
gst_element_link_pads_filtered() to specify the pads to link on
each element by name.

Each element has a state (see #GstState). You can get and set the state
of an element with gst_element_get_state() and gst_element_set_state().
Setting a state triggers a #GstStateChange. To get a string representation
of a #GstState, use gst_element_state_get_name().

You can get and set a #GstClock on an element using gst_element_get_clock()
and gst_element_set_clock().
Some elements can provide a clock for the pipeline if
the #GST_ELEMENT_FLAG_PROVIDE_CLOCK flag is set. With the
gst_element_provide_clock() method one can retrieve the clock provided by
such an element.
Not all elements require a clock to operate correctly. If the
#GST_ELEMENT_FLAG_REQUIRE_CLOCK() flag is set, a clock should be set on the
element with gst_element_set_clock().

Note that clock selection and distribution is normally handled by the
toplevel #GstPipeline so the clock functions are only to be used in very
specific situations.

https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html

  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • abortState

      public void abortState()
      Abort the state change of the element. This function is used
      by elements that do asynchronous state changes and find out
      something is wrong.

      This function should be called with the STATE_LOCK held.

      MT safe.
    • addPad

      public boolean addPad(@Nonnull Pad pad)
      Adds a pad (link point) to @element. @pad's parent will be set to @element;
      see gst_object_set_parent() for refcounting information.

      Pads are automatically activated when added in the PAUSED or PLAYING
      state.

      The pad and the element should be unlocked when calling this function.

      This function will emit the #GstElement::pad-added signal on the element.
      Parameter:
      pad - the #GstPad to add to the element.
      Gibt zurück:
      %TRUE if the pad could be added. This function can fail when a pad with the same name already existed or the pad already had another parent. MT safe.
    • addPropertyDeepNotifyWatch

      public long addPropertyDeepNotifyWatch(@Nullable Str property_name, boolean include_value)
      Parameter:
      property_name - name of property to watch for changes, or NULL to watch all properties
      include_value - whether to include the new property value in the message
      Gibt zurück:
      a watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.
    • addPropertyDeepNotifyWatch

      public long addPropertyDeepNotifyWatch(String property_name, boolean include_value)
      Parameter:
      property_name - name of property to watch for changes, or NULL to watch all properties
      include_value - whether to include the new property value in the message
      Gibt zurück:
      a watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.
    • addPropertyNotifyWatch

      public long addPropertyNotifyWatch(@Nullable Str property_name, boolean include_value)
      Parameter:
      property_name - name of property to watch for changes, or NULL to watch all properties
      include_value - whether to include the new property value in the message
      Gibt zurück:
      a watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.
    • addPropertyNotifyWatch

      public long addPropertyNotifyWatch(String property_name, boolean include_value)
      Parameter:
      property_name - name of property to watch for changes, or NULL to watch all properties
      include_value - whether to include the new property value in the message
      Gibt zurück:
      a watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.
    • callAsync

      public void callAsync(Element.OnElementCallAsyncFunc func, @Nullable Pointer user_data, Element.OnDestroyNotify destroy_notify)
      Calls @func from another thread and passes @user_data to it. This is to be
      used for cases when a state change has to be performed from a streaming
      thread, directly via gst_element_set_state() or indirectly e.g. via SEEK
      events.

      Calling those functions directly from the streaming thread will cause
      deadlocks in many situations, as they might involve waiting for the
      streaming thread to shut down from this very streaming thread.

      MT safe.
      Parameter:
      func - Function to call asynchronously from another thread
      user_data - Data to pass to @func
      destroy_notify - GDestroyNotify for @user_data
    • changeState

      public int changeState(int transition)
      Perform @transition on @element.

      This function must be called with STATE_LOCK held and is mainly used
      internally.
      Parameter:
      transition - the requested transition
      Gibt zurück:
      the #GstStateChangeReturn of the state transition.
    • continueState

      public int continueState(int ret)
      Commit the state change of the element and proceed to the next
      pending state if any. This function is used
      by elements that do asynchronous state changes.
      The core will normally call this method automatically when an
      element returned %GST_STATE_CHANGE_SUCCESS from the state change function.

      If after calling this method the element still has not reached
      the pending state, the next state change is performed.

      This method is used internally and should normally not be called by plugins
      or applications.

      This function must be called with STATE_LOCK held.
      Parameter:
      ret - The previous state return value
      Gibt zurück:
      The result of the commit state change. MT safe.
    • createAllPads

      public void createAllPads()
      Creates a pad for each pad template that is always available.
      This function is only useful during object initialization of
      subclasses of #GstElement.
    • decorateStreamId

      public Str decorateStreamId(@Nonnull Str stream_id)
      Creates a stream-id for @element by combining the upstream information with
      the @stream_id.

      This function generates an unique stream-id by getting the upstream
      stream-start event stream ID and appending @stream_id to it. If the element
      has no sinkpad it will generate an upstream stream-id by doing an URI query
      on the element and in the worst case just uses a random number. Source
      elements that don't implement the URI handler interface should ideally
      generate a unique, deterministic stream-id manually instead.

      Since stream IDs are sorted alphabetically, any numbers in the stream ID
      should be printed with a fixed number of characters, preceded by 0's, such as
      by using the format \%03u instead of \%u.
      Parameter:
      stream_id - The stream-id
      Gibt zurück:
      A stream-id for @element.
    • decorateStreamId

      public Str decorateStreamId(String stream_id)
      Creates a stream-id for @element by combining the upstream information with
      the @stream_id.

      This function generates an unique stream-id by getting the upstream
      stream-start event stream ID and appending @stream_id to it. If the element
      has no sinkpad it will generate an upstream stream-id by doing an URI query
      on the element and in the worst case just uses a random number. Source
      elements that don't implement the URI handler interface should ideally
      generate a unique, deterministic stream-id manually instead.

      Since stream IDs are sorted alphabetically, any numbers in the stream ID
      should be printed with a fixed number of characters, preceded by 0's, such as
      by using the format \%03u instead of \%u.
      Parameter:
      stream_id - The stream-id
      Gibt zurück:
      A stream-id for @element.
    • decorateStreamIdPrintf

      public Str decorateStreamIdPrintf(@Nonnull Str format, Object... _ellipsis)
      Creates a stream-id for @element by combining the upstream information with
      the @format.

      This function generates an unique stream-id by getting the upstream
      stream-start event stream ID and appending the stream-id to it. If the element
      has no sinkpad it will generate an upstream stream-id by doing an URI query
      on the element and in the worst case just uses a random number. Source
      elements that don't implement the URI handler interface should ideally
      generate a unique, deterministic stream-id manually instead.

      Since stream IDs are sorted alphabetically, any numbers in the stream ID
      should be printed with a fixed number of characters, preceded by 0's, such as
      by using the format \%03u instead of \%u.
      Parameter:
      format - The stream-id
      _ellipsis -
      Gibt zurück:
      A stream-id for @element.
    • decorateStreamIdPrintf

      public Str decorateStreamIdPrintf(String format, Object... _ellipsis)
      Creates a stream-id for @element by combining the upstream information with
      the @format.

      This function generates an unique stream-id by getting the upstream
      stream-start event stream ID and appending the stream-id to it. If the element
      has no sinkpad it will generate an upstream stream-id by doing an URI query
      on the element and in the worst case just uses a random number. Source
      elements that don't implement the URI handler interface should ideally
      generate a unique, deterministic stream-id manually instead.

      Since stream IDs are sorted alphabetically, any numbers in the stream ID
      should be printed with a fixed number of characters, preceded by 0's, such as
      by using the format \%03u instead of \%u.
      Parameter:
      format - The stream-id
      _ellipsis -
      Gibt zurück:
      A stream-id for @element.
    • foreachPad

      public boolean foreachPad(Element.OnElementForeachPadFunc func, @Nullable Pointer user_data)
      Call @func with @user_data for each of @element's pads. @func will be called
      exactly once for each pad that exists at the time of this call, unless
      one of the calls to @func returns %FALSE in which case we will stop
      iterating pads and return early. If new pads are added or pads are removed
      while pads are being iterated, this will not be taken into account until
      next time this function is used.
      Parameter:
      func - function to call for each pad
      user_data - user data passed to @func
      Gibt zurück:
      %FALSE if @element had no pads or if one of the calls to @func returned %FALSE.
    • foreachSinkPad

      public boolean foreachSinkPad(Element.OnElementForeachPadFunc func, @Nullable Pointer user_data)
      Call @func with @user_data for each of @element's sink pads. @func will be
      called exactly once for each sink pad that exists at the time of this call,
      unless one of the calls to @func returns %FALSE in which case we will stop
      iterating pads and return early. If new sink pads are added or sink pads
      are removed while the sink pads are being iterated, this will not be taken
      into account until next time this function is used.
      Parameter:
      func - function to call for each sink pad
      user_data - user data passed to @func
      Gibt zurück:
      %FALSE if @element had no sink pads or if one of the calls to @func returned %FALSE.
    • foreachSrcPad

      public boolean foreachSrcPad(Element.OnElementForeachPadFunc func, @Nullable Pointer user_data)
      Call @func with @user_data for each of @element's source pads. @func will be
      called exactly once for each source pad that exists at the time of this call,
      unless one of the calls to @func returns %FALSE in which case we will stop
      iterating pads and return early. If new source pads are added or source pads
      are removed while the source pads are being iterated, this will not be taken
      into account until next time this function is used.
      Parameter:
      func - function to call for each source pad
      user_data - user data passed to @func
      Gibt zurück:
      %FALSE if @element had no source pads or if one of the calls to @func returned %FALSE.
    • getBaseTime

      public long getBaseTime()
      Returns the base time of the element. The base time is the
      absolute time of the clock when this element was last put to
      PLAYING. Subtracting the base time from the clock time gives
      the running time of the element.
      Gibt zurück:
      the base time of the element. MT safe.
    • getBus

      public Bus getBus()
      Returns the bus of the element. Note that only a #GstPipeline will provide a
      bus for the application.
      Gibt zurück:
      the element's #GstBus. unref after usage. MT safe.
    • getClock

      public Clock getClock()
      Gets the currently configured clock of the element. This is the clock as was
      last set with gst_element_set_clock().

      Elements in a pipeline will only have their clock set when the
      pipeline is in the PLAYING state.
      Gibt zurück:
      the #GstClock of the element. unref after usage. MT safe.
    • getCompatiblePad

      public Pad getCompatiblePad(@Nonnull Pad pad, @Nullable Caps caps)
      Looks for an unlinked pad to which the given pad can link. It is not
      guaranteed that linking the pads will work, though it should work in most
      cases.

      This function will first attempt to find a compatible unlinked ALWAYS pad,
      and if none can be found, it will request a compatible REQUEST pad by looking
      at the templates of @element.
      Parameter:
      pad - the #GstPad to find a compatible one for.
      caps - the #GstCaps to use as a filter.
      Gibt zurück:
      the #GstPad to which a link can be made, or %NULL if one cannot be found. gst_object_unref() after usage.
    • getCompatiblePadTemplate

      public PadTemplate getCompatiblePadTemplate(@Nonnull PadTemplate compattempl)
      Retrieves a pad template from @element that is compatible with @compattempl.
      Pads from compatible templates can be linked together.
      Parameter:
      compattempl - the #GstPadTemplate to find a compatible template for
      Gibt zurück:
      a compatible #GstPadTemplate, or %NULL if none was found. No unreferencing is necessary.
    • getContext

      public Context getContext(@Nonnull Str context_type)
      Gets the context with @context_type set on the element or NULL.

      MT safe.
      Parameter:
      context_type - a name of a context to retrieve
      Gibt zurück:
      A #GstContext or NULL
    • getContext

      public Context getContext(String context_type)
      Gets the context with @context_type set on the element or NULL.

      MT safe.
      Parameter:
      context_type - a name of a context to retrieve
      Gibt zurück:
      A #GstContext or NULL
    • getContextUnlocked

      public Context getContextUnlocked(@Nonnull Str context_type)
      Gets the context with @context_type set on the element or NULL.
      Parameter:
      context_type - a name of a context to retrieve
      Gibt zurück:
      A #GstContext or NULL
    • getContextUnlocked

      public Context getContextUnlocked(String context_type)
      Gets the context with @context_type set on the element or NULL.
      Parameter:
      context_type - a name of a context to retrieve
      Gibt zurück:
      A #GstContext or NULL
    • getContexts

      public List getContexts()
      Gets the contexts set on the element.

      MT safe.
      Gibt zurück:
      List of #GstContext
    • getCurrentClockTime

      public long getCurrentClockTime()
      Returns the current clock time of the element, as in, the time of the
      element's clock, or GST_CLOCK_TIME_NONE if there is no clock.
      Gibt zurück:
      the clock time of the element, or GST_CLOCK_TIME_NONE if there is no clock.
    • getCurrentRunningTime

      public long getCurrentRunningTime()
      Returns the running time of the element. The running time is the
      element's clock time minus its base time. Will return GST_CLOCK_TIME_NONE
      if the element has no clock, or if its base time has not been set.
      Gibt zurück:
      the running time of the element, or GST_CLOCK_TIME_NONE if the element has no clock or its base time has not been set.
    • getFactory

      public ElementFactory getFactory()
      Retrieves the factory that was used to create this element.
      Gibt zurück:
      the #GstElementFactory used for creating this element or %NULL if element has not been registered (static element). no refcounting is needed.
    • getMetadata

      public Str getMetadata(@Nonnull Str key)
      Get metadata with @key in @klass.
      Parameter:
      key - the key to get
      Gibt zurück:
      the metadata for @key.
    • getMetadata

      public Str getMetadata(String key)
      Get metadata with @key in @klass.
      Parameter:
      key - the key to get
      Gibt zurück:
      the metadata for @key.
    • getPadTemplate

      public PadTemplate getPadTemplate(@Nonnull Str name)
      Retrieves a padtemplate from @element with the given name.
      Parameter:
      name - the name of the #GstPadTemplate to get.
      Gibt zurück:
      the #GstPadTemplate with the given name, or %NULL if none was found. No unreferencing is necessary.
    • getPadTemplate

      public PadTemplate getPadTemplate(String name)
      Retrieves a padtemplate from @element with the given name.
      Parameter:
      name - the name of the #GstPadTemplate to get.
      Gibt zurück:
      the #GstPadTemplate with the given name, or %NULL if none was found. No unreferencing is necessary.
    • getPadTemplateList

      public List getPadTemplateList()
      Retrieves a list of the pad templates associated with @element. The
      list must not be modified by the calling code.
      Gibt zurück:
      the #GList of pad templates.
    • getRequestPad

      @Deprecated public Pad getRequestPad(@Nonnull Str name)
      Veraltet.
      The name of this function is confusing to people learning GStreamer.
      gst_element_request_pad_simple() aims at making it more explicit it is
      a simplified gst_element_request_pad().
      Parameter:
      name - the name of the request #GstPad to retrieve.
      Gibt zurück:
      requested #GstPad if found, otherwise %NULL. Release after usage.
    • getRequestPad

      @Deprecated public Pad getRequestPad(String name)
      Veraltet.
      The name of this function is confusing to people learning GStreamer.
      gst_element_request_pad_simple() aims at making it more explicit it is
      a simplified gst_element_request_pad().
      Parameter:
      name - the name of the request #GstPad to retrieve.
      Gibt zurück:
      requested #GstPad if found, otherwise %NULL. Release after usage.
    • getStartTime

      public long getStartTime()
      Returns the start time of the element. The start time is the
      running time of the clock when this element was last put to PAUSED.

      Usually the start_time is managed by a toplevel element such as
      #GstPipeline.

      MT safe.
      Gibt zurück:
      the start time of the element.
    • getState

      public int getState(@Nullable Int state, @Nullable Int pending, long timeout)
      Gets the state of the element.

      For elements that performed an ASYNC state change, as reported by
      gst_element_set_state(), this function will block up to the
      specified timeout value for the state change to complete.
      If the element completes the state change or goes into
      an error, this function returns immediately with a return value of
      %GST_STATE_CHANGE_SUCCESS or %GST_STATE_CHANGE_FAILURE respectively.

      For elements that did not return %GST_STATE_CHANGE_ASYNC, this function
      returns the current and pending state immediately.

      This function returns %GST_STATE_CHANGE_NO_PREROLL if the element
      successfully changed its state but is not able to provide data yet.
      This mostly happens for live sources that only produce data in
      %GST_STATE_PLAYING. While the state change return is equivalent to
      %GST_STATE_CHANGE_SUCCESS, it is returned to the application to signal that
      some sink elements might not be able to complete their state change because
      an element is not producing data to complete the preroll. When setting the
      element to playing, the preroll will complete and playback will start.
      Parameter:
      state - a pointer to #GstState to hold the state. Can be %NULL.
      pending - a pointer to #GstState to hold the pending state. Can be %NULL.
      timeout - a #GstClockTime to specify the timeout for an async state change or %GST_CLOCK_TIME_NONE for infinite timeout.
      Gibt zurück:
      %GST_STATE_CHANGE_SUCCESS if the element has no more pending state and the last state change succeeded, %GST_STATE_CHANGE_ASYNC if the element is still performing a state change or %GST_STATE_CHANGE_FAILURE if the last state change failed. MT safe.
    • getStaticPad

      public Pad getStaticPad(@Nonnull Str name)
      Retrieves a pad from @element by name. This version only retrieves
      already-existing (i.e. 'static') pads.
      Parameter:
      name - the name of the static #GstPad to retrieve.
      Gibt zurück:
      the requested #GstPad if found, otherwise %NULL. unref after usage. MT safe.
    • getStaticPad

      public Pad getStaticPad(String name)
      Retrieves a pad from @element by name. This version only retrieves
      already-existing (i.e. 'static') pads.
      Parameter:
      name - the name of the static #GstPad to retrieve.
      Gibt zurück:
      the requested #GstPad if found, otherwise %NULL. unref after usage. MT safe.
    • isLockedState

      public boolean isLockedState()
      Checks if the state of an element is locked.
      If the state of an element is locked, state changes of the parent don't
      affect the element.
      This way you can leave currently unused elements inside bins. Just lock their
      state before changing the state from #GST_STATE_NULL.

      MT safe.
      Gibt zurück:
      %TRUE, if the element's state is locked.
    • iteratePads

      public Iterator iteratePads()
      Retrieves an iterator of @element's pads. The iterator should
      be freed after usage. Also more specialized iterators exists such as
      gst_element_iterate_src_pads() or gst_element_iterate_sink_pads().

      The order of pads returned by the iterator will be the order in which
      the pads were added to the element.
      Gibt zurück:
      the #GstIterator of #GstPad. MT safe.
    • iterateSinkPads

      public Iterator iterateSinkPads()
      Retrieves an iterator of @element's sink pads.

      The order of pads returned by the iterator will be the order in which
      the pads were added to the element.
      Gibt zurück:
      the #GstIterator of #GstPad. MT safe.
    • iterateSrcPads

      public Iterator iterateSrcPads()
      Retrieves an iterator of @element's source pads.

      The order of pads returned by the iterator will be the order in which
      the pads were added to the element.
      Gibt zurück:
      the #GstIterator of #GstPad. MT safe.
    • link

      public boolean link(@Nonnull Element dest)
      Links @src to @dest. The link must be from source to
      destination; the other direction will not be tried. The function looks for
      existing pads that aren't linked yet. It will request new pads if necessary.
      Such pads need to be released manually when unlinking.
      If multiple links are possible, only one is established.

      Make sure you have added your elements to a bin or pipeline with
      gst_bin_add() before trying to link them.
      Parameter:
      dest - the #GstElement containing the destination pad.
      Gibt zurück:
      %TRUE if the elements could be linked, %FALSE otherwise.
    • linkFiltered

      public boolean linkFiltered(@Nonnull Element dest, @Nullable Caps filter)
      Links @src to @dest using the given caps as filtercaps.
      The link must be from source to
      destination; the other direction will not be tried. The function looks for
      existing pads that aren't linked yet. It will request new pads if necessary.
      If multiple links are possible, only one is established.

      Make sure you have added your elements to a bin or pipeline with
      gst_bin_add() before trying to link them.
      Parameter:
      dest - the #GstElement containing the destination pad.
      filter - the #GstCaps to filter the link, or %NULL for no filter.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • linkMany

      public boolean linkMany(@Nonnull Element element_2, Object... _ellipsis)
      Chain together a series of elements. Uses gst_element_link().
      Make sure you have added your elements to a bin or pipeline with
      gst_bin_add() before trying to link them.
      Parameter:
      element_2 - the second #GstElement in the link chain.
      _ellipsis - the %NULL-terminated list of elements to link in order.
      Gibt zurück:
      %TRUE on success, %FALSE otherwise.
    • linkPads

      public boolean linkPads(@Nullable Str srcpadname, @Nonnull Element dest, @Nullable Str destpadname)
      Links the two named pads of the source and destination elements.
      Side effect is that if one of the pads has no parent, it becomes a
      child of the parent of the other element. If they have different
      parents, the link fails.
      Parameter:
      srcpadname - the name of the #GstPad in source element or %NULL for any pad.
      dest - the #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element, or %NULL for any pad.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • linkPads

      public boolean linkPads(String srcpadname, @Nonnull Element dest, String destpadname)
      Links the two named pads of the source and destination elements.
      Side effect is that if one of the pads has no parent, it becomes a
      child of the parent of the other element. If they have different
      parents, the link fails.
      Parameter:
      srcpadname - the name of the #GstPad in source element or %NULL for any pad.
      dest - the #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element, or %NULL for any pad.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • linkPadsFiltered

      public boolean linkPadsFiltered(@Nullable Str srcpadname, @Nonnull Element dest, @Nullable Str destpadname, @Nullable Caps filter)
      Links the two named pads of the source and destination elements. Side effect
      is that if one of the pads has no parent, it becomes a child of the parent of
      the other element. If they have different parents, the link fails. If @caps
      is not %NULL, makes sure that the caps of the link is a subset of @caps.
      Parameter:
      srcpadname - the name of the #GstPad in source element or %NULL for any pad.
      dest - the #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element or %NULL for any pad.
      filter - the #GstCaps to filter the link, or %NULL for no filter.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • linkPadsFiltered

      public boolean linkPadsFiltered(String srcpadname, @Nonnull Element dest, String destpadname, @Nullable Caps filter)
      Links the two named pads of the source and destination elements. Side effect
      is that if one of the pads has no parent, it becomes a child of the parent of
      the other element. If they have different parents, the link fails. If @caps
      is not %NULL, makes sure that the caps of the link is a subset of @caps.
      Parameter:
      srcpadname - the name of the #GstPad in source element or %NULL for any pad.
      dest - the #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element or %NULL for any pad.
      filter - the #GstCaps to filter the link, or %NULL for no filter.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • linkPadsFull

      public boolean linkPadsFull(@Nullable Str srcpadname, @Nonnull Element dest, @Nullable Str destpadname, int flags)
      Links the two named pads of the source and destination elements.
      Side effect is that if one of the pads has no parent, it becomes a
      child of the parent of the other element. If they have different
      parents, the link fails.

      Calling gst_element_link_pads_full() with @flags == %GST_PAD_LINK_CHECK_DEFAULT
      is the same as calling gst_element_link_pads() and the recommended way of
      linking pads with safety checks applied.

      This is a convenience function for gst_pad_link_full().
      Parameter:
      srcpadname - the name of the #GstPad in source element or %NULL for any pad.
      dest - the #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element, or %NULL for any pad.
      flags - the #GstPadLinkCheck to be performed when linking pads.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • linkPadsFull

      public boolean linkPadsFull(String srcpadname, @Nonnull Element dest, String destpadname, int flags)
      Links the two named pads of the source and destination elements.
      Side effect is that if one of the pads has no parent, it becomes a
      child of the parent of the other element. If they have different
      parents, the link fails.

      Calling gst_element_link_pads_full() with @flags == %GST_PAD_LINK_CHECK_DEFAULT
      is the same as calling gst_element_link_pads() and the recommended way of
      linking pads with safety checks applied.

      This is a convenience function for gst_pad_link_full().
      Parameter:
      srcpadname - the name of the #GstPad in source element or %NULL for any pad.
      dest - the #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element, or %NULL for any pad.
      flags - the #GstPadLinkCheck to be performed when linking pads.
      Gibt zurück:
      %TRUE if the pads could be linked, %FALSE otherwise.
    • lostState

      public void lostState()
      Brings the element to the lost state. The current state of the
      element is copied to the pending state so that any call to
      gst_element_get_state() will return %GST_STATE_CHANGE_ASYNC.

      An ASYNC_START message is posted. If the element was PLAYING, it will
      go to PAUSED. The element will be restored to its PLAYING state by
      the parent pipeline when it prerolls again.

      This is mostly used for elements that lost their preroll buffer
      in the %GST_STATE_PAUSED or %GST_STATE_PLAYING state after a flush,
      they will go to their pending state again when a new preroll buffer is
      queued. This function can only be called when the element is currently
      not in error or an async state change.

      This function is used internally and should normally not be called from
      plugins or applications.
    • messageFull

      public void messageFull(int type, int domain, int code, @Nullable Str text, @Nullable Str debug, @Nonnull Str file, @Nonnull Str function, int line)
      Post an error, warning or info message on the bus from inside an element.

      @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
      #GST_MESSAGE_INFO.

      MT safe.
      Parameter:
      type - the #GstMessageType
      domain - the GStreamer GError domain this message belongs to
      code - the GError code belonging to the domain
      text - an allocated text string to be used as a replacement for the default message connected to code, or %NULL
      debug - an allocated debug message to be used as a replacement for the default debugging information, or %NULL
      file - the source code file where the error was generated
      function - the source code function where the error was generated
      line - the source code line where the error was generated
    • messageFull

      public void messageFull(int type, int domain, int code, @Nullable Str text, @Nullable Str debug, String file, String function, int line)
      Post an error, warning or info message on the bus from inside an element.

      @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
      #GST_MESSAGE_INFO.

      MT safe.
      Parameter:
      type - the #GstMessageType
      domain - the GStreamer GError domain this message belongs to
      code - the GError code belonging to the domain
      text - an allocated text string to be used as a replacement for the default message connected to code, or %NULL
      debug - an allocated debug message to be used as a replacement for the default debugging information, or %NULL
      file - the source code file where the error was generated
      function - the source code function where the error was generated
      line - the source code line where the error was generated
    • messageFullWithDetails

      public void messageFullWithDetails(int type, int domain, int code, @Nullable Str text, @Nullable Str debug, @Nonnull Str file, @Nonnull Str function, int line, @Nonnull Structure structure)
      Post an error, warning or info message on the bus from inside an element.

      @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
      #GST_MESSAGE_INFO.
      Parameter:
      type - the #GstMessageType
      domain - the GStreamer GError domain this message belongs to
      code - the GError code belonging to the domain
      text - an allocated text string to be used as a replacement for the default message connected to code, or %NULL
      debug - an allocated debug message to be used as a replacement for the default debugging information, or %NULL
      file - the source code file where the error was generated
      function - the source code function where the error was generated
      line - the source code line where the error was generated
      structure - optional details structure
    • messageFullWithDetails

      public void messageFullWithDetails(int type, int domain, int code, @Nullable Str text, @Nullable Str debug, String file, String function, int line, @Nonnull Structure structure)
      Post an error, warning or info message on the bus from inside an element.

      @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
      #GST_MESSAGE_INFO.
      Parameter:
      type - the #GstMessageType
      domain - the GStreamer GError domain this message belongs to
      code - the GError code belonging to the domain
      text - an allocated text string to be used as a replacement for the default message connected to code, or %NULL
      debug - an allocated debug message to be used as a replacement for the default debugging information, or %NULL
      file - the source code file where the error was generated
      function - the source code function where the error was generated
      line - the source code line where the error was generated
      structure - optional details structure
    • noMorePads

      public void noMorePads()
      Use this function to signal that the element does not expect any more pads
      to show up in the current pipeline. This function should be called whenever
      pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES
      pad templates use this in combination with autopluggers to figure out that
      the element is done initializing its pads.

      This function emits the #GstElement::no-more-pads signal.

      MT safe.
    • postMessage

      public boolean postMessage(@Nonnull Message message)
      Post a message on the element's #GstBus. This function takes ownership of the
      message; if you want to access the message after this call, you should add an
      additional reference before calling.
      Parameter:
      message - a #GstMessage to post
      Gibt zurück:
      %TRUE if the message was successfully posted. The function returns %FALSE if the element did not have a bus. MT safe.
    • provideClock

      public Clock provideClock()
      Get the clock provided by the given element.
      > An element is only required to provide a clock in the PAUSED
      > state. Some elements can provide a clock in other states.
      Gibt zurück:
      the GstClock provided by the element or %NULL if no clock could be provided. Unref after usage. MT safe.
    • query

      public boolean query(@Nonnull Query query)
      Performs a query on the given element.

      For elements that don't implement a query handler, this function
      forwards the query to a random srcpad or to the peer of a
      random linked sinkpad of this element.

      Please note that some queries might need a running pipeline to work.
      Parameter:
      query - the #GstQuery.
      Gibt zurück:
      %TRUE if the query could be performed. MT safe.
    • releaseRequestPad

      public void releaseRequestPad(@Nonnull Pad pad)
      Makes the element free the previously requested pad as obtained
      with gst_element_request_pad().

      This does not unref the pad. If the pad was created by using
      gst_element_request_pad(), gst_element_release_request_pad() needs to be
      followed by gst_object_unref() to free the @pad.

      MT safe.
      Parameter:
      pad - the #GstPad to release.
    • removePad

      public boolean removePad(@Nonnull Pad pad)
      Removes @pad from @element. @pad will be destroyed if it has not been
      referenced elsewhere using gst_object_unparent().

      This function is used by plugin developers and should not be used
      by applications. Pads that were dynamically requested from elements
      with gst_element_request_pad() should be released with the
      gst_element_release_request_pad() function instead.

      Pads are not automatically deactivated so elements should perform the needed
      steps to deactivate the pad in case this pad is removed in the PAUSED or
      PLAYING state. See gst_pad_set_active() for more information about
      deactivating pads.

      The pad and the element should be unlocked when calling this function.

      This function will emit the #GstElement::pad-removed signal on the element.
      Parameter:
      pad - the #GstPad to remove from the element.
      Gibt zurück:
      %TRUE if the pad could be removed. Can return %FALSE if the pad does not belong to the provided element. MT safe.
    • removePropertyNotifyWatch

      public void removePropertyNotifyWatch(long watch_id)
      Parameter:
      watch_id - watch id to remove
    • requestPad

      public Pad requestPad(@Nonnull PadTemplate templ, @Nullable Str name, @Nullable Caps caps)
      Retrieves a request pad from the element according to the provided template.
      Pad templates can be looked up using
      gst_element_factory_get_static_pad_templates().

      The pad should be released with gst_element_release_request_pad().
      Parameter:
      templ - a #GstPadTemplate of which we want a pad of.
      name - the name of the request #GstPad to retrieve. Can be %NULL.
      caps - the caps of the pad we want to request. Can be %NULL.
      Gibt zurück:
      requested #GstPad if found, otherwise %NULL. Release after usage.
    • requestPad

      public Pad requestPad(@Nonnull PadTemplate templ, String name, @Nullable Caps caps)
      Retrieves a request pad from the element according to the provided template.
      Pad templates can be looked up using
      gst_element_factory_get_static_pad_templates().

      The pad should be released with gst_element_release_request_pad().
      Parameter:
      templ - a #GstPadTemplate of which we want a pad of.
      name - the name of the request #GstPad to retrieve. Can be %NULL.
      caps - the caps of the pad we want to request. Can be %NULL.
      Gibt zurück:
      requested #GstPad if found, otherwise %NULL. Release after usage.
    • requestPadSimple

      public Pad requestPadSimple(@Nonnull Str name)
      Retrieves a pad from the element by name (e.g. "src_\%d"). This version only
      retrieves request pads. The pad should be released with
      gst_element_release_request_pad().

      This method is slower than manually getting the pad template and calling
      gst_element_request_pad() if the pads should have a specific name (e.g.
      @name is "src_1" instead of "src_\%u").

      Note that this function was introduced in GStreamer 1.20 in order to provide
      a better name to gst_element_get_request_pad(). Prior to 1.20, users
      should use gst_element_get_request_pad() which provides the same
      functionality.
      Parameter:
      name - the name of the request #GstPad to retrieve.
      Gibt zurück:
      requested #GstPad if found, otherwise %NULL. Release after usage.
    • requestPadSimple

      public Pad requestPadSimple(String name)
      Retrieves a pad from the element by name (e.g. "src_\%d"). This version only
      retrieves request pads. The pad should be released with
      gst_element_release_request_pad().

      This method is slower than manually getting the pad template and calling
      gst_element_request_pad() if the pads should have a specific name (e.g.
      @name is "src_1" instead of "src_\%u").

      Note that this function was introduced in GStreamer 1.20 in order to provide
      a better name to gst_element_get_request_pad(). Prior to 1.20, users
      should use gst_element_get_request_pad() which provides the same
      functionality.
      Parameter:
      name - the name of the request #GstPad to retrieve.
      Gibt zurück:
      requested #GstPad if found, otherwise %NULL. Release after usage.
    • seek

      public boolean seek(double rate, int format, int flags, int start_type, long start, int stop_type, long stop)
      Sends a seek event to an element. See gst_event_new_seek() for the details of
      the parameters. The seek event is sent to the element using
      gst_element_send_event().

      MT safe.
      Parameter:
      rate - The new playback rate
      format - The format of the seek values
      flags - The optional seek flags.
      start_type - The type and flags for the new start position
      start - The value of the new start position
      stop_type - The type and flags for the new stop position
      stop - The value of the new stop position
      Gibt zurück:
      %TRUE if the event was handled. Flushing seeks will trigger a preroll, which will emit %GST_MESSAGE_ASYNC_DONE.
    • seekSimple

      public boolean seekSimple(int format, int seek_flags, long seek_pos)
      Simple API to perform a seek on the given element, meaning it just seeks
      to the given position relative to the start of the stream. For more complex
      operations like segment seeks (e.g. for looping) or changing the playback
      rate or seeking relative to the last configured playback segment you should
      use gst_element_seek().

      In a completely prerolled PAUSED or PLAYING pipeline, seeking is always
      guaranteed to return %TRUE on a seekable media type or %FALSE when the media
      type is certainly not seekable (such as a live stream).

      Some elements allow for seeking in the READY state, in this
      case they will store the seek event and execute it when they are put to
      PAUSED. If the element supports seek in READY, it will always return %TRUE when
      it receives the event in the READY state.
      Parameter:
      format - a #GstFormat to execute the seek in, such as #GST_FORMAT_TIME
      seek_flags - seek options; playback applications will usually want to use GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here
      seek_pos - position to seek to (relative to the start); if you are doing a seek in #GST_FORMAT_TIME this value is in nanoseconds - multiply with #GST_SECOND to convert seconds to nanoseconds or with #GST_MSECOND to convert milliseconds to nanoseconds.
      Gibt zurück:
      %TRUE if the seek operation succeeded. Flushing seeks will trigger a preroll, which will emit %GST_MESSAGE_ASYNC_DONE.
    • sendEvent

      public boolean sendEvent(@Nonnull Event event)
      Sends an event to an element. If the element doesn't implement an
      event handler, the event will be pushed on a random linked sink pad for
      downstream events or a random linked source pad for upstream events.

      This function takes ownership of the provided event so you should
      gst_event_ref() it if you want to reuse the event after this call.

      MT safe.
      Parameter:
      event - the #GstEvent to send to the element.
      Gibt zurück:
      %TRUE if the event was handled. Events that trigger a preroll (such as flushing seeks and steps) will emit %GST_MESSAGE_ASYNC_DONE.
    • setBaseTime

      public void setBaseTime(long time)
      Set the base time of an element. See gst_element_get_base_time().

      MT safe.
      Parameter:
      time - the base time to set.
    • setBus

      public void setBus(@Nullable Bus bus)
      Sets the bus of the element. Increases the refcount on the bus.
      For internal use only, unless you're testing elements.

      MT safe.
      Parameter:
      bus - the #GstBus to set.
    • setClock

      public boolean setClock(@Nullable Clock clock)
      Sets the clock for the element. This function increases the
      refcount on the clock. Any previously set clock on the object
      is unreffed.
      Parameter:
      clock - the #GstClock to set for the element.
      Gibt zurück:
      %TRUE if the element accepted the clock. An element can refuse a clock when it, for example, is not able to slave its internal clock to the @clock or when it requires a specific clock to operate. MT safe.
    • setContext

      public void setContext(@Nonnull Context context)
      Sets the context of the element. Increases the refcount of the context.

      MT safe.
      Parameter:
      context - the #GstContext to set.
    • setLockedState

      public boolean setLockedState(boolean locked_state)
      Locks the state of an element, so state changes of the parent don't affect
      this element anymore.

      Note that this is racy if the state lock of the parent bin is not taken.
      The parent bin might've just checked the flag in another thread and as the
      next step proceed to change the child element's state.

      MT safe.
      Parameter:
      locked_state - %TRUE to lock the element's state
      Gibt zurück:
      %TRUE if the state was changed, %FALSE if bad parameters were given or the elements state-locking needed no change.
    • setStartTime

      public void setStartTime(long time)
      Set the start time of an element. The start time of the element is the
      running time of the element when it last went to the PAUSED state. In READY
      or after a flushing seek, it is set to 0.

      Toplevel elements like #GstPipeline will manage the start_time and
      base_time on its children. Setting the start_time to #GST_CLOCK_TIME_NONE
      on such a toplevel element will disable the distribution of the base_time to
      the children and can be useful if the application manages the base_time
      itself, for example if you want to synchronize capture from multiple
      pipelines, and you can also ensure that the pipelines have the same clock.

      MT safe.
      Parameter:
      time - the base time to set.
    • setState

      public int setState(int state)
      Sets the state of the element. This function will try to set the
      requested state by going through all the intermediary states and calling
      the class's state change function for each.

      This function can return #GST_STATE_CHANGE_ASYNC, in which case the
      element will perform the remainder of the state change asynchronously in
      another thread.
      An application can use gst_element_get_state() to wait for the completion
      of the state change or it can wait for a %GST_MESSAGE_ASYNC_DONE or
      %GST_MESSAGE_STATE_CHANGED on the bus.

      State changes to %GST_STATE_READY or %GST_STATE_NULL never return
      #GST_STATE_CHANGE_ASYNC.
      Parameter:
      state - the element's new #GstState.
      Gibt zurück:
      Result of the state change using #GstStateChangeReturn. MT safe.
    • syncStateWithParent

      public boolean syncStateWithParent()
      Tries to change the state of the element to the same as its parent.
      If this function returns %FALSE, the state of element is undefined.
      Gibt zurück:
      %TRUE, if the element's state could be synced to the parent's state. MT safe.
    • unlink

      public void unlink(@Nonnull Element dest)
      Unlinks all source pads of the source element with all sink pads
      of the sink element to which they are linked.

      If the link has been made using gst_element_link(), it could have created an
      requestpad, which has to be released using gst_element_release_request_pad().
      Parameter:
      dest - the sink #GstElement to unlink.
    • unlinkMany

      public void unlinkMany(@Nonnull Element element_2, Object... _ellipsis)
      Unlinks a series of elements. Uses gst_element_unlink().
      Parameter:
      element_2 - the second #GstElement in the link chain.
      _ellipsis - the %NULL-terminated list of elements to unlink in order.
    • unlinkPads

      public void unlinkPads(@Nonnull Str srcpadname, @Nonnull Element dest, @Nonnull Str destpadname)
      Unlinks the two named pads of the source and destination elements.

      This is a convenience function for gst_pad_unlink().
      Parameter:
      srcpadname - the name of the #GstPad in source element.
      dest - a #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element.
    • unlinkPads

      public void unlinkPads(String srcpadname, @Nonnull Element dest, String destpadname)
      Unlinks the two named pads of the source and destination elements.

      This is a convenience function for gst_pad_unlink().
      Parameter:
      srcpadname - the name of the #GstPad in source element.
      dest - a #GstElement containing the destination pad.
      destpadname - the name of the #GstPad in destination element.
    • onNoMorePads

      public SignalHandler onNoMorePads(Element.OnNoMorePads signal)
      Connect to signal "no-more-pads".
      See Element.OnNoMorePads.onNoMorePads() for signal description.
      Field SIGNAL_ON_NO_MORE_PADS contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onPadAdded

      public SignalHandler onPadAdded(Element.OnPadAdded signal)
      Connect to signal "pad-added".
      See Element.OnPadAdded.onPadAdded(ch.bailu.gtk.gst.Pad) for signal description.
      Field SIGNAL_ON_PAD_ADDED contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onPadRemoved

      public SignalHandler onPadRemoved(Element.OnPadRemoved signal)
      Connect to signal "pad-removed".
      See Element.OnPadRemoved.onPadRemoved(ch.bailu.gtk.gst.Pad) for signal description.
      Field SIGNAL_ON_PAD_REMOVED contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • makeFromUri

      public static Element makeFromUri(int type, @Nonnull Str uri, @Nullable Str elementname) throws AllocationError
      Creates an element for handling the given URI.
      Parameter:
      type - Whether to create a source or a sink
      uri - URI to create an element for
      elementname - Name of created element, can be %NULL.
      Gibt zurück:
      a new element or %NULL if none could be created
      Löst aus:
      AllocationError
    • register

      public static boolean register(@Nullable Plugin plugin, @Nonnull Str name, int rank, long type)
      Create a new elementfactory capable of instantiating objects of the
      @type and add the factory to @plugin.
      Parameter:
      plugin - #GstPlugin to register the element with, or %NULL for a static element.
      name - name of elements of this type
      rank - rank of element (higher rank means more importance when autoplugging)
      type - GType of element to register
      Gibt zurück:
      %TRUE, if the registering succeeded, %FALSE on error
    • stateChangeReturnGetName

      public static Str stateChangeReturnGetName(int state_ret)
      Gets a string representing the given state change result.
      Parameter:
      state_ret - a #GstStateChangeReturn to get the name of.
      Gibt zurück:
      a string with the name of the state result.
    • stateGetName

      public static Str stateGetName(int state)
      Gets a string representing the given state.
      Parameter:
      state - a #GstState to get the name of.
      Gibt zurück:
      a string with the name of the state.
    • typeSetSkipDocumentation

      public static void typeSetSkipDocumentation(long type)
      Marks @type as "documentation should be skipped".
      Can be useful for dynamically registered element to be excluded from
      plugin documentation system.

      Example:
      ```c
      GType my_type;
      GTypeInfo my_type_info;

      // Fill "my_type_info"
      ...

      my_type = g_type_register_static (GST_TYPE_MY_ELEMENT, "my-type-name",
      &my_type_info, 0);
      gst_element_type_set_skip_documentation (my_type);
      gst_element_register (plugin, "my-plugin-feature-name", rank, my_type);
      ```
      Parameter:
      type - a #GType of element
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()