summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-11-15 15:21:40 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-11-15 17:03:41 +0200
commit98ee8dd15976501157c894ec385c4c551c6614ad (patch)
tree0ca98500193f1e76da5ecc15d2076abec9caee59 /libmpcodecs
parent201bef7ee150f9d852996b379c926ba0c47320d5 (diff)
downloadmpv-98ee8dd15976501157c894ec385c4c551c6614ad.tar.bz2
mpv-98ee8dd15976501157c894ec385c4c551c6614ad.tar.xz
Add yuv_colorspace property, implemented in vo_vdpau and vo_xv
Add a property to select YUV colorspace. Currently implemented only in vo_vdpau and vo_xv. Allows switching between BT.601, BT.709 and SMPTE-240M (vdpau only). The xv support uses the "XV_ITURBT_709" attribute. At least my NVIDIA card supports that; I don't know whether other xv implementations do. Bind the colorspace switch to the 'c' key by default. 'c' is currently used by vo_sdl for some fullscreen mode change thing, but at the moment that does not conflict and if it will in the future then vo_sdl can change. VDPAU part based on a patch from Lauri Mylläri <lauri.myllari@gmail.com>
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf.h2
-rw-r--r--libmpcodecs/vf_vo.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index d0e3c1cba4..f9dbb8b4fb 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -93,6 +93,8 @@ typedef struct vf_seteq_s
* the OSD state outside of normal OSD draw time. */
#define VFCTRL_SET_OSD_OBJ 20
#define VFCTRL_REDRAW_OSD 21 /* Change user-visible OSD immediately */
+#define VFCTRL_SET_YUV_COLORSPACE 22
+#define VFCTRL_GET_YUV_COLORSPACE 23
#include "vfcap.h"
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index 7416e5f1d4..7026ac93fc 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -88,6 +88,10 @@ static int control(struct vf_instance* vf, int request, void* data)
if(!video_out) return CONTROL_FALSE; // vo not configured?
return vo_control(video_out, VOCTRL_SET_DEINTERLACE, data) == VO_TRUE;
}
+ case VFCTRL_GET_YUV_COLORSPACE:
+ return vo_control(video_out, VOCTRL_GET_YUV_COLORSPACE, data) == true;
+ case VFCTRL_SET_YUV_COLORSPACE:
+ return vo_control(video_out, VOCTRL_SET_YUV_COLORSPACE, data) == true;
case VFCTRL_DRAW_OSD:
if(!video_out->config_ok) return CONTROL_FALSE; // vo not configured?
vo_draw_osd(video_out, data);