aboutsummaryrefslogtreecommitdiff
path: root/graphics/video/dxa_player.h
diff options
context:
space:
mode:
authorEugene Sandulenko2008-12-21 21:08:17 +0000
committerEugene Sandulenko2008-12-21 21:08:17 +0000
commit829cbc411094bd69052ab97c7846f2f8683796b9 (patch)
tree32d04552a0e59745d90bf1b9bc93ced4b3df3b61 /graphics/video/dxa_player.h
parentbe66a538b44966c52a48cc59421ccd7b7c27dedc (diff)
downloadscummvm-rg350-829cbc411094bd69052ab97c7846f2f8683796b9.tar.gz
scummvm-rg350-829cbc411094bd69052ab97c7846f2f8683796b9.tar.bz2
scummvm-rg350-829cbc411094bd69052ab97c7846f2f8683796b9.zip
Move all video players to separate directory
svn-id: r35470
Diffstat (limited to 'graphics/video/dxa_player.h')
-rw-r--r--graphics/video/dxa_player.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/graphics/video/dxa_player.h b/graphics/video/dxa_player.h
new file mode 100644
index 0000000000..8ead07f2ae
--- /dev/null
+++ b/graphics/video/dxa_player.h
@@ -0,0 +1,141 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GRAPHICS_VIDEO_DXA_PLAYER_H
+#define GRAPHICS_VIDEO_DXA_PLAYER_H
+
+#include "common/scummsys.h"
+#include "common/stream.h"
+
+namespace Graphics {
+
+enum ScaleMode {
+ S_NONE,
+ S_INTERLACED,
+ S_DOUBLE
+};
+
+class DXAPlayer {
+protected:
+ 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;
+ uint32 _frameSize;
+ uint32 _frameTicks;
+ ScaleMode _scaleMode;
+
+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
+ */
+ bool loadFile(const char *fileName);
+
+ /**
+ * Close a DXA encoded video file
+ */
+ void closeFile();
+
+protected:
+ /**
+ * Set palette, based on current frame
+ * @param pal the 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();
+
+ void decodeZlib(byte *data, int size, int totalSize);
+ void decode12(int size);
+ void decode13(int size);
+
+ Common::SeekableReadStream *_fileStream;
+};
+
+} // End of namespace Graphics
+
+#endif