com.coremedia.iso.boxes.mdat
Class MediaDataBox

java.lang.Object
  extended by com.coremedia.iso.boxes.mdat.MediaDataBox
All Implemented Interfaces:
Box

public final class MediaDataBox
extends Object
implements Box

This box contains the media data. In video tracks, this box would contain video frames. A presentation may contain zero or more Media Data Boxes. The actual media data follows the type field; its structure is described by the metadata (see SampleTableBox).
In large presentations, it may be desirable to have more data in this box than a 32-bit size would permit. In this case, the large variant of the size field is used.
There may be any number of these boxes in the file (including zero, if all the media data is in other files). The metadata refers to media data by its absolute offset within the file (see StaticChunkOffsetBox); so Media Data Box headers and free space may easily be skipped, and files without any box structure may also be referenced and used.


Field Summary
static int BUFFER_SIZE
           
static String TYPE
           
 
Constructor Summary
MediaDataBox()
           
 
Method Summary
 void getBox(WritableByteChannel writableByteChannel)
          Writes the complete box - size | 4-cc | content - to the given writableByteChannel.
 ByteBuffer getContent(long offset, int length)
           
 ByteBuffer getHeader()
           
 ContainerBox getParent()
           
 long getSize()
           
 String getType()
          The box's 4-cc type.
 void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser)
           
 void setParent(ContainerBox parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

MediaDataBox

public MediaDataBox()
Method Detail

getParent

public ContainerBox getParent()
Specified by:
getParent in interface Box

setParent

public void setParent(ContainerBox parent)
Specified by:
setParent in interface Box

getType

public String getType()
Description copied from interface: Box
The box's 4-cc type.

Specified by:
getType in interface Box
Returns:
the 4 character type of the box

getBox

public void getBox(WritableByteChannel writableByteChannel)
            throws IOException
Description copied from interface: Box
Writes the complete box - size | 4-cc | content - to the given writableByteChannel.

Specified by:
getBox in interface Box
Parameters:
writableByteChannel - the box's sink
Throws:
IOException - in case of problems with the Channel

getSize

public long getSize()
Specified by:
getSize in interface Box

parse

public void parse(ReadableByteChannel readableByteChannel,
                  ByteBuffer header,
                  long contentSize,
                  BoxParser boxParser)
           throws IOException
Specified by:
parse in interface Box
Throws:
IOException

getContent

public ByteBuffer getContent(long offset,
                             int length)

getHeader

public ByteBuffer getHeader()


Copyright © 2012. All Rights Reserved.