mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
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
This commit is contained in:
parent
1373937b8e
commit
3b353be8ea
6 changed files with 39 additions and 22 deletions
|
@ -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,
|
G_GNUC_INTERNAL void ges_project_add_loading_asset (GESProject *project,
|
||||||
GType extractable_type,
|
GType extractable_type,
|
||||||
const gchar *id);
|
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 *
|
* GESBaseXmlFormatter internal methods *
|
||||||
|
|
|
@ -287,24 +287,18 @@ done:
|
||||||
gst_object_unref (fenum);
|
gst_object_unref (fenum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_add_missing_uri_relocation_path (const gchar * option_name,
|
ges_add_missing_uri_relocation_uri (const gchar * uri, gboolean recurse)
|
||||||
const gchar * value, gpointer udata, GError ** error)
|
|
||||||
{
|
{
|
||||||
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)
|
if (new_paths == NULL)
|
||||||
new_paths = g_ptr_array_new_with_free_func (g_free);
|
new_paths = g_ptr_array_new_with_free_func (g_free);
|
||||||
|
|
||||||
g_print ("\n\nOption name %s\n\n", option_name);
|
if (recurse)
|
||||||
if (g_strcmp0 (option_name, "--sample-path-recurse") == 0 ||
|
_add_media_new_paths_recursing (uri);
|
||||||
g_strcmp0 (option_name, "-R") == 0) {
|
else
|
||||||
_add_media_new_paths_recursing (value);
|
g_ptr_array_add (new_paths, g_strdup (uri));
|
||||||
} else {
|
|
||||||
GST_INFO ("Adding folder: %s", value);
|
|
||||||
g_ptr_array_add (new_paths, g_strdup (value));
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,8 @@ GList * ges_project_get_loading_assets (GESProject * project);
|
||||||
gboolean ges_project_add_encoding_profile (GESProject *project,
|
gboolean ges_project_add_encoding_profile (GESProject *project,
|
||||||
GstEncodingProfile *profile);
|
GstEncodingProfile *profile);
|
||||||
const GList *ges_project_list_encoding_profiles (GESProject *project);
|
const GList *ges_project_list_encoding_profiles (GESProject *project);
|
||||||
|
gboolean ges_add_missing_uri_relocation_uri (const gchar * uri,
|
||||||
|
gboolean recurse);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ struct _GESUriSourceAssetClass
|
||||||
};
|
};
|
||||||
GstDiscovererStreamInfo * ges_uri_source_asset_get_stream_info (GESUriSourceAsset *asset);
|
GstDiscovererStreamInfo * ges_uri_source_asset_get_stream_info (GESUriSourceAsset *asset);
|
||||||
const gchar * ges_uri_source_asset_get_stream_uri (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
|
G_END_DECLS
|
||||||
#endif /* _GES_URI_CLIP_ASSET */
|
#endif /* _GES_URI_CLIP_ASSET */
|
||||||
|
|
12
ges/ges.c
12
ges/ges.c
|
@ -129,6 +129,10 @@ parse_goption_arg (const gchar * s_opt,
|
||||||
if (g_strcmp0 (s_opt, "--ges-version") == 0) {
|
if (g_strcmp0 (s_opt, "--ges-version") == 0) {
|
||||||
g_print ("GStreamer Editing Services version %s\n", PACKAGE_VERSION);
|
g_print ("GStreamer Editing Services version %s\n", PACKAGE_VERSION);
|
||||||
exit (0);
|
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;
|
return TRUE;
|
||||||
|
@ -162,11 +166,11 @@ ges_init_get_option_group (void)
|
||||||
(gpointer) parse_goption_arg,
|
(gpointer) parse_goption_arg,
|
||||||
"Print the GStreamer Editing Services version",
|
"Print the GStreamer Editing Services version",
|
||||||
NULL},
|
NULL},
|
||||||
{"sample-paths", 'P', 0, G_OPTION_ARG_CALLBACK,
|
{"ges-sample-paths", 0, 0, G_OPTION_ARG_CALLBACK,
|
||||||
&ges_add_missing_uri_relocation_path,
|
(gpointer) parse_goption_arg,
|
||||||
"List of pathes to look assets in if they were moved"},
|
"List of pathes to look assets in if they were moved"},
|
||||||
{"sample-path-recurse", 'R', 0, G_OPTION_ARG_CALLBACK,
|
{"ges-sample-path-recurse", 0, 0, G_OPTION_ARG_CALLBACK,
|
||||||
&ges_add_missing_uri_relocation_path,
|
(gpointer) parse_goption_arg,
|
||||||
"Same as above, but recursing into the folder"},
|
"Same as above, but recursing into the folder"},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
|
@ -682,6 +682,23 @@ _parse_encoding_profile (const gchar * format)
|
||||||
return encoding_profile;
|
return encoding_profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_add_media_path (const gchar * option_name, const gchar * value,
|
||||||
|
gpointer udata, GError ** error)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (gst_uri_is_valid (value), FALSE);
|
||||||
|
|
||||||
|
if (g_strcmp0 (option_name, "--sample-path-recurse") == 0 ||
|
||||||
|
g_strcmp0 (option_name, "-R") == 0) {
|
||||||
|
ges_add_missing_uri_relocation_uri (value, TRUE);
|
||||||
|
} else {
|
||||||
|
GST_INFO ("Adding folder: %s", value);
|
||||||
|
ges_add_missing_uri_relocation_uri (value, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, gchar ** argv)
|
main (int argc, gchar ** argv)
|
||||||
{
|
{
|
||||||
|
@ -736,6 +753,11 @@ main (int argc, gchar ** argv)
|
||||||
"The video sink used for playing back", "<videosink>"},
|
"The video sink used for playing back", "<videosink>"},
|
||||||
{"audiosink", 'a', 0, G_OPTION_ARG_STRING, &audiosink,
|
{"audiosink", 'a', 0, G_OPTION_ARG_STRING, &audiosink,
|
||||||
"The audio sink used for playing back", "<audiosink>"},
|
"The audio sink used for playing back", "<audiosink>"},
|
||||||
|
{"sample-paths", 'P', 0, G_OPTION_ARG_CALLBACK, &_add_media_path,
|
||||||
|
"List of pathes to look assets in if they were moved"},
|
||||||
|
{"sample-path-recurse", 'R', 0, G_OPTION_ARG_CALLBACK,
|
||||||
|
&_add_media_path,
|
||||||
|
"Same as above, but recursing into the folder"},
|
||||||
#ifdef HAVE_GST_VALIDATE
|
#ifdef HAVE_GST_VALIDATE
|
||||||
{"inspect-action-type", 'y', 0, G_OPTION_ARG_NONE, &inspect_action_type,
|
{"inspect-action-type", 'y', 0, G_OPTION_ARG_NONE, &inspect_action_type,
|
||||||
"Inspect the avalaible action types with which to write scenarios"
|
"Inspect the avalaible action types with which to write scenarios"
|
||||||
|
|
Loading…
Reference in a new issue