[empathy: 5/12] Allow to build with empathy-av



commit 57a7b1ba43133f3f3097d00b89a8d8f7f246ccdb
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Feb 28 13:05:43 2012 +0100

    Allow to build with empathy-av

 configure.ac                         |   19 +++++++++++++++++++
 data/Makefile.am                     |   12 ++++++++++--
 libempathy-gtk/empathy-call-utils.c  |   31 +++++++++++++++++--------------
 src/Makefile.am                      |    9 ++++++---
 src/empathy-streamed-media-handler.c |    6 +++---
 src/empathy-streamed-media-handler.h |    2 +-
 src/empathy-streamed-media-window.c  |    8 ++++----
 7 files changed, 60 insertions(+), 27 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9e20141..b69ee09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,24 @@ AC_DEFINE(EMPATHY_GOA_PROVIDER, "org.gnome.OnlineAccounts",
    [Name of provider for accounts imported from GOA])
 
 # -----------------------------------------------------------
+# Build empathy-av?
+# -----------------------------------------------------------
+AC_ARG_ENABLE(empathy-av,
+            AS_HELP_STRING([--enable-empathy-av=@<:@no/yes@:>@],
+            [build empathy-av (legacy call UI)]),,
+            [enable_empathy_av=no])
+if test "x$enable_empathy_av" != "xno" ; then
+   PKG_CHECK_MODULES(EMPATHY_AV,
+   [
+      farstream-0.1
+      telepathy-farsight >= $TELEPATHY_FARSIGHT_REQUIRED
+   ])
+   AC_DEFINE(HAVE_EMPATHY_AV, 1, [Define if you have StreamedMedia channel support])
+   have_empathy_av=yes
+fi
+AM_CONDITIONAL(HAVE_EMPATHY_AV, test "x$have_empathy_av" = "xyes")
+
+# -----------------------------------------------------------
 # Call support in tp-logger
 # -----------------------------------------------------------
 AC_ARG_ENABLE(call-logs,
@@ -669,4 +687,5 @@ Configure summary:
 	GOA MC plugin...............:  ${have_goa}
 	Salut E-D-S support.........:  ${with_eds}
 	Exp. Call log support.......:  ${have_call_logs}
+	empathy-av (legacy).........:  ${enable_empathy_av}
 "
diff --git a/data/Makefile.am b/data/Makefile.am
index 443cdeb..f3da574 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -22,11 +22,15 @@ convert_DATA = \
 servicefiledir = $(datadir)/dbus-1/services
 servicefile_in_files = \
 	org.freedesktop.Telepathy.Client.Empathy.Chat.service.in \
-	org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service.in \
 	org.freedesktop.Telepathy.Client.Empathy.Auth.service.in \
 	org.freedesktop.Telepathy.Client.Empathy.Call.service.in \
 	org.freedesktop.Telepathy.Client.Empathy.FileTransfer.service.in
 
+if HAVE_EMPATHY_AV
+servicefile_in_files += \
+	org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service.in
+endif
+
 servicefile_DATA = $(servicefile_in_files:.service.in=.service)
 
 org.freedesktop.Telepathy.Client.Empathy.Chat.service: org.freedesktop.Telepathy.Client.Empathy.Chat.service.in
@@ -47,11 +51,15 @@ org.freedesktop.Telepathy.Client.Empathy.FileTransfer.service: org.freedesktop.T
 clientfiledir = $(datarootdir)/telepathy/clients
 clientfile_DATA = \
 	Empathy.Chat.client \
-	Empathy.AudioVideo.client \
 	Empathy.Auth.client \
 	Empathy.Call.client \
 	Empathy.FileTransfer.client
 
+if HAVE_EMPATHY_AV
+clientfile_DATA += \
+	Empathy.AudioVideo.client
+endif
+
 htmldir = $(datadir)/empathy
 html_DATA = \
 	Template.html \
diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c
index 1dca386..545ec7c 100644
--- a/libempathy-gtk/empathy-call-utils.c
+++ b/libempathy-gtk/empathy-call-utils.c
@@ -143,24 +143,24 @@ create_call_channel_cb (GObject *source,
   if (tp_account_channel_request_create_channel_finish (
       TP_ACCOUNT_CHANNEL_REQUEST (source), result, &error))
     {
-      g_object_unref (streamed_media_req);
+      g_clear_object (&streamed_media_req);
       return;
     }
 
   DEBUG ("Failed to create Call channel: %s", error->message);
 
-  if (error->code != TP_ERROR_NOT_IMPLEMENTED)
+  if (streamed_media_req != NULL)
     {
-      show_call_error (error);
+      DEBUG ("Let's try with an StreamedMedia channel");
+      g_error_free (error);
+      tp_account_channel_request_create_channel_async (streamed_media_req,
+          EMPATHY_AV_BUS_NAME, NULL,
+          create_streamed_media_channel_cb,
+          NULL);
       return;
     }
 
-  DEBUG ("Let's try with an StreamedMedia channel");
-  g_error_free (error);
-  tp_account_channel_request_create_channel_async (streamed_media_req,
-      EMPATHY_AV_BUS_NAME, NULL,
-      create_streamed_media_channel_cb,
-      NULL);
+  show_call_error (error);
 }
 
 /* Try to request a Call channel and fallback to StreamedMedia if that fails */
@@ -171,8 +171,11 @@ call_new_with_streams (const gchar *contact,
     gboolean initial_video,
     gint64 timestamp)
 {
-  GHashTable *call_request, *streamed_media_request;
-  TpAccountChannelRequest *call_req, *streamed_media_req;
+  GHashTable *call_request;
+  TpAccountChannelRequest *call_req, *streamed_media_req = NULL;
+#ifdef HAVE_EMPATHY_AV
+  GHashTable *streamed_media_request;
+#endif
 
   /* Call */
   call_request = empathy_call_create_call_request (contact,
@@ -183,6 +186,7 @@ call_new_with_streams (const gchar *contact,
 
   g_hash_table_unref (call_request);
 
+#ifdef HAVE_EMPATHY_AV
   /* StreamedMedia */
   streamed_media_request = empathy_call_create_streamed_media_request (
       contact, initial_audio, initial_video);
@@ -192,11 +196,10 @@ call_new_with_streams (const gchar *contact,
       timestamp);
 
   g_hash_table_unref (streamed_media_request);
+#endif
 
   tp_account_channel_request_create_channel_async (call_req,
-      EMPATHY_CALL_BUS_NAME, NULL,
-      create_call_channel_cb,
-      streamed_media_req);
+      EMPATHY_CALL_BUS_NAME, NULL, create_call_channel_cb, streamed_media_req);
 
   g_object_unref (call_req);
 }
diff --git a/src/Makefile.am b/src/Makefile.am
index ffc74e7..ba482c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,7 +52,7 @@ bin_PROGRAMS =			\
 
 libexec_PROGRAMS = \
 	empathy-auth-client \
-	empathy-av \
+	empathy-call \
 	empathy-chat
 
 empathy_accounts_SOURCES =						\
@@ -69,6 +69,7 @@ empathy_debugger_SOURCES =						\
 	empathy-debugger.c		 				\
 	$(NULL)
 
+if HAVE_EMPATHY_AV
 empathy_av_SOURCES = \
 	empathy-av.c \
 	empathy-audio-sink.c \
@@ -96,6 +97,10 @@ empathy_av_SOURCES = \
 empathy_av_CFLAGS = $(EMPATHY_AV_CFLAGS)
 empathy_av_LDFLAGS = $(EMPATHY_AV_LIBS) $(LIBM)
 
+libexec_PROGRAMS += empathy-av
+
+endif
+
 empathy_auth_client_SOURCES =						\
 	empathy-auth-client.c \
 	$(NULL)
@@ -109,8 +114,6 @@ empathy_chat_SOURCES =						\
 	gedit-close-button.c gedit-close-button.h \
 	$(NULL)
 
-libexec_PROGRAMS += empathy-call
-
 empathy_call_SOURCES = \
        empathy-call.c \
        empathy-call-factory.c \
diff --git a/src/empathy-streamed-media-handler.c b/src/empathy-streamed-media-handler.c
index a3c5397..42d991b 100644
--- a/src/empathy-streamed-media-handler.c
+++ b/src/empathy-streamed-media-handler.c
@@ -539,7 +539,7 @@ empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler
     return;
 
   if (s != NULL &&
-      gst_structure_has_name (s, "farsight-send-codec-changed"))
+      gst_structure_has_name (s, "farstream-send-codec-changed"))
     {
       const GValue *val;
       FsCodec *codec;
@@ -554,7 +554,7 @@ empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler
       update_sending_codec (handler, codec, session);
     }
   else if (s != NULL &&
-      gst_structure_has_name (s, "farsight-recv-codecs-changed"))
+      gst_structure_has_name (s, "farstream-recv-codecs-changed"))
     {
       const GValue *val;
       GList *codecs;
@@ -569,7 +569,7 @@ empathy_streamed_media_handler_bus_message (EmpathyStreamedMediaHandler *handler
       update_receiving_codec (handler, codecs, stream);
     }
   else if (s != NULL &&
-      gst_structure_has_name (s, "farsight-new-active-candidate-pair"))
+      gst_structure_has_name (s, "farstream-new-active-candidate-pair"))
     {
       const GValue *val;
       FsCandidate *remote_candidate, *local_candidate;
diff --git a/src/empathy-streamed-media-handler.h b/src/empathy-streamed-media-handler.h
index ab655b8..429c954 100644
--- a/src/empathy-streamed-media-handler.h
+++ b/src/empathy-streamed-media-handler.h
@@ -24,7 +24,7 @@
 #include <glib-object.h>
 
 #include <gst/gst.h>
-#include <gst/farsight/fs-conference-iface.h>
+#include <farstream/fs-conference.h>
 
 #include <libempathy/empathy-tp-streamed-media.h>
 #include <libempathy/empathy-contact.h>
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c
index df3fbab..beec4eb 100644
--- a/src/empathy-streamed-media-window.c
+++ b/src/empathy-streamed-media-window.c
@@ -31,11 +31,11 @@
 #include <glib/gi18n.h>
 
 #include <telepathy-glib/util.h>
-#include <telepathy-farsight/channel.h>
-#include <telepathy-glib/util.h>
 
-#include <gst/farsight/fs-element-added-notifier.h>
-#include <gst/farsight/fs-utils.h>
+#include <telepathy-farsight/stream.h>
+
+#include <farstream/fs-element-added-notifier.h>
+#include <farstream/fs-utils.h>
 
 #include <libempathy/empathy-tp-contact-factory.h>
 #include <libempathy/empathy-utils.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]