[Scummvm-cvs-logs] SF.net SVN: scummvm:[49084] scummvm/trunk

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Tue May 18 19:36:34 CEST 2010


Revision: 49084
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49084&view=rev
Author:   mthreepwood
Date:     2010-05-18 17:36:34 +0000 (Tue, 18 May 2010)

Log Message:
-----------
Add a new class 'RewindableVideoDecoder' that allows a video to be rewound and have QTPlayer inherit from that.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/video/qt_player.h
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/graphics/video/video_decoder.h

Modified: scummvm/trunk/engines/mohawk/video/qt_player.h
===================================================================
--- scummvm/trunk/engines/mohawk/video/qt_player.h	2010-05-18 15:52:45 UTC (rev 49083)
+++ scummvm/trunk/engines/mohawk/video/qt_player.h	2010-05-18 17:36:34 UTC (rev 49084)
@@ -55,7 +55,7 @@
 	kScaleQuarter = 4
 };
 
-class QTPlayer : public Graphics::VideoDecoder {
+class QTPlayer : public Graphics::RewindableVideoDecoder {
 public:
 	QTPlayer();
 	virtual ~QTPlayer();
@@ -112,7 +112,7 @@
 	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.

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-05-18 15:52:45 UTC (rev 49083)
+++ scummvm/trunk/engines/sci/console.cpp	2010-05-18 17:36:34 UTC (rev 49084)
@@ -225,8 +225,9 @@
 		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());

Modified: scummvm/trunk/graphics/video/video_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/video_decoder.h	2010-05-18 15:52:45 UTC (rev 49083)
+++ scummvm/trunk/graphics/video/video_decoder.h	2010-05-18 17:36:34 UTC (rev 49084)
@@ -160,11 +160,8 @@
 /**
  * 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 @@
 	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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list