summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl_cb.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-24 22:56:02 +0100
committerwm4 <wm4@nowhere>2015-01-24 23:16:27 +0100
commit28582322207bb962553505f0c25268f4b786287d (patch)
tree8c9611a9161f48338701fc506646aaedd8c1a491 /video/out/vo_opengl_cb.c
parent047788e3b1354562f99ce8dacdba1972ad990d03 (diff)
downloadmpv-28582322207bb962553505f0c25268f4b786287d.tar.bz2
mpv-28582322207bb962553505f0c25268f4b786287d.tar.xz
vo: simplify VOs by adding generic screenshot support
At the time screenshot support was added, images weren't refcounted yet, so screenshots required specialized implementations in the VOs. But now we can handle these things much simpler. Also see commit 5bb24980. If there are VOs in the future which can't do this (e.g. they need to write to the image passed to vo_driver->draw_image), this still could be disabled on a per-VO basis etc., so we lose no potential performance advantages.
Diffstat (limited to 'video/out/vo_opengl_cb.c')
-rw-r--r--video/out/vo_opengl_cb.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index a974305b85..cee0bc1d46 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -64,7 +64,6 @@ struct mpv_opengl_cb_context {
mpv_opengl_cb_update_fn update_cb;
void *update_cb_ctx;
struct mp_image *waiting_frame;
- struct mp_image *displayed_frame;
struct mp_image **frame_queue;
int queued_frames;
struct mp_image_params img_params;
@@ -358,7 +357,6 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
pthread_mutex_lock(&p->ctx->lock);
mp_image_setrefp(&p->ctx->waiting_frame, mpi);
- mp_image_setrefp(&p->ctx->displayed_frame, mpi);
talloc_free(mpi);
pthread_mutex_unlock(&p->ctx->lock);
}
@@ -488,12 +486,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
update(p);
pthread_mutex_unlock(&p->ctx->lock);
return VO_TRUE;
- case VOCTRL_SCREENSHOT: {
- pthread_mutex_lock(&p->ctx->lock);
- *(struct mp_image **)data = mp_image_new_ref(p->ctx->displayed_frame);
- pthread_mutex_unlock(&p->ctx->lock);
- return VO_TRUE;
- }
case VOCTRL_SET_COMMAND_LINE: {
char *arg = data;
return reparse_cmdline(p, arg);
@@ -514,7 +506,6 @@ static void uninit(struct vo *vo)
pthread_mutex_lock(&p->ctx->lock);
forget_frames(p->ctx);
- mp_image_unrefp(&p->ctx->displayed_frame);
p->ctx->img_params = (struct mp_image_params){0};
p->ctx->reconfigured = true;
p->ctx->active = NULL;