Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.esau.ptarmigan.impl.filter
Class VorbisFilter  view VorbisFilter download VorbisFilter.java

java.lang.Object
  extended byorg.xml.sax.helpers.XMLFilterImpl
      extended byorg.esau.ptarmigan.impl.filter.BaseFilter
          extended byorg.esau.ptarmigan.impl.filter.BinaryFilter
              extended byorg.esau.ptarmigan.impl.filter.VorbisCommentFilter
                  extended byorg.esau.ptarmigan.impl.filter.VorbisFilter
All Implemented Interfaces:
org.esau.ptarmigan.impl.ByteStreamSource, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public final class VorbisFilter
extends VorbisCommentFilter

Extract metadata from an OGG Vorbis native tag format Following the three header packets, all packets in a Vorbis I stream are audio.


Field Summary
(package private) static java.lang.String ENCODING
           
(package private) static org.apache.commons.logging.Log log
          logging object
(package private)  int m_bit_rate_nominal
           
(package private)  int m_channel_mode
           
(package private) static int PACKET_COMMENT
           
(package private) static int PACKET_IDENTIFICATION
           
(package private) static int PACKET_SETUP
           
 
Fields inherited from class org.esau.ptarmigan.impl.filter.VorbisCommentFilter
MAX_COMMENT_SIZE, NS_PREFIX, NS_URI
 
Fields inherited from class org.esau.ptarmigan.impl.filter.BinaryFilter
ERROR_MSG, m_cis, m_limit_to_impose
 
Fields inherited from class org.esau.ptarmigan.impl.filter.BaseFilter
EMPTY_ATTRS, m_media_properties
 
Fields inherited from class org.xml.sax.helpers.XMLFilterImpl
 
Constructor Summary
VorbisFilter()
           
 
Method Summary
(package private)  int checkForVorbis()
          consume six (6) bytes of the InputStream to verify that they match 'vorbis'
 void doParse()
          SAX-Invoked parse of a 'document' from an input stream.
(package private)  java.lang.String getNamespacePrefix()
           
(package private)  java.lang.String getNamespaceURI()
           
(package private)  void readCommentPacket(int available)
          read comments starting at the current position in the InputStream
(package private)  void readIdentificationPacket(int available)
          read identification header starting at the current position in the InputStream
(package private)  boolean readMarker()
           
(package private)  boolean readPacket(int size)
          read the next packet
(package private)  boolean readPage()
          InputStream should be positioned following the OggS prefix There are one or more packets on a page.
 
Methods inherited from class org.esau.ptarmigan.impl.filter.VorbisCommentFilter
readCommentSubPacket
 
Methods inherited from class org.esau.ptarmigan.impl.filter.BinaryFilter
counter, doParse, fastForward, read, read, read, readCharBE, readCharLE, readInt16BE, readInt16LE, readInt24BE, readInt24LE, readInt32BE, readInt32LE, remaining, rewind, setCounterLimit, skip
 
Methods inherited from class org.esau.ptarmigan.impl.filter.BaseFilter
characters, getByteStream, getChars, getMediaProperties, parse, setMediaProperties, sourceIsXML, write, write, write, write, write, write, write, write, write, write, write, writeDate, writeDate, writeDate, writeDate, writeInteger, writeInteger, writeInteger, writeInteger, writeInteger, writeString, writeString, writeString, writeString, writeString
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_bit_rate_nominal

int m_bit_rate_nominal

m_channel_mode

int m_channel_mode

PACKET_IDENTIFICATION

static final int PACKET_IDENTIFICATION
See Also:
Constant Field Values

PACKET_COMMENT

static final int PACKET_COMMENT
See Also:
Constant Field Values

PACKET_SETUP

static final int PACKET_SETUP
See Also:
Constant Field Values

ENCODING

static final java.lang.String ENCODING
See Also:
Constant Field Values

log

static org.apache.commons.logging.Log log
logging object

Constructor Detail

VorbisFilter

public VorbisFilter()
             throws org.xml.sax.SAXException
Method Detail

getNamespaceURI

java.lang.String getNamespaceURI()
Specified by:
getNamespaceURI in class BaseFilter

getNamespacePrefix

java.lang.String getNamespacePrefix()
Specified by:
getNamespacePrefix in class BaseFilter

doParse

public void doParse()
             throws org.xml.sax.SAXException,
                    java.io.IOException,
                    java.text.ParseException
SAX-Invoked parse of a 'document' from an input stream.

This module creates the document from the parsed Vorbis metadata.

Specified by:
doParse in class BinaryFilter

readPage

boolean readPage()
           throws java.io.IOException,
                  org.xml.sax.SAXException,
                  java.text.ParseException
InputStream should be positioned following the OggS prefix There are one or more packets on a page. The segment values are used to calculate the size of each packet.


readPacket

boolean readPacket(int size)
             throws java.io.IOException,
                    org.xml.sax.SAXException,
                    java.text.ParseException
read the next packet


readIdentificationPacket

void readIdentificationPacket(int available)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               java.text.ParseException
read identification header starting at the current position in the InputStream


readCommentPacket

void readCommentPacket(int available)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        java.text.ParseException
read comments starting at the current position in the InputStream


checkForVorbis

int checkForVorbis()
             throws java.io.IOException,
                    java.text.ParseException
consume six (6) bytes of the InputStream to verify that they match 'vorbis'


readMarker

boolean readMarker()
             throws java.io.IOException