AVPKit
com::avpkit::core::IIndexEntry Class Referenceabstract

An index entry for a IStream. More...

#include <IIndexEntry.h>

Inheritance diagram for com::avpkit::core::IIndexEntry:
Collaboration diagram for com::avpkit::core::IIndexEntry:

Public Member Functions

virtual int64_t getPosition ()=0
 The position in bytes of the frame corresponding to this index entry in the IContainer. More...
 
virtual int64_t getTimeStamp ()=0
 The actual time stamp, in units of IStream#getTimeBase(), of the frame this entry points to. More...
 
virtual int32_t getFlags ()=0
 Flags set for this entry. More...
 
virtual int32_t getSize ()=0
 The size of bytes of the frame this index entry points to. More...
 
virtual int32_t getMinDistance ()=0
 Minimum number of index entries between this index entry and the last keyframe in the index, used to avoid unneeded searching. More...
 
virtual bool isKeyFrame ()=0
 Is this index entry pointing to a key frame. More...
 
- Public Member Functions inherited from com::avpkit::ferry::RefCounted
virtual int32_t acquire ()
 Internal Only. More...
 
virtual int32_t release ()
 Internal Only. More...
 
virtual RefCountedcopyReference ()
 Create a new Java object that refers to the same native object. More...
 
virtual int32_t getCurrentRefCount ()
 Return the current reference count on this object. More...
 
void setJavaAllocator (void *allocator)
 This method is public but not part of the standard API. More...
 
void * getJavaAllocator ()
 This method is public but not part of the standard API. More...
 

Static Public Member Functions

static IIndexEntrymake (int64_t position, int64_t timeStamp, int32_t flags, int32_t size, int32_t minDistance)
 Create a new IIndexEntry with the specified values. More...
 

Static Public Attributes

static const int32_t IINDEX_FLAG_KEYFRAME = 0x0001
 A bit mask value that may be set in getFlags.
 

Additional Inherited Members

- Protected Member Functions inherited from com::avpkit::ferry::RefCounted
virtual void destroy ()
 This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed.
 
- Protected Attributes inherited from com::avpkit::ferry::RefCounted
AtomicIntegermRefCount
 This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe.
 
void * mAllocator
 Not part of public API.
 

Detailed Description

An index entry for a IStream.

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 IStream#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).

See also
IStream::findTimeStampEntryInIndex(long, int)
IStream::findTimeStampPositionInIndex(long, int)
IStream::getIndexEntry(int)
IStream::getNumIndexEntries()
IStream::getIndexEntries()
Since
3.4

Definition at line 64 of file IIndexEntry.h.

Member Function Documentation

◆ getFlags()

virtual int32_t com::avpkit::core::IIndexEntry::getFlags ( )
pure virtual

Flags set for this entry.

See the IINDEX_FLAG* constants above.

Returns
the flags.

Implemented in com::avpkit::core::IndexEntry.

Referenced by com::avpkit::core::Stream::addIndexEntry().

◆ getMinDistance()

virtual int32_t com::avpkit::core::IIndexEntry::getMinDistance ( )
pure virtual

Minimum number of index entries between this index entry and the last keyframe in the index, used to avoid unneeded searching.

Returns
the minimum distance, in bytes.

Implemented in com::avpkit::core::IndexEntry.

Referenced by com::avpkit::core::Stream::addIndexEntry().

◆ getPosition()

virtual int64_t com::avpkit::core::IIndexEntry::getPosition ( )
pure virtual

The position in bytes of the frame corresponding to this index entry in the IContainer.

Returns
The byte-offset from start of the IContainer where the frame for this IIndexEntry can be found.

Implemented in com::avpkit::core::IndexEntry.

Referenced by com::avpkit::core::Stream::addIndexEntry().

◆ getSize()

virtual int32_t com::avpkit::core::IIndexEntry::getSize ( )
pure virtual

The size of bytes of the frame this index entry points to.

Returns
The size in bytes.

Implemented in com::avpkit::core::IndexEntry.

Referenced by com::avpkit::core::Stream::addIndexEntry().

◆ getTimeStamp()

virtual int64_t com::avpkit::core::IIndexEntry::getTimeStamp ( )
pure virtual

The actual time stamp, in units of IStream#getTimeBase(), of the frame this entry points to.

Returns
The time stamp for this entry.

Implemented in com::avpkit::core::IndexEntry.

Referenced by com::avpkit::core::Stream::addIndexEntry().

◆ isKeyFrame()

virtual bool com::avpkit::core::IIndexEntry::isKeyFrame ( )
pure virtual

Is this index entry pointing to a key frame.

Really shorthand for getFlags() & IINDEX_FLAG_KEYFRAME.

Returns
True if this index entry is for a key frame.

Implemented in com::avpkit::core::IndexEntry.

◆ make()

IIndexEntry * com::avpkit::core::IIndexEntry::make ( int64_t  position,
int64_t  timeStamp,
int32_t  flags,
int32_t  size,
int32_t  minDistance 
)
static

Create a new IIndexEntry with the specified values.

Parameters
positionThe value to be returned from getPosition().
timeStampThe value to be returned from getTimeStamp().
flagsThe value to be returned from getFlags().
sizeThe value to be returned from getSize().
minDistanceThe value to be returned from getMinDistance().

Definition at line 44 of file IIndexEntry.cpp.

46 {
47  return IndexEntry::make(position, timeStamp,
48  flags, size, minDistance);
49 }

Referenced by com::avpkit::core::Stream::getIndexEntry().


The documentation for this class was generated from the following files: