pidgin: 05021ad0: Allow setting properties on GStreamer el...
maiku at soc.pidgin.im
maiku at soc.pidgin.im
Tue Aug 4 22:20:47 EDT 2009
-----------------------------------------------------------------
Revision: 05021ad048bde89b469369cfaa19752f347171b0
Ancestor: f2a545adb2d67a5ba3dce2abedf68c392cc815e1
Author: maiku at soc.pidgin.im
Date: 2009-08-05T01:58:02
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/05021ad048bde89b469369cfaa19752f347171b0
Modified files:
libpurple/mediamanager.c
ChangeLog:
Allow setting properties on GStreamer elements with fs-element.conf.
-------------- next part --------------
============================================================
--- libpurple/mediamanager.c 1d55fd9e6e4068c2343d62595b03f26663215867
+++ libpurple/mediamanager.c 0a13254e42d9954a5dfa01f54e40420550934480
@@ -39,6 +39,7 @@
#ifdef USE_VV
#include <gst/farsight/fs-conference-iface.h>
+#include <gst/farsight/fs-element-added-notifier.h>
#include <gst/interfaces/xoverlay.h>
/** @copydoc _PurpleMediaManagerPrivate */
@@ -229,6 +230,9 @@ purple_media_manager_get_pipeline(Purple
g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
if (manager->priv->pipeline == NULL) {
+ gchar *filename;
+ GError *err = NULL;
+ GKeyFile *keyfile;
GstBus *bus;
manager->priv->pipeline = gst_pipeline_new(NULL);
@@ -241,6 +245,33 @@ purple_media_manager_get_pipeline(Purple
gst_bus_sync_signal_handler, NULL);
gst_object_unref(bus);
+ filename = g_build_filename(purple_user_dir(),
+ "fs-element.conf", NULL);
+ keyfile = g_key_file_new();
+ if (g_key_file_load_from_file(keyfile, filename,
+ G_KEY_FILE_NONE, &err)) {
+ FsElementAddedNotifier *notifier =
+ fs_element_added_notifier_new();
+ fs_element_added_notifier_add(notifier,
+ GST_BIN(manager->priv->pipeline));
+ fs_element_added_notifier_set_properties_from_keyfile(
+ notifier, keyfile);
+ } else {
+ if (err->code == 4)
+ purple_debug_info("mediamanager",
+ "Couldn't read "
+ "fs-element.conf: %s\n",
+ err->message);
+ else
+ purple_debug_error("mediamanager",
+ "Error reading "
+ "fs-element.conf: %s\n",
+ err->message);
+ g_error_free(err);
+ g_key_file_free(keyfile);
+ }
+ g_free(filename);
+
gst_element_set_state(manager->priv->pipeline,
GST_STATE_PLAYING);
}
More information about the Commits
mailing list