mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
clapper-app: Add command line options to set GStreamer elements
Allows setting audio/video filters and sinks. By setting value to "none" default filter can be disabled.
This commit is contained in:
@@ -324,3 +324,29 @@ parse_overrides:
|
||||
|
||||
g_free (stored_overrides);
|
||||
}
|
||||
|
||||
GstElement *
|
||||
clapper_app_utils_make_element (const gchar *string)
|
||||
{
|
||||
gchar *char_loc;
|
||||
|
||||
if (strcmp (string, "none") == 0)
|
||||
return NULL;
|
||||
|
||||
char_loc = strchr (string, ' ');
|
||||
|
||||
if (char_loc) {
|
||||
GstElement *element;
|
||||
GError *error = NULL;
|
||||
|
||||
element = gst_parse_bin_from_description (string, TRUE, &error);
|
||||
if (error) {
|
||||
GST_ERROR ("Bin parse error: \"%s\", reason: %s", string, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
return gst_element_factory_make (string, NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user