diff options
author | wm4 <wm4@nowhere> | 2013-08-24 19:37:34 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-08-24 19:40:18 +0200 |
commit | 47e92b2f884d4dd831e3e59ae9c692b460ef8dc3 (patch) | |
tree | 545d089a4a1be158c135fd43eaa33d4d93538925 /video/decode | |
parent | ba4654b72977b915e5f09d23ce02e099c2bd9d0f (diff) | |
download | mpv-47e92b2f884d4dd831e3e59ae9c692b460ef8dc3.tar.bz2 mpv-47e92b2f884d4dd831e3e59ae9c692b460ef8dc3.tar.xz |
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.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/dec_video.c | 28 | ||||
-rw-r--r-- | video/decode/dec_video.h | 3 | ||||
-rw-r--r-- | video/decode/vd.c | 3 |
3 files changed, 1 insertions, 33 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 22aa8f3e75..c16dc57eda 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -101,34 +101,6 @@ int get_video_colors(sh_video_t *sh_video, const char *item, int *value) return 0; } -// Return the effective video image parameters. Might be different from VO, -// and might be different from actual video bitstream/container params. -// This is affected by user-specified overrides (aspect, colorspace...). -bool get_video_params(struct sh_video *sh, struct mp_image_params *p) -{ - if (!sh->vf_input) - return false; - - *p = *sh->vf_input; - return true; -} - -void set_video_output_levels(struct sh_video *sh) -{ - struct MPOpts *opts = sh->opts; - - if (!sh->vfilter) - return; - - struct mp_csp_details csp; - if (vf_control(sh->vfilter, VFCTRL_GET_YUV_COLORSPACE, &csp) > 0) { - csp.levels_out = opts->requested_output_range; - if (csp.levels_out == MP_CSP_LEVELS_AUTO) - csp.levels_out = MP_CSP_LEVELS_PC; - vf_control(sh->vfilter, VFCTRL_SET_YUV_COLORSPACE, &csp); - } -} - void resync_video_stream(sh_video_t *sh_video) { vd_control(sh_video, VDCTRL_RESYNC_STREAM, NULL); diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 021abaaf22..339de7e860 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -37,9 +37,6 @@ int get_video_quality_max(sh_video_t *sh_video); int get_video_colors(sh_video_t *sh_video, const char *item, int *value); int set_video_colors(sh_video_t *sh_video, const char *item, int value); -struct mp_image_params; -bool get_video_params(struct sh_video *sh, struct mp_image_params *p); -void set_video_output_levels(struct sh_video *sh); void resync_video_stream(sh_video_t *sh_video); void video_reinit_vo(struct sh_video *sh_video); int get_current_video_decoder_lag(sh_video_t *sh_video); diff --git a/video/decode/vd.c b/video/decode/vd.c index 1518d78695..fad9adbdf7 100644 --- a/video/decode/vd.c +++ b/video/decode/vd.c @@ -157,6 +157,7 @@ int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params) p.colorspace = opts->requested_colorspace; if (opts->requested_input_range != MP_CSP_LEVELS_AUTO) p.colorlevels = opts->requested_input_range; + p.outputlevels = opts->requested_output_range; // Detect colorspace from resolution. // Make sure the user-overrides are consistent (no RGB csp for YUV, etc.). @@ -184,8 +185,6 @@ int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params) sh->vf_input = talloc(sh, struct mp_image_params); *sh->vf_input = p; - set_video_output_levels(sh); - if (opts->gamma_gamma != 1000) set_video_colors(sh, "gamma", opts->gamma_gamma); if (opts->gamma_brightness != 1000) |