2009-08-06 09:23:01 +00:00
|
|
|
/* GStreamer Editing Services
|
2009-11-30 14:14:25 +00:00
|
|
|
* Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
|
|
|
|
* 2009 Nokia Corporation
|
2009-08-06 09:23:01 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-04 00:25:20 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2009-08-06 09:23:01 +00:00
|
|
|
*/
|
|
|
|
|
2018-10-22 09:39:03 +00:00
|
|
|
/**
|
|
|
|
* SECTION: ges.h
|
|
|
|
* @title: Initialization
|
|
|
|
* @short_description: GStreamer editing services initialization functions
|
|
|
|
*
|
|
|
|
* GES needs to be initialized after GStreamer itself. This section
|
|
|
|
* contains the various functions to do so.
|
|
|
|
*/
|
2014-11-03 10:14:45 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2009-08-06 09:23:01 +00:00
|
|
|
#include <ges/ges.h>
|
2016-04-13 09:31:05 +00:00
|
|
|
#include "ges/gstframepositioner.h"
|
2019-08-17 15:59:38 +00:00
|
|
|
#include "ges/ges-smart-adder.h"
|
|
|
|
#include "ges/ges-smart-video-mixer.h"
|
2009-08-06 17:51:29 +00:00
|
|
|
#include "ges-internal.h"
|
2009-08-06 09:23:01 +00:00
|
|
|
|
2018-11-30 15:41:04 +00:00
|
|
|
#ifndef DISABLE_XPTV
|
|
|
|
#include <ges/ges-pitivi-formatter.h>
|
|
|
|
#endif
|
|
|
|
|
2014-03-16 11:46:26 +00:00
|
|
|
#define GES_GNONLIN_VERSION_NEEDED_MAJOR 1
|
|
|
|
#define GES_GNONLIN_VERSION_NEEDED_MINOR 2
|
2012-05-01 17:48:57 +00:00
|
|
|
#define GES_GNONLIN_VERSION_NEEDED_MICRO 0
|
2011-02-07 12:19:18 +00:00
|
|
|
|
2019-10-01 15:02:27 +00:00
|
|
|
GST_DEBUG_CATEGORY (_ges_debug_category);
|
2009-08-06 09:23:01 +00:00
|
|
|
|
2019-01-12 10:57:37 +00:00
|
|
|
G_LOCK_DEFINE_STATIC (init_lock);
|
2009-09-10 16:40:51 +00:00
|
|
|
|
2019-01-28 11:45:11 +00:00
|
|
|
/* (without holding ref) thread object for thread_self() validation
|
|
|
|
* between init/deinit
|
|
|
|
*/
|
|
|
|
static GThread *initialized_thread = NULL;
|
2016-03-30 07:26:18 +00:00
|
|
|
|
2019-10-01 15:02:27 +00:00
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
static gpointer
|
|
|
|
init_debug_category (gpointer data)
|
|
|
|
{
|
|
|
|
/* initialize debugging category */
|
|
|
|
GST_DEBUG_CATEGORY_INIT (_ges_debug_category, "ges", GST_DEBUG_FG_YELLOW,
|
|
|
|
"GStreamer Editing Services");
|
|
|
|
|
|
|
|
return _ges_debug_category;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstDebugCategory *
|
|
|
|
_ges_debug (void)
|
|
|
|
{
|
|
|
|
static GOnce my_once = G_ONCE_INIT;
|
|
|
|
|
|
|
|
g_once (&my_once, init_debug_category, NULL);
|
|
|
|
|
|
|
|
return my_once.retval;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
GstDebugCategory *
|
|
|
|
_ges_debug (void)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2016-03-30 07:26:18 +00:00
|
|
|
static gboolean
|
|
|
|
ges_init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|
|
|
GError ** error)
|
2009-08-06 09:23:01 +00:00
|
|
|
{
|
2019-01-28 11:45:11 +00:00
|
|
|
if (initialized_thread) {
|
2019-01-12 10:57:37 +00:00
|
|
|
GST_DEBUG ("already initialized");
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-03-30 07:26:18 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
ges_init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|
|
|
GError ** error)
|
|
|
|
{
|
2016-11-15 18:09:10 +00:00
|
|
|
GESUriClipAssetClass *uriasset_klass = NULL;
|
2018-08-03 18:02:58 +00:00
|
|
|
GstElementFactory *nlecomposition_factory = NULL;
|
2019-08-22 16:50:00 +00:00
|
|
|
static GstValueTable gstvtable = {
|
|
|
|
G_TYPE_NONE,
|
|
|
|
(GstValueCompareFunc) NULL,
|
|
|
|
(GstValueSerializeFunc) ges_marker_list_serialize,
|
|
|
|
(GstValueDeserializeFunc) ges_marker_list_deserialize
|
|
|
|
};
|
|
|
|
static gboolean marker_list_registered = FALSE;
|
2016-11-15 18:09:10 +00:00
|
|
|
|
2019-01-28 11:45:11 +00:00
|
|
|
if (initialized_thread) {
|
2012-11-27 15:53:14 +00:00
|
|
|
GST_DEBUG ("already initialized ges");
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-11-15 18:09:10 +00:00
|
|
|
uriasset_klass = g_type_class_ref (GES_TYPE_URI_CLIP_ASSET);
|
2019-01-28 08:12:54 +00:00
|
|
|
|
2019-07-04 19:58:44 +00:00
|
|
|
_init_formatter_assets ();
|
2019-01-28 08:12:54 +00:00
|
|
|
if (!_ges_uri_asset_ensure_setup (uriasset_klass)) {
|
|
|
|
GST_ERROR ("cannot setup uri asset");
|
2020-10-29 13:30:52 +00:00
|
|
|
if (error)
|
|
|
|
*error = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN,
|
|
|
|
"Cannot initialize URI asset class.");
|
2019-01-28 08:12:54 +00:00
|
|
|
goto failed;
|
2019-01-28 07:34:15 +00:00
|
|
|
}
|
2016-11-15 18:09:10 +00:00
|
|
|
|
2018-08-03 18:02:58 +00:00
|
|
|
nlecomposition_factory = gst_element_factory_find ("nlecomposition");
|
|
|
|
if (!nlecomposition_factory) {
|
|
|
|
GST_ERROR ("The `nlecomposition` object was not found.");
|
|
|
|
if (error)
|
|
|
|
*error = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN,
|
|
|
|
"The `nle` plugin is missing.");
|
|
|
|
|
|
|
|
goto failed;
|
|
|
|
}
|
|
|
|
gst_object_unref (nlecomposition_factory);
|
|
|
|
|
2013-02-08 20:11:22 +00:00
|
|
|
/* register clip classes with the system */
|
2010-09-23 13:49:04 +00:00
|
|
|
|
2017-07-11 01:42:21 +00:00
|
|
|
g_type_class_ref (GES_TYPE_TEST_CLIP);
|
|
|
|
g_type_class_ref (GES_TYPE_URI_CLIP);
|
|
|
|
g_type_class_ref (GES_TYPE_TITLE_CLIP);
|
|
|
|
g_type_class_ref (GES_TYPE_TRANSITION_CLIP);
|
|
|
|
g_type_class_ref (GES_TYPE_OVERLAY_CLIP);
|
|
|
|
g_type_class_ref (GES_TYPE_OVERLAY_TEXT_CLIP);
|
2019-08-17 15:59:38 +00:00
|
|
|
g_type_class_ref (GES_TYPE_EFFECT_CLIP);
|
2010-09-23 13:49:04 +00:00
|
|
|
|
2017-07-11 01:42:21 +00:00
|
|
|
g_type_class_ref (GES_TYPE_GROUP);
|
2013-06-26 21:08:57 +00:00
|
|
|
|
2013-02-08 19:39:18 +00:00
|
|
|
/* Register track elements */
|
2017-07-11 01:42:21 +00:00
|
|
|
g_type_class_ref (GES_TYPE_EFFECT);
|
2012-09-23 00:05:42 +00:00
|
|
|
|
2012-09-10 00:15:17 +00:00
|
|
|
ges_asset_cache_init ();
|
|
|
|
|
2019-08-17 15:59:38 +00:00
|
|
|
gst_element_register (NULL, "gesaudiomixer", 0, GES_TYPE_SMART_ADDER);
|
|
|
|
gst_element_register (NULL, "gescompositor", 0, GES_TYPE_SMART_MIXER);
|
2016-04-13 09:31:05 +00:00
|
|
|
gst_element_register (NULL, "framepositioner", 0, GST_TYPE_FRAME_POSITIONNER);
|
2013-09-09 15:47:32 +00:00
|
|
|
gst_element_register (NULL, "gespipeline", 0, GES_TYPE_PIPELINE);
|
2013-06-03 21:02:15 +00:00
|
|
|
|
2010-09-23 13:49:04 +00:00
|
|
|
/* TODO: user-defined types? */
|
2019-01-28 11:45:11 +00:00
|
|
|
initialized_thread = g_thread_self ();
|
2016-11-15 18:09:10 +00:00
|
|
|
g_type_class_unref (uriasset_klass);
|
2010-09-23 13:49:04 +00:00
|
|
|
|
2019-08-22 16:50:00 +00:00
|
|
|
if (!marker_list_registered) {
|
|
|
|
gstvtable.type = GES_TYPE_MARKER_LIST;
|
|
|
|
gst_value_register (&gstvtable);
|
|
|
|
marker_list_registered = TRUE;
|
|
|
|
}
|
|
|
|
|
2009-08-07 14:46:35 +00:00
|
|
|
GST_DEBUG ("GStreamer Editing Services initialized");
|
2011-02-07 12:19:18 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2016-11-15 18:09:10 +00:00
|
|
|
|
|
|
|
failed:
|
|
|
|
if (uriasset_klass)
|
|
|
|
g_type_class_unref (uriasset_klass);
|
|
|
|
|
|
|
|
GST_ERROR ("Could not initialize GES.");
|
|
|
|
|
|
|
|
return FALSE;
|
2009-08-06 09:23:01 +00:00
|
|
|
}
|
2011-12-26 01:54:29 +00:00
|
|
|
|
2016-03-30 07:26:18 +00:00
|
|
|
/**
|
|
|
|
* ges_init:
|
|
|
|
*
|
|
|
|
* Initialize the GStreamer Editing Service. Call this before any usage of
|
|
|
|
* GES. You should take care of initilizing GStreamer before calling this
|
|
|
|
* function.
|
2019-01-28 11:45:11 +00:00
|
|
|
*
|
|
|
|
* MT safety.
|
|
|
|
* GStreamer Editing Services do not guarantee MT safety.
|
|
|
|
* An application is required to use GES APIs (including ges_deinit())
|
|
|
|
* in the thread where ges_init() was called.
|
2016-03-30 07:26:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
ges_init (void)
|
|
|
|
{
|
2019-01-12 10:57:37 +00:00
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
G_LOCK (init_lock);
|
2016-03-30 07:26:18 +00:00
|
|
|
ges_init_pre (NULL, NULL, NULL, NULL);
|
|
|
|
|
2019-01-12 10:57:37 +00:00
|
|
|
ret = ges_init_post (NULL, NULL, NULL, NULL);
|
|
|
|
G_UNLOCK (init_lock);
|
|
|
|
|
|
|
|
return ret;
|
2016-03-30 07:26:18 +00:00
|
|
|
}
|
|
|
|
|
2017-02-06 11:07:26 +00:00
|
|
|
/**
|
|
|
|
* ges_deinit:
|
|
|
|
*
|
|
|
|
* Clean up any resources created by GES in ges_init().
|
|
|
|
*
|
|
|
|
* It is normally not needed to call this function in a normal application as the
|
|
|
|
* resources will automatically be freed when the program terminates.
|
|
|
|
* This function is therefore mostly used by testsuites and other memory profiling tools.
|
2019-01-28 11:45:11 +00:00
|
|
|
* This function should be called from the thread where ges_init() was called.
|
2017-02-06 11:07:26 +00:00
|
|
|
*
|
2019-01-28 11:45:11 +00:00
|
|
|
* After this call GES should not be used until another ges_init() call.
|
2017-02-06 11:07:26 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
ges_deinit (void)
|
|
|
|
{
|
2019-01-12 10:57:37 +00:00
|
|
|
G_LOCK (init_lock);
|
|
|
|
|
|
|
|
GST_INFO ("deinitializing GES");
|
|
|
|
|
2019-01-28 11:45:11 +00:00
|
|
|
if (!initialized_thread) {
|
2019-01-28 02:07:36 +00:00
|
|
|
GST_DEBUG ("nothing to deinitialize");
|
2019-01-12 10:57:37 +00:00
|
|
|
G_UNLOCK (init_lock);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-01-28 11:45:11 +00:00
|
|
|
/* Allow deinit only from a thread where ges_init() was called */
|
|
|
|
g_assert (initialized_thread == g_thread_self ());
|
|
|
|
|
2017-02-06 11:07:26 +00:00
|
|
|
_ges_uri_asset_cleanup ();
|
2017-07-11 01:42:21 +00:00
|
|
|
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_TEST_CLIP));
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_URI_CLIP));
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_TITLE_CLIP));
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_TRANSITION_CLIP));
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_OVERLAY_CLIP));
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_OVERLAY_TEXT_CLIP));
|
2019-08-17 15:59:38 +00:00
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_EFFECT_CLIP));
|
2017-07-11 01:42:21 +00:00
|
|
|
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_GROUP));
|
|
|
|
/* Register track elements */
|
|
|
|
g_type_class_unref (g_type_class_peek (GES_TYPE_EFFECT));
|
2019-01-12 10:57:37 +00:00
|
|
|
|
2019-01-12 11:23:50 +00:00
|
|
|
ges_asset_cache_deinit ();
|
2019-07-08 00:55:53 +00:00
|
|
|
ges_xml_formatter_deinit ();
|
2019-01-12 11:23:50 +00:00
|
|
|
|
2019-01-28 11:45:11 +00:00
|
|
|
initialized_thread = NULL;
|
2019-01-12 10:57:37 +00:00
|
|
|
G_UNLOCK (init_lock);
|
|
|
|
|
|
|
|
GST_INFO ("deinitialized GES");
|
|
|
|
|
|
|
|
return;
|
2017-02-06 11:07:26 +00:00
|
|
|
}
|
|
|
|
|
2014-11-03 10:14:45 +00:00
|
|
|
#ifndef GST_DISABLE_OPTION_PARSING
|
|
|
|
static gboolean
|
|
|
|
parse_goption_arg (const gchar * s_opt,
|
|
|
|
const gchar * arg, gpointer data, GError ** err)
|
|
|
|
{
|
|
|
|
if (g_strcmp0 (s_opt, "--ges-version") == 0) {
|
2021-04-27 15:57:35 +00:00
|
|
|
gst_print ("GStreamer Editing Services version %s\n", PACKAGE_VERSION);
|
2014-11-03 10:14:45 +00:00
|
|
|
exit (0);
|
2014-11-03 11:18:35 +00:00
|
|
|
} else if (g_strcmp0 (s_opt, "--ges-sample-paths") == 0) {
|
|
|
|
ges_add_missing_uri_relocation_uri (arg, FALSE);
|
|
|
|
} else if (g_strcmp0 (s_opt, "--ges-sample-path-recurse") == 0) {
|
|
|
|
ges_add_missing_uri_relocation_uri (arg, TRUE);
|
2014-11-03 10:14:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ges_init_get_option_group: (skip)
|
|
|
|
*
|
|
|
|
* Returns a #GOptionGroup with GES's argument specifications. The
|
|
|
|
* group is set up to use standard GOption callbacks, so when using this
|
|
|
|
* group in combination with GOption parsing methods, all argument parsing
|
|
|
|
* and initialization is automated.
|
|
|
|
*
|
|
|
|
* This function is useful if you want to integrate GES with other
|
|
|
|
* libraries that use GOption (see g_option_context_add_group() ).
|
|
|
|
*
|
|
|
|
* If you use this function, you should make sure you initialise the GStreamer
|
2016-03-30 07:26:18 +00:00
|
|
|
* as one of the very first things in your program. That means you need to
|
|
|
|
* use gst_init_get_option_group() and add it to the option context before
|
|
|
|
* using the ges_init_get_option_group() result.
|
2014-11-03 10:14:45 +00:00
|
|
|
*
|
|
|
|
* Returns: (transfer full): a pointer to GES's option group.
|
|
|
|
*/
|
|
|
|
GOptionGroup *
|
|
|
|
ges_init_get_option_group (void)
|
|
|
|
{
|
|
|
|
#ifndef GST_DISABLE_OPTION_PARSING
|
|
|
|
|
|
|
|
GOptionGroup *group;
|
|
|
|
static const GOptionEntry ges_args[] = {
|
|
|
|
{"ges-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
|
|
|
|
(gpointer) parse_goption_arg,
|
|
|
|
"Print the GStreamer Editing Services version",
|
|
|
|
NULL},
|
2014-11-03 11:18:35 +00:00
|
|
|
{"ges-sample-paths", 0, 0, G_OPTION_ARG_CALLBACK,
|
|
|
|
(gpointer) parse_goption_arg,
|
2014-11-03 10:51:51 +00:00
|
|
|
"List of pathes to look assets in if they were moved"},
|
2014-11-03 11:18:35 +00:00
|
|
|
{"ges-sample-path-recurse", 0, 0, G_OPTION_ARG_CALLBACK,
|
|
|
|
(gpointer) parse_goption_arg,
|
2014-11-03 10:51:51 +00:00
|
|
|
"Same as above, but recursing into the folder"},
|
2014-11-03 10:14:45 +00:00
|
|
|
{NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
group = g_option_group_new ("GES", "GStreamer Editing Services Options",
|
2016-12-13 14:10:26 +00:00
|
|
|
"Show GES Options", NULL, NULL);
|
2016-03-30 07:26:18 +00:00
|
|
|
g_option_group_set_parse_hooks (group, (GOptionParseFunc) ges_init_pre,
|
|
|
|
(GOptionParseFunc) ges_init_post);
|
2014-11-03 10:14:45 +00:00
|
|
|
g_option_group_add_entries (group, ges_args);
|
|
|
|
|
|
|
|
return group;
|
|
|
|
|
|
|
|
#else
|
|
|
|
return NULL;
|
|
|
|
#endif
|
|
|
|
}
|
2011-12-26 01:54:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ges_version:
|
|
|
|
* @major: (out): pointer to a guint to store the major version number
|
|
|
|
* @minor: (out): pointer to a guint to store the minor version number
|
|
|
|
* @micro: (out): pointer to a guint to store the micro version number
|
|
|
|
* @nano: (out): pointer to a guint to store the nano version number
|
|
|
|
*
|
|
|
|
* Gets the version number of the GStreamer Editing Services library.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ges_version (guint * major, guint * minor, guint * micro, guint * nano)
|
|
|
|
{
|
|
|
|
g_return_if_fail (major);
|
|
|
|
g_return_if_fail (minor);
|
|
|
|
g_return_if_fail (micro);
|
|
|
|
g_return_if_fail (nano);
|
|
|
|
|
|
|
|
*major = GES_VERSION_MAJOR;
|
|
|
|
*minor = GES_VERSION_MINOR;
|
|
|
|
*micro = GES_VERSION_MICRO;
|
|
|
|
*nano = GES_VERSION_NANO;
|
|
|
|
}
|
2014-11-03 10:59:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
|
2019-01-12 10:57:37 +00:00
|
|
|
G_LOCK (init_lock);
|
|
|
|
|
2019-01-28 11:45:11 +00:00
|
|
|
if (initialized_thread) {
|
2014-11-03 10:59:32 +00:00
|
|
|
GST_DEBUG ("already initialized ges");
|
2019-01-12 10:57:37 +00:00
|
|
|
G_UNLOCK (init_lock);
|
2014-11-03 10:59:32 +00:00
|
|
|
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
|
2019-01-12 10:57:37 +00:00
|
|
|
|
|
|
|
if (!res) {
|
|
|
|
G_UNLOCK (init_lock);
|
2014-11-03 10:59:32 +00:00
|
|
|
return res;
|
2019-01-12 10:57:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ges_init_pre (NULL, NULL, NULL, NULL);
|
|
|
|
res = ges_init_post (NULL, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
G_UNLOCK (init_lock);
|
2014-11-03 10:59:32 +00:00
|
|
|
|
2019-01-12 10:57:37 +00:00
|
|
|
return res;
|
2014-11-03 10:59:32 +00:00
|
|
|
}
|
2019-01-14 21:30:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ges_is_initialized:
|
|
|
|
*
|
|
|
|
* Use this function to check if GES has been initialized with ges_init()
|
|
|
|
* or ges_init_check().
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if initialization has been done, %FALSE otherwise.
|
2019-05-16 12:06:14 +00:00
|
|
|
*
|
|
|
|
* Since: 1.16
|
2019-01-14 21:30:38 +00:00
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
ges_is_initialized (void)
|
|
|
|
{
|
2019-01-28 11:45:11 +00:00
|
|
|
return initialized_thread ? TRUE : FALSE;
|
2019-01-14 21:30:38 +00:00
|
|
|
}
|