Class EncodingTarget

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class EncodingTarget extends GObject

Collection of GstEncodingProfile for a specific target or use-case.

When being stored/loaded, targets come from a specific category, like GST_ENCODING_CATEGORY_DEVICE.

  • Constructor Details

    • EncodingTarget

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

      public EncodingTarget(String name, String category, String description, List<EncodingProfile> profiles)

      Creates a new GstEncodingTarget.

      The name and category can only consist of lowercase ASCII letters for the first character, followed by either lowercase ASCII letters, digits or hyphens ('-').

      The category should be one of the existing well-defined categories, like GST_ENCODING_CATEGORY_DEVICE, but it can be a application or user specific category if needed.

      Parameters:
      name - The name of the target.
      category - The name of the category to which this target belongs. For example: GST_ENCODING_CATEGORY_DEVICE.
      description - A description of GstEncodingTarget in the current locale.
      profiles - A GList of GstEncodingProfile.
    • EncodingTarget

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

    • getType

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

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

      protected EncodingTarget 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 GObject
      Returns:
      the instance as if it were its parent type
    • load

      public static EncodingTarget load(String name, @Nullable String category) throws GErrorException

      Searches for the GstEncodingTarget with the given name, loads it and returns it.

      If the category name is specified only targets from that category will be searched for.

      Parameters:
      name - the name of the GstEncodingTarget to load (automatically converted to lower case internally as capital letters are not valid for target names).
      category - the name of the target category, like GST_ENCODING_CATEGORY_DEVICE. Can be null
      Returns:
      The GstEncodingTarget if available, else null.
      Throws:
      GErrorException - see GError
    • loadFromFile

      public static EncodingTarget loadFromFile(String filepath) throws GErrorException
      Opens the provided file and returns the contained GstEncodingTarget.
      Parameters:
      filepath - The file location to load the GstEncodingTarget from
      Returns:
      The GstEncodingTarget contained in the file, else null
      Throws:
      GErrorException - see GError
    • addProfile

      public boolean addProfile(EncodingProfile profile)

      Adds the given profile to the target. Each added profile must have a unique name within the profile.

      The this EncodingTarget will steal a reference to the profile. If you wish to use the profile after calling this method, you should increase its reference count.

      Parameters:
      profile - the GstEncodingProfile to add
      Returns:
      true if the profile was added, else false.
    • getCategory

      public String getCategory()
    • getDescription

      public String getDescription()
    • getName

      public String getName()
    • getPath

      public @Nullable String getPath()
    • getProfile

      public @Nullable EncodingProfile getProfile(String name)
    • getProfiles

      public List<EncodingProfile> getProfiles()
    • save

      public boolean save() throws GErrorException
      Saves the this EncodingTarget to a default user-local directory.
      Returns:
      true if the target was correctly saved, else false.
      Throws:
      GErrorException - see GError
    • saveToFile

      public boolean saveToFile(String filepath) throws GErrorException
      Saves the this EncodingTarget to the provided file location.
      Parameters:
      filepath - the location to store the this EncodingTarget at.
      Returns:
      true if the target was correctly saved, else false.
      Throws:
      GErrorException - see GError
    • builder

      public static EncodingTarget.Builder<? extends EncodingTarget.Builder> builder()
      A EncodingTarget.Builder object constructs a EncodingTarget with the specified properties. Use the various set...() methods to set properties, and finish construction with EncodingTarget.Builder.build().
      Returns:
      the builder object