diff options
-rw-r--r-- | engines/mohawk/video/qt_player.h | 4 | ||||
-rw-r--r-- | engines/sci/console.cpp | 5 | ||||
-rw-r--r-- | graphics/video/video_decoder.h | 16 |
3 files changed, 17 insertions, 8 deletions
diff --git a/engines/mohawk/video/qt_player.h b/engines/mohawk/video/qt_player.h index 5234f7cc59..205b18f99c 100644 --- a/engines/mohawk/video/qt_player.h +++ b/engines/mohawk/video/qt_player.h @@ -55,7 +55,7 @@ enum ScaleMode { kScaleQuarter = 4 }; -class QTPlayer : public Graphics::VideoDecoder { +class QTPlayer : public Graphics::RewindableVideoDecoder { public: QTPlayer(); virtual ~QTPlayer(); @@ -112,7 +112,7 @@ public: uint32 getTimeToNextFrame() const; Graphics::PixelFormat getPixelFormat() const; - void rewind(); // For a future RewindableVideoDecoder class + void rewind(); // TODO: These audio functions need to be removed from the public and/or added to // the VideoDecoder API directly. diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index f2e5601c9e..7cf3958257 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -225,8 +225,9 @@ void Console::postEnter() { Graphics::VideoDecoder *videoDecoder = 0; if (_videoFile.hasSuffix(".seq")) { - videoDecoder = new SeqDecoder(); - ((SeqDecoder *)videoDecoder)->setFrameDelay(_videoFrameDelay); + SeqDecoder *seqDecoder = new SeqDecoder(); + seqDecoder->setFrameDelay(_videoFrameDelay); + videoDecoder = seqDecoder; #ifdef ENABLE_SCI32 } else if (_videoFile.hasSuffix(".vmd")) { videoDecoder = new VMDDecoder(g_system->getMixer()); diff --git a/graphics/video/video_decoder.h b/graphics/video/video_decoder.h index 62aa496148..2ab8306d76 100644 --- a/graphics/video/video_decoder.h +++ b/graphics/video/video_decoder.h @@ -160,11 +160,8 @@ protected: /** * A VideoDecoder wrapper that implements getTimeToNextFrame() based on getFrameRate(). */ -class FixedRateVideoDecoder : public VideoDecoder { +class FixedRateVideoDecoder : public virtual VideoDecoder { public: - FixedRateVideoDecoder() {} - virtual ~FixedRateVideoDecoder() {} - uint32 getTimeToNextFrame() const; protected: @@ -179,6 +176,17 @@ private: uint32 getFrameBeginTime(uint32 frame) const; }; +/** + * A VideoDecoder that can rewind back to the beginning. + */ +class RewindableVideoDecoder : public virtual VideoDecoder { +public: + /** + * Rewind to the beginning of the video. + */ + virtual void rewind() = 0; +}; + } // End of namespace Graphics #endif |