ScummVM API documentation
Video::QuickTimeDecoder Class Reference

#include <qt_decoder.h>

Inheritance diagram for Video::QuickTimeDecoder:
Video::VideoDecoder Audio::QuickTimeAudioDecoder Common::QuickTimeParser

Public Member Functions

bool loadFile (const Common::Path &filename)
 
bool loadStream (Common::SeekableReadStream *stream)
 
void close ()
 
uint16 getWidth () const
 
uint16 getHeight () const
 
const Graphics::SurfacedecodeNextFrame ()
 
Audio::Timestamp getDuration () const
 
void enableEditListBoundsCheckQuirk (bool enable)
 
Common::String getAliasPath ()
 
- Public Member Functions inherited from Video::VideoDecoder
bool isVideoLoaded () const
 
void start ()
 
void stop ()
 
void setRate (const Common::Rational &rate)
 
Common::Rational getRate () const
 
bool isPlaying () const
 
virtual bool isRewindable () const
 
virtual bool rewind ()
 
virtual bool isSeekable () const
 
bool seek (const Audio::Timestamp &time)
 
virtual bool seekToFrame (uint frame)
 
void pauseVideo (bool pause)
 
bool isPaused () const
 
void setEndTime (const Audio::Timestamp &endTime)
 
void setEndFrame (uint frame)
 
Audio::Timestamp getEndTime () const
 
bool endOfVideo () const
 
int getCurFrame () const
 
uint32 getFrameCount () const
 
uint32 getTime () const
 
Graphics::PixelFormat getPixelFormat () const
 
const byte * getPalette ()
 
bool hasDirtyPalette () const
 
uint32 getTimeToNextFrame () const
 
bool needsUpdate () const
 
bool setReverse (bool reverse)
 
bool setDitheringPalette (const byte *palette)
 
bool setOutputPixelFormat (const Graphics::PixelFormat &format)
 
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
 
- Public Member Functions inherited from Audio::QuickTimeAudioDecoder
bool loadAudioFile (const Common::Path &filename)
 
bool loadAudioStream (Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle)
 
- Public Member Functions inherited from Common::QuickTimeParser
bool parseFile (const Path &filename)
 
bool parseStream (SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle=DisposeAfterUse::YES)
 
void close ()
 
void flattenEditLists ()
 
void setChunkBeginOffset (uint32 offset)
 
uint32 getTimeScale () const
 
bool isOpen () const
 

Protected Member Functions

Common::QuickTimeParser::SampleDescreadSampleDesc (Common::QuickTimeParser::Track *track, uint32 format, uint32 descSize)
 
- Protected Member Functions inherited from Video::VideoDecoder
void resetPauseStartTime ()
 
virtual void readNextPacket ()
 
void addTrack (Track *track, bool isExternal=false)
 
virtual bool useAudioSync () const
 
TrackgetTrack (uint track)
 
const TrackgetTrack (uint track) const
 
bool endOfVideoTracks () const
 
VideoTrackfindNextVideoTrack ()
 
TrackListIterator getTrackListBegin ()
 
TrackListIterator getTrackListEnd ()
 
void eraseTrack (Track *track)
 
virtual bool seekIntern (const Audio::Timestamp &time)
 
virtual bool supportsAudioTrackSwitching () const
 
virtual AudioTrackgetAudioTrack (int index)
 
void stopAudio ()
 
void setAudioRate (Common::Rational rate)
 
void startAudio ()
 
void startAudioLimit (const Audio::Timestamp &limit)
 
bool hasFramesLeft () const
 
bool hasAudio () const
 
- Protected Member Functions inherited from Audio::QuickTimeAudioDecoder
void init ()
 
- Protected Member Functions inherited from Common::QuickTimeParser
void init ()
 

Additional Inherited Members

- Protected Types inherited from Video::VideoDecoder
typedef Common::Array< Track * > TrackList
 
typedef TrackList::iterator TrackListIterator
 
- Protected Types inherited from Common::QuickTimeParser
enum  CodecType { CODEC_TYPE_MOV_OTHER, CODEC_TYPE_VIDEO, CODEC_TYPE_AUDIO, CODEC_TYPE_MIDI }
 
- Protected Attributes inherited from Video::VideoDecoder
Audio::Timestamp _lastTimeChange
 
int32 _startTime
 
- Protected Attributes inherited from Audio::QuickTimeAudioDecoder
Common::Array< QuickTimeAudioTrack * > _audioTracks
 
- Protected Attributes inherited from Common::QuickTimeParser
SeekableReadStream_fd
 
uint32 _timeScale
 
uint32 _duration
 
Rational _scaleFactorX
 
Rational _scaleFactorY
 
Array< Track * > _tracks
 

Detailed Description

Decoder for QuickTime videos.

Video decoder used in engines:

  • mohawk
  • pegasus
  • sci

Member Function Documentation

◆ loadFile()

bool Video::QuickTimeDecoder::loadFile ( const Common::Path filename)
virtual

Load a video from a file with the given name.

A default implementation using Common::File and loadStream is provided.

Parameters
filenamethe filename to load
Returns
whether loading the file succeeded

Reimplemented from Video::VideoDecoder.

◆ loadStream()

bool Video::QuickTimeDecoder::loadStream ( Common::SeekableReadStream stream)
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.

Parameters
streamthe stream to load
Returns
whether loading the stream succeeded

Implements Video::VideoDecoder.

◆ close()

void Video::QuickTimeDecoder::close ( )
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.

◆ getWidth()

uint16 Video::QuickTimeDecoder::getWidth ( ) const
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.

Returns
the width of the video's frames

Reimplemented from Video::VideoDecoder.

◆ getHeight()

uint16 Video::QuickTimeDecoder::getHeight ( ) const
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.

Returns
the height of the video's frames

Reimplemented from Video::VideoDecoder.

◆ decodeNextFrame()

const Graphics::Surface* Video::QuickTimeDecoder::decodeNextFrame ( )
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.

Returns
a surface containing the decoded frame, or 0
Note
Ownership of the returned surface stays with the VideoDecoder, hence the caller must not free it.
this may return 0, in which case the last frame should be kept on screen

Reimplemented from Video::VideoDecoder.

◆ getDuration()

Audio::Timestamp Video::QuickTimeDecoder::getDuration ( ) const
inlinevirtual

Get the duration of the video.

If the duration is unknown, this will return 0. If this is not overriden, it will take the length of the longest track.

Reimplemented from Video::VideoDecoder.


The documentation for this class was generated from the following file: