diff options
author | Matthew Hoops | 2011-05-14 22:48:44 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-15 02:20:49 -0400 |
commit | e6452518ddb13294c2b3264e9dc754c8ad6ff3ef (patch) | |
tree | ad35443a058115ce8ae96bca09e511a100d6f174 /engines/sword25/fmv/theora_decoder.h | |
parent | 0bcfbd3cbdc4910e40635846844b1d356b1ae82e (diff) | |
download | scummvm-rg350-e6452518ddb13294c2b3264e9dc754c8ad6ff3ef.tar.gz scummvm-rg350-e6452518ddb13294c2b3264e9dc754c8ad6ff3ef.tar.bz2 scummvm-rg350-e6452518ddb13294c2b3264e9dc754c8ad6ff3ef.zip |
SWORD25: Begin fixing the TheoraDecoder implementation
getFrameRate() and endOfVideo() have been fixed so it can be used as a standalone decoder. a/v sync still needs to be fixed
Diffstat (limited to 'engines/sword25/fmv/theora_decoder.h')
-rw-r--r-- | engines/sword25/fmv/theora_decoder.h | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h index d8da024ab9..a1ce3ae473 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -53,7 +53,7 @@ namespace Sword25 { */ class TheoraDecoder : public Video::FixedRateVideoDecoder { public: - TheoraDecoder(Audio::Mixer *mixer = 0, Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); + TheoraDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); virtual ~TheoraDecoder(); /** @@ -71,43 +71,30 @@ public: */ const Graphics::Surface *decodeNextFrame(); - bool isVideoLoaded() const { - return _fileStream != 0; - } - bool isPaused() const { - return (FixedRateVideoDecoder::isPaused() || !isVideoLoaded()); - } + bool isVideoLoaded() const { return _fileStream != 0; } + uint16 getWidth() const { return _surface->w; } + uint16 getHeight() const { return _surface->h; } - uint16 getWidth() const { - return _surface->w; - } - uint16 getHeight() const { - return _surface->h; - } uint32 getFrameCount() const { // It is not possible to get frame count easily // I.e. seeking is required assert(0); return 0; } - Graphics::PixelFormat getPixelFormat() const { - return Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); - } + + Graphics::PixelFormat getPixelFormat() const { return _surface->format; } uint32 getElapsedTime() const; bool endOfVideo() const; protected: - Common::Rational getFrameRate() const { - return _frameRate; - } + Common::Rational getFrameRate() const { return _frameRate; } private: void queuePage(ogg_page *page); int bufferData(); - Audio::QueuingAudioStream *createAudioStream(); - void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelData); + void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer); private: Common::SeekableReadStream *_fileStream; @@ -115,7 +102,6 @@ private: Common::Rational _frameRate; uint32 _frameCount; - Audio::Mixer *_mixer; Audio::Mixer::SoundType _soundType; Audio::SoundHandle *_audHandle; Audio::QueuingAudioStream *_audStream; @@ -136,15 +122,11 @@ private: int _theoraPacket; int _vorbisPacket; - bool _stateFlag; int _ppLevelMax; int _ppLevel; int _ppInc; - // single frame video buffering - bool _videobufReady; - // single audio fragment audio buffering int _audiobufFill; bool _audiobufReady; |