diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2019-05-14 19:29:27 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-15 07:43:22 +0100 |
commit | cdd8ec39a102d43091e5941b4d59610c25112bab (patch) | |
tree | a1a9d0e9669f5d0b1568ccff51746e0e667bcab9 /recipes/libnice | |
parent | d1a2845b7d0edf83e4cfcde090568142a4d0685d (diff) |
recipes: libnice: upgrade to 0.1.16
Patch 0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch
is no longer needed, libnice now drops all packets before a conncheck
has succeeded as per WebRTC's recommendations, and webrtcbin also works
around the lack of this patch.
Patch 0001-meson-install-.pc-file-for-static-gstreamer-plugin.patch is
upstream now.
https://gitlab.freedesktop.org/gstreamer/cerbero/merge_requests/173
Diffstat (limited to 'recipes/libnice')
-rw-r--r-- | recipes/libnice/0001-meson-install-.pc-file-for-static-gstreamer-plugin.patch | 36 | ||||
-rw-r--r-- | recipes/libnice/0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch | 253 |
2 files changed, 0 insertions, 289 deletions
diff --git a/recipes/libnice/0001-meson-install-.pc-file-for-static-gstreamer-plugin.patch b/recipes/libnice/0001-meson-install-.pc-file-for-static-gstreamer-plugin.patch deleted file mode 100644 index 1938d1a3..00000000 --- a/recipes/libnice/0001-meson-install-.pc-file-for-static-gstreamer-plugin.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 006688afe7d6ea76dcf6d4426cdf538315445c07 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com> -Date: Tue, 15 Jan 2019 12:26:57 +0000 -Subject: [PATCH] meson: install .pc file for static gstreamer plugin - ---- - gst/meson.build | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/gst/meson.build b/gst/meson.build -index 15a5079..091a37f 100644 ---- a/gst/meson.build -+++ b/gst/meson.build -@@ -6,11 +6,18 @@ gst_nice_sources = [ - - gst_nice_args = ['-DGST_USE_UNSTABLE_API'] - -+gst_plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0') -+ - libgstnice = library('gstnice', - gst_nice_sources, - c_args : gst_nice_args, - include_directories: nice_incs, - dependencies: [nice_deps, gst_dep], - link_with: libnice, -- install_dir: join_paths(get_option('libdir'), 'gstreamer-1.0'), -+ install_dir: gst_plugins_install_dir, - install: true) -+ -+# Generate pc files for static plugins if we build static plugins -+if get_option('default_library') != 'shared' -+ pkg.generate(libgstnice, install_dir: join_paths(gst_plugins_install_dir, 'pkgconfig')) -+endif --- -2.20.1 - diff --git a/recipes/libnice/0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch b/recipes/libnice/0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch deleted file mode 100644 index ee5206ca..00000000 --- a/recipes/libnice/0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch +++ /dev/null @@ -1,253 +0,0 @@ -From e0583a05ddb65a3c9326266a769678aff82a009a Mon Sep 17 00:00:00 2001 -From: Alessandro Decina <alessandro.d@gmail.com> -Date: Tue, 13 Oct 2015 12:49:19 +1100 -Subject: [PATCH] nicesrc: spin the agent mainloop in a separate thread - -Don't run the mainloop from the srcpad task, since that can get blocked in the -pipeline and cause unnecessary STUN retrasmissions (at best) and completely -block the agent (at worst). ---- - gst/gstnicesrc.c | 158 +++++++++++++++++++++++++++-------------------- - gst/gstnicesrc.h | 4 +- - 2 files changed, 93 insertions(+), 69 deletions(-) - -diff --git a/gst/gstnicesrc.c b/gst/gstnicesrc.c -index 0d39c34..954323c 100644 ---- a/gst/gstnicesrc.c -+++ b/gst/gstnicesrc.c -@@ -48,6 +48,14 @@ GST_DEBUG_CATEGORY_STATIC (nicesrc_debug); - - #define BUFFER_SIZE (65536) - -+static gboolean -+gst_nice_src_start ( -+ GstBaseSrc *basesrc); -+ -+static gboolean -+gst_nice_src_stop ( -+ GstBaseSrc *basesrc); -+ - static GstFlowReturn - gst_nice_src_create ( - GstPushSrc *basesrc, -@@ -57,10 +65,6 @@ static gboolean - gst_nice_src_unlock ( - GstBaseSrc *basesrc); - --static gboolean --gst_nice_src_unlock_stop ( -- GstBaseSrc *basesrc); -- - static void - gst_nice_src_set_property ( - GObject *object, -@@ -116,8 +120,9 @@ gst_nice_src_class_init (GstNiceSrcClass *klass) - gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_nice_src_create); - - gstbasesrc_class = (GstBaseSrcClass *) klass; -+ gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_nice_src_start); -+ gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_nice_src_stop); - gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_nice_src_unlock); -- gstbasesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_nice_src_unlock_stop); - - gobject_class = (GObjectClass *) klass; - gobject_class->set_property = gst_nice_src_set_property; -@@ -179,9 +184,83 @@ gst_nice_src_init (GstNiceSrc *src) - src->component_id = 0; - src->mainctx = g_main_context_new (); - src->mainloop = g_main_loop_new (src->mainctx, FALSE); -- src->unlocked = FALSE; -- src->idle_source = NULL; - src->outbufs = g_queue_new (); -+ src->agent_io_thread = NULL; -+ g_cond_init (&src->outcond); -+} -+ -+static gpointer -+gst_nice_src_agent_io_thread (gpointer data) -+{ -+ GstNiceSrc *nicesrc = GST_NICE_SRC (data); -+ -+ GST_INFO_OBJECT (nicesrc, "starting agent io thread"); -+ g_main_loop_run (nicesrc->mainloop); -+ GST_INFO_OBJECT (nicesrc, "exiting agent io thread"); -+ -+ return NULL; -+} -+ -+static gboolean -+main_loop_running_cb (gpointer data) -+{ -+ GstNiceSrc *nicesrc = GST_NICE_SRC (data); -+ -+ GST_OBJECT_LOCK (nicesrc); -+ /* _start() and _stop() could both be waiting for the mainloop to start so we -+ * need to broadcast */ -+ g_cond_broadcast (&nicesrc->outcond); -+ GST_OBJECT_UNLOCK (nicesrc); -+ -+ return FALSE; -+} -+ -+static gboolean -+gst_nice_src_start (GstBaseSrc * basesrc) -+{ -+ GstNiceSrc *nicesrc = GST_NICE_SRC (basesrc); -+ GSource *source; -+ gchar *thread_name; -+ -+ GST_OBJECT_LOCK (nicesrc); -+ source = g_idle_source_new (); -+ g_source_set_callback (source, -+ (GSourceFunc) main_loop_running_cb, nicesrc, NULL); -+ g_source_attach (source, nicesrc->mainctx); -+ g_source_unref (source); -+ -+ thread_name = g_strdup_printf ("%s:agent_io", GST_OBJECT_NAME (nicesrc)); -+ nicesrc->agent_io_thread = g_thread_new (thread_name, gst_nice_src_agent_io_thread, nicesrc); -+ g_free (thread_name); -+ /* wait until the agent thread starts spinning the mainloop or _stop() is -+ * called */ -+ while (GST_BASE_SRC_IS_STARTING (basesrc) && -+ !g_main_loop_is_running (nicesrc->mainloop)) -+ g_cond_wait (&nicesrc->outcond, GST_OBJECT_GET_LOCK (nicesrc)); -+ GST_OBJECT_UNLOCK (nicesrc); -+ -+ return TRUE; -+} -+ -+static gboolean -+gst_nice_src_stop (GstBaseSrc * basesrc) -+{ -+ GstNiceSrc *nicesrc = GST_NICE_SRC (basesrc); -+ GThread *agent_io_thread = NULL; -+ -+ GST_OBJECT_LOCK (nicesrc); -+ /* here we wait for the agent thread created in _start() to be scheduled so -+ * that we don't risk calling _quit() first and then _run() on the mainloop */ -+ while (!g_main_loop_is_running (nicesrc->mainloop)) -+ g_cond_wait (&nicesrc->outcond, GST_OBJECT_GET_LOCK (nicesrc)); -+ g_main_loop_quit (nicesrc->mainloop); -+ agent_io_thread = nicesrc->agent_io_thread; -+ nicesrc->agent_io_thread = NULL; -+ GST_OBJECT_UNLOCK (nicesrc); -+ -+ g_thread_join (agent_io_thread); -+ -+ return TRUE; - } - - static void -@@ -207,62 +286,17 @@ gst_nice_src_read_callback (NiceAgent *agent, - #endif - GST_OBJECT_LOCK (nicesrc); - g_queue_push_tail (nicesrc->outbufs, buffer); -- g_main_loop_quit (nicesrc->mainloop); -+ g_cond_signal (&nicesrc->outcond); - GST_OBJECT_UNLOCK (nicesrc); - } - --static gboolean --gst_nice_src_unlock_idler (gpointer data) --{ -- GstNiceSrc *nicesrc = GST_NICE_SRC (data); -- -- GST_OBJECT_LOCK (nicesrc); -- if (nicesrc->unlocked) -- g_main_loop_quit (nicesrc->mainloop); -- -- if (nicesrc->idle_source) { -- g_source_destroy (nicesrc->idle_source); -- g_source_unref (nicesrc->idle_source); -- nicesrc->idle_source = NULL; -- } -- GST_OBJECT_UNLOCK (nicesrc); -- -- return FALSE; --} -- - static gboolean - gst_nice_src_unlock (GstBaseSrc *src) - { - GstNiceSrc *nicesrc = GST_NICE_SRC (src); - - GST_OBJECT_LOCK (src); -- nicesrc->unlocked = TRUE; -- -- g_main_loop_quit (nicesrc->mainloop); -- -- if (!nicesrc->idle_source) { -- nicesrc->idle_source = g_idle_source_new (); -- g_source_set_priority (nicesrc->idle_source, G_PRIORITY_HIGH); -- g_source_set_callback (nicesrc->idle_source, gst_nice_src_unlock_idler, src, NULL); -- g_source_attach (nicesrc->idle_source, g_main_loop_get_context (nicesrc->mainloop)); -- } -- GST_OBJECT_UNLOCK (src); -- -- return TRUE; --} -- --static gboolean --gst_nice_src_unlock_stop (GstBaseSrc *src) --{ -- GstNiceSrc *nicesrc = GST_NICE_SRC (src); -- -- GST_OBJECT_LOCK (src); -- nicesrc->unlocked = FALSE; -- if (nicesrc->idle_source) { -- g_source_destroy (nicesrc->idle_source); -- g_source_unref(nicesrc->idle_source); -- } -- nicesrc->idle_source = NULL; -+ g_cond_signal (&nicesrc->outcond); - GST_OBJECT_UNLOCK (src); - - return TRUE; -@@ -278,19 +312,8 @@ gst_nice_src_create ( - GST_LOG_OBJECT (nicesrc, "create called"); - - GST_OBJECT_LOCK (basesrc); -- if (nicesrc->unlocked) { -- GST_OBJECT_UNLOCK (basesrc); --#if GST_CHECK_VERSION (1,0,0) -- return GST_FLOW_FLUSHING; --#else -- return GST_FLOW_WRONG_STATE; --#endif -- } -- if (g_queue_is_empty (nicesrc->outbufs)) { -- GST_OBJECT_UNLOCK (basesrc); -- g_main_loop_run (nicesrc->mainloop); -- GST_OBJECT_LOCK (basesrc); -- } -+ if (g_queue_is_empty (nicesrc->outbufs)) -+ g_cond_wait (&nicesrc->outcond, GST_OBJECT_GET_LOCK (nicesrc)); - - *buffer = g_queue_pop_head (nicesrc->outbufs); - GST_OBJECT_UNLOCK (basesrc); -@@ -330,6 +353,7 @@ gst_nice_src_dispose (GObject *object) - g_queue_free_full (src->outbufs, (GDestroyNotify) gst_buffer_unref); - } - src->outbufs = NULL; -+ g_cond_clear (&src->outcond); - - G_OBJECT_CLASS (gst_nice_src_parent_class)->dispose (object); - } -diff --git a/gst/gstnicesrc.h b/gst/gstnicesrc.h -index 5d3f554..2d9f674 100644 ---- a/gst/gstnicesrc.h -+++ b/gst/gstnicesrc.h -@@ -68,8 +68,8 @@ struct _GstNiceSrc - GMainContext *mainctx; - GMainLoop *mainloop; - GQueue *outbufs; -- gboolean unlocked; -- GSource *idle_source; -+ GCond outcond; -+ GThread *agent_io_thread; - }; - - typedef struct _GstNiceSrcClass GstNiceSrcClass; --- -2.20.1 - |