ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Decoder for Smacker v2/v4 videos. More...

#include <smk_decoder.h>

Inheritance diagram for Video::SmackerDecoder:
Collaboration diagram for Video::SmackerDecoder:

List of all members.

Classes

struct  AudioInfo
class  SmackerAudioTrack
class  SmackerVideoTrack

Public Member Functions

 SmackerDecoder ()
virtual ~SmackerDecoder ()
virtual bool loadStream (Common::SeekableReadStream *stream)
 Load a video from a generic read stream.
void close ()
 Close the active video stream and free any associated resources.
bool rewind ()
 Rewind a video to its beginning.
Common::Rational getFrameRate () const

Protected Types

enum  AudioCompression { kCompressionNone, kCompressionDPCM, kCompressionRDFT, kCompressionDCT }

Protected Member Functions

void readNextPacket ()
 Decode enough data for the next frame and enough audio to last that long.
bool supportsAudioTrackSwitching () const
 Does this video format support switching between audio tracks?
AudioTrackgetAudioTrack (int index)
 Get the audio track for the given index.
virtual void handleAudioTrack (byte track, uint32 chunkSize, uint32 unpackedSize)
virtual SmackerVideoTrackcreateVideoTrack (uint32 width, uint32 height, uint32 frameCount, const Common::Rational &frameRate, uint32 flags, uint32 signature) 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

Private Attributes

byte_frameTypes
uint32 _firstFrameStart

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 http://svn.ffmpeg.org/ffmpeg/trunk/libavcodec/smacker.c?revision=16143&view=markup

Video decoder used in engines:

  • agos
  • saga
  • scumm (he)
  • sword1
  • sword2
  • toon

Definition at line 60 of file smk_decoder.h.


Member Enumeration Documentation

Enumerator:
kCompressionNone 
kCompressionDPCM 
kCompressionRDFT 
kCompressionDCT 

Definition at line 131 of file smk_decoder.h.


Constructor & Destructor Documentation

Video::SmackerDecoder::SmackerDecoder (  ) 

Definition at line 279 of file smk_decoder.cpp.

Video::SmackerDecoder::~SmackerDecoder (  )  [virtual]

Definition at line 286 of file smk_decoder.cpp.


Member Function Documentation

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.

Definition at line 396 of file smk_decoder.cpp.

SmackerDecoder::SmackerVideoTrack * Video::SmackerDecoder::createVideoTrack ( uint32  width,
uint32  height,
uint32  frameCount,
const Common::Rational frameRate,
uint32  flags,
uint32  signature 
) const [protected, virtual]

Definition at line 867 of file smk_decoder.cpp.

VideoDecoder::AudioTrack * Video::SmackerDecoder::getAudioTrack ( int  index  )  [protected, virtual]

Get the audio track for the given index.

This is used only if supportsAudioTrackSwitching() returns true.

Parameters:
index The 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.

Definition at line 510 of file smk_decoder.cpp.

Common::Rational Video::SmackerDecoder::getFrameRate (  )  const

Definition at line 872 of file smk_decoder.cpp.

void Video::SmackerDecoder::handleAudioTrack ( byte  track,
uint32  chunkSize,
uint32  unpackedSize 
) [protected, virtual]

Definition at line 477 of file smk_decoder.cpp.

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:
stream the stream to load
Returns:
whether loading the stream succeeded

Implements Video::VideoDecoder.

Definition at line 290 of file smk_decoder.cpp.

void Video::SmackerDecoder::readNextPacket (  )  [protected, virtual]

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.

Definition at line 419 of file smk_decoder.cpp.

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.

Definition at line 409 of file smk_decoder.cpp.

bool Video::SmackerDecoder::supportsAudioTrackSwitching (  )  const [inline, protected, virtual]

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.

Definition at line 75 of file smk_decoder.h.


Member Data Documentation

Definition at line 189 of file smk_decoder.h.

Definition at line 159 of file smk_decoder.h.

Definition at line 187 of file smk_decoder.h.

struct { ... } Video::SmackerDecoder::_header [protected]

Definition at line 149 of file smk_decoder.h.


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


Generated on Sat Jul 13 2019 05:05:19 for ResidualVM by doxygen 1.7.1
curved edge   curved edge