org.jaudiotagger.audio.asf.data
Class FileHeader

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
      extended by org.jaudiotagger.audio.asf.data.FileHeader

public class FileHeader
extends Chunk

This class stores the information about the file, which is contained within a special chunk of ASF files.

Author:
Christian Laireiter

Field Summary
private  java.math.BigInteger duration
          Duration of the media content in 100ns steps.
private  java.util.Date fileCreationTime
          The time the file was created.
private  java.math.BigInteger fileSize
          Size of the file or stream.
private  long flags
          Usually contains value of 2.
private  long maxPackageSize
          Maximum size of stream packages.
private  long minPackageSize
          Minimun size of stream packages.
private  java.math.BigInteger packageCount
          Number of stream packages within the File.
private  java.math.BigInteger timeEndPos
          No Idea of the Meaning, but stored anyway.
private  java.math.BigInteger timeStartPos
          Like timeEndPosno Idea.
private  long uncompressedFrameSize
          Size of an uncompressed video frame.
 
Fields inherited from class org.jaudiotagger.audio.asf.data.Chunk
chunkLength, guid, position
 
Constructor Summary
FileHeader(java.math.BigInteger chunckLen, java.math.BigInteger size, java.math.BigInteger fileTime, java.math.BigInteger pkgCount, java.math.BigInteger dur, java.math.BigInteger timestampStart, java.math.BigInteger timestampEnd, long headerFlags, long minPkgSize, long maxPkgSize, long uncmpVideoFrameSize)
          Creates an instance.
 
Method Summary
 java.math.BigInteger getDuration()
           
 int getDurationInSeconds()
          This method converts getDuration()from 100ns steps to normal seconds.
 java.util.Date getFileCreationTime()
           
 java.math.BigInteger getFileSize()
           
 long getFlags()
           
 long getMaxPackageSize()
           
 long getMinPackageSize()
           
 java.math.BigInteger getPackageCount()
           
 float getPreciseDuration()
          This method converts getDuration() from 100ns steps to normal seconds with a fractional part taking milliseconds.
 java.math.BigInteger getTimeEndPos()
           
 java.math.BigInteger getTimeStartPos()
           
 long getUncompressedFrameSize()
           
 java.lang.String prettyPrint(java.lang.String prefix)
          (overridden)
 
Methods inherited from class org.jaudiotagger.audio.asf.data.Chunk
getChunckEnd, getChunkEnd, getChunkLength, getGuid, getPosition, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

duration

private final java.math.BigInteger duration
Duration of the media content in 100ns steps.


fileCreationTime

private final java.util.Date fileCreationTime
The time the file was created.


fileSize

private final java.math.BigInteger fileSize
Size of the file or stream.


flags

private final long flags
Usually contains value of 2.


maxPackageSize

private final long maxPackageSize
Maximum size of stream packages.
Warning: must be same size as minPackageSize. Its not known how to handle deviating values.


minPackageSize

private final long minPackageSize
Minimun size of stream packages.
Warning: must be same size as maxPackageSize. Its not known how to handle deviating values.


packageCount

private final java.math.BigInteger packageCount
Number of stream packages within the File.


timeEndPos

private final java.math.BigInteger timeEndPos
No Idea of the Meaning, but stored anyway.
Source documentation says it is: "Timestamp of end position"


timeStartPos

private final java.math.BigInteger timeStartPos
Like timeEndPosno Idea.


uncompressedFrameSize

private final long uncompressedFrameSize
Size of an uncompressed video frame.

Constructor Detail

FileHeader

public FileHeader(java.math.BigInteger chunckLen,
                  java.math.BigInteger size,
                  java.math.BigInteger fileTime,
                  java.math.BigInteger pkgCount,
                  java.math.BigInteger dur,
                  java.math.BigInteger timestampStart,
                  java.math.BigInteger timestampEnd,
                  long headerFlags,
                  long minPkgSize,
                  long maxPkgSize,
                  long uncmpVideoFrameSize)
Creates an instance.

Parameters:
chunckLen - Length of the file header (chunk)
size - Size of file or stream
fileTime - Time file or stream was created. Time is calculated since 1st january of 1601 in 100ns steps.
pkgCount - Number of stream packages.
dur - Duration of media clip in 100ns steps
timestampStart - Timestamp of start timeStartPos
timestampEnd - Timestamp of end timeEndPos
headerFlags - some stream related flags.
minPkgSize - minimum size of packages
maxPkgSize - maximum size of packages
uncmpVideoFrameSize - Size of an uncompressed Video Frame.
Method Detail

getDuration

public java.math.BigInteger getDuration()
Returns:
Returns the duration.

getDurationInSeconds

public int getDurationInSeconds()
This method converts getDuration()from 100ns steps to normal seconds.

Returns:
Duration of the media in seconds.

getFileCreationTime

public java.util.Date getFileCreationTime()
Returns:
Returns the fileCreationTime.

getFileSize

public java.math.BigInteger getFileSize()
Returns:
Returns the fileSize.

getFlags

public long getFlags()
Returns:
Returns the flags.

getMaxPackageSize

public long getMaxPackageSize()
Returns:
Returns the maxPackageSize.

getMinPackageSize

public long getMinPackageSize()
Returns:
Returns the minPackageSize.

getPackageCount

public java.math.BigInteger getPackageCount()
Returns:
Returns the packageCount.

getPreciseDuration

public float getPreciseDuration()
This method converts getDuration() from 100ns steps to normal seconds with a fractional part taking milliseconds.

Returns:
The duration of the media in seconds (with a precision of milliseconds)

getTimeEndPos

public java.math.BigInteger getTimeEndPos()
Returns:
Returns the timeEndPos.

getTimeStartPos

public java.math.BigInteger getTimeStartPos()
Returns:
Returns the timeStartPos.

getUncompressedFrameSize

public long getUncompressedFrameSize()
Returns:
Returns the uncompressedFrameSize.

prettyPrint

public java.lang.String prettyPrint(java.lang.String prefix)
(overridden)

Overrides:
prettyPrint in class Chunk
Parameters:
prefix - each line gets this string prepended.
Returns:
Information of current Chunk Object.
See Also:
Chunk.prettyPrint(String)