aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-07-10 22:41:27 +0800
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-08-07 01:24:40 +0800
commita885bc90fd4c27676090a59bb615b14258ff8579 (patch)
tree063db3c68744f97da574066dc88982048459dd40
parentb1642e68a321a80d7557863409455375906c14ba (diff)
downloadgsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.tar
gsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.tar.gz
gsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.tar.bz2
gsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.tar.lz
gsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.tar.xz
gsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.tar.zst
gsoc2013-empathy-a885bc90fd4c27676090a59bb615b14258ff8579.zip
Make it possible to set element properties from a config file
-rw-r--r--data/Makefile.am3
-rw-r--r--data/element-properties17
-rw-r--r--libempathy/empathy-call-handler.c50
3 files changed, 36 insertions, 34 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 94737140f..81ca5a7b9 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -32,7 +32,8 @@ schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
streamingprefsdir = $(datadir)/empathy
streamingprefs_DATA = \
- codec-preferences
+ codec-preferences \
+ element-properties
if GCONF_SCHEMAS_INSTALL
install-data-local:
diff --git a/data/element-properties b/data/element-properties
new file mode 100644
index 000000000..e8bd9c084
--- /dev/null
+++ b/data/element-properties
@@ -0,0 +1,17 @@
+# 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
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c
index 4565ec10b..09ea5a179 100644
--- a/libempathy/empathy-call-handler.c
+++ b/libempathy/empathy-call-handler.c
@@ -322,48 +322,32 @@ 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);
+ GKeyFile *keyfile;
+ gchar *filename;
+ GError *error = NULL;
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);
+ 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);
g_signal_emit (G_OBJECT (self), signals[CONFERENCE_ADDED], 0,
GST_ELEMENT (conference));