Changes between Initial Version and Version 1 of Ticket #9994


Ignore:
Timestamp:
07/25/17 02:32:19 (7 years ago)
Author:
csnover
Comment:

When a game calls to play a video at its original resolution, the video player tries to optimise rendering by setting the backend pixel format to the pixel format of the video (which is 32bpp) so it can be sent directly without any intermediate conversion step.

The OpenGL backend cannot handle the pixel format given by the decoder for this video, so fails, shows that alert, and the system pixel format remains 8bpp. At this point the game scripts will continue to try to play the video, and then the convertTo error happens because the system surface is 8bpp but the video is 32bpp so there is no way to down-convert to the system surface for rendering.

There is supposed to be an API for negotiating supported pixel formats between the backend and frontend, but this API is currently broken for SDL; 32bpp formats that are supported by SDL are not added to the supported list because ScummVM starts SDL at 16bpp and then only allows formats that are <= the currently set colour depth onto the supported formats list. When I was looking, it seems that all the engines that use 32bpp work around this by blindly setting a hard-coded 32bpp pixel format and assuming it will succeed. (The OSystem API for setting the surface format also doesn’t actually have any mechanism for communicating success/failure.)

I was hoping to avoid doing more work on backend but I just don’t know that there is any other way to resolve this (except to say not to use the OpenGL backend…).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9994

    • Property Summary SCI: GK2 Demo: Surface:: convertTO() Crash for Widescreen MovieSCI: GK2 Demo: Surface:: convertTo() Crash for Windowed Movie
  • Ticket #9994 – Description

    initial v1  
    55If I try to watch the Movie in the demo on Windowed then scummvm crashes.
    66
    7 After I click widescreen it says "Could not Initialize color format".
     7After I click Windowed it says "Could not Initialize color format".
    88
    99Then it crashes and says
    10 Error: Surface:: convertTO() Can only convert to 2Bpp and 4Bpp!
     10Error: Surface::convertTo() Can only convert to 2Bpp and 4Bpp!