aboutsummaryrefslogtreecommitdiff
path: root/video/avi_decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'video/avi_decoder.h')
-rw-r--r--video/avi_decoder.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 96d9e821ff..a3733b579c 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -57,12 +57,15 @@ namespace Video {
* - sci
* - sword1
* - sword2
+ * - titanic
* - zvision
*/
class AVIDecoder : public VideoDecoder {
public:
- AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
- AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
+ typedef bool(*SelectTrackFn)(bool isVideo, int trackNumber);
+ AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType, SelectTrackFn trackFn = nullptr);
+ AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType,
+ SelectTrackFn trackFn = nullptr);
virtual ~AVIDecoder();
bool loadStream(Common::SeekableReadStream *stream);
@@ -81,6 +84,16 @@ protected:
bool supportsAudioTrackSwitching() const { return true; }
AudioTrack *getAudioTrack(int index);
+ /**
+ * Define a track to be used by this class.
+ *
+ * The pointer is then owned by this base class.
+ *
+ * @param track The track to add
+ * @param isExternal Is this an external track not found by loadStream()?
+ */
+ void addTrack(Track *track, bool isExternal = false);
+
struct BitmapInfoHeader {
uint32 size;
uint32 width;
@@ -164,6 +177,7 @@ protected:
uint32 quality;
uint32 sampleSize;
Common::Rect frame;
+ Common::String name;
};
class AVIVideoTrack : public FixedRateVideoTrack {
@@ -179,6 +193,7 @@ protected:
Graphics::PixelFormat getPixelFormat() const;
int getCurFrame() const { return _curFrame; }
int getFrameCount() const { return _frameCount; }
+ Common::String &getName() { return _vidsHeader.name; }
const Graphics::Surface *decodeNextFrame() { return _lastFrame; }
const byte *getPalette() const;
@@ -222,6 +237,7 @@ protected:
void skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime);
virtual void resetStream();
uint32 getCurChunk() const { return _curChunk; }
+ Common::String &getName() { return _audsHeader.name; }
void setCurChunk(uint32 chunk) { _curChunk = chunk; }
bool isRewindable() const { return true; }
@@ -268,12 +284,18 @@ protected:
Audio::Mixer::SoundType _soundType;
Common::Rational _frameRateOverride;
+
+ int _videoTrackCounter, _audioTrackCounter;
+ Track *_lastAddedTrack;
+ SelectTrackFn _selectTrackFn;
+
void initCommon();
bool parseNextChunk();
void skipChunk(uint32 size);
void handleList(uint32 listSize);
void handleStreamHeader(uint32 size);
+ void readStreamName(uint32 size);
uint16 getStreamType(uint32 tag) const { return tag & 0xFFFF; }
byte getStreamIndex(uint32 tag) const;
void checkTruemotion1();