AutoAnxSeekTable Class Reference

#include <AutoAnxSeekTable.h>

Inheritance diagram for AutoAnxSeekTable:

Inheritance graph
[legend]
Collaboration diagram for AutoAnxSeekTable:

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

 AutoAnxSeekTable (string inFileName)
virtual ~AutoAnxSeekTable (void)
virtual bool acceptOggPage (OggPage *inOggPage)
virtual bool buildTable ()
 Builds the actual seek table: only works if we have random access to the file.
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 mAnxPackets
bool mSeenAnything
unsigned long mAnnodexSerialNo
bool mReadyForOgg
bool mSkippedCMML
unsigned short mAnnodexMajorVersion
unsigned long mCMMLSerialNo
unsigned long mCMMLPacketsToSkip
fstream mDebugFile
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

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

AutoAnxSeekTable::AutoAnxSeekTable string  inFileName  ) 
 

Definition at line 6 of file AutoAnxSeekTable.cpp.

References false, inFileName, and mDebugFile.

AutoAnxSeekTable::~AutoAnxSeekTable void   )  [virtual]
 

Definition at line 21 of file AutoAnxSeekTable.cpp.

References mDebugFile.


Member Function Documentation

bool AutoAnxSeekTable::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.

Reimplemented from AutoOggSeekTable.

Definition at line 31 of file AutoAnxSeekTable.cpp.

References AutoOggSeekTable::acceptOggPage(), OggPage::getPacket(), OggPage::header(), OggPageHeader::HeaderFlags(), mAnnodexMajorVersion, mAnnodexSerialNo, mCMMLPacketsToSkip, mCMMLSerialNo, mDebugFile, mReadyForOgg, mSeenAnything, mSkippedCMML, OggPacket::packetData(), OggPage::pageSize(), and OggPageHeader::StreamSerialNo().

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 AutoOggSeekTable::acceptOggPage(), AutoOggSeekTable::buildTable(), AutoOggSeekTable::buildTableFromBuffer(), AutoOggSeekTable::buildTableFromFile(), and main().

bool AutoOggSeekTable::buildTable  )  [virtual, inherited]
 

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(), AutoOggSeekTable::mFile, AutoOggSeekTable::mFileName, AutoOggSeekTable::mOggDemux, and AutoOggSeekTable::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, inherited]
 

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, inherited]
 

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  )  [inherited]
 

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().

unsigned long AutoOggSeekTable::serialisedSize  )  [inherited]
 

Returns the size the seek table will be if serialised.

Definition at line 224 of file AutoOggSeekTable.cpp.

Referenced by AutoOggSeekTable::serialiseInto().

bool AutoOggSeekTable::serialiseInto const string  inSeekTableFilename  )  [inherited]
 

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

Definition at line 249 of file AutoOggSeekTable.cpp.

References AutoOggSeekTable::serialisedSize(), and AutoOggSeekTable::serialiseInto().

Here is the call graph for this function:

bool AutoOggSeekTable::serialiseInto unsigned char *  inBuff,
unsigned long  inBuffSize
[inherited]
 

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(), AutoOggSeekTable::serialisedSize(), and iLE_Math::ULongToCharArr().

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

Here is the call graph for this function:


Member Data Documentation

const LOOG_INT64 AutoOggSeekTable::DS_UNITS = 10000000 [static, inherited]
 

Definition at line 63 of file AutoOggSeekTable.h.

bool AutoOggSeekTable::isFLAC [protected, inherited]
 

Definition at line 100 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

bool AutoOggSeekTable::isOggFLAC_1_0 [protected, inherited]
 

Definition at line 101 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

bool AutoOggSeekTable::isTheora [protected, inherited]
 

Definition at line 99 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

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

Definition at line 64 of file AutoOggSeekTable.h.

unsigned short AutoAnxSeekTable::mAnnodexMajorVersion [protected]
 

Definition at line 30 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().

unsigned long AutoAnxSeekTable::mAnnodexSerialNo [protected]
 

Definition at line 26 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().

unsigned long AutoAnxSeekTable::mAnxPackets [protected]
 

Definition at line 24 of file AutoAnxSeekTable.h.

unsigned long AutoAnxSeekTable::mCMMLPacketsToSkip [protected]
 

Definition at line 34 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().

unsigned long AutoAnxSeekTable::mCMMLSerialNo [protected]
 

Definition at line 33 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().

fstream AutoAnxSeekTable::mDebugFile [protected]
 

Definition at line 36 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage(), AutoAnxSeekTable(), and ~AutoAnxSeekTable().

bool OggSeekTable::mEnabled [protected, inherited]
 

Definition at line 69 of file OggSeekTable.h.

fstream AutoOggSeekTable::mFile [protected, inherited]
 

Definition at line 105 of file AutoOggSeekTable.h.

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

LOOG_INT64 AutoOggSeekTable::mFileDuration [protected, inherited]
 

Definition at line 104 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

string AutoOggSeekTable::mFileName [protected, inherited]
 

Definition at line 106 of file AutoOggSeekTable.h.

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

unsigned long AutoOggSeekTable::mFilePos [protected, inherited]
 

Definition at line 91 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

bool AutoOggSeekTable::mFoundStreamInfo [protected, inherited]
 

Definition at line 102 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

unsigned long AutoOggSeekTable::mGranulePosShift [protected, inherited]
 

Definition at line 97 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

bool AutoOggSeekTable::mLastIsSeekable [protected, inherited]
 

Definition at line 98 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

LOOG_INT64 AutoOggSeekTable::mLastSeekTime [protected, inherited]
 

Definition at line 103 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

unsigned long AutoOggSeekTable::mNumHeaders [protected, inherited]
 

Definition at line 94 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

OggDataBuffer* AutoOggSeekTable::mOggDemux [protected, inherited]
 

Definition at line 108 of file AutoOggSeekTable.h.

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

unsigned long AutoOggSeekTable::mPacketCount [protected, inherited]
 

Definition at line 92 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

bool AutoAnxSeekTable::mReadyForOgg [protected]
 

Definition at line 27 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().

LOOG_INT64 OggSeekTable::mRealStartPos [protected, inherited]
 

Definition at line 66 of file OggSeekTable.h.

unsigned long AutoOggSeekTable::mSampleRate [protected, inherited]
 

Definition at line 93 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage(), and AutoOggSeekTable::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.

bool AutoAnxSeekTable::mSeenAnything [protected]
 

Definition at line 25 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().

unsigned long AutoOggSeekTable::mSerialNoToTrack [protected, inherited]
 

Definition at line 96 of file AutoOggSeekTable.h.

Referenced by AutoOggSeekTable::acceptOggPage().

bool AutoAnxSeekTable::mSkippedCMML [protected]
 

Definition at line 28 of file AutoAnxSeekTable.h.

Referenced by acceptOggPage().


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