summaryrefslogtreecommitdiffstats
path: root/video/out/vo_direct3d.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_direct3d.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_direct3d.c')
-rw-r--r--video/out/vo_direct3d.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 5b4fb7856a..88eb619b8a 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -225,7 +225,6 @@ static void d3d_clear_video_textures(d3d_priv *priv);
static bool resize_d3d(d3d_priv *priv);
static void uninit(struct vo *vo);
static void flip_page(struct vo *vo);
-static mp_image_t *get_screenshot(d3d_priv *priv);
static mp_image_t *get_window_screenshot(d3d_priv *priv);
static void draw_osd(struct vo *vo);
static bool change_d3d_backbuffer(d3d_priv *priv);
@@ -1260,9 +1259,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
return VO_TRUE;
case VOCTRL_GET_PANSCAN:
return VO_TRUE;
- case VOCTRL_SCREENSHOT:
- *(struct mp_image **)data = get_screenshot(priv);
- return VO_TRUE;
case VOCTRL_SCREENSHOT_WIN:
*(struct mp_image **)data = get_window_screenshot(priv);
return VO_TRUE;
@@ -1445,29 +1441,6 @@ done:
talloc_free(mpi);
}
-static mp_image_t *get_screenshot(d3d_priv *priv)
-{
- if (!priv->d3d_device)
- return NULL;
-
- if (!priv->have_image)
- return NULL;
-
- if (!priv->vo->params)
- return NULL;
-
- struct mp_image buffer;
- if (!get_video_buffer(priv, &buffer))
- return NULL;
-
- struct mp_image *image = mp_image_new_copy(&buffer);
- if (image)
- mp_image_set_attributes(image, priv->vo->params);
-
- d3d_unlock_video_objects(priv);
- return image;
-}
-
static mp_image_t *get_window_screenshot(d3d_priv *priv)
{
D3DDISPLAYMODE mode;