22 #ifndef VIDEO_AVI_DECODER_H 23 #define VIDEO_AVI_DECODER_H 25 #include "common/array.h" 26 #include "common/rational.h" 27 #include "common/rect.h" 28 #include "common/str.h" 30 #include "video/video_decoder.h" 31 #include "audio/mixer.h" 35 class PacketizedAudioStream;
39 class SeekableReadStream;
72 uint16
getWidth()
const {
return _header.width; }
77 bool isSeekable()
const;
102 void readNextPacket();
115 void addTrack(
Track *track,
bool isExternal =
false);
125 uint32 xPelsPerMeter;
126 uint32 yPelsPerMeter;
134 uint32 samplesPerSec;
135 uint32 avgBytesPerSec;
144 uint16 bitsPerSample;
162 uint32 microSecondsPerFrame;
163 uint32 maxBytesPerSecond;
167 uint32 initialFrames;
176 AVIF_HASINDEX = 0x00000010,
177 AVIF_MUSTUSEINDEX = 0x00000020,
178 AVIF_ISINTERLEAVED = 0x00000100,
179 AVIF_TRUSTCKTYPE = 0x00000800,
180 AVIF_WASCAPTUREFILE = 0x00010000,
181 AVIF_WASCOPYRIGHTED = 0x00020000
187 uint32 streamHandler;
191 uint32 initialFrames;
209 void forceTrackEnd();
213 uint16 getBitCount()
const {
return _bmInfo.bitCount; }
216 void setCodecAccuracy(Image::CodecAccuracy accuracy);
222 const byte *getPalette()
const;
223 bool hasDirtyPalette()
const;
224 void setCurFrame(
int frame) { _curFrame = frame; }
227 void useInitialPalette();
228 bool canDither()
const;
229 void setDither(
const byte *palette);
230 bool isValid()
const {
return _videoCodec !=
nullptr; }
232 bool isTruemotion1()
const;
233 void forceDimensions(uint16 width, uint16 height);
246 virtual bool setReverse(
bool reverse);
256 virtual bool endOfTrack()
const;
267 _vidsHeader.rate = r.getNumerator();
268 _vidsHeader.scale = r.getDenominator();
273 byte _palette[3 * 256];
274 byte *_initialPalette;
275 mutable bool _dirtyPalette;
276 int _frameCount, _curFrame;
281 Image::CodecAccuracy _accuracy;
291 virtual void createAudioStream();
294 virtual void resetStream();
295 uint32 getCurChunk()
const {
return _curChunk; }
297 void setCurChunk(uint32 chunk) { _curChunk = chunk; }
299 bool isRewindable()
const {
return true; }
317 uint32 chunkSearchOffset;
327 void readOldIndex(uint32 size);
332 bool _foundMovieList;
333 uint32 _movieListStart, _movieListEnd;
337 int _videoTrackCounter, _audioTrackCounter;
338 Track *_lastAddedTrack;
342 bool parseNextChunk();
343 void skipChunk(uint32 size);
344 void handleList(uint32 listSize);
345 void handleStreamHeader(uint32 size);
346 void readStreamName(uint32 size);
347 void readPalette8(uint32 size);
348 uint16 getStreamType(uint32 tag)
const {
return tag & 0xFFFF; }
349 static byte getStreamIndex(uint32 tag);
350 void checkTruemotion1();
351 uint getVideoTrackOffset(uint trackIndex, uint frameNumber = 0);
355 void seekTransparencyFrame(
int frame);
369 virtual bool seekToFrame(uint frame);
Definition: video_decoder.h:493
Definition: video_decoder.h:686
Definition: avi_decoder.h:64
In find(In first, In last, const T &v)
Definition: algorithm.h:225
Definition: video_decoder.h:711
Definition: avi_decoder.h:320
Common::Rational getFrameRate() const
Definition: avi_decoder.h:261
bool isRewindable() const
Definition: avi_decoder.h:76
Definition: timestamp.h:83
uint16 getHeight() const
Definition: avi_decoder.h:212
Definition: audiostream.h:446
const Graphics::Surface * decodeNextFrame()
Definition: avi_decoder.h:220
Definition: rational.h:40
Definition: avi_decoder.h:286
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
SoundType
Definition: mixer.h:62
Definition: avi_decoder.h:203
Definition: video_decoder.h:53
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: avi_decoder.h:148
Definition: audiostream.h:50
bool supportsAudioTrackSwitching() const
Definition: avi_decoder.h:104
uint16 getWidth() const
Definition: avi_decoder.h:72
bool isRewindable() const
Definition: avi_decoder.h:235
int getCurFrame() const
Definition: avi_decoder.h:217
Definition: avi_decoder.h:312
uint16 getHeight() const
Definition: avi_decoder.h:73
Definition: avi_frames.h:36
Definition: movie_decoder.h:32
void setFrameRate(const Common::Rational &r)
Definition: avi_decoder.h:266
int getFrameCount() const
Definition: avi_decoder.h:218
uint16 getWidth() const
Definition: avi_decoder.h:211
virtual bool isReversed() const
Definition: avi_decoder.h:251