Commit 72da45d5 authored by Olivier Crête's avatar Olivier Crête
Browse files

Set direction in offer

parent 6c75e8a9
...@@ -54,6 +54,7 @@ on_offer_created (GstPromise *promise, GstElement *webrtcbin) ...@@ -54,6 +54,7 @@ on_offer_created (GstPromise *promise, GstElement *webrtcbin)
GstWebRTCSessionDescription *offer = NULL; GstWebRTCSessionDescription *offer = NULL;
gchar *sdp; gchar *sdp;
GstSDPMedia *media; GstSDPMedia *media;
guint i;
gst_structure_get (gst_promise_get_reply (promise), gst_structure_get (gst_promise_get_reply (promise),
"offer", GST_TYPE_WEBRTC_SESSION_DESCRIPTION, &offer, NULL); "offer", GST_TYPE_WEBRTC_SESSION_DESCRIPTION, &offer, NULL);
...@@ -61,6 +62,18 @@ on_offer_created (GstPromise *promise, GstElement *webrtcbin) ...@@ -61,6 +62,18 @@ on_offer_created (GstPromise *promise, GstElement *webrtcbin)
media = (GstSDPMedia *) gst_sdp_message_get_media (offer->sdp, 0); media = (GstSDPMedia *) gst_sdp_message_get_media (offer->sdp, 0);
for (i = 0; i < gst_sdp_media_attributes_len (media); i++) {
const GstSDPAttribute *a = gst_sdp_media_get_attribute (media, i);
if (!strcmp (a->key, "sendrecv")) {
GstSDPAttribute newa;
newa.key = g_strdup ("sendonly");
newa.value = g_strdup ("");
gst_sdp_media_replace_attribute (media, i, &newa);
break;
}
}
gst_sdp_media_add_attribute (media, "fmtp", gst_sdp_media_add_attribute (media, "fmtp",
"96 packetization-mode=1;profile-level-id=42e01f"); "96 packetization-mode=1;profile-level-id=42e01f");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment