org.stanwood.media.info
Class VideoInfoParser

java.lang.Object
  extended by org.stanwood.media.xml.XMLParser
      extended by org.stanwood.media.info.VideoInfoParser

public class VideoInfoParser
extends XMLParser

This class is used to parse the XML output of the mediainfo command


Field Summary
 
Fields inherited from class org.stanwood.media.xml.XMLParser
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION
 
Constructor Summary
VideoInfoParser(org.w3c.dom.Document dom)
          Constructor
 
Method Summary
 java.lang.String getAspectRatio()
          Used to get the aspect ratio or null if it can't be found
 java.lang.Long getAudioBitRate()
          Used to get the audio bit rate (Kbs)
 java.lang.String getAudioFormatProfile()
          Used to get the audio format profile
 java.lang.Integer getDuration()
          Used to get the video duration in milliseconds or null if it can't be found
 java.lang.Float getFrameRate()
          Used to get the frames per second or null if it can't be found
 java.lang.Integer getHeight()
          Used to get the height in pixels or null if it can be found
 boolean getInterlaced()
          Used to find out if the scan type is interlaced
 java.lang.Integer getWidth()
          Used to get the width in pixels or null if it can be found
 
Methods inherited from class org.stanwood.media.xml.XMLParser
createDocBuilder, createFactory, deleteNode, domToStr, encodeAttributeValue, firstChild, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoInfoParser

public VideoInfoParser(org.w3c.dom.Document dom)
Constructor

Parameters:
dom - The DOM XML model output from the command mediainfo
Method Detail

getHeight

public java.lang.Integer getHeight()
                            throws XMLParserException
Used to get the height in pixels or null if it can be found

Returns:
the height or null if it can be found
Throws:
XMLParserException - Thrown if their is a parser error

getWidth

public java.lang.Integer getWidth()
                           throws XMLParserException
Used to get the width in pixels or null if it can be found

Returns:
the width or null if it can be found
Throws:
XMLParserException - Thrown if their is a parser error

getFrameRate

public java.lang.Float getFrameRate()
                             throws XMLParserException
Used to get the frames per second or null if it can't be found

Returns:
the frames per second or null if it can't be found
Throws:
XMLParserException - Thrown if their is a parser error

getDuration

public java.lang.Integer getDuration()
                              throws XMLParserException
Used to get the video duration in milliseconds or null if it can't be found

Returns:
the video duration in milliseconds or null if it can't be found
Throws:
XMLParserException - Thrown if their is a parser error

getAspectRatio

public java.lang.String getAspectRatio()
                                throws XMLParserException
Used to get the aspect ratio or null if it can't be found

Returns:
the aspect ratio or null if it can't be found
Throws:
XMLParserException - Thrown if their is a parser error

getInterlaced

public boolean getInterlaced()
                      throws XMLParserException
Used to find out if the scan type is interlaced

Returns:
true if the scan type is interlaced, otherwise false
Throws:
XMLParserException - Thrown if their is a parser error

getAudioFormatProfile

public java.lang.String getAudioFormatProfile()
                                       throws XMLParserException
Used to get the audio format profile

Returns:
The audio format profile
Throws:
XMLParserException - Thrown if their is a parser error

getAudioBitRate

public java.lang.Long getAudioBitRate()
                               throws XMLParserException
Used to get the audio bit rate (Kbs)

Returns:
The audio bit rate (Kbs)
Throws:
XMLParserException