summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-26 20:19:06 +0200
committerwm4 <wm4@nowhere>2012-11-01 02:07:45 +0100
commitc62efc52c6c5f9dc9cf8e335f6e934e69a721331 (patch)
treef29779dd1e4624dba1e7d0824eca93a8ce9f7a4e /libvo
parent738aeb1c60c6ffe95e915e443598f8a51081bdfb (diff)
downloadmpv-c62efc52c6c5f9dc9cf8e335f6e934e69a721331.tar.bz2
mpv-c62efc52c6c5f9dc9cf8e335f6e934e69a721331.tar.xz
screenshot: remove hack for passing anamorphic image size
With anamorphic video (display with non-1:1 PAR, e.g. DVD), the display size was passed using the mp_image fields w/h, which was blatantly incorrect. w/h are the normal image dimensions, while width/height are the "uncropped" storage size (used internally by vf.c). Add a display_w/h, and use that for the display size. Make all VOs that can do screenshots use it.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_corevideo.m7
-rw-r--r--libvo/vo_direct3d.c4
-rw-r--r--libvo/vo_opengl.c9
-rw-r--r--libvo/vo_opengl_old.c9
-rw-r--r--libvo/vo_vdpau.c6
-rw-r--r--libvo/vo_xv.c4
6 files changed, 16 insertions, 23 deletions
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index 0fd8510f39..5116ab653c 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -375,11 +375,8 @@ static mp_image_t *get_screenshot(struct vo *vo)
memcpy(image->planes[0], base, image_size);
image->stride[0] = stride;
- image->width = width;
- image->height = height;
-
- image->w = vo->aspdat.prew;
- image->h = vo->aspdat.preh;
+ image->display_w = vo->aspdat.prew;
+ image->display_h = vo->aspdat.preh;
mp_image_set_colorspace_details(image, &p->colorspace);
diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c
index 773cd5fb76..5fc2a64893 100644
--- a/libvo/vo_direct3d.c
+++ b/libvo/vo_direct3d.c
@@ -1801,8 +1801,8 @@ static mp_image_t *get_screenshot(d3d_priv *priv)
return NULL;
}
- image->w = priv->vo->aspdat.prew;
- image->h = priv->vo->aspdat.preh;
+ image->display_w = priv->vo->aspdat.prew;
+ image->display_h = priv->vo->aspdat.preh;
mp_image_set_colorspace_details(image, &priv->colorspace);
diff --git a/libvo/vo_opengl.c b/libvo/vo_opengl.c
index cc7b7bde40..bcbff61244 100644
--- a/libvo/vo_opengl.c
+++ b/libvo/vo_opengl.c
@@ -1394,11 +1394,10 @@ static mp_image_t *get_screenshot(struct gl_priv *p)
}
gl->ActiveTexture(GL_TEXTURE0);
- image->width = p->image_width;
- image->height = p->image_height;
-
- image->w = p->vo->aspdat.prew;
- image->h = p->vo->aspdat.preh;
+ image->w = p->image_width;
+ image->h = p->image_height;
+ image->display_w = p->vo->aspdat.prew;
+ image->display_h = p->vo->aspdat.preh;
mp_image_set_colorspace_details(image, &p->colorspace);
diff --git a/libvo/vo_opengl_old.c b/libvo/vo_opengl_old.c
index 4823576290..d68ea3c5d5 100644
--- a/libvo/vo_opengl_old.c
+++ b/libvo/vo_opengl_old.c
@@ -822,11 +822,10 @@ static mp_image_t *get_screenshot(struct vo *vo)
gl->ActiveTexture(GL_TEXTURE0);
}
- image->width = p->image_width;
- image->height = p->image_height;
-
- image->w = vo->aspdat.prew;
- image->h = vo->aspdat.preh;
+ image->w = p->image_width;
+ image->h = p->image_height;
+ image->display_w = vo->aspdat.prew;
+ image->display_h = vo->aspdat.preh;
mp_image_set_colorspace_details(image, &p->colorspace);
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index 3f5b7bc660..9f72249c4b 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -1397,10 +1397,8 @@ static struct mp_image *get_screenshot(struct vo *vo)
struct mp_image *image = read_output_surface(vc, vc->screenshot_surface,
vc->vid_width, vc->vid_height);
- image->width = vc->vid_width;
- image->height = vc->vid_height;
- image->w = vo->aspdat.prew;
- image->h = vo->aspdat.preh;
+ image->display_w = vo->aspdat.prew;
+ image->display_h = vo->aspdat.preh;
return image;
}
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 82469e491f..90eda230b8 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -423,8 +423,8 @@ static mp_image_t *get_screenshot(struct vo *vo)
// try to get an image without OSD
int id = ctx->have_image_copy ? ctx->num_buffers : ctx->visible_buf;
struct mp_image img = get_xv_buffer(vo, id);
- img.w = vo->aspdat.prew;
- img.h = vo->aspdat.preh;
+ img.display_w = vo->aspdat.prew;
+ img.display_h = vo->aspdat.preh;
return talloc_memdup(NULL, &img, sizeof(img));
}