Class Device

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
Device.Device$Impl

@Generated("org.javagi.JavaGI") public abstract class Device extends GstObject

GstDevice are objects representing a device, they contain relevant metadata about the device, such as its class and the GstCaps representing the media types it can produce or handle.

GstDevice are created by GstDeviceProvider objects which can be aggregated by GstDeviceMonitor objects.

Since:
1.4
  • Constructor Details

    • Device

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

      public Device()
      Create a new Device.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the Device class.
      Returns:
      the GType
    • getMemoryLayout

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

      protected Device asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GstObject
      Returns:
      the instance as if it were its parent type
    • createElement

      public @Nullable Element createElement(@Nullable String name)
      Creates the element with all of the required parameters set to use this device.
      Parameters:
      name - name of new element, or null to automatically create a unique name.
      Returns:
      a new GstElement configured to use this device
      Since:
      1.4
    • getCaps

      public @Nullable Caps getCaps()
      Getter for the GstCaps that this device supports.
      Returns:
      The GstCaps supported by this device. Unref with gst_caps_unref() when done.
      Since:
      1.4
    • getDeviceClass

      public String getDeviceClass()
      Gets the "class" of a device. This is a "/" separated list of classes that represent this device. They are a subset of the classes of the GstDeviceProvider that produced this device.
      Returns:
      The device class. Free with g_free() after use.
      Since:
      1.4
    • getDisplayName

      public String getDisplayName()
      Gets the user-friendly name of the device.
      Returns:
      The device name. Free with g_free() after use.
      Since:
      1.4
    • getProperties

      public @Nullable Structure getProperties()
      Gets the extra properties of a device.
      Returns:
      The extra properties or null when there are none. Free with gst_structure_free() after use.
      Since:
      1.6
    • hasClasses

      public boolean hasClasses(String classes)
      Check if this Device matches all of the given classes
      Parameters:
      classes - a "/"-separated list of device classes to match, only match if all classes are matched
      Returns:
      true if this Device matches.
      Since:
      1.4
    • hasClassesv

      public boolean hasClassesv(@Nullable String @Nullable [] classes)
      Check if factory matches all of the given classes
      Parameters:
      classes - a null terminated array of classes to match, only match if all classes are matched
      Returns:
      true if this Device matches.
      Since:
      1.4
    • reconfigureElement

      public boolean reconfigureElement(Element element)

      Tries to reconfigure an existing element to use the device. If this function fails, then one must destroy the element and create a new one using gst_device_create_element().

      Note: This should only be implemented for elements can change their device in the PLAYING state.

      Parameters:
      element - a GstElement
      Returns:
      true if the element could be reconfigured to use this device, false otherwise.
      Since:
      1.4
    • onRemoved

    • emitRemoved

      public void emitRemoved()