AutoOggSeekTable Class Reference

#include <AutoOggSeekTable.h>

Inheritance diagram for AutoOggSeekTable:

Inheritance graph
[legend]
Collaboration diagram for AutoOggSeekTable:

Collaboration graph
[legend]
List of all members.

Public Types

typedef pair< LOOG_INT64,
unsigned long > 
tSeekPair
typedef map< LOOG_INT64, unsigned
long > 
tSeekMap

Public Member Functions

 AutoOggSeekTable (string inFileName)
 Create a new AutoOggSeekTable associated with the filename passed into inFileName.
virtual ~AutoOggSeekTable (void)
virtual bool buildTable ()
 Builds the actual seek table: only works if we have random access to the file.
virtual bool acceptOggPage (OggPage *inOggPage)
LOOG_INT64 fileDuration ()
 The duration of the file, in DirectShow time units.
unsigned long serialisedSize ()
 Returns the size the seek table will be if serialised.
bool serialiseInto (unsigned char *inBuff, unsigned long inBuffSize)
 Serialise the seek table into a memory buffer, which may be useful for e.g. caching.
bool serialiseInto (const string inSeekTableFilename)
 Serialise the seek table into a file, which may be useful for e.g. caching.
virtual bool buildTableFromBuffer (const unsigned char *inBuffer, const unsigned long inBufferSize)
 Build a seek table from a buffer previously written to with serialiseInto().
virtual bool buildTableFromFile (const string inCachedSeekTableFilename)
 Build a seek table from a file previously serialised into with serialiseInto().
tSeekMap getSeekMap ()
 Returns a copy of the seek table.
bool addSeekPoint (LOOG_INT64 inTime, unsigned long inStartPos)
 Add a seek point (which consists of a time in DirectShow units, and a byte offset corresponding to that time) to the seek table.
tSeekPair getStartPos (LOOG_INT64 inTime)
 Given a requested seek time in DirectShow units, returns the closest time and byte to the seek time.
bool enabled ()
 Returns whether this table is enabled or disabled.

Static Public Attributes

const LOOG_INT64 DS_UNITS = 10000000
const unsigned long LINT_MAX = 4294967295UL

Protected Attributes

unsigned long mFilePos
unsigned long mPacketCount
unsigned long mSampleRate
unsigned long mNumHeaders
unsigned long mSerialNoToTrack
unsigned long mGranulePosShift
bool mLastIsSeekable
bool isTheora
bool isFLAC
bool isOggFLAC_1_0
bool mFoundStreamInfo
LOOG_INT64 mLastSeekTime
LOOG_INT64 mFileDuration
fstream mFile
string mFileName
OggDataBuffermOggDemux
tSeekMap mSeekMap
tSeekMap::value_type mSeekValue
LOOG_INT64 mRealStartPos
bool mEnabled

Private Member Functions

 AutoOggSeekTable (const AutoOggSeekTable &)
AutoOggSeekTableoperator= (const AutoOggSeekTable &)

Member Typedef Documentation

typedef map<LOOG_INT64, unsigned long> OggSeekTable::tSeekMap [inherited]
 

Definition at line 49 of file OggSeekTable.h.

Referenced by OggSeekTable::getSeekMap(), and main().

typedef pair<LOOG_INT64, unsigned long> OggSeekTable::tSeekPair [inherited]
 

Definition at line 48 of file OggSeekTable.h.

Referenced by OggSeekTable::getStartPos(), OggBinarySeeker::getStartPos(), main(), and OggDemuxSourceFilter::SetPositions().


Constructor & Destructor Documentation

AutoOggSeekTable::AutoOggSeekTable string  inFileName  ) 
 

Create a new AutoOggSeekTable associated with the filename passed into inFileName.

Definition at line 35 of file AutoOggSeekTable.cpp.

References false, mFileName, mOggDemux, and OggDataBuffer::registerVirtualCallback().

Here is the call graph for this function:

AutoOggSeekTable::~AutoOggSeekTable void   )  [virtual]
 

Definition at line 59 of file AutoOggSeekTable.cpp.

References mFile.

AutoOggSeekTable::AutoOggSeekTable const AutoOggSeekTable  )  [private]
 


Member Function Documentation

bool AutoOggSeekTable::acceptOggPage OggPage inOggPage  )  [virtual]
 

All callers to acceptOggPage give away their pointer to this function. All methods implementing this interface are responsible for deleting this page. All callers should NULL their pointer immediately after calling to avoid reusing them.

Implements IOggCallback.

Reimplemented in AutoAnxSeekTable.

Definition at line 67 of file AutoOggSeekTable.cpp.

References OggSeekTable::addSeekPoint(), iLE_Math::CharArrToInt64(), iBE_Math::charArrToULong(), iLE_Math::charArrToULong(), OggPage::getPacket(), OggPageHeader::GranulePos(), OggPage::header(), OggPageHeader::HeaderFlags(), isFLAC, isOggFLAC_1_0, isTheora, LOOG_INT64, mFileDuration, mFilePos, mFoundStreamInfo, mGranulePosShift, mLastIsSeekable, mLastSeekTime, mNumHeaders, mPacketCount, mSampleRate, mSerialNoToTrack, OggPage::numPackets(), OggPacket::packetData(), OggPage::pageSize(), and OggPageHeader::StreamSerialNo().

Referenced by AutoAnxSeekTable::acceptOggPage().

Here is the call graph for this function:

bool OggSeekTable::addSeekPoint LOOG_INT64  inTime,
unsigned long  inStartPos
[inherited]
 

Add a seek point (which consists of a time in DirectShow units, and a byte offset corresponding to that time) to the seek table.

Definition at line 52 of file OggSeekTable.cpp.

References OggSeekTable::mSeekMap.

Referenced by acceptOggPage(), buildTable(), buildTableFromBuffer(), buildTableFromFile(), and main().

bool AutoOggSeekTable::buildTable  )  [virtual]
 

Builds the actual seek table: only works if we have random access to the file.

Definition at line 275 of file AutoOggSeekTable.cpp.

References OggSeekTable::addSeekPoint(), OggDataBuffer::feed(), mFile, mFileName, mOggDemux, and mSampleRate.

Referenced by OggDemuxSourceFilter::Load(), AnxDemuxSourceFilter::Load(), main(), and AnnodexRecomposer::recomposeStreamFrom().

Here is the call graph for this function:

bool AutoOggSeekTable::buildTableFromBuffer const unsigned char *  inBuffer,
const unsigned long  inBufferSize
[virtual]
 

Build a seek table from a buffer previously written to with serialiseInto().

Definition at line 304 of file AutoOggSeekTable.cpp.

References OggSeekTable::addSeekPoint(), iLE_Math::CharArrToInt64(), iLE_Math::charArrToULong(), and LOOG_INT64.

Here is the call graph for this function:

bool AutoOggSeekTable::buildTableFromFile const string  inCachedSeekTableFilename  )  [virtual]
 

Build a seek table from a file previously serialised into with serialiseInto().

Note that this method does not do any verification that the file is up-to-date or valid (i.e. if you are using the serialised seek table as a cache, you must check yourself that the cached seek table is not out of date).

Definition at line 324 of file AutoOggSeekTable.cpp.

References OggSeekTable::addSeekPoint(), iLE_Math::CharArrToInt64(), iLE_Math::charArrToULong(), and LOOG_INT64.

Referenced by main(), and AnnodexRecomposer::recomposeStreamFrom().

Here is the call graph for this function:

bool OggSeekTable::enabled  )  [inherited]
 

Returns whether this table is enabled or disabled.

Definition at line 49 of file OggSeekTable.cpp.

Referenced by OggDemuxSourceFilter::GetAvailable(), OggDemuxSourceFilter::GetCapabilities(), OggDemuxSourceFilter::GetDuration(), OggDemuxSourceFilter::GetStopPosition(), and OggDemuxSourceFilter::SetPositions().

LOOG_INT64 AutoOggSeekTable::fileDuration  ) 
 

The duration of the file, in DirectShow time units.

Definition at line 270 of file AutoOggSeekTable.cpp.

References LOOG_INT64.

Referenced by OggDemuxSourceFilter::GetAvailable(), OggDemuxSourceFilter::GetDuration(), OggDemuxSourceFilter::GetStopPosition(), and OggDemuxSourceFilter::SetPositions().

OggSeekTable::tSeekMap OggSeekTable::getSeekMap  )  [inherited]
 

Returns a copy of the seek table.

Note that this method returns a copy of the seek table, not the actual seek table used by the class. So, feel free to corrupt your copy to your heart's leisure.

Definition at line 80 of file OggSeekTable.cpp.

References OggSeekTable::tSeekMap.

Referenced by main().

OggSeekTable::tSeekPair OggSeekTable::getStartPos LOOG_INT64  inTime  )  [inherited]
 

Given a requested seek time in DirectShow units, returns the closest time and byte to the seek time.

Returns a tSeekPair whose first element is the actual closest possible time that can be seeked to (which will always be either before or at the requested seek position). The second element is the number of bytes into the stream where the first page of the actual seek time occurs.

Reimplemented in OggBinarySeeker.

Definition at line 67 of file OggSeekTable.cpp.

References OggSeekTable::mSeekMap, and OggSeekTable::tSeekPair.

Referenced by main(), AnnodexRecomposer::recomposeStreamFrom(), and OggDemuxSourceFilter::SetPositions().

AutoOggSeekTable& AutoOggSeekTable::operator= const AutoOggSeekTable  )  [private]
 

unsigned long AutoOggSeekTable::serialisedSize  ) 
 

Returns the size the seek table will be if serialised.

Definition at line 224 of file AutoOggSeekTable.cpp.

Referenced by serialiseInto().

bool AutoOggSeekTable::serialiseInto const string  inSeekTableFilename  ) 
 

Serialise the seek table into a file, which may be useful for e.g. caching.

Definition at line 249 of file AutoOggSeekTable.cpp.

References serialisedSize(), and serialiseInto().

Here is the call graph for this function:

bool AutoOggSeekTable::serialiseInto unsigned char *  inBuff,
unsigned long  inBuffSize
 

Serialise the seek table into a memory buffer, which may be useful for e.g. caching.

Definition at line 230 of file AutoOggSeekTable.cpp.

References iLE_Math::Int64ToCharArr(), serialisedSize(), and iLE_Math::ULongToCharArr().

Referenced by main(), AnnodexRecomposer::recomposeStreamFrom(), and serialiseInto().

Here is the call graph for this function:


Member Data Documentation

const LOOG_INT64 AutoOggSeekTable::DS_UNITS = 10000000 [static]
 

Definition at line 63 of file AutoOggSeekTable.h.

bool AutoOggSeekTable::isFLAC [protected]
 

Definition at line 100 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

bool AutoOggSeekTable::isOggFLAC_1_0 [protected]
 

Definition at line 101 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

bool AutoOggSeekTable::isTheora [protected]
 

Definition at line 99 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

const unsigned long AutoOggSeekTable::LINT_MAX = 4294967295UL [static]
 

Definition at line 64 of file AutoOggSeekTable.h.

bool OggSeekTable::mEnabled [protected, inherited]
 

Definition at line 69 of file OggSeekTable.h.

fstream AutoOggSeekTable::mFile [protected]
 

Definition at line 105 of file AutoOggSeekTable.h.

Referenced by buildTable(), and ~AutoOggSeekTable().

LOOG_INT64 AutoOggSeekTable::mFileDuration [protected]
 

Definition at line 104 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

string AutoOggSeekTable::mFileName [protected]
 

Definition at line 106 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable(), and buildTable().

unsigned long AutoOggSeekTable::mFilePos [protected]
 

Definition at line 91 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

bool AutoOggSeekTable::mFoundStreamInfo [protected]
 

Definition at line 102 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

unsigned long AutoOggSeekTable::mGranulePosShift [protected]
 

Definition at line 97 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

bool AutoOggSeekTable::mLastIsSeekable [protected]
 

Definition at line 98 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

LOOG_INT64 AutoOggSeekTable::mLastSeekTime [protected]
 

Definition at line 103 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

unsigned long AutoOggSeekTable::mNumHeaders [protected]
 

Definition at line 94 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

OggDataBuffer* AutoOggSeekTable::mOggDemux [protected]
 

Definition at line 108 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable(), and buildTable().

unsigned long AutoOggSeekTable::mPacketCount [protected]
 

Definition at line 92 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().

LOOG_INT64 OggSeekTable::mRealStartPos [protected, inherited]
 

Definition at line 66 of file OggSeekTable.h.

unsigned long AutoOggSeekTable::mSampleRate [protected]
 

Definition at line 93 of file AutoOggSeekTable.h.

Referenced by acceptOggPage(), and buildTable().

tSeekMap OggSeekTable::mSeekMap [protected, inherited]
 

Definition at line 64 of file OggSeekTable.h.

Referenced by OggSeekTable::addSeekPoint(), OggSeekTable::getStartPos(), and OggSeekTable::OggSeekTable().

tSeekMap::value_type OggSeekTable::mSeekValue [protected, inherited]
 

Definition at line 65 of file OggSeekTable.h.

unsigned long AutoOggSeekTable::mSerialNoToTrack [protected]
 

Definition at line 96 of file AutoOggSeekTable.h.

Referenced by acceptOggPage().


The documentation for this class was generated from the following files:
Generated on Tue Feb 15 15:01:39 2005 for oggdsf by  doxygen 1.3.9