ges-launch: option to select encoding profile from xml

https://bugzilla.gnome.org/show_bug.cgi?id=735121
This commit is contained in:
Lubosz Sarnecki 2014-07-20 11:47:18 +02:00 committed by Thibault Saunier
parent b6bc750730
commit 79322a452d

View file

@ -741,6 +741,7 @@ main (int argc, gchar ** argv)
gchar *videosink = NULL, *audiosink = NULL; gchar *videosink = NULL, *audiosink = NULL;
const gchar *scenario = NULL; const gchar *scenario = NULL;
gboolean list_action_types = FALSE; gboolean list_action_types = FALSE;
gchar *encoding_profile = NULL;
GOptionEntry options[] = { GOptionEntry options[] = {
{"thumbnail", 'm', 0.0, G_OPTION_ARG_DOUBLE, &thumbinterval, {"thumbnail", 'm', 0.0, G_OPTION_ARG_DOUBLE, &thumbinterval,
@ -752,6 +753,8 @@ main (int argc, gchar ** argv)
{"format", 'f', 0, G_OPTION_ARG_STRING, &format, {"format", 'f', 0, G_OPTION_ARG_STRING, &format,
"Specify an encoding profile on the command line", "Specify an encoding profile on the command line",
"<profile>"}, "<profile>"},
{"encoding-profile", 'e', 0, G_OPTION_ARG_STRING, &encoding_profile,
"Use a specific encoding profile from XML", "<profile-name>"},
{"repeat", 'r', 0, G_OPTION_ARG_INT, &repeat, {"repeat", 'r', 0, G_OPTION_ARG_INT, &repeat,
"Number of times to repeat timeline", "<times>"}, "Number of times to repeat timeline", "<times>"},
{"list-transitions", 't', 0, G_OPTION_ARG_NONE, &list_transitions, {"list-transitions", 't', 0, G_OPTION_ARG_NONE, &list_transitions,
@ -908,7 +911,14 @@ main (int argc, gchar ** argv)
GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (timeline))); GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (timeline)));
const GList *profiles = ges_project_list_encoding_profiles (proj); const GList *profiles = ges_project_list_encoding_profiles (proj);
prof = profiles ? profiles->data : NULL; if (profiles) {
prof = profiles->data;
if (encoding_profile)
for (; profiles; profiles = profiles->next)
if (strcmp (encoding_profile,
gst_encoding_profile_get_name (profiles->data)) == 0)
prof = profiles->data;
}
} }
if (!prof) { if (!prof) {