mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 17:05:52 +00:00
ges: Add a method to pass argc/argv to GES at init time
Allowing user to set configuration actions without using the GES GOptionGroup https://bugzilla.gnome.org/show_bug.cgi?id=740717
This commit is contained in:
parent
ac3cad47b6
commit
e5b57db7a2
2 changed files with 43 additions and 0 deletions
42
ges/ges.c
42
ges/ges.c
|
@ -204,3 +204,45 @@ ges_version (guint * major, guint * minor, guint * micro, guint * nano)
|
|||
*micro = GES_VERSION_MICRO;
|
||||
*nano = GES_VERSION_NANO;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_init_check:
|
||||
* @argc: (inout) (allow-none): pointer to application's argc
|
||||
* @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
|
||||
* @err: pointer to a #GError to which a message will be posted on error
|
||||
*
|
||||
* Initializes the GStreamer Editing Services library, setting up internal path lists,
|
||||
* and loading evrything needed.
|
||||
*
|
||||
* This function will return %FALSE if GES could not be initialized
|
||||
* for some reason.
|
||||
*
|
||||
* Returns: %TRUE if GES could be initialized.
|
||||
*/
|
||||
gboolean
|
||||
ges_init_check (int *argc, char **argv[], GError ** err)
|
||||
{
|
||||
#ifndef GST_DISABLE_OPTION_PARSING
|
||||
GOptionGroup *group;
|
||||
GOptionContext *ctx;
|
||||
#endif
|
||||
gboolean res;
|
||||
|
||||
if (ges_initialized) {
|
||||
GST_DEBUG ("already initialized ges");
|
||||
return TRUE;
|
||||
}
|
||||
#ifndef GST_DISABLE_OPTION_PARSING
|
||||
ctx = g_option_context_new ("- GStreamer Editing Services initialization");
|
||||
g_option_context_set_ignore_unknown_options (ctx, TRUE);
|
||||
g_option_context_set_help_enabled (ctx, FALSE);
|
||||
group = ges_init_get_option_group ();
|
||||
g_option_context_add_group (ctx, group);
|
||||
res = g_option_context_parse (ctx, argc, argv, err);
|
||||
g_option_context_free (ctx);
|
||||
#endif
|
||||
if (!res)
|
||||
return res;
|
||||
|
||||
return ges_init ();
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ G_BEGIN_DECLS
|
|||
|
||||
|
||||
gboolean ges_init (void);
|
||||
gboolean ges_init_check (int *argc, char **argv[], GError ** err);
|
||||
void ges_version (guint * major, guint * minor, guint * micro,
|
||||
guint * nano);
|
||||
GOptionGroup *
|
||||
|
|
Loading…
Reference in a new issue