torque Torque Game Engine Documentation
TGE Version 1.5.2

TheoraTexture Class Reference

#include <theoraPlayer.h>


Detailed Description

TheoraTexture decodes Ogg Theora files, and their audio.

TheoraTexture objects can be used similarly to TextureObjects. Just set the video, call play(), and then refresh every frame to get the latest video. Audio happens automagically.

Note:
Uses Theora and ogg libraries which are Copyright (C) Xiph.org Foundation


Public Member Functions

 TheoraTexture ()
 TheoraTexture (const char *filename, bool play=false, Audio::Description *desc=NULL)
 ~TheoraTexture ()
 operator TextureObject * ()
bool setFile (const char *, bool play=false, bool restart=false, Audio::Description *desc=NULL)
const bool isPlaying () const
const bool isReady () const
bool play ()
void stop ()
bool pause ()
void refresh ()
 Update the GL texture from the bitmap the background thread writes to.
U32 getGLName ()
const F64 getCurrentTime ()

Data Fields

TextureHandle * mTextureHandle

Private Member Functions

void init ()
bool parseHeaders ()
bool createVideoBuffers ()
bool createAudioBuffers (Audio::Description *desc)
void generateLookupTables ()
 We precalculate adjusted YUV values for faster RGB conversion.
void destroyTexture (bool restartOgg=false)
void drawFrame ()
bool readyVideo (const F64 lastFrame, F64 &vBuffTime)
bool readyAudio ()
bool demandOggPage ()
S32 bufferOggPage ()
S32 queueOggPage (ogg_page *page)
F64 getTheoraTime ()
bool playLoop ()

Static Private Member Functions

static void playThread (void *udata)
 Background playback thread.

Private Attributes

ThreadmPlayThread
ogg_sync_state mOggSyncState
 Ogg and codec state for demux/decode.
ogg_page mOggPage
ogg_stream_state mOggTheoraStream
ogg_stream_state mOggVorbisStream
theora_info mTheoraInfo
theora_comment mTheoraComment
theora_state mTheoraState
vorbis_info mVorbisInfo
vorbis_comment mVorbisComment
vorbis_dsp_state mVorbisDspState
vorbis_block mVorbisBlock
StreammTheoraFile
 File handle for the theora file.
volatile bool mReady
volatile bool mPlaying
volatile bool mHasVorbis
OggMixedStreamSourcemVorbisBuffer
AUDIOHANDLE mVorbisHandle
volatile F32 mCurrentTime
volatile U32 mStartTick
MagicalTrevor mMagicalTrevor

Data Structures

struct  MagicalTrevor
 Magical Trevor is responsible for tracking elapsed time based on the currently playing buffer. More...


Constructor & Destructor Documentation

TheoraTexture::TheoraTexture (  ) 

TheoraTexture::TheoraTexture ( const char *  filename,
bool  play = false,
Audio::Description desc = NULL 
)

TheoraTexture::~TheoraTexture (  ) 


Member Function Documentation

void TheoraTexture::init (  )  [private]

bool TheoraTexture::parseHeaders (  )  [private]

bool TheoraTexture::createVideoBuffers (  )  [private]

bool TheoraTexture::createAudioBuffers ( Audio::Description desc  )  [private]

void TheoraTexture::generateLookupTables (  )  [private]

We precalculate adjusted YUV values for faster RGB conversion.

This function is responsible for making sure they're present and valid.

void TheoraTexture::destroyTexture ( bool  restartOgg = false  )  [private]

void TheoraTexture::drawFrame (  )  [private]

bool TheoraTexture::readyVideo ( const F64  lastFrame,
F64 vBuffTime 
) [private]

bool TheoraTexture::readyAudio (  )  [private]

bool TheoraTexture::demandOggPage (  )  [private]

S32 TheoraTexture::bufferOggPage (  )  [private]

S32 TheoraTexture::queueOggPage ( ogg_page *  page  )  [private]

F64 TheoraTexture::getTheoraTime (  )  [private]

static void TheoraTexture::playThread ( void udata  )  [static, private]

Background playback thread.

bool TheoraTexture::playLoop (  )  [private]

TheoraTexture::operator TextureObject * (  )  [inline]

bool TheoraTexture::setFile ( const char *  ,
bool  play = false,
bool  restart = false,
Audio::Description desc = NULL 
)

const bool TheoraTexture::isPlaying (  )  const [inline]

const bool TheoraTexture::isReady (  )  const [inline]

bool TheoraTexture::play (  ) 

void TheoraTexture::stop (  ) 

bool TheoraTexture::pause (  ) 

void TheoraTexture::refresh (  ) 

Update the GL texture from the bitmap the background thread writes to.

U32 TheoraTexture::getGLName (  ) 

const F64 TheoraTexture::getCurrentTime (  )  [inline]


Field Documentation

ogg_sync_state TheoraTexture::mOggSyncState [private]

Ogg and codec state for demux/decode.

ogg_page TheoraTexture::mOggPage [private]

ogg_stream_state TheoraTexture::mOggTheoraStream [private]

ogg_stream_state TheoraTexture::mOggVorbisStream [private]

theora_info TheoraTexture::mTheoraInfo [private]

theora_comment TheoraTexture::mTheoraComment [private]

theora_state TheoraTexture::mTheoraState [private]

vorbis_info TheoraTexture::mVorbisInfo [private]

vorbis_comment TheoraTexture::mVorbisComment [private]

vorbis_dsp_state TheoraTexture::mVorbisDspState [private]

vorbis_block TheoraTexture::mVorbisBlock [private]

File handle for the theora file.

volatile bool TheoraTexture::mReady [private]

volatile bool TheoraTexture::mPlaying [private]

volatile bool TheoraTexture::mHasVorbis [private]

volatile F32 TheoraTexture::mCurrentTime [private]

volatile U32 TheoraTexture::mStartTick [private]




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen