Class SampleDescriptionBox

java.lang.Object
org.mp4parser.BasicContainer
org.mp4parser.support.AbstractContainerBox
org.mp4parser.boxes.iso14496.part12.SampleDescriptionBox
All Implemented Interfaces:
Box, Container, FullBox, ParsableBox

public class SampleDescriptionBox extends AbstractContainerBox implements FullBox

4cc = ""stsd""

The sample description table gives detailed information about the coding type used, and any initialization information needed for that coding.
The information stored in the sample description box after the entry-count is both track-type specific as documented here, and can also have variants within a track type (e.g. different codings may use different specific information after some common fields, even within a video track).
For video tracks, a VisualSampleEntry is used; for audio tracks, an AudioSampleEntry. Hint tracks use an entry format specific to their protocol, with an appropriate name. Timed Text tracks use a TextSampleEntry For hint tracks, the sample description contains appropriate declarative data for the streaming protocol being used, and the format of the hint track. The definition of the sample description is specific to the protocol. Multiple descriptions may be used within a track.
The 'protocol' and 'codingname' fields are registered identifiers that uniquely identify the streaming protocol or compression format decoder to be used. A given protocol or codingname may have optional or required extensions to the sample description (e.g. codec initialization parameters). All such extensions shall be within boxes; these boxes occur after the required fields. Unrecognized boxes shall be ignored.
Defined in ISO/IEC 14496-12
See Also:
  • Field Details

  • Constructor Details

    • SampleDescriptionBox

      public SampleDescriptionBox()
  • Method Details

    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface FullBox
    • setVersion

      public void setVersion(int version)
      Specified by:
      setVersion in interface FullBox
    • getFlags

      public int getFlags()
      Specified by:
      getFlags in interface FullBox
    • setFlags

      public void setFlags(int flags)
      Specified by:
      setFlags in interface FullBox
    • parse

      public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException
      Description copied from interface: ParsableBox
      Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]). The remaining size of the box is the contentSize, contentSize number of bytes should be read from the box source (readableByteChannel). If you need the header buffer at a later stage you have to create a copy.
      Specified by:
      parse in interface ParsableBox
      Overrides:
      parse in class AbstractContainerBox
      Parameters:
      dataSource - the source for this box
      header - the box' already parsed header (create copy if you need it later as it will be overwritten)
      contentSize - remaining bytes of this box
      boxParser - use it to parse sub-boxes.
      Throws:
      IOException - in case of an error during a read operation
    • 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
      Overrides:
      getBox in class AbstractContainerBox
      Parameters:
      writableByteChannel - the box's sink
      Throws:
      IOException - in case of problems with the Channel
    • getSampleEntry

      public AbstractSampleEntry getSampleEntry()
    • getSize

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