static void
ges_uri_clip_asset_class_init (GESUriClipAssetClass * klass)
{
+ GError *err;
GstClockTime timeout;
const gchar *timeout_str;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
if (errno)
timeout = 60 * GST_SECOND;
- klass->discoverer = gst_discoverer_new (timeout, NULL);
+ klass->discoverer = gst_discoverer_new (timeout, &err);
+ if (!klass->discoverer) {
+ GST_ERROR ("Could not create discoverer: %s", err->message);
+ g_error_free (err);
+ return;
+ }
+
klass->sync_discoverer = gst_discoverer_new (timeout, NULL);
+ if (!klass->sync_discoverer) {
+ GST_ERROR ("Could not create discoverer: %s", err->message);
+ g_error_free (err);
+ return;
+ }
+
g_signal_connect (klass->discoverer, "discovered",
G_CALLBACK (discoverer_discovered_cb), NULL);
ges_init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
GError ** error)
{
+ GESUriClipAssetClass *uriasset_klass = NULL;
+
if (ges_initialized) {
GST_DEBUG ("already initialized ges");
return TRUE;
}
+ uriasset_klass = g_type_class_ref (GES_TYPE_URI_CLIP_ASSET);
+ if (!uriasset_klass->discoverer)
+ goto failed;
+
+ if (!uriasset_klass->sync_discoverer)
+ goto failed;
+
/* register clip classes with the system */
GES_TYPE_TEST_CLIP;
/* TODO: user-defined types? */
ges_initialized = TRUE;
+ g_type_class_unref (uriasset_klass);
GST_DEBUG ("GStreamer Editing Services initialized");
return TRUE;
+
+failed:
+ if (uriasset_klass)
+ g_type_class_unref (uriasset_klass);
+
+ GST_ERROR ("Could not initialize GES.");
+
+ return FALSE;
}
/**
ges_init (void)
{
ges_init_pre (NULL, NULL, NULL, NULL);
- ges_init_post (NULL, NULL, NULL, NULL);
- return TRUE;
+ return ges_init_post (NULL, NULL, NULL, NULL);
}
#ifndef GST_DISABLE_OPTION_PARSING