[Scummvm-devel] VideoPlayer improvement: video positioning.

Willem Jan Palenstijn wjp at usecode.org
Mon Jan 11 14:37:44 CET 2010

On Mon, Jan 11, 2010 at 04:12:21PM +0300, Vladimir Menshakov wrote:
> 11.01.10, 12:42, "Filippos Karapetis" <philipk79 at hotmail.com>:
> > > Another questions for the setFrameLocation() is: *when* will you call it?
> > > VideoPlayer quite limited and basically have only one method: play(). You
> > > cannot call it from post-process because first frame would be already
> > > rendered. Another virtual callback onPlay()? Default 'uninitialized'
> > > values for the x/y position? Sounds ugly. :(
> > 
> > Could be something like: if x and y are -1, then draw the frame centered on
> > screen (like now), if not, draw the frame at the requested location
> Enough for simple deinterlacing filter, yes. Let's start with this one.

A setFrameLocation() sounds much less clean than simply extracting

        Graphics::Surface *screen = g_system->lockScreen();
        _decoder->copyFrameToBuffer((byte *)screen->pixels, frameX, frameY, g_system->getWidth());
        performPostProcessing((byte *)screen->pixels);

into a new VideoPlayer::render() method that can be overloaded as you
originally suggested. I don't see the advantage of having a function to move
the location of the frame only to process it further.

-Willem Jan

More information about the Scummvm-devel mailing list