This speeds up pipeline creation and fixes a timing issue where caps negotiation is not completed prior to the first buffer being sent.
-- v2: winegstreamer: Allow decodebin to eliminate caps that don't use system memory.
From: Brendan McGrath bmcgrath@codeweavers.com
nvh264dec fixates a caps using CUDAMemory, which is not accepted by deinterlace. Linking triggers a reconfigure, but due to a GStreamer bug some buffers are sent with the CUDAMemory caps, triggering a streaming error. Work around this by forcing all buffers to use system memory --- dlls/winegstreamer/wg_parser.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index fc14eaf3a98..e806298fb57 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -555,6 +555,39 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, return GST_AUTOPLUG_SELECT_TRY; }
+static gboolean autoplug_query_cb(GstElement *bin, GstPad *child, + GstElement *pad, GstQuery *query, gpointer user) +{ + GstCapsFeatures *features; + GstCaps *filter, *result; + GstStructure *structure; + guint i; + + GST_INFO("Query %"GST_PTR_FORMAT, query); + + if (query->type == GST_QUERY_CAPS) + { + result = gst_caps_new_empty(); + gst_query_parse_caps(query, &filter); + for (i = 0; i < gst_caps_get_size(filter); i++) + { + if (!(features = gst_caps_get_features(filter, i)) + || gst_caps_features_contains(features, GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY)) + { + structure = gst_caps_get_structure(filter, i); + gst_caps_append_structure(result, gst_structure_copy(structure)); + } + } + + GST_INFO("Result %"GST_PTR_FORMAT, result); + gst_query_set_caps_result(query, result); + + return TRUE; + } + + return FALSE; +} + static void no_more_pads_cb(GstElement *element, gpointer user) { struct wg_parser *parser = user; @@ -1809,6 +1842,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser); + g_signal_connect(element, "autoplug-query", G_CALLBACK(autoplug_query_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser);
There is a very long line introduced by the patch; please break it before the "||".
Done
Please also adjust the commit message
Done
On investigation I don't think I see how pipeline creation is going to be sped up, since we always trigger a reconfigure anyway?
You're right. My thinking (at the time of writing that commit message) was that by eliminating the need to change the caps, it meant we sped up the caps neg and didn't run in to the timing issue. But that's not quite right. It just means we have acceptable caps for deinterlace either side of that renegotiation.
Sorry about the delay
No worries, I appreciate the thoroughness!
This merge request was approved by Elizabeth Figura.