webrtcbin: Use the same promise reply structure name everywhere
authorSebastian Dröge <sebastian@centricular.com>
Fri, 8 Oct 2021 18:14:52 +0000 (21:14 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 9 Oct 2021 08:45:46 +0000 (11:45 +0300)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1099>

subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c

index 1bd9d46..861b005 100644 (file)
@@ -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);
index da09e5d..157f185 100644 (file)
@@ -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));