aboutsummaryrefslogtreecommitdiff
path: root/graphics/video/dxa_player.h
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-07 21:19:00 +0000
committerFilippos Karapetis2009-01-07 21:19:00 +0000
commit2772a7aaf13b83f8bdb5c27bd0b519127950de20 (patch)
treea451f67fafdf6641b601b281bf9088820f13e63e /graphics/video/dxa_player.h
parent1395d3ba639ac543dc8f982aafb99781cdb4afbb (diff)
downloadscummvm-rg350-2772a7aaf13b83f8bdb5c27bd0b519127950de20.tar.gz
scummvm-rg350-2772a7aaf13b83f8bdb5c27bd0b519127950de20.tar.bz2
scummvm-rg350-2772a7aaf13b83f8bdb5c27bd0b519127950de20.zip
Further merging of the SMK and DXA players (the FLIC player is not done yet):
- Added a new class, VideoPlayer(), from which both the SMK and the DXA player inherit. This class provides generic functions and public methods for the inherited video classes. Default implementations have been made for these public methods, and the virtual ones can be overriden in inherited classes - There is now a default implementation of the function that sets the video palette - A basic video player for inherited classes has been added with method playVideo(). This is able to play a fullscreen non-interactive video, which can be skipped with events set by the caller. Postprocessing methods, which draw upon each frame (e.g. subtitles) can be done by implementing performPostProcessing() - The FTA2 movie player now uses the new playVideo() method - The new video player code is compatible with the old one (i.e. no changes to the existing engine code are necessary), but it's now possible to reduce engine code for video playing considerably svn-id: r35772
Diffstat (limited to 'graphics/video/dxa_player.h')
-rw-r--r--graphics/video/dxa_player.h89
1 files changed, 11 insertions, 78 deletions
diff --git a/graphics/video/dxa_player.h b/graphics/video/dxa_player.h
index 3239913131..1593658ae7 100644
--- a/graphics/video/dxa_player.h
+++ b/graphics/video/dxa_player.h
@@ -29,56 +29,16 @@
#include "common/scummsys.h"
#include "common/stream.h"
-namespace Graphics {
+#include "graphics/video/video_player.h"
-enum ScaleMode {
- S_NONE,
- S_INTERLACED,
- S_DOUBLE
-};
+namespace Graphics {
-class DXAPlayer {
+class DXAPlayer : public VideoPlayer {
public:
DXAPlayer();
virtual ~DXAPlayer();
/**
- * Returns the width of the video
- * @return the width of the video
- */
- int getWidth();
-
- /**
- * Returns the height of the video
- * @return the height of the video
- */
- int getHeight();
-
- /**
- * Returns the current frame number of the video
- * @return the current frame number of the video
- */
- int32 getCurFrame();
-
- /**
- * Returns the amount of frames in the video
- * @return the amount of frames in the video
- */
- int32 getFrameCount();
-
- /**
- * Returns the frame rate of the video
- * @return the frame rate of the video
- */
- int32 getFrameRate();
-
- /**
- * Returns the time to wait for each frame in 1/100 ms
- * @return the time to wait for each frame in 1/100 ms
- */
- int32 getFrameDelay();
-
- /**
* Load a DXA encoded video file
* @param filename the filename to load
*/
@@ -89,55 +49,28 @@ public:
*/
void closeFile();
- /**
- * Returns if a video file is loaded or not
- */
- bool videoIsLoaded() { return (_fileStream != NULL); }
-
-protected:
- /**
- * Set RGB palette, based on current frame
- * @param pal the RGB palette data
- */
- virtual void setPalette(byte *pal) = 0;
-
- /**
- * Copy current frame into the specified position of the destination
- * buffer.
- * @param dst the buffer
- * @param x the x position of the buffer
- * @param y the y position of the buffer
- * @param pitch the pitch of buffer
- */
- void copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch);
-
- /**
- * Decode the next frame
- */
- void decodeNextFrame();
+ bool decodeNextFrame();
+private:
void decodeZlib(byte *data, int size, int totalSize);
void decode12(int size);
void decode13(int size);
- Common::SeekableReadStream *_fileStream;
+ enum ScaleMode {
+ S_NONE,
+ S_INTERLACED,
+ S_DOUBLE
+ };
-private:
byte *_frameBuffer1;
byte *_frameBuffer2;
byte *_scaledBuffer;
- byte *_drawBuffer;
byte *_inBuffer;
uint32 _inBufferSize;
byte *_decompBuffer;
uint32 _decompBufferSize;
- uint16 _width;
- uint16 _height, _curHeight;
- uint16 _framesCount;
- uint32 _framesPerSec;
- uint16 _frameNum;
+ uint16 _curHeight;
uint32 _frameSize;
- uint32 _frameTicks;
ScaleMode _scaleMode;
};