mirror of https://github.com/mpv-player/mpv
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:
parent
274e71ee8b
commit
9a873cc53b
|
@ -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);
|
||||
}
|
||||
*(struct mp_image **)data = screen;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue