From 47e92b2f884d4dd831e3e59ae9c692b460ef8dc3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 24 Aug 2013 19:37:34 +0200 Subject: video: handle video output levels with mp_image_params Until now, video output levels (obscure feature, like using TV screens that require RGB output in limited range, similar to YUY) still required handling of VOCTRL_SET_YUV_COLORSPACE. Simplify this, and use the new mp_image_params code. This gets rid of some code. VOCTRL_SET_YUV_COLORSPACE is not needed at all anymore in VOs that use the reconfig callback. The result of VOCTRL_GET_YUV_COLORSPACE is now used only used for the colormatrix related properties (basically, for display on OSD). For other VOs, VOCTRL_SET_YUV_COLORSPACE will be sent only once after config instead of twice. --- video/filter/vf.c | 1 + video/filter/vf.h | 2 -- video/filter/vf_vo.c | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) (limited to 'video/filter') diff --git a/video/filter/vf.c b/video/filter/vf.c index 85a03cfa85..a8469c9203 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -499,6 +499,7 @@ int vf_next_config(struct vf_instance *vf, .colorspace = vf->fmt_in.params.colorspace, .colorlevels = vf->fmt_in.params.colorlevels, .chroma_location = vf->fmt_in.params.chroma_location, + .outputlevels = vf->fmt_in.params.outputlevels, }; // Fix csp in case of pixel format change mp_image_params_guess_csp(&p); diff --git a/video/filter/vf.h b/video/filter/vf.h index 29ce051869..730b0e0da0 100644 --- a/video/filter/vf.h +++ b/video/filter/vf.h @@ -106,8 +106,6 @@ typedef struct vf_seteq { /* Hack to make the OSD state object available to vf_sub which * access OSD/subtitle state outside of normal OSD draw time. */ #define VFCTRL_SET_OSD_OBJ 20 -#define VFCTRL_SET_YUV_COLORSPACE 22 // arg is struct mp_csp_details* -#define VFCTRL_GET_YUV_COLORSPACE 23 // arg is struct mp_csp_details* int vf_control(struct vf_instance *vf, int cmd, void *arg); diff --git a/video/filter/vf_vo.c b/video/filter/vf_vo.c index b3e7b7bd60..05f835d5fd 100644 --- a/video/filter/vf_vo.c +++ b/video/filter/vf_vo.c @@ -65,10 +65,6 @@ static int control(struct vf_instance *vf, int request, void *data) return vo_control(video_out, VOCTRL_GET_DEINTERLACE, data) == VO_TRUE; case VFCTRL_SET_DEINTERLACE: 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_SET_EQUALIZER: { vf_equalizer_t *eq = data; if (!video_out->config_ok) -- cgit v1.2.3