ScummVM API documentation
Video::QuickTimeDecoder Class Reference

#include <qt_decoder.h>

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

Classes

struct  NodeData
 

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 ()
 
void handleMouseMove (int16 x, int16 y)
 
void handleMouseButton (bool isDown, int16 x=-1, int16 y=-1)
 
float getPanAngle () const
 
void setPanAngle (float panAngle)
 
float getTiltAngle () const
 
void setTiltAngle (float tiltAngle)
 
float getFOV () const
 
void setFOV (float fov)
 
int getCurrentRow ()
 
void setCurrentRow (int row)
 
int getCurrentColumn ()
 
void setCurrentColumn (int column)
 
void nudge (const Common::String &direction)
 
bool isVR () const
 
QTVRType getQTVRType () const
 
uint8 getWarpMode () const
 
void setWarpMode (uint8 warpMode)
 
NodeData getNodeData (uint32 nodeID)
 
- 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
 
void resetStartTime ()
 
bool endOfVideo () const
 
int getCurFrame () const
 
uint32 getFrameCount () const
 
uint32 getTime () const
 
Graphics::PixelFormat getPixelFormat () 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
 
- 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

- Public Types inherited from Common::QuickTimeParser
enum  QTVRType { OTHER, OBJECT, PANORAMA }
 
- 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,
  CODEC_TYPE_PANO
}
 
enum  GraphicsMode {
  COPY = 0x0, DITHER_COPY = 0x40, BLEND = 0x20, TRANSPARENT = 0x24,
  STRAIGHT_ALPHA = 0x100, PREMUL_WHITE_ALPHA = 0x101, PREMUL_BLACK_ALPHA = 0x102, STRAIGHT_ALPHA_BLEND = 0x104,
  COMPOSITION = 0x103
}
 
enum  HotSpotType { undefined, link, navg }
 
enum  MovieType { kStandardObject = 1, kOldNavigableMovieScene, kObjectInScene }
 
- Protected Attributes inherited from Video::VideoDecoder
Audio::Timestamp _lastTimeChange
 
int32 _startTime
 
VideoTrack_nextVideoTrack
 
Image::CodecAccuracy _videoCodecAccuracy
 
- 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
 
Navigation _nav
 
QTVRType _qtvrType
 
uint16 _winX
 
uint16 _winY
 
Track_panoTrack
 

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: