aboutsummaryrefslogtreecommitdiff
path: root/graphics/video
diff options
context:
space:
mode:
authorMax Horn2009-03-09 03:45:23 +0000
committerMax Horn2009-03-09 03:45:23 +0000
commite080a593378bcaf44a7b44c297dcb291a2b584a8 (patch)
tree6a565b0e712d7f6a8b2d8151d9701d17d9922f63 /graphics/video
parent93240b003adb08d83703b03e192bd5905aa61884 (diff)
downloadscummvm-rg350-e080a593378bcaf44a7b44c297dcb291a2b584a8.tar.gz
scummvm-rg350-e080a593378bcaf44a7b44c297dcb291a2b584a8.tar.bz2
scummvm-rg350-e080a593378bcaf44a7b44c297dcb291a2b584a8.zip
Renamed SMKPlayer -> SmackerDecoder and DXAPlayer -> DXADecoder, as well as some other tweaks
svn-id: r39255
Diffstat (limited to 'graphics/video')
-rw-r--r--graphics/video/dxa_player.cpp18
-rw-r--r--graphics/video/dxa_player.h6
-rw-r--r--graphics/video/flic_player.h2
-rw-r--r--graphics/video/smk_player.cpp18
-rw-r--r--graphics/video/smk_player.h6
-rw-r--r--graphics/video/video_player.cpp6
-rw-r--r--graphics/video/video_player.h6
7 files changed, 32 insertions, 30 deletions
diff --git a/graphics/video/dxa_player.cpp b/graphics/video/dxa_player.cpp
index d91e902408..d297e58727 100644
--- a/graphics/video/dxa_player.cpp
+++ b/graphics/video/dxa_player.cpp
@@ -37,7 +37,7 @@
namespace Graphics {
-DXAPlayer::DXAPlayer() {
+DXADecoder::DXADecoder() {
_fileStream = 0;
_frameBuffer1 = 0;
@@ -63,11 +63,11 @@ DXAPlayer::DXAPlayer() {
_scaleMode = S_NONE;
}
-DXAPlayer::~DXAPlayer() {
+DXADecoder::~DXADecoder() {
closeFile();
}
-bool DXAPlayer::loadFile(const char *fileName) {
+bool DXADecoder::loadFile(const char *fileName) {
uint32 tag;
int32 frameRate;
@@ -118,7 +118,7 @@ bool DXAPlayer::loadFile(const char *fileName) {
_frameBuffer2 = (uint8 *)malloc(_frameSize);
memset(_frameBuffer2, 0, _frameSize);
if (!_frameBuffer1 || !_frameBuffer2)
- error("DXAPlayer: Error allocating frame buffers (size %u)", _frameSize);
+ error("DXADecoder: Error allocating frame buffers (size %u)", _frameSize);
_scaledBuffer = 0;
if (_scaleMode != S_NONE) {
@@ -160,7 +160,7 @@ bool DXAPlayer::loadFile(const char *fileName) {
return true;
}
-void DXAPlayer::closeFile() {
+void DXADecoder::closeFile() {
if (!_fileStream)
return;
@@ -177,7 +177,7 @@ void DXAPlayer::closeFile() {
_decompBuffer = 0;
}
-void DXAPlayer::decodeZlib(byte *data, int size, int totalSize) {
+void DXADecoder::decodeZlib(byte *data, int size, int totalSize) {
#ifdef USE_ZLIB
unsigned long dstLen = totalSize;
Common::uncompress(data, &dstLen, _inBuffer, size);
@@ -187,7 +187,7 @@ void DXAPlayer::decodeZlib(byte *data, int size, int totalSize) {
#define BLOCKW 4
#define BLOCKH 4
-void DXAPlayer::decode12(int size) {
+void DXADecoder::decode12(int size) {
#ifdef USE_ZLIB
if (_decompBuffer == NULL) {
_decompBuffer = (byte *)malloc(_decompBufferSize);
@@ -287,7 +287,7 @@ void DXAPlayer::decode12(int size) {
#endif
}
-void DXAPlayer::decode13(int size) {
+void DXADecoder::decode13(int size) {
#ifdef USE_ZLIB
uint8 *codeBuf, *dataBuf, *motBuf, *maskBuf;
@@ -475,7 +475,7 @@ void DXAPlayer::decode13(int size) {
#endif
}
-bool DXAPlayer::decodeNextFrame() {
+bool DXADecoder::decodeNextFrame() {
uint32 tag;
if (_videoInfo.currentFrame == 0)
diff --git a/graphics/video/dxa_player.h b/graphics/video/dxa_player.h
index 35ce86f181..15fb4aa168 100644
--- a/graphics/video/dxa_player.h
+++ b/graphics/video/dxa_player.h
@@ -37,10 +37,10 @@
namespace Graphics {
-class DXAPlayer : public VideoDecoder {
+class DXADecoder : public VideoDecoder {
public:
- DXAPlayer();
- virtual ~DXAPlayer();
+ DXADecoder();
+ virtual ~DXADecoder();
/**
* Load a DXA encoded video file
diff --git a/graphics/video/flic_player.h b/graphics/video/flic_player.h
index f2a60811c9..de65e0c47b 100644
--- a/graphics/video/flic_player.h
+++ b/graphics/video/flic_player.h
@@ -55,6 +55,8 @@ struct FrameTypeChunkHeader {
uint16 heightOverride;
};
+// TOD: rewrite this based on VideoDecoder & VideoPlayer (this may
+// require improvements to these two classes).
class FlicPlayer {
public:
FlicPlayer();
diff --git a/graphics/video/smk_player.cpp b/graphics/video/smk_player.cpp
index 909401a3a1..16d5c9f73d 100644
--- a/graphics/video/smk_player.cpp
+++ b/graphics/video/smk_player.cpp
@@ -316,21 +316,21 @@ uint32 BigHuffmanTree::getCode(BitStream &bs) {
return v;
}
-SMKPlayer::SMKPlayer(Audio::Mixer *mixer)
+SmackerDecoder::SmackerDecoder(Audio::Mixer *mixer)
: _audioStarted(false), _audioStream(0), _mixer(mixer) {
}
-SMKPlayer::~SMKPlayer() {
+SmackerDecoder::~SmackerDecoder() {
closeFile();
}
-int SMKPlayer::getHeight() {
+int SmackerDecoder::getHeight() {
if (!_fileStream)
return 0;
return (_header.flags ? 2 : 1) * _videoInfo.height;
}
-int32 SMKPlayer::getAudioLag() {
+int32 SmackerDecoder::getAudioLag() {
if (!_fileStream)
return 0;
@@ -351,7 +351,7 @@ int32 SMKPlayer::getAudioLag() {
return videoTime - audioTime;
}
-bool SMKPlayer::loadFile(const char *fileName) {
+bool SmackerDecoder::loadFile(const char *fileName) {
int32 frameRate;
closeFile();
@@ -476,7 +476,7 @@ bool SMKPlayer::loadFile(const char *fileName) {
return true;
}
-void SMKPlayer::closeFile() {
+void SmackerDecoder::closeFile() {
if (!_fileStream)
return;
@@ -500,7 +500,7 @@ void SMKPlayer::closeFile() {
free(_palette);
}
-bool SMKPlayer::decodeNextFrame() {
+bool SmackerDecoder::decodeNextFrame() {
uint i;
uint32 chunkSize = 0;
uint32 dataSizeUnpacked = 0;
@@ -722,7 +722,7 @@ bool SMKPlayer::decodeNextFrame() {
return ++_videoInfo.currentFrame < _videoInfo.frameCount;
}
-void SMKPlayer::queueCompressedBuffer(byte *buffer, uint32 bufferSize,
+void SmackerDecoder::queueCompressedBuffer(byte *buffer, uint32 bufferSize,
uint32 unpackedSize, int streamNum) {
BitStream audioBS(buffer, bufferSize);
@@ -802,7 +802,7 @@ void SMKPlayer::queueCompressedBuffer(byte *buffer, uint32 bufferSize,
// unpackedBuffer will be deleted by AppendableAudioStream
}
-void SMKPlayer::unpackPalette() {
+void SmackerDecoder::unpackPalette() {
uint startPos = _fileStream->pos();
uint32 len = 4 * _fileStream->readByte();
diff --git a/graphics/video/smk_player.h b/graphics/video/smk_player.h
index d4c6050a5d..aa2ee305fc 100644
--- a/graphics/video/smk_player.h
+++ b/graphics/video/smk_player.h
@@ -53,10 +53,10 @@ class BigHuffmanTree;
/**
* Implementation of a Smacker v2/v4 video decoder
*/
-class SMKPlayer : public Graphics::VideoDecoder {
+class SmackerDecoder : public Graphics::VideoDecoder {
public:
- SMKPlayer(Audio::Mixer *mixer);
- virtual ~SMKPlayer();
+ SmackerDecoder(Audio::Mixer *mixer);
+ virtual ~SmackerDecoder();
int getHeight();
int32 getAudioLag();
diff --git a/graphics/video/video_player.cpp b/graphics/video/video_player.cpp
index 817a9117dc..81c025d22f 100644
--- a/graphics/video/video_player.cpp
+++ b/graphics/video/video_player.cpp
@@ -157,7 +157,7 @@ void VideoDecoder::setPalette(byte *pal) {
* VideoPlayer
*/
-void VideoPlayer::processVideoEvents(Common::List<Common::Event> *stopEvents) {
+void VideoPlayer::processVideoEvents(Common::List<Common::Event> &stopEvents) {
Common::Event curEvent;
Common::EventManager *eventMan = g_system->getEventManager();
@@ -167,7 +167,7 @@ void VideoPlayer::processVideoEvents(Common::List<Common::Event> *stopEvents) {
_skipVideo = true;
}
- for (Common::List<Common::Event>::const_iterator iter = stopEvents->begin(); iter != stopEvents->end(); iter++) {
+ for (Common::List<Common::Event>::const_iterator iter = stopEvents.begin(); iter != stopEvents.end(); iter++) {
if (curEvent.type == iter->type) {
if (iter->type == Common::EVENT_KEYDOWN || iter->type == Common::EVENT_KEYUP) {
if (curEvent.kbd.keycode == iter->kbd.keycode) {
@@ -183,7 +183,7 @@ void VideoPlayer::processVideoEvents(Common::List<Common::Event> *stopEvents) {
}
}
-bool VideoPlayer::playVideo(Common::List<Common::Event> *stopEvents) {
+bool VideoPlayer::playVideo(Common::List<Common::Event> &stopEvents) {
_skipVideo = false;
debug(0, "Playing video");
diff --git a/graphics/video/video_player.h b/graphics/video/video_player.h
index 2fe90210cd..2ffce6f9a9 100644
--- a/graphics/video/video_player.h
+++ b/graphics/video/video_player.h
@@ -103,7 +103,7 @@ public:
/**
* Close a video file
*/
- virtual void closeFile()=0;
+ virtual void closeFile() = 0;
/**
* Returns if a video file is loaded or not
@@ -178,7 +178,7 @@ public:
*
* Returns true if the video was played to the end, false if skipped
*/
- bool playVideo(Common::List<Common::Event> *stopEvents);
+ bool playVideo(Common::List<Common::Event> &stopEvents);
protected:
/**
@@ -190,7 +190,7 @@ protected:
bool _skipVideo;
VideoDecoder* _decoder;
- void processVideoEvents(Common::List<Common::Event> *stopEvents);
+ void processVideoEvents(Common::List<Common::Event> &stopEvents);
};
} // End of namespace Graphics