summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-04-27 16:39:07 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2012-10-02 13:35:17 -0400
commit3901964fa0696305a548191cf568eca05a4aec15 (patch)
treebf8c7d2abc627346d29afda3cda1f6c4a9e59896
parent44b935ca4b889816a004e413f95bdaa0b4c7156f (diff)
downloadfarstream-3901964fa0696305a548191cf568eca05a4aec15.tar.gz
elementaddednotifier: Return the signal ID when adding from a keyfile
-rw-r--r--farstream/fs-element-added-notifier.c11
-rw-r--r--farstream/fs-element-added-notifier.h2
-rw-r--r--tests/check/utils/binadded.c5
3 files changed, 12 insertions, 6 deletions
diff --git a/farstream/fs-element-added-notifier.c b/farstream/fs-element-added-notifier.c
index d4562165..0cf84c72 100644
--- a/farstream/fs-element-added-notifier.c
+++ b/farstream/fs-element-added-notifier.c
@@ -351,16 +351,19 @@ _element_foreach_keyfile (const GValue * item, gpointer user_data)
* this function has been called. It will take ownership of the
* GKeyFile structure. It will first try the group as the element type, if that
* does not match, it will check its name.
+ *
+ * Returns: The id of the signal connection, this can be used to disconnect
+ * this property setter using g_signal_handler_disconnect().
*/
-void
+gulong
fs_element_added_notifier_set_properties_from_keyfile (
FsElementAddedNotifier *notifier,
GKeyFile *keyfile)
{
guint i;
- g_return_if_fail (FS_IS_ELEMENT_ADDED_NOTIFIER (notifier));
- g_return_if_fail (keyfile);
+ g_return_val_if_fail (FS_IS_ELEMENT_ADDED_NOTIFIER (notifier), 0);
+ g_return_val_if_fail (keyfile, 0);
for (i = 0; i < notifier->priv->bins->len; i++)
{
@@ -374,7 +377,7 @@ fs_element_added_notifier_set_properties_from_keyfile (
gst_iterator_free (iter);
}
- g_signal_connect_data (notifier, "element-added",
+ return g_signal_connect_data (notifier, "element-added",
G_CALLBACK (_bin_added_from_keyfile), keyfile,
(GClosureNotify) g_key_file_free, 0);
}
diff --git a/farstream/fs-element-added-notifier.h b/farstream/fs-element-added-notifier.h
index f45e010c..a8ef3155 100644
--- a/farstream/fs-element-added-notifier.h
+++ b/farstream/fs-element-added-notifier.h
@@ -87,7 +87,7 @@ void fs_element_added_notifier_add (FsElementAddedNotifier *notifier,
gboolean fs_element_added_notifier_remove (FsElementAddedNotifier *notifier,
GstBin *bin);
-void fs_element_added_notifier_set_properties_from_keyfile (
+gulong fs_element_added_notifier_set_properties_from_keyfile (
FsElementAddedNotifier *notifier,
GKeyFile *keyfile);
diff --git a/tests/check/utils/binadded.c b/tests/check/utils/binadded.c
index 7950485b..df6a0e62 100644
--- a/tests/check/utils/binadded.c
+++ b/tests/check/utils/binadded.c
@@ -242,13 +242,16 @@ GST_START_TEST (test_bin_keyfile)
{
GKeyFile *keyfile = g_key_file_new ();
FsElementAddedNotifier *notifier = NULL;
+ gulong ret;
g_key_file_set_boolean (keyfile, "identity", "sync", TRUE);
g_key_file_set_boolean (keyfile, "identity", "invalid-property", TRUE);
notifier = fs_element_added_notifier_new ();
- fs_element_added_notifier_set_properties_from_keyfile (notifier, keyfile);
+ ret = fs_element_added_notifier_set_properties_from_keyfile (notifier,
+ keyfile);
+ fail_if (ret == 0);
test_keyfile (notifier);
}