ScummVM API documentation
Sci::VideoPlayer Class Reference

#include <video32.h>

Inheritance diagram for Sci::VideoPlayer:
Sci::AVIPlayer Sci::DuckPlayer Sci::QuickTimePlayer Sci::SEQPlayer Sci::VMDPlayer

Public Types

enum  EventFlags {
  kEventFlagNone = 0, kEventFlagEnd = 1, kEventFlagEscapeKey = 2, kEventFlagMouseDown = 4,
  kEventFlagHotRectangle = 8, kEventFlagToFrame = 0x10, kEventFlagYieldToVM = 0x20, kEventFlagReverse = 0x80
}
 

Public Member Functions

 VideoPlayer (EventManager *eventMan, Video::VideoDecoder *decoder=nullptr)
 

Protected Member Functions

bool open (const Common::Path &fileName)
 
bool startHQVideo ()
 
virtual bool shouldStartHQVideo () const
 
bool endHQVideo ()
 
virtual EventFlags playUntilEvent (const EventFlags flags, const uint32 maxSleepMs=0xFFFFFFFF)
 
virtual EventFlags checkForEvent (const EventFlags flags)
 
virtual void submitPalette (const uint8 palette[256 *3]) const
 
virtual void renderFrame (const Graphics::Surface &nextFrame) const
 
template<typename PixelType >
void renderLQToSurface (Graphics::Surface &out, const Graphics::Surface &nextFrame, const bool doublePixels, const bool blackLines) const
 
void setDrawRect (const int16 x, const int16 y, const int16 width, const int16 height)
 
void setSubtitlePosition () const
 

Protected Attributes

EventManager_eventMan
 
Common::ScopedPtr< Video::VideoDecoder_decoder
 
Common::Rect _drawRect
 
bool _needsUpdate
 
const Graphics::Surface_currentFrame
 
Video::Subtitles _subtitles
 

Friends

EventFlags operator| (const EventFlags a, const EventFlags b)
 

Detailed Description

An abstract class implementing common video playback functionality for SCI engine.

Member Function Documentation

◆ open()

bool Sci::VideoPlayer::open ( const Common::Path fileName)
protected

Attempts to open a video by filename and performs basic validation to ensure that the current system is actually capable of playing back the video.

◆ startHQVideo()

bool Sci::VideoPlayer::startHQVideo ( )
protected

Reinitializes the system hardware surface for playback of high-quality scaled video if the current video meets the necessary criteria for this playback mode.

Returns
whether or not the system surface was reinitialized for high-quality scaled video.

◆ shouldStartHQVideo()

virtual bool Sci::VideoPlayer::shouldStartHQVideo ( ) const
inlineprotectedvirtual

Determines whether or not the currently loaded video meets the criteria for high-quality scaled output.

Reimplemented in Sci::DuckPlayer.

◆ endHQVideo()

bool Sci::VideoPlayer::endHQVideo ( )
protected

Restores the hardware surface back to CLUT8 after video playback.

◆ playUntilEvent()

virtual EventFlags Sci::VideoPlayer::playUntilEvent ( const EventFlags  flags,
const uint32  maxSleepMs = 0xFFFFFFFF 
)
protectedvirtual

Plays a video until an event in the given flags is encountered, or until the end of the video is reached.

Parameters
maxSleepMsAn optional parameter defining the maximum number of milliseconds that the video player should sleep between video frames.

Reimplemented in Sci::AVIPlayer.

◆ checkForEvent()

virtual EventFlags Sci::VideoPlayer::checkForEvent ( const EventFlags  flags)
protectedvirtual

Checks to see if an event has occurred that should cause the video player to yield back to the VM.

◆ submitPalette()

virtual void Sci::VideoPlayer::submitPalette ( const uint8  palette[256 *3]) const
protectedvirtual

Submits a palette from the video to the system.

Reimplemented in Sci::VMDPlayer.

◆ renderFrame()

virtual void Sci::VideoPlayer::renderFrame ( const Graphics::Surface nextFrame) const
protectedvirtual

Renders a video frame to the system.

Reimplemented in Sci::DuckPlayer, and Sci::VMDPlayer.

◆ renderLQToSurface()

template<typename PixelType >
void Sci::VideoPlayer::renderLQToSurface ( Graphics::Surface out,
const Graphics::Surface nextFrame,
const bool  doublePixels,
const bool  blackLines 
) const
protected

Renders a video frame to an intermediate surface using low-quality scaling, black-lining, or direct copy, depending upon the passed flags.

◆ setDrawRect()

void Sci::VideoPlayer::setDrawRect ( const int16  x,
const int16  y,
const int16  width,
const int16  height 
)
protected

Sets the draw rect, clipping it to the screen's dimensions if necessary.

◆ setSubtitlePosition()

void Sci::VideoPlayer::setSubtitlePosition ( ) const
protected

Sets the subtitle position according to the draw rect and overlay size.

Member Data Documentation

◆ _decoder

Common::ScopedPtr<Video::VideoDecoder> Sci::VideoPlayer::_decoder
protected

The video decoder to use for video playback by this player.

◆ _drawRect

Common::Rect Sci::VideoPlayer::_drawRect
protected

The rectangle where the video will be drawn, in screen coordinates.

◆ _needsUpdate

bool Sci::VideoPlayer::_needsUpdate
protected

If true, playUntilEvent() will immediately render a frame. Used by VMDPlayer when censorship blobs are added or removed in Phant1 in order to immediately update the screen upon resuming playback.

◆ _currentFrame

const Graphics::Surface* Sci::VideoPlayer::_currentFrame
protected

Current frame rendered by playUntilEvent()

◆ _subtitles

Video::Subtitles Sci::VideoPlayer::_subtitles
mutableprotected

Video SRT subtitles used by fan translation projects for phantasmagoria 1 & 2.


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