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/mp_image.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'video/mp_image.h') diff --git a/video/mp_image.h b/video/mp_image.h index 7a70ec6a35..ac981533a0 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -37,6 +37,9 @@ #define MP_IMGFIELD_BOTTOM 0x10 #define MP_IMGFIELD_INTERLACED 0x20 +// Describes image parameters that usually stay constant. +// New fields can be added in the future. Code changing the parameters should +// usually copy the whole struct, so that fields added later will be preserved. struct mp_image_params { enum mp_imgfmt imgfmt; // pixel format int w, h; // image dimensions @@ -44,6 +47,10 @@ struct mp_image_params { enum mp_csp colorspace; enum mp_csp_levels colorlevels; enum mp_chroma_location chroma_location; + // The image should be converted to these levels. Unlike colorlevels, it + // does not describe the current state of the image. (Somewhat similar to + // d_w/d_h vs. w/h.) + enum mp_csp_levels outputlevels; }; /* Memory management: -- cgit v1.2.3