aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/Makefile.am5
-rw-r--r--data/codec-preferences36
-rw-r--r--data/element-properties32
-rw-r--r--libempathy-gtk/empathy-audio-sink.c10
-rw-r--r--libempathy-gtk/empathy-audio-src.c12
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c8
-rw-r--r--libempathy/empathy-call-handler.c101
-rw-r--r--src/empathy-call-window.c31
8 files changed, 143 insertions, 92 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 52108fbe7..81ca5a7b9 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -30,6 +30,11 @@ schemas_in_files = empathy.schemas.in
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
+streamingprefsdir = $(datadir)/empathy
+streamingprefs_DATA = \
+ codec-preferences \
+ element-properties
+
if GCONF_SCHEMAS_INSTALL
install-data-local:
if test -z "$(DESTDIR)" ; then \
diff --git a/data/codec-preferences b/data/codec-preferences
new file mode 100644
index 000000000..0cb0910bc
--- /dev/null
+++ b/data/codec-preferences
@@ -0,0 +1,36 @@
+# Favorite audio codecs
+
+[audio/SPEEX:8000]
+clock-rate=8000
+
+[audio/SPEEX:16000]
+clock-rate=16000
+
+[audio/AMR]
+
+[audio/G729]
+
+[audio/ILBC]
+
+# Disabled audio codecs
+
+[audio/DV]
+id=-1
+
+[audio/MPA]
+id=-1
+
+[audio/VORBIS]
+id=-1
+
+[audio/MP3]
+id=-1
+
+
+# Favorite video codecs
+
+[video/H264]
+
+[video/H263]
+
+[video/THEORA]
diff --git a/data/element-properties b/data/element-properties
new file mode 100644
index 000000000..17a283ada
--- /dev/null
+++ b/data/element-properties
@@ -0,0 +1,32 @@
+# Put the desired properties in the style of
+#
+# [element name]
+# prop1=val1
+
+[gstrtpbin]
+latency=100
+
+[x264enc]
+byte-stream=1
+bframes=0
+b-adapt=0
+cabac=0
+dct8x8=0
+
+[ffenc_h263]
+rtp-payload-size=1
+
+# Work around bug in the re-timestamp slaving method in
+# GStreamer (2 is skew)
+[alsasrc]
+slave-method=2
+
+[osssrc]
+slave-method=2
+
+[oss4src]
+slave-method=2
+
+[sunaudiosrc]
+slave-method=2
+
diff --git a/libempathy-gtk/empathy-audio-sink.c b/libempathy-gtk/empathy-audio-sink.c
index 55f64e828..1d2169593 100644
--- a/libempathy-gtk/empathy-audio-sink.c
+++ b/libempathy-gtk/empathy-audio-sink.c
@@ -204,7 +204,15 @@ empathy_audio_sink_finalize (GObject *object)
GstElement *
empathy_audio_sink_new (void)
{
- return GST_ELEMENT (g_object_new (EMPATHY_TYPE_GST_AUDIO_SINK, NULL));
+ static gboolean registered = FALSE;
+
+ if (!registered) {
+ if (!gst_element_register (NULL, "empathyaudiosink",
+ GST_RANK_NONE, EMPATHY_TYPE_GST_AUDIO_SINK))
+ return NULL;
+ registered = TRUE;
+ }
+ return gst_element_factory_make ("empathyaudiosink", NULL);
}
void
diff --git a/libempathy-gtk/empathy-audio-src.c b/libempathy-gtk/empathy-audio-src.c
index 0497439bf..a3416f2ea 100644
--- a/libempathy-gtk/empathy-audio-src.c
+++ b/libempathy-gtk/empathy-audio-src.c
@@ -343,7 +343,15 @@ out:
GstElement *
empathy_audio_src_new (void)
{
- return GST_ELEMENT (g_object_new (EMPATHY_TYPE_GST_AUDIO_SRC, NULL));
+ static gboolean registered = FALSE;
+
+ if (!registered) {
+ if (!gst_element_register (NULL, "empathyaudiosrc",
+ GST_RANK_NONE, EMPATHY_TYPE_GST_AUDIO_SRC))
+ return NULL;
+ registered = TRUE;
+ }
+ return gst_element_factory_make ("empathyaudiosrc", NULL);
}
void
@@ -375,3 +383,5 @@ empathy_audio_src_get_volume (EmpathyGstAudioSrc *src)
return volume;
}
+
+
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 783d986d0..a4dfa0f59 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -364,6 +364,7 @@ contact_list_view_drag_motion (GtkWidget *widget,
gboolean is_row;
gboolean is_different = FALSE;
gboolean cleanup = TRUE;
+ int action = 0;
is_row = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
x,
@@ -382,6 +383,13 @@ contact_list_view_drag_motion (GtkWidget *widget,
cleanup &= FALSE;
}
+ if (context->actions == GDK_ACTION_COPY) {
+ action = context->suggested_action;
+ } else if (context->actions & GDK_ACTION_MOVE) {
+ action = GDK_ACTION_MOVE;
+ }
+ gdk_drag_status (context, action, time);
+
if (!is_different && !cleanup) {
return TRUE;
}
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c
index f73c41e2e..72c317b7f 100644
--- a/libempathy/empathy-call-handler.c
+++ b/libempathy/empathy-call-handler.c
@@ -27,8 +27,6 @@
#include <telepathy-farsight/channel.h>
#include <telepathy-farsight/stream.h>
-#include <gst/farsight/fs-element-added-notifier.h>
-
#include "empathy-call-handler.h"
#include "empathy-dispatcher.h"
#include "empathy-marshal.h"
@@ -65,7 +63,6 @@ typedef struct {
TfChannel *tfchannel;
gboolean initial_audio;
gboolean initial_video;
- FsElementAddedNotifier *fsnotifier;
} EmpathyCallHandlerPriv;
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCallHandler)
@@ -98,12 +95,6 @@ empathy_call_handler_dispose (GObject *object)
priv->call = NULL;
- if (priv->fsnotifier != NULL)
- {
- g_object_unref (priv->fsnotifier);
- }
- priv->fsnotifier = NULL;
-
/* release any references held by the object here */
if (G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose)
G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose (object);
@@ -322,49 +313,10 @@ empathy_call_handler_bus_message (EmpathyCallHandler *handler,
}
static void
-conference_element_added (FsElementAddedNotifier *notifier,
- GstBin *bin,
- GstElement *element,
- gpointer user_data)
-{
- GstElementFactory *factory;
- const gchar *name;
-
- factory = gst_element_get_factory (element);
- name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory));
-
- if (!tp_strdiff (name, "x264enc"))
- {
- /* Ensure that the encoder creates the baseline profile */
- g_object_set (element,
- "byte-stream", TRUE,
- "bframes", 0,
- "b-adapt", FALSE,
- "cabac", FALSE,
- "dct8x8", FALSE,
- NULL);
- }
- else if (!tp_strdiff (name, "gstrtpbin"))
- {
- /* Lower the jitterbuffer latency to make it more suitable for video
- * conferencing */
- g_object_set (element, "latency", 100, NULL);
- }
-}
-
-static void
empathy_call_handler_tf_channel_session_created_cb (TfChannel *tfchannel,
FsConference *conference, FsParticipant *participant,
EmpathyCallHandler *self)
{
- EmpathyCallHandlerPriv *priv = GET_PRIV (self);
-
- priv->fsnotifier = fs_element_added_notifier_new ();
- fs_element_added_notifier_add (priv->fsnotifier, GST_BIN (conference));
-
- g_signal_connect (priv->fsnotifier, "element-added",
- G_CALLBACK (conference_element_added), NULL);
-
g_signal_emit (G_OBJECT (self), signals[CONFERENCE_ADDED], 0,
GST_ELEMENT (conference));
}
@@ -427,53 +379,24 @@ empathy_call_handler_tf_channel_closed_cb (TfChannel *tfchannel,
}
static GList *
-empathy_call_handler_tf_channel_codec_config_get_defaults (FsCodec *codecs)
-{
- GList *l = NULL;
- int i;
-
- for (i = 0; codecs[i].encoding_name != NULL; i++)
- l = g_list_append (l, fs_codec_copy (codecs + i));
-
- return l;
-}
-
-static GList *
empathy_call_handler_tf_channel_codec_config_cb (TfChannel *channel,
guint stream_id, FsMediaType media_type, guint direction, gpointer user_data)
{
- FsCodec audio_codecs[] = {
- { FS_CODEC_ID_ANY, "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000, },
- { FS_CODEC_ID_ANY, "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000, },
-
- { FS_CODEC_ID_DISABLE, "DV", FS_MEDIA_TYPE_AUDIO, },
- { FS_CODEC_ID_DISABLE, "MPA", FS_MEDIA_TYPE_AUDIO, },
- { FS_CODEC_ID_DISABLE, "VORBIS", FS_MEDIA_TYPE_AUDIO, },
- { FS_CODEC_ID_DISABLE, "MP3", FS_MEDIA_TYPE_AUDIO, },
- { 0, NULL, 0,}
- };
- FsCodec video_codecs[] = {
- { FS_CODEC_ID_ANY, "H264", FS_MEDIA_TYPE_VIDEO, },
- { FS_CODEC_ID_ANY, "THEORA", FS_MEDIA_TYPE_VIDEO, },
- { FS_CODEC_ID_ANY, "H263", FS_MEDIA_TYPE_VIDEO, },
-
- { FS_CODEC_ID_DISABLE, "DV", FS_MEDIA_TYPE_VIDEO, },
- { FS_CODEC_ID_DISABLE, "JPEG", FS_MEDIA_TYPE_VIDEO, },
- { FS_CODEC_ID_DISABLE, "MPV", FS_MEDIA_TYPE_VIDEO, },
- { 0, NULL, 0}
- };
-
- switch (media_type)
+ gchar *filename = empathy_file_lookup ("codec-preferences", "data");
+ GList *codecs;
+ GError *error = NULL;
+
+ codecs = fs_codec_list_from_keyfile (filename, &error);
+ g_free (filename);
+
+ if (!codecs)
{
- case FS_MEDIA_TYPE_AUDIO:
- return empathy_call_handler_tf_channel_codec_config_get_defaults
- (audio_codecs);
- case FS_MEDIA_TYPE_VIDEO:
- return empathy_call_handler_tf_channel_codec_config_get_defaults
- (video_codecs);
+ g_warning ("No codec-preferences file: %s",
+ error ? error->message : "No error message");
}
+ g_clear_error (&error);
- return NULL;
+ return codecs;
}
static void
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index bd958aada..f3219d483 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -31,6 +31,8 @@
#include <telepathy-farsight/channel.h>
+#include <gst/farsight/fs-element-added-notifier.h>
+
#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-call-factory.h>
#include <libempathy/empathy-utils.h>
@@ -153,6 +155,8 @@ struct _EmpathyCallWindowPriv
GstElement *funnel;
GstElement *liveadder;
+ FsElementAddedNotifier *fsnotifier;
+
guint context_id;
GTimer *timer;
@@ -678,6 +682,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
GtkWidget *page;
GstBus *bus;
gchar *filename;
+ GKeyFile *keyfile;
+ GError *error = NULL;
filename = empathy_file_lookup ("empathy-call-window.ui", "src");
gui = empathy_builder_get_file (filename,
@@ -694,6 +700,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
"ui_manager", &priv->ui_manager,
"menufullscreen", &priv->menu_fullscreen,
NULL);
+ g_free (filename);
empathy_builder_connect (gui, self,
"menuhangup", "activate", empathy_call_window_hangup_cb,
@@ -722,6 +729,25 @@ empathy_call_window_init (EmpathyCallWindow *self)
bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline));
gst_bus_add_watch (bus, empathy_call_window_bus_message, self);
+ priv->fsnotifier = fs_element_added_notifier_new ();
+ fs_element_added_notifier_add (priv->fsnotifier, GST_BIN (priv->pipeline));
+
+ keyfile = g_key_file_new ();
+ filename = empathy_file_lookup ("element-properties", "data");
+ if (g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_NONE, &error))
+ {
+ fs_element_added_notifier_set_properties_from_keyfile (priv->fsnotifier,
+ keyfile);
+ }
+ else
+ {
+ g_warning ("Could not load element-properties file: %s", error->message);
+ g_key_file_free (keyfile);
+ g_clear_error (&error);
+ }
+ g_free (filename);
+
+
priv->remote_user_output_frame = gtk_frame_new (NULL);
gtk_widget_set_size_request (priv->remote_user_output_frame,
EMPATHY_VIDEO_WIDGET_DEFAULT_WIDTH, EMPATHY_VIDEO_WIDGET_DEFAULT_HEIGHT);
@@ -800,7 +826,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
g_object_ref (priv->ui_manager);
g_object_unref (gui);
- g_free (filename);
}
/* Instead of specifying a width and a height, we specify only one size. That's
@@ -1064,6 +1089,10 @@ empathy_call_window_dispose (GObject *object)
g_object_unref (priv->video_tee);
priv->video_tee = NULL;
+ if (priv->fsnotifier != NULL)
+ g_object_unref (priv->fsnotifier);
+ priv->fsnotifier = NULL;
+
if (priv->timer_id != 0)
g_source_remove (priv->timer_id);
priv->timer_id = 0;