aboutsummaryrefslogtreecommitdiff
path: root/graphics/video/dxa_decoder.h
diff options
context:
space:
mode:
authorMatthew Hoops2010-05-18 14:17:24 +0000
committerMatthew Hoops2010-05-18 14:17:24 +0000
commit11cbdd03180a655b2b23ee4a13f1a00a1d782b3c (patch)
tree5b0d84211308ea37a2fa2f7017d6f96314f3c6fb /graphics/video/dxa_decoder.h
parentf3892a506b2f935bae0be6319394c503c786d368 (diff)
downloadscummvm-rg350-11cbdd03180a655b2b23ee4a13f1a00a1d782b3c.tar.gz
scummvm-rg350-11cbdd03180a655b2b23ee4a13f1a00a1d782b3c.tar.bz2
scummvm-rg350-11cbdd03180a655b2b23ee4a13f1a00a1d782b3c.zip
Committing the rest of the VideoDecoder Rewrite from patch #2963496.
svn-id: r49079
Diffstat (limited to 'graphics/video/dxa_decoder.h')
-rw-r--r--graphics/video/dxa_decoder.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/graphics/video/dxa_decoder.h b/graphics/video/dxa_decoder.h
index 3edcc75ca9..0312828195 100644
--- a/graphics/video/dxa_decoder.h
+++ b/graphics/video/dxa_decoder.h
@@ -26,7 +26,7 @@
#ifndef GRAPHICS_VIDEO_DXA_PLAYER_H
#define GRAPHICS_VIDEO_DXA_PLAYER_H
-#include "graphics/video/video_player.h"
+#include "graphics/video/video_decoder.h"
namespace Graphics {
@@ -38,29 +38,33 @@ namespace Graphics {
* - sword1
* - sword2
*/
-class DXADecoder : public VideoDecoder {
+class DXADecoder : public FixedRateVideoDecoder {
public:
DXADecoder();
virtual ~DXADecoder();
- /**
- * Load a DXA encoded video file
- * @param filename the filename to load
- */
- bool loadFile(const char *fileName);
-
- /**
- * Close a DXA encoded video file
- */
- void closeFile();
-
- bool decodeNextFrame();
+ bool load(Common::SeekableReadStream &stream);
+ void close();
+
+ bool isVideoLoaded() const { return _fileStream != 0; }
+ uint16 getWidth() const { return _width; }
+ uint16 getHeight() const { return _height; }
+ uint32 getFrameCount() const { return _frameCount; }
+ Surface *decodeNextFrame();
+ PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); }
+ byte *getPalette() { _dirtyPalette = false; return _palette; }
+ bool hasDirtyPalette() const { return _dirtyPalette; }
/**
* Get the sound chunk tag of the loaded DXA file
*/
uint32 getSoundTag() { return _soundTag; }
+protected:
+ Common::Rational getFrameRate() const { return _frameRate; }
+
+ Common::SeekableReadStream *_fileStream;
+
private:
void decodeZlib(byte *data, int size, int totalSize);
void decode12(int size);
@@ -72,6 +76,10 @@ private:
S_DOUBLE
};
+ Graphics::Surface *_surface;
+ byte _palette[256 * 3];
+ bool _dirtyPalette;
+
byte *_frameBuffer1;
byte *_frameBuffer2;
byte *_scaledBuffer;
@@ -83,6 +91,9 @@ private:
uint32 _frameSize;
ScaleMode _scaleMode;
uint32 _soundTag;
+ uint16 _width, _height;
+ uint32 _frameRate;
+ uint32 _frameCount;
};
} // End of namespace Graphics