summaryrefslogtreecommitdiff
path: root/ges
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2014-11-03 12:18:35 +0100
committerThibault Saunier <tsaunier@gnome.org>2014-12-06 10:34:16 +0100
commit3b353be8eac56a14000a534b51bdd749569bcd5f (patch)
tree94f430d2c17ac312add3c8bd9e4e0beaf717c7de /ges
parent1373937b8ef1a937c44dc06e1adfcda58de72bec (diff)
ges: Keep backward compatibility for relocated assets CLI
Meaning adding an API for user to add relacation URI paths API: ges_add_missing_uri_relocation_uri
Diffstat (limited to 'ges')
-rw-r--r--ges/ges-internal.h5
-rw-r--r--ges/ges-project.c18
-rw-r--r--ges/ges-project.h2
-rw-r--r--ges/ges-uri-asset.h2
-rw-r--r--ges/ges.c12
5 files changed, 17 insertions, 22 deletions
diff --git a/ges/ges-internal.h b/ges/ges-internal.h
index 080ec3b0..e9ab737d 100644
--- a/ges/ges-internal.h
+++ b/ges/ges-internal.h
@@ -183,11 +183,6 @@ G_GNUC_INTERNAL gchar * ges_project_try_updating_id (GESProject *s
G_GNUC_INTERNAL void ges_project_add_loading_asset (GESProject *project,
GType extractable_type,
const gchar *id);
-G_GNUC_INTERNAL gboolean ges_add_missing_uri_relocation_path (const gchar * option_name,
- const gchar * value,
- gpointer udata,
- GError ** error);
-
/************************************************
* *
* GESBaseXmlFormatter internal methods *
diff --git a/ges/ges-project.c b/ges/ges-project.c
index 5d7cdc13..8e48954c 100644
--- a/ges/ges-project.c
+++ b/ges/ges-project.c
@@ -287,24 +287,18 @@ done:
gst_object_unref (fenum);
}
-
gboolean
-ges_add_missing_uri_relocation_path (const gchar * option_name,
- const gchar * value, gpointer udata, GError ** error)
+ges_add_missing_uri_relocation_uri (const gchar * uri, gboolean recurse)
{
- g_return_val_if_fail (gst_uri_is_valid (value), FALSE);
+ g_return_val_if_fail (gst_uri_is_valid (uri), FALSE);
if (new_paths == NULL)
new_paths = g_ptr_array_new_with_free_func (g_free);
- g_print ("\n\nOption name %s\n\n", option_name);
- if (g_strcmp0 (option_name, "--sample-path-recurse") == 0 ||
- g_strcmp0 (option_name, "-R") == 0) {
- _add_media_new_paths_recursing (value);
- } else {
- GST_INFO ("Adding folder: %s", value);
- g_ptr_array_add (new_paths, g_strdup (value));
- }
+ if (recurse)
+ _add_media_new_paths_recursing (uri);
+ else
+ g_ptr_array_add (new_paths, g_strdup (uri));
return TRUE;
}
diff --git a/ges/ges-project.h b/ges/ges-project.h
index 689752ef..c2bd1566 100644
--- a/ges/ges-project.h
+++ b/ges/ges-project.h
@@ -105,6 +105,8 @@ GList * ges_project_get_loading_assets (GESProject * project);
gboolean ges_project_add_encoding_profile (GESProject *project,
GstEncodingProfile *profile);
const GList *ges_project_list_encoding_profiles (GESProject *project);
+gboolean ges_add_missing_uri_relocation_uri (const gchar * uri,
+ gboolean recurse);
G_END_DECLS
diff --git a/ges/ges-uri-asset.h b/ges/ges-uri-asset.h
index d6b47f1b..8fe053fb 100644
--- a/ges/ges-uri-asset.h
+++ b/ges/ges-uri-asset.h
@@ -114,7 +114,7 @@ struct _GESUriSourceAssetClass
};
GstDiscovererStreamInfo * ges_uri_source_asset_get_stream_info (GESUriSourceAsset *asset);
const gchar * ges_uri_source_asset_get_stream_uri (GESUriSourceAsset *asset);
-const GESUriClipAsset *ges_uri_source_asset_get_filesource_asset (GESUriSourceAsset *asset);
+const GESUriClipAsset *ges_uri_source_asset_get_filesource_asset (GESUriSourceAsset *asset);
G_END_DECLS
#endif /* _GES_URI_CLIP_ASSET */
diff --git a/ges/ges.c b/ges/ges.c
index 55a426b7..864db1ae 100644
--- a/ges/ges.c
+++ b/ges/ges.c
@@ -129,6 +129,10 @@ parse_goption_arg (const gchar * s_opt,
if (g_strcmp0 (s_opt, "--ges-version") == 0) {
g_print ("GStreamer Editing Services version %s\n", PACKAGE_VERSION);
exit (0);
+ } 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);
}
return TRUE;
@@ -162,11 +166,11 @@ ges_init_get_option_group (void)
(gpointer) parse_goption_arg,
"Print the GStreamer Editing Services version",
NULL},
- {"sample-paths", 'P', 0, G_OPTION_ARG_CALLBACK,
- &ges_add_missing_uri_relocation_path,
+ {"ges-sample-paths", 0, 0, G_OPTION_ARG_CALLBACK,
+ (gpointer) parse_goption_arg,
"List of pathes to look assets in if they were moved"},
- {"sample-path-recurse", 'R', 0, G_OPTION_ARG_CALLBACK,
- &ges_add_missing_uri_relocation_path,
+ {"ges-sample-path-recurse", 0, 0, G_OPTION_ARG_CALLBACK,
+ (gpointer) parse_goption_arg,
"Same as above, but recursing into the folder"},
{NULL}
};