Class OpusTags

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class OpusTags
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    The metadata from an Ogg Opus stream.

    This structure holds the in-stream metadata corresponding to the 'comment' header packet of an Ogg Opus stream. The comment header is meant to be used much like someone jotting a quick note on the label of a CD. It should be a short, to the point text note that can be more than a couple words, but not more than a short paragraph.

    The metadata is stored as a series of (tag, value) pairs, in length-encoded string vectors, using the same format as Vorbis (without the final "framing bit"), Theora, and Speex, except for the packet header. The first occurrence of the '=' character delimits the tag and value. A particular tag may occur more than once, and order is significant. The character set encoding for the strings is always UTF-8, but the tag names are limited to ASCII, and treated as case-insensitive. See the Vorbis comment header specification for details.

    In filling in this structure, libopusfile will null-terminate the #user_comments strings for safety. However, the bitstream format itself treats them as 8-bit clean vectors, possibly containing NUL characters, so the #comment_lengths array should be treated as their authoritative length.

    This structure is binary and source-compatible with a vorbis_comment, and pointers to it may be freely cast to vorbis_comment pointers, and vice versa. It is provided as a separate type to avoid introducing a compile-time dependency on the libvorbis headers.

    Layout

    
     struct OpusTags {
         char ** user_comments();
         int * comment_lengths();
         int comments();
         char * vendor();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  OpusTags.Buffer
      An array of OpusTags structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int COMMENT_LENGTHS
      COMMENTS
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      static int USER_COMMENTS
      VENDOR
      The struct member offsets.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      OpusTags​(java.nio.ByteBuffer container)
      Creates a OpusTags instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static OpusTags calloc()
      Returns a new OpusTags instance allocated with memCalloc.
      static OpusTags.Buffer calloc​(int capacity)
      Returns a new OpusTags.Buffer instance allocated with memCalloc.
      static OpusTags.Buffer calloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new OpusTags.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static OpusTags calloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new OpusTags instance allocated on the specified MemoryStack and initializes all its bits to zero.
      java.nio.IntBuffer comment_lengths()
      an array of the corresponding length of each vector, in bytes
      int comments()
      the total number of comment streams
      static OpusTags create()
      Returns a new OpusTags instance allocated with BufferUtils.
      static OpusTags.Buffer create​(int capacity)
      Returns a new OpusTags.Buffer instance allocated with BufferUtils.
      static OpusTags create​(long address)
      Returns a new OpusTags instance for the specified memory address.
      static OpusTags.Buffer create​(long address, int capacity)
      Create a OpusTags.Buffer instance at the specified memory.
      static OpusTags createSafe​(long address)
      Like create, but returns null if address is NULL.
      static OpusTags.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      static OpusTags malloc()
      Returns a new OpusTags instance allocated with memAlloc.
      static OpusTags.Buffer malloc​(int capacity)
      Returns a new OpusTags.Buffer instance allocated with memAlloc.
      static OpusTags.Buffer malloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new OpusTags.Buffer instance allocated on the specified MemoryStack.
      static OpusTags malloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new OpusTags instance allocated on the specified MemoryStack.
      static java.nio.IntBuffer ncomment_lengths​(long struct)
      Unsafe version of comment_lengths.
      static int ncomments​(long struct)
      Unsafe version of comments().
      static org.lwjgl.PointerBuffer nuser_comments​(long struct)
      Unsafe version of user_comments.
      static java.nio.ByteBuffer nvendor​(long struct)
      Unsafe version of vendor().
      static java.lang.String nvendorString​(long struct)
      Unsafe version of vendorString().
      int sizeof()  
      org.lwjgl.PointerBuffer user_comments()
      the array of comment string vectors
      java.nio.ByteBuffer vendor()
      the null-terminated vendor string.
      java.lang.String vendorString()
      the null-terminated vendor string.
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull, validate
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • USER_COMMENTS, COMMENT_LENGTHS, COMMENTS, VENDOR

        The struct member offsets.
    • Constructor Detail

      • OpusTags

        public OpusTags​(java.nio.ByteBuffer container)
        Creates a OpusTags instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • user_comments

        public org.lwjgl.PointerBuffer user_comments()
        the array of comment string vectors
      • comment_lengths

        public java.nio.IntBuffer comment_lengths()
        an array of the corresponding length of each vector, in bytes
      • comments

        public int comments()
        the total number of comment streams
      • vendor, vendorString

        public java.nio.ByteBuffer vendor()
        
        public java.lang.String vendorString()
        
        the null-terminated vendor string. This identifies the software used to encode the stream.
      • malloc

        public static OpusTags malloc()
        Returns a new OpusTags instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static OpusTags calloc()
        Returns a new OpusTags instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static OpusTags create()
        Returns a new OpusTags instance allocated with BufferUtils.
      • create

        public static OpusTags create​(long address)
        Returns a new OpusTags instance for the specified memory address.
      • createSafe

        @Nullable
        public static OpusTags createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static OpusTags.Buffer malloc​(int capacity)
        Returns a new OpusTags.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static OpusTags.Buffer calloc​(int capacity)
        Returns a new OpusTags.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static OpusTags.Buffer create​(int capacity)
        Returns a new OpusTags.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static OpusTags.Buffer create​(long address,
                                             int capacity)
        Create a OpusTags.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static OpusTags.Buffer createSafe​(long address,
                                                 int capacity)
        Like create, but returns null if address is NULL.
      • malloc

        public static OpusTags malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new OpusTags instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static OpusTags calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new OpusTags instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static OpusTags.Buffer malloc​(int capacity,
                                             org.lwjgl.system.MemoryStack stack)
        Returns a new OpusTags.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static OpusTags.Buffer calloc​(int capacity,
                                             org.lwjgl.system.MemoryStack stack)
        Returns a new OpusTags.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nuser_comments

        public static org.lwjgl.PointerBuffer nuser_comments​(long struct)
        Unsafe version of user_comments.
      • ncomment_lengths

        public static java.nio.IntBuffer ncomment_lengths​(long struct)
        Unsafe version of comment_lengths.
      • ncomments

        public static int ncomments​(long struct)
        Unsafe version of comments().
      • nvendor

        public static java.nio.ByteBuffer nvendor​(long struct)
        Unsafe version of vendor().
      • nvendorString

        public static java.lang.String nvendorString​(long struct)
        Unsafe version of vendorString().