public class IndexEntryImpl extends Object implements IndexEntry, Cloneable, Serializable, XMLSerializable
| Modifier and Type | Field and Description |
|---|---|
static String |
FLAGS_TAG |
static String |
INDEXENTRY_TAG |
static String |
KEYFRANEOFFST_TAG |
static String |
POSTABLE_TAG |
static String |
SLICEOFFSET_TAG |
static String |
STREAMOFFSET_TAG |
static String |
TEMPORALOFFSET_TAG |
EDITFLAG_BACKWARD_PREDICTION, EDITFLAG_FORWARD_PREDICTION, EDITFLAG_RANDOM_ACCESS, EDITFLAG_SEQUENCE_HEADER, FLAGS_DEFAULT, KEYFRAMEOFFSET_DEFAULT, TEMPORALOFFSET_DEFAULT| Constructor and Description |
|---|
IndexEntryImpl() |
IndexEntryImpl(byte temporalOffset,
byte keyFrameOffset,
byte flags,
long streamOffset) |
IndexEntryImpl(long streamOffset) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendXMLChildren(Node parent)
Append extra child elements to the given parent node to serialize the value of an object
to an XML fragment.
|
IndexEntry |
clone()
Create a cloned copy of this IndexEntryImpl.
|
static IndexEntry |
createFromBuffer(ByteBuffer buffer) |
boolean |
equals(Object o) |
String |
getComment()
Include a comment when serializing a value to XML.
|
byte |
getFlags()
Returns the edit flags that indicate the coding of the edit unit associated with the index
entry.
|
byte |
getKeyFrameOffset()
Returns the offset measured in edit units to the previous key frame for this index entry,
which may be the preceding I-frame for an MPEG stream.
|
Rational[] |
getPosTable()
Returns the array of fractional position offsets from the start of the content package to the
synchronized sample in the content package.
|
int[] |
getSliceOffset()
Returns the array of byte offsets from the stream offset of the edit unit to each slice.
|
long |
getStreamOffset()
Returns the offset of the edit unit within the container stream relative to the start of
that container stream, measured in bytes.
|
byte |
getTemporalOffset()
Returns the offset measured in edit units from the display order to the coded order
for this index entry.
|
int |
hashCode() |
void |
resolveBytes(IndexTableSegment parentSegment)
Resolves any bytes that could not be parsed initially without the context of an index
table segment in the context of the given index table segment.
|
void |
setFlags(byte flags)
Sets the edit flags that indicate the coding of the edit unit associated with the index
entry.
|
void |
setKeyFrameOffset(byte keyFrameOffset)
Sets the offset measured in edit units to the previous key frame for this index entry,
which may be the preceding I-frame for an MPEG stream.
|
void |
setPosTable(Rational[] posTable)
Sets the array of fractional position offsets from the start of the content package to the
synchronized sample in the content package.
|
void |
setSliceOffset(int[] sliceOffset)
Sets the array of byte offsets from the stream offset of the edit unit to each slice.
|
void |
setStreamOffset(long streamOffset)
Sets the offset of the edit unit within the container stream relative to the start of
that container stream, measured in bytes.
|
void |
setTemporalOffset(byte temporalOffset)
Sets the offset measured in edit units from the display order to the coded order
for this index entry.
|
String |
toString() |
public static final String INDEXENTRY_TAG
public static final String TEMPORALOFFSET_TAG
public static final String KEYFRANEOFFST_TAG
public static final String FLAGS_TAG
public static final String STREAMOFFSET_TAG
public static final String SLICEOFFSET_TAG
public static final String POSTABLE_TAG
public IndexEntryImpl()
public IndexEntryImpl(@UInt64 long streamOffset) throws IllegalArgumentException
IllegalArgumentExceptionpublic IndexEntryImpl(@Int8 byte temporalOffset, @Int8 byte keyFrameOffset, @EditUnitFlag byte flags, @UInt64 long streamOffset) throws IllegalArgumentException
IllegalArgumentException@Int8 public byte getTemporalOffset()
IndexEntryReturns the offset measured in edit units from the display order to the coded order for this index entry.
getTemporalOffset in interface IndexEntryIndexEntry.TEMPORALOFFSET_DEFAULT,
DeltaEntry.getPosTableIndex()public void setTemporalOffset(@Int8 byte temporalOffset)
IndexEntrySets the offset measured in edit units from the display order to the coded order for this index entry.
setTemporalOffset in interface IndexEntrytemporalOffset - Offset measured in edit units from the display order to the coded order.IndexEntry.TEMPORALOFFSET_DEFAULT,
DeltaEntry.setPosTableIndex(byte)@Int8 public byte getKeyFrameOffset()
IndexEntryReturns the offset measured in edit units to the previous key frame for this index entry, which may be the preceding I-frame for an MPEG stream. The value is zero if this is a key frame.
getKeyFrameOffset in interface IndexEntryIndexEntry.KEYFRAMEOFFSET_DEFAULTpublic void setKeyFrameOffset(@Int8 byte keyFrameOffset)
IndexEntrySets the offset measured in edit units to the previous key frame for this index entry, which may be the preceding I-frame for an MPEG stream. The value is zero if this is a key frame.
setKeyFrameOffset in interface IndexEntrykeyFrameOffset - Offset measured in edit units to the previous key frame.IndexEntry.KEYFRAMEOFFSET_DEFAULT@EditUnitFlag public byte getFlags()
IndexEntryReturns the edit flags that indicate the coding of the edit unit associated with the index entry.
Note the following about prediction flags:
getFlags in interface IndexEntryIndexEntry.FLAGS_DEFAULT,
IndexEntry.EDITFLAG_RANDOM_ACCESS,
IndexEntry.EDITFLAG_SEQUENCE_HEADER,
IndexEntry.EDITFLAG_FORWARD_PREDICTION,
IndexEntry.EDITFLAG_BACKWARD_PREDICTIONpublic void setFlags(@EditUnitFlag byte flags)
IndexEntrySets the edit flags that indicate the coding of the edit unit associated with the index entry.
Note the following about prediction flags:
setFlags in interface IndexEntryflags - Edit flags that indicate the coding of the edit unit.IndexEntry.FLAGS_DEFAULT,
IndexEntry.EDITFLAG_RANDOM_ACCESS,
IndexEntry.EDITFLAG_SEQUENCE_HEADER,
IndexEntry.EDITFLAG_FORWARD_PREDICTION,
IndexEntry.EDITFLAG_BACKWARD_PREDICTION@UInt64 public long getStreamOffset()
IndexEntryReturns the offset of the edit unit within the container stream relative to the start of that container stream, measured in bytes.
getStreamOffset in interface IndexEntrypublic void setStreamOffset(@UInt64 long streamOffset) throws IllegalArgumentException
IndexEntrySets the offset of the edit unit within the container stream relative to the start of that container stream, measured in bytes.
setStreamOffset in interface IndexEntrystreamOffset - offset of the edit unit within the container stream relative to the start of
that container stream, measured in bytes.IllegalArgumentException - Stream offset values cannot be negative.@UInt32Array public int[] getSliceOffset()
IndexEntryReturns the array of byte offsets from the stream offset of the edit unit to each slice. Other than the first slice always starts at the beginning of the edit unit, a slice offset indicates the start of a group of sections following a variable bitrate encoded item.
getSliceOffset in interface IndexEntryDeltaEntry.getSlice()public void setSliceOffset(@UInt32Array int[] sliceOffset) throws IllegalArgumentException
IndexEntrySets the array of byte offsets from the stream offset of the edit unit to each slice. Other than the first slice always starts at the beginning of the edit unit, a slice offset indicates the start of a group of sections following a variable bitrate encoded item.
setSliceOffset in interface IndexEntrysliceOffset - Array of byte offsets from the stream offset of the edit unit to each slice.IllegalArgumentException - Slice offset values cannot be negative.DeltaEntry.setSlice(byte)public Rational[] getPosTable()
IndexEntryReturns the array of fractional position offsets from the start of the content package to the synchronized sample in the content package. Fractional offsets are required when a difference exists between the frame size of content, such as between audio and video.
For example, the audio may only be synchronized with the video every few frames. In this case the fraction indicates how much of a fraction differece exists between the start of the audio frame and the start of the video frame.
getPosTable in interface IndexEntryDeltaEntry.getPosTableIndex()public void setPosTable(Rational[] posTable) throws NullPointerException
IndexEntrySets the array of fractional position offsets from the start of the content package to the synchronized sample in the content package. Fractional offsets are required when a difference exists between the frame size of content, such as between audio and video.
For example, the audio may only be synchronized with the video every few frames. In this case the fraction indicates how much of a fraction differece exists between the start of the audio frame and the start of the video frame.
setPosTable in interface IndexEntryposTable - Array of fractional position offsets from the start of the content package to the
synchronized sample in the content package.NullPointerException - Cannot create a position table with null elements.DeltaEntry.setPosTableIndex(byte)public IndexEntry clone()
Create a cloned copy of this IndexEntryImpl.
clone in interface IndexEntryclone in class Objectpublic void resolveBytes(IndexTableSegment parentSegment) throws NullPointerException, EndOfDataException
IndexEntryResolves any bytes that could not be parsed initially without the context of an index table segment in the context of the given index table segment. The result of calling this method is to set the slice offset and position table properties using the slice count and position table count of the index table segment.
resolveBytes in interface IndexEntryparentSegment - Segment that owns the index entry and provides the slice count and position table count values.NullPointerException - The given parent segment is null.EndOfDataException - Insufficient data in the unresolved bytes of each index entry to be resolved to arrays of
the required size.IndexTableSegment.getSliceCount(),
IndexTableSegment.getPosTableCount()public void appendXMLChildren(Node parent)
XMLSerializableAppend extra child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder class are provided to help with this
process.
appendXMLChildren in interface XMLSerializableparent - XML parent element to append child nodes to.public String getComment()
XMLSerializableInclude a comment when serializing a value to XML. The comment will be inserted as the first child node of the element representing the class.
getComment in interface XMLSerializablepublic static final IndexEntry createFromBuffer(ByteBuffer buffer) throws NullPointerException, EndOfDataException
(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.