com.coremedia.iso
Class IsoFile

java.lang.Object
  extended by com.coremedia.iso.boxes.AbstractBox
      extended by com.coremedia.iso.boxes.AbstractContainerBox
          extended by com.coremedia.iso.IsoFile
All Implemented Interfaces:
Box, ContainerBox

public class IsoFile
extends AbstractContainerBox

The most upper container for ISO Boxes. It is a container box that is a file. Uses IsoBufferWrapper to access the underlying file.


Field Summary
protected  BoxParser boxParser
           
protected  IsoBufferWrapper originalIso
           
 
Fields inherited from class com.coremedia.iso.boxes.AbstractContainerBox
boxes
 
Fields inherited from class com.coremedia.iso.boxes.AbstractBox
offset, parsed
 
Constructor Summary
IsoFile(IsoBufferWrapper originalIso)
           
IsoFile(IsoBufferWrapper originalIso, BoxParser boxParser)
           
 
Method Summary
static String bytesToFourCC(byte[] type)
           
 long calculateOffset()
           
protected  BoxParser createBoxParser()
           
static byte[] fourCCtoBytes(String fourCC)
           
 BoxParser getBoxParser()
           
 String getDisplayName()
          Returns the human readable name of the box.
 byte[] getHeader()
           
protected  long getHeaderSize()
           
 IsoFile getIsoFile()
           
 long getNumOfBytesToFirstChild()
          Returns the number of bytes from the start of the box to start of the first child.
 long getOffset()
           
 IsoBufferWrapper getOriginalIso()
           
 long getSize()
           
 List<Sample<? extends TrackMetaDataContainer>> getTrack(long trackId)
          Returns the track with the given id as list of Sample.
 void parse()
           
 void parse(IsoBufferWrapper in, long size, BoxParser boxParser, Box lastMovieFragmentBox)
          Pareses the given IsoBufferWrapper and returns the remaining bytes.
 void parseMdats()
           
 String toString()
           
 
Methods inherited from class com.coremedia.iso.boxes.AbstractContainerBox
addBox, getBoxes, getBoxes, getBoxes, getContent, getContentSize, removeBox, setBoxes
 
Methods inherited from class com.coremedia.iso.boxes.AbstractBox
addWriteListener, getBox, getDeadBytes, getParent, getType, getUserType, isParsed, setDeadBytes, setParent, setParsed, setUserType, utf8StringLengthInBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.coremedia.iso.boxes.ContainerBox
getParent
 
Methods inherited from interface com.coremedia.iso.boxes.Box
getBox, getType, getUserType, isParsed
 

Field Detail

boxParser

protected BoxParser boxParser

originalIso

protected IsoBufferWrapper originalIso
Constructor Detail

IsoFile

public IsoFile(IsoBufferWrapper originalIso)

IsoFile

public IsoFile(IsoBufferWrapper originalIso,
               BoxParser boxParser)
Method Detail

createBoxParser

protected BoxParser createBoxParser()

getDisplayName

public String getDisplayName()
Description copied from class: AbstractBox
Returns the human readable name of the box.

Specified by:
getDisplayName in class AbstractBox
Returns:
a display string

parse

public void parse(IsoBufferWrapper in,
                  long size,
                  BoxParser boxParser,
                  Box lastMovieFragmentBox)
           throws IOException
Description copied from class: AbstractBox
Pareses the given IsoBufferWrapper and returns the remaining bytes.

Overrides:
parse in class AbstractContainerBox
Parameters:
in - the (part of the) iso file to parse
size - expected size of the box
boxParser - creates inner boxes
lastMovieFragmentBox - latest of previously found moof boxes
Throws:
IOException - in case of an I/O error.

parse

public void parse()
           throws IOException
Throws:
IOException

parseMdats

public void parseMdats()
                throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class AbstractContainerBox

fourCCtoBytes

public static byte[] fourCCtoBytes(String fourCC)

bytesToFourCC

public static String bytesToFourCC(byte[] type)

getTrack

public List<Sample<? extends TrackMetaDataContainer>> getTrack(long trackId)
Returns the track with the given id as list of Sample. It unifies the track if it is spread over more than one MediaDataBox.

Parameters:
trackId - as stated in ISO 14496-13
Returns:
the track's list of Sample.

getNumOfBytesToFirstChild

public long getNumOfBytesToFirstChild()
Description copied from interface: ContainerBox
Returns the number of bytes from the start of the box to start of the first child.

Specified by:
getNumOfBytesToFirstChild in interface ContainerBox
Overrides:
getNumOfBytesToFirstChild in class AbstractContainerBox
Returns:
offset of first child from box start

getSize

public long getSize()
Specified by:
getSize in interface Box
Overrides:
getSize in class AbstractBox

calculateOffset

public long calculateOffset()
Specified by:
calculateOffset in interface Box
Overrides:
calculateOffset in class AbstractBox

getOffset

public long getOffset()
Specified by:
getOffset in interface Box
Overrides:
getOffset in class AbstractBox

getIsoFile

public IsoFile getIsoFile()
Specified by:
getIsoFile in interface Box
Specified by:
getIsoFile in interface ContainerBox
Overrides:
getIsoFile in class AbstractBox

getHeaderSize

protected long getHeaderSize()
Overrides:
getHeaderSize in class AbstractBox

getHeader

public byte[] getHeader()
Overrides:
getHeader in class AbstractBox

getBoxParser

public BoxParser getBoxParser()

getOriginalIso

public IsoBufferWrapper getOriginalIso()


Copyright © 2011. All Rights Reserved.