vo_opengl: redirect window screenshot requests to backend

If the glReadPixels method is not available, let the backend do it.

Useful for the next commit.
This commit is contained in:
wm4 2016-09-12 16:35:25 +02:00
parent 274e71ee8b
commit 9a873cc53b
1 changed files with 5 additions and 5 deletions

View File

@ -300,12 +300,12 @@ static int control(struct vo *vo, uint32_t request, void *data)
}
case VOCTRL_SCREENSHOT_WIN: {
struct mp_image *screen = gl_read_window_contents(p->gl);
if (!screen)
break; // redirect to backend
// set image parameters according to the display, if possible
if (screen) {
screen->params.color = gl_video_get_output_colorspace(p->renderer);
if (p->glctx->flip_v)
mp_image_vflip(screen);
}
screen->params.color = gl_video_get_output_colorspace(p->renderer);
if (p->glctx->flip_v)
mp_image_vflip(screen);
*(struct mp_image **)data = screen;
return true;
}