aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-11 00:30:02 -0400
committerMatthew Hoops2011-05-11 00:30:28 -0400
commita1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch)
tree8c51419daa486f1d4833757db4715dadab6c3497 /video
parentaccb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff)
parent33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff)
downloadscummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz
scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2
scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip
Merge remote branch 'upstream/master' into t7g-ios
Conflicts: audio/decoders/qdm2.h common/util.cpp engines/groovie/music.cpp engines/groovie/resource.h video/qt_decoder.cpp video/qt_decoder.h
Diffstat (limited to 'video')
-rw-r--r--video/avi_decoder.cpp7
-rw-r--r--video/avi_decoder.h25
-rw-r--r--video/codecs/cdtoons.cpp8
-rw-r--r--video/codecs/cinepak.cpp8
-rw-r--r--video/codecs/cinepak.h10
-rw-r--r--video/codecs/indeo3.cpp12
-rw-r--r--video/codecs/mjpeg.cpp10
-rw-r--r--video/codecs/mjpeg.h12
-rw-r--r--video/codecs/msrle.cpp3
-rw-r--r--video/codecs/msvideo1.cpp4
-rw-r--r--video/codecs/qtrle.cpp4
-rw-r--r--video/codecs/rpza.cpp4
-rw-r--r--video/codecs/smc.cpp3
-rw-r--r--video/codecs/truemotion1.cpp10
-rw-r--r--video/coktel_decoder.cpp66
-rw-r--r--video/coktel_decoder.h15
-rw-r--r--video/dxa_decoder.cpp7
-rw-r--r--video/dxa_decoder.h10
-rw-r--r--video/flic_decoder.cpp9
-rw-r--r--video/flic_decoder.h5
-rw-r--r--video/mpeg_player.h2
-rw-r--r--video/qt_decoder.cpp10
-rw-r--r--video/qt_decoder.h7
-rw-r--r--video/smk_decoder.cpp4
-rw-r--r--video/smk_decoder.h9
-rw-r--r--video/video_decoder.cpp3
-rw-r--r--video/video_decoder.h15
27 files changed, 195 insertions, 87 deletions
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 715741f41d..47322c86b7 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -23,10 +23,9 @@
*
*/
-#include "common/endian.h"
-#include "common/file.h"
#include "common/stream.h"
-#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
@@ -407,7 +406,7 @@ Codec *AviDecoder::createCodec() {
case ID_IV32:
return new Indeo3Decoder(_bmInfo.width, _bmInfo.height);
#endif
-#ifdef GRAPHICS_TRUEMOTION1_H
+#ifdef VIDEO_CODECS_TRUEMOTION1_H
case ID_DUCK:
return new TrueMotion1Decoder(_bmInfo.width, _bmInfo.height);
#endif
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 33189910c7..0154b57ea6 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -26,13 +26,34 @@
#ifndef VIDEO_AVI_PLAYER_H
#define VIDEO_AVI_PLAYER_H
+#include "common/endian.h"
+#include "common/rational.h"
+#include "common/rect.h"
+#include "common/str.h"
+
#include "video/video_decoder.h"
-#include "video/codecs/codec.h"
-#include "audio/audiostream.h"
#include "audio/mixer.h"
+namespace Audio {
+class QueuingAudioStream;
+}
+
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Video {
+class Codec;
+
#define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a))
// IDs used throughout the AVI files
diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp
index bdca5f9c80..51e3c23eaa 100644
--- a/video/codecs/cdtoons.cpp
+++ b/video/codecs/cdtoons.cpp
@@ -24,9 +24,9 @@
*/
#include "video/codecs/cdtoons.h"
+#include "common/rect.h"
#include "common/stream.h"
-
-#include "common/system.h"
+#include "common/textconsole.h"
namespace Video {
@@ -54,7 +54,7 @@ CDToonsDecoder::CDToonsDecoder(uint16 width, uint16 height) {
debugN(5, "CDToons: width %d, height %d\n", width, height);
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_currentPaletteId = 0;
memset(_palette, 0, 256 * 3);
@@ -75,7 +75,7 @@ Graphics::Surface *CDToonsDecoder::decodeImage(Common::SeekableReadStream *strea
uint16 blocksValidUntil = stream->readUint16BE();
byte u6 = stream->readByte();
byte backgroundColor = stream->readByte();
- debugN(5, "CDToons frame %d, size %d, unknown %04x (at 0), blocks valid until %d, unknown 6 is %02x, bkg colour is %02x\n",
+ debugN(5, "CDToons frame %d, size %d, unknown %04x (at 0), blocks valid until %d, unknown 6 is %02x, bkg color is %02x\n",
frameId, stream->size(), u0, blocksValidUntil, u6, backgroundColor);
Common::Rect clipRect = readRect(stream);
diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp
index 2f5cb73561..2a782dbafe 100644
--- a/video/codecs/cinepak.cpp
+++ b/video/codecs/cinepak.cpp
@@ -25,7 +25,13 @@
#include "video/codecs/cinepak.h"
+#include "common/debug.h"
+#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/util.h"
+
+#include "graphics/surface.h"
// Code here partially based off of ffmpeg ;)
@@ -89,7 +95,7 @@ const Graphics::Surface *CinepakDecoder::decodeImage(Common::SeekableReadStream
if (!_curFrame.surface) {
_curFrame.surface = new Graphics::Surface();
- _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat.bytesPerPixel);
+ _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat);
}
// Reset the y variable.
diff --git a/video/codecs/cinepak.h b/video/codecs/cinepak.h
index 8b4c0216a3..34e4fe98eb 100644
--- a/video/codecs/cinepak.h
+++ b/video/codecs/cinepak.h
@@ -27,13 +27,19 @@
#define VIDEO_CODECS_CINEPAK_H
#include "common/scummsys.h"
-#include "common/stream.h"
#include "common/rect.h"
-#include "graphics/surface.h"
#include "graphics/pixelformat.h"
#include "video/codecs/codec.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Video {
struct CinepakCodebook {
diff --git a/video/codecs/indeo3.cpp b/video/codecs/indeo3.cpp
index e7f470bd3a..b4f6c6ffe3 100644
--- a/video/codecs/indeo3.cpp
+++ b/video/codecs/indeo3.cpp
@@ -35,8 +35,8 @@
#include "common/system.h"
#include "common/endian.h"
-#include "common/frac.h"
-#include "common/file.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
#include "graphics/conversion.h"
@@ -51,7 +51,7 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _correc
_pixelFormat = g_system->getScreenFormat();
_surface = new Graphics::Surface;
- _surface->create(width, height, _pixelFormat.bytesPerPixel);
+ _surface->create(width, height, _pixelFormat);
buildModPred();
allocFrames();
@@ -322,10 +322,10 @@ const Graphics::Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream *
const uint32 color = _pixelFormat.RGBToColor(r, g, b);
- for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->bytesPerPixel) {
- if (_surface->bytesPerPixel == 1)
+ for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->format.bytesPerPixel) {
+ if (_surface->format.bytesPerPixel == 1)
*((uint8 *)rowDest) = (uint8)color;
- else if (_surface->bytesPerPixel == 2)
+ else if (_surface->format.bytesPerPixel == 2)
*((uint16 *)rowDest) = (uint16)color;
}
}
diff --git a/video/codecs/mjpeg.cpp b/video/codecs/mjpeg.cpp
index d6ec391a84..2ef854039b 100644
--- a/video/codecs/mjpeg.cpp
+++ b/video/codecs/mjpeg.cpp
@@ -24,10 +24,16 @@
*/
#include "common/system.h"
-#include "graphics/conversion.h" // For YUV2RGB
+#include "common/textconsole.h"
+#include "graphics/jpeg.h"
+#include "graphics/surface.h"
#include "video/codecs/mjpeg.h"
+namespace Common {
+class SeekableReadStream;
+}
+
namespace Video {
JPEGDecoder::JPEGDecoder() : Codec() {
@@ -53,7 +59,7 @@ const Graphics::Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream* st
if (!_surface) {
_surface = new Graphics::Surface();
- _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat.bytesPerPixel);
+ _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat);
}
Graphics::Surface *frame = _jpeg->getSurface(_pixelFormat);
diff --git a/video/codecs/mjpeg.h b/video/codecs/mjpeg.h
index c9f931f091..d1395a8248 100644
--- a/video/codecs/mjpeg.h
+++ b/video/codecs/mjpeg.h
@@ -26,12 +26,18 @@
#ifndef VIDEO_CODECS_MJPEG_H
#define VIDEO_CODECS_MJPEG_H
-#include "common/scummsys.h"
-
#include "video/codecs/codec.h"
-#include "graphics/jpeg.h"
#include "graphics/pixelformat.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+class JPEG;
+struct Surface;
+}
+
namespace Video {
// Motion JPEG Decoder
diff --git a/video/codecs/msrle.cpp b/video/codecs/msrle.cpp
index 46158c49d7..19309bc7aa 100644
--- a/video/codecs/msrle.cpp
+++ b/video/codecs/msrle.cpp
@@ -27,12 +27,13 @@
#include "video/codecs/msrle.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Video {
MSRLEDecoder::MSRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) {
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_bitsPerPixel = bitsPerPixel;
}
diff --git a/video/codecs/msvideo1.cpp b/video/codecs/msvideo1.cpp
index 2075d7f013..93e9aaae64 100644
--- a/video/codecs/msvideo1.cpp
+++ b/video/codecs/msvideo1.cpp
@@ -27,6 +27,7 @@
#include "video/codecs/msvideo1.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Video {
@@ -38,7 +39,8 @@ namespace Video {
MSVideo1Decoder::MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() {
_surface = new Graphics::Surface();
- _surface->create(width, height, (bitsPerPixel == 8) ? 1 : 2);
+ // TODO: Specify the correct pixel format for 2Bpp mode.
+ _surface->create(width, height, (bitsPerPixel == 8) ? Graphics::PixelFormat::createFormatCLUT8() : Graphics::PixelFormat(2, 0, 0, 0, 0, 0, 0, 0, 0));
_bitsPerPixel = bitsPerPixel;
}
diff --git a/video/codecs/qtrle.cpp b/video/codecs/qtrle.cpp
index 26b2f02ce1..0ae27f6284 100644
--- a/video/codecs/qtrle.cpp
+++ b/video/codecs/qtrle.cpp
@@ -28,9 +28,11 @@
#include "video/codecs/qtrle.h"
+#include "common/debug.h"
#include "common/scummsys.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/colormasks.h"
#include "graphics/surface.h"
@@ -48,7 +50,7 @@ QTRLEDecoder::QTRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) : Cod
debug(2, "QTRLE corrected width: %d", width);
_surface = new Graphics::Surface();
- _surface->create(width, height, _bitsPerPixel <= 8 ? 1 : _pixelFormat.bytesPerPixel);
+ _surface->create(width, height, _bitsPerPixel <= 8 ? Graphics::PixelFormat::createFormatCLUT8() : _pixelFormat);
}
#define CHECK_STREAM_PTR(n) \
diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp
index cc9739b673..0c06661c50 100644
--- a/video/codecs/rpza.cpp
+++ b/video/codecs/rpza.cpp
@@ -27,8 +27,10 @@
#include "video/codecs/rpza.h"
+#include "common/debug.h"
#include "common/system.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "graphics/colormasks.h"
namespace Video {
@@ -44,7 +46,7 @@ RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() {
debug(2, "RPZA corrected width: %d", width);
_surface = new Graphics::Surface();
- _surface->create(width, height, _pixelFormat.bytesPerPixel);
+ _surface->create(width, height, _pixelFormat);
}
RPZADecoder::~RPZADecoder() {
diff --git a/video/codecs/smc.cpp b/video/codecs/smc.cpp
index d03c60490f..bbd6073497 100644
--- a/video/codecs/smc.cpp
+++ b/video/codecs/smc.cpp
@@ -27,6 +27,7 @@
#include "video/codecs/smc.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Video {
@@ -49,7 +50,7 @@ namespace Video {
SMCDecoder::SMCDecoder(uint16 width, uint16 height) {
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
}
SMCDecoder::~SMCDecoder() {
diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp
index a0456869ab..b7d1f406d7 100644
--- a/video/codecs/truemotion1.cpp
+++ b/video/codecs/truemotion1.cpp
@@ -32,6 +32,8 @@
#include "video/codecs/truemotion1data.h"
#include "common/stream.h"
+#include "common/textconsole.h"
+#include "common/util.h"
namespace Video {
@@ -58,12 +60,14 @@ enum {
};
// { valid for metatype }, algorithm, num of deltas, vert res, horiz res
-struct {
+struct CompressionType {
int algorithm;
int blockWidth; // vres
int blockHeight; // hres
int blockType;
-} static const compressionTypes[17] = {
+};
+
+static const CompressionType compressionTypes[17] = {
{ ALGO_NOP, 0, 0, 0 },
{ ALGO_RGB16V, 4, 4, BLOCK_4x4 },
@@ -92,7 +96,7 @@ TrueMotion1Decoder::TrueMotion1Decoder(uint16 width, uint16 height) {
_width = width;
_height = height;
- _surface->create(width, height, 2);
+ _surface->create(width, height, getPixelFormat());
// there is a vertical predictor for each pixel in a line; each vertical
// predictor is 0 to start with
diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index 0ab12e91cc..4448c9162e 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -24,6 +24,13 @@
*/
#include "common/scummsys.h"
+#include "common/rect.h"
+#include "common/endian.h"
+#include "common/stream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/types.h"
+#include "common/util.h"
#include "video/coktel_decoder.h"
@@ -92,11 +99,12 @@ void CoktelDecoder::setSurfaceMemory(void *mem, uint16 width, uint16 height, uin
assert(bpp == getPixelFormat().bytesPerPixel);
// Create a surface over this memory
- _surface.w = width;
- _surface.h = height;
- _surface.pitch = width * bpp;
- _surface.pixels = mem;
- _surface.bytesPerPixel = bpp;
+ _surface.w = width;
+ _surface.h = height;
+ _surface.pitch = width * bpp;
+ _surface.pixels = mem;
+ // TODO: Check whether it is fine to assume we want the setup PixelFormat.
+ _surface.format = getPixelFormat();
_ownSurface = false;
}
@@ -127,18 +135,18 @@ void CoktelDecoder::createSurface() {
return;
if ((_width > 0) && (_height > 0))
- _surface.create(_width, _height, getPixelFormat().bytesPerPixel);
+ _surface.create(_width, _height, getPixelFormat());
_ownSurface = true;
}
void CoktelDecoder::freeSurface() {
if (!_ownSurface) {
- _surface.w = 0;
- _surface.h = 0;
- _surface.pitch = 0;
- _surface.pixels = 0;
- _surface.bytesPerPixel = 0;
+ _surface.w = 0;
+ _surface.h = 0;
+ _surface.pitch = 0;
+ _surface.pixels = 0;
+ _surface.format = Graphics::PixelFormat();
} else
_surface.free();
@@ -449,11 +457,11 @@ void CoktelDecoder::renderBlockWhole(Graphics::Surface &dstSurf, const byte *src
rect.clip(dstSurf.w, dstSurf.h);
- byte *dst = (byte *)dstSurf.pixels + (rect.top * dstSurf.pitch) + rect.left * dstSurf.bytesPerPixel;
+ byte *dst = (byte *)dstSurf.pixels + (rect.top * dstSurf.pitch) + rect.left * dstSurf.format.bytesPerPixel;
for (int i = 0; i < rect.height(); i++) {
- memcpy(dst, src, rect.width() * dstSurf.bytesPerPixel);
+ memcpy(dst, src, rect.width() * dstSurf.format.bytesPerPixel);
- src += srcRect.width() * dstSurf.bytesPerPixel;
+ src += srcRect.width() * dstSurf.format.bytesPerPixel;
dst += dstSurf.pitch;
}
}
@@ -1375,12 +1383,12 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) {
if ((type == 2) && (rect.width() == _surface.w) && (_x == 0)) {
// Directly uncompress onto the video surface
- const int offsetX = rect.left * _surface.bytesPerPixel;
+ const int offsetX = rect.left * _surface.format.bytesPerPixel;
const int offsetY = (_y + rect.top) * _surface.pitch;
const int offset = offsetX + offsetY;
if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
- _surface.w * _surface.h * _surface.bytesPerPixel - offset))
+ _surface.w * _surface.h * _surface.format.bytesPerPixel - offset))
return true;
}
@@ -1806,11 +1814,11 @@ bool VMDDecoder::assessVideoProperties() {
_videoBuffer[i] = new byte[_videoBufferSize];
memset(_videoBuffer[i], 0, _videoBufferSize);
- _8bppSurface[i].w = _width * _bytesPerPixel;
- _8bppSurface[i].h = _height;
- _8bppSurface[i].pitch = _width * _bytesPerPixel;
- _8bppSurface[i].pixels = _videoBuffer[i];
- _8bppSurface[i].bytesPerPixel = 1;
+ _8bppSurface[i].w = _width * _bytesPerPixel;
+ _8bppSurface[i].h = _height;
+ _8bppSurface[i].pitch = _width * _bytesPerPixel;
+ _8bppSurface[i].pixels = _videoBuffer[i];
+ _8bppSurface[i].format = Graphics::PixelFormat::createFormatCLUT8();
}
}
@@ -2223,12 +2231,12 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) {
if ((type == 2) && (rect.width() == _surface.w) && (_x == 0) && (_blitMode == 0)) {
// Directly uncompress onto the video surface
- const int offsetX = rect.left * _surface.bytesPerPixel;
+ const int offsetX = rect.left * _surface.format.bytesPerPixel;
const int offsetY = (_y + rect.top) * _surface.pitch;
const int offset = offsetX - offsetY;
if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
- _surface.w * _surface.h * _surface.bytesPerPixel - offset))
+ _surface.w * _surface.h * _surface.format.bytesPerPixel - offset))
return true;
}
@@ -2338,13 +2346,13 @@ void VMDDecoder::blit16(const Graphics::Surface &srcSurf, Common::Rect &rect) {
const byte *src = (byte *)srcSurf.pixels +
(srcRect.top * srcSurf.pitch) + srcRect.left * _bytesPerPixel;
byte *dst = (byte *)_surface.pixels +
- ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.bytesPerPixel;
+ ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.format.bytesPerPixel;
for (int i = 0; i < rect.height(); i++) {
const byte *srcRow = src;
byte *dstRow = dst;
- for (int j = 0; j < rect.width(); j++, srcRow += 2, dstRow += _surface.bytesPerPixel) {
+ for (int j = 0; j < rect.width(); j++, srcRow += 2, dstRow += _surface.format.bytesPerPixel) {
uint16 data = READ_LE_UINT16(srcRow);
byte r = ((data & 0x7C00) >> 10) << 3;
@@ -2355,7 +2363,7 @@ void VMDDecoder::blit16(const Graphics::Surface &srcSurf, Common::Rect &rect) {
if ((r == 0) && (g == 0) && (b == 0))
c = 0;
- if (_surface.bytesPerPixel == 2)
+ if (_surface.format.bytesPerPixel == 2)
*((uint16 *)dstRow) = (uint16) c;
}
@@ -2376,13 +2384,13 @@ void VMDDecoder::blit24(const Graphics::Surface &srcSurf, Common::Rect &rect) {
const byte *src = (byte *)srcSurf.pixels +
(srcRect.top * srcSurf.pitch) + srcRect.left * _bytesPerPixel;
byte *dst = (byte *)_surface.pixels +
- ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.bytesPerPixel;
+ ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.format.bytesPerPixel;
for (int i = 0; i < rect.height(); i++) {
const byte *srcRow = src;
byte *dstRow = dst;
- for (int j = 0; j < rect.width(); j++, srcRow += 3, dstRow += _surface.bytesPerPixel) {
+ for (int j = 0; j < rect.width(); j++, srcRow += 3, dstRow += _surface.format.bytesPerPixel) {
byte r = srcRow[2];
byte g = srcRow[1];
byte b = srcRow[0];
@@ -2391,7 +2399,7 @@ void VMDDecoder::blit24(const Graphics::Surface &srcSurf, Common::Rect &rect) {
if ((r == 0) && (g == 0) && (b == 0))
c = 0;
- if (_surface.bytesPerPixel == 2)
+ if (_surface.format.bytesPerPixel == 2)
*((uint16 *)dstRow) = (uint16) c;
}
diff --git a/video/coktel_decoder.h b/video/coktel_decoder.h
index e83e1d29ed..46007d55da 100644
--- a/video/coktel_decoder.h
+++ b/video/coktel_decoder.h
@@ -35,14 +35,25 @@
#include "common/list.h"
#include "common/array.h"
-#include "common/rect.h"
+#include "common/rational.h"
+#include "common/str.h"
+
+#include "graphics/surface.h"
#include "video/video_decoder.h"
#include "audio/mixer.h"
+namespace Common {
+struct Rect;
+class SeekableReadStream;
+}
namespace Audio {
- class QueuingAudioStream;
+class QueuingAudioStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
}
namespace Video {
diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp
index a64b8f6fee..9e3f59705c 100644
--- a/video/dxa_decoder.cpp
+++ b/video/dxa_decoder.cpp
@@ -25,10 +25,11 @@
#include "common/debug.h"
#include "common/endian.h"
-#include "common/archive.h"
#include "common/system.h"
#include "common/stream.h"
-#include "common/util.h"
+#include "common/textconsole.h"
+
+#include "graphics/surface.h"
#include "video/dxa_decoder.h"
@@ -101,7 +102,7 @@ bool DXADecoder::loadStream(Common::SeekableReadStream *stream) {
}
_surface = new Graphics::Surface();
- _surface->bytesPerPixel = 1;
+ _surface->format = Graphics::PixelFormat::createFormatCLUT8();
debug(2, "flags 0x0%x framesCount %d width %d height %d rate %d", flags, getFrameCount(), getWidth(), getHeight(), getFrameRate().toInt());
diff --git a/video/dxa_decoder.h b/video/dxa_decoder.h
index 614cb2d90b..498f4630d4 100644
--- a/video/dxa_decoder.h
+++ b/video/dxa_decoder.h
@@ -26,8 +26,18 @@
#ifndef VIDEO_DXA_DECODER_H
#define VIDEO_DXA_DECODER_H
+#include "common/rational.h"
+#include "graphics/pixelformat.h"
#include "video/video_decoder.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Video {
/**
diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp
index 90f7a8e9ac..47a9244a13 100644
--- a/video/flic_decoder.cpp
+++ b/video/flic_decoder.cpp
@@ -24,10 +24,11 @@
*/
#include "video/flic_decoder.h"
-#include "common/archive.h"
-#include "common/stream.h"
#include "common/endian.h"
+#include "common/rect.h"
+#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace Video {
@@ -79,7 +80,7 @@ bool FlicDecoder::loadStream(Common::SeekableReadStream *stream) {
_offsetFrame2 = _fileStream->readUint32LE();
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_palette = (byte *)malloc(3 * 256);
memset(_palette, 0, 3 * 256);
_paletteChanged = false;
@@ -226,7 +227,7 @@ const Graphics::Surface *FlicDecoder::decodeNextFrame() {
_surface->free();
delete _surface;
_surface = new Graphics::Surface();
- _surface->create(newWidth, newHeight, 1);
+ _surface->create(newWidth, newHeight, Graphics::PixelFormat::createFormatCLUT8());
}
}
break;
diff --git a/video/flic_decoder.h b/video/flic_decoder.h
index 954fed7bfa..4ca8615de1 100644
--- a/video/flic_decoder.h
+++ b/video/flic_decoder.h
@@ -28,10 +28,13 @@
#include "video/video_decoder.h"
#include "common/list.h"
+#include "common/rational.h"
#include "common/rect.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Video {
diff --git a/video/mpeg_player.h b/video/mpeg_player.h
index 44baff9c2b..dde272a9c6 100644
--- a/video/mpeg_player.h
+++ b/video/mpeg_player.h
@@ -81,7 +81,7 @@ typedef sequence_t mpeg2_sequence_t;
#define BUFFER_SIZE 4096
namespace Common {
- class File;
+class File;
}
class OSystem;
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 1ed99a701a..d9ad65c9a0 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -33,12 +33,17 @@
#include "video/qt_decoder.h"
+#include "audio/audiostream.h"
+
#include "common/debug.h"
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "common/util.h"
// Video codecs
+#include "video/codecs/codec.h"
#include "video/codecs/cinepak.h"
#include "video/codecs/mjpeg.h"
#include "video/codecs/qtrle.h"
@@ -46,6 +51,7 @@
#include "video/codecs/smc.h"
#include "video/codecs/cdtoons.h"
+
namespace Video {
////////////////////////////////////////////
@@ -313,7 +319,7 @@ const Graphics::Surface *QuickTimeDecoder::scaleSurface(const Graphics::Surface
for (int32 j = 0; j < _scaledSurface->h; j++)
for (int32 k = 0; k < _scaledSurface->w; k++)
- memcpy(_scaledSurface->getBasePtr(k, j), frame->getBasePtr((k * getScaleFactorX()).toInt() , (j * getScaleFactorY()).toInt()), frame->bytesPerPixel);
+ memcpy(_scaledSurface->getBasePtr(k, j), frame->getBasePtr((k * getScaleFactorX()).toInt() , (j * getScaleFactorY()).toInt()), frame->format.bytesPerPixel);
return _scaledSurface;
}
@@ -386,7 +392,7 @@ void QuickTimeDecoder::init() {
if (getScaleFactorX() != 1 || getScaleFactorY() != 1) {
// We have to initialize the scaled surface
_scaledSurface = new Graphics::Surface();
- _scaledSurface->create(getWidth(), getHeight(), getPixelFormat().bytesPerPixel);
+ _scaledSurface->create(getWidth(), getHeight(), getPixelFormat());
}
}
}
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 7167c8b9a2..6f7eb9450c 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -35,20 +35,21 @@
#define VIDEO_QT_DECODER_H
#include "common/scummsys.h"
+#include "common/rational.h"
#include "video/video_decoder.h"
-#include "video/codecs/codec.h"
-#include "audio/audiostream.h"
#include "audio/mixer.h"
#include "audio/decoders/quicktime_intern.h"
namespace Common {
- class MacResManager;
+ class Rational;
}
namespace Video {
+class Codec;
+
/**
* Decoder for QuickTime videos.
*
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 760d0045d9..7a95eedf6a 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -29,11 +29,11 @@
#include "video/smk_decoder.h"
-#include "common/archive.h"
#include "common/endian.h"
#include "common/util.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
@@ -483,7 +483,7 @@ bool SmackerDecoder::loadStream(Common::SeekableReadStream *stream) {
_surface = new Graphics::Surface();
// Height needs to be doubled if we have flags (Y-interlaced or Y-doubled)
- _surface->create(width, height * (_header.flags ? 2 : 1), 1);
+ _surface->create(width, height * (_header.flags ? 2 : 1), Graphics::PixelFormat::createFormatCLUT8());
memset(_palette, 0, 3 * 256);
return true;
diff --git a/video/smk_decoder.h b/video/smk_decoder.h
index 2d01909a44..b4eda88203 100644
--- a/video/smk_decoder.h
+++ b/video/smk_decoder.h
@@ -26,11 +26,18 @@
#ifndef VIDEO_SMK_PLAYER_H
#define VIDEO_SMK_PLAYER_H
+#include "common/rational.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
#include "video/video_decoder.h"
#include "audio/mixer.h"
namespace Audio {
- class QueuingAudioStream;
+class QueuingAudioStream;
+}
+
+namespace Common {
+class SeekableReadStream;
}
namespace Video {
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index a6317bac8f..dde2c09082 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -25,9 +25,12 @@
#include "video/video_decoder.h"
+#include "common/rational.h"
#include "common/file.h"
#include "common/system.h"
+#include "graphics/palette.h"
+
namespace Video {
VideoDecoder::VideoDecoder() {
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 348b5dc0a3..b5574fd3fc 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -26,18 +26,19 @@
#ifndef VIDEO_DECODER_H
#define VIDEO_DECODER_H
-#include "common/events.h"
-#include "common/list.h"
-#include "common/rational.h"
-
-#include "graphics/surface.h"
-#include "graphics/pixelformat.h"
+#include "common/str.h"
#include "audio/timestamp.h" // TODO: Move this to common/ ?
namespace Common {
- class SeekableReadStream;
+class Rational;
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
+struct Surface;
}
namespace Video {