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:
Rafał Dzięgiel
2024-05-02 20:54:23 +02:00
parent 6941f1b042
commit 6edffb9a4b
4 changed files with 72 additions and 2 deletions

View File

@@ -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);
}