diff options
Diffstat (limited to 'video/avi_decoder.h')
-rw-r--r-- | video/avi_decoder.h | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/video/avi_decoder.h b/video/avi_decoder.h index 80c11b1e09..4461e537c5 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -43,9 +43,11 @@ namespace Graphics { struct PixelFormat; } -namespace Video { - +namespace Image { class Codec; +} + +namespace Video { /** * Decoder for AVI videos. @@ -54,6 +56,7 @@ class Codec; * - sci * - sword1 * - sword2 + * - zvision */ class AVIDecoder : public VideoDecoder { public: @@ -71,8 +74,11 @@ public: bool isSeekable() const; protected: - void readNextPacket(); - bool seekIntern(const Audio::Timestamp &time); + // VideoDecoder API + void readNextPacket(); + bool seekIntern(const Audio::Timestamp &time); + bool supportsAudioTrackSwitching() const { return true; } + AudioTrack *getAudioTrack(int index); struct BitmapInfoHeader { uint32 size; @@ -165,6 +171,7 @@ protected: ~AVIVideoTrack(); void decodeFrame(Common::SeekableReadStream *stream); + void forceTrackEnd(); uint16 getWidth() const { return _bmInfo.width; } uint16 getHeight() const { return _bmInfo.height; } @@ -178,6 +185,9 @@ protected: void loadPaletteFromChunk(Common::SeekableReadStream *chunk); void useInitialPalette(); + bool isTruemotion1() const; + void forceDimensions(uint16 width, uint16 height); + bool isRewindable() const { return true; } bool rewind(); @@ -192,9 +202,9 @@ protected: mutable bool _dirtyPalette; int _frameCount, _curFrame; - Codec *_videoCodec; + Image::Codec *_videoCodec; const Graphics::Surface *_lastFrame; - Codec *createCodec(); + Image::Codec *createCodec(); }; class AVIAudioTrack : public AudioTrack { @@ -219,6 +229,7 @@ protected: kWaveFormatPCM = 1, kWaveFormatMSADPCM = 2, kWaveFormatMSIMAADPCM = 17, + kWaveFormatMP3 = 85, kWaveFormatDK3 = 98 // rogue format number }; @@ -229,13 +240,15 @@ protected: Audio::QueuingAudioStream *createAudioStream(); }; - Common::Array<OldIndex> _indexEntries; AVIHeader _header; + void readOldIndex(uint32 size); + Common::Array<OldIndex> _indexEntries; + Common::SeekableReadStream *_fileStream; bool _decodedHeader; bool _foundMovieList; - uint32 _movieListStart; + uint32 _movieListStart, _movieListEnd; Audio::Mixer::SoundType _soundType; Common::Rational _frameRateOverride; @@ -247,6 +260,8 @@ protected: void handleStreamHeader(uint32 size); uint16 getStreamType(uint32 tag) const { return tag & 0xFFFF; } byte getStreamIndex(uint32 tag) const; + void forceVideoEnd(); + void checkTruemotion1(); public: virtual AVIAudioTrack *createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo); |