diff --git a/.gitignore b/.gitignore index bf0ee7c..f333de8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /farstream-0.2.4.tar.gz /farstream-0.2.7.tar.gz /farstream-0.2.8.tar.gz +/farstream-0.2.9.tar.gz diff --git a/farstream-0.2.8-30-g092d884d.patch b/farstream-0.2.8-30-g092d884d.patch deleted file mode 100644 index 3ff29c8..0000000 --- a/farstream-0.2.8-30-g092d884d.patch +++ /dev/null @@ -1,7129 +0,0 @@ -From fefa55ae7f2236264a7578dfd50e9945d5b0b1b9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 16 Jun 2016 10:57:32 -0400 -Subject: [PATCH 02/30] rtp-tfrc: Fix memset to the right size - -This was reported from static analysis by dcb314@hotmail.com - -https://bugs.freedesktop.org/show_bug.cgi?id=96546 ---- - gst/fsrtpconference/fs-rtp-tfrc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gst/fsrtpconference/fs-rtp-tfrc.c b/gst/fsrtpconference/fs-rtp-tfrc.c -index 11aa6b1b..f1435519 100644 ---- a/gst/fsrtpconference/fs-rtp-tfrc.c -+++ b/gst/fsrtpconference/fs-rtp-tfrc.c -@@ -158,7 +158,7 @@ fs_rtp_tfrc_init (FsRtpTfrc *self) - - self->extension_type = EXTENSION_NONE; - self->extension_id = 0; -- memset (self->pts, 0, 128); -+ memset (self->pts, 0, 128 * sizeof (gboolean)); - - self->systemclock = gst_system_clock_obtain (); - } -@@ -1444,7 +1444,7 @@ fs_rtp_tfrc_codecs_updated (FsRtpTfrc *self, - - GST_OBJECT_LOCK (self); - -- memset (self->pts, 0, 128); -+ memset (self->pts, 0, 128 * sizeof (gboolean)); - for (item = codec_associations; item; item = item->next) - { - CodecAssociation *ca = item->data; --- -2.21.0 - -From 482550e7e47cf48dd4bdab3adfe0d1777e20743a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Tue, 21 Jun 2016 15:40:59 -0400 -Subject: [PATCH 03/30] Sync with latest common/ - ---- - common | 2 +- - common-modified/gst-glib-gen.mak | 6 +-- - common-modified/gtk-doc-plugins.mak | 69 +++++++++++------------------ - common-modified/gtk-doc.mak | 37 +++++++++++----- - 4 files changed, 54 insertions(+), 60 deletions(-) - -diff --git a/common-modified/gst-glib-gen.mak b/common-modified/gst-glib-gen.mak -index 2d29b036..d14f5c64 100644 ---- a/common-modified/gst-glib-gen.mak -+++ b/common-modified/gst-glib-gen.mak -@@ -10,16 +10,16 @@ enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") - - # these are all the rules generating the relevant files - $(glib_gen_basename)-enumtypes.h: $(glib_enum_headers) -- $(AM_V_GEN)glib-mkenums \ -+ $(AM_V_GEN)$(GLIB_MKENUMS) \ - --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ - --fprod "\n/* enumerations from \"@filename@\" */\n" \ -- --vhead "GType @enum_name@_get_type (void);\n#define FS_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ -+ --vhead "GType @enum_name@_get_type (void);\n#define FS_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ - $^ > $@ - - $(glib_gen_basename)-enumtypes.c: $(glib_enum_headers) - @if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi -- $(AM_V_GEN)glib-mkenums \ -+ $(AM_V_GEN)$(GLIB_MKENUMS) \ - --fhead "#include \"$(glib_gen_basename)-enumtypes.h\"\n$(enum_headers)" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {" \ -diff --git a/common-modified/gtk-doc-plugins.mak b/common-modified/gtk-doc-plugins.mak -index 017aedc6..82dbad46 100644 ---- a/common-modified/gtk-doc-plugins.mak -+++ b/common-modified/gtk-doc-plugins.mak -@@ -14,10 +14,19 @@ help: - @echo - - # update the stuff maintained by doc maintainers --update: -- $(MAKE) scanobj-update -+update: scanobj-update - $(MAKE) check-outdated-docs - -+if GTK_DOC_USE_LIBTOOL -+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -+GTKDOC_RUN = $(LIBTOOL) --mode=execute -+else -+GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -+GTKDOC_RUN = -+endif -+ - # We set GPATH here; this gives us semantics for GNU make - # which are more like other make's VPATH, when it comes to - # whether a source that is a target of one rule is then -@@ -29,8 +38,7 @@ GPATH = $(srcdir) - TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@FS_APIVERSION@ - - MAINTAINER_DOC_STAMPS = \ -- scanobj-build.stamp \ -- scanobj-trans-build.stamp -+ scanobj-build.stamp - - EXTRA_DIST = \ - $(MAINTAINER_DOC_STAMPS) \ -@@ -47,17 +55,15 @@ EXTRA_DIST = \ - # maintainers and result is commited to git - DOC_STAMPS = \ - scan-build.stamp \ -- tmpl-build.stamp \ - sgml-build.stamp \ - html-build.stamp \ - scan.stamp \ -- tmpl.stamp \ - sgml.stamp \ - html.stamp - - # files generated/updated by gtkdoc-scangobj - SCANOBJ_FILES = \ -- $(DOC_MODULE).args \ -+ $(DOC_MODULE).args \ - $(DOC_MODULE).hierarchy \ - $(DOC_MODULE).interfaces \ - $(DOC_MODULE).prerequisites \ -@@ -97,9 +103,9 @@ all-local: html-build.stamp - INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml - INSPECT_ENVIRONMENT=\ - LC_ALL=C \ -- GST_PLUGIN_SYSTEM_PATH= \ -- GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \ -- GST_REGISTRY=$(INSPECT_REGISTRY) \ -+ GST_PLUGIN_SYSTEM_PATH_1_0= \ -+ GST_PLUGIN_PATH_1_0=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \ -+ GST_REGISTRY_1_0=$(INSPECT_REGISTRY) \ - PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ - $(INSPECT_EXTRA_ENVIRONMENT) - -@@ -125,14 +131,14 @@ scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles) - scanobj_options="--verbose"; \ - fi; \ - $(INSPECT_ENVIRONMENT) \ -- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ -+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \ - CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS) $(WARNING_CFLAGS)" \ - LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - $(GST_DOC_SCANOBJ) $$scanobj_options --type-init-func="gst_init(NULL,NULL)" \ - --module=$(DOC_MODULE) --source=$(PACKAGE) --inspect-dir=$(INSPECT_DIR) && \ - echo " DOC Merging introspection data" && \ - $(PYTHON) \ -- $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE); \ -+ $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE) || exit 1; \ - if test x"$(srcdir)" != x. ; then \ - for f in $(SCANOBJ_FILES); \ - do \ -@@ -164,34 +170,12 @@ scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp - --ignore-headers="$(IGNORE_HFILES)"; \ - touch scan-build.stamp - --#### update templates; done on every build #### -- --### FIXME: make this error out again when docs are fixed for 0.9 --# in a non-srcdir build, we need to copy files from the previous step --# and the files from previous runs of this step --tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES) -- @echo ' DOC Rebuilding template files' -- @if test x"$(srcdir)" != x. ; then \ -- for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ -- do \ -- if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ -- done; \ -- fi -- @gtkdoc-mktmpl --module=$(DOC_MODULE) -- @$(PYTHON) \ -- $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/$(INSPECT_DIR) tmpl -- @touch tmpl-build.stamp -- --tmpl.stamp: tmpl-build.stamp -- @true -- - #### xml #### - --### FIXME: make this error out again when docs are fixed for 0.9 --sgml-build.stamp: tmpl.stamp scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl $(expand_content_files) -+sgml-build.stamp: scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl $(expand_content_files) - @echo ' DOC Building XML' - @-mkdir -p xml -- @for a in $(srcdir)/$(INSPECT_DIR)/*.xml; do \ -+ @for a in $(inspect_files); do \ - xsltproc --stringparam module $(MODULE) \ - $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done - @for f in $(EXAMPLE_CFILES); do \ -@@ -204,6 +188,7 @@ sgml-build.stamp: tmpl.stamp scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common - --output-format=xml \ - --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \ - $(MKDB_OPTIONS) -+ @$(PYTHON) $(top_srcdir)/common/mangle-db.py xml - @cp ../version.entities xml - @touch sgml-build.stamp - -@@ -227,10 +212,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - mkhtml_options="$$mkhtml_options --verbose"; \ - fi; \ - fi; \ -- cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) -- @mv html/index.sgml html/index.sgml.bak -- @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_API_VERSION@\//g" html/index.sgml.bak >html/index.sgml -- @rm -f html/index.sgml.bak -+ cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_API_VERSION@ $(DOC_MAIN_SGML_FILE) - @rm -f html/$(DOC_MAIN_SGML_FILE) - @rm -rf html/xml - @rm -f html/version.entities -@@ -253,8 +235,8 @@ clean-local-gtkdoc: - endif - - clean-local: clean-local-gtkdoc -- rm -f *~ *.bak -- rm -rf .libs -+ @rm -f *~ *.bak -+ @rm -rf .libs - - distclean-local: - @rm -f $(REPORT_FILES) \ -@@ -299,8 +281,7 @@ install-data-local: - $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \ - $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@FS_APIVERSION@.devhelp2; \ - fi; \ -- (which gtkdoc-rebase >/dev/null && \ -- gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || true ; \ -+ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ - fi) - uninstall-local: - if test -d $(DESTDIR)$(TARGET_DIR); then \ -diff --git a/common-modified/gtk-doc.mak b/common-modified/gtk-doc.mak -index be81d9b9..37542ec2 100644 ---- a/common-modified/gtk-doc.mak -+++ b/common-modified/gtk-doc.mak -@@ -3,7 +3,16 @@ - ########################################################################### - # thomas: except of course that we did - --# thomas: copied from glib-2 -+if GTK_DOC_USE_LIBTOOL -+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -+GTKDOC_RUN = $(LIBTOOL) --mode=execute -+else -+GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -+GTKDOC_RUN = -+endif -+ - # We set GPATH here; this gives us semantics for GNU make - # which are more like other make's VPATH, when it comes to - # whether a source that is a target of one rule is then -@@ -81,17 +90,25 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) - --ignore-headers="$(IGNORE_HFILES)" - @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \ - echo " DOC Introspecting gobjects"; \ -- GST_PLUGIN_SYSTEM_PATH=`cd $(top_builddir) && pwd` \ -- GST_PLUGIN_PATH= \ -- GST_REGISTRY=doc-registry.xml \ -+ scanobj_options=""; \ -+ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ -+ if test "$$?" = "0"; then \ -+ if test "x$(V)" = "x1"; then \ -+ scanobj_options="--verbose"; \ -+ fi; \ -+ fi; \ -+ GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \ -+ GST_PLUGIN_PATH_1_0= \ -+ GST_REGISTRY_1_0=doc-registry.xml \ - $(GTKDOC_EXTRA_ENVIRONMENT) \ -- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ -+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \ - CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \ - LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \ -- --module=$(DOC_MODULE) ; \ -+ $$scanobj_options --module=$(DOC_MODULE) ; \ - else \ - for i in $(SCANOBJ_FILES) ; do \ -+ $(MKDIR_P) $(dirname $$i) ; \ - test -f $$i || touch $$i ; \ - done \ - fi -@@ -130,10 +147,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - if test "$(?)" = "0"; then \ - mkhtml_options=--path="$(abs_srcdir)"; \ - fi; \ -- cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -- @mv html/index.sgml html/index.sgml.bak -- @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_API_VERSION@\//g" html/index.sgml.bak >html/index.sgml -- @rm -f html/index.sgml.bak -+ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) - @rm -rf html/xml - @rm -f version.entities - @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) -@@ -194,8 +208,7 @@ install-data-local: - $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \ - $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@FS_APIVERSION@.devhelp2; \ - fi; \ -- (which gtkdoc-rebase >/dev/null && \ -- gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || true ; \ -+ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ - fi) - uninstall-local: - if test -d $(DESTDIR)$(TARGET_DIR); then \ --- -2.21.0 - -From e5b221d844163f2ba5baedbf63c13d3ef87db388 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Mon, 11 Jul 2016 18:27:59 -0400 -Subject: [PATCH 04/30] rtp-codec-specific: Document types better - ---- - gst/fsrtpconference/fs-rtp-codec-specific.h | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/gst/fsrtpconference/fs-rtp-codec-specific.h b/gst/fsrtpconference/fs-rtp-codec-specific.h -index e269c083..069f3425 100644 ---- a/gst/fsrtpconference/fs-rtp-codec-specific.h -+++ b/gst/fsrtpconference/fs-rtp-codec-specific.h -@@ -34,11 +34,13 @@ G_BEGIN_DECLS - /* - * These are the basic types: - * -- * @FS_PARAM_TYPE_SEND: The parameter define what we are allowed to send -- * @FS_PARAM_TYPE_RECV: The parameter defines what will be received, -+ * @FS_PARAM_TYPE_SEND: The parameter define what we are allowed to send, it -+ * describes the capabilities of the decoder -+ * @FS_PARAM_TYPE_RECV: The parameter defines what will be received, it -+ * describes the stream - * @FS_PARAM_TYPE_CONFIG: The parameter is some configuration that must be - * fed to the decoder to be able to decode the stream -- * @FS_PARAM_TYPE_SEND_AVOID_NEGO: The parameter is not negotiated and can -+ * @FS_PARAM_TYPE_SEND_AVOID_NEGO: The send parameter is not negotiated and can - * be different on both sides - * @FS_PARAM_TYPE_MANDATORY: This parameter is mandatory and the codec's - * definition is not useful without it. --- -2.21.0 - -From 4c483cb097ab5bf1c6ac51c47e77bbbc12bcf5a9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 14 Jul 2016 17:06:27 -0400 -Subject: [PATCH 05/30] doc: Put stream message parsers in right section - ---- - docs/libs/farstream-libs-sections.txt | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/docs/libs/farstream-libs-sections.txt b/docs/libs/farstream-libs-sections.txt -index e9324ade..f9695dc4 100644 ---- a/docs/libs/farstream-libs-sections.txt -+++ b/docs/libs/farstream-libs-sections.txt -@@ -34,6 +34,11 @@ fs_stream_force_remote_candidates - fs_stream_set_decryption_parameters - fs_stream_destroy - fs_stream_iterate_src_pads -+fs_stream_parse_component_state_changed -+fs_stream_parse_local_candidates_prepared -+fs_stream_parse_new_active_candidate_pair -+fs_stream_parse_new_local_candidate -+fs_stream_parse_recv_codecs_changed - fs_stream_add_id - fs_stream_emit_error - fs_stream_emit_src_pad_added -@@ -209,11 +214,6 @@ fs_stream_transmitter_gather_local_candidates - fs_stream_transmitter_force_remote_candidates - fs_stream_transmitter_stop - fs_stream_transmitter_emit_error --fs_stream_parse_component_state_changed --fs_stream_parse_local_candidates_prepared --fs_stream_parse_new_active_candidate_pair --fs_stream_parse_new_local_candidate --fs_stream_parse_recv_codecs_changed - - FS_IS_STREAM_TRANSMITTER - FS_IS_STREAM_TRANSMITTER_CLASS --- -2.21.0 - -From d91fc0fb3e57f4231126cd30df44ffaad5ee6ab3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 14 Jul 2016 17:07:00 -0400 -Subject: [PATCH 06/30] rtp-codec-specific: Add OPUS non-negotiation - -Also include unit test ---- - gst/fsrtpconference/fs-rtp-codec-specific.c | 14 +- - tests/check/rtp/codecs.c | 255 ++++++++++++++++++++ - 2 files changed, 268 insertions(+), 1 deletion(-) - -diff --git a/gst/fsrtpconference/fs-rtp-codec-specific.c b/gst/fsrtpconference/fs-rtp-codec-specific.c -index 20767d18..55f2172d 100644 ---- a/gst/fsrtpconference/fs-rtp-codec-specific.c -+++ b/gst/fsrtpconference/fs-rtp-codec-specific.c -@@ -279,6 +279,19 @@ static const struct SdpNegoFunction sdp_nego_functions[] = { - {"height", FS_PARAM_TYPE_SEND, param_minimum} - } - }, -+ /* OPUS: RFC 7687 */ -+ {FS_MEDIA_TYPE_AUDIO, "OPUS", sdp_negotiate_codec_default, -+ { -+ {"sprop-maxcapturerate", FS_PARAM_TYPE_CONFIG | FS_PARAM_TYPE_RECV, param_copy}, -+ {"sprop-stereo", FS_PARAM_TYPE_CONFIG | FS_PARAM_TYPE_RECV, param_copy}, -+ /* Not sure how to handle those */ -+ {"maxplaybackrate", FS_PARAM_TYPE_SEND_AVOID_NEGO, param_copy}, -+ {"stereo", FS_PARAM_TYPE_SEND_AVOID_NEGO, param_copy}, -+ {"cbr", FS_PARAM_TYPE_SEND_AVOID_NEGO, param_copy}, -+ {"useinbandfec", FS_PARAM_TYPE_SEND_AVOID_NEGO, param_copy}, -+ {"usedtx", FS_PARAM_TYPE_SEND_AVOID_NEGO, param_copy}, -+ } -+ }, - {0, NULL, NULL} - }; - -@@ -1227,7 +1240,6 @@ param_list_commas (const struct SdpParam *sdp_param, - return TRUE; - } - -- - /** - * param_copy: - * -diff --git a/tests/check/rtp/codecs.c b/tests/check/rtp/codecs.c -index 0bf10336..f512580b 100644 ---- a/tests/check/rtp/codecs.c -+++ b/tests/check/rtp/codecs.c -@@ -2173,6 +2173,12 @@ GST_START_TEST (test_rtpcodecs_nego_h264) - test_one_codec (dat->session, participant, prefcodec, outprefcodec, - codec, outcodec); - -+ codec = fs_codec_new (96, "H264", FS_MEDIA_TYPE_VIDEO, 90000); -+ fs_codec_add_optional_parameter (codec, "sprop-init-buf-time", "1"); -+ outcodec = fs_codec_new (96, "H264", FS_MEDIA_TYPE_VIDEO, 90000); -+ test_one_codec (dat->session, participant, prefcodec, outprefcodec, -+ codec, outcodec); -+ - /* Now test the minimum_reporting_interval property */ - - codec = fs_codec_new (96, "H264", FS_MEDIA_TYPE_VIDEO, 90000); -@@ -2209,6 +2215,251 @@ GST_START_TEST (test_rtpcodecs_nego_h264) - } - GST_END_TEST; - -+static gboolean -+check_opus_params (struct SimpleTestConference *dat, const gchar *param, -+ const gchar *value) -+{ -+ GList *codecs = NULL, *item; -+ gboolean ret = FALSE; -+ -+ g_object_get (dat->session, "codecs", &codecs, NULL); -+ -+ for (item = codecs; item; item = item->next) -+ { -+ FsCodec *codec = item->data; -+ if (!g_ascii_strcasecmp ("OPUS", codec->encoding_name)) { -+ if (fs_codec_get_optional_parameter (codec, param, value)) -+ ret = TRUE; -+ break; -+ } -+ } -+ fs_codec_list_destroy (codecs); -+ -+ return ret; -+} -+ -+static void -+opus_src_caps_set_cb (GstPad *pad, GParamSpec *spec, gpointer user_data) -+{ -+ GstCaps **desired_src_caps = user_data; -+ GstCaps *current_caps; -+ -+ current_caps = gst_pad_get_current_caps (pad); -+ -+ if (current_caps) { -+ g_print ("caps: %s\n", gst_caps_to_string (gst_pad_get_current_caps (pad))); -+ g_mutex_lock (&check_mutex); -+ if (*desired_src_caps) { -+ if (gst_caps_can_intersect (current_caps, *desired_src_caps)) { -+ gst_caps_replace (desired_src_caps, 0); -+ g_cond_broadcast (&check_cond); -+ } -+ } -+ g_mutex_unlock (&check_mutex); -+ gst_caps_unref (current_caps); -+ } -+} -+ -+static void -+opus_src_pad_added_cb (FsStream *self, GstPad *pad, FsCodec *codec, -+ gpointer user_data) -+{ -+ GstCaps **desired_src_caps = user_data; -+ GstCaps *current_caps; -+ -+ current_caps = gst_pad_get_current_caps (pad); -+ -+ if (current_caps) { -+ g_print ("caps: %s\n", gst_caps_to_string (gst_pad_get_current_caps (pad))); -+ g_mutex_lock (&check_mutex); -+ if (*desired_src_caps) { -+ if (gst_caps_can_intersect (current_caps, *desired_src_caps)) { -+ gst_caps_replace (desired_src_caps, 0); -+ g_cond_broadcast (&check_cond); -+ } -+ } -+ g_mutex_unlock (&check_mutex); -+ gst_caps_unref (current_caps); -+ } else { -+ g_signal_connect (pad, "notify::caps", G_CALLBACK (opus_src_caps_set_cb), -+ user_data); -+ } -+} -+ -+GST_START_TEST (test_rtpcodecs_nego_opus) -+{ -+ struct SimpleTestConference *dat = NULL; -+ FsCodec *codec = NULL; -+ FsCodec *outcodec = NULL; -+ FsCodec *prefcodec = NULL; -+ FsCodec *outprefcodec = NULL; -+ FsParticipant *participant; -+ GError *error = NULL; -+ GstCaps *caps; -+ FsStream *stream; -+ GstBus *bus; -+ GstElement *src; -+ GstPad *srcpad, *sinkpad; -+ gboolean done = FALSE; -+ GList *codecs = NULL, *item; -+ GError *gerror = NULL; -+ GstCaps *desired_src_caps = NULL; -+ FsCandidate *rtp_cand = NULL; -+ GstElement *send_pipeline; -+ gchar *tmp; -+ -+ setup_codec_tests (&dat, &participant, FS_MEDIA_TYPE_AUDIO); -+ -+ -+ outprefcodec = fs_codec_new (FS_CODEC_ID_ANY, "OPUS", FS_MEDIA_TYPE_AUDIO, -+ 48000); -+ outprefcodec->channels = 2; -+ -+ prefcodec = fs_codec_copy (outprefcodec); -+ fs_codec_add_optional_parameter (prefcodec, "farstream-recv-profile", -+ "rtpopusdepay ! identity"); -+ fs_codec_add_optional_parameter (prefcodec, "farstream-send-profile", -+ "identity ! rtpopuspay"); -+ -+ caps = gst_caps_from_string ("audio/x-opus; audio/x-raw"); -+ fail_unless (fs_session_set_allowed_caps (dat->session, caps, caps, &error)); -+ g_assert_no_error (error); -+ gst_caps_unref (caps); -+ -+ -+ codec = fs_codec_new (96, "OPUS", FS_MEDIA_TYPE_AUDIO, 48000); -+ outcodec = fs_codec_new (96, "OPUS", FS_MEDIA_TYPE_AUDIO, 48000); -+ outcodec->channels = 2; -+ test_one_codec (dat->session, participant, prefcodec, outprefcodec, -+ codec, outcodec); -+ -+ codec = fs_codec_new (96, "OPUS", FS_MEDIA_TYPE_AUDIO, 48000); -+ fs_codec_add_optional_parameter (codec, "sprop-stereo", "1"); -+ fs_codec_add_optional_parameter (codec, "stereo", "1"); -+ outcodec = fs_codec_new (96, "OPUS", FS_MEDIA_TYPE_AUDIO, 48000); -+ outcodec->channels = 2; -+ test_one_codec (dat->session, participant, prefcodec, outprefcodec, -+ codec, outcodec); -+ -+ fs_codec_destroy (outprefcodec); -+ fs_codec_destroy (prefcodec); -+ cleanup_codec_tests (dat, participant); -+ -+ -+ -+ dat = setup_simple_conference (1, "fsrtpconference", "bob@127.0.0.1"); -+ participant = fs_conference_new_participant ( -+ FS_CONFERENCE (dat->conference), &gerror); -+ g_assert_no_error (gerror); -+ -+ stream = fs_session_new_stream (dat->session, participant, -+ FS_DIRECTION_BOTH, &gerror); -+ g_assert_no_error (gerror); -+ -+ g_object_get (dat->session, "codecs-without-config", &codecs, NULL); -+ for (item = codecs; item; item = item->next) -+ { -+ FsCodec *codec = item->data; -+ if (!g_ascii_strcasecmp ("OPUS", codec->encoding_name)) -+ break; -+ -+ } -+ fs_codec_list_destroy (codecs); -+ -+ if (!item) -+ { -+ GST_WARNING ("Could not find Opus encoder/decoder/payloader/depayloaders," -+ " so we are skipping the config-data test"); -+ goto out; -+ } -+ -+ g_object_set (dat->session, "no-rtcp-timeout", 0, NULL); -+ -+ g_object_get (dat->session, "sink-pad", &sinkpad, NULL); -+ src = gst_parse_bin_from_description ( -+ "audiotestsrc ! audio/x-raw, rate=16000, channels=1 ! identity", TRUE, -+ &gerror); -+ g_assert_no_error (gerror); -+ g_assert (src); -+ gst_bin_add (GST_BIN (dat->pipeline), src); -+ srcpad = gst_element_get_static_pad (src, "src"); -+ g_assert (srcpad); -+ gst_pad_link (srcpad, sinkpad); -+ g_object_unref (sinkpad); -+ g_object_unref (srcpad); -+ gst_element_set_state (dat->pipeline, GST_STATE_PLAYING); -+ -+ fs_stream_set_transmitter (stream, "rawudp", NULL, 0, &gerror); -+ g_assert_no_error (gerror); -+ -+ desired_src_caps = gst_caps_from_string ("audio/x-raw, clock=rate=24000," -+ " channels=2"); -+ -+ g_signal_connect (stream, "src-pad-added", G_CALLBACK (opus_src_pad_added_cb), -+ &desired_src_caps); -+ -+ codec = fs_codec_new (96, "OPUS", FS_MEDIA_TYPE_AUDIO, 48000); -+ fs_codec_add_optional_parameter (codec, "sprop-stereo", "1"); -+ fs_codec_add_optional_parameter (codec, "sprop-maxcapturerate", "24000"); -+ codecs = g_list_append (NULL, codec); -+ fs_stream_set_remote_codecs (stream, codecs, &gerror); -+ fs_codec_list_destroy (codecs); -+ g_assert_no_error (gerror); -+ -+ done = check_opus_params (dat, "sprop-maxcapturerate", "16000") && -+ check_opus_params (dat, "sprop-stereo", "0"); -+ -+ bus = gst_pipeline_get_bus (GST_PIPELINE (dat->pipeline)); -+ -+ -+ while (!done || rtp_cand == NULL) { -+ GstMessage *msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, -+ GST_MESSAGE_ELEMENT); -+ FsCandidate *cand = NULL; -+ -+ g_assert (msg); -+ -+ if (fs_session_parse_codecs_changed (dat->session, msg)) { -+ done = check_opus_params (dat, "sprop-maxcapturerate", "16000") && -+ check_opus_params (dat, "sprop-stereo", "0"); -+ } else if (fs_stream_parse_new_local_candidate (stream, msg, &cand)) { -+ if (cand->component_id == 1) -+ rtp_cand = fs_candidate_copy (cand); -+ } -+ gst_message_unref (msg); -+ } -+ gst_object_unref (bus); -+ -+ g_assert (check_opus_params (dat, "sprop-maxcapturerate", "16000")); -+ g_assert (check_opus_params (dat, "sprop-stereo", "0")); -+ -+ tmp = g_strdup_printf ( -+ "audiotestsrc ! opusenc ! rtpopuspay ! udpsink port=%d", rtp_cand->port); -+ send_pipeline = gst_parse_launch (tmp, &gerror); -+ g_assert_no_error (gerror); -+ g_free (tmp); -+ -+ fs_candidate_destroy (rtp_cand); -+ gst_element_set_state (send_pipeline, GST_STATE_PLAYING); -+ -+ g_mutex_lock (&check_mutex); -+ while (desired_src_caps != NULL) -+ g_cond_wait (&check_cond, &check_mutex); -+ g_mutex_unlock (&check_mutex); -+ -+ gst_element_set_state (send_pipeline, GST_STATE_NULL); -+ gst_object_unref (send_pipeline); -+ -+ gst_element_set_state (dat->pipeline, GST_STATE_NULL); -+ out: -+ -+ fs_stream_destroy (stream); -+ g_object_unref (stream); -+ g_object_unref (participant); -+ -+ cleanup_simple_conference (dat); -+} -+GST_END_TEST; - - GST_START_TEST (test_rtpcodecs_nego_feedback) - { -@@ -2564,6 +2815,10 @@ fsrtpcodecs_suite (void) - tcase_add_test (tc_chain, test_rtpcodecs_nego_h264); - suite_add_tcase (s, tc_chain); - -+ tc_chain = tcase_create ("fsrtpcodecs_nego_opus"); -+ tcase_add_test (tc_chain, test_rtpcodecs_nego_opus); -+ suite_add_tcase (s, tc_chain); -+ - tc_chain = tcase_create ("fsrtpcodecs_nego_feedback"); - tcase_add_test (tc_chain, test_rtpcodecs_nego_feedback); - suite_add_tcase (s, tc_chain); --- -2.21.0 - -From 1dcbbb07cbc8c3f05e3c86d21713d1a059eb2486 Mon Sep 17 00:00:00 2001 -From: Jeremy Bicha -Date: Wed, 17 Aug 2016 02:51:38 -0400 -Subject: [PATCH 07/30] Add missing includes to fix docs build - -https://bugs.freedesktop.org/97376 ---- - docs/plugins/farstream-plugins.types | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/docs/plugins/farstream-plugins.types b/docs/plugins/farstream-plugins.types -index 79a6b2a9..ddacd280 100644 ---- a/docs/plugins/farstream-plugins.types -+++ b/docs/plugins/farstream-plugins.types -@@ -1,4 +1,8 @@ - #include -+#include "../../gst/fsrtpconference/fs-rtp-participant.h" -+#include "../../gst/fsrtpconference/fs-rtp-session.h" -+#include "../../gst/fsrtpconference/fs-rtp-stream.h" -+#include "../../gst/fsmsnconference/fs-msn-conference.h" - fs_rtp_participant_get_type - fs_rtp_session_get_type - fs_rtp_stream_get_type --- -2.21.0 - -From 36a64eaa3ad4b40ca4622ea752003b780fc439ef Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Sun, 18 Dec 2016 11:15:44 -0500 -Subject: [PATCH 08/30] docs: Add missing include - -Patch from Laurent Bigonville ---- - docs/plugins/farstream-plugins.types | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/docs/plugins/farstream-plugins.types b/docs/plugins/farstream-plugins.types -index ddacd280..892ca678 100644 ---- a/docs/plugins/farstream-plugins.types -+++ b/docs/plugins/farstream-plugins.types -@@ -3,6 +3,7 @@ - #include "../../gst/fsrtpconference/fs-rtp-session.h" - #include "../../gst/fsrtpconference/fs-rtp-stream.h" - #include "../../gst/fsmsnconference/fs-msn-conference.h" -+#include "../../gst/fsmsnconference/fs-msn-participant.h" - fs_rtp_participant_get_type - fs_rtp_session_get_type - fs_rtp_stream_get_type --- -2.21.0 - -From dd86619a48117049a9aa765bbb4b0d2a3313046e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Sun, 18 Dec 2016 11:17:18 -0500 -Subject: [PATCH 09/30] rtp: Switch VP8 to standard encoding name - -This has been changed in GStreamer a very long time ago. - -Issue reported by Fabrice Bellet - -https://bugs.freedesktop.org/show_bug.cgi?id=99122 ---- - gst/fsrtpconference/default-codec-preferences | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gst/fsrtpconference/default-codec-preferences b/gst/fsrtpconference/default-codec-preferences -index 95a0a7d6..12745624 100644 ---- a/gst/fsrtpconference/default-codec-preferences -+++ b/gst/fsrtpconference/default-codec-preferences -@@ -51,7 +51,7 @@ id=-1 - feedback:nack/pli= - - # We like VP8, but H.264 is still better --[video/VP8-DRAFT-IETF-01] -+[video/VP8] - - [video/H263] - feedback:nack/pli= --- -2.21.0 - -From 433898b123957ae1319da579f356bc1f1c989309 Mon Sep 17 00:00:00 2001 -From: Fabrice Bellet -Date: Sun, 11 Dec 2016 19:17:36 +0100 -Subject: [PATCH 10/30] nice-stream-transmitter: fix a memory leak - -https://bugs.freedesktop.org/show_bug.cgi?id=99123 ---- - transmitters/nice/fs-nice-stream-transmitter.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c -index e126d9ae..5dbff443 100644 ---- a/transmitters/nice/fs-nice-stream-transmitter.c -+++ b/transmitters/nice/fs-nice-stream-transmitter.c -@@ -1419,10 +1419,12 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self, - self->priv->preferred_local_candidates)) - { - fs_candidate_list_destroy (prefs); -+ g_free (stun_server); - break; - } - fs_candidate_list_destroy (prefs); - } -+ g_free (stun_server); - } - - --- -2.21.0 - -From 11dde55cbaf5179e8e1885cf1483e538a8d5a4a9 Mon Sep 17 00:00:00 2001 -From: Jakub Adam -Date: Thu, 14 Apr 2016 15:17:50 +0200 -Subject: [PATCH 11/30] rtpbitrateadapter: should make no adaption by default - -Description of "bitrate" property says 0 (the default value) means -the element performs no adaption, and so one would assume it would -remain passive until "bitrate" is set to some nonzero value. However, -when "bitrate" is left unset, the adapter instead requests video in tiny -128x96 resolution on its sink pad. - -In order for fs_rtp_bitrate_adapter_getcaps() to return peer_caps by -default, the value of FsRtpBitrateAdapter::bitrate has to be initialized -to G_MAXUINT. - -Also fix the comments to say that MAXUINT is no adaptation. - -https://bugs.freedesktop.org/show_bug.cgi?id=99183 ---- - gst/fsrtpconference/fs-rtp-bitrate-adapter.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/gst/fsrtpconference/fs-rtp-bitrate-adapter.c b/gst/fsrtpconference/fs-rtp-bitrate-adapter.c -index e8684fd5..99ea03a0 100644 ---- a/gst/fsrtpconference/fs-rtp-bitrate-adapter.c -+++ b/gst/fsrtpconference/fs-rtp-bitrate-adapter.c -@@ -55,6 +55,7 @@ enum - }; - - #define PROP_INTERVAL_DEFAULT (10 * GST_SECOND) -+#define PROP_BITRATE_DEFAULT (G_MAXUINT) - - static void fs_rtp_bitrate_adapter_finalize (GObject *object); - static void fs_rtp_bitrate_adapter_set_property (GObject *object, -@@ -105,8 +106,8 @@ fs_rtp_bitrate_adapter_class_init (FsRtpBitrateAdapterClass *klass) - PROP_BITRATE, - g_param_spec_uint ("bitrate", - "Bitrate to adapt for", -- "The bitrate to adapt for (0 means no adaption)", -- 0, G_MAXUINT, 0, -+ "The bitrate to adapt for (MAXUINT means no adaption)", -+ 0, G_MAXUINT, PROP_BITRATE_DEFAULT, - G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property (gobject_class, -@@ -161,6 +162,7 @@ fs_rtp_bitrate_adapter_init (FsRtpBitrateAdapter *self) - self->system_clock = gst_system_clock_obtain (); - self->interval = PROP_INTERVAL_DEFAULT; - -+ self->bitrate = PROP_BITRATE_DEFAULT; - self->last_bitrate = G_MAXUINT; - } - --- -2.21.0 - -From 182fb0223bee9067cafa00c5c6a56b71e6c892a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Fri, 24 Jul 2015 19:29:38 -0400 -Subject: [PATCH 12/30] Remove MSN plugin - ---- - .gitignore | 1 - - README | 3 - - configure.ac | 2 - - docs/plugins/Makefile.am | 8 - - docs/plugins/farstream-plugins-docs.sgml | 9 - - docs/plugins/farstream-plugins-sections.txt | 115 -- - docs/plugins/farstream-plugins.types | 4 - - gst/fsmsnconference/Makefile.am | 66 - - .../fs-msn-cam-recv-conference.c | 86 -- - .../fs-msn-cam-recv-conference.h | 69 - - .../fs-msn-cam-send-conference.c | 85 -- - .../fs-msn-cam-send-conference.h | 69 - - gst/fsmsnconference/fs-msn-conference.c | 311 ----- - gst/fsmsnconference/fs-msn-conference.h | 75 -- - gst/fsmsnconference/fs-msn-connection.c | 1134 ----------------- - gst/fsmsnconference/fs-msn-connection.h | 97 -- - gst/fsmsnconference/fs-msn-participant.c | 65 - - gst/fsmsnconference/fs-msn-participant.h | 79 -- - gst/fsmsnconference/fs-msn-session.c | 544 -------- - gst/fsmsnconference/fs-msn-session.h | 90 -- - gst/fsmsnconference/fs-msn-stream.c | 912 ------------- - gst/fsmsnconference/fs-msn-stream.h | 86 -- - tests/check/Makefile.am | 5 - - tests/check/msn/conference.c | 424 ------ - 24 files changed, 4339 deletions(-) - delete mode 100644 gst/fsmsnconference/Makefile.am - delete mode 100644 gst/fsmsnconference/fs-msn-cam-recv-conference.c - delete mode 100644 gst/fsmsnconference/fs-msn-cam-recv-conference.h - delete mode 100644 gst/fsmsnconference/fs-msn-cam-send-conference.c - delete mode 100644 gst/fsmsnconference/fs-msn-cam-send-conference.h - delete mode 100644 gst/fsmsnconference/fs-msn-conference.c - delete mode 100644 gst/fsmsnconference/fs-msn-conference.h - delete mode 100644 gst/fsmsnconference/fs-msn-connection.c - delete mode 100644 gst/fsmsnconference/fs-msn-connection.h - delete mode 100644 gst/fsmsnconference/fs-msn-participant.c - delete mode 100644 gst/fsmsnconference/fs-msn-participant.h - delete mode 100644 gst/fsmsnconference/fs-msn-session.c - delete mode 100644 gst/fsmsnconference/fs-msn-session.h - delete mode 100644 gst/fsmsnconference/fs-msn-stream.c - delete mode 100644 gst/fsmsnconference/fs-msn-stream.h - delete mode 100644 tests/check/msn/conference.c - -diff --git a/README b/README -index 55e482cc..cc8efeda 100644 ---- a/README -+++ b/README -@@ -29,9 +29,6 @@ Run time for the RTP plugin: - - gst-plugins-good 1.4.0 - - gst-plugins-bad 1.4.0 - --Run time for the MSN plugin: -- - gst-plugins-bad 1.4.0 -- - For the GUI example: - - Gtk 3.0 - -diff --git a/configure.ac b/configure.ac -index 240a4859..38c49807 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -113,7 +113,6 @@ dnl these are all the gst plug-ins, compilable without additional libs - FS_PLUGINS_ALL=" \ - fsrawconference \ - fsrtpconference \ -- fsmsnconference \ - fsvideoanyrate \ - fsrtpxdata \ - " -@@ -403,7 +402,6 @@ common-modified/Makefile - gst/Makefile - gst/fsrawconference/Makefile - gst/fsrtpconference/Makefile --gst/fsmsnconference/Makefile - gst/fsvideoanyrate/Makefile - gst/fsrtpxdata/Makefile - farstream/Makefile -diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am -index da8678ff..7b4913fb 100644 ---- a/docs/plugins/Makefile.am -+++ b/docs/plugins/Makefile.am -@@ -60,7 +60,6 @@ SCANOBJ_DEPS = \ - $(top_builddir)/transmitters/nice/libnice-transmitter.la \ - $(top_builddir)/transmitters/shm/libshm-transmitter.la \ - $(top_builddir)/gst/fsrtpconference/libfsrtpconference_doc.la \ -- $(top_builddir)/gst/fsmsnconference/libfsmsnconference_doc.la \ - $(top_builddir)/gst/fsrawconference/libfsrawconference_doc.la \ - $(top_builddir)/gst/fsvideoanyrate/libfsvideoanyrate.la \ - $(top_builddir)/gst/fsrtpxdata/libfsrtpxdata.la -@@ -89,12 +88,6 @@ EXTRA_HFILES = \ - $(top_srcdir)/gst/fsrawconference/fs-raw-session.h \ - $(top_srcdir)/gst/fsrawconference/fs-raw-stream.h \ - $(top_srcdir)/gst/fsrawconference/fs-raw-participant.h \ -- $(top_srcdir)/gst/fsmsnconference/fs-msn-cam-recv-conference.h \ -- $(top_srcdir)/gst/fsmsnconference/fs-msn-cam-send-conference.h \ -- $(top_srcdir)/gst/fsmsnconference/fs-msn-conference.h \ -- $(top_srcdir)/gst/fsmsnconference/fs-msn-session.h \ -- $(top_srcdir)/gst/fsmsnconference/fs-msn-stream.h \ -- $(top_srcdir)/gst/fsmsnconference/fs-msn-participant.h \ - $(top_srcdir)/transmitters/rawudp/fs-rawudp-transmitter.h \ - $(top_srcdir)/transmitters/rawudp/fs-rawudp-stream-transmitter.h \ - $(top_srcdir)/transmitters/multicast/fs-multicast-transmitter.h \ -@@ -130,7 +123,6 @@ GTKDOC_LIBS = \ - $(top_builddir)/farstream/libfarstream-@FS_APIVERSION@.la \ - $(top_builddir)/gst/fsrtpconference/libfsrtpconference_doc.la \ - $(top_builddir)/gst/fsrawconference/libfsrawconference_doc.la \ -- $(top_builddir)/gst/fsmsnconference/libfsmsnconference_doc.la \ - $(GST_BASE_LIBS) - - GTKDOC_CC=$(LIBTOOL) --tag=CC --mode=compile $(CC) -diff --git a/docs/plugins/farstream-plugins-docs.sgml b/docs/plugins/farstream-plugins-docs.sgml -index 1a7a365e..b5572a4d 100644 ---- a/docs/plugins/farstream-plugins-docs.sgml -+++ b/docs/plugins/farstream-plugins-docs.sgml -@@ -33,15 +33,6 @@ - - - -- -- MSN Webcam plugin -- -- -- -- -- -- -- - - - -diff --git a/docs/plugins/farstream-plugins-sections.txt b/docs/plugins/farstream-plugins-sections.txt -index c4eef75b..095d1b2a 100644 ---- a/docs/plugins/farstream-plugins-sections.txt -+++ b/docs/plugins/farstream-plugins-sections.txt -@@ -331,121 +331,6 @@ FS_SHM_STREAM_TRANSMITTER_GET_CLASS - - - --
--fs-msn-conference --FsMsnConference --FsMsnConference -- --FS_MSN_CONFERENCE_CAST --FsMsnConferencePrivate --FsMsnConferenceClass --FS_MSN_CONFERENCE --FS_IS_MSN_CONFERENCE --FS_TYPE_MSN_CONFERENCE --fs_msn_conference_get_type --FS_MSN_CONFERENCE_CLASS --FS_IS_MSN_CONFERENCE_CLASS --FS_MSN_CONFERENCE_GET_CLASS --
-- -- --
--fs-msn-session --FsMsnSession --FsMsnSession -- --FS_IS_MSN_SESSION --FS_IS_MSN_SESSION_CLASS --FS_MSN_SESSION --FS_MSN_SESSION_CAST --FS_MSN_SESSION_CLASS --FS_MSN_SESSION_GET_CLASS --FS_TYPE_MSN_SESSION --FsMsnSessionClass --FsMsnSessionPrivate --fs_msn_session_get_type -- --fs_msn_session_new --fs_msn_session_new_recv_pad --connection --
-- -- --
--fs-msn-stream --FsMsnStream --FsMsnStream -- --FS_IS_MSN_STREAM --FS_IS_MSN_STREAM_CLASS --FS_MSN_STREAM --FS_MSN_STREAM_CAST --FS_MSN_STREAM_CLASS --FS_MSN_STREAM_GET_CLASS --FS_TYPE_MSN_STREAM --FsMsnStreamClass --FsMsnStreamPrivate --fs_msn_stream_get_type -- --fs_msn_stream_new --fs_msn_stream_set_tos_locked --
-- -- --
--fs-msn-participant --FsMsnParticipant --FsMsnParticipant -- --FS_IS_MSN_PARTICIPANT --FS_IS_MSN_PARTICIPANT_CLASS --FS_MSN_PARTICIPANT --FS_MSN_PARTICIPANT_CAST --FS_MSN_PARTICIPANT_CLASS --FS_MSN_PARTICIPANT_GET_CLASS --FS_TYPE_MSN_PARTICIPANT --FsMsnParticipantClass --FsMsnParticipantPrivate --fs_msn_participant_get_type -- --fs_msn_participant_new --
-- --
--element-fsmsncamrecvconference --FsMsnCamCamRecvConference --FsMsnCamRecvConference -- --FS_IS_MSN_CAM_RECV_CONFERENCE --FS_IS_MSN_CAM_RECV_CONFERENCE_CLASS --FS_MSN_CAM_RECV_CONFERENCE --FS_MSN_CAM_RECV_CONFERENCE_CAST --FS_MSN_CAM_RECV_CONFERENCE_CLASS --FS_MSN_CAM_RECV_CONFERENCE_GET_CLASS --FS_TYPE_MSN_CAM_RECV_CONFERENCE --FsMsnCamRecvConferenceClass --FsMsnCamRecvConferencePrivate --fs_msn_cam_recv_conference_get_type --
-- --
--element-fsmsncamsendconference --FsMsnCamSendConference --FsMsnCamSendConference -- --FS_IS_MSN_CAM_SEND_CONFERENCE --FS_IS_MSN_CAM_SEND_CONFERENCE_CLASS --FS_MSN_CAM_SEND_CONFERENCE --FS_MSN_CAM_SEND_CONFERENCE_CAST --FS_MSN_CAM_SEND_CONFERENCE_CLASS --FS_MSN_CAM_SEND_CONFERENCE_GET_CLASS --FS_TYPE_MSN_CAM_SEND_CONFERENCE --FsMsnCamSendConferenceClass --FsMsnCamSendConferencePrivate --fs_msn_cam_send_conference_get_type --
-- -- -
- element-fsrawconference - FsRawConference -diff --git a/docs/plugins/farstream-plugins.types b/docs/plugins/farstream-plugins.types -index 892ca678..4dbbef27 100644 ---- a/docs/plugins/farstream-plugins.types -+++ b/docs/plugins/farstream-plugins.types -@@ -2,10 +2,6 @@ - #include "../../gst/fsrtpconference/fs-rtp-participant.h" - #include "../../gst/fsrtpconference/fs-rtp-session.h" - #include "../../gst/fsrtpconference/fs-rtp-stream.h" --#include "../../gst/fsmsnconference/fs-msn-conference.h" --#include "../../gst/fsmsnconference/fs-msn-participant.h" - fs_rtp_participant_get_type - fs_rtp_session_get_type - fs_rtp_stream_get_type --fs_msn_conference_get_type --fs_msn_participant_get_type -diff --git a/gst/fsmsnconference/Makefile.am b/gst/fsmsnconference/Makefile.am -deleted file mode 100644 -index 3faa34d8..00000000 ---- a/gst/fsmsnconference/Makefile.am -+++ /dev/null -@@ -1,66 +0,0 @@ --plugin_LTLIBRARIES = libfsmsnconference.la -- -- --# First build a convenience lib with the common stuff so its not built twice -- --noinst_LTLIBRARIES = libfsmsnconference-convenience.la -- --libfsmsnconference_convenience_la_SOURCES = \ -- fs-msn-cam-recv-conference.c \ -- fs-msn-cam-send-conference.c \ -- fs-msn-participant.c \ -- fs-msn-session.c \ -- fs-msn-connection.c \ -- fs-msn-stream.c -- --noinst_HEADERS = \ -- fs-msn-cam-recv-conference.h \ -- fs-msn-cam-send-conference.h \ -- fs-msn-conference.h \ -- fs-msn-participant.h \ -- fs-msn-session.h \ -- fs-msn-connection.h \ -- fs-msn-stream.h -- -- --AM_CFLAGS = \ -- $(FS_INTERNAL_CFLAGS) \ -- $(FS_CFLAGS) \ -- $(GST_PLUGINS_BASE_CFLAGS) \ -- $(GST_CFLAGS) \ -- $(NICE_CFLAGS) -- --# Build the main plugin -- --libfsmsnconference_la_SOURCES = \ -- fs-msn-conference.c -- --libfsmsnconference_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) --libfsmsnconference_la_LIBTOOLFLAGS = $(PLUGIN_LIBTOOLFLAGS) --libfsmsnconference_la_LIBADD = \ -- libfsmsnconference-convenience.la \ -- $(top_builddir)/farstream/libfarstream-@FS_APIVERSION@.la \ -- $(FS_LIBS) \ -- $(GST_BASE_LIBS) \ -- $(GST_LIBS) \ -- $(NICE_LIBS) -- -- -- --# Optionally build a library to allow building the gtk-doc -- --if ENABLE_GTK_DOC --noinst_LTLIBRARIES += libfsmsnconference_doc.la -- --nodist_libfsmsnconference_doc_la_CFLAGS = -DBUILD_GTK_DOC -- --nodist_libfsmsnconference_doc_la_SOURCES = $(libfsmsnconference_la_SOURCES) -- -- --libfsmsnconference_doc_la_LIBADD = libfsmsnconference-convenience.la \ -- $(libfsmsnconference_la_LIBADD) -- --CLEANFILES = $(BUILT_SOURCES) -- --endif -- -diff --git a/gst/fsmsnconference/fs-msn-cam-recv-conference.c b/gst/fsmsnconference/fs-msn-cam-recv-conference.c -deleted file mode 100644 -index 462bc4dc..00000000 ---- a/gst/fsmsnconference/fs-msn-cam-recv-conference.c -+++ /dev/null -@@ -1,86 +0,0 @@ --/* -- * Farstream - Farstream MSN Conference Implementation -- * -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-recv-conference.c - MSN implementation for Farstream Conference -- * Gstreamer Elements -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --/** -- * SECTION:element-fsmsncamrecvconference -- * @short_description: Farstream MSN Receive Conference Gstreamer Element -- * -- * This element implements the unidirection webcam feature found in various -- * version of MSN Messenger (tm) and Windows Live Messenger (tm). This is -- * to receive someone else's webcam. -- */ -- -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include "fs-msn-cam-recv-conference.h" -- --#include "fs-msn-conference.h" --#include "fs-msn-session.h" --#include "fs-msn-stream.h" --#include "fs-msn-participant.h" -- --#define GST_CAT_DEFAULT fsmsnconference_debug -- -- --G_DEFINE_TYPE (FsMsnCamRecvConference, fs_msn_cam_recv_conference, -- FS_TYPE_MSN_CONFERENCE); -- -- --static void --fs_msn_cam_recv_conference_class_init (FsMsnCamRecvConferenceClass * klass) --{ -- GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); -- -- gst_element_class_set_metadata (gstelement_class, -- "Farstream MSN Reception Conference", -- "Generic/Bin/MSN", -- "A Farstream MSN Reception Conference", -- "Richard Spiers , " -- "Youness Alaoui , " -- "Olivier Crete "); --} -- --static void --fs_msn_cam_recv_conference_init (FsMsnCamRecvConference *self) --{ -- FsMsnConference *conf = FS_MSN_CONFERENCE (self); -- GstElementFactory *fact = NULL; -- -- GST_DEBUG_OBJECT (conf, "fs_msn_cam_recv_conference_init"); -- -- conf->max_direction = FS_DIRECTION_RECV; -- -- fact = gst_element_factory_find ("mimenc"); -- if (fact) -- gst_object_unref (fact); -- else -- g_set_error (&conf->missing_element_error, -- FS_ERROR, FS_ERROR_CONSTRUCTION, -- "mimenc missing"); --} -- -diff --git a/gst/fsmsnconference/fs-msn-cam-recv-conference.h b/gst/fsmsnconference/fs-msn-cam-recv-conference.h -deleted file mode 100644 -index dcd43547..00000000 ---- a/gst/fsmsnconference/fs-msn-cam-recv-conference.h -+++ /dev/null -@@ -1,69 +0,0 @@ --/* -- * Farstream - Farstream MSN Conference Implementation -- * -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-recv-conference.h - MSN implementation for Farstream Conference -- * Gstreamer Elements -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_CAM_RECV_CONFERENCE_H__ --#define __FS_MSN_CAM_RECV_CONFERENCE_H__ -- --#include "fs-msn-conference.h" -- --G_BEGIN_DECLS -- --#define FS_TYPE_MSN_CAM_RECV_CONFERENCE (fs_msn_cam_recv_conference_get_type ()) --#define FS_MSN_CAM_RECV_CONFERENCE(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_MSN_CAM_RECV_CONFERENCE, \ -- FsMsnCamRecvConference)) --#define FS_MSN_CAM_RECV_CONFERENCE_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_MSN_CAM_RECV_CONFERENCE, \ -- FsMsnCamRecvConferenceClass)) --#define FS_MSN_CAM_RECV_CONFERENCE_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS((obj), FS_TYPE_MSN_CAM_RECV_CONFERENCE, \ -- FsMsnCamRecvConferenceClass)) --#define FS_IS_MSN_CAM_RECV_CONFERENCE(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_MSN_CAM_RECV_CONFERENCE)) --#define FS_IS_MSN_CAM_RECV_CONFERENCE_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_MSN_CAM_RECV_CONFERENCE)) --#define FS_MSN_CAM_RECV_CONFERENCE_CAST(obj) \ -- ((FsMsnCamRecvConference *)(obj)) -- --typedef struct _FsMsnCamRecvConference FsMsnCamRecvConference; --typedef struct _FsMsnCamRecvConferenceClass FsMsnCamRecvConferenceClass; --typedef struct _FsMsnCamRecvConferencePrivate FsMsnCamRecvConferencePrivate; -- --struct _FsMsnCamRecvConference --{ -- FsMsnConference parent; --}; -- --struct _FsMsnCamRecvConferenceClass --{ -- FsMsnConferenceClass parent_class; --}; -- --GType fs_msn_cam_recv_conference_get_type (void); -- -- --G_END_DECLS -- --#endif /* __FS_MSN_CAM_RECV_CONFERENCE_H__ */ -diff --git a/gst/fsmsnconference/fs-msn-cam-send-conference.c b/gst/fsmsnconference/fs-msn-cam-send-conference.c -deleted file mode 100644 -index 12d3ec70..00000000 ---- a/gst/fsmsnconference/fs-msn-cam-send-conference.c -+++ /dev/null -@@ -1,85 +0,0 @@ --/* -- * Farstream - Farstream MSN Conference Implementation -- * -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-send-conference.c - MSN implementation for Farstream Conference -- * Gstreamer Elements -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --/** -- * SECTION:element-fsmsncamsendconference -- * @short_description: Farstream MSN send Conference Gstreamer Element -- * -- * This element implements the unidirection webcam feature found in various -- * version of MSN Messenger (tm) and Windows Live Messenger (tm). This is -- * to send the local webcam's video to someone else. -- */ -- -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include "fs-msn-cam-send-conference.h" -- --#include "fs-msn-conference.h" --#include "fs-msn-session.h" --#include "fs-msn-stream.h" --#include "fs-msn-participant.h" -- --#define GST_CAT_DEFAULT fsmsnconference_debug -- -- --G_DEFINE_TYPE (FsMsnCamSendConference, fs_msn_cam_send_conference, -- FS_TYPE_MSN_CONFERENCE); -- --static void --fs_msn_cam_send_conference_class_init (FsMsnCamSendConferenceClass * klass) --{ -- GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); -- -- gst_element_class_set_metadata (gstelement_class, -- "Farstream MSN Sending Conference", -- "Generic/Bin/MSN", -- "A Farstream MSN Sending Conference", -- "Richard Spiers , " -- "Youness Alaoui , " -- "Olivier Crete "); --} -- --static void --fs_msn_cam_send_conference_init (FsMsnCamSendConference *self) --{ -- FsMsnConference *conf = FS_MSN_CONFERENCE (self); -- GstElementFactory *fact = NULL; -- -- GST_DEBUG_OBJECT (conf, "fs_msn_cam_send_conference_init"); -- -- conf->max_direction = FS_DIRECTION_SEND; -- -- fact = gst_element_factory_find ("mimenc"); -- if (fact) -- gst_object_unref (fact); -- else -- g_set_error (&conf->missing_element_error, -- FS_ERROR, FS_ERROR_CONSTRUCTION, -- "mimenc missing"); --} -- -diff --git a/gst/fsmsnconference/fs-msn-cam-send-conference.h b/gst/fsmsnconference/fs-msn-cam-send-conference.h -deleted file mode 100644 -index 2c8897ea..00000000 ---- a/gst/fsmsnconference/fs-msn-cam-send-conference.h -+++ /dev/null -@@ -1,69 +0,0 @@ --/* -- * Farstream - Farstream MSN Conference Implementation -- * -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-send-conference.h - MSN implementation for Farstream Conference -- * Gstreamer Elements -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_CAM_SEND_CONFERENCE_H__ --#define __FS_MSN_CAM_SEND_CONFERENCE_H__ -- --#include "fs-msn-conference.h" -- --G_BEGIN_DECLS -- --#define FS_TYPE_MSN_CAM_SEND_CONFERENCE (fs_msn_cam_send_conference_get_type ()) --#define FS_MSN_CAM_SEND_CONFERENCE(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_MSN_CAM_SEND_CONFERENCE, \ -- FsMsnCamSendConference)) --#define FS_MSN_CAM_SEND_CONFERENCE_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_MSN_CAM_SEND_CONFERENCE, \ -- FsMsnCamSendConferenceClass)) --#define FS_MSN_CAM_SEND_CONFERENCE_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS((obj), FS_TYPE_MSN_CAM_SEND_CONFERENCE, \ -- FsMsnCamSendConferenceClass)) --#define FS_IS_MSN_CAM_SEND_CONFERENCE(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_MSN_CAM_SEND_CONFERENCE)) --#define FS_IS_MSN_CAM_SEND_CONFERENCE_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_MSN_CAM_SEND_CONFERENCE)) --#define FS_MSN_CAM_SEND_CONFERENCE_CAST(obj) \ -- ((FsMsnCamSendConference *)(obj)) -- --typedef struct _FsMsnCamSendConference FsMsnCamSendConference; --typedef struct _FsMsnCamSendConferenceClass FsMsnCamSendConferenceClass; --typedef struct _FsMsnCamSendConferencePrivate FsMsnCamSendConferencePrivate; -- --struct _FsMsnCamSendConference --{ -- FsMsnConference parent; --}; -- --struct _FsMsnCamSendConferenceClass --{ -- FsMsnConferenceClass parent_class; --}; -- --GType fs_msn_cam_send_conference_get_type (void); -- -- --G_END_DECLS -- --#endif /* __FS_MSN_CAM_SEND_CONFERENCE_H__ */ -diff --git a/gst/fsmsnconference/fs-msn-conference.c b/gst/fsmsnconference/fs-msn-conference.c -deleted file mode 100644 -index ab79674b..00000000 ---- a/gst/fsmsnconference/fs-msn-conference.c -+++ /dev/null -@@ -1,311 +0,0 @@ --/* -- * Farstream - Farstream MSN Conference Implementation -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-conference.c - MSN implementation for Farstream Conference Gstreamer -- * Elements -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --/** -- * SECTION:fs-msn-conference -- * @short_description: Farstream MSN Conference Gstreamer Elements Base class -- * -- * This element implements the unidirection webcam feature found in various -- * version of MSN Messenger (tm) and Windows Live Messenger (tm). -- */ -- -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include -- --#include "fs-msn-conference.h" -- --#include "fs-msn-session.h" --#include "fs-msn-stream.h" --#include "fs-msn-participant.h" -- --#include "fs-msn-cam-send-conference.h" --#include "fs-msn-cam-recv-conference.h" -- --GST_DEBUG_CATEGORY (fsmsnconference_debug); --#define GST_CAT_DEFAULT fsmsnconference_debug -- --/* Signals */ --enum --{ -- LAST_SIGNAL --}; -- --/* Properties */ --enum --{ -- PROP_0 --}; -- -- --static GstStaticPadTemplate fs_msn_conference_sink_template = -- GST_STATIC_PAD_TEMPLATE ("sink_%d", -- GST_PAD_SINK, -- GST_PAD_SOMETIMES, -- GST_STATIC_CAPS_ANY); -- --static GstStaticPadTemplate fs_msn_conference_src_template = -- GST_STATIC_PAD_TEMPLATE ("src_%d_%d_%d", -- GST_PAD_SRC, -- GST_PAD_SOMETIMES, -- GST_STATIC_CAPS_ANY); -- --#define FS_MSN_CONFERENCE_GET_PRIVATE(obj) \ -- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), FS_TYPE_MSN_CONFERENCE, \ -- FsMsnConferencePrivate)) -- --struct _FsMsnConferencePrivate --{ -- gboolean disposed; -- /* Protected by GST_OBJECT_LOCK */ -- FsMsnParticipant *participant; -- FsMsnSession *session; --}; -- --G_DEFINE_ABSTRACT_TYPE (FsMsnConference, fs_msn_conference, -- FS_TYPE_CONFERENCE); -- --static FsSession *fs_msn_conference_new_session (FsConference *conf, -- FsMediaType media_type, -- GError **error); -- --static FsParticipant *fs_msn_conference_new_participant (FsConference *conf, -- GError **error); -- --static void _remove_session (gpointer user_data, -- GObject *where_the_object_was); --static void _remove_participant (gpointer user_data, -- GObject *where_the_object_was); -- --static void --fs_msn_conference_dispose (GObject * object) --{ -- FsMsnConference *self = FS_MSN_CONFERENCE (object); -- -- if (self->priv->disposed) -- return; -- -- GST_OBJECT_LOCK (object); -- if (self->priv->session) -- g_object_weak_unref (G_OBJECT (self->priv->session), _remove_session, self); -- self->priv->session = NULL; -- -- if (self->priv->participant) -- g_object_weak_unref (G_OBJECT (self->priv->participant), -- _remove_participant, self); -- self->priv->participant = NULL; -- GST_OBJECT_UNLOCK (object); -- -- self->priv->disposed = TRUE; -- -- g_clear_error (&self->missing_element_error); -- -- G_OBJECT_CLASS (fs_msn_conference_parent_class)->dispose (object); --} -- --static void --fs_msn_conference_class_init (FsMsnConferenceClass * klass) --{ -- GObjectClass *gobject_class = G_OBJECT_CLASS (klass); -- GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); -- FsConferenceClass *baseconf_class = FS_CONFERENCE_CLASS (klass); -- -- g_type_class_add_private (klass, sizeof (FsMsnConferencePrivate)); -- -- GST_DEBUG_CATEGORY_INIT (fsmsnconference_debug, "fsmsnconference", 0, -- "Farstream MSN Conference Element"); -- -- gst_element_class_add_pad_template (gstelement_class, -- gst_static_pad_template_get (&fs_msn_conference_sink_template)); -- gst_element_class_add_pad_template (gstelement_class, -- gst_static_pad_template_get (&fs_msn_conference_src_template)); -- -- baseconf_class->new_session = -- GST_DEBUG_FUNCPTR (fs_msn_conference_new_session); -- baseconf_class->new_participant = -- GST_DEBUG_FUNCPTR (fs_msn_conference_new_participant); -- -- gobject_class->dispose = GST_DEBUG_FUNCPTR (fs_msn_conference_dispose); --} -- -- --static void --fs_msn_conference_init (FsMsnConference *conf) --{ -- GST_DEBUG_OBJECT (conf, "fs_msn_conference_init"); -- -- conf->priv = FS_MSN_CONFERENCE_GET_PRIVATE (conf); --} -- --static void --_remove_session (gpointer user_data, -- GObject *where_the_object_was) --{ -- FsMsnConference *self = FS_MSN_CONFERENCE (user_data); -- -- GST_OBJECT_LOCK (self); -- if (self->priv->session == (FsMsnSession *) where_the_object_was) -- self->priv->session = NULL; -- GST_OBJECT_UNLOCK (self); --} -- --static void --_remove_participant (gpointer user_data, -- GObject *where_the_object_was) --{ -- FsMsnConference *self = FS_MSN_CONFERENCE (user_data); -- -- GST_OBJECT_LOCK (self); -- if (self->priv->participant == (FsMsnParticipant *) where_the_object_was) -- self->priv->participant = NULL; -- GST_OBJECT_UNLOCK (self); --} -- -- --static FsSession * --fs_msn_conference_new_session (FsConference *conf, -- FsMediaType media_type, -- GError **error) --{ -- FsMsnConference *self = FS_MSN_CONFERENCE (conf); -- FsMsnSession *new_session = NULL; -- -- if (self->missing_element_error) -- { -- if (error) -- *error = g_error_copy (self->missing_element_error); -- return NULL; -- } -- -- if (media_type != FS_MEDIA_TYPE_VIDEO) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "Only video supported for msn webcam"); -- return NULL; -- } -- -- GST_OBJECT_LOCK (self); -- if (self->priv->session) -- { -- GST_OBJECT_UNLOCK (self); -- g_set_error (error, FS_ERROR, FS_ERROR_ALREADY_EXISTS, -- "There already is a session"); -- return NULL; -- } -- -- GST_OBJECT_UNLOCK (self); -- -- new_session = fs_msn_session_new (media_type, self, error); -- -- if (new_session) -- { -- GST_OBJECT_LOCK (self); -- self->priv->session = new_session; -- g_object_weak_ref (G_OBJECT (new_session), _remove_session, self); -- GST_OBJECT_UNLOCK (self); -- } -- -- return FS_SESSION (new_session); --} -- -- --static FsParticipant * --fs_msn_conference_new_participant (FsConference *conf, -- GError **error) --{ -- FsMsnConference *self = FS_MSN_CONFERENCE (conf); -- FsMsnParticipant *new_participant = NULL; -- -- if (self->missing_element_error) -- { -- if (error) -- *error = g_error_copy (self->missing_element_error); -- return NULL; -- } -- -- GST_OBJECT_LOCK (self); -- if (self->priv->participant) -- { -- GST_OBJECT_UNLOCK (self); -- g_set_error (error, FS_ERROR, FS_ERROR_ALREADY_EXISTS, -- "There already is a participant"); -- return NULL; -- } -- -- GST_OBJECT_UNLOCK (self); -- -- new_participant = fs_msn_participant_new (); -- -- if (new_participant) -- { -- GST_OBJECT_LOCK (self); -- self->priv->participant = new_participant; -- g_object_weak_ref (G_OBJECT (new_participant), _remove_participant, self); -- GST_OBJECT_UNLOCK (self); -- } -- -- return FS_PARTICIPANT (new_participant); -- --} -- -- --static gboolean plugin_init (GstPlugin * plugin) --{ -- return gst_element_register (plugin, "fsmsncamsendconference", -- GST_RANK_NONE, FS_TYPE_MSN_CAM_SEND_CONFERENCE) && -- gst_element_register (plugin, "fsmsncamrecvconference", -- GST_RANK_NONE, FS_TYPE_MSN_CAM_RECV_CONFERENCE); --} -- -- -- --#ifdef BUILD_GTK_DOC --void --fs_msn_plugin_init_real (void) --{ -- gst_plugin_register_static ( --#else --GST_PLUGIN_DEFINE ( --#endif -- GST_VERSION_MAJOR, -- GST_VERSION_MINOR, -- fsmsnconference, -- "Farstream MSN Conference plugin", -- plugin_init, -- VERSION, -- "LGPL", -- "Farstream", -- "http://www.freedesktop.org/wiki/Software/Farstream" --#ifdef BUILD_GTK_DOC -- ); --} --#else --) --#endif -- -diff --git a/gst/fsmsnconference/fs-msn-conference.h b/gst/fsmsnconference/fs-msn-conference.h -deleted file mode 100644 -index 9e1afc51..00000000 ---- a/gst/fsmsnconference/fs-msn-conference.h -+++ /dev/null -@@ -1,75 +0,0 @@ --/* -- * Farstream - Farstream MSN Conference Implementation -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007 Collabora Ltd. -- * @author: Olivier Crete -- * -- * gstfsmsnconference.h - MSN implementation for Farstream Conference Gstreamer -- * Elements -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_CONFERENCE_H__ --#define __FS_MSN_CONFERENCE_H__ -- --#include -- --G_BEGIN_DECLS -- --#define FS_TYPE_MSN_CONFERENCE \ -- (fs_msn_conference_get_type ()) --#define FS_MSN_CONFERENCE(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj),FS_TYPE_MSN_CONFERENCE,FsMsnConference)) --#define FS_MSN_CONFERENCE_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass),FS_TYPE_MSN_CONFERENCE,FsMsnConferenceClass)) --#define FS_MSN_CONFERENCE_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS((obj),FS_TYPE_MSN_CONFERENCE,FsMsnConferenceClass)) --#define FS_IS_MSN_CONFERENCE(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj),FS_TYPE_MSN_CONFERENCE)) --#define FS_IS_MSN_CONFERENCE_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass),FS_TYPE_MSN_CONFERENCE)) --#define FS_MSN_CONFERENCE_CAST(obj) \ -- ((FsMsnConference *)(obj)) -- --typedef struct _FsMsnConference FsMsnConference; --typedef struct _FsMsnConferenceClass FsMsnConferenceClass; --typedef struct _FsMsnConferencePrivate FsMsnConferencePrivate; -- --struct _FsMsnConference --{ -- FsConference parent; -- FsMsnConferencePrivate *priv; -- -- FsStreamDirection max_direction; -- -- GError *missing_element_error; --}; -- --struct _FsMsnConferenceClass --{ -- FsConferenceClass parent_class; --}; -- --GType fs_msn_conference_get_type (void); -- -- --GST_DEBUG_CATEGORY_EXTERN (fsmsnconference_debug); -- --G_END_DECLS -- --#endif /* __FS_MSN_CONFERENCE_H__ */ -diff --git a/gst/fsmsnconference/fs-msn-connection.c b/gst/fsmsnconference/fs-msn-connection.c -deleted file mode 100644 -index 0acf8c33..00000000 ---- a/gst/fsmsnconference/fs-msn-connection.c -+++ /dev/null -@@ -1,1134 +0,0 @@ --/* -- * Farstream - Farstream MSN Connection -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * @author: Youness Alaoui -- * -- * fs-msn-connection.c - A MSN Connection gobject -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include "fs-msn-connection.h" -- --#include --#include --#include --#include --#include --#include --#include --#include --#ifdef HAVE_STDLIB_H --#include --#endif -- --#include --#include -- --#define GST_CAT_DEFAULT fsmsnconference_debug -- --/* Signals */ --enum --{ -- SIGNAL_NEW_LOCAL_CANDIDATE, -- SIGNAL_LOCAL_CANDIDATES_PREPARED, -- SIGNAL_CONNECTED, -- SIGNAL_CONNECTION_FAILED, -- N_SIGNALS --}; -- -- --static guint signals[N_SIGNALS]; -- --/* props */ --enum --{ -- PROP_0, -- PROP_SESSION_ID --}; -- -- --typedef enum { -- FS_MSN_STATUS_AUTH, -- FS_MSN_STATUS_CONNECTED, -- FS_MSN_STATUS_CONNECTED2, -- FS_MSN_STATUS_SEND_RECEIVE, -- FS_MSN_STATUS_PAUSED, --} FsMsnStatus; -- --typedef struct _FsMsnPollFD FsMsnPollFD; --typedef void (*PollFdCallback) (FsMsnConnection *self, FsMsnPollFD *pollfd); -- --struct _FsMsnPollFD { -- GstPollFD pollfd; -- FsMsnStatus status; -- gboolean server; -- gboolean want_read; -- gboolean want_write; -- PollFdCallback callback; --}; -- --#define FS_MSN_CONNECTION_LOCK(conn) g_rec_mutex_lock(&(conn)->mutex) --#define FS_MSN_CONNECTION_UNLOCK(conn) g_rec_mutex_unlock(&(conn)->mutex) -- -- --G_DEFINE_TYPE(FsMsnConnection, fs_msn_connection, G_TYPE_OBJECT); -- --static void fs_msn_connection_dispose (GObject *object); --static void fs_msn_connection_finalize (GObject *object); --static void fs_msn_connection_get_property (GObject *object, -- guint prop_id, -- GValue *value, -- GParamSpec *pspec); --static void fs_msn_connection_set_property (GObject *object, -- guint prop_id, -- const GValue *value, -- GParamSpec *pspec); -- -- --static gboolean fs_msn_connection_attempt_connection_locked ( -- FsMsnConnection *connection, -- FsCandidate *candidate, -- GError **error); --static gboolean fs_msn_open_listening_port_unlock (FsMsnConnection *connection, -- guint16 port, -- GError **error); -- --static void successful_connection_cb (FsMsnConnection *self, FsMsnPollFD *fd); --static void accept_connection_cb (FsMsnConnection *self, FsMsnPollFD *fd); --static void connection_cb (FsMsnConnection *self, FsMsnPollFD *fd); -- --static gpointer connection_polling_thread (gpointer data); --static void shutdown_fd (FsMsnConnection *self, FsMsnPollFD *pollfd, -- gboolean equal); --static void shutdown_fd_locked (FsMsnConnection *self, FsMsnPollFD *pollfd, -- gboolean equal); --static FsMsnPollFD * add_pollfd_locked (FsMsnConnection *self, int fd, -- PollFdCallback callback, gboolean read, gboolean write, gboolean server); -- --static void --fs_msn_connection_class_init (FsMsnConnectionClass *klass) --{ -- GObjectClass *gobject_class = (GObjectClass *) klass; -- -- gobject_class->dispose = fs_msn_connection_dispose; -- gobject_class->finalize = fs_msn_connection_finalize; -- gobject_class->get_property = fs_msn_connection_get_property; -- gobject_class->set_property = fs_msn_connection_set_property; -- -- signals[SIGNAL_NEW_LOCAL_CANDIDATE] = g_signal_new -- ("new-local-candidate", -- G_TYPE_FROM_CLASS (klass), -- G_SIGNAL_RUN_LAST, -- 0, -- NULL, -- NULL, -- g_cclosure_marshal_VOID__BOXED, -- G_TYPE_NONE, 1, FS_TYPE_CANDIDATE); -- -- signals[SIGNAL_LOCAL_CANDIDATES_PREPARED] = g_signal_new -- ("local-candidates-prepared", -- G_TYPE_FROM_CLASS (klass), -- G_SIGNAL_RUN_LAST, -- 0, -- NULL, -- NULL, -- g_cclosure_marshal_VOID__VOID, -- G_TYPE_NONE, 0); -- -- signals[SIGNAL_CONNECTED] = g_signal_new -- ("connected", -- G_TYPE_FROM_CLASS (klass), -- G_SIGNAL_RUN_LAST, -- 0, -- NULL, -- NULL, -- g_cclosure_marshal_VOID__UINT, -- G_TYPE_NONE, 1, G_TYPE_UINT); -- -- signals[SIGNAL_CONNECTION_FAILED] = g_signal_new -- ("connection-failed", -- G_TYPE_FROM_CLASS (klass), -- G_SIGNAL_RUN_LAST, -- 0, -- NULL, -- NULL, -- g_cclosure_marshal_VOID__VOID, -- G_TYPE_NONE, 0); -- -- g_object_class_install_property (gobject_class, -- PROP_SESSION_ID, -- g_param_spec_uint ("session-id", -- "The session-id of the session", -- "This is the session-id of the MSN session", -- 1, 9999, 1, -- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); --} -- --static void --fs_msn_connection_init (FsMsnConnection *self) --{ -- /* member init */ -- -- self->poll_timeout = GST_CLOCK_TIME_NONE; -- self->poll = gst_poll_new (TRUE); -- gst_poll_set_flushing (self->poll, FALSE); -- self->pollfds = g_ptr_array_new (); -- -- g_rec_mutex_init (&self->mutex); --} -- --static void --fs_msn_connection_dispose (GObject *object) --{ -- FsMsnConnection *self = FS_MSN_CONNECTION (object); -- -- FS_MSN_CONNECTION_LOCK(self); -- -- if (self->polling_thread) -- { -- GThread *polling_thread = g_thread_ref (self->polling_thread); -- gst_poll_set_flushing (self->poll, TRUE); -- FS_MSN_CONNECTION_UNLOCK(self); -- g_thread_join (polling_thread); -- FS_MSN_CONNECTION_LOCK(self); -- g_thread_unref (polling_thread); -- self->polling_thread = NULL; -- } -- -- FS_MSN_CONNECTION_UNLOCK(self); -- -- G_OBJECT_CLASS (fs_msn_connection_parent_class)->dispose (object); --} -- --static void --fs_msn_connection_finalize (GObject *object) --{ -- FsMsnConnection *self = FS_MSN_CONNECTION (object); -- gint i; -- -- g_free (self->local_recipient_id); -- g_free (self->remote_recipient_id); -- -- gst_poll_free (self->poll); -- -- for (i = 0; i < self->pollfds->len; i++) -- { -- FsMsnPollFD *p = g_ptr_array_index(self->pollfds, i); -- close (p->pollfd.fd); -- g_slice_free (FsMsnPollFD, p); -- } -- g_ptr_array_free (self->pollfds, TRUE); -- -- g_rec_mutex_clear (&self->mutex); -- -- G_OBJECT_CLASS (fs_msn_connection_parent_class)->finalize (object); --} -- --/** -- * fs_msn_connection_new: -- * @session: The #FsMsnSession this connection is a child of -- * @participant: The #FsMsnParticipant this connection is for -- * @direction: the initial #FsDirection for this connection -- * -- * -- * This function create a new connection -- * -- * Returns: the newly created string or NULL on error -- */ -- --FsMsnConnection * --fs_msn_connection_new (guint session_id, gboolean producer, guint initial_port) --{ -- FsMsnConnection *self = g_object_new (FS_TYPE_MSN_CONNECTION, NULL); -- -- if (self) { -- self->session_id = session_id; -- self->initial_port = initial_port; -- self->producer = producer; -- } -- -- return self; --} -- --static void --fs_msn_connection_get_property (GObject *object, -- guint prop_id, -- GValue *value, -- GParamSpec *pspec) --{ -- FsMsnConnection *self = FS_MSN_CONNECTION (object); -- -- FS_MSN_CONNECTION_LOCK (self); -- switch (prop_id) -- { -- case PROP_SESSION_ID: -- g_value_set_uint (value, self->session_id); -- break; -- default: -- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- break; -- } -- FS_MSN_CONNECTION_UNLOCK (self); --} -- --static void --fs_msn_connection_set_property (GObject *object, -- guint prop_id, -- const GValue *value, -- GParamSpec *pspec) --{ -- FsMsnConnection *self = FS_MSN_CONNECTION (object); -- -- FS_MSN_CONNECTION_LOCK (self); -- switch (prop_id) -- { -- case PROP_SESSION_ID: -- self->session_id = g_value_get_uint (value); -- break; -- default: -- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- break; -- } -- FS_MSN_CONNECTION_LOCK (self); -- --} -- --gboolean --fs_msn_connection_gather_local_candidates (FsMsnConnection *self, -- GError **error) --{ -- gboolean ret; -- -- FS_MSN_CONNECTION_LOCK(self); -- -- self->polling_thread = g_thread_try_new ("msn polling thread", -- connection_polling_thread, self, error); -- -- if (!self->polling_thread) -- { -- FS_MSN_CONNECTION_UNLOCK(self); -- return FALSE; -- } -- -- ret = fs_msn_open_listening_port_unlock (self, self->initial_port, error); -- -- g_signal_emit (self, signals[SIGNAL_LOCAL_CANDIDATES_PREPARED], 0); -- -- return ret; --} -- -- --/** -- * fs_msn_connection_add_remote_candidate: -- */ --gboolean --fs_msn_connection_add_remote_candidates (FsMsnConnection *self, -- GList *candidates, GError **error) --{ -- GList *item = NULL; -- gchar *recipient_id = NULL; -- gboolean ret = FALSE; -- guint session_id = 0; -- -- if (!candidates) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "Candidate list can no be empty"); -- return FALSE; -- } -- -- FS_MSN_CONNECTION_LOCK(self); -- -- recipient_id = self->remote_recipient_id; -- -- for (item = candidates; item; item = g_list_next (item)) -- { -- FsCandidate *candidate = item->data; -- -- if (!candidate->ip || !candidate->port) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "The candidate passed does not contain a valid ip or port"); -- goto out; -- } -- if (!candidate->foundation) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "The candidate passed does not have a foundation (MSN recipient ID)"); -- goto out; -- } -- if (recipient_id) -- { -- if (g_strcmp0 (candidate->foundation, recipient_id) != 0) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "The candidates do not have the same recipient ID"); -- goto out; -- } -- } -- else -- { -- recipient_id = candidate->foundation; -- } -- -- if (candidate->username) -- { -- gint sid = atoi (candidate->username); -- -- if (sid < 1 || sid > 9999) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "The session ID (in the username) must be between 1 and 9999," -- " %d is invalid", sid); -- goto out; -- } -- -- if (session_id) -- { -- if (session_id != sid) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "The candidates do not have the same session ID" -- " (in the username)"); -- goto out; -- } -- } -- else -- { -- session_id = sid; -- } -- } -- } -- -- self->remote_recipient_id = g_strdup (recipient_id); -- self->session_id = session_id; -- ret = TRUE; -- for (item = candidates; item; item = g_list_next (item)) -- { -- FsCandidate *candidate = item->data; -- if (!fs_msn_connection_attempt_connection_locked (self, candidate, error)) -- { -- ret = FALSE; -- break; -- } -- } -- -- out: -- FS_MSN_CONNECTION_UNLOCK(self); -- return ret; --} -- -- -- --static GList * --filter_ips_ipv4 (GList *ips) --{ -- GList *item; -- -- for (item = ips; item;) -- { -- gchar *ip = item->data; -- GList *next = item->next; -- -- if (!strchr (ip, '.')) -- { -- g_free (ip); -- ips = g_list_delete_link (ips, item); -- } -- item = next; -- } -- -- return ips; --} -- --static gboolean --fs_msn_open_listening_port_unlock (FsMsnConnection *self, guint16 port, -- GError **error) --{ -- gint fd = -1; -- struct sockaddr_in myaddr; -- guint myaddr_len = sizeof (struct sockaddr_in); -- FsCandidate * candidate = NULL; -- GList *addresses = nice_interfaces_get_local_ips (FALSE); -- GList *item = NULL; -- gchar *session_id; -- -- addresses = filter_ips_ipv4 (addresses); -- -- -- GST_DEBUG ("Attempting to listen on port %d.....",port); -- -- if ( (fd = socket(PF_INET, SOCK_STREAM, 0)) < 0 ) -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- g_set_error (error, FS_ERROR, FS_ERROR_NETWORK, -- "Could not create socket: %s", error_str); -- goto error; -- } -- -- // set non-blocking mode -- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); -- for (;;) { -- GST_DEBUG ("Attempting to listen on port %d.....",port); -- memset(&myaddr, 0, sizeof(myaddr)); -- myaddr.sin_family = AF_INET; -- myaddr.sin_port = htons (port); -- // bind -- if (bind(fd, (struct sockaddr *) &myaddr, sizeof(myaddr)) != 0) -- { -- if (port != 0 && errno == EADDRINUSE) -- { -- port++; -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- g_set_error (error, FS_ERROR, FS_ERROR_NETWORK, -- "Could not bind socket: %s", error_str); -- goto error; -- } -- } else { -- /* Listen */ -- if (listen(fd, 3) != 0) -- { -- if (port != 0 && errno == EADDRINUSE) -- { -- port++; -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- g_set_error (error, FS_ERROR, FS_ERROR_NETWORK, -- "Could not listen on socket: %s", error_str); -- goto error; -- } -- } -- else -- { -- goto done; -- } -- } -- } -- -- done: -- -- if (getsockname (fd, (struct sockaddr *) &myaddr, &myaddr_len) < 0) { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- g_set_error (error, FS_ERROR, FS_ERROR_NETWORK, -- "Could not get the socket name: %s", error_str); -- goto error; -- } -- port = ntohs (myaddr.sin_port); -- add_pollfd_locked (self, fd, accept_connection_cb, TRUE, TRUE, FALSE); -- -- GST_DEBUG ("Listening on port %d", port); -- -- self->local_recipient_id = g_strdup_printf ("%d", -- g_random_int_range (100, 199)); -- session_id = g_strdup_printf ("%u", self->session_id); -- -- FS_MSN_CONNECTION_UNLOCK (self); -- -- for (item = addresses; -- item; -- item = g_list_next (item)) -- { -- candidate = fs_candidate_new (self->local_recipient_id, 1, -- FS_CANDIDATE_TYPE_HOST, FS_NETWORK_PROTOCOL_TCP, item->data, port); -- candidate->username = g_strdup (session_id); -- -- g_signal_emit (self, signals[SIGNAL_NEW_LOCAL_CANDIDATE], 0, candidate); -- -- fs_candidate_destroy (candidate); -- } -- -- g_free (session_id); -- -- g_list_foreach (addresses, (GFunc) g_free, NULL); -- g_list_free (addresses); -- -- return TRUE; -- -- error: -- if (fd >= 0) -- close (fd); -- g_list_foreach (addresses, (GFunc) g_free, NULL); -- g_list_free (addresses); -- FS_MSN_CONNECTION_UNLOCK (self); -- return FALSE; --} -- --static gboolean --fs_msn_connection_attempt_connection_locked (FsMsnConnection *connection, -- FsCandidate *candidate, -- GError **error) --{ -- FsMsnConnection *self = FS_MSN_CONNECTION (connection); -- gint fd = -1; -- gint ret; -- struct sockaddr_in theiraddr; -- memset(&theiraddr, 0, sizeof(theiraddr)); -- -- -- if ( (fd = socket(PF_INET, SOCK_STREAM, 0)) == -1 ) -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- g_set_error (error, FS_ERROR, FS_ERROR_NETWORK, -- "Could not create socket: %s", error_str); -- return FALSE; -- } -- -- // set non-blocking mode -- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); -- -- theiraddr.sin_family = AF_INET; -- theiraddr.sin_addr.s_addr = inet_addr (candidate->ip); -- theiraddr.sin_port = htons (candidate->port); -- -- GST_DEBUG ("Attempting connection to %s %d on socket %d", candidate->ip, -- candidate->port, fd); -- // this is non blocking, the return value isn't too usefull -- ret = connect (fd, (struct sockaddr *) &theiraddr, sizeof (theiraddr)); -- if (ret < 0 && errno != EINPROGRESS) -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- g_set_error (error, FS_ERROR, FS_ERROR_NETWORK, -- "Could not connect socket: %s", error_str); -- close (fd); -- return FALSE; -- } -- -- FS_MSN_CONNECTION_LOCK (self); -- add_pollfd_locked (self, fd, successful_connection_cb, TRUE, TRUE, FALSE); -- FS_MSN_CONNECTION_UNLOCK (self); -- -- return TRUE; --} -- --static void --accept_connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd) --{ -- struct sockaddr_in in; -- int fd = -1; -- socklen_t n = sizeof (in); -- -- if (gst_poll_fd_has_error (self->poll, &pollfd->pollfd) || -- gst_poll_fd_has_closed (self->poll, &pollfd->pollfd)) -- { -- GST_WARNING ("Error in accept socket : %d", pollfd->pollfd.fd); -- goto error; -- } -- -- if ((fd = accept(pollfd->pollfd.fd, -- (struct sockaddr*) &in, &n)) == -1) -- { -- GST_ERROR ("Error while running accept() %d", errno); -- return; -- } -- -- FS_MSN_CONNECTION_LOCK (self); -- add_pollfd_locked (self, fd, connection_cb, TRUE, FALSE, TRUE); -- FS_MSN_CONNECTION_UNLOCK (self); -- -- return; -- -- /* Error */ -- error: -- GST_WARNING ("Got error from fd %d, closing", fd); -- // find, shutdown and remove channel from fdlist -- shutdown_fd (self, pollfd, TRUE); -- -- return; --} -- -- --static void --successful_connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd) --{ -- gint error; -- socklen_t option_len; -- -- GST_DEBUG ("handler called on fd %d", pollfd->pollfd.fd); -- -- errno = 0; -- if (gst_poll_fd_has_error (self->poll, &pollfd->pollfd) || -- gst_poll_fd_has_closed (self->poll, &pollfd->pollfd)) -- { -- GST_WARNING ("connecton closed or error"); -- goto error; -- } -- -- option_len = sizeof(error); -- -- /* Get the error option */ -- if (getsockopt(pollfd->pollfd.fd, SOL_SOCKET, SO_ERROR, (void*) &error, &option_len) < 0) -- { -- g_warning ("getsockopt() failed"); -- goto error; -- } -- -- /* Check if there is an error */ -- if (error) -- { -- GST_WARNING ("getsockopt gave an error : %d", error); -- goto error; -- } -- -- pollfd->callback = connection_cb; -- -- GST_DEBUG ("connection succeeded on socket %p", pollfd); -- return; -- -- /* Error */ -- error: -- GST_WARNING ("Got error from fd %d, closing", pollfd->pollfd.fd); -- // find, shutdown and remove channel from fdlist -- shutdown_fd (self, pollfd, TRUE); -- -- return; --} -- -- --static void --connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd) --{ -- gboolean success = FALSE; -- -- GST_DEBUG ("handler called on fd:%d server: %d status:%d r:%d w:%d", -- pollfd->pollfd.fd, -- pollfd->server, pollfd->status, -- gst_poll_fd_can_read (self->poll, &pollfd->pollfd), -- gst_poll_fd_can_write (self->poll, &pollfd->pollfd)); -- -- if (gst_poll_fd_has_error (self->poll, &pollfd->pollfd) || -- gst_poll_fd_has_closed (self->poll, &pollfd->pollfd)) -- { -- GST_WARNING ("connecton closed or error (error: %d closed: %d)", -- gst_poll_fd_has_error (self->poll, &pollfd->pollfd), -- gst_poll_fd_has_closed (self->poll, &pollfd->pollfd)); -- goto error; -- } -- -- if (gst_poll_fd_can_read (self->poll, &pollfd->pollfd)) -- { -- switch (pollfd->status) -- { -- case FS_MSN_STATUS_AUTH: -- if (pollfd->server) -- { -- gchar str[35] = {0}; -- gchar check[35] = {0}; -- -- if (recv (pollfd->pollfd.fd, str, 34, 0) == 34) -- { -- GST_DEBUG ("Got %s, checking if it's auth", str); -- FS_MSN_CONNECTION_LOCK(self); -- snprintf(check, 35, "recipientid=%s&sessionid=%d\r\n\r\n", -- self->local_recipient_id, self->session_id); -- FS_MSN_CONNECTION_UNLOCK(self); -- if (strncmp (str, check, 35) == 0) -- { -- GST_DEBUG ("Authentication successful"); -- pollfd->status = FS_MSN_STATUS_CONNECTED; -- pollfd->want_write = TRUE; -- gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, TRUE); -- } -- else -- { -- GST_WARNING ("Authentication failed check=%s", check); -- goto error; -- } -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- GST_WARNING ("auth: %s", error_str); -- goto error; -- } -- -- } else { -- GST_ERROR ("shouldn't receive data when client on AUTH state"); -- goto error; -- } -- break; -- case FS_MSN_STATUS_CONNECTED: -- if (!pollfd->server) -- { -- gchar str[14] = {0}; -- ssize_t size; -- -- size = recv (pollfd->pollfd.fd, str, 13, MSG_PEEK); -- if (size > 0) -- { -- GST_DEBUG ("Got %s, checking if it's connected", str); -- if (size == 13 && strcmp (str, "connected\r\n\r\n") == 0) -- { -- GST_DEBUG ("connection successful"); -- if (recv (pollfd->pollfd.fd, str, 13, 0) != 13) -- { -- GST_WARNING ("Could not read 13 bytes that had previously" -- " been peeked at!"); -- goto error; -- } -- pollfd->status = FS_MSN_STATUS_CONNECTED2; -- pollfd->want_write = TRUE; -- gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, TRUE); -- } -- else if (!self->producer) -- { -- GST_DEBUG ("connection successful"); -- pollfd->status = FS_MSN_STATUS_SEND_RECEIVE; -- success = TRUE; -- } -- else -- { -- GST_WARNING ("connected failed"); -- goto error; -- } -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- GST_WARNING ("recv: %s", error_str); -- goto error; -- } -- } else { -- GST_ERROR ("shouldn't receive data when server on CONNECTED state"); -- goto error; -- } -- break; -- case FS_MSN_STATUS_CONNECTED2: -- if (pollfd->server) -- { -- gchar str[14] = {0}; -- ssize_t size; -- -- size = recv (pollfd->pollfd.fd, str, 13, MSG_PEEK); -- if (size > 0) -- { -- GST_DEBUG ("Got %s, checking if it's connected", str); -- if (size == 13 && strcmp (str, "connected\r\n\r\n") == 0) -- { -- GST_DEBUG ("connection successful"); -- if (recv (pollfd->pollfd.fd, str, 13, 0) != 13) -- { -- GST_WARNING ("Could not read 13 bytes that had previously" -- " been peeked at!"); -- -- goto error; -- } -- pollfd->status = FS_MSN_STATUS_SEND_RECEIVE; -- success = TRUE; -- } -- else if (!self->producer) -- { -- GST_DEBUG ("connection successful"); -- pollfd->status = FS_MSN_STATUS_SEND_RECEIVE; -- success = TRUE; -- } -- else -- { -- GST_WARNING ("connected failed"); -- goto error; -- } -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- GST_WARNING ("recv: %s", error_str); -- goto error; -- } -- -- } else { -- GST_ERROR ("shouldn't receive data when client on CONNECTED2 state"); -- goto error; -- } -- break; -- default: -- GST_ERROR ("Invalid status %d", pollfd->status); -- goto error; -- break; -- -- } -- } -- else if (gst_poll_fd_can_write (self->poll, &pollfd->pollfd)) -- { -- pollfd->want_write = FALSE; -- gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, FALSE); -- switch (pollfd->status) -- { -- case FS_MSN_STATUS_AUTH: -- if (!pollfd->server) -- { -- gchar *str; -- FS_MSN_CONNECTION_LOCK(self); -- str = g_strdup_printf("recipientid=%s&sessionid=%d\r\n\r\n", -- self->remote_recipient_id, self->session_id); -- FS_MSN_CONNECTION_UNLOCK(self); -- if (send(pollfd->pollfd.fd, str, strlen (str), 0) != -1) -- { -- GST_DEBUG ("Sent %s", str); -- pollfd->status = FS_MSN_STATUS_CONNECTED; -- g_free (str); -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- GST_WARNING ("auth send: %s", error_str); -- g_free (str); -- goto error; -- } -- -- } -- break; -- case FS_MSN_STATUS_CONNECTED: -- if (pollfd->server) -- { -- -- if (send(pollfd->pollfd.fd, "connected\r\n\r\n", 13, 0) != -1) -- { -- GST_DEBUG ("sent connected"); -- if (self->producer) -- { -- pollfd->status = FS_MSN_STATUS_SEND_RECEIVE; -- success = TRUE; -- } -- else -- { -- pollfd->status = FS_MSN_STATUS_CONNECTED2; -- } -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- GST_WARNING ("sending connected: %s", error_str); -- goto error; -- } -- } else { -- GST_DEBUG ("shouldn't receive data when server on CONNECTED state"); -- goto error; -- } -- break; -- case FS_MSN_STATUS_CONNECTED2: -- if (!pollfd->server) -- { -- -- if (send(pollfd->pollfd.fd, "connected\r\n\r\n", 13, 0) != -1) -- { -- GST_DEBUG ("sent connected"); -- pollfd->status = FS_MSN_STATUS_SEND_RECEIVE; -- success = TRUE; -- } -- else -- { -- gchar error_str[256]; -- strerror_r (errno, error_str, 256); -- GST_WARNING ("sending connected: %s", error_str); -- goto error; -- } -- } else { -- GST_ERROR ("shouldn't receive data when client on CONNECTED2 state"); -- goto error; -- } -- break; -- default: -- GST_ERROR ("Invalid status %d", pollfd->status); -- goto error; -- break; -- } -- } -- -- if (success) { -- // success! we need to shutdown/close all other channels -- shutdown_fd (self, pollfd, FALSE); -- -- g_signal_emit (self, signals[SIGNAL_CONNECTED], 0, pollfd->pollfd.fd); -- -- pollfd->want_read = FALSE; -- pollfd->want_write = FALSE; -- gst_poll_fd_ctl_read (self->poll, &pollfd->pollfd, FALSE); -- gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, FALSE); -- } -- -- return; -- error: -- /* Error */ -- GST_WARNING ("Got error from fd %d, closing", pollfd->pollfd.fd); -- shutdown_fd (self, pollfd, TRUE); -- -- FS_MSN_CONNECTION_LOCK (self); -- success = (self->pollfds->len > 1); -- FS_MSN_CONNECTION_UNLOCK (self); -- -- if (!success) -- g_signal_emit (self, signals[SIGNAL_CONNECTION_FAILED], 0); -- -- return; --} -- --static gpointer --connection_polling_thread (gpointer data) --{ -- FsMsnConnection *self = data; -- gint ret; -- GstClockTime timeout; -- GstPoll * poll; -- -- FS_MSN_CONNECTION_LOCK(self); -- timeout = self->poll_timeout; -- poll = self->poll; -- GST_DEBUG ("poll waiting %d", self->pollfds->len); -- FS_MSN_CONNECTION_UNLOCK(self); -- -- while ((ret = gst_poll_wait (poll, timeout)) >= 0) -- { -- GST_DEBUG ("gst_poll_wait returned : %d", ret); -- FS_MSN_CONNECTION_LOCK(self); -- if (ret > 0) -- { -- gint i; -- -- for (i = 0; i < self->pollfds->len; i++) -- { -- FsMsnPollFD *pollfd = NULL; -- -- pollfd = g_ptr_array_index(self->pollfds, i); -- -- GST_DEBUG ("ret %d - i = %d, len = %d", ret, i, self->pollfds->len); -- -- GST_DEBUG ("%p - error %d, close %d, read %d-%d, write %d-%d", -- pollfd, -- gst_poll_fd_has_error (poll, &pollfd->pollfd), -- gst_poll_fd_has_closed (poll, &pollfd->pollfd), -- pollfd->want_read, -- gst_poll_fd_can_read (poll, &pollfd->pollfd), -- pollfd->want_write, -- gst_poll_fd_can_write (poll, &pollfd->pollfd)); -- -- if (gst_poll_fd_has_error (poll, &pollfd->pollfd) || -- gst_poll_fd_has_closed (poll, &pollfd->pollfd)) -- { -- pollfd->callback (self, pollfd); -- shutdown_fd_locked (self, pollfd, TRUE); -- i--; -- continue; -- } -- if ((pollfd->want_read && -- gst_poll_fd_can_read (poll, &pollfd->pollfd)) || -- (pollfd->want_write && -- gst_poll_fd_can_write (poll, &pollfd->pollfd))) -- { -- pollfd->callback (self, pollfd); -- } -- -- } -- } -- timeout = self->poll_timeout; -- FS_MSN_CONNECTION_UNLOCK(self); -- } -- -- return NULL; --} -- -- --static void --shutdown_fd (FsMsnConnection *self, FsMsnPollFD *pollfd, gboolean equal) --{ -- FS_MSN_CONNECTION_LOCK (self); -- shutdown_fd_locked (self, pollfd, equal); -- FS_MSN_CONNECTION_UNLOCK (self); --} -- --static void --shutdown_fd_locked (FsMsnConnection *self, FsMsnPollFD *pollfd, gboolean equal) --{ -- gint i; -- guint closed = 0; -- -- for (i = 0; i < self->pollfds->len; i++) -- { -- FsMsnPollFD *p = g_ptr_array_index(self->pollfds, i); -- if ((equal && p == pollfd) || (!equal && p != pollfd)) -- { -- GST_DEBUG ("Shutting down p %p (fd %d)", p, p->pollfd.fd); -- -- if (!gst_poll_fd_has_closed (self->poll, &p->pollfd)) -- close (p->pollfd.fd); -- if (!gst_poll_remove_fd (self->poll, &p->pollfd)) -- GST_WARNING ("Could not remove pollfd %p", p); -- g_ptr_array_remove_index_fast (self->pollfds, i); -- g_slice_free (FsMsnPollFD, p); -- closed++; -- i--; -- } -- } -- -- if (closed) -- gst_poll_restart (self->poll); -- else -- GST_WARNING ("Could find pollfd to remove"); --} -- --static FsMsnPollFD * --add_pollfd_locked (FsMsnConnection *self, int fd, PollFdCallback callback, -- gboolean read, gboolean write, gboolean server) --{ -- FsMsnPollFD *pollfd = g_slice_new0 (FsMsnPollFD); -- gst_poll_fd_init (&pollfd->pollfd); -- pollfd->pollfd.fd = fd; -- pollfd->server = server; -- pollfd->want_read = read; -- pollfd->want_write = write; -- pollfd->status = FS_MSN_STATUS_AUTH; -- -- gst_poll_add_fd (self->poll, &pollfd->pollfd); -- -- gst_poll_fd_ctl_read (self->poll, &pollfd->pollfd, read); -- gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, write); -- pollfd->callback = callback; -- -- GST_DEBUG ("ADD_POLLFD %p (%p) - error %d, close %d, read %d-%d, write %d-%d", -- self->pollfds, pollfd, -- gst_poll_fd_has_error (self->poll, &pollfd->pollfd), -- gst_poll_fd_has_closed (self->poll, &pollfd->pollfd), -- pollfd->want_read, -- gst_poll_fd_can_read (self->poll, &pollfd->pollfd), -- pollfd->want_write, -- gst_poll_fd_can_write (self->poll, &pollfd->pollfd)); -- -- g_ptr_array_add (self->pollfds, pollfd); -- gst_poll_restart (self->poll); -- return pollfd; --} -diff --git a/gst/fsmsnconference/fs-msn-connection.h b/gst/fsmsnconference/fs-msn-connection.h -deleted file mode 100644 -index a3563cca..00000000 ---- a/gst/fsmsnconference/fs-msn-connection.h -+++ /dev/null -@@ -1,97 +0,0 @@ --/* -- * Farstream - Farstream MSN Stream -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * @author: Youness Alaoui -- * -- * fs-msn-connection.h - An MSN Connection class -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_CONNECTION_H__ --#define __FS_MSN_CONNECTION_H__ -- --#include "fs-msn-participant.h" --#include "fs-msn-session.h" -- --G_BEGIN_DECLS -- --/* TYPE MACROS */ --#define FS_TYPE_MSN_CONNECTION \ -- (fs_msn_connection_get_type ()) --#define FS_MSN_CONNECTION(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_MSN_CONNECTION, FsMsnConnection)) --#define FS_MSN_CONNECTION_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_MSN_CONNECTION, FsMsnConnectionClass)) --#define FS_IS_MSN_CONNECTION(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_MSN_CONNECTION)) --#define FS_IS_MSN_CONNECTION_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_MSN_CONNECTION)) --#define FS_MSN_CONNECTION_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_MSN_CONNECTION, FsMsnConnectionClass)) --#define FS_MSN_CONNECTION_CAST(obj) ((FsMsnConnection*) (obj)) -- --typedef struct _FsMsnConnection FsMsnConnection; --typedef struct _FsMsnConnectionClass FsMsnConnectionClass; --typedef struct _FsMsnConnectionPrivate FsMsnConnectionPrivate; -- -- --struct _FsMsnConnectionClass --{ -- GObjectClass parent_class; --}; -- --/** -- * FsMsnConnection: -- * -- */ --struct _FsMsnConnection --{ -- GObject parent; -- -- /* All variables that are not protected by the lock are read-only */ -- -- gchar *local_recipient_id; -- gchar *remote_recipient_id; /* protected by lock */ -- guint session_id; /* protected by lock */ -- guint initial_port; -- gboolean producer; -- -- GThread *polling_thread; /* protected by lock */ -- GstClockTime poll_timeout; /* protected by lock */ -- GstPoll *poll; -- GPtrArray *pollfds; /* protected by lock */ -- GRecMutex mutex; --}; -- --GType fs_msn_connection_get_type (void); -- --FsMsnConnection *fs_msn_connection_new (guint session_id, gboolean producer, -- guint initial_port); -- --gboolean fs_msn_connection_gather_local_candidates (FsMsnConnection *connection, -- GError **error); -- --gboolean fs_msn_connection_add_remote_candidates (FsMsnConnection *connection, -- GList *candidates, GError **error); -- -- --G_END_DECLS -- --#endif /* __FS_MSN_CONNECTION_H__ */ -diff --git a/gst/fsmsnconference/fs-msn-participant.c b/gst/fsmsnconference/fs-msn-participant.c -deleted file mode 100644 -index 1dcf72c9..00000000 ---- a/gst/fsmsnconference/fs-msn-participant.c -+++ /dev/null -@@ -1,65 +0,0 @@ --/* -- * Farstream - Farstream MSN Participant -- * -- * Copyright 2007 Collabora Ltd. -- * @author: Olivier Crete -- * Copyright 2008 Richard Spiers -- * -- * fs-msn-participant.c - A MSN Farstream Participant gobject -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --/** -- * SECTION:fs-msn-participant -- * @short_description: A MSN participant in a #FsMsnConference -- * -- * This object represents one participant or person in a conference -- */ -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include "fs-msn-participant.h" -- --/* Signals */ --enum --{ -- LAST_SIGNAL --}; -- --/* props */ --enum --{ -- PROP_0, --}; -- --G_DEFINE_TYPE(FsMsnParticipant, fs_msn_participant, FS_TYPE_PARTICIPANT); -- --static void --fs_msn_participant_class_init (FsMsnParticipantClass *klass) --{ --} -- --static void --fs_msn_participant_init (FsMsnParticipant *self) --{ --} -- --FsMsnParticipant *fs_msn_participant_new (void) --{ -- return g_object_new (FS_TYPE_MSN_PARTICIPANT, NULL); --} -diff --git a/gst/fsmsnconference/fs-msn-participant.h b/gst/fsmsnconference/fs-msn-participant.h -deleted file mode 100644 -index 44c6a0a2..00000000 ---- a/gst/fsmsnconference/fs-msn-participant.h -+++ /dev/null -@@ -1,79 +0,0 @@ --/* -- * Farstream - Farstream MSN Participant -- * -- * Copyright 2007 Collabora Ltd. -- * @author: Olivier Crete -- * Copyright 2008 Richard Spiers -- * -- * fs-msn-participant.h - A Farstream MSN Participant gobject -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_PARTICIPANT_H__ --#define __FS_MSN_PARTICIPANT_H__ -- --#include -- --G_BEGIN_DECLS -- --/* TYPE MACROS */ --#define FS_TYPE_MSN_PARTICIPANT (fs_msn_participant_get_type()) --#define FS_MSN_PARTICIPANT(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_MSN_PARTICIPANT, \ -- FsMsnParticipant)) --#define FS_MSN_PARTICIPANT_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_MSN_PARTICIPANT, \ -- FsMsnParticipantClass)) --#define FS_IS_MSN_PARTICIPANT(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_MSN_PARTICIPANT)) --#define FS_IS_MSN_PARTICIPANT_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_MSN_PARTICIPANT)) --#define FS_MSN_PARTICIPANT_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_MSN_PARTICIPANT, \ -- FsMsnParticipantClass)) --#define FS_MSN_PARTICIPANT_CAST(obj) ((FsMsnParticipant *) (obj)) -- --typedef struct _FsMsnParticipant FsMsnParticipant; --typedef struct _FsMsnParticipantClass FsMsnParticipantClass; --typedef struct _FsMsnParticipantPrivate FsMsnParticipantPrivate; -- --struct _FsMsnParticipantClass --{ -- FsParticipantClass parent_class; -- -- /*virtual functions */ -- -- /*< private >*/ -- FsMsnParticipantPrivate *priv; --}; -- --/** -- * FsMsnParticipant: -- * -- */ --struct _FsMsnParticipant --{ -- FsParticipant parent; -- FsMsnParticipantPrivate *priv; --}; -- --GType fs_msn_participant_get_type (void); -- --FsMsnParticipant *fs_msn_participant_new (void); -- --G_END_DECLS -- --#endif /* __FS_MSN_PARTICIPANT_H__ */ -diff --git a/gst/fsmsnconference/fs-msn-session.c b/gst/fsmsnconference/fs-msn-session.c -deleted file mode 100644 -index cf455fd0..00000000 ---- a/gst/fsmsnconference/fs-msn-session.c -+++ /dev/null -@@ -1,544 +0,0 @@ --/* -- * Farstream - Farstream MSN Session -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * @author: Youness Alaoui -- * -- * fs-msn-session.c - A Farstream Msn Session gobject -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --/** -- * SECTION:fs-msn-session -- * @short_description: A MSN session in a #FsMsnConference -- * -- * There can be only one stream per session. -- * -- * It can afterwards be modified to pause sending (or receiving) by modifying -- * the #FsMsnStream::direction property. -- * -- * The transmitter parameters to the fs_session_new_stream() function are -- * used to set the initial value of the construct properties of the stream -- * object. This plugin does not use transmitter plugins, so the transmitter -- * parameter itself is ignored. -- * -- * The codecs preferences can not be modified and the codec is a fixed value. -- * It is always "MIMIC". -- */ -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include "fs-msn-session.h" -- --#include -- --#include -- --#include "fs-msn-stream.h" --#include "fs-msn-participant.h" -- --#define GST_CAT_DEFAULT fsmsnconference_debug -- --/* Signals */ --enum --{ -- LAST_SIGNAL --}; -- --/* props */ --enum --{ -- PROP_0, -- PROP_MEDIA_TYPE, -- PROP_ID, -- PROP_SINK_PAD, -- PROP_CODEC_PREFERENCES, -- PROP_CODECS, -- PROP_CODECS_WITHOUT_CONFIG, -- PROP_CURRENT_SEND_CODEC, -- PROP_CONFERENCE, -- PROP_TOS --}; -- -- -- --struct _FsMsnSessionPrivate --{ -- FsMediaType media_type; -- -- FsMsnConference *conference; -- FsMsnStream *stream; -- -- GError *construction_error; -- -- GstPad *media_sink_pad; -- -- guint tos; /* Protected by conf lock */ -- -- GMutex mutex; /* protects the conference */ --}; -- --G_DEFINE_TYPE (FsMsnSession, fs_msn_session, FS_TYPE_SESSION); -- --#define FS_MSN_SESSION_GET_PRIVATE(o) \ -- (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_MSN_SESSION, FsMsnSessionPrivate)) -- --static void fs_msn_session_dispose (GObject *object); --static void fs_msn_session_finalize (GObject *object); -- --static void fs_msn_session_get_property (GObject *object, -- guint prop_id, -- GValue *value, -- GParamSpec *pspec); --static void fs_msn_session_set_property (GObject *object, -- guint prop_id, -- const GValue *value, -- GParamSpec *pspec); -- --static void fs_msn_session_constructed (GObject *object); -- --static FsStream *fs_msn_session_new_stream (FsSession *session, -- FsParticipant *participant, -- FsStreamDirection direction, -- GError **error); -- --static GType --fs_msn_session_get_stream_transmitter_type (FsSession *session, -- const gchar *transmitter); -- --static void _remove_stream (gpointer user_data, -- GObject *where_the_object_was); -- --static void --fs_msn_session_class_init (FsMsnSessionClass *klass) --{ -- GObjectClass *gobject_class; -- FsSessionClass *session_class; -- -- gobject_class = (GObjectClass *) klass; -- session_class = FS_SESSION_CLASS (klass); -- -- gobject_class->set_property = fs_msn_session_set_property; -- gobject_class->get_property = fs_msn_session_get_property; -- gobject_class->constructed = fs_msn_session_constructed; -- -- session_class->new_stream = fs_msn_session_new_stream; -- session_class->get_stream_transmitter_type = -- fs_msn_session_get_stream_transmitter_type; -- -- g_object_class_override_property (gobject_class, -- PROP_MEDIA_TYPE, "media-type"); -- g_object_class_override_property (gobject_class, -- PROP_ID, "id"); -- g_object_class_override_property (gobject_class, -- PROP_SINK_PAD, "sink-pad"); -- -- g_object_class_override_property (gobject_class, -- PROP_CODEC_PREFERENCES, "codec-preferences"); -- g_object_class_override_property (gobject_class, -- PROP_CODECS, "codecs"); -- g_object_class_override_property (gobject_class, -- PROP_CODECS_WITHOUT_CONFIG, "codecs-without-config"); -- g_object_class_override_property (gobject_class, -- PROP_CURRENT_SEND_CODEC, "current-send-codec"); -- g_object_class_override_property (gobject_class, -- PROP_TOS, "tos"); -- g_object_class_override_property (gobject_class, -- PROP_CONFERENCE, "conference"); -- -- gobject_class->dispose = fs_msn_session_dispose; -- gobject_class->finalize = fs_msn_session_finalize; -- -- g_type_class_add_private (klass, sizeof (FsMsnSessionPrivate)); --} -- --static void --fs_msn_session_init (FsMsnSession *self) --{ -- /* member init */ -- self->priv = FS_MSN_SESSION_GET_PRIVATE (self); -- self->priv->construction_error = NULL; -- -- g_mutex_init (&self->priv->mutex); -- -- self->priv->media_type = FS_MEDIA_TYPE_LAST + 1; --} -- -- --static FsMsnConference * --fs_msn_session_get_conference (FsMsnSession *self, GError **error) --{ -- FsMsnConference *conference; -- -- g_mutex_lock (&self->priv->mutex); -- conference = self->priv->conference; -- if (conference) -- g_object_ref (conference); -- g_mutex_unlock (&self->priv->mutex); -- -- if (!conference) -- g_set_error (error, FS_ERROR, FS_ERROR_DISPOSED, -- "Called function after session has been disposed"); -- -- return conference; --} -- -- --static void --fs_msn_session_dispose (GObject *object) --{ -- FsMsnSession *self = FS_MSN_SESSION (object); -- GstBin *conferencebin = NULL; -- FsMsnConference *conference = fs_msn_session_get_conference (self, NULL); -- GstElement *valve = NULL; -- -- g_mutex_lock (&self->priv->mutex); -- self->priv->conference = NULL; -- g_mutex_unlock (&self->priv->mutex); -- -- if (!conference) -- goto out; -- -- if (self->priv->stream) -- { -- g_object_weak_unref (G_OBJECT (self->priv->stream), _remove_stream, self); -- fs_stream_destroy (FS_STREAM (self->priv->stream)); -- self->priv->stream = NULL; -- } -- -- conferencebin = GST_BIN (conference); -- -- if (!conferencebin) -- goto out; -- -- if (self->priv->media_sink_pad) -- gst_pad_set_active (self->priv->media_sink_pad, FALSE); -- -- GST_OBJECT_LOCK (conference); -- valve = self->valve; -- self->valve = NULL; -- GST_OBJECT_UNLOCK (conference); -- -- if (valve) -- { -- gst_element_set_locked_state (valve, TRUE); -- gst_element_set_state (valve, GST_STATE_NULL); -- gst_bin_remove (conferencebin, valve); -- } -- -- if (self->priv->media_sink_pad) -- gst_element_remove_pad (GST_ELEMENT (conference), -- self->priv->media_sink_pad); -- self->priv->media_sink_pad = NULL; -- -- gst_object_unref (conferencebin); -- gst_object_unref (conference); -- -- out: -- -- G_OBJECT_CLASS (fs_msn_session_parent_class)->dispose (object); --} -- --static void --fs_msn_session_finalize (GObject *object) --{ -- FsMsnSession *self = FS_MSN_SESSION (object); -- -- g_mutex_clear (&self->priv->mutex); -- -- G_OBJECT_CLASS (fs_msn_session_parent_class)->finalize (object); --} -- --static void --fs_msn_session_get_property (GObject *object, -- guint prop_id, -- GValue *value, -- GParamSpec *pspec) --{ -- FsMsnSession *self = FS_MSN_SESSION (object); -- FsMsnConference *conference = fs_msn_session_get_conference (self, NULL); -- -- if (!conference) -- return; -- -- switch (prop_id) -- { -- case PROP_MEDIA_TYPE: -- g_value_set_enum (value, self->priv->media_type); -- break; -- case PROP_ID: -- g_value_set_uint (value, 1); -- break; -- case PROP_CONFERENCE: -- g_value_set_object (value, self->priv->conference); -- break; -- case PROP_SINK_PAD: -- g_value_set_object (value, self->priv->media_sink_pad); -- break; -- case PROP_CODEC_PREFERENCES: -- /* There are no preferences, so return NULL */ -- break; -- case PROP_CODECS: -- case PROP_CODECS_WITHOUT_CONFIG: -- { -- GList *codecs = NULL; -- FsCodec *mimic_codec = fs_codec_new (FS_CODEC_ID_ANY, "mimic", -- FS_MEDIA_TYPE_VIDEO, 0); -- codecs = g_list_append (codecs, mimic_codec); -- g_value_take_boxed (value, codecs); -- } -- break; -- case PROP_CURRENT_SEND_CODEC: -- { -- FsCodec *send_codec = fs_codec_new (FS_CODEC_ID_ANY, "mimic", -- FS_MEDIA_TYPE_VIDEO, 0); -- g_value_take_boxed (value, send_codec); -- break; -- } -- case PROP_TOS: -- GST_OBJECT_LOCK (conference); -- g_value_set_uint (value, self->priv->tos); -- GST_OBJECT_UNLOCK (conference); -- break; -- default: -- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- break; -- } -- -- gst_object_unref (conference); --} -- --static void --fs_msn_session_set_property (GObject *object, -- guint prop_id, -- const GValue *value, -- GParamSpec *pspec) --{ -- FsMsnSession *self = FS_MSN_SESSION (object); -- FsMsnConference *conference = fs_msn_session_get_conference (self, NULL); -- -- if (!conference && !(pspec->flags & G_PARAM_CONSTRUCT_ONLY)) -- return; -- -- switch (prop_id) -- { -- case PROP_MEDIA_TYPE: -- self->priv->media_type = g_value_get_enum (value); -- break; -- case PROP_ID: -- break; -- case PROP_CONFERENCE: -- self->priv->conference = FS_MSN_CONFERENCE (g_value_dup_object (value)); -- break; -- case PROP_TOS: -- if (conference) -- GST_OBJECT_LOCK (conference); -- self->priv->tos = g_value_get_uint (value); -- if (self->priv->stream) -- fs_msn_stream_set_tos_locked (self->priv->stream, self->priv->tos); -- if (conference) -- GST_OBJECT_UNLOCK (conference); -- break; -- default: -- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- break; -- } -- -- if (conference) -- gst_object_unref (conference); --} -- --static void --fs_msn_session_constructed (GObject *object) --{ -- FsMsnSession *self = FS_MSN_SESSION (object); -- GstPad *pad; -- -- g_assert (self->priv->conference); -- -- self->valve = gst_element_factory_make ("valve", NULL); -- -- if (!self->valve) -- { -- self->priv->construction_error = g_error_new (FS_ERROR, -- FS_ERROR_CONSTRUCTION, "Could not make sink valve"); -- return; -- } -- -- if (!gst_bin_add (GST_BIN (self->priv->conference), self->valve)) -- { -- self->priv->construction_error = g_error_new (FS_ERROR, -- FS_ERROR_CONSTRUCTION, "Could not add valve to conference"); -- return; -- } -- -- g_object_set (G_OBJECT (self->valve), "drop", TRUE, NULL); -- -- pad = gst_element_get_static_pad (self->valve, "sink"); -- self->priv->media_sink_pad = gst_ghost_pad_new ("sink1", pad); -- gst_object_unref (pad); -- -- if (!self->priv->media_sink_pad) -- { -- self->priv->construction_error = g_error_new (FS_ERROR, -- FS_ERROR_CONSTRUCTION, "Could not create sink ghost pad"); -- return; -- } -- -- gst_pad_set_active (self->priv->media_sink_pad, TRUE); -- if (!gst_element_add_pad (GST_ELEMENT (self->priv->conference), -- self->priv->media_sink_pad)) -- { -- self->priv->construction_error = g_error_new (FS_ERROR, -- FS_ERROR_CONSTRUCTION, "Could not add sink pad to conference"); -- gst_object_unref (self->priv->media_sink_pad); -- self->priv->media_sink_pad = NULL; -- return; -- } -- -- gst_element_sync_state_with_parent (self->valve); -- -- if (G_OBJECT_CLASS (fs_msn_session_parent_class)->constructed) -- G_OBJECT_CLASS (fs_msn_session_parent_class)->constructed (object); --} -- -- --static void --_remove_stream (gpointer user_data, -- GObject *where_the_object_was) --{ -- FsMsnSession *self = FS_MSN_SESSION (user_data); -- FsMsnConference *conference = fs_msn_session_get_conference (self, NULL); -- -- if (!conference) -- return; -- -- GST_OBJECT_LOCK (conference); -- if (self->priv->stream == (FsMsnStream *) where_the_object_was) -- self->priv->stream = NULL; -- GST_OBJECT_UNLOCK (conference); -- gst_object_unref (conference); --} -- --/** -- * fs_msn_session_new_stream: -- * @session: an #FsMsnSession -- * @participant: #FsParticipant of a participant for the new stream -- * @direction: #FsStreamDirection describing the direction of the new stream -- * that will be created for this participant -- * @error: location of a #GError, or NULL if no error occured -- * -- * This function creates a stream for the given participant into the active -- * session. -- * -- * Returns: the new #FsStream that has been created. User must unref the -- * #FsStream when the stream is ended. If an error occured, returns NULL. -- */ --static FsStream * --fs_msn_session_new_stream (FsSession *session, -- FsParticipant *participant, -- FsStreamDirection direction, -- GError **error) --{ -- FsMsnSession *self = FS_MSN_SESSION (session); -- FsMsnParticipant *msnparticipant = NULL; -- FsStream *new_stream = NULL; -- FsMsnConference *conference; -- -- if (!FS_IS_MSN_PARTICIPANT (participant)) -- { -- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS, -- "You have to provide a participant of type MSN"); -- return NULL; -- } -- -- conference = fs_msn_session_get_conference (self, error); -- if (!conference) -- return FALSE; -- -- GST_OBJECT_LOCK (conference); -- if (self->priv->stream) -- goto already_have_stream; -- GST_OBJECT_UNLOCK (conference); -- -- msnparticipant = FS_MSN_PARTICIPANT (participant); -- -- new_stream = FS_STREAM_CAST (fs_msn_stream_new (self, msnparticipant, -- direction, conference)); -- -- GST_OBJECT_LOCK (conference); -- if (self->priv->stream) -- { -- g_object_unref (new_stream); -- goto already_have_stream; -- } -- self->priv->stream = (FsMsnStream *) new_stream; -- g_object_weak_ref (G_OBJECT (new_stream), _remove_stream, self); -- -- fs_msn_stream_set_tos_locked (self->priv->stream, self->priv->tos); -- GST_OBJECT_UNLOCK (conference); -- -- gst_object_unref (conference); -- -- -- return new_stream; -- -- already_have_stream: -- GST_OBJECT_UNLOCK (conference); -- gst_object_unref (conference); -- -- g_set_error (error, FS_ERROR, FS_ERROR_ALREADY_EXISTS, -- "There already is a stream in this session"); -- return NULL; --} -- --FsMsnSession * --fs_msn_session_new (FsMediaType media_type, -- FsMsnConference *conference, -- GError **error) --{ -- FsMsnSession *session = g_object_new (FS_TYPE_MSN_SESSION, -- "media-type", media_type, -- "conference", conference, -- NULL); -- -- if (!session) -- { -- *error = g_error_new (FS_ERROR, FS_ERROR_CONSTRUCTION, -- "Could not create object"); -- } -- else if (session->priv->construction_error) -- { -- g_propagate_error (error, session->priv->construction_error); -- g_object_unref (session); -- return NULL; -- } -- -- return session; --} -- -- --static GType --fs_msn_session_get_stream_transmitter_type (FsSession *session, -- const gchar *transmitter) --{ -- return FS_TYPE_MSN_STREAM; --} -diff --git a/gst/fsmsnconference/fs-msn-session.h b/gst/fsmsnconference/fs-msn-session.h -deleted file mode 100644 -index 79189e17..00000000 ---- a/gst/fsmsnconference/fs-msn-session.h -+++ /dev/null -@@ -1,90 +0,0 @@ --/* -- * Farstream - Farstream MSN Session -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-session.h - A Farstream Msn Session gobject -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_SESSION_H__ --#define __FS_MSN_SESSION_H__ -- --#include -- --#include -- --#include "fs-msn-conference.h" -- --G_BEGIN_DECLS -- --/* TYPE MACROS */ --#define FS_TYPE_MSN_SESSION \ -- (fs_msn_session_get_type ()) --#define FS_MSN_SESSION(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_MSN_SESSION, FsMsnSession)) --#define FS_MSN_SESSION_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_MSN_SESSION, FsMsnSessionClass)) --#define FS_IS_MSN_SESSION(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_MSN_SESSION)) --#define FS_IS_MSN_SESSION_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_MSN_SESSION)) --#define FS_MSN_SESSION_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_MSN_SESSION, FsMsnSessionClass)) --#define FS_MSN_SESSION_CAST(obj) ((FsMsnSession *) (obj)) -- --typedef struct _FsMsnSession FsMsnSession; --typedef struct _FsMsnSessionClass FsMsnSessionClass; --typedef struct _FsMsnSessionPrivate FsMsnSessionPrivate; -- --struct _FsMsnSessionClass -- { -- FsSessionClass parent_class; -- }; -- --/** -- * FsMsnSession: -- * -- */ --struct _FsMsnSession --{ -- FsSession parent; -- -- /* Protected by the conf lock */ -- GstElement *valve; -- -- /*< private >*/ -- -- FsMsnSessionPrivate *priv; --}; -- -- --GType fs_msn_session_get_type (void); -- --FsMsnSession *fs_msn_session_new (FsMediaType media_type, -- FsMsnConference *conference, -- GError **error); -- --void fs_msn_session_new_recv_pad (FsMsnSession *session, -- GstPad *new_pad, -- guint32 ssrc, guint pt); -- --G_END_DECLS -- --#endif /* __FS_MSN_SESSION_H__ */ -diff --git a/gst/fsmsnconference/fs-msn-stream.c b/gst/fsmsnconference/fs-msn-stream.c -deleted file mode 100644 -index 7ac0a85e..00000000 ---- a/gst/fsmsnconference/fs-msn-stream.c -+++ /dev/null -@@ -1,912 +0,0 @@ --/* -- * Farstream - Farstream MSN Stream -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007-2009 Collabora Ltd. -- * @author: Olivier Crete -- * @author: Youness Alaoui -- * -- * fs-msn-stream.c - A Farstream MSN Stream gobject -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --/** -- * SECTION:fs-msn-stream -- * @short_description: A MSN stream in a #FsMsnSession in a #FsMsnConference -- * -- * The #FsMsnStream::direction property can be used to pause the stream, but not -- * to change the direction between sending and receiving since this protocol -- * is unidirectional. -- * -- * The "foundation" field of the local #FsCandidate contains the "recipient-id" -- * that must be transmitted to the peer. -- * -- * The session id can either be retrieved as a property, but it is also -- * put into every #FsCandidate in the "username" field. -- * -- * If the peer started the webcam session, it picks the session-id, it can then -- * be set either in the transmitter parameters field of fs_session_new_stream() -- * or by putting it in the "username" field of the remote #FsCandidate. -- */ -- --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif -- --#include "fs-msn-stream.h" -- --#include --#include --#include --#include --#include --#include -- --#include -- --#include -- -- --#include "fs-msn-connection.h" -- -- --#define GST_CAT_DEFAULT fsmsnconference_debug -- --/* Signals */ --enum --{ -- LAST_SIGNAL --}; -- --/* props */ --enum --{ -- PROP_0, -- PROP_DIRECTION, -- PROP_PARTICIPANT, -- PROP_SESSION, -- PROP_CONFERENCE, -- PROP_SESSION_ID, -- PROP_INITIAL_PORT --}; -- -- -- --struct _FsMsnStreamPrivate --{ -- FsMsnConference *conference; -- FsMsnSession *session; -- FsMsnParticipant *participant; -- FsStreamDirection direction; -- GstElement *codecbin; -- GstElement *recv_valve; -- GstPad *src_pad; -- FsMsnConnection *connection; -- -- guint session_id; -- guint initial_port; -- -- gint fd; -- gint tos; -- -- GMutex mutex; /* protects the conference */ --}; -- -- --G_DEFINE_TYPE(FsMsnStream, fs_msn_stream, FS_TYPE_STREAM); -- --#define FS_MSN_STREAM_GET_PRIVATE(o) \ -- (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_MSN_STREAM, FsMsnStreamPrivate)) -- --static void fs_msn_stream_dispose (GObject *object); --static void fs_msn_stream_finalize (GObject *object); -- --static void fs_msn_stream_get_property (GObject *object, -- guint prop_id, -- GValue *value, -- GParamSpec *pspec); --static void fs_msn_stream_set_property (GObject *object, -- guint prop_id, -- const GValue *value, -- GParamSpec *pspec); -- --static gboolean --fs_msn_stream_set_transmitter (FsStream *stream, -- const gchar *transmitter, -- GParameter *stream_transmitter_parameters, -- guint stream_transmitter_n_parameters, -- GError **error); -- --static gboolean fs_msn_stream_add_remote_candidates (FsStream *stream, -- GList *candidates, -- GError **error); -- --static void _local_candidates_prepared (FsMsnConnection *connection, -- gpointer user_data); -- --static void _new_local_candidate ( -- FsMsnConnection *connection, -- FsCandidate *candidate, -- gpointer user_data); -- --static void --_connected ( -- FsMsnConnection *connection, -- guint fd, -- gpointer user_data); -- --static void --_connection_failed (FsMsnConnection *connection, FsMsnStream *self); -- -- --static void --fs_msn_stream_class_init (FsMsnStreamClass *klass) --{ -- GObjectClass *gobject_class; -- FsStreamClass *stream_class = FS_STREAM_CLASS (klass); -- -- gobject_class = (GObjectClass *) klass; -- -- gobject_class->set_property = fs_msn_stream_set_property; -- gobject_class->get_property = fs_msn_stream_get_property; -- gobject_class->dispose = fs_msn_stream_dispose; -- gobject_class->finalize = fs_msn_stream_finalize; -- -- stream_class->add_remote_candidates = fs_msn_stream_add_remote_candidates; -- stream_class->set_transmitter = fs_msn_stream_set_transmitter; -- -- g_type_class_add_private (klass, sizeof (FsMsnStreamPrivate)); -- -- g_object_class_override_property (gobject_class, -- PROP_DIRECTION, -- "direction"); -- g_object_class_override_property (gobject_class, -- PROP_PARTICIPANT, -- "participant"); -- g_object_class_override_property (gobject_class, -- PROP_SESSION, -- "session"); -- -- g_object_class_install_property (gobject_class, -- PROP_CONFERENCE, -- g_param_spec_object ("conference", -- "The Conference this stream refers to", -- "This is a conveniance pointer for the Conference", -- FS_TYPE_MSN_CONFERENCE, -- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -- g_object_class_install_property (gobject_class, -- PROP_SESSION_ID, -- g_param_spec_uint ("session-id", -- "The session-id of the session", -- "This is the session-id of the MSN session", -- 0, 9999, 0, -- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -- g_object_class_install_property (gobject_class, -- PROP_INITIAL_PORT, -- g_param_spec_uint ("initial-port", -- "The initial port to listen on", -- "The initial port to try to listen on for incoming connection." -- " If already used, port+1 is tried until one succeeds", -- 1025, 65535, 1025, -- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); --} -- --static void --fs_msn_stream_init (FsMsnStream *self) --{ -- /* member init */ -- self->priv = FS_MSN_STREAM_GET_PRIVATE (self); -- -- self->priv->session = NULL; -- self->priv->participant = NULL; -- self->priv->fd = -1; -- -- self->priv->direction = FS_DIRECTION_NONE; -- -- g_mutex_init (&self->priv->mutex); --} -- -- --static FsMsnConference * --fs_msn_stream_get_conference (FsMsnStream *self, GError **error) --{ -- FsMsnConference *conference; -- -- g_mutex_lock (&self->priv->mutex); -- conference = self->priv->conference; -- if (conference) -- g_object_ref (conference); -- g_mutex_unlock (&self->priv->mutex); -- -- if (!conference) -- g_set_error (error, FS_ERROR, FS_ERROR_DISPOSED, -- "Called function after stream has been disposed"); -- -- return conference; --} -- --static void --fs_msn_stream_dispose (GObject *object) --{ -- FsMsnStream *self = FS_MSN_STREAM (object); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- -- if (!conference) -- return; -- -- g_mutex_lock (&self->priv->mutex); -- self->priv->conference = NULL; -- g_mutex_unlock (&self->priv->mutex); -- -- if (self->priv->src_pad) -- { -- gst_pad_set_active (self->priv->src_pad, FALSE); -- gst_element_remove_pad (GST_ELEMENT (conference), self->priv->src_pad); -- self->priv->src_pad = NULL; -- } -- -- if (self->priv->recv_valve) -- { -- gst_object_unref (self->priv->recv_valve); -- self->priv->recv_valve = NULL; -- } -- -- if (self->priv->codecbin) -- { -- gst_element_set_locked_state (self->priv->codecbin, TRUE); -- gst_element_set_state (self->priv->codecbin, GST_STATE_NULL); -- gst_bin_remove (GST_BIN (conference), self->priv->codecbin); -- self->priv->codecbin = NULL; -- } -- -- if (self->priv->participant) -- { -- g_object_unref (self->priv->participant); -- self->priv->participant = NULL; -- } -- -- if (self->priv->session) -- { -- g_object_unref (self->priv->session); -- self->priv->session = NULL; -- } -- -- if (self->priv->connection) -- { -- g_object_unref (self->priv->connection); -- self->priv->connection = NULL; -- } -- -- gst_object_unref (conference); -- gst_object_unref (conference); -- -- G_OBJECT_CLASS (fs_msn_stream_parent_class)->dispose (object); --} -- --static void --fs_msn_stream_finalize (GObject *object) --{ -- FsMsnStream *self = FS_MSN_STREAM (object); -- -- g_mutex_clear (&self->priv->mutex); -- -- G_OBJECT_CLASS (fs_msn_stream_parent_class)->finalize (object); --} -- -- --static void --fs_msn_stream_get_property (GObject *object, -- guint prop_id, -- GValue *value, -- GParamSpec *pspec) --{ -- FsMsnStream *self = FS_MSN_STREAM (object); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- -- if (!conference && -- !(pspec->flags & (G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT))) -- return; -- -- if (conference) -- GST_OBJECT_LOCK (conference); -- -- switch (prop_id) -- { -- case PROP_SESSION: -- g_value_set_object (value, self->priv->session); -- break; -- case PROP_PARTICIPANT: -- g_value_set_object (value, self->priv->participant); -- break; -- case PROP_DIRECTION: -- g_value_set_flags (value, self->priv->direction); -- break; -- case PROP_CONFERENCE: -- g_value_set_object (value, self->priv->conference); -- break; -- case PROP_SESSION_ID: -- g_object_get_property (G_OBJECT (self->priv->connection), "session-id", -- value); -- break; -- case PROP_INITIAL_PORT: -- g_value_set_uint (value, self->priv->initial_port); -- break; -- default: -- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- break; -- } -- -- if (conference) -- { -- GST_OBJECT_UNLOCK (conference); -- gst_object_unref (conference); -- } --} -- --static void --fs_msn_stream_set_property (GObject *object, -- guint prop_id, -- const GValue *value, -- GParamSpec *pspec) --{ -- FsMsnStream *self = FS_MSN_STREAM (object); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- -- if (!conference && -- !(pspec->flags & (G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT))) -- return; -- -- if (conference) -- GST_OBJECT_LOCK (conference); -- -- switch (prop_id) -- { -- case PROP_SESSION: -- self->priv->session = FS_MSN_SESSION (g_value_dup_object (value)); -- break; -- case PROP_PARTICIPANT: -- self->priv->participant = FS_MSN_PARTICIPANT (g_value_dup_object (value)); -- break; -- case PROP_DIRECTION: -- if (g_value_get_flags (value) != self->priv->direction) -- { -- GstElement *recv_valve = NULL; -- GstElement *session_valve = NULL; -- -- if (!conference || -- !self->priv->recv_valve || -- !self->priv->session) -- { -- self->priv->direction = g_value_get_flags (value); -- break; -- } -- -- if (self->priv->recv_valve) -- recv_valve = gst_object_ref (self->priv->recv_valve); -- if (self->priv->session->valve) -- session_valve = gst_object_ref (self->priv->session->valve); -- -- self->priv->direction = -- g_value_get_flags (value) & conference->max_direction; -- -- if (self->priv->direction == FS_DIRECTION_NONE) -- { -- GST_OBJECT_UNLOCK (conference); -- if (recv_valve) -- g_object_set (recv_valve, "drop", TRUE, NULL); -- g_object_set (session_valve, "drop", TRUE, NULL); -- GST_OBJECT_LOCK (conference); -- } -- else if (self->priv->direction == FS_DIRECTION_SEND) -- { -- if (self->priv->codecbin) -- { -- GST_OBJECT_UNLOCK (conference); -- g_object_set (session_valve, "drop", FALSE, NULL); -- GST_OBJECT_LOCK (conference); -- } -- } -- else if (self->priv->direction == FS_DIRECTION_RECV) -- { -- GST_OBJECT_UNLOCK (conference); -- if (recv_valve) -- g_object_set (recv_valve, "drop", FALSE, NULL); -- GST_OBJECT_LOCK (conference); -- } -- -- if (session_valve) -- gst_object_unref (session_valve); -- if (recv_valve) -- gst_object_unref (recv_valve); -- } -- self->priv->direction = g_value_get_flags (value); -- break; -- case PROP_CONFERENCE: -- self->priv->conference = FS_MSN_CONFERENCE (g_value_dup_object (value)); -- break; -- case PROP_SESSION_ID: -- self->priv->session_id = g_value_get_uint (value); -- if (self->priv->session_id == 0) -- self->priv->session_id = g_random_int_range (9000, 9999); -- break; -- case PROP_INITIAL_PORT: -- self->priv->initial_port = g_value_get_uint (value); -- break; -- default: -- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- break; -- } -- -- if (conference) -- { -- GST_OBJECT_UNLOCK (conference); -- gst_object_unref (conference); -- } --} -- --static void --_local_candidates_prepared (FsMsnConnection *connection, -- gpointer user_data) --{ -- FsMsnStream *self = FS_MSN_STREAM (user_data); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- -- if (!conference) -- return; -- -- gst_element_post_message (GST_ELEMENT (conference), -- gst_message_new_element (GST_OBJECT (conference), -- gst_structure_new ("farstream-local-candidates-prepared", -- "stream", FS_TYPE_STREAM, self, -- NULL))); -- -- gst_object_unref (conference); --} -- --static void --_new_local_candidate ( -- FsMsnConnection *connection, -- FsCandidate *candidate, -- gpointer user_data) --{ -- FsMsnStream *self = FS_MSN_STREAM (user_data); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- -- if (!conference) -- return; -- -- gst_element_post_message (GST_ELEMENT (conference), -- gst_message_new_element (GST_OBJECT (conference), -- gst_structure_new ("farstream-new-local-candidate", -- "stream", FS_TYPE_STREAM, self, -- "candidate", FS_TYPE_CANDIDATE, candidate, -- NULL))); -- -- gst_object_unref (conference); --} -- --static void --_connected ( -- FsMsnConnection *connection, -- guint fd, -- gpointer user_data) --{ -- FsMsnStream *self = FS_MSN_STREAM (user_data); -- GError *error = NULL; -- GstPad *pad; -- GstElement *fdelem; -- int checkfd; -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- GstElement *codecbin = NULL; -- GstElement *recv_valve = NULL; -- GstElement *send_valve = NULL; -- gboolean drop; -- -- if (!conference) -- goto error; -- -- GST_DEBUG ("******** CONNECTED %d**********", fd); -- -- gst_element_post_message (GST_ELEMENT (conference), -- gst_message_new_element (GST_OBJECT (conference), -- gst_structure_new ("farstream-component-state-changed", -- "stream", FS_TYPE_STREAM, self, -- "component", G_TYPE_UINT, 1, -- "state", FS_TYPE_STREAM_STATE, FS_STREAM_STATE_READY, -- NULL))); -- -- if (self->priv->conference->max_direction == FS_DIRECTION_RECV) -- codecbin = gst_parse_bin_from_description ( -- "fdsrc name=fdsrc do-timestamp=true ! mimdec ! valve name=recv_valve", TRUE, &error); -- else -- codecbin = gst_parse_bin_from_description ( -- "videoconvert ! videoscale ! mimenc name=enc !" -- " fdsink name=fdsink sync=false async=false", -- TRUE, &error); -- -- if (!codecbin) -- { -- g_prefix_error (&error, "Error creating codecbin: "); -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- error->message); -- g_clear_error (&error); -- goto error; -- } -- -- /* So we don't require an unlreased gst-plugins-bad mimenc */ -- if (self->priv->conference->max_direction == FS_DIRECTION_SEND) -- { -- GstElement *mimenc = gst_bin_get_by_name (GST_BIN (codecbin), "enc"); -- if (g_object_class_find_property ( -- G_OBJECT_GET_CLASS (mimenc), "paused-mode")) -- g_object_set (mimenc, "paused-mode", TRUE, NULL); -- gst_object_unref (mimenc); -- } -- -- if (self->priv->conference->max_direction == FS_DIRECTION_RECV) -- { -- fdelem = gst_bin_get_by_name (GST_BIN (codecbin), "fdsrc"); -- gst_base_src_set_format (GST_BASE_SRC (fdelem), GST_FORMAT_TIME); -- } -- else -- { -- fdelem = gst_bin_get_by_name (GST_BIN (codecbin), "fdsink"); -- } -- -- if (!fdelem) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not get fd element"); -- goto error; -- } -- -- g_object_set (fdelem, "fd", fd, NULL); -- g_object_get (fdelem, "fd", &checkfd, NULL); -- gst_object_unref (fdelem); -- -- if (fd != checkfd) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_INTERNAL, -- "Could not set file descriptor"); -- goto error; -- } -- -- -- if (self->priv->conference->max_direction == FS_DIRECTION_RECV) -- pad = gst_element_get_static_pad (codecbin, "src"); -- else -- pad = gst_element_get_static_pad (codecbin, "sink"); -- -- if (!pad) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not get codecbin pad"); -- goto error; -- } -- -- if (!gst_bin_add (GST_BIN (conference), codecbin)) -- { -- gst_object_unref (pad); -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not add codecbin to the conference"); -- goto error; -- } -- -- GST_OBJECT_LOCK (conference); -- self->priv->fd = fd; -- self->priv->codecbin = gst_object_ref (codecbin); -- GST_OBJECT_UNLOCK (conference); -- -- if (self->priv->conference->max_direction == FS_DIRECTION_RECV) -- { -- FsCodec *mimic_codec; -- GstPad *src_pad; -- -- src_pad = gst_ghost_pad_new ("src_1_1_1", pad); -- gst_object_unref (pad); -- -- GST_OBJECT_LOCK (conference); -- self->priv->src_pad = gst_object_ref (src_pad); -- GST_OBJECT_UNLOCK (conference); -- -- gst_pad_set_active (src_pad, TRUE); -- if (!gst_element_add_pad (GST_ELEMENT (conference), src_pad)) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not add src_1_1_1 pad"); -- gst_object_unref (src_pad); -- goto error; -- } -- -- recv_valve = gst_bin_get_by_name (GST_BIN (codecbin), "recv_valve"); -- -- if (!recv_valve) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not get recv_valve"); -- gst_object_unref (src_pad); -- goto error; -- } -- -- GST_OBJECT_LOCK (conference); -- self->priv->recv_valve = gst_object_ref (recv_valve); -- drop = !(self->priv->direction & FS_DIRECTION_RECV); -- GST_OBJECT_UNLOCK (conference); -- -- g_object_set (recv_valve, "drop", drop, NULL); -- -- -- mimic_codec = fs_codec_new (0, "mimic", -- FS_MEDIA_TYPE_VIDEO, 0); -- fs_stream_emit_src_pad_added (FS_STREAM (self), src_pad, mimic_codec); -- fs_codec_destroy (mimic_codec); -- gst_object_unref (src_pad); -- -- } -- else -- { -- GstPad *valvepad; -- -- GST_OBJECT_LOCK (conference); -- if (self->priv->session->valve) -- send_valve = gst_object_ref (self->priv->session->valve); -- GST_OBJECT_UNLOCK (conference); -- -- if (!send_valve) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_DISPOSED, -- "Session was disposed"); -- goto error; -- } -- -- valvepad = gst_element_get_static_pad (send_valve, "src"); -- -- if (!valvepad) -- { -- gst_object_unref (pad); -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not get valve sink pad"); -- goto error; -- } -- -- if (GST_PAD_LINK_FAILED (gst_pad_link (valvepad, pad))) -- { -- gst_object_unref (valvepad); -- gst_object_unref (pad); -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not link valve to codec bin"); -- goto error; -- } -- gst_object_unref (valvepad); -- gst_object_unref (pad); -- } -- -- if (!gst_element_sync_state_with_parent (codecbin)) -- { -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONSTRUCTION, -- "Could not start codec bin"); -- goto error; -- } -- -- if (self->priv->conference->max_direction == FS_DIRECTION_SEND) -- { -- GST_OBJECT_LOCK (conference); -- fs_msn_stream_set_tos_locked (self, self->priv->tos); -- drop = !(self->priv->direction & FS_DIRECTION_SEND); -- GST_OBJECT_UNLOCK (conference); -- g_object_set (send_valve, "drop", drop, NULL); -- } -- -- error: -- -- if (send_valve) -- gst_object_unref (send_valve); -- if (recv_valve) -- gst_object_unref (recv_valve); -- if (codecbin) -- gst_object_unref (codecbin); -- if (conference) -- gst_object_unref (conference); --} -- --static void --_connection_failed (FsMsnConnection *connection, FsMsnStream *self) --{ -- FsMsnConference *conference = fs_msn_stream_get_conference (self, NULL); -- -- if (!conference) -- return; -- -- GST_OBJECT_LOCK (conference); -- self->priv->fd = -1; -- GST_OBJECT_UNLOCK (conference); -- -- gst_element_post_message (GST_ELEMENT (conference), -- gst_message_new_element (GST_OBJECT (conference), -- gst_structure_new ("farstream-component-state-changed", -- "stream", FS_TYPE_STREAM, self, -- "component", G_TYPE_UINT, 1, -- "state", FS_TYPE_STREAM_STATE, FS_STREAM_STATE_FAILED, -- NULL))); -- -- fs_stream_emit_error (FS_STREAM (self), FS_ERROR_CONNECTION_FAILED, -- "Could not establish streaming connection"); -- -- gst_object_unref (conference); --} -- --/** -- * fs_msn_stream_add_remote_candidate: -- */ --static gboolean --fs_msn_stream_add_remote_candidates (FsStream *stream, GList *candidates, -- GError **error) --{ -- FsMsnStream *self = FS_MSN_STREAM (stream); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, error); -- FsMsnConnection *conn = NULL; -- gboolean ret = FALSE; -- -- if (!conference) -- return FALSE; -- -- GST_OBJECT_LOCK (conference); -- if (self->priv->connection) -- conn = g_object_ref (self->priv->connection); -- GST_OBJECT_UNLOCK (conference); -- -- if (conn) -- { -- ret = fs_msn_connection_add_remote_candidates (conn, candidates, error); -- g_object_unref (conn); -- } -- -- if (ret) -- gst_element_post_message (GST_ELEMENT (conference), -- gst_message_new_element (GST_OBJECT (conference), -- gst_structure_new ("farstream-component-state-changed", -- "stream", FS_TYPE_STREAM, self, -- "component", G_TYPE_UINT, 1, -- "state", FS_TYPE_STREAM_STATE, FS_STREAM_STATE_CONNECTING, -- NULL))); -- -- gst_object_unref (conference); -- -- return ret; --} -- -- --/** -- * fs_msn_stream_new: -- * @session: The #FsMsnSession this stream is a child of -- * @participant: The #FsMsnParticipant this stream is for -- * @direction: the initial #FsDirection for this stream -- * -- * -- * This function create a new stream -- * -- * Returns: the newly created string or NULL on error -- */ -- --FsMsnStream * --fs_msn_stream_new (FsMsnSession *session, -- FsMsnParticipant *participant, -- FsStreamDirection direction, -- FsMsnConference *conference) --{ -- FsMsnStream *self; -- -- self = g_object_new (FS_TYPE_MSN_STREAM, -- "session", session, -- "participant", participant, -- "direction", direction, -- "conference", conference, -- NULL); -- -- return self; --} -- --void --fs_msn_stream_set_tos_locked (FsMsnStream *self, gint tos) --{ -- self->priv->tos = tos; -- -- if (self->priv->fd < 0) -- return; -- -- if (setsockopt (self->priv->fd, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0) -- GST_WARNING ( "could not set socket ToS: %s", g_strerror (errno)); -- --#ifdef IPV6_TCLASS -- if (setsockopt (self->priv->fd, IPPROTO_IPV6, IPV6_TCLASS, -- &tos, sizeof (tos)) < 0) -- GST_WARNING ("could not set TCLASS: %s", g_strerror (errno)); --#endif --} -- -- --static gboolean --fs_msn_stream_set_transmitter (FsStream *stream, -- const gchar *transmitter, -- GParameter *stream_transmitter_parameters, -- guint stream_transmitter_n_parameters, -- GError **error) --{ -- FsMsnStream *self = FS_MSN_STREAM (stream); -- FsMsnConference *conference = fs_msn_stream_get_conference (self, error); -- gboolean producer; -- guint i; -- -- if (!conference) -- return FALSE; -- -- for (i = 0; i < stream_transmitter_n_parameters; i++) -- { -- if (!g_ascii_strcasecmp (stream_transmitter_parameters[i].name, -- "session-id")) -- { -- if (g_value_get_uint (&stream_transmitter_parameters[i].value) >= 1025 && -- g_value_get_uint (&stream_transmitter_parameters[i].value) < 65536) -- self->priv->session_id = -- g_value_get_uint (&stream_transmitter_parameters[i].value); -- } -- else if (!g_ascii_strcasecmp (stream_transmitter_parameters[i].name, -- "initial-port")) -- { -- if (g_value_get_uint (&stream_transmitter_parameters[i].value) < 10000) -- self->priv->initial_port = -- g_value_get_uint (&stream_transmitter_parameters[i].value); -- } -- } -- -- if (self->priv->conference->max_direction == FS_DIRECTION_RECV) -- producer = FALSE; -- else if (self->priv->conference->max_direction == FS_DIRECTION_SEND) -- producer = TRUE; -- else -- g_assert_not_reached (); -- -- -- self->priv->connection = fs_msn_connection_new (self->priv->session_id, -- producer, self->priv->initial_port); -- -- g_signal_connect (self->priv->connection, -- "new-local-candidate", -- G_CALLBACK (_new_local_candidate), self); -- g_signal_connect (self->priv->connection, -- "local-candidates-prepared", -- G_CALLBACK (_local_candidates_prepared), self); -- g_signal_connect (self->priv->connection, -- "connected", -- G_CALLBACK (_connected), self); -- g_signal_connect (self->priv->connection, -- "connection-failed", -- G_CALLBACK (_connection_failed), self); -- -- if (!fs_msn_connection_gather_local_candidates (self->priv->connection, -- error)) -- { -- g_object_unref (self->priv->connection); -- self->priv->connection = NULL; -- g_object_unref (conference); -- return FALSE; -- } -- -- g_object_unref (conference); -- -- return TRUE; --} -diff --git a/gst/fsmsnconference/fs-msn-stream.h b/gst/fsmsnconference/fs-msn-stream.h -deleted file mode 100644 -index 725c8968..00000000 ---- a/gst/fsmsnconference/fs-msn-stream.h -+++ /dev/null -@@ -1,86 +0,0 @@ --/* -- * Farstream - Farstream MSN Stream -- * -- * Copyright 2008 Richard Spiers -- * Copyright 2007 Nokia Corp. -- * Copyright 2007 Collabora Ltd. -- * @author: Olivier Crete -- * -- * fs-msn-stream.h - A Farstream MSN Stream -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ -- --#ifndef __FS_MSN_STREAM_H__ --#define __FS_MSN_STREAM_H__ -- --#include -- --#include "fs-msn-participant.h" --#include "fs-msn-session.h" -- --G_BEGIN_DECLS -- --/* TYPE MACROS */ --#define FS_TYPE_MSN_STREAM \ -- (fs_msn_stream_get_type ()) --#define FS_MSN_STREAM(obj) \ -- (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_MSN_STREAM, FsMsnStream)) --#define FS_MSN_STREAM_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_MSN_STREAM, FsMsnStreamClass)) --#define FS_IS_MSN_STREAM(obj) \ -- (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_MSN_STREAM)) --#define FS_IS_MSN_STREAM_CLASS(klass) \ -- (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_MSN_STREAM)) --#define FS_MSN_STREAM_GET_CLASS(obj) \ -- (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_MSN_STREAM, FsMsnStreamClass)) --#define FS_MSN_STREAM_CAST(obj) ((FsMsnStream*) (obj)) -- --typedef struct _FsMsnStream FsMsnStream; --typedef struct _FsMsnStreamClass FsMsnStreamClass; --typedef struct _FsMsnStreamPrivate FsMsnStreamPrivate; -- -- --struct _FsMsnStreamClass --{ -- FsStreamClass parent_class; -- --}; -- --/** -- * FsMsnStream: -- * -- */ --struct _FsMsnStream --{ -- FsStream parent; -- -- /*< private >*/ -- FsMsnStreamPrivate *priv; --}; -- --GType fs_msn_stream_get_type (void); -- --FsMsnStream *fs_msn_stream_new (FsMsnSession *session, -- FsMsnParticipant *participant, -- FsStreamDirection direction, -- FsMsnConference *conference); -- --void fs_msn_stream_set_tos_locked (FsMsnStream *self, gint tos); -- -- --G_END_DECLS -- --#endif /* __FS_MSN_STREAM_H__ */ -diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am -index a963967b..d50fc264 100644 ---- a/tests/check/Makefile.am -+++ b/tests/check/Makefile.am -@@ -55,7 +55,6 @@ check_PROGRAMS = \ - rtp/sendcodecs \ - rtp/conference \ - rtp/recvcodecs \ -- msn/conference \ - utils/binadded - - AM_CFLAGS = \ -@@ -156,10 +155,6 @@ rtp_sendcodecs_SOURCES = \ - rtp_recvcodecs_CFLAGS = $(AM_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) - rtp_recvcodecs_LDADD = $(LDADD) -lgstrtp-@GST_API_VERSION@ - --msn_conference_CFLAGS = $(AM_CFLAGS) --msn_conference_SOURCES = \ -- msn/conference.c -- - utils_binadded_CFLAGS = $(AM_CFLAGS) - utils_binadded_SOURCES = \ - testutils.c \ -diff --git a/tests/check/msn/conference.c b/tests/check/msn/conference.c -deleted file mode 100644 -index 1e3a209e..00000000 ---- a/tests/check/msn/conference.c -+++ /dev/null -@@ -1,424 +0,0 @@ --/* Farstream unit tests for FsMsnConference -- * -- * Copyright (C) 2009 Collabora -- * @author: Olivier Crete -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --*/ -- --#ifdef HAVE_CONFIG_H --# include --#endif -- --#include --#include -- --#include "check-threadsafe.h" -- --GMainLoop *loop; --int count = 0; -- --#define WAITING_ON_LAST_CODEC (1<<0) --#define SHOULD_BE_LAST_CODEC (1<<1) --#define HAS_BEEN_RESET (1<<2) -- --gint max_buffer_count = 20; -- -- --struct SimpleMsnConference { -- GstElement *pipeline; -- FsConference *conf; -- FsSession *session; -- FsParticipant *part; -- FsStream *stream; -- -- struct SimpleMsnConference *target; -- FsStreamDirection direction; --}; -- --static gboolean --bus_watch (GstBus *bus, GstMessage *message, gpointer user_data) --{ -- struct SimpleMsnConference *dat = user_data; -- -- switch (GST_MESSAGE_TYPE (message)) -- { -- case GST_MESSAGE_ELEMENT: -- { -- const GstStructure *s = gst_message_get_structure (message); -- ts_fail_if (s==NULL, "NULL structure in element message"); -- if (gst_structure_has_name (s, "farstream-error")) -- { -- const GValue *value; -- FsError errorno; -- const gchar *error; -- -- ts_fail_unless ( -- gst_structure_has_field_typed (s, "src-object", G_TYPE_OBJECT), -- "farstream-error structure has no src-object field"); -- ts_fail_unless ( -- gst_structure_has_field_typed (s, "error-no", FS_TYPE_ERROR), -- "farstream-error structure has no src-object field"); -- ts_fail_unless ( -- gst_structure_has_field_typed (s, "error-msg", G_TYPE_STRING), -- "farstream-error structure has no src-object field"); -- -- value = gst_structure_get_value (s, "error-no"); -- errorno = g_value_get_enum (value); -- error = gst_structure_get_string (s, "error-msg"); -- -- ts_fail ("Error on BUS (%d) %s", errorno, error); -- } -- else if (gst_structure_has_name (s, "farstream-new-local-candidate")) -- { -- FsStream *stream; -- FsCandidate *candidate; -- const GValue *value; -- -- ts_fail_unless ( -- gst_structure_has_field_typed (s, "stream", FS_TYPE_STREAM), -- "farstream-new-local-candidate structure has no stream field"); -- ts_fail_unless ( -- gst_structure_has_field_typed (s, "candidate", FS_TYPE_CANDIDATE), -- "farstream-new-local-candidate structure has no candidate field"); -- -- value = gst_structure_get_value (s, "stream"); -- stream = g_value_get_object (value); -- -- value = gst_structure_get_value (s, "candidate"); -- candidate = g_value_get_boxed (value); -- -- ts_fail_unless (stream && candidate, "new-local-candidate with NULL" -- " stream(%p) or candidate(%p)", stream, candidate); -- -- if (dat->target) -- { -- GError *error = NULL; -- GList *list = g_list_append (NULL, candidate); -- gboolean add_remote_candidates_res; -- -- GST_DEBUG ("Setting candidate: %s %d", -- candidate->ip, candidate->port); -- add_remote_candidates_res = fs_stream_add_remote_candidates ( -- dat->target->stream, list, &error); -- ts_fail_unless (add_remote_candidates_res, -- "Could not set remote candidate: %s", -- error ? error->message : "No GError"); -- ts_fail_unless (error == NULL); -- g_list_free (list); -- } -- } -- } -- break; -- case GST_MESSAGE_ERROR: -- { -- GError *error = NULL; -- gchar *debug = NULL; -- gst_message_parse_error (message, &error, &debug); -- -- ts_fail ("Got an error on the BUS (%d): %s (%s)", error->code, -- error->message, debug); -- g_error_free (error); -- g_free (debug); -- } -- break; -- case GST_MESSAGE_WARNING: -- { -- GError *error = NULL; -- gchar *debug = NULL; -- gst_message_parse_warning (message, &error, &debug); -- -- GST_DEBUG ("%d: Got a warning on the BUS: %s (%s)", -- error->code, -- error->message, debug); -- g_error_free (error); -- g_free (debug); -- } -- break; -- default: -- break; -- } -- -- return TRUE; --} -- --static GstPadProbeReturn --pad_probe_cb (GstPad *pad, GstPadProbeInfo *info, gpointer user_data) --{ -- count++; -- -- if (count > 20) -- g_main_loop_quit (loop); -- -- return GST_PAD_PROBE_OK; --} -- --static void --stream_src_pad_added (FsStream *stream, GstPad *pad, FsCodec *codec, -- struct SimpleMsnConference *dat) --{ -- GstElement *sink = gst_element_factory_make ("fakesink", NULL); -- GstPad *sinkpad; -- -- GST_DEBUG ("pad added"); -- -- ts_fail_unless (sink != NULL); -- -- ts_fail_unless (gst_bin_add (GST_BIN (dat->pipeline), sink)); -- -- sinkpad = gst_element_get_static_pad (sink, "sink"); -- ts_fail_unless (sinkpad != NULL); -- -- gst_pad_add_probe (sinkpad, GST_PAD_PROBE_TYPE_BUFFER, pad_probe_cb, dat, -- NULL); -- -- ts_fail_if (GST_PAD_LINK_FAILED (gst_pad_link (pad, sinkpad))); -- -- gst_object_unref (sinkpad); -- -- ts_fail_if (gst_element_set_state (sink, GST_STATE_PLAYING) == -- GST_STATE_CHANGE_FAILURE); -- --} -- --struct SimpleMsnConference * --setup_conference (FsStreamDirection dir, struct SimpleMsnConference *target) --{ -- struct SimpleMsnConference *dat = g_new0 (struct SimpleMsnConference, 1); -- GError *error = NULL; -- GstBus *bus; -- GParameter param = {NULL, {0}}; -- gint n_params = 0; -- guint tos; -- -- dat->target = target; -- dat->direction = dir; -- -- dat->pipeline = gst_pipeline_new (NULL); -- -- bus = gst_element_get_bus (dat->pipeline); -- gst_bus_add_watch (bus, bus_watch, dat); -- gst_object_unref (bus); -- -- if (dir == FS_DIRECTION_SEND) -- dat->conf = FS_CONFERENCE ( -- gst_element_factory_make ("fsmsncamsendconference", NULL)); -- else -- dat->conf = FS_CONFERENCE ( -- gst_element_factory_make ("fsmsncamrecvconference", NULL)); -- ts_fail_unless (dat->conf != NULL); -- -- ts_fail_unless (gst_bin_add (GST_BIN (dat->pipeline), -- GST_ELEMENT (dat->conf))); -- -- dat->part = fs_conference_new_participant (dat->conf, &error); -- ts_fail_unless (error == NULL, "Error: %s", error ? error->message: ""); -- ts_fail_unless (dat->part != NULL); -- -- dat->session = fs_conference_new_session (dat->conf, FS_MEDIA_TYPE_VIDEO, -- &error); -- ts_fail_unless (dat->session != NULL, "Session create error: %s:", -- error ? error->message : "No GError"); -- ts_fail_unless (error == NULL); -- -- g_object_set (dat->session, "tos", 2, NULL); -- g_object_get (dat->session, "tos", &tos, NULL); -- ts_fail_unless (tos == 2); -- -- if (dir == FS_DIRECTION_SEND) -- { -- GstPad *sinkpad, *srcpad; -- GstElement *src; -- src = gst_element_factory_make ("videotestsrc", NULL); -- ts_fail_unless (src != NULL); -- g_object_set (src, "is-live", TRUE, NULL); -- ts_fail_unless (gst_bin_add (GST_BIN (dat->pipeline), -- GST_ELEMENT (src))); -- -- g_object_get (dat->session, "sink-pad", &sinkpad, NULL); -- ts_fail_if (sinkpad == NULL); -- srcpad = gst_element_get_static_pad (src, "src"); -- ts_fail_if (srcpad == NULL); -- -- ts_fail_if (GST_PAD_LINK_FAILED (gst_pad_link ( srcpad, sinkpad))); -- gst_object_unref (srcpad); -- gst_object_unref (sinkpad); -- } -- -- if (target) -- { -- guint session_id = 0; -- n_params = 1; -- g_object_get (target->stream, "session-id", &session_id, NULL); -- ts_fail_unless (session_id >= 9000 && session_id < 10000); -- param.name = "session-id"; -- g_value_init (¶m.value, G_TYPE_UINT); -- g_value_set_uint (¶m.value, session_id); -- } -- -- dat->stream = fs_session_new_stream (dat->session, dat->part, dir, &error); -- ts_fail_unless (dat->stream != NULL); -- ts_fail_unless (error == NULL); -- -- fail_unless (fs_stream_set_transmitter (dat->stream, NULL, ¶m, n_params, -- &error)); -- fail_unless (error == NULL); -- -- g_signal_connect (dat->stream, "src-pad-added", -- G_CALLBACK (stream_src_pad_added), dat); -- -- ts_fail_if (gst_element_set_state (dat->pipeline, GST_STATE_PLAYING) == -- GST_STATE_CHANGE_FAILURE); -- -- return dat; --} -- --static void --free_conference (struct SimpleMsnConference *dat) --{ -- ts_fail_if (gst_element_set_state (dat->pipeline, GST_STATE_NULL) == -- GST_STATE_CHANGE_FAILURE); -- -- fs_session_destroy (dat->session); -- gst_object_unref (dat->stream); -- gst_object_unref (dat->session); -- gst_object_unref (dat->part); -- gst_object_unref (dat->pipeline); -- -- free (dat); --} -- -- --GST_START_TEST (test_msnconference_new) --{ -- struct SimpleMsnConference *senddat = setup_conference (FS_DIRECTION_SEND, -- NULL); -- struct SimpleMsnConference *recvdat = setup_conference (FS_DIRECTION_RECV, -- NULL); -- -- -- free_conference (senddat); -- free_conference (recvdat); --} --GST_END_TEST; -- -- -- --GST_START_TEST (test_msnconference_send_to_recv) --{ -- struct SimpleMsnConference *senddat = setup_conference (FS_DIRECTION_SEND, -- NULL); -- struct SimpleMsnConference *recvdat = setup_conference (FS_DIRECTION_RECV, -- senddat); -- -- loop = g_main_loop_new (NULL, FALSE); -- -- g_main_loop_run (loop); -- -- free_conference (senddat); -- free_conference (recvdat); -- g_main_loop_unref (loop); --} --GST_END_TEST; -- -- --GST_START_TEST (test_msnconference_recv_to_send) --{ -- struct SimpleMsnConference *recvdat = setup_conference (FS_DIRECTION_RECV, -- NULL); -- struct SimpleMsnConference *senddat = setup_conference (FS_DIRECTION_SEND, -- recvdat); -- -- loop = g_main_loop_new (NULL, FALSE); -- -- g_main_loop_run (loop); -- -- free_conference (senddat); -- free_conference (recvdat); -- g_main_loop_unref (loop); --} --GST_END_TEST; -- -- --GST_START_TEST (test_msnconference_error) --{ -- struct SimpleMsnConference *dat = setup_conference (FS_DIRECTION_SEND, -- NULL); -- GError *error = NULL; -- -- ts_fail_unless ( -- fs_conference_new_participant (dat->conf, &error) == NULL); -- ts_fail_unless (error->domain == FS_ERROR && -- error->code == FS_ERROR_ALREADY_EXISTS); -- g_clear_error (&error); -- -- -- ts_fail_unless ( -- fs_conference_new_session (dat->conf, FS_MEDIA_TYPE_VIDEO, &error) == NULL); -- ts_fail_unless (error->domain == FS_ERROR && -- error->code == FS_ERROR_ALREADY_EXISTS); -- g_clear_error (&error); -- -- -- ts_fail_unless ( -- fs_session_new_stream (dat->session, dat->part, FS_DIRECTION_SEND, -- &error) == NULL); -- ts_fail_unless (error->domain == FS_ERROR && -- error->code == FS_ERROR_ALREADY_EXISTS); -- g_clear_error (&error); -- -- fail_unless (fs_stream_set_transmitter (dat->stream, NULL, NULL, 0, -- &error)); -- fail_unless (error == NULL); -- -- -- free_conference (dat); --} --GST_END_TEST; -- --static Suite * --fsmsnconference_suite (void) --{ -- Suite *s = suite_create ("fsmsnconference"); -- TCase *tc_chain; -- GLogLevelFlags fatal_mask; -- -- fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); -- fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; -- g_log_set_always_fatal (fatal_mask); -- -- tc_chain = tcase_create ("fsmsnconference_new"); -- tcase_add_test (tc_chain, test_msnconference_new); -- suite_add_tcase (s, tc_chain); -- -- -- tc_chain = tcase_create ("fsmsnconference_send_to_recv"); -- tcase_add_test (tc_chain, test_msnconference_send_to_recv); -- suite_add_tcase (s, tc_chain); -- -- tc_chain = tcase_create ("fsmsnconference_recv_to_send"); -- tcase_add_test (tc_chain, test_msnconference_recv_to_send); -- suite_add_tcase (s, tc_chain); -- -- -- tc_chain = tcase_create ("fsmsnconference_error"); -- tcase_add_test (tc_chain, test_msnconference_error); -- suite_add_tcase (s, tc_chain); -- -- -- return s; --} -- --GST_CHECK_MAIN (fsmsnconference); --- -2.21.0 - -From b8751b8ee7cd2a8fab2a61a79443a8d287412c8d Mon Sep 17 00:00:00 2001 -From: Philip Withnall -Date: Thu, 1 Oct 2015 08:34:31 +0100 -Subject: [PATCH 13/30] nice: Port away from deprecated libnice signals - -The NiceAgent::new-candidate and ::new-selected-pair signals have been -deprecated since 0.1.8 (which we depend on). Port them to use the -replacement ::*-full signals. - -https://bugs.freedesktop.org/show_bug.cgi?id=92208 ---- - .../nice/fs-nice-stream-transmitter.c | 163 +++++------------- - 1 file changed, 46 insertions(+), 117 deletions(-) - -diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c -index 5dbff443..5e27127d 100644 ---- a/transmitters/nice/fs-nice-stream-transmitter.c -+++ b/transmitters/nice/fs-nice-stream-transmitter.c -@@ -176,13 +176,11 @@ static void agent_gathering_done (NiceAgent *agent, guint stream_id, - static void agent_new_selected_pair (NiceAgent *agent, - guint stream_id, - guint component_id, -- const gchar *lfoundation, -- const gchar *rfoundation, -+ NiceCandidate *l_candidate, -+ NiceCandidate *r_candidate, - gpointer user_data); - static void agent_new_candidate (NiceAgent *agent, -- guint stream_id, -- guint component_id, -- const gchar *foundation, -+ NiceCandidate *candidate, - gpointer user_data); - - static GstPadProbeReturn known_buffer_have_buffer_handler (GstPad *pad, -@@ -1528,10 +1526,11 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self, - self->priv->gathering_done_handler_id = g_signal_connect_object (agent->agent, - "candidate-gathering-done", G_CALLBACK (agent_gathering_done), self, 0); - self->priv->new_selected_pair_handler_id = g_signal_connect_object ( -- agent->agent, "new-selected-pair", G_CALLBACK (agent_new_selected_pair), -+ agent->agent, "new-selected-pair-full", -+ G_CALLBACK (agent_new_selected_pair), - self, 0); - self->priv->new_candidate_handler_id = g_signal_connect_object (agent->agent, -- "new-candidate", G_CALLBACK (agent_new_candidate), self, 0); -+ "new-candidate-full", G_CALLBACK (agent_new_candidate), self, 0); - self->priv->tos_changed_handler_id = g_signal_connect_object ( - self->priv->transmitter, "notify::tos", G_CALLBACK (tos_changed), self, - 0); -@@ -1703,142 +1702,72 @@ static void - agent_new_selected_pair (NiceAgent *agent, - guint stream_id, - guint component_id, -- const gchar *lfoundation, -- const gchar *rfoundation, -+ NiceCandidate *l_candidate, -+ NiceCandidate *r_candidate, - gpointer user_data) - { - FsNiceStreamTransmitter *self = FS_NICE_STREAM_TRANSMITTER (user_data); -- GSList *candidates, *item; - FsCandidate *local = NULL; - FsCandidate *remote = NULL; -+ struct candidate_signal_data *data; - - if (stream_id != self->priv->stream_id) - return; - -- candidates = nice_agent_get_local_candidates (agent, -- self->priv->stream_id, component_id); -- -- for (item = candidates; item; item = g_slist_next (item)) -- { -- NiceCandidate *candidate = item->data; -- -- if (!strcmp (candidate->foundation, lfoundation)) -- { -- local = nice_candidate_to_fs_candidate (agent, candidate, TRUE); -- break; -- } -- } -- g_slist_foreach (candidates, (GFunc)nice_candidate_free, NULL); -- g_slist_free (candidates); -- -- candidates = nice_agent_get_remote_candidates (agent, -- self->priv->stream_id, component_id); -- -- for (item = candidates; item; item = g_slist_next (item)) -- { -- NiceCandidate *candidate = item->data; -- -- if (!strcmp (candidate->foundation, rfoundation)) -- { -- remote = nice_candidate_to_fs_candidate (agent, candidate, FALSE); -- break; -- } -- } -- g_slist_foreach (candidates, (GFunc)nice_candidate_free, NULL); -- g_slist_free (candidates); -- -+ local = nice_candidate_to_fs_candidate (agent, l_candidate, TRUE); -+ remote = nice_candidate_to_fs_candidate (agent, r_candidate, FALSE); - -- if (local && remote) -- { -- struct candidate_signal_data *data = -- g_slice_new (struct candidate_signal_data); -- data->self = g_object_ref (self); -- data->signal_name = "new-active-candidate-pair"; -- data->candidate1 = local; -- data->candidate2 = remote; -- fs_nice_agent_add_idle (self->priv->agent, agent_candidate_signal_idle, -- data, free_candidate_signal_data); -- } -- else -- { -- if (local) -- fs_candidate_destroy (local); -- if (remote) -- fs_candidate_destroy (remote); -- } -+ data = g_slice_new (struct candidate_signal_data); -+ data->self = g_object_ref (self); -+ data->signal_name = "new-active-candidate-pair"; -+ data->candidate1 = local; -+ data->candidate2 = remote; -+ fs_nice_agent_add_idle (self->priv->agent, agent_candidate_signal_idle, -+ data, free_candidate_signal_data); - } - - static void - agent_new_candidate (NiceAgent *agent, -- guint stream_id, -- guint component_id, -- const gchar *foundation, -+ NiceCandidate *candidate, - gpointer user_data) - { - FsNiceStreamTransmitter *self = FS_NICE_STREAM_TRANSMITTER (user_data); - FsCandidate *fscandidate = NULL; -- GSList *candidates, *item; - -- if (stream_id != self->priv->stream_id) -- return; -- -- GST_DEBUG ("New candidate found for stream %u component %u", -- stream_id, component_id); -- -- candidates = nice_agent_get_local_candidates (agent, stream_id, component_id); -+ GST_DEBUG ("New candidate found"); - -- for (item = candidates; item; item = g_slist_next (item)) -- { -- NiceCandidate *candidate = item->data; -+ fscandidate = nice_candidate_to_fs_candidate (agent, candidate, TRUE); - -- if (!strcmp (candidate->foundation, foundation)) -- { -- fscandidate = nice_candidate_to_fs_candidate (agent, candidate, TRUE); -- break; -- } -- } -- g_slist_foreach (candidates, (GFunc) nice_candidate_free, NULL); -- g_slist_free (candidates); -- -- if (fscandidate) -+ FS_NICE_STREAM_TRANSMITTER_LOCK (self); -+ if (!self->priv->gathered) - { -- FS_NICE_STREAM_TRANSMITTER_LOCK (self); -- if (!self->priv->gathered) -- { -- /* Nice doesn't do connchecks while gathering, so don't tell the upper -- * layers about the candidates untill gathering is finished. -- * Also older versions of farstream would fail the connection right away -- * when the first candidate given failed immediately (e.g. ipv6 on a -- * non-ipv6 capable host, so we order ipv6 candidates after ipv4 ones */ -- -- if (strchr (fscandidate->ip, ':')) -- self->priv->local_candidates = g_list_append -- (self->priv->local_candidates, fscandidate); -- else -- self->priv->local_candidates = g_list_prepend -- (self->priv->local_candidates, fscandidate); -- FS_NICE_STREAM_TRANSMITTER_UNLOCK (self); -- } -+ /* Nice doesn't do connchecks while gathering, so don't tell the upper -+ * layers about the candidates untill gathering is finished. -+ * Also older versions of farstream would fail the connection right away -+ * when the first candidate given failed immediately (e.g. ipv6 on a -+ * non-ipv6 capable host, so we order ipv6 candidates after ipv4 ones */ -+ -+ if (strchr (fscandidate->ip, ':')) -+ self->priv->local_candidates = g_list_append -+ (self->priv->local_candidates, fscandidate); - else -- { -- struct candidate_signal_data *data = -- g_slice_new (struct candidate_signal_data); -- -- FS_NICE_STREAM_TRANSMITTER_UNLOCK (self); -- -- data->self = g_object_ref (self); -- data->signal_name = "new-local-candidate"; -- data->candidate1 = fscandidate; -- data->candidate2 = NULL; -- fs_nice_agent_add_idle (self->priv->agent, agent_candidate_signal_idle, -- data, free_candidate_signal_data); -- } -+ self->priv->local_candidates = g_list_prepend -+ (self->priv->local_candidates, fscandidate); -+ FS_NICE_STREAM_TRANSMITTER_UNLOCK (self); - } - else - { -- GST_WARNING ("Could not find local candidate with foundation %s" -- " for component %d in stream %d", foundation, component_id, -- stream_id); -+ struct candidate_signal_data *data = -+ g_slice_new (struct candidate_signal_data); -+ -+ FS_NICE_STREAM_TRANSMITTER_UNLOCK (self); -+ -+ data->self = g_object_ref (self); -+ data->signal_name = "new-local-candidate"; -+ data->candidate1 = fscandidate; -+ data->candidate2 = NULL; -+ fs_nice_agent_add_idle (self->priv->agent, agent_candidate_signal_idle, -+ data, free_candidate_signal_data); - } - } - --- -2.21.0 - -From 484306ea21db9086d860e3e21ec7b41174c9cf15 Mon Sep 17 00:00:00 2001 -From: Fabrice Bellet -Date: Fri, 21 Apr 2017 10:01:15 +0200 -Subject: [PATCH 14/30] rtp: test the session conference property before using - it - -This may happen when the rtp session object is calling its dispose -function in another thread. The disposed flag is set, and it prevents -the fs_rtp_session_get_property() function to return its conference -object. - -https://bugs.freedesktop.org/show_bug.cgi?id=101169 ---- - gst/fsrtpconference/fs-rtp-stream.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c -index b2d59f2c..1ef6b2e8 100644 ---- a/gst/fsrtpconference/fs-rtp-stream.c -+++ b/gst/fsrtpconference/fs-rtp-stream.c -@@ -826,6 +826,11 @@ _local_candidates_prepared (FsStreamTransmitter *stream_transmitter, - - g_object_get (session, "conference", &conf, NULL); - -+ if (!conf) { -+ g_object_unref (session); -+ return; -+ } -+ - gst_element_post_message (conf, - gst_message_new_element (GST_OBJECT (conf), - gst_structure_new ("farstream-local-candidates-prepared", -@@ -853,6 +858,11 @@ _new_active_candidate_pair ( - - g_object_get (session, "conference", &conf, NULL); - -+ if (!conf) { -+ g_object_unref (session); -+ return; -+ } -+ - gst_element_post_message (conf, - gst_message_new_element (GST_OBJECT (conf), - gst_structure_new ("farstream-new-active-candidate-pair", -@@ -881,6 +891,11 @@ _new_local_candidate ( - - g_object_get (session, "conference", &conf, NULL); - -+ if (!conf) { -+ g_object_unref (session); -+ return; -+ } -+ - gst_element_post_message (conf, - gst_message_new_element (GST_OBJECT (conf), - gst_structure_new ("farstream-new-local-candidate", -@@ -929,6 +944,11 @@ _state_changed (FsStreamTransmitter *stream_transmitter, - - g_object_get (session, "conference", &conf, NULL); - -+ if (!conf) { -+ g_object_unref (session); -+ return; -+ } -+ - gst_element_post_message (conf, - gst_message_new_element (GST_OBJECT (conf), - gst_structure_new ("farstream-component-state-changed", --- -2.21.0 - -From 3123a5be03190c55fe1401d9dbb90c09078b2dee Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Mon, 5 Jun 2017 18:41:54 -0400 -Subject: [PATCH 15/30] rawudp tests: Increase timeout - -As we increased the default timeout in libnice's libstun, -also increase it here. ---- - tests/check/transmitter/rawudp.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c -index 71e38f37..e1936ac0 100644 ---- a/tests/check/transmitter/rawudp.c -+++ b/tests/check/transmitter/rawudp.c -@@ -949,7 +949,7 @@ rawudptransmitter_suite (void) - suite_add_tcase (s, tc_chain); - - tc_chain = tcase_create ("rawudptransmitter-stun-timeout"); -- tcase_set_timeout (tc_chain, 5); -+ tcase_set_timeout (tc_chain, 10); - tcase_add_test (tc_chain, test_rawudptransmitter_run_invalid_stun); - suite_add_tcase (s, tc_chain); - -@@ -1004,14 +1004,14 @@ rawudptransmitter_suite (void) - suite_add_tcase (s, tc_chain); - - tc_chain = tcase_create ("rawudptransmitter-stunalternd-to-nowhere"); -- tcase_set_timeout (tc_chain, 12); -+ tcase_set_timeout (tc_chain, 20); - tcase_add_checked_fixture (tc_chain, setup_stunalternd_valid, - teardown_stunalternd); - tcase_add_test (tc_chain, test_rawudptransmitter_run_stun_altern_to_nowhere); - suite_add_tcase (s, tc_chain); - - tc_chain = tcase_create ("rawudptransmitter-stunalternd-loop"); -- tcase_set_timeout (tc_chain, 12); -+ tcase_set_timeout (tc_chain, 20); - tcase_add_checked_fixture (tc_chain, setup_stunalternd_loop, - teardown_stunalternd); - tcase_add_test (tc_chain, test_rawudptransmitter_run_stun_altern_to_nowhere); --- -2.21.0 - -From c5c0427aa055852f2de9f7d0273d3e994ac91df4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Mon, 5 Jun 2017 19:05:15 -0400 -Subject: [PATCH 16/30] stream: Stop substreams before removing them - -https://bugs.freedesktop.org/show_bug.cgi?id=100644 ---- - gst/fsrtpconference/fs-rtp-stream.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c -index 1ef6b2e8..593af4d8 100644 ---- a/gst/fsrtpconference/fs-rtp-stream.c -+++ b/gst/fsrtpconference/fs-rtp-stream.c -@@ -359,6 +359,7 @@ fs_rtp_stream_dispose (GObject *object) - FsRtpSubStream *substream = self->substreams->data; - self->substreams = g_list_remove (self->substreams, substream); - FS_RTP_SESSION_UNLOCK (session); -+ fs_rtp_sub_stream_stop (substream); - g_object_unref (substream); - FS_RTP_SESSION_LOCK (session); - } --- -2.21.0 - -From 5eeb7ad22bdbff1b78b0c518247644feb7e9c806 Mon Sep 17 00:00:00 2001 -From: Fabrice Bellet -Date: Tue, 14 Feb 2017 20:40:03 +0100 -Subject: [PATCH 17/30] rtptfrc: Fix reference counting - -https://bugs.freedesktop.org/show_bug.cgi?id=99823 ---- - gst/fsrtpconference/fs-rtp-tfrc.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/gst/fsrtpconference/fs-rtp-tfrc.c b/gst/fsrtpconference/fs-rtp-tfrc.c -index f1435519..7c92218e 100644 ---- a/gst/fsrtpconference/fs-rtp-tfrc.c -+++ b/gst/fsrtpconference/fs-rtp-tfrc.c -@@ -1354,9 +1354,11 @@ fs_rtp_tfrc_new (FsRtpSession *fsrtpsession) - gst_object_unref (rtpmuxer); - - self->in_rtp_probe_id = gst_pad_add_probe (self->in_rtp_pad, -- GST_PAD_PROBE_TYPE_BUFFER, incoming_rtp_probe, self, NULL); -+ GST_PAD_PROBE_TYPE_BUFFER, incoming_rtp_probe, -+ g_object_ref (self), (GDestroyNotify) g_object_unref); - self->in_rtcp_probe_id = gst_pad_add_probe (self->in_rtcp_pad, -- GST_PAD_PROBE_TYPE_BUFFER, incoming_rtcp_probe, self, NULL); -+ GST_PAD_PROBE_TYPE_BUFFER, incoming_rtcp_probe, -+ g_object_ref (self), (GDestroyNotify) g_object_unref); - - - self->on_ssrc_validated_id = g_signal_connect_object (self->rtpsession, --- -2.21.0 - -From 0ff6a4eda899461aa21a876033edc42f5b048bc7 Mon Sep 17 00:00:00 2001 -From: Sergey Mamonov -Date: Mon, 27 Mar 2017 19:08:09 +0000 -Subject: [PATCH 18/30] fsrtpsession: Set discovery valve to dropping on - creation - -Although it should do nothing, it seems to improve CPU usage. - -https://bugs.freedesktop.org/show_bug.cgi?id=100412 ---- - gst/fsrtpconference/fs-rtp-session.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c -index ee0225f2..86eefbb4 100644 ---- a/gst/fsrtpconference/fs-rtp-session.c -+++ b/gst/fsrtpconference/fs-rtp-session.c -@@ -1454,6 +1454,8 @@ fs_rtp_session_constructed (GObject *object) - return; - } - -+ g_object_set (self->priv->discovery_valve, "drop", TRUE, NULL); -+ - if (!gst_bin_add (GST_BIN (self->priv->conference), - self->priv->discovery_valve)) - { --- -2.21.0 - -From cc577d4828fee3d3e5e4d3e2afcbb9c4538556aa Mon Sep 17 00:00:00 2001 -From: Fabrice Bellet -Date: Wed, 7 Jun 2017 16:47:48 +0200 -Subject: [PATCH 19/30] nice: select the candidate with the correct stream id - -This selection based on the stream_id has been lost in commit b8751b8 - -https://bugs.freedesktop.org/show_bug.cgi?id=92208 ---- - transmitters/nice/fs-nice-stream-transmitter.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c -index 5e27127d..dac87c6b 100644 ---- a/transmitters/nice/fs-nice-stream-transmitter.c -+++ b/transmitters/nice/fs-nice-stream-transmitter.c -@@ -1734,6 +1734,9 @@ agent_new_candidate (NiceAgent *agent, - FsNiceStreamTransmitter *self = FS_NICE_STREAM_TRANSMITTER (user_data); - FsCandidate *fscandidate = NULL; - -+ if (candidate->stream_id != self->priv->stream_id) -+ return; -+ - GST_DEBUG ("New candidate found"); - - fscandidate = nice_candidate_to_fs_candidate (agent, candidate, TRUE); --- -2.21.0 - -From 8d1d8349c5b67255c0e00b19b02b0db1db7fe769 Mon Sep 17 00:00:00 2001 -From: Nicolas Dufresne -Date: Wed, 21 Jun 2017 14:04:19 -0400 -Subject: [PATCH 20/30] rtpconference: Move link flags to convenience library - -This way unit test will inherit from all the required flags. - -https://bugs.freedesktop.org/show_bug.cgi?id=101544 ---- - gst/fsrtpconference/Makefile.am | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/gst/fsrtpconference/Makefile.am b/gst/fsrtpconference/Makefile.am -index c9e8ae18..18ecee36 100644 ---- a/gst/fsrtpconference/Makefile.am -+++ b/gst/fsrtpconference/Makefile.am -@@ -23,6 +23,13 @@ libfsrtpconference_convenience_la_SOURCES = \ - fs-rtp-tfrc.c \ - fs-rtp-packet-modder.c \ - tfrc.c -+libfsrtpconference_convenience_la_LIBADD = \ -+ $(top_builddir)/farstream/libfarstream-@FS_APIVERSION@.la \ -+ $(FS_LIBS) \ -+ $(GST_PLUGINS_BASE_LIBS) \ -+ $(GST_LIBS) \ -+ -lgstrtp-@GST_API_VERSION@ \ -+ -lm - - noinst_HEADERS = \ - fs-rtp-conference.h \ -@@ -55,13 +62,7 @@ AM_CFLAGS = \ - libfsrtpconference_la_SOURCES = fs-rtp-conference-plugin.c - - libfsrtpconference_la_LIBADD = \ -- libfsrtpconference-convenience.la \ -- $(top_builddir)/farstream/libfarstream-@FS_APIVERSION@.la \ -- $(FS_LIBS) \ -- $(GST_PLUGINS_BASE_LIBS) \ -- $(GST_LIBS) \ -- -lgstrtp-@GST_API_VERSION@ \ -- -lm -+ libfsrtpconference-convenience.la - - libfsrtpconference_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - libfsrtpconference_la_LIBTOOLFLAGS = $(PLUGIN_LIBTOOLFLAGS) --- -2.21.0 - -From 782bf607e49cc1eba15eb9def1d0596c74405a47 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 12 Oct 2017 17:02:57 -0400 -Subject: [PATCH 21/30] Update autogen.sh to match common/ - ---- - autogen.sh | 77 ++++++++++++++++++++++++++---------------------------- - 1 file changed, 37 insertions(+), 40 deletions(-) - -diff --git a/autogen.sh b/autogen.sh -index b2653248..ceb92578 100755 ---- a/autogen.sh -+++ b/autogen.sh -@@ -1,9 +1,11 @@ --#!/bin/sh --# Run this to generate all the initial makefiles, etc. -+test -n "$srcdir" || srcdir=`dirname "$0"` -+test -n "$srcdir" || srcdir=. -+ -+olddir=`pwd` -+cd "$srcdir" - --DIE=0 - package=farstream --srcfile=farstream/fs-candidate.c -+srcfile=farstream/fs-conference.c - - # Make sure we have common - if test ! -f common/gst-autogen.sh; -@@ -22,30 +24,33 @@ then - fi - . common/gst-autogen.sh - --CONFIGURE_DEF_OPT='--enable-gtk-doc --enable-introspection' -+CONFIGURE_DEF_OPT='--enable-gtk-doc' - - autogen_options $@ - --echo -n "+ check for build tools" --if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi --version_check "autoconf" "$AUTOCONF autoconf autoconf259 autoconf257 autoconf-2.54 autoconf-2.53 autoconf253 autoconf-2.52 autoconf252" \ -- "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 --version_check "automake" "$AUTOMAKE automake automake-1.9 automake19 automake-1.8 automake18 automake-1.7 automake17 automake-1.6 automake16" \ -- "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1 --version_check "libtoolize" "libtoolize libtoolize15 glibtoolize" \ -- "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 --version_check "pkg-config" "" \ -- "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 -- --die_check $DIE -- --aclocal_check || DIE=1 --autoheader_check || DIE=1 -- --die_check $DIE -+printf "+ check for build tools" -+if test -z "$NOCHECK"; then -+ echo -+ -+ printf " checking for autoreconf ... " -+ echo -+ which "autoreconf" 2>/dev/null || { -+ echo "not found! Please install the autoconf package." -+ exit 1 -+ } -+ -+ printf " checking for pkg-config ... " -+ echo -+ which "pkg-config" 2>/dev/null || { -+ echo "not found! Please install pkg-config." -+ exit 1 -+ } -+else -+ echo ": skipped version checks" -+fi - - # if no arguments specified then this will be printed --if test -z "$*"; then -+if test -z "$*" && test -z "$NOCONFIGURE"; then - echo "+ checking for autogen.sh options" - echo " This autogen script will automatically run ./configure as:" - echo " ./configure $CONFIGURE_DEF_OPT" -@@ -57,34 +62,26 @@ toplevel_check $srcfile - - # aclocal - if test -f acinclude.m4; then rm acinclude.m4; fi --tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" - --tool_run "$libtoolize" "--copy --force" --tool_run "$autoheader" -- --# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo --echo timestamp > stamp-h.in 2> /dev/null -- --tool_run "$autoconf" --debug "automake: $automake" --tool_run "$automake" "--add-missing --copy -Wno-portability" -+autoreconf --force --install || exit 1 - - test -n "$NOCONFIGURE" && { -- echo "skipping configure stage for package $package, as requested." -- echo "autogen.sh done." -+ echo "+ skipping configure stage for package $package, as requested." -+ echo "+ autogen.sh done." - exit 0 - } - -+cd "$olddir" -+ - echo "+ running configure ... " --test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" --test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" -+test ! -z "$CONFIGURE_DEF_OPT" && echo " default flags: $CONFIGURE_DEF_OPT" -+test ! -z "$CONFIGURE_EXT_OPT" && echo " external flags: $CONFIGURE_EXT_OPT" - echo - --echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT --./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { -+echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT -+"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { - echo " configure failed" - exit 1 - } - - echo "Now type 'make' to compile $package." -- --- -2.21.0 - -From 01f01a59cf6e39dd37c22caf3166e63a508903e1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 12 Oct 2017 17:04:40 -0400 -Subject: [PATCH 22/30] Update INSTALL file - ---- - INSTALL | 250 +++++++++++++++++++++++++++++++++++++++++++------------- - 1 file changed, 192 insertions(+), 58 deletions(-) - -diff --git a/INSTALL b/INSTALL -index 23e5f25d..20998407 100644 ---- a/INSTALL -+++ b/INSTALL -@@ -1,16 +1,25 @@ - Installation Instructions - ************************* - --Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free --Software Foundation, Inc. -+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -+Inc. - --This file is free documentation; the Free Software Foundation gives --unlimited permission to copy, distribute and modify it. -+ Copying and distribution of this file, with or without modification, -+are permitted in any medium without royalty provided the copyright -+notice and this notice are preserved. This file is offered as-is, -+without warranty of any kind. - - Basic Installation - ================== - --These are generic installation instructions. -+ Briefly, the shell command `./configure && make && make install' -+should configure, build, and install this package. The following -+more-detailed instructions are generic; see the `README' file for -+instructions specific to this package. Some packages provide this -+`INSTALL' file but do not implement all of the features documented -+below. The lack of an optional feature in a given package is not -+necessarily a bug. More recommendations for GNU packages can be found -+in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for - various system-dependent variables used during compilation. It uses -@@ -23,9 +32,9 @@ debugging `configure'). - - It can also use an optional file (typically called `config.cache' - and enabled with `--cache-file=config.cache' or simply `-C') that saves --the results of its tests to speed up reconfiguring. (Caching is -+the results of its tests to speed up reconfiguring. Caching is - disabled by default to prevent problems with accidental use of stale --cache files.) -+cache files. - - If you need to do unusual things to compile the package, please try - to figure out how `configure' could check whether to do them, and mail -@@ -35,30 +44,37 @@ some point `config.cache' contains results you don't want to keep, you - may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create --`configure' by a program called `autoconf'. You only need --`configure.ac' if you want to change it or regenerate `configure' using --a newer version of `autoconf'. -+`configure' by a program called `autoconf'. You need `configure.ac' if -+you want to change it or regenerate `configure' using a newer version -+of `autoconf'. - --The simplest way to compile this package is: -+ The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type -- `./configure' to configure the package for your system. If you're -- using `csh' on an old version of System V, you might need to type -- `sh ./configure' instead to prevent `csh' from trying to execute -- `configure' itself. -+ `./configure' to configure the package for your system. - -- Running `configure' takes awhile. While running, it prints some -- messages telling which features it is checking for. -+ Running `configure' might take a while. While running, it prints -+ some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with -- the package. -+ the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and -- documentation. -- -- 5. You can remove the program binaries and object files from the -+ documentation. When installing into a prefix owned by root, it is -+ recommended that the package be configured and built as a regular -+ user, and only the `make install' phase executed with root -+ privileges. -+ -+ 5. Optionally, type `make installcheck' to repeat any self-tests, but -+ this time using the binaries in their final installed location. -+ This target does not install anything. Running this target as a -+ regular user, particularly if the prior `make install' required -+ root privileges, verifies that the installation completed -+ correctly. -+ -+ 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is -@@ -67,45 +83,69 @@ The simplest way to compile this package is: - all sorts of other programs in order to regenerate files that came - with the distribution. - -+ 7. Often, you can also type `make uninstall' to remove the installed -+ files again. In practice, not all packages have tested that -+ uninstallation works correctly, even though it is required by the -+ GNU Coding Standards. -+ -+ 8. Some packages, particularly those that use Automake, provide `make -+ distcheck', which can by used by developers to test that all other -+ targets like `make install' and `make uninstall' work correctly. -+ This target is generally not run by end users. -+ - Compilers and Options - ===================== - --Some systems require unusual options for compilation or linking that the --`configure' script does not know about. Run `./configure --help' for --details on some of the pertinent environment variables. -+ Some systems require unusual options for compilation or linking that -+the `configure' script does not know about. Run `./configure --help' -+for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters - by setting variables in the command line or in the environment. Here - is an example: - -- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix -+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - - Compiling For Multiple Architectures - ==================================== - --You can compile the package for more than one kind of computer at the -+ You can compile the package for more than one kind of computer at the - same time, by placing the object files for each architecture in their --own directory. To do this, you must use a version of `make' that --supports the `VPATH' variable, such as GNU `make'. `cd' to the -+own directory. To do this, you can use GNU `make'. `cd' to the - directory where you want the object files and executables to go and run - the `configure' script. `configure' automatically checks for the --source code in the directory that `configure' is in and in `..'. -+source code in the directory that `configure' is in and in `..'. This -+is known as a "VPATH" build. -+ -+ With a non-GNU `make', it is safer to compile the package for one -+architecture at a time in the source code directory. After you have -+installed the package for one architecture, use `make distclean' before -+reconfiguring for another architecture. - -- If you have to use a `make' that does not support the `VPATH' --variable, you have to compile the package for one architecture at a --time in the source code directory. After you have installed the --package for one architecture, use `make distclean' before reconfiguring --for another architecture. -+ On MacOS X 10.5 and later systems, you can create libraries and -+executables that work on multiple system types--known as "fat" or -+"universal" binaries--by specifying multiple `-arch' options to the -+compiler but only a single `-arch' option to the preprocessor. Like -+this: -+ -+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ -+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ -+ CPP="gcc -E" CXXCPP="g++ -E" -+ -+ This is not guaranteed to produce working output in all cases, you -+may have to build one architecture at a time and combine the results -+using the `lipo' tool if you have problems. - - Installation Names - ================== - --By default, `make install' installs the package's commands under -+ By default, `make install' installs the package's commands under - `/usr/local/bin', include files under `/usr/local/include', etc. You - can specify an installation prefix other than `/usr/local' by giving --`configure' the option `--prefix=PREFIX'. -+`configure' the option `--prefix=PREFIX', where PREFIX must be an -+absolute file name. - - You can specify separate installation prefixes for - architecture-specific files and architecture-independent files. If you -@@ -116,16 +156,47 @@ Documentation and other data files still use the regular prefix. - In addition, if you use an unusual directory layout you can give - options like `--bindir=DIR' to specify different values for particular - kinds of files. Run `configure --help' for a list of the directories --you can set and what kinds of files go in them. -+you can set and what kinds of files go in them. In general, the -+default for these options is expressed in terms of `${prefix}', so that -+specifying just `--prefix' will affect all of the other directory -+specifications that were not explicitly provided. -+ -+ The most portable way to affect installation locations is to pass the -+correct locations to `configure'; however, many packages provide one or -+both of the following shortcuts of passing variable assignments to the -+`make install' command line to change installation locations without -+having to reconfigure or recompile. -+ -+ The first method involves providing an override variable for each -+affected directory. For example, `make install -+prefix=/alternate/directory' will choose an alternate location for all -+directory configuration variables that were expressed in terms of -+`${prefix}'. Any directories that were specified during `configure', -+but not in terms of `${prefix}', must each be overridden at install -+time for the entire installation to be relocated. The approach of -+makefile variable overrides for each directory variable is required by -+the GNU Coding Standards, and ideally causes no recompilation. -+However, some platforms have known limitations with the semantics of -+shared libraries that end up requiring recompilation when using this -+method, particularly noticeable in packages that use GNU Libtool. -+ -+ The second method involves providing the `DESTDIR' variable. For -+example, `make install DESTDIR=/alternate/directory' will prepend -+`/alternate/directory' before all installation names. The approach of -+`DESTDIR' overrides is not required by the GNU Coding Standards, and -+does not work on platforms that have drive letters. On the other hand, -+it does better at avoiding recompilation issues, and works well even -+when some directory options were not specified in terms of `${prefix}' -+at `configure' time. -+ -+Optional Features -+================= - - If the package supports it, you can cause programs to be installed - with an extra prefix or suffix on their names by giving `configure' the - option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - --Optional Features --================= -- --Some packages pay attention to `--enable-FEATURE' options to -+ Some packages pay attention to `--enable-FEATURE' options to - `configure', where FEATURE indicates an optional part of the package. - They may also pay attention to `--with-PACKAGE' options, where PACKAGE - is something like `gnu-as' or `x' (for the X Window System). The -@@ -137,14 +208,58 @@ find the X include and library files automatically, but if it doesn't, - you can use the `configure' options `--x-includes=DIR' and - `--x-libraries=DIR' to specify their locations. - -+ Some packages offer the ability to configure how verbose the -+execution of `make' will be. For these packages, running `./configure -+--enable-silent-rules' sets the default to minimal output, which can be -+overridden with `make V=1'; while running `./configure -+--disable-silent-rules' sets the default to verbose, which can be -+overridden with `make V=0'. -+ -+Particular systems -+================== -+ -+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU -+CC is not installed, it is recommended to use the following options in -+order to use an ANSI C compiler: -+ -+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" -+ -+and if that doesn't work, install pre-built binaries of GCC for HP-UX. -+ -+ HP-UX `make' updates targets which have the same time stamps as -+their prerequisites, which makes it generally unusable when shipped -+generated files such as `configure' are involved. Use GNU `make' -+instead. -+ -+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -+parse its `' header file. The option `-nodtk' can be used as -+a workaround. If GNU CC is not installed, it is therefore recommended -+to try -+ -+ ./configure CC="cc" -+ -+and if that doesn't work, try -+ -+ ./configure CC="cc -nodtk" -+ -+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This -+directory contains several dysfunctional programs; working variants of -+these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -+in your `PATH', put it _after_ `/usr/bin'. -+ -+ On Haiku, software installed for all users goes in `/boot/common', -+not `/usr/local'. It is recommended to use the following options: -+ -+ ./configure --prefix=/boot/common -+ - Specifying the System Type - ========================== - --There may be some features `configure' cannot figure out automatically, --but needs to determine by the type of machine the package will run on. --Usually, assuming the package is built to be run on the _same_ --architectures, `configure' can figure that out, but if it prints a --message saying it cannot guess the machine type, give it the -+ There may be some features `configure' cannot figure out -+automatically, but needs to determine by the type of machine the package -+will run on. Usually, assuming the package is built to be run on the -+_same_ architectures, `configure' can figure that out, but if it prints -+a message saying it cannot guess the machine type, give it the - `--build=TYPE' option. TYPE can either be a short name for the system - type, such as `sun4', or a canonical name which has the form: - -@@ -152,7 +267,8 @@ type, such as `sun4', or a canonical name which has the form: - - where SYSTEM can have one of these forms: - -- OS KERNEL-OS -+ OS -+ KERNEL-OS - - See the file `config.sub' for the possible values of each field. If - `config.sub' isn't included in this package, then this package doesn't -@@ -170,9 +286,9 @@ eventually be run) with `--host=TYPE'. - Sharing Defaults - ================ - --If you want to set default values for `configure' scripts to share, you --can create a site shell script called `config.site' that gives default --values for variables like `CC', `cache_file', and `prefix'. -+ If you want to set default values for `configure' scripts to share, -+you can create a site shell script called `config.site' that gives -+default values for variables like `CC', `cache_file', and `prefix'. - `configure' looks for `PREFIX/share/config.site' if it exists, then - `PREFIX/etc/config.site' if it exists. Or, you can set the - `CONFIG_SITE' environment variable to the location of the site script. -@@ -181,7 +297,7 @@ A warning: not all `configure' scripts look for a site script. - Defining Variables - ================== - --Variables not defined in a site shell script can be set in the -+ Variables not defined in a site shell script can be set in the - environment passed to `configure'. However, some packages may run - configure again during the build, and the customized values of these - variables may be lost. In order to avoid this problem, you should set -@@ -190,21 +306,30 @@ them in the `configure' command line, using `VAR=value'. For example: - ./configure CC=/usr/local2/bin/gcc - - causes the specified `gcc' to be used as the C compiler (unless it is --overridden in the site shell script). Here is a another example: -+overridden in the site shell script). - -- /bin/bash ./configure CONFIG_SHELL=/bin/bash -+Unfortunately, this technique does not work for `CONFIG_SHELL' due to -+an Autoconf limitation. Until the limitation is lifted, you can use -+this workaround: - --Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent --configuration-related scripts to be executed by `/bin/bash'. -+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash - - `configure' Invocation - ====================== - --`configure' recognizes the following options to control how it operates. -+ `configure' recognizes the following options to control how it -+operates. - - `--help' - `-h' -- Print a summary of the options to `configure', and exit. -+ Print a summary of all of the options to `configure', and exit. -+ -+`--help=short' -+`--help=recursive' -+ Print a summary of the options unique to this package's -+ `configure', and exit. The `short' variant lists options used -+ only in the top level, while the `recursive' variant lists options -+ also present in any nested packages. - - `--version' - `-V' -@@ -231,6 +356,15 @@ configuration-related scripts to be executed by `/bin/bash'. - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -+`--prefix=DIR' -+ Use DIR as the installation prefix. *note Installation Names:: -+ for more details, including other options available for fine-tuning -+ the installation locations. -+ -+`--no-create' -+`-n' -+ Run the configure checks, but stop before creating any output -+ files. -+ - `configure' also accepts some other, not widely useful, options. Run - `configure --help' for more details. -- --- -2.21.0 - -From 6c3ded360addb03c75634adb521526f23028a85b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Tue, 14 Nov 2017 17:31:03 -0500 -Subject: [PATCH 23/30] fs-gui: Use accessor functions to parse messages - -Getting boxed types from GstMessage manually is just too error prone. ---- - examples/gui/fs-gui.py | 61 +++++++++++++++++++++++++----------------- - 1 file changed, 36 insertions(+), 25 deletions(-) - -diff --git a/examples/gui/fs-gui.py b/examples/gui/fs-gui.py -index 0ec16ac9..7ce937cc 100755 ---- a/examples/gui/fs-gui.py -+++ b/examples/gui/fs-gui.py -@@ -140,34 +140,45 @@ class FsUIPipeline (GObject.Object): - elif message.type == Gst.MessageType.LATENCY: - self.pipeline.recalculate_latency() - elif message.type == Gst.MessageType.ELEMENT: -+ sessions = [] -+ if AUDIO: -+ sessions += [self.audiosession] -+ if VIDEO: -+ sessions += [self.videosession] -+ for session in sessions: -+ (changed, codec, sec_codecs) = session.fssession.parse_send_codec_changed(message) -+ if changed: -+ print "Send codec changed: " + codec.to_string() -+ if changed or session.fssession.parse_codecs_changed(message): -+ print "Codecs changed" -+ -+ if self.audiosession == session: -+ self.codecs_changed_audio() -+ if self.videosession == session: -+ self.codecs_changed_video() -+ return True -+ -+ for stream in session.streams: -+ (res, candidate) = stream.fsstream.parse_new_local_candidate(message) -+ if res: -+ print "New Local candidate" -+ stream.new_local_candidate(candidate) -+ return True -+ -+ (res, codecs) = stream.fsstream.parse_recv_codecs_changed(message) -+ if res: -+ print "Receive codecs changed" -+ stream.recv_codecs_changed(codecs) -+ return True -+ -+ if stream.fsstream.parse_local_candidates_prepared(message): -+ print "Local candidates prepared" -+ stream.local_candidates_prepared() -+ return True -+ - if message.get_structure().has_name("dtmf-event"): - print "dtmf-event: %d" % message.get_structure().get_int("number") -- elif message.get_structure().has_name("farstream-local-candidates-prepared"): -- message.get_structure().get_value("stream").uistream.local_candidates_prepared() - -- elif message.get_structure().has_name("farstream-new-local-candidate"): -- message.get_structure().get_value("stream").uistream.new_local_candidate( -- message.get_structure().get_value("candidate")) -- elif message.get_structure().has_name("farstream-codecs-changed"): -- print message.src.get_name(), ": ", message.get_structure().get_name() -- message.get_structure().get_value("session").uisession.codecs_changed() -- if AUDIO and message.get_structure().get_value("session") == self.audiosession.fssession: -- self.codecs_changed_audio() -- if VIDEO and message.get_structure().get_value("session") == self.videosession.fssession: -- self.codecs_changed_video() -- elif message.get_structure().has_name("farstream-send-codec-changed"): -- print message.src.get_name(), ": ", message.get_structure().get_name() -- print "send codec changed: " + message.get_structure().get_value("codec").to_string() -- if AUDIO and message.get_structure().get_value("session") == self.audiosession.fssession: -- self.codecs_changed_audio() -- if VIDEO and message.get_structure().get_value("session") == self.videosession.fssession: -- self.codecs_changed_video() -- elif message.get_structure().has_name("farstream-recv-codecs-changed"): -- print message.src.get_name(), ": ", message.get_structure().get_name() -- message.get_structure().get_value("stream").uistream.recv_codecs_changed( \ -- message.get_structure().get_value("codecs")) -- -- - elif message.get_structure().has_name("farstream-error"): - print "Async error ("+ str(message.get_structure().get_int("error-no")) +"): " + message.get_structure().get_string("error-msg") - elif message.get_structure().has_name("level"): --- -2.21.0 - -From 5bcf5578a70f16f87c595560b0793e208b823c6c Mon Sep 17 00:00:00 2001 -From: Laurent Bigonville -Date: Thu, 1 Feb 2018 16:13:33 +0100 -Subject: [PATCH 24/30] Fix the name of the generated .devhelp2 files - -https://bugs.freedesktop.org/show_bug.cgi?id=104903 ---- - common-modified/gtk-doc-plugins.mak | 2 +- - common-modified/gtk-doc.mak | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/common-modified/gtk-doc-plugins.mak b/common-modified/gtk-doc-plugins.mak -index 82dbad46..a50107f0 100644 ---- a/common-modified/gtk-doc-plugins.mak -+++ b/common-modified/gtk-doc-plugins.mak -@@ -212,7 +212,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - mkhtml_options="$$mkhtml_options --verbose"; \ - fi; \ - fi; \ -- cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_API_VERSION@ $(DOC_MAIN_SGML_FILE) -+ cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) - @rm -f html/$(DOC_MAIN_SGML_FILE) - @rm -rf html/xml - @rm -f html/version.entities -diff --git a/common-modified/gtk-doc.mak b/common-modified/gtk-doc.mak -index 37542ec2..7caeb8bf 100644 ---- a/common-modified/gtk-doc.mak -+++ b/common-modified/gtk-doc.mak -@@ -147,7 +147,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - if test "$(?)" = "0"; then \ - mkhtml_options=--path="$(abs_srcdir)"; \ - fi; \ -- cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) -+ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - @rm -rf html/xml - @rm -f version.entities - @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) --- -2.21.0 - -From 73891c28fa27d5e65a71762e826f13747d743588 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Wed, 19 Sep 2018 13:31:49 +0200 -Subject: [PATCH 25/30] Remove Python dependency - -Farstream 0.2 never depended on Python directly ---- - Makefile.am | 4 +--- - configure.ac | 1 - - m4/Makefile.am | 2 -- - m4/as-check-python-headers.m4 | 30 ------------------------------ - 4 files changed, 1 insertion(+), 36 deletions(-) - delete mode 100644 m4/Makefile.am - delete mode 100644 m4/as-check-python-headers.m4 - -diff --git a/Makefile.am b/Makefile.am -index f81f6885..0bf9e861 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -10,7 +10,6 @@ SUBDIRS = \ - docs \ - common \ - common-modified \ -- m4 \ - examples - # pkgconfig - -@@ -22,7 +21,6 @@ DIST_SUBDIRS = \ - docs \ - common \ - common-modified \ -- m4 \ - examples - # pkgconfig - -@@ -30,7 +28,7 @@ EXTRA_DIST = \ - AUTHORS COPYING NEWS README ChangeLog autogen.sh \ - $(pcinfiles) - --ACLOCAL_AMFLAGS = -I m4 -I common/m4 -+ACLOCAL_AMFLAGS = -I common/m4 - - check-valgrind: - cd tests/check && make check-valgrind -diff --git a/configure.ac b/configure.ac -index 38c49807..c0747192 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -200,7 +200,6 @@ GOBJECT_INTROSPECTION_CHECK([0.10.1]) - - dnl check for documentation tools - GTK_DOC_CHECK([1.18]) --AS_PATH_PYTHON([2.1]) - AG_GST_PLUGIN_DOCS([1.8],[2.1]) - - dnl Make automake happy with per-target flags -diff --git a/m4/Makefile.am b/m4/Makefile.am -deleted file mode 100644 -index ad0c1aec..00000000 ---- a/m4/Makefile.am -+++ /dev/null -@@ -1,2 +0,0 @@ --EXTRA_DIST = \ -- as-check-python-headers.m4 -diff --git a/m4/as-check-python-headers.m4 b/m4/as-check-python-headers.m4 -deleted file mode 100644 -index 585455fd..00000000 ---- a/m4/as-check-python-headers.m4 -+++ /dev/null -@@ -1,30 +0,0 @@ --dnl Copy pasted from gst-python's acinclude.m4 file -- --dnl a macro to check for ability to create python extensions --dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) --dnl function also defines PYTHON_INCLUDES --AC_DEFUN([AM_CHECK_PYTHON_HEADERS], --[AC_REQUIRE([AM_PATH_PYTHON]) --AC_MSG_CHECKING(for headers required to compile python extensions) --dnl deduce PYTHON_INCLUDES --py_prefix=`$PYTHON -c "import sys; print sys.prefix"` --py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` --if $PYTHON-config --help 2>/dev/null; then -- PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` --else -- PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -- if test "$py_prefix" != "$py_exec_prefix"; then -- PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" -- fi --fi --AC_SUBST(PYTHON_INCLUDES) --dnl check if the headers exist: --save_CPPFLAGS="$CPPFLAGS" --CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" --AC_TRY_CPP([#include ],dnl --[AC_MSG_RESULT(found) --$1],dnl --[AC_MSG_RESULT(not found) --$2]) --CPPFLAGS="$save_CPPFLAGS" --]) --- -2.21.0 - -From 73625a038f308160375bef5ded796fae1a903265 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Wed, 19 Sep 2018 14:11:27 +0200 -Subject: [PATCH 26/30] Update common/ to latest - ---- - common | 2 +- - common-modified/gst-glib-gen.mak | 6 +++--- - common-modified/gtk-doc.mak | 6 +++++- - configure.ac | 3 +-- - docs/libs/Makefile.am | 4 ++-- - docs/plugins/Makefile.am | 4 ++-- - farstream/Makefile.am | 7 ++++--- - 7 files changed, 18 insertions(+), 14 deletions(-) - -diff --git a/common-modified/gst-glib-gen.mak b/common-modified/gst-glib-gen.mak -index d14f5c64..14f1ba37 100644 ---- a/common-modified/gst-glib-gen.mak -+++ b/common-modified/gst-glib-gen.mak -@@ -11,16 +11,16 @@ enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") - # these are all the rules generating the relevant files - $(glib_gen_basename)-enumtypes.h: $(glib_enum_headers) - $(AM_V_GEN)$(GLIB_MKENUMS) \ -- --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ -+ --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n$(glib_gen_decl_include)\n\nG_BEGIN_DECLS\n" \ - --fprod "\n/* enumerations from \"@filename@\" */\n" \ -- --vhead "GType @enum_name@_get_type (void);\n#define FS_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ -+ --vhead "$(glib_gen_decl_banner)\nGType @enum_name@_get_type (void);\n#define FS_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ - $^ > $@ - - $(glib_gen_basename)-enumtypes.c: $(glib_enum_headers) - @if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi - $(AM_V_GEN)$(GLIB_MKENUMS) \ -- --fhead "#include \"$(glib_gen_basename)-enumtypes.h\"\n$(enum_headers)" \ -+ --fhead "#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#include \"$(glib_gen_basename)-enumtypes.h\"\n$(enum_headers)" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ -diff --git a/common-modified/gtk-doc.mak b/common-modified/gtk-doc.mak -index 7caeb8bf..a973b8d7 100644 ---- a/common-modified/gtk-doc.mak -+++ b/common-modified/gtk-doc.mak -@@ -121,7 +121,11 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE) - - sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) - @echo ' DOC Building XML' -- @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) -+ @_source_dir='' ; \ -+ for i in $(DOC_SOURCE_DIR) ; do \ -+ _source_dir="$${_source_dir} --source-dir=$$i" ; \ -+ done ; \ -+ gtkdoc-mkdb --module=$(DOC_MODULE) $${_source_dir} --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) - @cp ../version.entities xml - @touch sgml-build.stamp - -diff --git a/configure.ac b/configure.ac -index c0747192..31be2770 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -75,7 +75,7 @@ dnl allow for different autotools - AS_AUTOTOOLS_ALTERNATE - - dnl Add parameters for aclocal --AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4") -+AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4") - - dnl *** check for arguments to configure *** - -@@ -422,7 +422,6 @@ docs/Makefile - docs/libs/Makefile - docs/plugins/Makefile - docs/version.entities --m4/Makefile - dnl docs/plugins/Makefile - ) - AC_OUTPUT -diff --git a/docs/libs/Makefile.am b/docs/libs/Makefile.am -index 0f6d2654..4b22d992 100644 ---- a/docs/libs/Makefile.am -+++ b/docs/libs/Makefile.am -@@ -68,8 +68,8 @@ GTKDOC_LIBS = -static \ - $(GST_BASE_LIBS) \ - $(GCOV_LIBS) - --GTKDOC_CC=$(LIBTOOL) --tag=CC --mode=compile $(CC) --GTKDOC_LD=$(LIBTOOL) --tag=CC --mode=link $(CC) -+#GTKDOC_CC=$(LIBTOOL) --tag=CC --mode=compile $(CC) -+#GTKDOC_LD=$(LIBTOOL) --tag=CC --mode=link $(CC) - - # If you need to override some of the declarations, place them in this file - # and uncomment this line. -diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am -index 7b4913fb..629291b8 100644 ---- a/docs/plugins/Makefile.am -+++ b/docs/plugins/Makefile.am -@@ -125,8 +125,8 @@ GTKDOC_LIBS = \ - $(top_builddir)/gst/fsrawconference/libfsrawconference_doc.la \ - $(GST_BASE_LIBS) - --GTKDOC_CC=$(LIBTOOL) --tag=CC --mode=compile $(CC) --GTKDOC_LD=$(LIBTOOL) --tag=CC --mode=link $(CC) -+#GTKDOC_CC=$(LIBTOOL) --tag=CC --mode=compile $(CC) -+#GTKDOC_LD=$(LIBTOOL) --tag=CC --mode=link $(CC) - - # If you need to override some of the declarations, place them in this file - # and uncomment this line. -diff --git a/farstream/Makefile.am b/farstream/Makefile.am -index 510c39c2..36a820d1 100644 ---- a/farstream/Makefile.am -+++ b/farstream/Makefile.am -@@ -73,6 +73,7 @@ glib_enum_headers=$(public_headers) - glib_enum_define=FS - glib_gen_prefix=_fs - glib_gen_basename=fs -+glib_gen_decl_include=\#include - - include $(top_srcdir)/common-modified/gst-glib-gen.mak - -@@ -83,8 +84,9 @@ introspection_sources = \ - $(nodist_libfarstreaminclude_HEADERS) \ - $(libfarstreaminclude_HEADERS) - -+ - INTROSPECTION_GIRS = Farstream-@FS_APIVERSION@.gir --Farstream-@FS_APIVERSION@.gir: libfarstream-@FS_APIVERSION@.la -+Farstream_@FS_API_VERSION@_gir: libfarstream_@FS_APIVERSION@.la - Farstream_@FS_API_VERSION@_gir_NAMESPACE = Farstream - Farstream_@FS_API_VERSION@_gir_VERSION = @FS_APIVERSION@ - Farstream_@FS_API_VERSION@_gir_LIBS = libfarstream-@FS_APIVERSION@.la -@@ -94,8 +96,7 @@ Farstream_@FS_API_VERSION@_gir_CFLAGS = $(FS_INTERNAL_CFLAGS) - Farstream_@FS_API_VERSION@_gir_SCANNERFLAGS = --symbol-prefix=fs \ - --identifier-prefix=Fs --add-init-section="gst_init(NULL,NULL);" \ - --pkg-export=farstream-@FS_APIVERSION@ \ -- $(foreach hdr,$(public_headers),--c-include=$(hdr)) --Farstream_@FS_API_VERSION@_gir_LDFLAGS = $(GST_LIBS) -+ $(foreach hdr,$(public_headers),--c-include=$(hdr)) --include-last-in-header=gst/gst.h - - girdir = $(datadir)/gir-1.0 - dist_gir_DATA = Farstream-@FS_APIVERSION@.gir --- -2.21.0 - -From a7de59c359349b47419880699b2e48e132eec5bb Mon Sep 17 00:00:00 2001 -From: Fabrice Bellet -Date: Tue, 23 May 2017 16:06:47 +0200 -Subject: [PATCH 27/30] rtp: fix a double locking issue on the session - -The session value used in fs_rtp_stream_add_substream_unlock(), taken -from the stream struct may be null, while the session value from -fs_rtp_session_new_recv_pad() is not. However these two function depend -on the same session value to properly lock and unlock it: the first -function will unlock the session previously locked by the second -function. ---- - gst/fsrtpconference/fs-rtp-session.c | 6 +++--- - gst/fsrtpconference/fs-rtp-stream.c | 12 ++++++++---- - gst/fsrtpconference/fs-rtp-stream.h | 1 + - 3 files changed, 12 insertions(+), 7 deletions(-) - -diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c -index 86eefbb4..bcee5909 100644 ---- a/gst/fsrtpconference/fs-rtp-session.c -+++ b/gst/fsrtpconference/fs-rtp-session.c -@@ -3290,7 +3290,7 @@ fs_rtp_session_new_recv_pad (FsRtpSession *session, GstPad *new_pad, - - if (stream) - { -- if (!fs_rtp_stream_add_substream_unlock (stream, substream, &error)) -+ if (!fs_rtp_stream_add_substream_unlock (stream, substream, session, &error)) - { - g_prefix_error (&error, - "Could not add the output ghostpad to the new substream: "); -@@ -4363,7 +4363,7 @@ fs_rtp_session_associate_free_substreams (FsRtpSession *session, - g_signal_handlers_disconnect_by_func (substream, "no-rtcp-timedout", - session) > 0); - -- if (fs_rtp_stream_add_substream_unlock (stream, substream, &error)) -+ if (fs_rtp_stream_add_substream_unlock (stream, substream, session, &error)) - { - GST_DEBUG ("Associated SSRC %x in session %u", ssrc, session->id); - } -@@ -4488,7 +4488,7 @@ _substream_no_rtcp_timedout_cb (FsRtpSubStream *substream, - - first_stream = g_list_first (session->priv->streams)->data; - g_object_ref (first_stream); -- if (!fs_rtp_stream_add_substream_unlock (first_stream, substream, &error)) -+ if (!fs_rtp_stream_add_substream_unlock (first_stream, substream, session, &error)) - { - g_prefix_error (&error, - "Could not link the substream to a stream: "); -diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c -index 593af4d8..c2b96922 100644 ---- a/gst/fsrtpconference/fs-rtp-stream.c -+++ b/gst/fsrtpconference/fs-rtp-stream.c -@@ -1013,6 +1013,7 @@ _substream_unlinked (FsRtpSubStream *substream, gpointer user_data) - * fs_rtp_stream_add_substream_unlock: - * @stream: a #FsRtpStream - * @substream: the #FsRtpSubStream to associate with this stream -+ * @session: the #FsRtpSession to be unlocked - * - * This functions associates a substream with this stream - * -@@ -1024,13 +1025,18 @@ _substream_unlinked (FsRtpSubStream *substream, gpointer user_data) - gboolean - fs_rtp_stream_add_substream_unlock (FsRtpStream *stream, - FsRtpSubStream *substream, -+ FsRtpSession *session, - GError **error) - { - gboolean ret = TRUE; -- FsRtpSession *session = fs_rtp_stream_get_session (stream, error); -+ FsRtpSession *mysession = fs_rtp_stream_get_session (stream, error); - -- if (!session) -+ if (!mysession) { -+ FS_RTP_SESSION_UNLOCK (session); - return FALSE; -+ } -+ -+ g_object_unref (mysession); - - stream->substreams = g_list_prepend (stream->substreams, - substream); -@@ -1056,8 +1062,6 @@ fs_rtp_stream_add_substream_unlock (FsRtpStream *stream, - else - FS_RTP_SESSION_UNLOCK (session); - -- g_object_unref (session); -- - return ret; - } - -diff --git a/gst/fsrtpconference/fs-rtp-stream.h b/gst/fsrtpconference/fs-rtp-stream.h -index a4b3fb23..86674c3b 100644 ---- a/gst/fsrtpconference/fs-rtp-stream.h -+++ b/gst/fsrtpconference/fs-rtp-stream.h -@@ -117,6 +117,7 @@ FsRtpStream *fs_rtp_stream_new (FsRtpSession *session, - - gboolean fs_rtp_stream_add_substream_unlock (FsRtpStream *stream, - FsRtpSubStream *substream, -+ FsRtpSession *session, - GError **error); - - void --- -2.21.0 - -From 2cbbbca4f1855997b559f2da3d16ad896260407a Mon Sep 17 00:00:00 2001 -From: Fabrice Bellet -Date: Wed, 14 Jun 2017 12:22:32 +0200 -Subject: [PATCH 28/30] rtp: stop the transmitter src before unlinking its - funnel - -This patch tweaks the order the elements are stopped and unlinked to -prevent the transmitter source to fail on a not-linked to any sinkpads -error. The pipeline is transmitter-src -> funnel -> rtpbin -> substream. - -The funnel is stopped, then the transmitter-src, and thereafter the -funnel is unlinked. - -https://bugs.freedesktop.org/show_bug.cgi?id=100586 ---- - gst/fsrtpconference/fs-rtp-session.c | 31 +++++++++++++++++++++------- - 1 file changed, 24 insertions(+), 7 deletions(-) - -diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c -index bcee5909..a9d7c950 100644 ---- a/gst/fsrtpconference/fs-rtp-session.c -+++ b/gst/fsrtpconference/fs-rtp-session.c -@@ -574,19 +574,27 @@ _stop_transmitter_elem (gpointer key, gpointer value, gpointer elem_name) - } - - static void --stop_and_remove (GstBin *conf, GstElement **element, gboolean unref) -+stop_element (GstElement *element) - { -- if (*element == NULL) -+ if (element == NULL) - return; - -- gst_element_set_locked_state (*element, TRUE); -- if (gst_element_set_state (*element, GST_STATE_NULL) != -+ gst_element_set_locked_state (element, TRUE); -+ if (gst_element_set_state (element, GST_STATE_NULL) != - GST_STATE_CHANGE_SUCCESS) - { -- gchar *elemname = gst_element_get_name (*element); -+ gchar *elemname = gst_element_get_name (element); - GST_WARNING ("Could not set %s to GST_STATE_NULL", elemname); - g_free (elemname); - } -+} -+ -+static void -+remove_element (GstBin *conf, GstElement **element, gboolean unref) -+{ -+ if (*element == NULL) -+ return; -+ - if (!gst_bin_remove (conf, *element)) - { - gchar *binname = gst_element_get_name (conf); -@@ -600,6 +608,12 @@ stop_and_remove (GstBin *conf, GstElement **element, gboolean unref) - *element = NULL; - } - -+static void -+stop_and_remove (GstBin *conf, GstElement **element, gboolean unref) -+{ -+ stop_element (*element); -+ remove_element (conf, element, unref); -+} - - static void - fs_rtp_session_dispose (GObject *obj) -@@ -748,13 +762,16 @@ fs_rtp_session_dispose (GObject *obj) - if (self->priv->rtpbin_recv_rtcp_sink) - gst_pad_set_active (self->priv->rtpbin_recv_rtcp_sink, FALSE); - -- stop_and_remove (conferencebin, &self->priv->transmitter_rtp_funnel, TRUE); -- stop_and_remove (conferencebin, &self->priv->transmitter_rtcp_funnel, TRUE); -+ stop_element (self->priv->transmitter_rtp_funnel); -+ stop_element (self->priv->transmitter_rtcp_funnel); - - if (self->priv->transmitters) - g_hash_table_foreach (self->priv->transmitters, _stop_transmitter_elem, - "gst-src"); - -+ remove_element (conferencebin, &self->priv->transmitter_rtp_funnel, TRUE); -+ remove_element (conferencebin, &self->priv->transmitter_rtcp_funnel, TRUE); -+ - self->priv->extra_sources = - fs_rtp_special_sources_destroy (self->priv->extra_sources); - --- -2.21.0 - -From 0d3d4bf20285f4fe8c9e3222afee62042147601d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 1 Nov 2018 18:31:28 -0400 -Subject: [PATCH 29/30] farstream: Quell warning in interspection generation - ---- - farstream/Makefile.am | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/farstream/Makefile.am b/farstream/Makefile.am -index 36a820d1..ec32682b 100644 ---- a/farstream/Makefile.am -+++ b/farstream/Makefile.am -@@ -96,7 +96,8 @@ Farstream_@FS_API_VERSION@_gir_CFLAGS = $(FS_INTERNAL_CFLAGS) - Farstream_@FS_API_VERSION@_gir_SCANNERFLAGS = --symbol-prefix=fs \ - --identifier-prefix=Fs --add-init-section="gst_init(NULL,NULL);" \ - --pkg-export=farstream-@FS_APIVERSION@ \ -- $(foreach hdr,$(public_headers),--c-include=$(hdr)) --include-last-in-header=gst/gst.h -+ $(foreach hdr,$(public_headers),--c-include=$(hdr)) \ -+ --cflags-begin -include gst/gst.h --cflags-end - - girdir = $(datadir)/gir-1.0 - dist_gir_DATA = Farstream-@FS_APIVERSION@.gir --- -2.21.0 - -From 092d884da4c91967692dcaddaf583413a39d59d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= -Date: Thu, 1 Nov 2018 18:57:46 -0400 -Subject: [PATCH 30/30] gir: Add package deps to ensure the GIR build works - ---- - farstream/Makefile.am | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/farstream/Makefile.am b/farstream/Makefile.am -index ec32682b..e6b509c1 100644 ---- a/farstream/Makefile.am -+++ b/farstream/Makefile.am -@@ -93,6 +93,7 @@ Farstream_@FS_API_VERSION@_gir_LIBS = libfarstream-@FS_APIVERSION@.la - Farstream_@FS_API_VERSION@_gir_FILES = $(introspection_sources) - Farstream_@FS_API_VERSION@_gir_INCLUDES = GObject-2.0 Gst-@GST_API_VERSION@ - Farstream_@FS_API_VERSION@_gir_CFLAGS = $(FS_INTERNAL_CFLAGS) -+Farstream_@FS_API_VERSION@_gir_PACKAGES = gstreamer-@GST_API_VERSION@ - Farstream_@FS_API_VERSION@_gir_SCANNERFLAGS = --symbol-prefix=fs \ - --identifier-prefix=Fs --add-init-section="gst_init(NULL,NULL);" \ - --pkg-export=farstream-@FS_APIVERSION@ \ --- -2.21.0 - diff --git a/farstream-0.2.9-build-Adapt-to-backwards-incompatible-change-in-GNU-.patch b/farstream-0.2.9-build-Adapt-to-backwards-incompatible-change-in-GNU-.patch new file mode 100644 index 0000000..7b1ec9a --- /dev/null +++ b/farstream-0.2.9-build-Adapt-to-backwards-incompatible-change-in-GNU-.patch @@ -0,0 +1,38 @@ +From 54987d445ea714b467d901b7daf8c09ed0644189 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 12 Mar 2020 14:07:23 +0100 +Subject: [PATCH] build: Adapt to backwards incompatible change in GNU Make 4.3 + +GNU Make 4.3 has a backwards incompatible change affecting the use of +number signs or hashes (ie., #) inside function invocations. See: +https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html + +In this case, it would expand the '\#' in the '\n\#include \"$(h)\"' +argument to the foreach call to '\#', not '#'. This would lead to +spurious backslashes in front of the '#include' directives in the +generated fs-enumtypes.c file. + +Spotted by Ernestas Kulik. + +https://gitlab.freedesktop.org/farstream/farstream/-/merge_requests/4 +--- + common-modified/gst-glib-gen.mak | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/common-modified/gst-glib-gen.mak b/common-modified/gst-glib-gen.mak +index 14f1ba37c788..2247a41c49ea 100644 +--- a/common-modified/gst-glib-gen.mak ++++ b/common-modified/gst-glib-gen.mak +@@ -6,7 +6,8 @@ + #glib_gen_prefix=gst_color_balance + #glib_gen_basename=colorbalance + +-enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") ++hash:=\# ++enum_headers=$(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\") + + # these are all the rules generating the relevant files + $(glib_gen_basename)-enumtypes.h: $(glib_enum_headers) +-- +2.24.1 + diff --git a/farstream02.spec b/farstream02.spec index a57a33a..dcbd1e3 100644 --- a/farstream02.spec +++ b/farstream02.spec @@ -1,30 +1,31 @@ +%global glib2_ver 2.40 %global gst_ver 1.0.0 %global gst_plugins_base_ver 1.0.0 %global far farstream Name: %{far}02 -Version: 0.2.8 -Release: 7%{?dist} +Version: 0.2.9 +Release: 1%{?dist} Summary: Libraries for videoconferencing # Package is LGPLv2 except for a few files in /common/coverage/ License: LGPLv2+ and GPLv2+ URL: https//www.freedesktop.org/wiki/Software/Farstream Source0: https://freedesktop.org/software/%{far}/releases/%{far}/%{far}-%{version}.tar.gz -# generated with format-patch, edited to remove changes to files not in tarball -Patch1: farstream-0.2.8-30-g092d884d.patch # patch for upstream issue https://gitlab.freedesktop.org/farstream/farstream/issues/16 -Patch2: farstream-0.2.8-configure-add-check-for-glib-mkenums.patch +Patch0: farstream-0.2.8-configure-add-check-for-glib-mkenums.patch +Patch1: farstream-0.2.9-build-Adapt-to-backwards-incompatible-change-in-GNU-.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libnice-devel >= 0.1.8 -BuildRequires: glib2-devel +BuildRequires: glib2-devel >= %{glib2_ver} BuildRequires: gstreamer1-devel >= %{gst_ver} BuildRequires: gstreamer1-plugins-base-devel >= %{gst_plugins_base_ver} BuildRequires: gupnp-igd-devel BuildRequires: gobject-introspection-devel +Requires: glib2%{?isa} >= %{glib2_ver} Requires: gstreamer1-plugins-good >= 1.0.0 Requires: gstreamer1-plugins-bad-free >= 1.0.0 Requires: libnice-gstreamer1 @@ -50,8 +51,8 @@ developing applications that use %{name}. %prep %setup -q -n %{far}-%{version} +%patch0 -p1 %patch1 -p1 -%patch2 -p1 %check @@ -115,6 +116,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %changelog +* Thu Mar 12 2020 Debarshi Ray - 0.2.9-1 +- Update to 0.2.9. + * Tue Jan 28 2020 Fedora Release Engineering - 0.2.8-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index 6789642..628888d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (farstream-0.2.8.tar.gz) = 7ec5c57f8778f4107cb628dbf411e38b726152cf78920127dff4423239ff7e4980b6b4f938abba2aa21ab984b1e3053e7e648611322a0ce94df0af576df99a7e +SHA512 (farstream-0.2.9.tar.gz) = 8840725d2f1de59bebc8c49cf68a6712822a4e7b6ba9078713f80e3c35a39135565a1a885edab43a562f895e11b8f5d8d666d57d9b3814dabb661f46498515bd