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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1099>
This commit is contained in:
Sebastian Dröge 2021-10-08 21:14:52 +03:00
parent 33ad1cdc5e
commit 3011fa7ddd
2 changed files with 8 additions and 17 deletions

View 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);

View 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));