Theora Playback Library  1.1.0
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
TheoraVideoManager Class Reference

Public Member Functions

 TheoraVideoManager (int num_worker_threads=1)
 
virtual ~TheoraVideoManager ()
 
TheoraVideoClipgetVideoClipByName (std::string name)
 search registered clips by name More...
 
TheoraVideoClipcreateVideoClip (std::string filename, TheoraOutputMode output_mode=TH_RGB, int numPrecachedOverride=0, bool usePower2Stride=0)
 
TheoraVideoClipcreateVideoClip (TheoraDataSource *data_source, TheoraOutputMode output_mode=TH_RGB, int numPrecachedOverride=0, bool usePower2Stride=0)
 
void update (float timeDelta)
 
void destroyVideoClip (TheoraVideoClip *clip)
 
void setAudioInterfaceFactory (TheoraAudioInterfaceFactory *factory)
 
TheoraAudioInterfaceFactorygetAudioInterfaceFactory ()
 
int getNumWorkerThreads ()
 
void setNumWorkerThreads (int n)
 
void setDefaultNumPrecachedFrames (int n)
 
int getDefaultNumPrecachedFrames ()
 
void logMessage (std::string msg)
 used by libtheoraplayer functions More...
 
std::string getVersionString ()
 get nicely formated version string More...
 
void getVersion (int *a, int *b, int *c)
 get version numbers More...
 
std::vector< std::string > getSupportedDecoders ()
 returns the supported decoders (eg. Theora, AVFoundation...) More...
 

Static Public Member Functions

static TheoraVideoManagergetSingleton ()
 get the global reference to the manager instance More...
 
static TheoraVideoManagergetSingletonPtr ()
 get the global pointer to the manager instance More...
 
static void setLogFunction (void(*fn)(std::string))
 you can set your own log function to recieve theora's log calls More...
 

Protected Types

typedef std::vector< TheoraVideoClip * > ClipList
 
typedef std::vector< TheoraWorkerThread * > ThreadList
 

Protected Member Functions

void createWorkerThreads (int n)
 
void destroyWorkerThreads ()
 
float calcClipWorkTime (TheoraVideoClip *clip)
 
TheoraVideoCliprequestWork (TheoraWorkerThread *caller)
 

Protected Attributes

ThreadList mWorkerThreads
 stores pointers to worker threads which are decoding video and audio More...
 
ClipList mClips
 stores pointers to created video clips More...
 
std::list< TheoraVideoClip * > mWorkLog
 stores pointer to clips that were docoded in the past in order to achieve fair scheduling More...
 
int mDefaultNumPrecachedFrames
 
TheoraMutexmWorkMutex
 
TheoraAudioInterfaceFactorymAudioFactory
 

Friends

class TheoraWorkerThread
 

Detailed Description

This is the main singleton class that handles all playback/sync operations

Member Typedef Documentation

typedef std::vector<TheoraVideoClip*> TheoraVideoManager::ClipList
protected
typedef std::vector<TheoraWorkerThread*> TheoraVideoManager::ThreadList
protected

Constructor & Destructor Documentation

TheoraVideoManager::TheoraVideoManager ( int  num_worker_threads = 1)
virtual TheoraVideoManager::~TheoraVideoManager ( )
virtual

Member Function Documentation

float TheoraVideoManager::calcClipWorkTime ( TheoraVideoClip clip)
protected
TheoraVideoClip* TheoraVideoManager::createVideoClip ( std::string  filename,
TheoraOutputMode  output_mode = TH_RGB,
int  numPrecachedOverride = 0,
bool  usePower2Stride = 0 
)
TheoraVideoClip* TheoraVideoManager::createVideoClip ( TheoraDataSource data_source,
TheoraOutputMode  output_mode = TH_RGB,
int  numPrecachedOverride = 0,
bool  usePower2Stride = 0 
)
void TheoraVideoManager::createWorkerThreads ( int  n)
protected
void TheoraVideoManager::destroyVideoClip ( TheoraVideoClip clip)
void TheoraVideoManager::destroyWorkerThreads ( )
protected
TheoraAudioInterfaceFactory* TheoraVideoManager::getAudioInterfaceFactory ( )
int TheoraVideoManager::getDefaultNumPrecachedFrames ( )
inline
int TheoraVideoManager::getNumWorkerThreads ( )
static TheoraVideoManager& TheoraVideoManager::getSingleton ( )
static

get the global reference to the manager instance

static TheoraVideoManager* TheoraVideoManager::getSingletonPtr ( )
static

get the global pointer to the manager instance

std::vector<std::string> TheoraVideoManager::getSupportedDecoders ( )

returns the supported decoders (eg. Theora, AVFoundation...)

void TheoraVideoManager::getVersion ( int *  a,
int *  b,
int *  c 
)

get version numbers

if c is negative, it means it's a release candidate -c

std::string TheoraVideoManager::getVersionString ( )

get nicely formated version string

TheoraVideoClip* TheoraVideoManager::getVideoClipByName ( std::string  name)

search registered clips by name

void TheoraVideoManager::logMessage ( std::string  msg)

used by libtheoraplayer functions

TheoraVideoClip* TheoraVideoManager::requestWork ( TheoraWorkerThread caller)
protected

Called by TheoraWorkerThread to request a TheoraVideoClip instance to work on decoding

void TheoraVideoManager::setAudioInterfaceFactory ( TheoraAudioInterfaceFactory factory)
void TheoraVideoManager::setDefaultNumPrecachedFrames ( int  n)
inline
static void TheoraVideoManager::setLogFunction ( void(*)(std::string)  fn)
static

you can set your own log function to recieve theora's log calls

This way you can integrate libtheoraplayer's log messages in your own logging system, prefix them, mute them or whatever you want

void TheoraVideoManager::setNumWorkerThreads ( int  n)
void TheoraVideoManager::update ( float  timeDelta)

Friends And Related Function Documentation

friend class TheoraWorkerThread
friend

Member Data Documentation

TheoraAudioInterfaceFactory* TheoraVideoManager::mAudioFactory
protected
ClipList TheoraVideoManager::mClips
protected

stores pointers to created video clips

int TheoraVideoManager::mDefaultNumPrecachedFrames
protected
ThreadList TheoraVideoManager::mWorkerThreads
protected

stores pointers to worker threads which are decoding video and audio

std::list<TheoraVideoClip*> TheoraVideoManager::mWorkLog
protected

stores pointer to clips that were docoded in the past in order to achieve fair scheduling

TheoraMutex* TheoraVideoManager::mWorkMutex
protected

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