aboutsummaryrefslogtreecommitdiff
path: root/video/avi_decoder.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-11 19:39:53 -0400
committerPaul Gilbert2016-07-17 13:08:31 -0400
commitfa6e12aaab4e19424481fc26eab281663cbf3283 (patch)
treeeabc58a771af32e6c87b41e96831bdeb86d8cc37 /video/avi_decoder.h
parent207e1cbb296c8f825d19167d420bbf141398ac1d (diff)
downloadscummvm-rg350-fa6e12aaab4e19424481fc26eab281663cbf3283.tar.gz
scummvm-rg350-fa6e12aaab4e19424481fc26eab281663cbf3283.tar.bz2
scummvm-rg350-fa6e12aaab4e19424481fc26eab281663cbf3283.zip
VIDEO: Add support for a track filtering callback function
This is needed for Starship Titanic, where videos can have a secondary video track. It was simpler to use the callback as a means to select one video track each across two decoders than trying to make VideoDecoder and/or AVIDecoder support decoding from multiple video tracks simultaneously
Diffstat (limited to 'video/avi_decoder.h')
-rw-r--r--video/avi_decoder.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 96d9e821ff..04e6a1847e 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -61,8 +61,10 @@ namespace Video {
*/
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);
@@ -268,6 +270,10 @@ protected:
Audio::Mixer::SoundType _soundType;
Common::Rational _frameRateOverride;
+
+ int _videoTrackCounter, _audioTrackCounter;
+ SelectTrackFn _selectTrackFn;
+
void initCommon();
bool parseNextChunk();