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
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
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for an encrypted video track.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.mp4parser.boxes.sampleentry.AbstractSampleEntry
dataReferenceIndexFields inherited from class org.mp4parser.support.AbstractContainerBox
largeBox, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidgetBox(WritableByteChannel writableByteChannel) Writes the complete box - size | 4-cc | content - to the givenwritableByteChannel.intgetDepth()intintdoublelonggetSize()doubleintgetWidth()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) voidvoidsetVertresolution(double vertresolution) voidsetWidth(int width) Methods inherited from class org.mp4parser.boxes.sampleentry.AbstractSampleEntry
getDataReferenceIndex, setDataReferenceIndexMethods inherited from class org.mp4parser.support.AbstractContainerBox
getHeader, getType, setParentMethods inherited from class org.mp4parser.BasicContainer
addBox, getBoxes, getBoxes, getBoxes, getContainerSize, initContainer, setBoxes, toString, writeContainer
-
Field Details
-
TYPE1
- See Also:
-
TYPE2
- See Also:
-
TYPE3
- See Also:
-
TYPE4
- See Also:
-
TYPE5
- See Also:
-
TYPE6
- See Also:
-
TYPE7
- See Also:
-
TYPE_ENCRYPTED
Identifier for an encrypted video track.
-
-
Constructor Details
-
VisualSampleEntry
public VisualSampleEntry() -
VisualSampleEntry
-
-
Method Details
-
setType
-
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
-
setCompressorname
-
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
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
-
equals
-
hashCode
public int hashCode()
-