Module: wine Branch: master Commit: 59dedf2754650bd84ffa7d10c94f83b97198fed2 URL: https://gitlab.winehq.org/wine/wine/-/commit/59dedf2754650bd84ffa7d10c94f83b...
Author: Rémi Bernon rbernon@codeweavers.com Date: Sun Jun 18 21:46:49 2023 +0200
winegstreamer: Remove colorimetry and chroma-site from wg_format caps.
They are set by default and will force color conversions we may not want in the wg_transform videoconvert.
---
dlls/winegstreamer/wg_format.c | 11 ++++++++--- dlls/winegstreamer/wg_parser.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c index a579a1101d1..bd0ebf892c1 100644 --- a/dlls/winegstreamer/wg_format.c +++ b/dlls/winegstreamer/wg_format.c @@ -480,12 +480,17 @@ static GstCaps *wg_format_to_caps_video(const struct wg_format *format) { for (i = 0; i < gst_caps_get_size(caps); ++i) { + GstStructure *structure = gst_caps_get_structure(caps, i); + if (!format->u.video.width) - gst_structure_remove_fields(gst_caps_get_structure(caps, i), "width", NULL); + gst_structure_remove_fields(structure, "width", NULL); if (!format->u.video.height) - gst_structure_remove_fields(gst_caps_get_structure(caps, i), "height", NULL); + gst_structure_remove_fields(structure, "height", NULL); if (!format->u.video.fps_d && !format->u.video.fps_n) - gst_structure_remove_fields(gst_caps_get_structure(caps, i), "framerate", NULL); + gst_structure_remove_fields(structure, "framerate", NULL); + + /* Remove fields which we don't specify but might have some default value */ + gst_structure_remove_fields(structure, "colorimetry", "chroma-site", NULL); } } return caps; diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index f043c4e18b4..cb2901f484d 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -721,7 +721,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) /* Clear some fields that shouldn't prevent us from connecting. */ for (i = 0; i < gst_caps_get_size(caps); ++i) gst_structure_remove_fields(gst_caps_get_structure(caps, i), - "framerate", "pixel-aspect-ratio", "colorimetry", "chroma-site", NULL); + "framerate", "pixel-aspect-ratio", NULL);
str = gst_caps_to_string(caps); GST_LOG("Stream caps are "%s".", str);