summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-27 18:06:09 +0200
committerwm4 <wm4@nowhere>2012-11-01 02:07:45 +0100
commit9ba52ea6efd41db9dbd08311380f7fa633e22aa2 (patch)
tree698757630c88e96f323bc66461045234505ace91 /libvo
parentd9839fe8623c855b6b335df3a5b9783e3ed22266 (diff)
downloadmpv-9ba52ea6efd41db9dbd08311380f7fa633e22aa2.tar.bz2
mpv-9ba52ea6efd41db9dbd08311380f7fa633e22aa2.tar.xz
screenshot, draw_bmp: use colorspace passed with mp_image
Remove the explicit struct mp_csp_details parameters from all related functions, and use mp_image.colorspace/levels instead.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_lavc.c5
-rw-r--r--libvo/vo_x11.c4
-rw-r--r--libvo/vo_xv.c9
3 files changed, 9 insertions, 9 deletions
diff --git a/libvo/vo_lavc.c b/libvo/vo_lavc.c
index 6c9a3906d0..96bf32521b 100644
--- a/libvo/vo_lavc.c
+++ b/libvo/vo_lavc.c
@@ -501,8 +501,9 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
.video_par = dar / sar,
};
- osd_draw_on_image(osd, dim, osd->vo_pts, OSD_DRAW_SUB_ONLY, vc->lastimg,
- &vc->colorspace);
+ mp_image_set_colorspace_details(vc->lastimg, &vc->colorspace);
+
+ osd_draw_on_image(osd, dim, osd->vo_pts, OSD_DRAW_SUB_ONLY, vc->lastimg);
}
}
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 587730a89a..24bc98ba7d 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -440,8 +440,6 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
struct mp_image img = get_x_buffer(p);
- struct mp_csp_details csp = MP_CSP_DETAILS_DEFAULTS;
-
struct mp_osd_res res = {
.w = img.w,
.h = img.h,
@@ -449,7 +447,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
.video_par = vo->aspdat.par,
};
- osd_draw_on_image(osd, res, osd->vo_pts, 0, &img, &csp);
+ osd_draw_on_image(osd, res, osd->vo_pts, 0, &img);
}
static void flip_page(struct vo *vo)
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 390c1753b6..82469e491f 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -309,6 +309,10 @@ static struct mp_image get_xv_buffer(struct vo *vo, int buf_index)
img.stride[n] = xv_image->pitches[sn];
}
+ struct mp_csp_details csp = {0};
+ vo_control(vo, VOCTRL_GET_YUV_COLORSPACE, &csp);
+ mp_image_set_colorspace_details(&img, &csp);
+
return img;
}
@@ -336,9 +340,6 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
struct mp_image img = get_xv_buffer(vo, ctx->current_buf);
- struct mp_csp_details csp = {0};
- vo_control(vo, VOCTRL_GET_YUV_COLORSPACE, &csp);
-
struct vo_rect *src = &ctx->src_rect;
struct vo_rect *dst = &ctx->dst_rect;
double xvpar = (double)dst->width / dst->height * src->height / src->width;
@@ -350,7 +351,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
.video_par = vo->aspdat.par,
};
- if (osd_draw_on_image(osd, res, osd->vo_pts, 0, &img, &csp))
+ if (osd_draw_on_image(osd, res, osd->vo_pts, 0, &img))
ctx->unchanged_image = false;
}