From a686614f5976c9ca8b3a7e6248cdeb8c5f2c66ec Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 16 May 2020 10:15:30 +0200 Subject: [PATCH] Support overriding color space for SRT inputs. This is mainly for completeness. --- nageru/theme.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nageru/theme.cpp b/nageru/theme.cpp index 6c75e11..2bb9e80 100644 --- a/nageru/theme.cpp +++ b/nageru/theme.cpp @@ -1202,7 +1202,14 @@ void LiveInputWrapper::connect_card(int card_idx, const InputState &input_state) ycbcr_inputs[i]->set_texture_num(0, userdata->tex_y[frame.field_number]); ycbcr_inputs[i]->set_texture_num(1, userdata->tex_cb[frame.field_number]); ycbcr_inputs[i]->set_texture_num(2, userdata->tex_cr[frame.field_number]); - ycbcr_inputs[i]->change_ycbcr_format(userdata->ycbcr_format); + // YCbCrPlanar is used for video streams, where we can have metadata from the mux. + // Prefer that if there's no override. (Overrides are only available when using + // video as SRT cards.) + if (input_state.ycbcr_coefficients_auto[card_idx]) { + ycbcr_inputs[i]->change_ycbcr_format(userdata->ycbcr_format); + } else { + ycbcr_inputs[i]->change_ycbcr_format(input_ycbcr_format); + } ycbcr_inputs[i]->set_width(width); ycbcr_inputs[i]->set_height(height); break; -- 2.39.2