#include <avi_decoder.h>
Classes | |
class | AVIAudioTrack |
struct | AVIHeader |
struct | AVIStreamHeader |
class | AVIVideoTrack |
struct | BitmapInfoHeader |
class | IndexEntries |
struct | OldIndex |
struct | PCMWaveFormat |
struct | TrackStatus |
struct | WaveFormat |
struct | WaveFormatEX |
Public Member Functions | |
AVIDecoder (const Common::Rational &frameRateOverride) | |
bool | loadStream (Common::SeekableReadStream *stream) |
void | close () |
uint16 | getWidth () const |
uint16 | getHeight () const |
bool | rewind () |
bool | isRewindable () const |
bool | isSeekable () const |
virtual const Graphics::Surface * | decodeNextFrame () |
const Graphics::Surface * | decodeNextTransparency () |
virtual AVIAudioTrack * | createAudioTrack (AVIStreamHeader sHeader, PCMWaveFormat wvInfo) |
virtual bool | seekToFrame (uint frame) |
Public Member Functions inherited from Video::VideoDecoder | |
virtual bool | loadFile (const Common::Path &filename) |
bool | isVideoLoaded () const |
void | start () |
void | stop () |
void | setRate (const Common::Rational &rate) |
Common::Rational | getRate () const |
bool | isPlaying () const |
bool | seek (const Audio::Timestamp &time) |
void | pauseVideo (bool pause) |
bool | isPaused () const |
void | setEndTime (const Audio::Timestamp &endTime) |
void | setEndFrame (uint frame) |
Audio::Timestamp | getEndTime () const |
void | resetStartTime () |
bool | endOfVideo () const |
int | getCurFrame () const |
uint32 | getFrameCount () const |
uint32 | getTime () const |
Graphics::PixelFormat | getPixelFormat () const |
virtual Audio::Timestamp | getDuration () const |
const byte * | getPalette () |
bool | hasDirtyPalette () const |
void | delayMillis (uint msecs) |
uint32 | getTimeToNextFrame () const |
bool | needsUpdate () const |
bool | setReverse (bool reverse) |
bool | setDitheringPalette (const byte *palette) |
bool | setOutputPixelFormat (const Graphics::PixelFormat &format) |
virtual void | setVideoCodecAccuracy (Image::CodecAccuracy accuracy) |
byte | getVolume () const |
void | setVolume (byte volume) |
int8 | getBalance () const |
void | setBalance (int8 balance) |
Audio::Mixer::SoundType | getSoundType () const |
void | setSoundType (Audio::Mixer::SoundType soundType) |
bool | addStreamTrack (Audio::SeekableAudioStream *stream) |
bool | addStreamFileTrack (const Common::Path &baseName) |
bool | setAudioTrack (int index) |
uint | getAudioTrackCount () const |
Protected Types | |
enum | IndexFlags { AVIIF_INDEX = 0x10 } |
enum | AVIFlags { AVIF_HASINDEX = 0x00000010, AVIF_MUSTUSEINDEX = 0x00000020, AVIF_ISINTERLEAVED = 0x00000100, AVIF_TRUSTCKTYPE = 0x00000800, AVIF_WASCAPTUREFILE = 0x00010000, AVIF_WASCOPYRIGHTED = 0x00020000 } |
Protected Types inherited from Video::VideoDecoder | |
typedef Common::Array< Track * > | TrackList |
typedef TrackList::iterator | TrackListIterator |
Protected Member Functions | |
void | readNextPacket () |
bool | seekIntern (const Audio::Timestamp &time) |
bool | supportsAudioTrackSwitching () const |
AudioTrack * | getAudioTrack (int index) |
void | addTrack (Track *track, bool isExternal=false) |
void | readOldIndex (uint32 size) |
void | initCommon () |
bool | parseNextChunk () |
void | skipChunk (uint32 size) |
void | handleList (uint32 listSize) |
void | handleStreamHeader (uint32 size) |
void | readStreamName (uint32 size) |
void | readPalette8 (uint32 size) |
uint16 | getStreamType (uint32 tag) const |
void | checkTruemotion1 () |
uint | getVideoTrackOffset (uint trackIndex, uint frameNumber=0) |
void | handleNextPacket (TrackStatus &status) |
bool | shouldQueueAudio (TrackStatus &status) |
void | seekTransparencyFrame (int frame) |
Protected Member Functions inherited from Video::VideoDecoder | |
void | resetPauseStartTime () |
void | addTrack (Track *track, bool isExternal=false) |
virtual bool | useAudioSync () const |
Track * | getTrack (uint track) |
const Track * | getTrack (uint track) const |
bool | endOfVideoTracks () const |
VideoTrack * | findNextVideoTrack () |
TrackListIterator | getTrackListBegin () |
TrackListIterator | getTrackListEnd () |
void | eraseTrack (Track *track) |
void | stopAudio () |
void | setAudioRate (Common::Rational rate) |
void | startAudio () |
void | startAudioLimit (const Audio::Timestamp &limit) |
bool | hasFramesLeft () const |
bool | hasAudio () const |
Static Protected Member Functions | |
static byte | getStreamIndex (uint32 tag) |
Protected Attributes | |
AVIHeader | _header |
IndexEntries | _indexEntries |
Common::SeekableReadStream * | _fileStream |
bool | _decodedHeader |
bool | _foundMovieList |
uint32 | _movieListStart |
uint32 | _movieListEnd |
Common::Rational | _frameRateOverride |
int | _videoTrackCounter |
int | _audioTrackCounter |
Track * | _lastAddedTrack |
Common::Array< TrackStatus > | _videoTracks |
Common::Array< TrackStatus > | _audioTracks |
TrackStatus | _transparencyTrack |
Protected Attributes inherited from Video::VideoDecoder | |
Audio::Timestamp | _lastTimeChange |
int32 | _startTime |
VideoTrack * | _nextVideoTrack |
Image::CodecAccuracy | _videoCodecAccuracy |
Decoder for AVI videos.
Video decoder used in engines:
|
virtual |
Load a video from a generic read stream. The ownership of the stream object transfers to this VideoDecoder instance, which is hence also responsible for eventually deleting it.
Implementations of this function are required to call addTrack() for each track in the video upon success.
stream | the stream to load |
Implements Video::VideoDecoder.
|
virtual |
Close the active video stream and free any associated resources.
All subclasses that need to close their own resources should still call the base class' close() function at the start of their function.
Reimplemented from Video::VideoDecoder.
|
inlinevirtual |
Returns the width of the video's frames.
By default, this finds the largest width between all of the loaded tracks. However, a subclass may override this if it does any kind of post-processing on it.
Reimplemented from Video::VideoDecoder.
|
inlinevirtual |
Returns the height of the video's frames.
By default, this finds the largest height between all of the loaded tracks. However, a subclass may override this if it does any kind of post-processing on it.
Reimplemented from Video::VideoDecoder.
|
virtual |
Rewind a video to its beginning.
If the video is playing, it will continue to play. The default implementation will rewind each track.
Reimplemented from Video::VideoDecoder.
|
inlinevirtual |
Returns if a video is rewindable or not. The default implementation polls each track for rewindability.
Reimplemented from Video::VideoDecoder.
|
virtual |
Returns if a video is seekable or not. The default implementation polls each track for seekability.
Reimplemented from Video::VideoDecoder.
|
virtual |
Decode the next frame into a surface and return the latter.
A subclass may override this, but must still call this function. As an example, a subclass may do this to apply some global video scale to individual track's frame.
Note that this will call readNextPacket() internally first before calling the next video track's decodeNextFrame() function.
Reimplemented from Video::VideoDecoder.
const Graphics::Surface* Video::AVIDecoder::decodeNextTransparency | ( | ) |
Decodes the next transparency track frame
|
protectedvirtual |
Decode enough data for the next frame and enough audio to last that long.
This function is used by this class' decodeNextFrame() function. A subclass of a Track may decide to just have its decodeNextFrame() function read and decode the frame, but only if it is the only track in the video.
Reimplemented from Video::VideoDecoder.
|
protectedvirtual |
The internal seek function that does the actual seeking.
Reimplemented from Video::VideoDecoder.
|
inlineprotectedvirtual |
Does this video format support switching between audio tracks?
Returning true implies this format supports multiple audio tracks, can switch tracks, and defaults to playing the first found audio track.
Reimplemented from Video::VideoDecoder.
|
protectedvirtual |
Get the audio track for the given index.
This is used only if supportsAudioTrackSwitching() returns true.
index | The index of the track, whose meaning is dependent on the container |
Reimplemented from Video::VideoDecoder.
|
protected |
Define a track to be used by this class.
The pointer is then owned by this base class.
track | The track to add |
isExternal | Is this an external track not found by loadStream()? |
|
virtual |
Seek to a given frame.
This only works when the video track(s) supports getFrameTime(). This calls seek() internally.
Reimplemented from Video::VideoDecoder.