org.xnap.plugin.viewer.videoinfo
Class VideoFile

java.lang.Object
  extended by java.io.File
      extended by org.xnap.plugin.viewer.videoinfo.VideoFile
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>

public class VideoFile
extends java.io.File

Class to extract a video's play length and resolution. The video parsing code for avi and mpeg files is taken from the ziga project. See README for more information. The video parsing code for asf files is taken from the avifile project (http://avifile.sourceforge.net/).

See Also:
Serialized Form

Nested Class Summary
protected  class VideoFile.ASFCodecList
           
protected  class VideoFile.ASFMainHeader
           
protected  class VideoFile.ASFStreamHeader
           
protected  class VideoFile.GUID
           
 
Field Summary
protected  VideoFile.GUID ASF_AUDIO_MEDIA_GUID
           
protected  VideoFile.GUID ASF_CODEC_LIST_GUID
           
protected  VideoFile.GUID ASF_FILE_PROPERTIES_GUID
           
protected static int ASF_FILE_PROPERTIES_SIZE
           
protected  VideoFile.GUID ASF_HEADER_GUID
           
protected  VideoFile.GUID ASF_STREAM_PROPERTIES_GUID
           
protected static int ASF_STREAM_PROPERTIES_SIZE
           
protected static int GROUP_START_CODE
           
protected static int GUID_SIZE
           
protected static int MAX_BACKWARD_READ_LENGTH
           
protected static int MAX_FORWARD_READ_LENGTH
           
protected static int PACK_START_CODE
           
protected static int SEQ_START_CODE
           
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
VideoFile(java.io.File f)
           
 
Method Summary
 int getHeight()
           
 java.lang.String getInfo()
           
 int getLength()
           
protected  java.lang.Long getMPEG2SCR(byte[] b)
           
protected  java.lang.Long getMPEGSCR(byte[] b)
           
 int getWidth()
           
protected  boolean lookForASF()
           
protected  boolean lookForAVI()
           
protected  boolean lookForMPEG()
           
protected  boolean nextStartCode()
           
 boolean parse()
           
protected  boolean previousStartCode()
           
protected  int readBigEndianInt()
           
protected  long readBigEndianLong()
           
protected  short readBigEndianShort()
           
protected  java.lang.String readChunk()
           
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PACK_START_CODE

protected static final int PACK_START_CODE
See Also:
Constant Field Values

SEQ_START_CODE

protected static final int SEQ_START_CODE
See Also:
Constant Field Values

GROUP_START_CODE

protected static final int GROUP_START_CODE
See Also:
Constant Field Values

MAX_FORWARD_READ_LENGTH

protected static final int MAX_FORWARD_READ_LENGTH
See Also:
Constant Field Values

MAX_BACKWARD_READ_LENGTH

protected static final int MAX_BACKWARD_READ_LENGTH
See Also:
Constant Field Values

ASF_FILE_PROPERTIES_SIZE

protected static final int ASF_FILE_PROPERTIES_SIZE
See Also:
Constant Field Values

ASF_STREAM_PROPERTIES_SIZE

protected static final int ASF_STREAM_PROPERTIES_SIZE
See Also:
Constant Field Values

GUID_SIZE

protected static final int GUID_SIZE
See Also:
Constant Field Values

ASF_HEADER_GUID

protected final transient VideoFile.GUID ASF_HEADER_GUID

ASF_FILE_PROPERTIES_GUID

protected final transient VideoFile.GUID ASF_FILE_PROPERTIES_GUID

ASF_STREAM_PROPERTIES_GUID

protected final transient VideoFile.GUID ASF_STREAM_PROPERTIES_GUID

ASF_AUDIO_MEDIA_GUID

protected final transient VideoFile.GUID ASF_AUDIO_MEDIA_GUID

ASF_CODEC_LIST_GUID

protected final transient VideoFile.GUID ASF_CODEC_LIST_GUID
Constructor Detail

VideoFile

public VideoFile(java.io.File f)
Method Detail

parse

public boolean parse()

getHeight

public int getHeight()

getInfo

public java.lang.String getInfo()

getLength

public int getLength()

getWidth

public int getWidth()

lookForAVI

protected boolean lookForAVI()
                      throws java.io.IOException
Throws:
java.io.IOException

lookForASF

protected boolean lookForASF()
                      throws java.io.IOException
Throws:
java.io.IOException

lookForMPEG

protected boolean lookForMPEG()
                       throws java.io.IOException
Throws:
java.io.IOException

readChunk

protected final java.lang.String readChunk()
                                    throws java.io.IOException
Throws:
java.io.IOException

readBigEndianShort

protected final short readBigEndianShort()
                                  throws java.io.IOException
Throws:
java.io.IOException

readBigEndianInt

protected final int readBigEndianInt()
                              throws java.io.IOException
Throws:
java.io.IOException

readBigEndianLong

protected final long readBigEndianLong()
                                throws java.io.IOException
Throws:
java.io.IOException

getMPEGSCR

protected java.lang.Long getMPEGSCR(byte[] b)

getMPEG2SCR

protected java.lang.Long getMPEG2SCR(byte[] b)

nextStartCode

protected boolean nextStartCode()

previousStartCode

protected boolean previousStartCode()


Copyright © 2001-2005 XNap Team. All Rights Reserved.