Class VisualSampleEntry

All Implemented Interfaces:
Box, SampleEntry, Container, ParsableBox

public final class VisualSampleEntry extends AbstractSampleEntry implements Container

4cc = ""mp4v"" || ""s263"" || ""avc1"" || ""avc3"" || ""drmi""

Contains information common to all visual tracks.
 class VisualSampleEntry(codingname) extends AbstractSampleEntry (codingname){
  unsigned int(16) pre_defined = 0;
  const unsigned int(16) reserved = 0;
  unsigned int(32)[3] pre_defined = 0;
  unsigned int(16) width;
  unsigned int(16) height;
  template unsigned int(32) horizresolution = 0x00480000; // 72 dpi
  template unsigned int(32) vertresolution = 0x00480000; // 72 dpi
  const unsigned int(32) reserved = 0;
  template unsigned int(16) frame_count = 1;
  string[32] compressorname;
  template unsigned int(16) depth = 0x0018;
  int(16) pre_defined = -1;
 }
 

Format-specific information is appened as boxes after the data described in ISO/IEC 14496-12 chapter 8.16.2.
  • Field Details

  • Constructor Details

    • VisualSampleEntry

      public VisualSampleEntry()
    • VisualSampleEntry

      public VisualSampleEntry(String type)
  • Method Details

    • setType

      public void setType(String type)
    • getWidth

      public int getWidth()
    • setWidth

      public void setWidth(int width)
    • getHeight

      public int getHeight()
    • setHeight

      public void setHeight(int height)
    • getHorizresolution

      public double getHorizresolution()
    • setHorizresolution

      public void setHorizresolution(double horizresolution)
    • getVertresolution

      public double getVertresolution()
    • setVertresolution

      public void setVertresolution(double vertresolution)
    • getFrameCount

      public int getFrameCount()
    • setFrameCount

      public void setFrameCount(int frameCount)
    • getCompressorname

      public String getCompressorname()
    • setCompressorname

      public void setCompressorname(String compressorname)
    • getDepth

      public int getDepth()
    • setDepth

      public void setDepth(int depth)
    • 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
      Specified by:
      parse in class AbstractSampleEntry
      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
      Specified by:
      getBox in class AbstractSampleEntry
      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
      Overrides:
      getSize in class AbstractContainerBox
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object