}
if (!caps) {
- GST_WARNING_OBJECT (webrtc, "no caps available for transceiver %"
- GST_PTR_FORMAT ", skipping", trans);
+ if (WEBRTC_TRANSCEIVER (trans)->mline_locked) {
+ g_set_error (error, GST_WEBRTC_ERROR,
+ GST_WEBRTC_ERROR_INTERNAL_FAILURE,
+ "Transceiver <%s> with mid %s has locked mline %u, but no caps. "
+ "Can't produce offer.", GST_OBJECT_NAME (trans), trans->mid,
+ trans->mline);
+ } else {
+ GST_WARNING_OBJECT (webrtc, "no caps available for transceiver %"
+ GST_PTR_FORMAT ", skipping", trans);
+ }
return FALSE;
}
}
GST_END_TEST;
+GST_START_TEST (test_reject_create_offer_mline_locked_no_caps)
+{
+ GstHarness *h;
+ GstPromise *promise;
+ const GstStructure *s;
+ GstPromiseResult res;
+ GError *error = NULL;
+
+ h = gst_harness_new_with_padnames ("webrtcbin", "sink_0", NULL);
+
+ promise = gst_promise_new ();
+ g_signal_emit_by_name (h->element, "create-offer", NULL, promise);
+ res = gst_promise_wait (promise);
+ fail_unless_equals_int (res, GST_PROMISE_RESULT_REPLIED);
+ s = gst_promise_get_reply (promise);
+ fail_unless (s != NULL);
+ gst_structure_get (s, "error", G_TYPE_ERROR, &error, NULL);
+ fail_unless (g_error_matches (error, GST_WEBRTC_ERROR,
+ GST_WEBRTC_ERROR_INTERNAL_FAILURE));
+ fail_unless_equals_string (error->message,
+ "Transceiver <webrtctransceiver0> with mid (null) has locked mline 0,"
+ " but no caps. Can't produce offer.");
+ g_clear_error (&error);
+ gst_promise_unref (promise);
+
+ gst_harness_teardown (h);
+}
+
+GST_END_TEST;
+
GST_START_TEST (test_reject_set_description)
{
struct test_webrtc *t = test_webrtc_new ();
test_bundle_codec_preferences_rtx_no_duplicate_payloads);
tcase_add_test (tc, test_reject_request_pad);
tcase_add_test (tc, test_reject_create_offer);
+ tcase_add_test (tc, test_reject_create_offer_mline_locked_no_caps);
tcase_add_test (tc, test_reject_set_description);
tcase_add_test (tc, test_force_second_media);
tcase_add_test (tc, test_codec_preferences_caps);