org.gagravarr.vorbis
Class VorbisPacket

java.lang.Object
  extended by org.gagravarr.ogg.HighLevelOggStreamPacket
      extended by org.gagravarr.vorbis.VorbisPacket
Direct Known Subclasses:
VorbisAudioData, VorbisComments, VorbisInfo, VorbisSetup

public abstract class VorbisPacket
extends HighLevelOggStreamPacket

Parent of all Vorbis packets


Field Summary
protected static int HEADER_LENGTH_AUDIO
           
protected static int HEADER_LENGTH_METADATA
           
static int TYPE_COMMENTS
           
static int TYPE_INFO
           
static int TYPE_SETUP
           
 
Constructor Summary
protected VorbisPacket()
           
protected VorbisPacket(OggPacket oggPacket)
           
 
Method Summary
static VorbisPacket create(OggPacket packet)
          Creates the appropriate VorbisPacket instance based on the type.
protected abstract  int getHeaderSize()
          How big is the header on this packet? For Metadata packets it's normally 7 bytes, otherwise for audio packets there is no header.
static boolean isVorbisStream(OggPacket firstPacket)
          Does this packet (the first in the stream) contain the magic string indicating that it's a vorbis one?
protected  void populateMetadataHeader(byte[] b, int type, int dataLength)
          Popupulates the metadata packet header, which is "#vorbis" where # is the type.
 
Methods inherited from class org.gagravarr.ogg.HighLevelOggStreamPacket
getData, getOggPacket, setData, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_INFO

public static final int TYPE_INFO
See Also:
Constant Field Values

TYPE_COMMENTS

public static final int TYPE_COMMENTS
See Also:
Constant Field Values

TYPE_SETUP

public static final int TYPE_SETUP
See Also:
Constant Field Values

HEADER_LENGTH_METADATA

protected static final int HEADER_LENGTH_METADATA
See Also:
Constant Field Values

HEADER_LENGTH_AUDIO

protected static final int HEADER_LENGTH_AUDIO
See Also:
Constant Field Values
Constructor Detail

VorbisPacket

protected VorbisPacket(OggPacket oggPacket)

VorbisPacket

protected VorbisPacket()
Method Detail

getHeaderSize

protected abstract int getHeaderSize()
How big is the header on this packet? For Metadata packets it's normally 7 bytes, otherwise for audio packets there is no header.


populateMetadataHeader

protected void populateMetadataHeader(byte[] b,
                                      int type,
                                      int dataLength)
Popupulates the metadata packet header, which is "#vorbis" where # is the type.


isVorbisStream

public static boolean isVorbisStream(OggPacket firstPacket)
Does this packet (the first in the stream) contain the magic string indicating that it's a vorbis one?


create

public static VorbisPacket create(OggPacket packet)
Creates the appropriate VorbisPacket instance based on the type.



Copyright © 2012. All Rights Reserved.