diff options
author | wm4 <wm4@nowhere> | 2015-01-22 17:47:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-22 18:18:23 +0100 |
commit | 74581a61064f56b170e555fa72d9cdca161d2307 (patch) | |
tree | 532223eaa3644b01501d443ebca9011ee12af963 /video/out/gl_video.c | |
parent | e9ac3fc3a1505c4db1773a2a24d35ac41ab69887 (diff) | |
download | mpv-74581a61064f56b170e555fa72d9cdca161d2307.tar.bz2 mpv-74581a61064f56b170e555fa72d9cdca161d2307.tar.xz |
video: handle hwdec screenshots differently
Instead of converting the hw surface to an image in the VO, provide a
generic way to convet hw surfaces, and use this in the screenshot code.
It's all relatively straightforward, except vdpau is being terrible. It
needs a huge chunk of new code, because copying back is not simple.
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index e3eb4d1abf..1f32844c07 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1671,7 +1671,7 @@ static void uninit_video(struct gl_video *p) fbotex_uninit(p, &p->indirect_fbo); fbotex_uninit(p, &p->scale_sep_fbo); - + // Invalidate image_params to ensure that gl_video_config() will call // init_video() on uninitialized gl_video. p->image_params = (struct mp_image_params){0}; @@ -2017,16 +2017,14 @@ struct mp_image *gl_video_download_image(struct gl_video *p) struct video_image *vimg = &p->image; - if (!p->have_image || !gl->GetTexImage) + if (!p->have_image) return NULL; - if (p->hwdec_active && p->hwdec->driver->download_image) { - struct mp_image *dlimage = - p->hwdec->driver->download_image(p->hwdec, vimg->hwimage); - if (dlimage) - mp_image_set_attributes(dlimage, &p->image_params); - return dlimage; - } + if (p->hwdec_active) + return mp_image_new_ref(vimg->hwimage); + + if (!gl->GetTexImage) + return NULL; set_image_textures(p, vimg, NULL); |