From c431e0434c6381c823006a456315674d41d7c697 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 27 Jan 2016 15:07:15 -0800 Subject: [PATCH] win-dshow: Pass proper range value to frame The "full_range" member variable of the video frame was being passed "false" each time even though it may not necessarily be set to partial range --- plugins/win-dshow/win-dshow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index 6ead461d3..38d6fa3ff 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -440,7 +440,6 @@ void DShowInput::OnVideoData(const VideoConfig &config, frame.width = config.cx; frame.height = config.cy; frame.format = ConvertVideoFormat(config.format); - frame.full_range = false; frame.flip = (config.format == VideoFormat::XRGB || config.format == VideoFormat::ARGB); @@ -957,13 +956,16 @@ inline bool DShowInput::Activate(obs_data_t *settings) if (!device.ConnectFilters()) return false; + enum video_colorspace cs = GetColorSpace(settings); + + video_range_type range = GetColorRange(settings); + frame.full_range = range == VIDEO_RANGE_FULL; + if (device.Start() != Result::Success) return false; - enum video_colorspace cs = GetColorSpace(settings); - bool success = video_format_get_parameters( - cs, GetColorRange(settings), + cs, range, frame.color_matrix, frame.color_range_min, frame.color_range_max);