Package org.mp4parser.boxes.sampleentry
Class VisualSampleEntry
- java.lang.Object
-
- org.mp4parser.BasicContainer
-
- org.mp4parser.support.AbstractContainerBox
-
- org.mp4parser.boxes.sampleentry.AbstractSampleEntry
-
- org.mp4parser.boxes.sampleentry.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 Summary
Fields Modifier and Type Field Description static StringTYPE_ENCRYPTEDIdentifier for an encrypted video track.static StringTYPE1static StringTYPE2static StringTYPE3static StringTYPE4static StringTYPE5static StringTYPE6static StringTYPE7-
Fields inherited from class org.mp4parser.boxes.sampleentry.AbstractSampleEntry
dataReferenceIndex
-
Fields inherited from class org.mp4parser.support.AbstractContainerBox
largeBox, type
-
-
Constructor Summary
Constructors Constructor Description VisualSampleEntry()VisualSampleEntry(String type)
-
Method Summary
Modifier and Type Method Description booleanequals(Object o)voidgetBox(WritableByteChannel writableByteChannel)Writes the complete box - size | 4-cc | content - to the givenwritableByteChannel.StringgetCompressorname()intgetDepth()intgetFrameCount()intgetHeight()doublegetHorizresolution()longgetSize()doublegetVertresolution()intgetWidth()inthashCode()voidparse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser)Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]).voidsetCompressorname(String compressorname)voidsetDepth(int depth)voidsetFrameCount(int frameCount)voidsetHeight(int height)voidsetHorizresolution(double horizresolution)voidsetType(String type)voidsetVertresolution(double vertresolution)voidsetWidth(int width)-
Methods inherited from class org.mp4parser.boxes.sampleentry.AbstractSampleEntry
getDataReferenceIndex, setDataReferenceIndex
-
Methods inherited from class org.mp4parser.support.AbstractContainerBox
getHeader, getType, setParent
-
Methods inherited from class org.mp4parser.BasicContainer
addBox, getBoxes, getBoxes, getBoxes, getContainerSize, initContainer, setBoxes, toString, writeContainer
-
-
-
-
Field Detail
-
TYPE1
public static final String TYPE1
- See Also:
- Constant Field Values
-
TYPE2
public static final String TYPE2
- See Also:
- Constant Field Values
-
TYPE3
public static final String TYPE3
- See Also:
- Constant Field Values
-
TYPE4
public static final String TYPE4
- See Also:
- Constant Field Values
-
TYPE5
public static final String TYPE5
- See Also:
- Constant Field Values
-
TYPE6
public static final String TYPE6
- See Also:
- Constant Field Values
-
TYPE7
public static final String TYPE7
- See Also:
- Constant Field Values
-
TYPE_ENCRYPTED
public static final String TYPE_ENCRYPTED
Identifier for an encrypted video track.
-
-
Constructor Detail
-
VisualSampleEntry
public VisualSampleEntry()
-
VisualSampleEntry
public VisualSampleEntry(String type)
-
-
Method Detail
-
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:ParsableBoxParses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]). The remaining size of the box is thecontentSize,contentSizenumber of bytes should be read from the box source (readableByteChannel). If you need theheaderbuffer at a later stage you have to create a copy.- Specified by:
parsein interfaceParsableBox- Specified by:
parsein classAbstractSampleEntry- Parameters:
dataSource- the source for this boxheader- the box' already parsed header (create copy if you need it later as it will be overwritten)contentSize- remaining bytes of this boxboxParser- 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:BoxWrites the complete box - size | 4-cc | content - to the givenwritableByteChannel.- Specified by:
getBoxin interfaceBox- Specified by:
getBoxin classAbstractSampleEntry- Parameters:
writableByteChannel- the box's sink- Throws:
IOException- in case of problems with theChannel
-
getSize
public long getSize()
- Specified by:
getSizein interfaceBox- Overrides:
getSizein classAbstractContainerBox
-
-