diff options
author | Eugene Sandulenko | 2011-01-23 19:08:09 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2011-01-23 19:08:09 +0000 |
commit | caa6684752a310e916b179125a4125a8b3be36f0 (patch) | |
tree | dc364d58619b297194bc5d0673b694c34fb51b6c /video | |
parent | 3d15871ee2d6a9c0ce4819a6ab5925638bafa8b9 (diff) | |
download | scummvm-rg350-caa6684752a310e916b179125a4125a8b3be36f0.tar.gz scummvm-rg350-caa6684752a310e916b179125a4125a8b3be36f0.tar.bz2 scummvm-rg350-caa6684752a310e916b179125a4125a8b3be36f0.zip |
VIDEO: Move video classes to Video:: namespace
svn-id: r55479
Diffstat (limited to 'video')
41 files changed, 216 insertions, 216 deletions
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index 73edfca052..a49b54a7f9 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -44,7 +44,7 @@ #include "video/codecs/msrle.h" #include "video/codecs/truemotion1.h" -namespace Graphics { +namespace Video { /* static byte char2num(char c) { @@ -316,7 +316,7 @@ uint32 AviDecoder::getElapsedTime() const { return VideoDecoder::getElapsedTime(); } -const Surface *AviDecoder::decodeNextFrame() { +const Graphics::Surface *AviDecoder::decodeNextFrame() { uint32 nextTag = _fileStream->readUint32BE(); if (_fileStream->eos()) @@ -334,9 +334,9 @@ const Surface *AviDecoder::decodeNextFrame() { error ("Expected 'rec ' LIST"); // Decode chunks in the list and see if we get a frame - const Surface *frame = NULL; + const Graphics::Surface *frame = NULL; while (_fileStream->pos() < startPos + (int32)listSize) { - const Surface *temp = decodeNextFrame(); + const Graphics::Surface *temp = decodeNextFrame(); if (temp) frame = temp; } @@ -417,7 +417,7 @@ Codec *AviDecoder::createCodec() { return NULL; } -PixelFormat AviDecoder::getPixelFormat() const { +Graphics::PixelFormat AviDecoder::getPixelFormat() const { assert(_videoCodec); return _videoCodec->getPixelFormat(); } @@ -456,4 +456,4 @@ void AviDecoder::queueAudioBuffer(uint32 chunkSize) { } } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/avi_decoder.h b/video/avi_decoder.h index a89b378c10..57a39ea941 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -31,7 +31,7 @@ #include "sound/audiostream.h" #include "sound/mixer.h" -namespace Graphics { +namespace Video { #define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a)) @@ -182,8 +182,8 @@ public: uint16 getHeight() const { return _header.height; } uint32 getFrameCount() const { return _header.totalFrames; } uint32 getElapsedTime() const; - const Surface *decodeNextFrame(); - PixelFormat getPixelFormat() const; + const Graphics::Surface *decodeNextFrame(); + Graphics::PixelFormat getPixelFormat() const; const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } @@ -220,6 +220,6 @@ private: void queueAudioBuffer(uint32 chunkSize); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp index cd43f744e6..eaa8f53602 100644 --- a/video/codecs/cdtoons.cpp +++ b/video/codecs/cdtoons.cpp @@ -28,7 +28,7 @@ #include "common/system.h" -namespace Graphics { +namespace Video { struct CDToonsAction { uint16 blockId; @@ -447,4 +447,4 @@ void CDToonsDecoder::setPalette(byte *data) { _palette[0] = _palette[1] = _palette[2] = 0; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/cdtoons.h b/video/codecs/cdtoons.h index bb6fefa5de..dafe5e56ef 100644 --- a/video/codecs/cdtoons.h +++ b/video/codecs/cdtoons.h @@ -30,7 +30,7 @@ #include "common/hashmap.h" -namespace Graphics { +namespace Video { struct CDToonsBlock { uint16 flags; @@ -46,14 +46,14 @@ public: CDToonsDecoder(uint16 width, uint16 height); ~CDToonsDecoder(); - Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } bool containsPalette() const { return true; } const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } private: - Surface *_surface; + Graphics::Surface *_surface; byte _palette[256 * 3]; bool _dirtyPalette; uint16 _currentPaletteId; @@ -65,6 +65,6 @@ private: void setPalette(byte *data); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp index 27be2d05ff..2f5cb73561 100644 --- a/video/codecs/cinepak.cpp +++ b/video/codecs/cinepak.cpp @@ -29,7 +29,7 @@ // Code here partially based off of ffmpeg ;) -namespace Graphics { +namespace Video { // Convert a color from YUV to RGB colorspace, Cinepak style. inline static void CPYUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) { @@ -54,7 +54,7 @@ CinepakDecoder::CinepakDecoder(int bitsPerPixel) : Codec() { _y = 0; if (bitsPerPixel == 8) - _pixelFormat = PixelFormat::createFormatCLUT8(); + _pixelFormat = Graphics::PixelFormat::createFormatCLUT8(); else _pixelFormat = g_system->getScreenFormat(); } @@ -68,7 +68,7 @@ CinepakDecoder::~CinepakDecoder() { delete[] _curFrame.strips; } -const Surface *CinepakDecoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *CinepakDecoder::decodeImage(Common::SeekableReadStream *stream) { _curFrame.flags = stream->readByte(); _curFrame.length = (stream->readByte() << 16) + stream->readUint16BE(); _curFrame.width = stream->readUint16BE(); @@ -88,7 +88,7 @@ const Surface *CinepakDecoder::decodeImage(Common::SeekableReadStream *stream) { } if (!_curFrame.surface) { - _curFrame.surface = new Surface(); + _curFrame.surface = new Graphics::Surface(); _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat.bytesPerPixel); } @@ -289,4 +289,4 @@ void CinepakDecoder::decodeVectors(Common::SeekableReadStream *stream, uint16 st } } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/cinepak.h b/video/codecs/cinepak.h index c200c75e8c..8b4c0216a3 100644 --- a/video/codecs/cinepak.h +++ b/video/codecs/cinepak.h @@ -34,7 +34,7 @@ #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { struct CinepakCodebook { byte y[4]; @@ -56,7 +56,7 @@ struct CinepakFrame { uint16 stripCount; CinepakStrip *strips; - Surface *surface; + Graphics::Surface *surface; }; class CinepakDecoder : public Codec { @@ -64,18 +64,18 @@ public: CinepakDecoder(int bitsPerPixel = 24); ~CinepakDecoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return _pixelFormat; } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; } private: CinepakFrame _curFrame; int32 _y; - PixelFormat _pixelFormat; + Graphics::PixelFormat _pixelFormat; void loadCodebook(Common::SeekableReadStream *stream, uint16 strip, byte codebookType, byte chunkID, uint32 chunkSize); void decodeVectors(Common::SeekableReadStream *stream, uint16 strip, byte chunkID, uint32 chunkSize); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/codec.h b/video/codecs/codec.h index 380f087d40..4a33d83138 100644 --- a/video/codecs/codec.h +++ b/video/codecs/codec.h @@ -29,25 +29,25 @@ #include "graphics/surface.h" #include "graphics/pixelformat.h" -namespace Common{ +namespace Common { class SeekableReadStream; } -namespace Graphics { +namespace Video { class Codec { public: Codec() {} virtual ~Codec() {} - virtual const Surface *decodeImage(Common::SeekableReadStream *stream) = 0; - virtual PixelFormat getPixelFormat() const = 0; + virtual const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream) = 0; + virtual Graphics::PixelFormat getPixelFormat() const = 0; virtual bool containsPalette() const { return false; } virtual const byte *getPalette() { return 0; } virtual bool hasDirtyPalette() const { return false; } }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/indeo3.cpp b/video/codecs/indeo3.cpp index 8fa4a2d530..cc87d26e2b 100644 --- a/video/codecs/indeo3.cpp +++ b/video/codecs/indeo3.cpp @@ -42,7 +42,7 @@ #include "video/codecs/indeo3.h" -namespace Graphics { +namespace Video { Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _corrector_type(0) { _iv_frame[0].the_buf = 0; @@ -50,7 +50,7 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _correc _pixelFormat = g_system->getScreenFormat(); - _surface = new Surface; + _surface = new Graphics::Surface; _surface->create(width, height, _pixelFormat.bytesPerPixel); buildModPred(); @@ -66,7 +66,7 @@ Indeo3Decoder::~Indeo3Decoder() { delete[] _corrector_type; } -PixelFormat Indeo3Decoder::getPixelFormat() const { +Graphics::PixelFormat Indeo3Decoder::getPixelFormat() const { return _pixelFormat; } @@ -169,7 +169,7 @@ void Indeo3Decoder::allocFrames() { } } -const Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream *stream) { // Not Indeo 3? Fail if (!isIndeo3(*stream)) return 0; @@ -318,7 +318,7 @@ const Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream *stream) { } byte r = 0, g = 0, b = 0; - YUV2RGB(cY, cU, cV, r, g, b); + Graphics::YUV2RGB(cY, cU, cV, r, g, b); const uint32 color = _pixelFormat.RGBToColor(r, g, b); @@ -3490,6 +3490,6 @@ const uint32 Indeo3Decoder::correctionhighorder[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; -} // End of namespace Graphics +} // End of namespace Video #endif // USE_INDEO3 diff --git a/video/codecs/indeo3.h b/video/codecs/indeo3.h index 1e5d45f742..a9ae480f17 100644 --- a/video/codecs/indeo3.h +++ b/video/codecs/indeo3.h @@ -39,22 +39,22 @@ #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { class Indeo3Decoder : public Codec { public: Indeo3Decoder(uint16 width, uint16 height); ~Indeo3Decoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const; + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const; static bool isIndeo3(Common::SeekableReadStream &stream); private: - Surface *_surface; + Graphics::Surface *_surface; - PixelFormat _pixelFormat; + Graphics::PixelFormat _pixelFormat; static const int _corrector_type_0[24]; static const int _corrector_type_2[8]; @@ -87,7 +87,7 @@ private: const byte *buf2, int min_width_160); }; -} // End of namespace Graphics +} // End of namespace Video #endif // VIDEO_CODECS_INDEO3_H diff --git a/video/codecs/mjpeg.cpp b/video/codecs/mjpeg.cpp index 5f41699e10..d6ec391a84 100644 --- a/video/codecs/mjpeg.cpp +++ b/video/codecs/mjpeg.cpp @@ -28,10 +28,10 @@ #include "video/codecs/mjpeg.h" -namespace Graphics { +namespace Video { JPEGDecoder::JPEGDecoder() : Codec() { - _jpeg = new JPEG(); + _jpeg = new Graphics::JPEG(); _pixelFormat = g_system->getScreenFormat(); _surface = NULL; } @@ -45,14 +45,14 @@ JPEGDecoder::~JPEGDecoder() { } } -const Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream* stream) { +const Graphics::Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream* stream) { if (!_jpeg->read(stream)) { warning("Failed to decode JPEG frame"); return 0; } if (!_surface) { - _surface = new Surface(); + _surface = new Graphics::Surface(); _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat.bytesPerPixel); } @@ -67,4 +67,4 @@ const Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream* stream) { return _surface; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/mjpeg.h b/video/codecs/mjpeg.h index da3719ea84..c9f931f091 100644 --- a/video/codecs/mjpeg.h +++ b/video/codecs/mjpeg.h @@ -32,7 +32,7 @@ #include "graphics/jpeg.h" #include "graphics/pixelformat.h" -namespace Graphics { +namespace Video { // Motion JPEG Decoder // Basically a wrapper around JPEG which converts to RGB and also functions @@ -43,15 +43,15 @@ public: JPEGDecoder(); ~JPEGDecoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return _pixelFormat; } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; } private: - PixelFormat _pixelFormat; - JPEG *_jpeg; - Surface *_surface; + Graphics::PixelFormat _pixelFormat; + Graphics::JPEG *_jpeg; + Graphics::Surface *_surface; }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/msrle.cpp b/video/codecs/msrle.cpp index 556f0ee670..46158c49d7 100644 --- a/video/codecs/msrle.cpp +++ b/video/codecs/msrle.cpp @@ -28,7 +28,7 @@ #include "video/codecs/msrle.h" #include "common/stream.h" -namespace Graphics { +namespace Video { MSRLEDecoder::MSRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) { _surface = new Graphics::Surface(); @@ -41,7 +41,7 @@ MSRLEDecoder::~MSRLEDecoder() { delete _surface; } -const Surface *MSRLEDecoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *MSRLEDecoder::decodeImage(Common::SeekableReadStream *stream) { if (_bitsPerPixel == 8) { decode8(stream); } else @@ -75,7 +75,7 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream *stream) { output = data + (y * width); if (y < 0) { - warning("Next line is beyond picture bounds"); + warning("MS RLE Codec: Next line is beyond picture bounds"); return; } @@ -93,7 +93,7 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream *stream) { x += count; if (y < 0) { - warning("Skip beyond picture bounds"); + warning("MS RLE Codec: Skip beyond picture bounds"); return; } @@ -128,7 +128,7 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream *stream) { } - warning("No end-of-picture code"); + warning("MS RLE Codec: No end-of-picture code"); } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/msrle.h b/video/codecs/msrle.h index e710c25ae8..130bb8c4ef 100644 --- a/video/codecs/msrle.h +++ b/video/codecs/msrle.h @@ -28,24 +28,24 @@ #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { class MSRLEDecoder : public Codec { public: MSRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel); ~MSRLEDecoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } private: byte _bitsPerPixel; - Surface *_surface; + Graphics::Surface *_surface; void decode8(Common::SeekableReadStream *stream); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/msvideo1.cpp b/video/codecs/msvideo1.cpp index 94537e1f9f..2075d7f013 100644 --- a/video/codecs/msvideo1.cpp +++ b/video/codecs/msvideo1.cpp @@ -28,7 +28,7 @@ #include "video/codecs/msvideo1.h" #include "common/stream.h" -namespace Graphics { +namespace Video { #define CHECK_STREAM_PTR(n) \ if ((stream->pos() + n) > stream->size() ) { \ @@ -126,7 +126,7 @@ void MSVideo1Decoder::decode8(Common::SeekableReadStream *stream) { } } -const Surface *MSVideo1Decoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *MSVideo1Decoder::decodeImage(Common::SeekableReadStream *stream) { if (_bitsPerPixel == 8) decode8(stream); else { @@ -137,4 +137,4 @@ const Surface *MSVideo1Decoder::decodeImage(Common::SeekableReadStream *stream) return _surface; } -} // End of namespace JMP +} // End of namespace Video diff --git a/video/codecs/msvideo1.h b/video/codecs/msvideo1.h index 8dadf311fe..c476538a8e 100644 --- a/video/codecs/msvideo1.h +++ b/video/codecs/msvideo1.h @@ -28,25 +28,25 @@ #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { class MSVideo1Decoder : public Codec { public: MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel); ~MSVideo1Decoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } private: byte _bitsPerPixel; - Surface *_surface; + Graphics::Surface *_surface; void decode8(Common::SeekableReadStream *stream); //void decode16(Common::SeekableReadStream *stream); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/qdm2.cpp b/video/codecs/qdm2.cpp index 6721788d8c..eac1954435 100644 --- a/video/codecs/qdm2.cpp +++ b/video/codecs/qdm2.cpp @@ -37,7 +37,7 @@ #include "common/stream.h" #include "common/system.h" -namespace Graphics { +namespace Video { enum { SOFTCLIP_THRESHOLD = 27600, @@ -3282,6 +3282,6 @@ Audio::AudioStream *makeQDM2Stream(Common::SeekableReadStream *stream, Common::S return new QDM2Stream(stream, extraData); } -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/qdm2.h b/video/codecs/qdm2.h index 98e0fa54b6..a6acf3a83e 100644 --- a/video/codecs/qdm2.h +++ b/video/codecs/qdm2.h @@ -37,7 +37,7 @@ namespace Audio { class AudioStream; } -namespace Graphics { +namespace Video { /** * Create a new AudioStream from the QDM2 data in the given stream. @@ -48,7 +48,7 @@ namespace Graphics { */ Audio::AudioStream *makeQDM2Stream(Common::SeekableReadStream *stream, Common::SeekableReadStream *extraData); -} // End of namespace Graphics +} // End of namespace Video #endif // VIDEO_CODECS_QDM2_H #endif // Mohawk/Plugins guard diff --git a/video/codecs/qdm2data.h b/video/codecs/qdm2data.h index 17d3948eb1..e1a690bd2b 100644 --- a/video/codecs/qdm2data.h +++ b/video/codecs/qdm2data.h @@ -28,7 +28,7 @@ #include "common/scummsys.h" -namespace Graphics { +namespace Video { /// VLC TABLES @@ -526,6 +526,6 @@ static const float type34_delta[10] = { // FIXME: covers 8 entries.. 0.138071194291115f,0.333333343267441f,0.60947573184967f,1.0f,0.0f, }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/qtrle.cpp b/video/codecs/qtrle.cpp index 1dcc94e417..26b2f02ce1 100644 --- a/video/codecs/qtrle.cpp +++ b/video/codecs/qtrle.cpp @@ -34,7 +34,7 @@ #include "graphics/colormasks.h" #include "graphics/surface.h" -namespace Graphics { +namespace Video { QTRLEDecoder::QTRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() { _bitsPerPixel = bitsPerPixel; @@ -47,7 +47,7 @@ QTRLEDecoder::QTRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) : Cod debug(2, "QTRLE corrected width: %d", width); - _surface = new Surface(); + _surface = new Graphics::Surface(); _surface->create(width, height, _bitsPerPixel <= 8 ? 1 : _pixelFormat.bytesPerPixel); } @@ -239,7 +239,7 @@ void QTRLEDecoder::decode16(Common::SeekableReadStream *stream, uint32 rowPtr, u while (rleCode--) { // Convert from RGB555 to the format specified by the Overlay byte r = 0, g = 0, b = 0; - colorToRGB<ColorMasks<555> >(rgb16, r, g, b); + Graphics::colorToRGB<Graphics::ColorMasks<555> >(rgb16, r, g, b); rgb[pixelPtr++] = _pixelFormat.RGBToColor(r, g, b); } } else { @@ -252,7 +252,7 @@ void QTRLEDecoder::decode16(Common::SeekableReadStream *stream, uint32 rowPtr, u // Convert from RGB555 to the format specified by the Overlay byte r = 0, g = 0, b = 0; - colorToRGB<ColorMasks<555> >(rgb16, r, g, b); + Graphics::colorToRGB<Graphics::ColorMasks<555> >(rgb16, r, g, b); rgb[pixelPtr++] = _pixelFormat.RGBToColor(r, g, b); } } @@ -354,7 +354,7 @@ void QTRLEDecoder::decode32(Common::SeekableReadStream *stream, uint32 rowPtr, u } } -const Surface *QTRLEDecoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *QTRLEDecoder::decodeImage(Common::SeekableReadStream *stream) { uint16 start_line = 0; uint16 height = _surface->h; @@ -418,4 +418,4 @@ QTRLEDecoder::~QTRLEDecoder() { delete _surface; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/qtrle.h b/video/codecs/qtrle.h index d40404ecb7..20fe2c3242 100644 --- a/video/codecs/qtrle.h +++ b/video/codecs/qtrle.h @@ -29,21 +29,21 @@ #include "graphics/pixelformat.h" #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { class QTRLEDecoder : public Codec { public: QTRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel); ~QTRLEDecoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return _pixelFormat; } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; } private: byte _bitsPerPixel; - Surface *_surface; - PixelFormat _pixelFormat; + Graphics::Surface *_surface; + Graphics::PixelFormat _pixelFormat; void decode1(Common::SeekableReadStream *stream, uint32 rowPtr, uint32 linesToChange); void decode2_4(Common::SeekableReadStream *stream, uint32 rowPtr, uint32 linesToChange, byte bpp); @@ -53,6 +53,6 @@ private: void decode32(Common::SeekableReadStream *stream, uint32 rowPtr, uint32 linesToChange); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp index 95cffb4015..cc9739b673 100644 --- a/video/codecs/rpza.cpp +++ b/video/codecs/rpza.cpp @@ -31,7 +31,7 @@ #include "common/stream.h" #include "graphics/colormasks.h" -namespace Graphics { +namespace Video { RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() { _pixelFormat = g_system->getScreenFormat(); @@ -43,7 +43,7 @@ RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() { debug(2, "RPZA corrected width: %d", width); - _surface = new Surface(); + _surface = new Graphics::Surface(); _surface->create(width, height, _pixelFormat.bytesPerPixel); } @@ -66,7 +66,7 @@ RPZADecoder::~RPZADecoder() { #define PUT_PIXEL(color) \ if ((int32)blockPtr < _surface->w * _surface->h) { \ byte r = 0, g = 0, b = 0; \ - colorToRGB<ColorMasks<555> >(color, r, g, b); \ + Graphics::colorToRGB<Graphics::ColorMasks<555> >(color, r, g, b); \ if (_pixelFormat.bytesPerPixel == 2) \ *((uint16 *)_surface->pixels + blockPtr) = _pixelFormat.RGBToColor(r, g, b); \ else \ @@ -74,7 +74,7 @@ RPZADecoder::~RPZADecoder() { } \ blockPtr++ -const Surface *RPZADecoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *RPZADecoder::decodeImage(Common::SeekableReadStream *stream) { uint16 colorA = 0, colorB = 0; uint16 color4[4]; @@ -211,4 +211,4 @@ const Surface *RPZADecoder::decodeImage(Common::SeekableReadStream *stream) { return _surface; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/rpza.h b/video/codecs/rpza.h index bc82465a1e..c6b1f43a9a 100644 --- a/video/codecs/rpza.h +++ b/video/codecs/rpza.h @@ -29,21 +29,21 @@ #include "graphics/pixelformat.h" #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { class RPZADecoder : public Codec { public: RPZADecoder(uint16 width, uint16 height); ~RPZADecoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return _pixelFormat; } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; } private: - Surface *_surface; - PixelFormat _pixelFormat; + Graphics::Surface *_surface; + Graphics::PixelFormat _pixelFormat; }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/smc.cpp b/video/codecs/smc.cpp index 017fe04ab6..d03c60490f 100644 --- a/video/codecs/smc.cpp +++ b/video/codecs/smc.cpp @@ -28,7 +28,7 @@ #include "video/codecs/smc.h" #include "common/stream.h" -namespace Graphics { +namespace Video { #define GET_BLOCK_COUNT() \ (opcode & 0x10) ? (1 + stream->readByte()) : 1 + (opcode & 0x0F); @@ -388,4 +388,4 @@ const Graphics::Surface *SMCDecoder::decodeImage(Common::SeekableReadStream *str return _surface; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/codecs/smc.h b/video/codecs/smc.h index 35fd76f76b..b2bc612857 100644 --- a/video/codecs/smc.h +++ b/video/codecs/smc.h @@ -28,7 +28,7 @@ #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { enum { CPAIR = 2, @@ -42,11 +42,11 @@ public: SMCDecoder(uint16 width, uint16 height); ~SMCDecoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } private: - Surface *_surface; + Graphics::Surface *_surface; // SMC color tables byte _colorPairs[COLORS_PER_TABLE * CPAIR]; @@ -54,6 +54,6 @@ private: byte _colorOctets[COLORS_PER_TABLE * COCTET]; }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp index e9a790924e..a0456869ab 100644 --- a/video/codecs/truemotion1.cpp +++ b/video/codecs/truemotion1.cpp @@ -33,7 +33,7 @@ #include "video/codecs/truemotion1data.h" #include "common/stream.h" -namespace Graphics { +namespace Video { enum { FLAG_SPRITE = (1 << 5), @@ -88,7 +88,7 @@ struct { }; TrueMotion1Decoder::TrueMotion1Decoder(uint16 width, uint16 height) { - _surface = new Surface(); + _surface = new Graphics::Surface(); _width = width; _height = height; @@ -396,7 +396,7 @@ void TrueMotion1Decoder::decode16() { } } -const Surface *TrueMotion1Decoder::decodeImage(Common::SeekableReadStream *stream) { +const Graphics::Surface *TrueMotion1Decoder::decodeImage(Common::SeekableReadStream *stream) { decodeHeader(stream); if (compressionTypes[_header.compression].algorithm == ALGO_NOP) @@ -413,6 +413,6 @@ const Surface *TrueMotion1Decoder::decodeImage(Common::SeekableReadStream *strea return _surface; } -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/codecs/truemotion1.h b/video/codecs/truemotion1.h index c80598afdc..4a51fcb33a 100644 --- a/video/codecs/truemotion1.h +++ b/video/codecs/truemotion1.h @@ -33,20 +33,20 @@ #include "video/codecs/codec.h" -namespace Graphics { +namespace Video { class TrueMotion1Decoder : public Codec { public: TrueMotion1Decoder(uint16 width, uint16 height); ~TrueMotion1Decoder(); - const Surface *decodeImage(Common::SeekableReadStream *stream); + const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream); // Always return RGB565 - PixelFormat getPixelFormat() const { return Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); } + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); } private: - Surface *_surface; + Graphics::Surface *_surface; int _mbChangeBitsRowSize; byte *_buf, *_mbChangeBits, *_indexStream; @@ -100,7 +100,7 @@ private: void genVectorTable16(const byte *selVectorTable); }; -} // End of namespace Graphics +} // End of namespace Video #endif // VIDEO_CODECS_TRUEMOTION1_H #endif // SCI32/Plugins guard diff --git a/video/codecs/truemotion1data.h b/video/codecs/truemotion1data.h index 8199135a29..06d30c4436 100644 --- a/video/codecs/truemotion1data.h +++ b/video/codecs/truemotion1data.h @@ -31,7 +31,7 @@ #include "common/scummsys.h" -namespace Graphics { +namespace Video { // Y delta tables, skinny and fat static const int16 ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; @@ -827,6 +827,6 @@ static const byte pc_tbl4[] = { static const byte * const tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp index 1cb94498c3..26b12220f2 100644 --- a/video/coktel_decoder.cpp +++ b/video/coktel_decoder.cpp @@ -38,7 +38,7 @@ static const uint32 kVideoCodecIndeo3 = MKID_BE('iv32'); -namespace Graphics { +namespace Video { CoktelDecoder::State::State() : flags(0), speechId(0) { } @@ -107,7 +107,7 @@ void CoktelDecoder::setSurfaceMemory() { _ownSurface = true; } -const Surface *CoktelDecoder::getSurface() const { +const Graphics::Surface *CoktelDecoder::getSurface() const { if (!isVideoLoaded()) return 0; @@ -435,7 +435,7 @@ void CoktelDecoder::deRLE(byte *&destPtr, const byte *&srcPtr, int16 destLen, in } // A whole, completely filled block -void CoktelDecoder::renderBlockWhole(Surface &dstSurf, const byte *src, Common::Rect &rect) { +void CoktelDecoder::renderBlockWhole(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect) { Common::Rect srcRect = rect; rect.clip(dstSurf.w, dstSurf.h); @@ -450,7 +450,7 @@ void CoktelDecoder::renderBlockWhole(Surface &dstSurf, const byte *src, Common:: } // A quarter-wide whole, completely filled block -void CoktelDecoder::renderBlockWhole4X(Surface &dstSurf, const byte *src, Common::Rect &rect) { +void CoktelDecoder::renderBlockWhole4X(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect) { Common::Rect srcRect = rect; rect.clip(dstSurf.w, dstSurf.h); @@ -475,7 +475,7 @@ void CoktelDecoder::renderBlockWhole4X(Surface &dstSurf, const byte *src, Common } // A half-high whole, completely filled block -void CoktelDecoder::renderBlockWhole2Y(Surface &dstSurf, const byte *src, Common::Rect &rect) { +void CoktelDecoder::renderBlockWhole2Y(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect) { Common::Rect srcRect = rect; rect.clip(dstSurf.w, dstSurf.h); @@ -497,7 +497,7 @@ void CoktelDecoder::renderBlockWhole2Y(Surface &dstSurf, const byte *src, Common } // A sparse block -void CoktelDecoder::renderBlockSparse(Surface &dstSurf, const byte *src, Common::Rect &rect) { +void CoktelDecoder::renderBlockSparse(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect) { Common::Rect srcRect = rect; rect.clip(dstSurf.w, dstSurf.h); @@ -532,7 +532,7 @@ void CoktelDecoder::renderBlockSparse(Surface &dstSurf, const byte *src, Common: } // A half-high sparse block -void CoktelDecoder::renderBlockSparse2Y(Surface &dstSurf, const byte *src, Common::Rect &rect) { +void CoktelDecoder::renderBlockSparse2Y(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect) { warning("renderBlockSparse2Y"); Common::Rect srcRect = rect; @@ -569,7 +569,7 @@ void CoktelDecoder::renderBlockSparse2Y(Surface &dstSurf, const byte *src, Commo } } -void CoktelDecoder::renderBlockRLE(Surface &dstSurf, const byte *src, Common::Rect &rect) { +void CoktelDecoder::renderBlockRLE(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect) { Common::Rect srcRect = rect; rect.clip(dstSurf.w, dstSurf.h); @@ -697,7 +697,7 @@ bool PreIMDDecoder::isVideoLoaded() const { return _stream != 0; } -const Surface *PreIMDDecoder::decodeNextFrame() { +const Graphics::Surface *PreIMDDecoder::decodeNextFrame() { if (!isVideoLoaded() || endOfVideo()) return 0; @@ -809,8 +809,8 @@ void PreIMDDecoder::renderFrame() { _dirtyRects.push_back(Common::Rect(_x, _y, _x + _width, _y + _height)); } -PixelFormat PreIMDDecoder::getPixelFormat() const { - return PixelFormat::createFormatCLUT8(); +Graphics::PixelFormat PreIMDDecoder::getPixelFormat() const { + return Graphics::PixelFormat::createFormatCLUT8(); } @@ -1165,7 +1165,7 @@ bool IMDDecoder::isVideoLoaded() const { return _stream != 0; } -const Surface *IMDDecoder::decodeNextFrame() { +const Graphics::Surface *IMDDecoder::decodeNextFrame() { if (!isVideoLoaded() || endOfVideo()) return 0; @@ -1455,8 +1455,8 @@ void IMDDecoder::emptySoundSlice(bool hasNextCmd) { _audioStream->queueBuffer(soundBuf, _soundSliceSize, DisposeAfterUse::YES, 0); } -PixelFormat IMDDecoder::getPixelFormat() const { - return PixelFormat::createFormatCLUT8(); +Graphics::PixelFormat IMDDecoder::getPixelFormat() const { + return Graphics::PixelFormat::createFormatCLUT8(); } @@ -2041,7 +2041,7 @@ bool VMDDecoder::isVideoLoaded() const { return _stream != 0; } -const Surface *VMDDecoder::decodeNextFrame() { +const Graphics::Surface *VMDDecoder::decodeNextFrame() { if (!isVideoLoaded() || endOfVideo()) return 0; @@ -2202,7 +2202,7 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) { return false; Common::MemoryReadStream frameStream(_videoBuffer[0], _videoBufferLen[0]); - const Surface *codecSurf = _codec->decodeImage(&frameStream); + const Graphics::Surface *codecSurf = _codec->decodeImage(&frameStream); if (!codecSurf) return false; @@ -2239,8 +2239,8 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) { dataSize = _videoBufferLen[srcBuffer]; } - Common::Rect *blockRect = &fakeRect; - Surface *surface = &_surface; + Common::Rect *blockRect = &fakeRect; + Graphics::Surface *surface = &_surface; if (_blitMode == 0) { *blockRect = Common::Rect(blockRect->left + _x, blockRect->top + _y, blockRect->right + _x, blockRect->bottom + _y); @@ -2325,14 +2325,14 @@ bool VMDDecoder::getRenderRects(const Common::Rect &rect, return true; } -void VMDDecoder::blit16(const Surface &srcSurf, Common::Rect &rect) { +void VMDDecoder::blit16(const Graphics::Surface &srcSurf, Common::Rect &rect) { rect = Common::Rect(rect.left / 2, rect.top, rect.right / 2, rect.bottom); Common::Rect srcRect = rect; rect.clip(_surface.w, _surface.h); - PixelFormat pixelFormat = getPixelFormat(); + Graphics::PixelFormat pixelFormat = getPixelFormat(); const byte *src = (byte *)srcSurf.pixels + (srcRect.top * srcSurf.pitch) + srcRect.left * _bytesPerPixel; @@ -2363,14 +2363,14 @@ void VMDDecoder::blit16(const Surface &srcSurf, Common::Rect &rect) { } } -void VMDDecoder::blit24(const Surface &srcSurf, Common::Rect &rect) { +void VMDDecoder::blit24(const Graphics::Surface &srcSurf, Common::Rect &rect) { rect = Common::Rect(rect.left / 3, rect.top, rect.right / 3, rect.bottom); Common::Rect srcRect = rect; rect.clip(_surface.w, _surface.h); - PixelFormat pixelFormat = getPixelFormat(); + Graphics::PixelFormat pixelFormat = getPixelFormat(); const byte *src = (byte *)srcSurf.pixels + (srcRect.top * srcSurf.pitch) + srcRect.left * _bytesPerPixel; @@ -2642,7 +2642,7 @@ byte *VMDDecoder::deADPCM(const byte *data, uint32 &size, int32 init, int32 inde return sound; } -PixelFormat VMDDecoder::getPixelFormat() const { +Graphics::PixelFormat VMDDecoder::getPixelFormat() const { if (_externalCodec) { if (_codec) return _codec->getPixelFormat(); @@ -2655,7 +2655,7 @@ PixelFormat VMDDecoder::getPixelFormat() const { if (_blitMode > 0) return g_system->getScreenFormat(); - return PixelFormat::createFormatCLUT8(); + return Graphics::PixelFormat::createFormatCLUT8(); } bool VMDDecoder::getPartCoords(int16 frame, PartType type, int16 &x, int16 &y, int16 &width, int16 &height) { @@ -2752,6 +2752,6 @@ bool VMDDecoder::isPaletted() const { return _isPaletted; } -} // End of namespace Graphics +} // End of namespace Video #endif // VIDEO_COKTELDECODER_H diff --git a/video/coktel_decoder.h b/video/coktel_decoder.h index 1b043d9dd2..0cbd00ea8c 100644 --- a/video/coktel_decoder.h +++ b/video/coktel_decoder.h @@ -45,7 +45,7 @@ namespace Audio { class QueuingAudioStream; } -namespace Graphics { +namespace Video { class Codec; @@ -78,7 +78,7 @@ public: /** Reset the video memory. */ void setSurfaceMemory(); - const Surface *getSurface() const; + const Graphics::Surface *getSurface() const; /** Draw the video starting at this position within the video memory. */ virtual void setXY(uint16 x, uint16 y); @@ -180,7 +180,7 @@ protected: bool _paletteDirty; bool _ownSurface; - Surface _surface; + Graphics::Surface _surface; Common::List<Common::Rect> _dirtyRects; @@ -206,12 +206,12 @@ protected: void deRLE(byte *&destPtr, const byte *&srcPtr, int16 destLen, int16 srcLen); // Block rendering - void renderBlockWhole (Surface &dstSurf, const byte *src, Common::Rect &rect); - void renderBlockWhole4X (Surface &dstSurf, const byte *src, Common::Rect &rect); - void renderBlockWhole2Y (Surface &dstSurf, const byte *src, Common::Rect &rect); - void renderBlockSparse (Surface &dstSurf, const byte *src, Common::Rect &rect); - void renderBlockSparse2Y(Surface &dstSurf, const byte *src, Common::Rect &rect); - void renderBlockRLE (Surface &dstSurf, const byte *src, Common::Rect &rect); + void renderBlockWhole (Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect); + void renderBlockWhole4X (Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect); + void renderBlockWhole2Y (Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect); + void renderBlockSparse (Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect); + void renderBlockSparse2Y(Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect); + void renderBlockRLE (Graphics::Surface &dstSurf, const byte *src, Common::Rect &rect); // Sound helper functions inline void unsignedToSigned(byte *buffer, int length); @@ -238,9 +238,9 @@ public: bool isVideoLoaded() const; - const Surface *decodeNextFrame(); + const Graphics::Surface *decodeNextFrame(); - PixelFormat getPixelFormat() const; + Graphics::PixelFormat getPixelFormat() const; private: Common::SeekableReadStream *_stream; @@ -271,9 +271,9 @@ public: bool isVideoLoaded() const; - const Surface *decodeNextFrame(); + const Graphics::Surface *decodeNextFrame(); - PixelFormat getPixelFormat() const; + Graphics::PixelFormat getPixelFormat() const; private: enum Command { @@ -375,9 +375,9 @@ public: bool isVideoLoaded() const; - const Surface *decodeNextFrame(); + const Graphics::Surface *decodeNextFrame(); - PixelFormat getPixelFormat() const; + Graphics::PixelFormat getPixelFormat() const; private: enum PartType { @@ -467,7 +467,7 @@ private: byte *_videoBuffer[3]; ///< Video buffers. uint32 _videoBufferLen[3]; ///< Size of the video buffers filled. - Surface _8bppSurface[3]; ///< Fake 8bpp surfaces over the video buffers. + Graphics::Surface _8bppSurface[3]; ///< Fake 8bpp surfaces over the video buffers. bool _externalCodec; Codec *_codec; @@ -490,8 +490,8 @@ private: bool renderFrame(Common::Rect &rect); bool getRenderRects(const Common::Rect &rect, Common::Rect &realRect, Common::Rect &fakeRect); - void blit16(const Surface &srcSurf, Common::Rect &rect); - void blit24(const Surface &srcSurf, Common::Rect &rect); + void blit16(const Graphics::Surface &srcSurf, Common::Rect &rect); + void blit24(const Graphics::Surface &srcSurf, Common::Rect &rect); // Sound void emptySoundSlice (uint32 size); @@ -513,7 +513,7 @@ private: bool getPartCoords(int16 frame, PartType type, int16 &x, int16 &y, int16 &width, int16 &height); }; -} // End of namespace Graphics +} // End of namespace Video #endif // VIDEO_COKTELDECODER_H diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp index 7e468371d0..bf476def44 100644 --- a/video/dxa_decoder.cpp +++ b/video/dxa_decoder.cpp @@ -36,7 +36,7 @@ #include "common/zlib.h" #endif -namespace Graphics { +namespace Video { DXADecoder::DXADecoder() { _fileStream = 0; @@ -477,7 +477,7 @@ void DXADecoder::decode13(int size) { #endif } -const Surface *DXADecoder::decodeNextFrame() { +const Graphics::Surface *DXADecoder::decodeNextFrame() { uint32 tag = _fileStream->readUint32BE(); if (tag == MKID_BE('CMAP')) { _fileStream->read(_palette, 256 * 3); @@ -559,4 +559,4 @@ const Surface *DXADecoder::decodeNextFrame() { return _surface; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/dxa_decoder.h b/video/dxa_decoder.h index e2fa97a7db..e480298a90 100644 --- a/video/dxa_decoder.h +++ b/video/dxa_decoder.h @@ -28,7 +28,7 @@ #include "video/video_decoder.h" -namespace Graphics { +namespace Video { /** * Decoder for DXA videos. @@ -50,8 +50,8 @@ public: uint16 getWidth() const { return _width; } uint16 getHeight() const { return _height; } uint32 getFrameCount() const { return _frameCount; } - const Surface *decodeNextFrame(); - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + const Graphics::Surface *decodeNextFrame(); + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } @@ -96,6 +96,6 @@ private: uint32 _frameCount; }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp index 34b667234a..347eae4034 100644 --- a/video/flic_decoder.cpp +++ b/video/flic_decoder.cpp @@ -29,7 +29,7 @@ #include "common/endian.h" #include "common/system.h" -namespace Graphics { +namespace Video { FlicDecoder::FlicDecoder() { _paletteChanged = false; @@ -194,7 +194,7 @@ void FlicDecoder::decodeDeltaFLC(uint8 *data) { #define PSTAMP 18 #define FRAME_TYPE 0xF1FA -const Surface *FlicDecoder::decodeNextFrame() { +const Graphics::Surface *FlicDecoder::decodeNextFrame() { // Read chunk uint32 frameSize = _fileStream->readUint32LE(); uint16 frameType = _fileStream->readUint16LE(); @@ -320,4 +320,4 @@ void FlicDecoder::copyDirtyRectsToBuffer(uint8 *dst, uint pitch) { _dirtyRects.clear(); } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/flic_decoder.h b/video/flic_decoder.h index 37068c2fb3..7736cdf604 100644 --- a/video/flic_decoder.h +++ b/video/flic_decoder.h @@ -34,7 +34,7 @@ namespace Common { class SeekableReadStream; } -namespace Graphics { +namespace Video { /** * Decoder for FLIC videos. @@ -59,13 +59,13 @@ public: * @note the return surface should *not* be freed * @note this may return 0, in which case the last frame should be kept on screen */ - const Surface *decodeNextFrame(); + const Graphics::Surface *decodeNextFrame(); bool isVideoLoaded() const { return _fileStream != 0; } uint16 getWidth() const { return _surface->w; } uint16 getHeight() const { return _surface->h; } uint32 getFrameCount() const { return _frameCount; } - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } const Common::List<Common::Rect> *getDirtyRects() const { return &_dirtyRects; } void clearDirtyRects() { _dirtyRects.clear(); } @@ -89,13 +89,13 @@ private: void unpackPalette(uint8 *mem); Common::SeekableReadStream *_fileStream; - Surface *_surface; + Graphics::Surface *_surface; uint32 _frameCount; Common::Rational _frameRate; Common::List<Common::Rect> _dirtyRects; }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/mpeg_player.cpp b/video/mpeg_player.cpp index 74f097500d..f583853183 100644 --- a/video/mpeg_player.cpp +++ b/video/mpeg_player.cpp @@ -91,7 +91,7 @@ #include "common/system.h" #include "common/util.h" -namespace Graphics { +namespace Video { BaseAnimationState::BaseAnimationState(OSystem *sys, int width, int height) : _movieWidth(width), _movieHeight(height), _frameWidth(width), _frameHeight(height), _sys(sys) { @@ -622,4 +622,4 @@ void BaseAnimationState::updateScreen() { _sys->updateScreen(); } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/mpeg_player.h b/video/mpeg_player.h index d6890f78b6..44baff9c2b 100644 --- a/video/mpeg_player.h +++ b/video/mpeg_player.h @@ -86,7 +86,7 @@ namespace Common { class OSystem; -namespace Graphics { +namespace Video { class BaseAnimationState { protected: @@ -167,6 +167,6 @@ protected: #endif }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 77752cc47f..49cab3527e 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -53,7 +53,7 @@ #include "video/codecs/smc.h" #include "video/codecs/cdtoons.h" -namespace Graphics { +namespace Video { //////////////////////////////////////////// // QuickTimeDecoder @@ -135,11 +135,11 @@ uint32 QuickTimeDecoder::getFrameDuration() { return 0; } -PixelFormat QuickTimeDecoder::getPixelFormat() const { +Graphics::PixelFormat QuickTimeDecoder::getPixelFormat() const { Codec *codec = findDefaultVideoCodec(); if (!codec) - return PixelFormat::createFormatCLUT8(); + return Graphics::PixelFormat::createFormatCLUT8(); return codec->getPixelFormat(); } @@ -177,7 +177,7 @@ void QuickTimeDecoder::seekToFrame(uint32 frame) { } // Adjust the video starting point - _startTime = g_system->getMillis() - Graphics::VideoTimestamp(_nextFrameStartTime, _streams[_videoStreamIndex]->time_scale).getUnitsInScale(1000); + _startTime = g_system->getMillis() - Video::VideoTimestamp(_nextFrameStartTime, _streams[_videoStreamIndex]->time_scale).getUnitsInScale(1000); resetPauseStartTime(); // Adjust the audio starting point @@ -196,7 +196,7 @@ void QuickTimeDecoder::seekToFrame(uint32 frame) { for (int32 j = 0; j < _streams[_audioStreamIndex]->stts_data[i].count; j++) { curTime += _streams[_audioStreamIndex]->stts_data[i].duration; - if (curTime > Graphics::VideoTimestamp(_nextFrameStartTime, _streams[_videoStreamIndex]->time_scale).getUnitsInScale(_streams[_audioStreamIndex]->time_scale)) { + if (curTime > Video::VideoTimestamp(_nextFrameStartTime, _streams[_videoStreamIndex]->time_scale).getUnitsInScale(_streams[_audioStreamIndex]->time_scale)) { done = true; break; } @@ -326,7 +326,7 @@ Codec *QuickTimeDecoder::findDefaultVideoCodec() const { return _streams[_videoStreamIndex]->stsdEntries[0].videoCodec; } -const Surface *QuickTimeDecoder::decodeNextFrame() { +const Graphics::Surface *QuickTimeDecoder::decodeNextFrame() { if (_videoStreamIndex < 0 || _curFrame >= (int32)getFrameCount() - 1) return 0; @@ -352,7 +352,7 @@ const Surface *QuickTimeDecoder::decodeNextFrame() { if (!entry->videoCodec) return 0; - const Surface *frame = entry->videoCodec->decodeImage(frameData); + const Graphics::Surface *frame = entry->videoCodec->decodeImage(frameData); delete frameData; // Update the palette @@ -375,7 +375,7 @@ const Surface *QuickTimeDecoder::decodeNextFrame() { return scaleSurface(frame); } -const Surface *QuickTimeDecoder::scaleSurface(const Surface *frame) { +const Graphics::Surface *QuickTimeDecoder::scaleSurface(const Graphics::Surface *frame) { if (getScaleFactorX() == 1 && getScaleFactorY() == 1) return frame; @@ -527,7 +527,7 @@ void QuickTimeDecoder::init() { if (getScaleFactorX() != 1 || getScaleFactorY() != 1) { // We have to initialize the scaled surface - _scaledSurface = new Surface(); + _scaledSurface = new Graphics::Surface(); _scaledSurface->create(getWidth(), getHeight(), getPixelFormat().bytesPerPixel); } } @@ -1485,4 +1485,4 @@ QuickTimeDecoder::MOVStreamContext::~MOVStreamContext() { delete extradata; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/qt_decoder.h b/video/qt_decoder.h index ed6634e38c..ef701b3756 100644 --- a/video/qt_decoder.h +++ b/video/qt_decoder.h @@ -49,7 +49,7 @@ namespace Common { class MacResManager; } -namespace Graphics { +namespace Video { /** * Decoder for QuickTime videos. @@ -113,11 +113,11 @@ public: void setChunkBeginOffset(uint32 offset) { _beginOffset = offset; } bool isVideoLoaded() const { return _fd != 0; } - const Surface *decodeNextFrame(); + const Graphics::Surface *decodeNextFrame(); bool endOfVideo() const; uint32 getElapsedTime() const; uint32 getTimeToNextFrame() const; - PixelFormat getPixelFormat() const; + Graphics::PixelFormat getPixelFormat() const; // SeekableVideoDecoder API void seekToFrame(uint32 frame); @@ -247,8 +247,8 @@ private: int8 _videoStreamIndex; uint32 findKeyFrame(uint32 frame) const; - Surface *_scaledSurface; - const Surface *scaleSurface(const Surface *frame); + Graphics::Surface *_scaledSurface; + const Graphics::Surface *scaleSurface(const Graphics::Surface *frame); Common::Rational getScaleFactorX() const; Common::Rational getScaleFactorY() const; @@ -273,6 +273,6 @@ private: int readWAVE(MOVatom atom); }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp index 8052df61fc..454bc6dde5 100644 --- a/video/smk_decoder.cpp +++ b/video/smk_decoder.cpp @@ -39,7 +39,7 @@ #include "sound/mixer.h" #include "sound/decoders/raw.h" -namespace Graphics { +namespace Video { enum SmkBlockTypes { SMK_BLOCK_MONO = 0, @@ -519,7 +519,7 @@ void SmackerDecoder::close() { reset(); } -const Surface *SmackerDecoder::decodeNextFrame() { +const Graphics::Surface *SmackerDecoder::decodeNextFrame() { uint i; uint32 chunkSize = 0; uint32 dataSizeUnpacked = 0; @@ -899,4 +899,4 @@ void SmackerDecoder::unpackPalette() { free(chunk); } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/smk_decoder.h b/video/smk_decoder.h index cb73810df9..3476dbe534 100644 --- a/video/smk_decoder.h +++ b/video/smk_decoder.h @@ -33,7 +33,7 @@ namespace Audio { class QueuingAudioStream; } -namespace Graphics { +namespace Video { class BigHuffmanTree; @@ -66,8 +66,8 @@ public: uint16 getHeight() const { return _surface->h; } uint32 getFrameCount() const { return _frameCount; } uint32 getElapsedTime() const; - const Surface *decodeNextFrame(); - PixelFormat getPixelFormat() const { return PixelFormat::createFormatCLUT8(); } + const Graphics::Surface *decodeNextFrame(); + Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } virtual void handleAudioTrack(byte track, uint32 chunkSize, uint32 unpackedSize); @@ -124,7 +124,7 @@ protected: Common::Rational _frameRate; uint32 _frameCount; - Surface *_surface; + Graphics::Surface *_surface; Audio::Mixer::SoundType _soundType; Audio::Mixer *_mixer; @@ -138,6 +138,6 @@ protected: BigHuffmanTree *_TypeTree; }; -} // End of namespace Graphics +} // End of namespace Video #endif diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 94e31b6323..739f1d3b93 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -28,7 +28,7 @@ #include "common/file.h" #include "common/system.h" -namespace Graphics { +namespace Video { VideoDecoder::VideoDecoder() { reset(); @@ -138,4 +138,4 @@ uint VideoTimestamp::getUnitsInScale(uint scale) const { return (_scale == scale) ? _units : _units * scale / _scale; } -} // End of namespace Graphics +} // End of namespace Video diff --git a/video/video_decoder.h b/video/video_decoder.h index 5d07753809..aa88dda4a4 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -37,7 +37,7 @@ namespace Common { class SeekableReadStream; } -namespace Graphics { +namespace Video { /** * Implementation of a generic video decoder @@ -109,12 +109,12 @@ public: * @note the return surface should *not* be freed * @note this may return 0, in which case the last frame should be kept on screen */ - virtual const Surface *decodeNextFrame() = 0; + virtual const Graphics::Surface *decodeNextFrame() = 0; /** * Get the pixel format of the video */ - virtual PixelFormat getPixelFormat() const = 0; + virtual Graphics::PixelFormat getPixelFormat() const = 0; /** * Get the palette for the video in RGB format (if 8bpp or less) @@ -285,6 +285,6 @@ public: virtual void rewind() { seekToTime(0); } }; -} // End of namespace Graphics +} // End of namespace Video #endif |