Package org.mp4parser.boxes.sampleentry
Class AbstractSampleEntry
java.lang.Object
org.mp4parser.BasicContainer
org.mp4parser.support.AbstractContainerBox
org.mp4parser.boxes.sampleentry.AbstractSampleEntry
- All Implemented Interfaces:
Box,SampleEntry,Container,ParsableBox
- Direct Known Subclasses:
ActionMessageFormat0SampleEntryBox,AudioSampleEntry,DfxpSampleEntry,HintSampleEntry,MpegSampleEntry,Ovc1VisualSampleEntryImpl,QuicktimeTextSampleEntry,TextSampleEntry,VisualSampleEntry,WebVTTSampleEntry,XMLSubtitleSampleEntry
Abstract base class for all sample entries.
- See Also:
-
Field Summary
FieldsFields inherited from class org.mp4parser.support.AbstractContainerBox
largeBox, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidgetBox(WritableByteChannel writableByteChannel) Writes the complete box - size | 4-cc | content - to the givenwritableByteChannel.intabstract voidparse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]).voidsetDataReferenceIndex(int dataReferenceIndex) Methods inherited from class org.mp4parser.support.AbstractContainerBox
getHeader, getSize, getType, setParentMethods inherited from class org.mp4parser.BasicContainer
addBox, getBoxes, getBoxes, getBoxes, getContainerSize, initContainer, setBoxes, toString, writeContainer
-
Field Details
-
dataReferenceIndex
protected int dataReferenceIndex
-
-
Constructor Details
-
AbstractSampleEntry
-
-
Method Details
-
getDataReferenceIndex
public int getDataReferenceIndex()- Specified by:
getDataReferenceIndexin interfaceSampleEntry
-
setDataReferenceIndex
public void setDataReferenceIndex(int dataReferenceIndex) - Specified by:
setDataReferenceIndexin interfaceSampleEntry
-
parse
public abstract 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- Overrides:
parsein classAbstractContainerBox- 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- Overrides:
getBoxin classAbstractContainerBox- Parameters:
writableByteChannel- the box's sink- Throws:
IOException- in case of problems with theChannel
-