]> git.sesse.net Git - nageru/blobdiff - nageru/theme.cpp
Support overriding color space for SRT inputs.
[nageru] / nageru / theme.cpp
index 6c75e114f97ac94899eef4e0a2f9b1c7e323e015..2bb9e807495e32a2d316ee5287a6f25b45208dc8 100644 (file)
@@ -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;