
public class IndexEntry extends RefCounted
Some ContainerFormats can maintain index of where key-frames
(and other interesting frames) can be found in a byte-stream.
This is really helpful for implementing efficient seeking (for
example, you can find all index entries near a desired timestamp,
and you'll find the nearest key-frame).
We don't maintain a complete list of all ContainerFormats that support
index, but if they do, you can query the Stream#getNumIndexEntries()
method to find how many entires are in the index. Some ContainerFormats can
parse the relevant Container message if an index is embedded in the
container (for example, the MOV and MP4 demuxer can do this). Other
ContainerFormats can create an index automatically as they read the file,
even if an index is not embedded in the container (for example the FLV
demuxer does this).
Stream#findTimeStampEntryInIndex(int,int)
,
Stream#findTimeStampPositionInIndex(int,int)
,
Stream#getIndexEntry(int)
,
Stream#getNumIndexEntries()
,
Stream#getIndexEntries()| Modifier and Type | Field and Description |
|---|---|
static int |
INDEX_FLAG_KEYFRAME
A bit mask value that may be set in #getFlags.
|
| Modifier and Type | Method and Description |
|---|---|
IndexEntry |
copyReference()
Create a new IndexEntry object that is actually referring to the
exact same underlying native object.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
int |
getFlags()
Flags set for this entry.
|
int |
getMinDistance()
Minimum number of index entries between this index entry
and the last keyframe in the index, used to avoid unneeded searching. |
long |
getPosition()
The position in bytes of the frame corresponding to this index entry
in the Container. |
int |
getSize()
The size of bytes of the frame this index entry points to.
|
long |
getTimeStamp()
The actual time stamp, in units of Stream#getTimeBase(), of the frame this entry points to.
|
int |
hashCode()
Get a hashable value for this object.
|
boolean |
isKeyFrame()
Is this index entry pointing to a key frame.
Really shorthand for #getFlags() & #INDEX_FLAG_KEYFRAME. |
static IndexEntry |
make(long position,
long timeStamp,
int flags,
int size,
int minDistance)
Create a new IndexEntry with the specified
values. |
String |
toString()
info about this entry.
|
delete, getCurrentRefCountpublic static final int INDEX_FLAG_KEYFRAME
public IndexEntry copyReference()
copyReference in class RefCountedpublic boolean equals(Object obj)
public int hashCode()
public String toString()
public static IndexEntry make(long position, long timeStamp, int flags, int size, int minDistance)
position - The value to be returned from #getPosition().timeStamp - The value to be returned from #getTimeStamp().flags - The value to be returned from #getFlags().size - The value to be returned from #getSize().minDistance - The value to be returned from #getMinDistance().public long getPosition()
public long getTimeStamp()
public int getFlags()
public int getSize()
public int getMinDistance()
public boolean isKeyFrame()
#getFlags() & #INDEX_FLAG_KEYFRAME.Copyright © 2018 Humble Software. All rights reserved.