FsElementAddedNotifier: Farstream Reference Manual

## FsElementAddedNotifier FsElementAddedNotifier — Recursive element addition notifier |

## Functions

FsElementAddedNotifier * | fs_element_added_notifier_new ()
void | fs_element_added_notifier_add ()
gboolean | fs_element_added_notifier_remove ()
gulong | fs_element_added_notifier_set_properties_from_keyfile ()
gboolean | fs_element_added_notifier_set_properties_from_file ()
gulong | fs_element_added_notifier_set_default_properties ()

## Signals

void | element-added | Run Last

## Types and Values

struct | FsElementAddedNotifier

## Object Hierarchy

        GObject
        ╰── FsElementAddedNotifier

## Includes

    #include <farstream/fs-element-added-notifier.h>

## Description

This object can be attach to any GstBin and will emit a the “element-added” signal for every element inside the GstBin or any sub-bin and any element added in the future to the bin or its sub-bins. There is also a utility method to have it used to set the properties of elements based on a GKeyfile.

## Functions

### fs_element_added_notifier_new ()

    FsElementAddedNotifier *
    fs_element_added_notifier_new (void);

Creates a new FsElementAddedNotifier object

#### Returns

the newly-created FsElementAddedNotifier

### fs_element_added_notifier_add ()

    void
    fs_element_added_notifier_add (FsElementAddedNotifier *notifier,
                                   GstBin *bin);

Add a GstBin to on which the “element-added” signal will be called on every element and sub-element present and added in the future.

#### Parameters

notifier | a FsElementAddedNotifier |
bin | A GstBin to watch to added elements |

### fs_element_added_notifier_remove ()

    gboolean
    fs_element_added_notifier_remove (FsElementAddedNotifier *notifier,
                                      GstBin *bin);

Stop watching the passed bin and its subbins.

#### Parameters

notifier | a FsElementAddedNotifier |
bin | A GstBin to stop watching |

#### Returns

`TRUE` if the GstBin was being watched, `FALSE` otherwise

### fs_element_added_notifier_set_properties_from_keyfile ()

    gulong
    fs_element_added_notifier_set_properties_from_keyfile
                                   (FsElementAddedNotifier *notifier,
                                    GKeyFile *keyfile);

Using a GKeyFile where the groups are the element's type or name and the key=value are the property and its value, this function will set the properties on the elements added to this object after 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.

#### Parameters

notifier | a FsElementAddedNotifier |
keyfile | a GKeyFile. | [transfer full]

#### Returns

The id of the signal connection, this can be used to disconnect this property setter using `g_signal_handler_disconnect()`.

### fs_element_added_notifier_set_properties_from_file ()

    gboolean
    fs_element_added_notifier_set_properties_from_file
                                   (FsElementAddedNotifier *notifier,
                                    const gchar *filename,
                                    GError **error);

Same as `fs_element_added_notifier_set_properties_from_keyfile()` but using the name of the file to load instead of the GKeyFile directly.

#### Parameters

notifier | a FsElementAddedNotifier |
filename | The name of the keyfile to use |
error | location of a GError, or `NULL` if no error occured |

#### Returns

`TRUE` if the file was successfully loaded, `FALSE` otherwise

### fs_element_added_notifier_set_default_properties ()

    gulong
    fs_element_added_notifier_set_default_properties
                                   (FsElementAddedNotifier *notifier,
                                    GstElement *element);

Same as first calling `fs_utils_get_default_element_properties()` and using the result with `fs_element_added_notifier_set_properties_from_keyfile()` .

This is binding friendly (since GKeyFile doesn't have a boxed type).

#### Parameters

notifier | a FsElementAddedNotifier |
element | Element for which to set the default codec preferences |

#### Returns

The id of the signal connection, this can be used to disconnect this property setter using `g_signal_handler_disconnect()`.

## Types and Values

### struct FsElementAddedNotifier

    struct FsElementAddedNotifier;

All members are private

## Signal Details

### The `“element-added”` signal

    void
    user_function (FsElementAddedNotifier *self,
                   GstBin                 *bin,
                   GstElement             *element,
                   gpointer                user_data)

This signal is emitted when an element is added to a GstBin that was added to this object or one of its sub-bins. Be careful, there is no guarantee that this will be emitted on your main thread, it will be emitted in the thread that added the element. The bin may be `NULL` if this is the top-level bin.

#### Parameters

self | FsElementAddedNotifier that emitted the signal |
bin | The GstBin to which this object was added |
element | The GstElement that was added |
user_data | user data set when the signal handler was connected. |

Flags: Run Last