From 3011fa7ddda622599018493f4159aa3badac2f4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 8 Oct 2021 21:14:52 +0300 Subject: [PATCH] webrtcbin: Use the same promise reply structure name everywhere This was an inconsistent mix of different names in the past. The name has no meaning at all so let's set all to "application/x-gst-promise". Part-of: --- .../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 21 ++++++++------------- .../tests/check/elements/webrtcbin.c | 4 ---- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index 1bd9d46..861b005 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -851,8 +851,7 @@ _execute_op (GstWebRTCBinTask * op) GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, "webrtcbin is closed. aborting execution."); - GstStructure *s = - gst_structure_new ("application/x-gstwebrtcbin-promise-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); gst_promise_reply (op->promise, s); @@ -3921,7 +3920,7 @@ _create_sdp_task (GstWebRTCBin * webrtc, struct create_sdp *data) g_warn_if_fail (error != NULL); GST_WARNING_OBJECT (webrtc, "returning error: %s", error ? error->message : "Unknown"); - s = gst_structure_new ("application/x-gstwebrtcbin-error", + s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); g_clear_error (&error); } @@ -3957,8 +3956,7 @@ gst_webrtc_bin_create_offer (GstWebRTCBin * webrtc, GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, "Could not create offer. webrtcbin is closed"); - GstStructure *s = - gst_structure_new ("application/x-gstwebrtcbin-promise-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); gst_promise_reply (promise, s); @@ -3982,8 +3980,7 @@ gst_webrtc_bin_create_answer (GstWebRTCBin * webrtc, GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, "Could not create answer. webrtcbin is closed."); - GstStructure *s = - gst_structure_new ("application/x-gstwebrtcbin-promise-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); gst_promise_reply (promise, s); @@ -5424,7 +5421,7 @@ out: g_strfreev (bundled); if (error) { - GstStructure *s = gst_structure_new ("application/x-gstwebrtcbin-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); GST_WARNING_OBJECT (webrtc, "returning error: %s", error->message); g_clear_error (&error); @@ -5463,8 +5460,7 @@ gst_webrtc_bin_set_remote_description (GstWebRTCBin * webrtc, GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, "Could not set remote description. webrtcbin is closed."); - GstStructure *s = - gst_structure_new ("application/x-gstwebrtcbin-promise-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); gst_promise_reply (promise, s); @@ -5502,8 +5498,7 @@ gst_webrtc_bin_set_local_description (GstWebRTCBin * webrtc, GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, "Could not set remote description. webrtcbin is closed"); - GstStructure *s = - gst_structure_new ("application/x-gstwebrtcbin-promise-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); gst_promise_reply (promise, s); @@ -5698,7 +5693,7 @@ gst_webrtc_bin_get_stats (GstWebRTCBin * webrtc, GstPad * pad, GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, "Could not retrieve statistics. webrtcbin is closed."); - GstStructure *s = gst_structure_new ("application/x-gst-promise-error", + GstStructure *s = gst_structure_new ("application/x-gst-promise", "error", G_TYPE_ERROR, error, NULL); gst_promise_reply (promise, s); diff --git a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c index da09e5d..157f185 100644 --- a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c +++ b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c @@ -3724,7 +3724,6 @@ GST_START_TEST (test_reject_create_offer) fail_unless_equals_int (res, GST_PROMISE_RESULT_REPLIED); s = gst_promise_get_reply (promise); fail_unless (s != NULL); - fail_unless (gst_structure_has_name (s, "application/x-gstwebrtcbin-error")); gst_structure_get (s, "error", G_TYPE_ERROR, &error, NULL); fail_unless (g_error_matches (error, GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_IMPOSSIBLE_MLINE_RESTRICTION)); @@ -3781,7 +3780,6 @@ GST_START_TEST (test_reject_set_description) fail_unless_equals_int (res, GST_PROMISE_RESULT_REPLIED); s = gst_promise_get_reply (promise); fail_unless (s != NULL); - fail_unless (gst_structure_has_name (s, "application/x-gst-promise")); gst_structure_get (s, "offer", GST_TYPE_WEBRTC_SESSION_DESCRIPTION, &desc, NULL); fail_unless (desc != NULL); @@ -3797,7 +3795,6 @@ GST_START_TEST (test_reject_set_description) res = gst_promise_wait (promise); fail_unless_equals_int (res, GST_PROMISE_RESULT_REPLIED); s = gst_promise_get_reply (promise); - fail_unless (gst_structure_has_name (s, "application/x-gstwebrtcbin-error")); gst_structure_get (s, "error", G_TYPE_ERROR, &error, NULL); fail_unless (g_error_matches (error, GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_IMPOSSIBLE_MLINE_RESTRICTION)); @@ -3994,7 +3991,6 @@ GST_START_TEST (test_codec_preferences_negotiation_sinkpad) fail_unless_equals_int (res, GST_PROMISE_RESULT_REPLIED); s = gst_promise_get_reply (promise); fail_unless (s != NULL); - fail_unless (gst_structure_has_name (s, "application/x-gstwebrtcbin-error")); gst_structure_get (s, "error", G_TYPE_ERROR, &error, NULL); fail_unless (g_error_matches (error, GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CAPS_NEGOTIATION_FAILED)); -- 2.7.4