Class OpusTags
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.opus.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.NativeResourceThe 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_commentsstrings for safety. However, the bitstream format itself treats them as 8-bit clean vectors, possibly containingNULcharacters, so the#comment_lengthsarray 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 tovorbis_commentpointers, 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(); intcomments(); char *vendor(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpusTags.BufferAn array ofOpusTagsstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intCOMMENT_LENGTHS
COMMENTSThe struct member offsets.static intSIZEOFThe struct size in bytes.static intUSER_COMMENTS
VENDORThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OpusTags(java.nio.ByteBuffer container)Creates aOpusTagsinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OpusTagscalloc()Returns a newOpusTagsinstance allocated withmemCalloc.static OpusTags.Buffercalloc(int capacity)Returns a newOpusTags.Bufferinstance allocated withmemCalloc.static OpusTags.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOpusTags.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OpusTagscalloc(org.lwjgl.system.MemoryStack stack)Returns a newOpusTagsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.java.nio.IntBuffercomment_lengths()an array of the corresponding length of each vector, in bytesintcomments()the total number of comment streamsstatic OpusTagscreate()Returns a newOpusTagsinstance allocated withBufferUtils.static OpusTags.Buffercreate(int capacity)Returns a newOpusTags.Bufferinstance allocated withBufferUtils.static OpusTagscreate(long address)Returns a newOpusTagsinstance for the specified memory address.static OpusTags.Buffercreate(long address, int capacity)Create aOpusTags.Bufferinstance at the specified memory.static OpusTagscreateSafe(long address)static OpusTags.BuffercreateSafe(long address, int capacity)static OpusTagsmalloc()Returns a newOpusTagsinstance allocated withmemAlloc.static OpusTags.Buffermalloc(int capacity)Returns a newOpusTags.Bufferinstance allocated withmemAlloc.static OpusTags.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOpusTags.Bufferinstance allocated on the specifiedMemoryStack.static OpusTagsmalloc(org.lwjgl.system.MemoryStack stack)Returns a newOpusTagsinstance allocated on the specifiedMemoryStack.static java.nio.IntBufferncomment_lengths(long struct)Unsafe version ofcomment_lengths.static intncomments(long struct)Unsafe version ofcomments().static org.lwjgl.PointerBuffernuser_comments(long struct)Unsafe version ofuser_comments.static java.nio.ByteBuffernvendor(long struct)Unsafe version ofvendor().static java.lang.StringnvendorString(long struct)Unsafe version ofvendorString().intsizeof()org.lwjgl.PointerBufferuser_comments()the array of comment string vectorsjava.nio.ByteBuffervendor()the null-terminated vendor string.java.lang.StringvendorString()the null-terminated vendor string.
-
-
-
Constructor Detail
-
OpusTags
public OpusTags(java.nio.ByteBuffer container)
Creates aOpusTagsinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.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 newOpusTagsinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OpusTags calloc()
Returns a newOpusTagsinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OpusTags create()
Returns a newOpusTagsinstance allocated withBufferUtils.
-
create
public static OpusTags create(long address)
Returns a newOpusTagsinstance for the specified memory address.
-
createSafe
@Nullable public static OpusTags createSafe(long address)
-
malloc
public static OpusTags.Buffer malloc(int capacity)
Returns a newOpusTags.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OpusTags.Buffer calloc(int capacity)
Returns a newOpusTags.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OpusTags.Buffer create(int capacity)
Returns a newOpusTags.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OpusTags.Buffer create(long address, int capacity)
Create aOpusTags.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static OpusTags.Buffer createSafe(long address, int capacity)
-
malloc
public static OpusTags malloc(org.lwjgl.system.MemoryStack stack)
Returns a newOpusTagsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static OpusTags calloc(org.lwjgl.system.MemoryStack stack)
Returns a newOpusTagsinstance allocated on the specifiedMemoryStackand 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 newOpusTags.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static OpusTags.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOpusTags.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nuser_comments
public static org.lwjgl.PointerBuffer nuser_comments(long struct)
Unsafe version ofuser_comments.
-
ncomment_lengths
public static java.nio.IntBuffer ncomment_lengths(long struct)
Unsafe version ofcomment_lengths.
-
ncomments
public static int ncomments(long struct)
Unsafe version ofcomments().
-
nvendor
public static java.nio.ByteBuffer nvendor(long struct)
Unsafe version ofvendor().
-
nvendorString
public static java.lang.String nvendorString(long struct)
Unsafe version ofvendorString().
-
-