com.coremedia.iso.boxes.sampleentry
Class SampleEntry

java.lang.Object
  extended by com.coremedia.iso.boxes.AbstractBox
      extended by com.coremedia.iso.boxes.sampleentry.SampleEntry
All Implemented Interfaces:
Box, ContainerBox
Direct Known Subclasses:
ActionMessageFormat0SampleEntryBox, AudioSampleEntry, MpegSampleEntry, Ovc1VisualSampleEntryImpl, SubtitleSampleEntry, TextSampleEntry, VisualSampleEntry

public abstract class SampleEntry
extends AbstractBox
implements ContainerBox

Abstract base class for all sample entries.

See Also:
AudioSampleEntry, VisualSampleEntry, TextSampleEntry

Field Summary
protected  List<Box> boxes
           
 
Fields inherited from class com.coremedia.iso.boxes.AbstractBox
deadBytes, type
 
Constructor Summary
protected SampleEntry(String type)
           
 
Method Summary
 void _parseChildBoxes(ByteBuffer content)
           
 void _parseReservedAndDataReferenceIndex(ByteBuffer content)
           
 void _writeChildBoxes(ByteBuffer bb)
           
 void _writeReservedAndDataReferenceIndex(ByteBuffer bb)
           
 void addBox(AbstractBox b)
           
 List<Box> getBoxes()
          Gets all child boxes.
<T extends Box>
List<T>
getBoxes(Class<T> clazz)
          Gets all child boxes of the given type.
<T extends Box>
List<T>
getBoxes(Class<T> clazz, boolean recursive)
          Gets all child boxes of the given type.
 int getDataReferenceIndex()
           
 long getNumOfBytesToFirstChild()
          Returns the number of bytes from the start of the box to start of the first child.
 void parse(ReadableByteChannel in, ByteBuffer header, long contentSize, BoxParser boxParser)
          Pareses the given IsoBufferWrapper and returns the remaining bytes.
 boolean removeBox(Box b)
           
 void setBoxes(List<Box> boxes)
          Sets all boxes and removes all previous child boxes.
 void setDataReferenceIndex(int dataReferenceIndex)
           
 void setType(String type)
           
 
Methods inherited from class com.coremedia.iso.boxes.AbstractBox
_parseDetails, getBox, getContent, getContentSize, getDeadBytes, getHeader, getIsoFile, getParent, getSize, getType, getUserType, isParsed, parseDetails, setDeadBytes, setParent, setUserType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.coremedia.iso.boxes.ContainerBox
getIsoFile, getParent
 
Methods inherited from interface com.coremedia.iso.boxes.Box
getBox, getSize, getType, setParent
 

Field Detail

boxes

protected List<Box> boxes
Constructor Detail

SampleEntry

protected SampleEntry(String type)
Method Detail

setType

public void setType(String type)

getDataReferenceIndex

public int getDataReferenceIndex()

setDataReferenceIndex

public void setDataReferenceIndex(int dataReferenceIndex)

setBoxes

public void setBoxes(List<Box> boxes)
Description copied from interface: ContainerBox
Sets all boxes and removes all previous child boxes.

Specified by:
setBoxes in interface ContainerBox
Parameters:
boxes - the new list of children

addBox

public void addBox(AbstractBox b)

removeBox

public boolean removeBox(Box b)

getBoxes

public List<Box> getBoxes()
Description copied from interface: ContainerBox
Gets all child boxes. May not return null.

Specified by:
getBoxes in interface ContainerBox
Returns:
an array of boxes, empty array in case of no children.

getBoxes

public <T extends Box> List<T> getBoxes(Class<T> clazz,
                                        boolean recursive)
Description copied from interface: ContainerBox
Gets all child boxes of the given type. May not return null.

Specified by:
getBoxes in interface ContainerBox
Parameters:
clazz - child box's type
recursive - step down the tree
Returns:
an array of boxes, empty array in case of no children.

getBoxes

public <T extends Box> List<T> getBoxes(Class<T> clazz)
Description copied from interface: ContainerBox
Gets all child boxes of the given type. May not return null.

Specified by:
getBoxes in interface ContainerBox
Parameters:
clazz - child box's type
Returns:
an array of boxes, empty array in case of no children.

parse

public void parse(ReadableByteChannel in,
                  ByteBuffer header,
                  long contentSize,
                  BoxParser boxParser)
           throws IOException
Description copied from class: AbstractBox
Pareses the given IsoBufferWrapper and returns the remaining bytes.

Specified by:
parse in interface Box
Overrides:
parse in class AbstractBox
Parameters:
in - the (part of the) iso file to parse
contentSize - expected contentSize of the box
boxParser - creates inner boxes
Throws:
IOException - in case of an I/O error.

_parseReservedAndDataReferenceIndex

public void _parseReservedAndDataReferenceIndex(ByteBuffer content)

_parseChildBoxes

public void _parseChildBoxes(ByteBuffer content)

_writeReservedAndDataReferenceIndex

public void _writeReservedAndDataReferenceIndex(ByteBuffer bb)

_writeChildBoxes

public void _writeChildBoxes(ByteBuffer bb)
                      throws IOException
Throws:
IOException

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
Returns:
offset of first child from box start


Copyright © 2012. All Rights Reserved.