GstWebRTCRTPTransceiverDirection direction, guint mline, GstWebRTCKind kind,
GstCaps * codec_preferences)
{
+ char *dir_str = gst_webrtc_rtp_transceiver_direction_to_string (direction);
WebRTCTransceiver *trans;
GstWebRTCRTPTransceiver *rtp_trans;
GstWebRTCRTPSender *sender;
/* FIXME: We don't support stopping transceiver yet so they're always not stopped */
rtp_trans->stopped = FALSE;
+ GST_LOG_OBJECT (webrtc, "created new transceiver %" GST_PTR_FORMAT " with "
+ "direction %s (%d), mline %u, kind %s (%d)", rtp_trans, dir_str,
+ direction, mline, gst_webrtc_kind_to_string (kind), kind);
+
g_signal_connect_object (sender, "notify::priority",
G_CALLBACK (gst_webrtc_bin_attach_tos), webrtc, G_CONNECT_SWAPPED);
g_signal_emit (webrtc, gst_webrtc_bin_signals[ON_NEW_TRANSCEIVER_SIGNAL],
0, trans);
+ g_free (dir_str);
+
return trans;
}
if (wtrans->mline_locked && trans->mline != media_idx) {
g_set_error (error, GST_WEBRTC_ERROR,
GST_WEBRTC_ERROR_INTERNAL_FAILURE,
- "Previous negotiatied transceiver %"
- GST_PTR_FORMAT " with mid %s was in mline %d but transceiver"
- " has locked mline %u", trans, trans->mid, media_idx,
- trans->mline);
+ "Previous negotiatied transceiver <%s> with mid %s was in "
+ "mline %d but transceiver has locked mline %u",
+ GST_OBJECT_NAME (trans), trans->mid, media_idx, trans->mline);
goto cancel_offer;
}
g_set_error (error, GST_WEBRTC_ERROR,
GST_WEBRTC_ERROR_INTERNAL_FAILURE,
- "Tranceiver %" GST_PTR_FORMAT " with mid %s has locked mline %d"
- " but the whole offer only has %u sections", trans, trans->mid,
+ "Tranceiver <%s> with mid %s has locked mline %d but the offer "
+ "only has %u sections", GST_OBJECT_NAME (trans), trans->mid,
trans->mline, media_idx);
goto cancel_offer;
}
goto rejected;
}
- if (!_update_transceiver_kind_from_caps (rtp_trans, answer_caps))
+ if (!_update_transceiver_kind_from_caps (rtp_trans, answer_caps)) {
+ GstWebRTCKind caps_kind = webrtc_kind_from_caps (answer_caps);
+
GST_WARNING_OBJECT (webrtc,
- "Trying to change transceiver %d kind from %d to %d",
- rtp_trans->mline, rtp_trans->kind,
- webrtc_kind_from_caps (answer_caps));
+ "Trying to change kind of transceiver %" GST_PTR_FORMAT
+ " at m-line %d from %s (%d) to %s (%d)", trans, rtp_trans->mline,
+ gst_webrtc_kind_to_string (rtp_trans->kind), rtp_trans->kind,
+ gst_webrtc_kind_to_string (caps_kind), caps_kind);
+ }
answer_caps = gst_caps_make_writable (answer_caps);
for (k = 0; k < gst_caps_get_size (answer_caps); k++) {
if (!g_strcmp0 (gst_sdp_media_get_media (media), "audio")) {
if (rtp_trans->kind == GST_WEBRTC_KIND_VIDEO)
- GST_FIXME_OBJECT (webrtc,
- "Updating video transceiver to audio, which isn't fully supported.");
+ GST_FIXME_OBJECT (webrtc, "Updating video transceiver %" GST_PTR_FORMAT
+ " to audio, which isn't fully supported.", rtp_trans);
rtp_trans->kind = GST_WEBRTC_KIND_AUDIO;
}
if (!g_strcmp0 (gst_sdp_media_get_media (media), "video")) {
if (rtp_trans->kind == GST_WEBRTC_KIND_AUDIO)
- GST_FIXME_OBJECT (webrtc,
- "Updating audio transceiver to video, which isn't fully supported.");
+ GST_FIXME_OBJECT (webrtc, "Updating audio transceiver %" GST_PTR_FORMAT
+ " to video, which isn't fully supported.", rtp_trans);
rtp_trans->kind = GST_WEBRTC_KIND_VIDEO;
}
if (rtp_trans->kind != GST_WEBRTC_KIND_UNKNOWN) {
if (!g_strcmp0 (gst_sdp_media_get_media (media), "audio") &&
rtp_trans->kind != GST_WEBRTC_KIND_AUDIO) {
+ char *trans_kind = gst_webrtc_kind_to_string (rtp_trans->kind);
g_set_error (error, GST_WEBRTC_ERROR,
GST_WEBRTC_ERROR_INTERNAL_FAILURE,
- "m-line %d was locked to audio, but SDP has %s media", i,
+ "m-line %d with transceiver <%s> was locked to %s, but SDP has "
+ "%s media", i, GST_OBJECT_NAME (rtp_trans), trans_kind,
gst_sdp_media_get_media (media));
+ g_free (trans_kind);
return FALSE;
}
if (!g_strcmp0 (gst_sdp_media_get_media (media), "video") &&
rtp_trans->kind != GST_WEBRTC_KIND_VIDEO) {
+ char *trans_kind = gst_webrtc_kind_to_string (rtp_trans->kind);
g_set_error (error, GST_WEBRTC_ERROR,
GST_WEBRTC_ERROR_INTERNAL_FAILURE,
- "m-line %d was locked to video, but SDP has %s media", i,
+ "m-line %d with transceiver <%s> was locked to %s, but SDP has "
+ "%s media", i, GST_OBJECT_NAME (rtp_trans), trans_kind,
gst_sdp_media_get_media (media));
+ g_free (trans_kind);
return FALSE;
}
}
if ((ret = transport_stream_get_caps_for_pt (stream, pt)))
gst_caps_ref (ret);
- GST_TRACE_OBJECT (webrtc, "Found caps %" GST_PTR_FORMAT " for pt %d in "
+ GST_DEBUG_OBJECT (webrtc, "Found caps %" GST_PTR_FORMAT " for pt %d in "
"session %d", ret, pt, session_id);
return ret;
GST_LOG_OBJECT (webrtc, "Using existing transceiver %" GST_PTR_FORMAT
" for mline %u", trans, serial);
if (caps) {
- if (!_update_transceiver_kind_from_caps (trans, caps))
+ if (!_update_transceiver_kind_from_caps (trans, caps)) {
+ GstWebRTCKind caps_kind = webrtc_kind_from_caps (caps);
+
GST_WARNING_OBJECT (webrtc,
- "Trying to change transceiver %d kind from %d to %d",
- serial, trans->kind, webrtc_kind_from_caps (caps));
+ "Trying to change kind of transceiver %" GST_PTR_FORMAT
+ " at m-line %d from %s (%d) to %s (%d)", trans, serial,
+ gst_webrtc_kind_to_string (trans->kind), trans->kind,
+ gst_webrtc_kind_to_string (caps_kind), caps_kind);
+ }
}
}
pad = _create_pad_for_sdp_media (webrtc, GST_PAD_SINK, trans, serial);
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 (g_str_match_string
- ("has locked mline 1 but the whole offer only has 0 sections",
- error->message, FALSE));
+ fail_unless_equals_string (error->message,
+ "Tranceiver <webrtctransceiver0> with mid (null) has locked mline 1 but the offer only has 0 sections");
g_clear_error (&error);
gst_promise_unref (promise);
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 (g_str_match_string
- ("m-line 0 was locked to audio, but SDP has audio media", error->message,
- FALSE));
+ fail_unless_equals_string
+ (error->message,
+ "m-line 0 with transceiver <webrtctransceiver1> was locked to video, but SDP has audio media");
g_clear_error (&error);
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 (g_str_match_string
+ fail_unless_equals_string
("Caps negotiation on pad sink_0 failed against codec preferences",
- error->message, FALSE));
+ error->message);
g_clear_error (&error);
gst_promise_unref (promise);