diff --git a/recipes/libnice.recipe b/recipes/libnice.recipe index 27eb8ea4..b57d2e82 100644 --- a/recipes/libnice.recipe +++ b/recipes/libnice.recipe @@ -3,19 +3,21 @@ class Recipe(recipe.Recipe): name = 'libnice' version = '0.1.13' - stype = SourceType.TARBALL - url = 'http://nice.freedesktop.org/releases/%(name)s-%(version)s.tar.gz' + stype = SourceType.GIT + remotes = {'origin': 'https://github.com/pexip/libnice.git'} + commit = '1a0796dfb9dc9769ef7b15fceefd5cebd1d3152b' licenses = [License.LGPLv2_1Plus, License.MPLv1_1] + config_sh = 'sh ./autogen.sh --no-configure && ./configure' configure_options = ' --enable-static --enable-shared --with-gstreamer \ --without-gstreamer-0.10 --enable-compile-warnings=maximum \ - --disable-gtk-doc' + --disable-gtk-doc --disable-python ' deps = ['glib', 'gtk-doc-lite', 'gstreamer-1.0'] - autoreconf = True patches = [ - "libnice/0001-agent-Remove-unnecessary-NULL-check.patch", - "libnice/0002-Do-not-update-a-remote-candidate-s-type.patch", - "libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch", - "libnice/0004-Removing-no-op-assignment.patch" + "libnice/0001-agent-Add-API-to-set-local-credentials.patch" +# "libnice/0001-agent-Remove-unnecessary-NULL-check.patch", +# "libnice/0002-Do-not-update-a-remote-candidate-s-type.patch", +# "libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch", +# "libnice/0004-Removing-no-op-assignment.patch" ] files_bins = ['stunbdc', 'stund'] diff --git a/recipes/libnice/0001-agent-Add-API-to-set-local-credentials.patch b/recipes/libnice/0001-agent-Add-API-to-set-local-credentials.patch new file mode 100644 index 00000000..20d63b74 --- /dev/null +++ b/recipes/libnice/0001-agent-Add-API-to-set-local-credentials.patch @@ -0,0 +1,355 @@ +From b304c2972a1e3a9dc51b7f0d85bf1b1ae35903a0 Mon Sep 17 00:00:00 2001 +From: Rohan Garg +Date: Wed, 8 Apr 2015 23:10:14 +0200 +Subject: [PATCH] agent: Add API to set local credentials + +Adds new API: nice_agent_set_local_credentials(). +--- + agent/agent.c | 31 +++++ + agent/agent.h | 27 ++++ + docs/reference/libnice/libnice-sections.txt | 1 + + nice/libnice.sym | 1 + + tests/Makefile.am | 5 +- + tests/test-credentials.c | 204 ++++++++++++++++++++++++++++ + 6 files changed, 268 insertions(+), 1 deletion(-) + create mode 100644 tests/test-credentials.c + +diff --git a/agent/agent.c b/agent/agent.c +index a134f79..e0f2d88 100644 +--- a/agent/agent.c ++++ b/agent/agent.c +@@ -2014,6 +2014,37 @@ nice_agent_set_remote_credentials ( + return ret; + } + ++NICEAPI_EXPORT gboolean ++nice_agent_set_local_credentials ( ++ NiceAgent *agent, ++ guint stream_id, ++ const gchar *ufrag, ++ const gchar *pwd) ++{ ++ Stream *stream; ++ gboolean ret = FALSE; ++ ++ g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); ++ g_return_val_if_fail (stream_id >= 1, FALSE); ++ ++ agent_lock (); ++ ++ stream = agent_find_stream (agent, stream_id); ++ ++ /* note: oddly enough, ufrag and pwd can be empty strings */ ++ if (stream && ufrag && pwd) { ++ g_strlcpy (stream->local_ufrag, ufrag, NICE_STREAM_MAX_UFRAG); ++ g_strlcpy (stream->local_password, pwd, NICE_STREAM_MAX_PWD); ++ ++ ret = TRUE; ++ goto done; ++ } ++ ++ done: ++ agent_unlock (); ++ return ret; ++} ++ + + NICEAPI_EXPORT gboolean + nice_agent_get_local_credentials ( +diff --git a/agent/agent.h b/agent/agent.h +index 049f83a..2db6a4f 100644 +--- a/agent/agent.h ++++ b/agent/agent.h +@@ -442,6 +442,33 @@ nice_agent_set_remote_credentials ( + const gchar *ufrag, const gchar *pwd); + + ++/** ++ * nice_agent_set_local_credentials: ++ * @agent: The #NiceAgent Object ++ * @stream_id: The ID of the stream ++ * @ufrag: nul-terminated string containing an ICE username fragment ++ * (length must be between 22 and 256 chars) ++ * @pwd: nul-terminated string containing an ICE password ++ * (length must be between 4 and 256 chars) ++ * ++ * Sets the local credentials for stream @stream_id. ++ * ++ ++ ++ This is only effective before ICE negotiation has started. ++ ++ ++ * ++ * Since 0.1.11 ++ * Returns: %TRUE on success, %FALSE on error. ++ */ ++gboolean ++nice_agent_set_local_credentials ( ++ NiceAgent *agent, ++ guint stream_id, ++ const gchar *ufrag, ++ const gchar *pwd); ++ + + /** + * nice_agent_get_local_credentials: +diff --git a/docs/reference/libnice/libnice-sections.txt b/docs/reference/libnice/libnice-sections.txt +index d5a659f..48bf5cc 100644 +--- a/docs/reference/libnice/libnice-sections.txt ++++ b/docs/reference/libnice/libnice-sections.txt +@@ -17,6 +17,7 @@ nice_agent_set_relay_info + nice_agent_gather_candidates + nice_agent_set_remote_credentials + nice_agent_get_local_credentials ++nice_agent_set_local_credentials + nice_agent_set_remote_candidates + nice_agent_get_remote_candidates + nice_agent_get_local_candidates +diff --git a/nice/libnice.sym b/nice/libnice.sym +index 8822f0c..5a10208 100644 +--- a/nice/libnice.sym ++++ b/nice/libnice.sym +@@ -32,6 +32,7 @@ nice_agent_set_transport + nice_agent_set_relay_info + nice_agent_set_remote_candidates + nice_agent_set_remote_credentials ++nice_agent_set_local_credentials + nice_agent_set_selected_pair + nice_agent_set_selected_remote_candidate + nice_agent_set_software +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 967b4d7..262cfc3 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -33,7 +33,8 @@ check_PROGRAMS = \ + test-fallback \ + test-thread \ + test-dribble \ +- test-new-dribble ++ test-new-dribble \ ++ test-credentials + + dist_check_SCRIPTS = \ + check-test-fullmode-with-stun.sh +@@ -66,5 +67,7 @@ test_dribble_LDADD = $(COMMON_LDADD) + + test_new_dribble_LDADD = $(COMMON_LDADD) + ++test_credentials_LDADD = $(COMMON_LDADD) ++ + all-local: + chmod a+x $(srcdir)/check-test-fullmode-with-stun.sh +diff --git a/tests/test-credentials.c b/tests/test-credentials.c +new file mode 100644 +index 0000000..f678afa +--- /dev/null ++++ b/tests/test-credentials.c +@@ -0,0 +1,204 @@ ++/* ++ * This file is part of the Nice GLib ICE library. ++ * ++ * (C) 2015 Rohan Garg ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is the Nice GLib ICE library. ++ * ++ * The Initial Developers of the Original Code are Collabora Ltd and Nokia ++ * Corporation. All Rights Reserved. ++ * ++ * Contributors: ++ * Dafydd Harries, Collabora Ltd. ++ * Kai Vehmanen, Nokia ++ * ++ * Alternatively, the contents of this file may be used under the terms of the ++ * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which ++ * case the provisions of LGPL are applicable instead of those above. If you ++ * wish to allow use of your version of this file only under the terms of the ++ * LGPL and not to allow others to use your version of this file under the ++ * MPL, indicate your decision by deleting the provisions above and replace ++ * them with the notice and other provisions required by the LGPL. If you do ++ * not delete the provisions above, a recipient may use your version of this ++ * file under either the MPL or the LGPL. ++ */ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include "agent.h" ++#include "agent-priv.h" ++#include ++#include ++ ++#define LEFT_AGENT GINT_TO_POINTER(1) ++#define RIGHT_AGENT GINT_TO_POINTER(2) ++#define USE_UPNP 0 ++ ++static GMainLoop *loop = NULL; ++ ++static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id, guint len, gchar *buf, gpointer user_data) ++{ ++ g_debug ("test-credentials:%s: %p", G_STRFUNC, user_data); ++} ++ ++static void set_credentials(NiceAgent *lagent, NiceAgent *ragent) ++{ ++ gchar *ufrag = NULL, *password = NULL; ++ ++ g_debug ("test-credentials:%s", G_STRFUNC); ++ ++ nice_agent_get_local_credentials (lagent, 1, &ufrag, &password); ++ nice_agent_set_remote_credentials (ragent, 1, ufrag, password); ++ ++ g_free (ufrag); ++ g_free (password); ++ ++ nice_agent_get_local_credentials (ragent, 1, &ufrag, &password); ++ nice_agent_set_remote_credentials (lagent, 1, ufrag, password); ++ ++ g_free (ufrag); ++ g_free (password); ++} ++ ++static void swap_candidates(NiceAgent *local, guint local_id, NiceAgent *remote, guint remote_id) ++{ ++ GSList *cands = NULL; ++ ++ g_debug ("test-credentials:%s", G_STRFUNC); ++ cands = nice_agent_get_local_candidates(local, local_id, ++ NICE_COMPONENT_TYPE_RTP); ++ g_assert(nice_agent_set_remote_candidates(remote, remote_id, ++ NICE_COMPONENT_TYPE_RTP, cands)); ++ ++ g_slist_free_full (cands, (GDestroyNotify) nice_candidate_free); ++} ++ ++ ++static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpointer data) ++{ ++ static gboolean L_CAND_DONE = false, R_CAND_DONE = false; ++ static NiceAgent *lagent = NULL, *ragent = NULL; ++ ++ g_debug ("test-credentials:%s: %p", G_STRFUNC, data); ++ if (GPOINTER_TO_UINT(data) == 1) { ++ g_debug ("lagent finished gathering candidates"); ++ L_CAND_DONE = true; ++ lagent = agent; ++ } else if (GPOINTER_TO_UINT(data) == 2) { ++ g_debug ("ragent finished gathering candidates"); ++ R_CAND_DONE = true; ++ ragent = agent; ++ } ++ ++ if (L_CAND_DONE && R_CAND_DONE) { ++ set_credentials (lagent, ragent); ++ swap_candidates (lagent, 1, ragent, 1); ++ swap_candidates (ragent, 1, lagent, 1); ++ } ++} ++ ++static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint component_id, guint state, gpointer data) ++{ ++ if (state == NICE_COMPONENT_STATE_READY) { ++ g_main_loop_quit(loop); ++ } ++} ++ ++static void setup(NiceAgent *lagent, NiceAgent *ragent) ++{ ++ NiceAddress addr; ++ ++ g_assert (nice_agent_add_stream (lagent, 1) == 1); ++ g_assert (nice_agent_add_stream (ragent, 1) == 1); ++ g_assert (NULL != lagent->streams); ++ g_assert (NULL != ragent->streams); ++ ++ nice_address_init (&addr); ++ g_assert (nice_address_set_from_string (&addr, "127.0.0.1")); ++ nice_agent_add_local_address (lagent, &addr); ++ nice_agent_add_local_address (ragent, &addr); ++ ++ nice_agent_attach_recv (lagent, 1, NICE_COMPONENT_TYPE_RTP, ++ g_main_context_default (), ++ cb_nice_recv, LEFT_AGENT); ++ nice_agent_attach_recv (ragent, 1, NICE_COMPONENT_TYPE_RTP, ++ g_main_context_default (), ++ cb_nice_recv, RIGHT_AGENT); ++ ++ g_signal_connect(G_OBJECT(lagent), "candidate-gathering-done", ++ G_CALLBACK(cb_candidate_gathering_done), LEFT_AGENT); ++ g_signal_connect(G_OBJECT(ragent), "candidate-gathering-done", ++ G_CALLBACK(cb_candidate_gathering_done), RIGHT_AGENT); ++ ++ g_signal_connect(G_OBJECT(lagent), "component-state-changed", ++ G_CALLBACK(cb_component_state_changed), LEFT_AGENT); ++ ++ g_object_set (G_OBJECT (lagent), "ice-tcp", FALSE, NULL); ++ g_object_set (G_OBJECT (ragent), "ice-tcp", FALSE, NULL); ++ ++ g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL); ++ g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL); ++ ++ g_object_set (G_OBJECT (lagent), "upnp", USE_UPNP, NULL); ++ g_object_set (G_OBJECT (ragent), "upnp", USE_UPNP, NULL); ++ ++ g_object_set_data (G_OBJECT (lagent), "other-agent", ragent); ++ g_object_set_data (G_OBJECT (ragent), "other-agent", lagent); ++} ++ ++static void teardown(NiceAgent *lagent, NiceAgent *ragent) ++{ ++ nice_agent_remove_stream (lagent, 1); ++ nice_agent_remove_stream (ragent, 1); ++} ++ ++int main (void) ++{ ++ NiceAgent *lagent = NULL, *ragent = NULL; ++ gchar *ufrag = NULL, *password = NULL; ++ ++#ifdef G_OS_WIN32 ++ WSADATA w; ++ WSAStartup(0x0202, &w); ++#endif ++ g_type_init (); ++ g_thread_init (NULL); ++ ++ loop = g_main_loop_new (NULL, FALSE); ++ ++ lagent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245); ++ ragent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245); ++ ++ setup (lagent, ragent); ++ ++ nice_agent_set_local_credentials (lagent, 1, "unicorns", "awesome"); ++ nice_agent_get_local_credentials (lagent, 1, &ufrag, &password); ++ g_assert (g_strcmp0("unicorns", ufrag) == 0); ++ g_assert (g_strcmp0("awesome", password) == 0); ++ ++ nice_agent_gather_candidates (lagent, 1); ++ nice_agent_gather_candidates (ragent, 1); ++ ++ g_main_loop_run (loop); ++ ++ teardown (lagent, ragent); ++ ++ g_object_unref (lagent); ++ g_object_unref (ragent); ++ ++#ifdef G_OS_WIN32 ++ WSACleanup(); ++#endif ++ return 0; ++} +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc.recipe b/recipes/openwebrtc.recipe index c1f78fee..74a5c5bd 100644 --- a/recipes/openwebrtc.recipe +++ b/recipes/openwebrtc.recipe @@ -42,6 +42,15 @@ class Recipe(recipe.Recipe): 'origin': 'https://github.com/EricssonResearch/openwebrtc.git' } commit = 'origin/master' + patches = [ + 'openwebrtc/0001-configure.ac-Check-for-libnice-0.1.3-as-that-is-the-.patch', + 'openwebrtc/0002-TEMPORARY-OwrCandidate-Hack-out-TCP-SO-support.patch', + 'openwebrtc/0003-TEMPORARY-OwrTransportAgent-Disable-missing-forget-r.patch', + 'openwebrtc/0004-OwrTransportAgent-Use-Pexip-nice_agent_new.patch', + 'openwebrtc/0005-OwrTransportAgent-Add-missing-gio.h-include.patch', + 'openwebrtc/0006-Revert-transport_agent-Use-new-candidate-full-instea.patch', + 'openwebrtc/0007-OwrTransportAgent-Enable-ICE-transports.patch' + ] autoreconf = True autoreconf_sh = 'mkdir -p m4 && gtkdocize && autoreconf -fiv' # Dependencies used in the dynamic (shared) build of OWRTC diff --git a/recipes/openwebrtc/0001-configure.ac-Check-for-libnice-0.1.3-as-that-is-the-.patch b/recipes/openwebrtc/0001-configure.ac-Check-for-libnice-0.1.3-as-that-is-the-.patch new file mode 100644 index 00000000..87ceb04c --- /dev/null +++ b/recipes/openwebrtc/0001-configure.ac-Check-for-libnice-0.1.3-as-that-is-the-.patch @@ -0,0 +1,26 @@ +From b7d9e376549f9e149b79c70c154da8ec0754dc38 Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Thu, 16 Jul 2015 12:33:48 +0200 +Subject: [PATCH 1/7] configure.ac: Check for libnice 0.1.3 as that is the + Pexip version + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index d5fdc38..41a167f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -28,7 +28,7 @@ AC_SUBST(LIBOPENWEBRTC_CFLAGS) + GST_REQUIRED=1.4 + PKG_CHECK_MODULES(GLIB, [glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0]) + PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= $GST_REQUIRED gstreamer-rtp-1.0 >= $GST_REQUIRED gstreamer-video-1.0 >= $GST_REQUIRED gstreamer-app-1.0 >= $GST_REQUIRED]) +-PKG_CHECK_MODULES(NICE, [nice >= 0.1.7.1]) ++PKG_CHECK_MODULES(NICE, [nice >= 0.1.3]) + PKG_CHECK_MODULES(GSTREAMER_SCTP, [gstreamer-sctp-1.0]) + PKG_CHECK_MODULES(ORC, [orc-0.4]) + +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc/0002-TEMPORARY-OwrCandidate-Hack-out-TCP-SO-support.patch b/recipes/openwebrtc/0002-TEMPORARY-OwrCandidate-Hack-out-TCP-SO-support.patch new file mode 100644 index 00000000..c5159c53 --- /dev/null +++ b/recipes/openwebrtc/0002-TEMPORARY-OwrCandidate-Hack-out-TCP-SO-support.patch @@ -0,0 +1,38 @@ +From 6bfd048f7a4a74d8726ed90dab431ce0209f80c6 Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Fri, 17 Jul 2015 07:56:59 +0200 +Subject: [PATCH 2/7] TEMPORARY: OwrCandidate: Hack out TCP SO support + +--- + transport/owr_candidate.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/transport/owr_candidate.c b/transport/owr_candidate.c +index 9a26f21..92f1e88 100644 +--- a/transport/owr_candidate.c ++++ b/transport/owr_candidate.c +@@ -358,10 +358,6 @@ OwrCandidate * _owr_candidate_new_from_nice_candidate(NiceCandidate *nice_candid + case NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE: + transport_type = OWR_TRANSPORT_TYPE_TCP_PASSIVE; + break; +- +- case NICE_CANDIDATE_TRANSPORT_TCP_SO: +- transport_type = OWR_TRANSPORT_TYPE_TCP_SO; +- break; + } + g_return_val_if_fail(transport_type != (OwrTransportType)-1, NULL); + +@@ -453,10 +449,6 @@ NiceCandidate * _owr_candidate_to_nice_candidate(OwrCandidate *candidate) + transport = NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE; + break; + +- case OWR_TRANSPORT_TYPE_TCP_SO: +- transport = NICE_CANDIDATE_TRANSPORT_TCP_SO; +- break; +- + default: + g_return_val_if_reached(NULL); + } +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc/0003-TEMPORARY-OwrTransportAgent-Disable-missing-forget-r.patch b/recipes/openwebrtc/0003-TEMPORARY-OwrTransportAgent-Disable-missing-forget-r.patch new file mode 100644 index 00000000..6c0fd0c6 --- /dev/null +++ b/recipes/openwebrtc/0003-TEMPORARY-OwrTransportAgent-Disable-missing-forget-r.patch @@ -0,0 +1,28 @@ +From 20e5a2400edbd83913557082b5e902e2f57e088c Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Fri, 17 Jul 2015 08:08:14 +0200 +Subject: [PATCH 3/7] TEMPORARY: OwrTransportAgent: Disable missing forget + relays API + +--- + transport/owr_transport_agent.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/transport/owr_transport_agent.c b/transport/owr_transport_agent.c +index 56113f2..fc19b6b 100644 +--- a/transport/owr_transport_agent.c ++++ b/transport/owr_transport_agent.c +@@ -669,8 +669,10 @@ static void update_helper_servers(OwrTransportAgent *transport_agent, guint stre + g_return_if_fail(OWR_IS_TRANSPORT_AGENT(transport_agent)); + priv = transport_agent->priv; + ++/* + nice_agent_forget_relays(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTP); + nice_agent_forget_relays(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTCP); ++*/ + + for (item = priv->helper_server_infos; item; item = item->next) { + helper_server_info = item->data; +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc/0004-OwrTransportAgent-Use-Pexip-nice_agent_new.patch b/recipes/openwebrtc/0004-OwrTransportAgent-Use-Pexip-nice_agent_new.patch new file mode 100644 index 00000000..9a37737a --- /dev/null +++ b/recipes/openwebrtc/0004-OwrTransportAgent-Use-Pexip-nice_agent_new.patch @@ -0,0 +1,26 @@ +From 14072a6edaedf9002614af98415fd9c2a03333e8 Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Fri, 17 Jul 2015 08:11:30 +0200 +Subject: [PATCH 4/7] OwrTransportAgent: Use Pexip nice_agent_new() + +--- + transport/owr_transport_agent.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/transport/owr_transport_agent.c b/transport/owr_transport_agent.c +index fc19b6b..2fbb40c 100644 +--- a/transport/owr_transport_agent.c ++++ b/transport/owr_transport_agent.c +@@ -393,7 +393,8 @@ static void owr_transport_agent_init(OwrTransportAgent *transport_agent) + + g_return_if_fail(_owr_is_initialized()); + +- priv->nice_agent = nice_agent_new(_owr_get_main_context(), NICE_COMPATIBILITY_RFC5245); ++ priv->nice_agent = nice_agent_new(_owr_get_main_context(), ++ NICE_COMPATIBILITY_RFC5245, NICE_COMPATIBILITY_RFC5245); + g_object_bind_property(transport_agent, "ice-controlling-mode", priv->nice_agent, + "controlling-mode", G_BINDING_SYNC_CREATE); + g_signal_connect(G_OBJECT(priv->nice_agent), "new-candidate-full", +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc/0005-OwrTransportAgent-Add-missing-gio.h-include.patch b/recipes/openwebrtc/0005-OwrTransportAgent-Add-missing-gio.h-include.patch new file mode 100644 index 00000000..5a3a15fe --- /dev/null +++ b/recipes/openwebrtc/0005-OwrTransportAgent-Add-missing-gio.h-include.patch @@ -0,0 +1,24 @@ +From ed465c6d2665c69013fa84b614c0f2ecf144f633 Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Fri, 17 Jul 2015 08:15:02 +0200 +Subject: [PATCH 5/7] OwrTransportAgent: Add missing gio.h include + +--- + transport/owr_transport_agent.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/transport/owr_transport_agent.c b/transport/owr_transport_agent.c +index 2fbb40c..68e448e 100644 +--- a/transport/owr_transport_agent.c ++++ b/transport/owr_transport_agent.c +@@ -60,6 +60,7 @@ + + #include + #include ++#include + #include + #include + #include +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc/0006-Revert-transport_agent-Use-new-candidate-full-instea.patch b/recipes/openwebrtc/0006-Revert-transport_agent-Use-new-candidate-full-instea.patch new file mode 100644 index 00000000..c70a2a08 --- /dev/null +++ b/recipes/openwebrtc/0006-Revert-transport_agent-Use-new-candidate-full-instea.patch @@ -0,0 +1,121 @@ +From 41bab415479cbd9c1059b562e9ef9bf18607b52e Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Fri, 17 Jul 2015 08:32:13 +0200 +Subject: [PATCH 6/7] Revert "transport_agent: Use new-candidate-full instead + of new-candidate" + +This reverts commit 605fbcdc734444a936dde73ddc19b300f59c7503. +--- + transport/owr_transport_agent.c | 45 +++++++++++++++++++++++++++++------------ + 1 file changed, 32 insertions(+), 13 deletions(-) + +diff --git a/transport/owr_transport_agent.c b/transport/owr_transport_agent.c +index 68e448e..ef7065f 100644 +--- a/transport/owr_transport_agent.c ++++ b/transport/owr_transport_agent.c +@@ -171,7 +171,7 @@ static void prepare_transport_bin_data_receive_elements(OwrTransportAgent *trans + static void prepare_transport_bin_data_send_elements(OwrTransportAgent *transport_agent, + guint stream_id); + static void set_send_ssrc_and_cname(OwrTransportAgent *agent, OwrMediaSession *media_session); +-static void on_new_candidate(NiceAgent *nice_agent, NiceCandidate *nice_candidate, OwrTransportAgent *transport_agent); ++static void on_new_candidate(NiceAgent *nice_agent, guint stream_id, guint component_id, gchar *foundation, OwrTransportAgent *transport_agent); + static void on_candidate_gathering_done(NiceAgent *nice_agent, guint stream_id, OwrTransportAgent *transport_agent); + static void on_component_state_changed(NiceAgent *nice_agent, guint stream_id, guint component_id, OwrIceState state, OwrTransportAgent *transport_agent); + static void handle_new_send_payload(OwrTransportAgent *transport_agent, OwrMediaSession *media_session, OwrPayload * payload); +@@ -398,7 +398,7 @@ static void owr_transport_agent_init(OwrTransportAgent *transport_agent) + NICE_COMPATIBILITY_RFC5245, NICE_COMPATIBILITY_RFC5245); + g_object_bind_property(transport_agent, "ice-controlling-mode", priv->nice_agent, + "controlling-mode", G_BINDING_SYNC_CREATE); +- g_signal_connect(G_OBJECT(priv->nice_agent), "new-candidate-full", ++ g_signal_connect(G_OBJECT(priv->nice_agent), "new-candidate", + G_CALLBACK(on_new_candidate), transport_agent); + g_signal_connect(G_OBJECT(priv->nice_agent), "candidate-gathering-done", + G_CALLBACK(on_candidate_gathering_done), transport_agent); +@@ -1606,7 +1606,10 @@ static gboolean emit_new_candidate(GHashTable *args) + OwrTransportAgent *transport_agent; + OwrTransportAgentPrivate *priv; + OwrSession *session; +- NiceCandidate *nice_candidate; ++ guint stream_id, component_id; ++ gchar *foundation; ++ GSList *lcands, *item; ++ NiceCandidate *nice_candidate = NULL; + OwrCandidate *owr_candidate; + gchar *ufrag = NULL, *password = NULL; + gboolean got_credentials; +@@ -1615,14 +1618,27 @@ static gboolean emit_new_candidate(GHashTable *args) + g_return_val_if_fail(OWR_IS_TRANSPORT_AGENT(transport_agent), FALSE); + priv = transport_agent->priv; + +- nice_candidate = (NiceCandidate *)g_hash_table_lookup(args, "nice_candidate"); +- g_return_val_if_fail(nice_candidate, FALSE); +- session = get_session(transport_agent, nice_candidate->stream_id); ++ stream_id = GPOINTER_TO_UINT(g_hash_table_lookup(args, "stream_id")); ++ component_id = GPOINTER_TO_UINT(g_hash_table_lookup(args, "component_id")); ++ foundation = g_hash_table_lookup(args, "foundation"); ++ ++ session = get_session(transport_agent, stream_id); + g_return_val_if_fail(OWR_IS_SESSION(session), FALSE); + ++ lcands = nice_agent_get_local_candidates(priv->nice_agent, stream_id, component_id); ++ for (item = lcands; item; item = item->next) { ++ nice_candidate = item->data; ++ g_warn_if_fail(nice_candidate->component_id == component_id); ++ ++ if (!g_strcmp0(nice_candidate->foundation, foundation)) ++ break; ++ } ++ if (!item) ++ goto out; ++ + if (!nice_candidate->username || !nice_candidate->password) { +- got_credentials = nice_agent_get_local_credentials(priv->nice_agent, +- nice_candidate->stream_id, &ufrag, &password); ++ got_credentials = nice_agent_get_local_credentials(priv->nice_agent, stream_id, ++ &ufrag, &password); + g_warn_if_fail(got_credentials); + + if (!nice_candidate->username) +@@ -1638,31 +1654,34 @@ static gboolean emit_new_candidate(GHashTable *args) + + owr_candidate = _owr_candidate_new_from_nice_candidate(nice_candidate); + g_return_val_if_fail(owr_candidate, FALSE); +- nice_candidate_free(nice_candidate); + + g_signal_emit_by_name(session, "on-new-candidate", owr_candidate); + g_object_unref(owr_candidate); + ++out: ++ g_slist_free_full(lcands, (GDestroyNotify)nice_candidate_free); + g_object_unref(session); ++ g_free(foundation); + g_hash_table_destroy(args); + g_object_unref(transport_agent); + + return FALSE; + } + +-static void on_new_candidate(NiceAgent *nice_agent, NiceCandidate *nice_candidate, +- OwrTransportAgent *transport_agent) ++static void on_new_candidate(NiceAgent *nice_agent, guint stream_id, guint component_id, ++ gchar *foundation, OwrTransportAgent *transport_agent) + { + GHashTable *args; + + g_return_if_fail(nice_agent); + g_return_if_fail(OWR_IS_TRANSPORT_AGENT(transport_agent)); +- g_return_if_fail(nice_candidate); + + g_object_ref(transport_agent); + args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(transport_agent)); + g_hash_table_insert(args, "transport_agent", transport_agent); +- g_hash_table_insert(args, "nice_candidate", nice_candidate_copy(nice_candidate)); ++ g_hash_table_insert(args, "stream_id", GUINT_TO_POINTER(stream_id)); ++ g_hash_table_insert(args, "component_id", GUINT_TO_POINTER(component_id)); ++ g_hash_table_insert(args, "foundation", g_strdup(foundation)); + + _owr_schedule_with_hash_table((GSourceFunc)emit_new_candidate, args); + +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/openwebrtc/0007-OwrTransportAgent-Enable-ICE-transports.patch b/recipes/openwebrtc/0007-OwrTransportAgent-Enable-ICE-transports.patch new file mode 100644 index 00000000..80037a51 --- /dev/null +++ b/recipes/openwebrtc/0007-OwrTransportAgent-Enable-ICE-transports.patch @@ -0,0 +1,32 @@ +From 0c968d4e2c90800ea9234a43344efe8709471b90 Mon Sep 17 00:00:00 2001 +From: Robert Swain +Date: Fri, 17 Jul 2015 14:52:25 +0200 +Subject: [PATCH 7/7] OwrTransportAgent: Enable ICE transports + +--- + transport/owr_transport_agent.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/transport/owr_transport_agent.c b/transport/owr_transport_agent.c +index ef7065f..84edbe0 100644 +--- a/transport/owr_transport_agent.c ++++ b/transport/owr_transport_agent.c +@@ -952,6 +952,15 @@ static gboolean add_session(GHashTable *args) + goto end; + } + ++ nice_agent_set_transport(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTP, NICE_CANDIDATE_TRANSPORT_UDP); ++ nice_agent_set_transport(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTP, NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE); ++ nice_agent_set_transport(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTP, NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE); ++ if (!rtcp_mux) { ++ nice_agent_set_transport(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTCP, NICE_CANDIDATE_TRANSPORT_UDP); ++ nice_agent_set_transport(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTCP, NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE); ++ nice_agent_set_transport(priv->nice_agent, stream_id, NICE_COMPONENT_TYPE_RTCP, NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE); ++ } ++ + g_mutex_lock(&priv->sessions_lock); + g_hash_table_insert(priv->sessions, GUINT_TO_POINTER(stream_id), session); + g_object_ref(session); +-- +2.3.2 (Apple Git-55) +