ScummVM API documentation
Grim::SmushDecoder Class Reference
Inheritance diagram for Grim::SmushDecoder:
Video::VideoDecoder

Classes

class  SmushAudioTrack
 
class  SmushVideoTrack
 

Public Member Functions

int getX () const
 
int getY () const
 
void setLooping (bool l)
 
bool isRewindable () const override
 
bool isSeekable () const override
 
bool rewind () override
 
bool seekIntern (const Audio::Timestamp &time) override
 
bool loadStream (Common::SeekableReadStream *stream) override
 
- 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)
 
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
 
virtual uint16 getWidth () const
 
virtual uint16 getHeight () const
 
Graphics::PixelFormat getPixelFormat () const
 
virtual Audio::Timestamp getDuration () 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
 

Protected Member Functions

bool readHeader ()
 
void handleFrameDemo ()
 
void handleFrame ()
 
bool handleFramesHeader ()
 
void handleFRME (Common::SeekableReadStream *stream, uint32 size)
 
void init ()
 
void close () override
 
const Graphics::SurfacedecodeNextFrame () override
 
- 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 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
 

Additional Inherited Members

- Protected Types inherited from Video::VideoDecoder
typedef Common::Array< Track * > TrackList
 
typedef TrackList::iterator TrackListIterator
 
- Protected Attributes inherited from Video::VideoDecoder
Audio::Timestamp _lastTimeChange
 
int32 _startTime
 

Member Function Documentation

◆ isRewindable()

bool Grim::SmushDecoder::isRewindable ( ) const
inlineoverridevirtual

Returns if a video is rewindable or not. The default implementation polls each track for rewindability.

Reimplemented from Video::VideoDecoder.

◆ isSeekable()

bool Grim::SmushDecoder::isSeekable ( ) const
inlineoverridevirtual

Returns if a video is seekable or not. The default implementation polls each track for seekability.

Reimplemented from Video::VideoDecoder.

◆ rewind()

bool Grim::SmushDecoder::rewind ( )
overridevirtual

Rewind a video to its beginning.

If the video is playing, it will continue to play. The default implementation will rewind each track.

Returns
true on success, false otherwise

Reimplemented from Video::VideoDecoder.

◆ seekIntern()

bool Grim::SmushDecoder::seekIntern ( const Audio::Timestamp time)
overridevirtual

The internal seek function that does the actual seeking.

See also
seek()
Returns
true on success, false otherwise

Reimplemented from Video::VideoDecoder.

◆ loadStream()

bool Grim::SmushDecoder::loadStream ( Common::SeekableReadStream stream)
overridevirtual

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 Grim::SmushDecoder::close ( )
overrideprotectedvirtual

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.

◆ decodeNextFrame()

const Graphics::Surface* Grim::SmushDecoder::decodeNextFrame ( )
overrideprotectedvirtual

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.


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