ScummVM API documentation
Video::SmackerDecoder Class Reference

#include <smk_decoder.h>

Inheritance diagram for Video::SmackerDecoder:
Video::VideoDecoder Hypno::HypnoSmackerDecoder Neverhood::NeverhoodSmackerDecoder Toon::ToonstruckSmackerDecoder Trecision::NightlongVideoDecoder Trecision::NightlongAmigaDecoder Trecision::NightlongSmackerDecoder

Classes

struct  AudioInfo
 
class  SmackerVideoTrack
 

Public Member Functions

virtual bool loadStream (Common::SeekableReadStream *stream)
 
void close ()
 
const Graphics::SurfaceforceSeekToFrame (uint frame)
 
bool rewind ()
 
Common::Rational getFrameRate () const
 
virtual const Common::RectgetNextDirtyRect ()
 
- 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
 
virtual bool isRewindable () const
 
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
 
virtual uint16 getWidth () const
 
virtual uint16 getHeight () 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
 
virtual const Graphics::SurfacedecodeNextFrame ()
 
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  AudioCompression { kCompressionNone, kCompressionDPCM, kCompressionRDFT, kCompressionDCT }
 
- Protected Types inherited from Video::VideoDecoder
typedef Common::Array< Track * > TrackList
 
typedef TrackList::iterator TrackListIterator
 

Protected Member Functions

void readNextPacket ()
 
bool supportsAudioTrackSwitching () const
 
AudioTrackgetAudioTrack (int index)
 
virtual void handleAudioTrack (byte track, uint32 chunkSize, uint32 unpackedSize)
 
virtual uint32 getSignatureVersion (uint32 signature) const
 
virtual SmackerVideoTrackcreateVideoTrack (uint32 width, uint32 height, uint32 frameCount, const Common::Rational &frameRate, uint32 flags, uint32 version) const
 
- Protected Member Functions inherited from Video::VideoDecoder
void resetPauseStartTime ()
 
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)
 
void stopAudio ()
 
void setAudioRate (Common::Rational rate)
 
void startAudio ()
 
void startAudioLimit (const Audio::Timestamp &limit)
 
bool hasFramesLeft () const
 
bool hasAudio () const
 

Protected Attributes

Common::SeekableReadStream_fileStream
 
struct {
   uint32   signature
 
   uint32   flags
 
   uint32   audioSize [7]
 
   uint32   treesSize
 
   uint32   mMapSize
 
   uint32   mClrSize
 
   uint32   fullSize
 
   uint32   typeSize
 
   AudioInfo   audioInfo [7]
 
   uint32   dummy
 
_header
 
uint32 * _frameSizes
 
byte * _frameTypes
 
- Protected Attributes inherited from Video::VideoDecoder
Audio::Timestamp _lastTimeChange
 
int32 _startTime
 
VideoTrack_nextVideoTrack
 
Image::CodecAccuracy _videoCodecAccuracy
 

Detailed Description

Decoder for Smacker v2/v4 videos.

Based on http://wiki.multimedia.cx/index.php?title=Smacker and the FFmpeg Smacker decoder (libavcodec/smacker.c), revision 16143 https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/40a19c443430de520d86bbd644033c8e2ca87e9b

Video decoder used in engines:

  • agos
  • bagel
  • saga
  • scumm (he)
  • sword1
  • sword2
  • toon
  • trecision
  • twine

Member Function Documentation

◆ loadStream()

virtual bool Video::SmackerDecoder::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.

Reimplemented in Trecision::NightlongAmigaDecoder, Trecision::NightlongSmackerDecoder, Toon::ToonstruckSmackerDecoder, and Hypno::HypnoSmackerDecoder.

◆ close()

void Video::SmackerDecoder::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.

◆ rewind()

bool Video::SmackerDecoder::rewind ( )
virtual

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.

◆ readNextPacket()

void Video::SmackerDecoder::readNextPacket ( )
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.

◆ supportsAudioTrackSwitching()

bool Video::SmackerDecoder::supportsAudioTrackSwitching ( ) const
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.

◆ getAudioTrack()

AudioTrack* Video::SmackerDecoder::getAudioTrack ( int  index)
protectedvirtual

Get the audio track for the given index.

This is used only if supportsAudioTrackSwitching() returns true.

Parameters
indexThe index of the track, whose meaning is dependent on the container
Returns
The audio track for the index, or 0 if not found

Reimplemented from Video::VideoDecoder.


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