Class Element.ElementClass

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
Aggregator.AggregatorClass, AudioDecoder.AudioDecoderClass, AudioEncoder.AudioEncoderClass, AudioVisualizer.AudioVisualizerClass, BaseParse.BaseParseClass, BaseSink.BaseSinkClass, BaseSrc.BaseSrcClass, BaseTransform.BaseTransformClass, Bin.BinClass, VideoDecoder.VideoDecoderClass, VideoEncoder.VideoEncoderClass
Enclosing class:
Element

public static class Element.ElementClass extends GstObject.ObjectClass
GStreamer element class. Override the vmethods to implement the element functionality.
  • Constructor Details

    • ElementClass

      public ElementClass(MemorySegment address)
      Create a ElementClass proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readMetadata

      public MemorySegment readMetadata()
      Read the value of the field metadata.
      Returns:
      The value of the field metadata
    • writeMetadata

      public void writeMetadata(MemorySegment metadata)
      Write a value in the field metadata.
      Parameters:
      metadata - The new value for the field metadata
    • readElementfactory

      public ElementFactory readElementfactory()
      Read the value of the field elementfactory.
      Returns:
      The value of the field elementfactory
    • writeElementfactory

      public void writeElementfactory(ElementFactory elementfactory)
      Write a value in the field elementfactory.
      Parameters:
      elementfactory - The new value for the field elementfactory
    • readPadtemplates

      public List<MemorySegment> readPadtemplates()
      Read the value of the field padtemplates.
      Returns:
      The value of the field padtemplates
    • writePadtemplates

      public void writePadtemplates(List<MemorySegment> padtemplates)
      Write a value in the field padtemplates.
      Parameters:
      padtemplates - The new value for the field padtemplates
    • readNumpadtemplates

      public int readNumpadtemplates()
      Read the value of the field numpadtemplates.
      Returns:
      The value of the field numpadtemplates
    • writeNumpadtemplates

      public void writeNumpadtemplates(int numpadtemplates)
      Write a value in the field numpadtemplates.
      Parameters:
      numpadtemplates - The new value for the field numpadtemplates
    • readPadTemplCookie

      public int readPadTemplCookie()
      Read the value of the field pad_templ_cookie.
      Returns:
      The value of the field pad_templ_cookie
    • writePadTemplCookie

      public void writePadTemplCookie(int padTemplCookie)
      Write a value in the field pad_templ_cookie.
      Parameters:
      padTemplCookie - The new value for the field pad_templ_cookie
    • overridePadAdded

      public void overridePadAdded(Arena arena, @Nullable Method method)
      Override virtual method pad_added.
      Parameters:
      method - the method to invoke
    • overridePadRemoved

      public void overridePadRemoved(Arena arena, @Nullable Method method)
      Override virtual method pad_removed.
      Parameters:
      method - the method to invoke
    • overrideNoMorePads

      public void overrideNoMorePads(Arena arena, @Nullable Method method)
      Override virtual method no_more_pads.
      Parameters:
      method - the method to invoke
    • overrideRequestNewPad

      public void overrideRequestNewPad(Arena arena, @Nullable Method method)
      Override virtual method request_new_pad.
      Parameters:
      method - the method to invoke
    • overrideReleasePad

      public void overrideReleasePad(Arena arena, @Nullable Method method)
      Override virtual method release_pad.
      Parameters:
      method - the method to invoke
    • overrideGetState

      public void overrideGetState(Arena arena, @Nullable Method method)
      Override virtual method get_state.
      Parameters:
      method - the method to invoke
    • overrideSetState

      public void overrideSetState(Arena arena, @Nullable Method method)
      Override virtual method set_state.
      Parameters:
      method - the method to invoke
    • overrideChangeState

      public void overrideChangeState(Arena arena, @Nullable Method method)
      Override virtual method change_state.
      Parameters:
      method - the method to invoke
    • overrideStateChanged

      public void overrideStateChanged(Arena arena, @Nullable Method method)
      Override virtual method state_changed.
      Parameters:
      method - the method to invoke
    • overrideSetBus

      public void overrideSetBus(Arena arena, @Nullable Method method)
      Override virtual method set_bus.
      Parameters:
      method - the method to invoke
    • overrideProvideClock

      public void overrideProvideClock(Arena arena, @Nullable Method method)
      Override virtual method provide_clock.
      Parameters:
      method - the method to invoke
    • overrideSetClock

      public void overrideSetClock(Arena arena, @Nullable Method method)
      Override virtual method set_clock.
      Parameters:
      method - the method to invoke
    • overrideSendEvent

      public void overrideSendEvent(Arena arena, @Nullable Method method)
      Override virtual method send_event.
      Parameters:
      method - the method to invoke
    • overrideQuery

      public void overrideQuery(Arena arena, @Nullable Method method)
      Override virtual method query.
      Parameters:
      method - the method to invoke
    • overridePostMessage

      public void overridePostMessage(Arena arena, @Nullable Method method)
      Override virtual method post_message.
      Parameters:
      method - the method to invoke
    • overrideSetContext

      public void overrideSetContext(Arena arena, @Nullable Method method)
      Override virtual method set_context.
      Parameters:
      method - the method to invoke
    • addMetadata

      public void addMetadata(String key, String value)
      Set key with value as metadata in klass.
      Parameters:
      key - the key to set
      value - the value to set
    • addPadTemplate

      public void addPadTemplate(PadTemplate templ)

      Adds a padtemplate to an element class. This is mainly used in the _class_init functions of classes. If a pad template with the same name as an already existing one is added the old one is replaced by the new one.

      templ's reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink())

      Parameters:
      templ - a GstPadTemplate to add to the element class.
    • addStaticMetadata

      public void addStaticMetadata(String key, String value)

      Set key with value as metadata in klass.

      Same as gst_element_class_add_metadata(), but value must be a static string or an inlined string, as it will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)

      Parameters:
      key - the key to set
      value - the value to set
    • addStaticPadTemplate

      public void addStaticPadTemplate(StaticPadTemplate staticTempl)
      Adds a pad template to an element class based on the static pad template templ. This is mainly used in the _class_init functions of element implementations. If a pad template with the same name already exists, the old one is replaced by the new one.
      Parameters:
      staticTempl - GstStaticPadTemplate to add as pad template to the element class.
      Since:
      1.8
    • addStaticPadTemplateWithGtype

      public void addStaticPadTemplateWithGtype(StaticPadTemplate staticTempl, Type padType)
      Adds a pad template to an element class based on the static pad template templ. This is mainly used in the _class_init functions of element implementations. If a pad template with the same name already exists, the old one is replaced by the new one.
      Parameters:
      staticTempl - GstStaticPadTemplate to add as pad template to the element class.
      padType - The GType of the pad to create
      Since:
      1.14
    • getMetadata

      public String getMetadata(String key)
      Get metadata with key in klass.
      Parameters:
      key - the key to get
      Returns:
      the metadata for key.
    • getPadTemplate

      public @Nullable PadTemplate getPadTemplate(String name)

      Retrieves a padtemplate from this ElementClass with the given name.

      If you use this function in the GInstanceInitFunc of an object class that has subclasses, make sure to pass the g_class parameter of the GInstanceInitFunc here.

      Parameters:
      name - the name of the GstPadTemplate to get.
      Returns:
      the GstPadTemplate with the given name, or null if none was found. No unreferencing is necessary.
    • getPadTemplateList

      public List<PadTemplate> getPadTemplateList()

      Retrieves a list of the pad templates associated with elementClass. The list must not be modified by the calling code.

      If you use this function in the GInstanceInitFunc of an object class that has subclasses, make sure to pass the g_class parameter of the GInstanceInitFunc here.

      Returns:
      the GList of pad templates.
    • setMetadata

      public void setMetadata(String longname, String classification, String description, String author)

      Sets the detailed information for a GstElementClass.

      This function is for use in _class_init functions only.

      Parameters:
      longname - The long English name of the element. E.g. "File Sink"
      classification - String describing the type of element, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File"
      description - Sentence describing the purpose of the element. E.g: "Write stream to a file"
      author - Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"
    • setStaticMetadata

      public void setStaticMetadata(String longname, String classification, String description, String author)

      Sets the detailed information for a GstElementClass.

      This function is for use in _class_init functions only.

      Same as gst_element_class_set_metadata(), but longname, classification, description, and author must be static strings or inlined strings, as they will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)

      Parameters:
      longname - The long English name of the element. E.g. "File Sink"
      classification - String describing the type of element, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File"
      description - Sentence describing the purpose of the element. E.g: "Write stream to a file"
      author - Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"