mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-08 00:59:48 +00:00
examples: create URIs properly from filenames
This commit is contained in:
parent
d5494acf30
commit
f7a26c704e
7 changed files with 12 additions and 9 deletions
|
@ -41,7 +41,7 @@ GESTimelinePipeline *make_timeline (char *path, float duration, char *text,
|
|||
GESTimelineObject *
|
||||
make_source (char *path, guint64 start, guint64 duration, gint priority)
|
||||
{
|
||||
char *uri = g_strdup_printf ("file://%s", path);
|
||||
gchar *uri = gst_filename_to_uri (path, NULL);
|
||||
|
||||
GESTimelineObject *ret =
|
||||
GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
|
||||
|
@ -125,7 +125,7 @@ main (int argc, char **argv)
|
|||
GESTimelinePipeline *pipeline;
|
||||
GMainLoop *mainloop;
|
||||
gdouble duration = DEFAULT_DURATION;
|
||||
char *path, *text;
|
||||
char *path = NULL, *text;
|
||||
guint64 color;
|
||||
gdouble xpos = DEFAULT_POS, ypos = DEFAULT_POS;
|
||||
|
||||
|
@ -163,6 +163,9 @@ main (int argc, char **argv)
|
|||
|
||||
ges_init ();
|
||||
|
||||
if (path == NULL)
|
||||
g_error ("Must specify --path=/path/to/media/file option\n");
|
||||
|
||||
pipeline = make_timeline (path, duration, text, color, xpos, ypos);
|
||||
|
||||
mainloop = g_main_loop_new (NULL, FALSE);
|
||||
|
|
|
@ -88,7 +88,7 @@ main (int argc, gchar ** argv)
|
|||
return -1;
|
||||
|
||||
if (1) {
|
||||
gchar *uri = g_strdup_printf ("file://%s", argv[1]);
|
||||
gchar *uri = gst_filename_to_uri (argv[1], NULL);
|
||||
/* Add the main audio/video file */
|
||||
src = ges_timeline_filesource_new (uri);
|
||||
g_free (uri);
|
||||
|
|
|
@ -62,7 +62,7 @@ main (int argc, gchar ** argv)
|
|||
* ready to start using it... by solely working with the layer ! */
|
||||
|
||||
for (i = 1; i < argc; i++, offset += GST_SECOND) {
|
||||
gchar *uri = g_strdup_printf ("file://%s", argv[i]);
|
||||
gchar *uri = gst_filename_to_uri (argv[i], NULL);
|
||||
GESTimelineFileSource *src = ges_timeline_filesource_new (uri);
|
||||
|
||||
g_assert (src);
|
||||
|
|
|
@ -61,7 +61,7 @@ main (int argc, gchar ** argv)
|
|||
* ready to start using it... by solely working with the layer ! */
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
gchar *uri = g_strdup_printf ("file://%s", argv[i]);
|
||||
gchar *uri = gst_filename_to_uri (argv[i], NULL);
|
||||
GESTimelineFileSource *src = ges_timeline_filesource_new (uri);
|
||||
|
||||
g_assert (src);
|
||||
|
|
|
@ -116,7 +116,7 @@ main (int argc, gchar ** argv)
|
|||
* ready to start using it... by solely working with the layer ! */
|
||||
|
||||
for (i = 2; i < argc; i++) {
|
||||
gchar *uri = g_strdup_printf ("file://%s", argv[i]);
|
||||
gchar *uri = gst_filename_to_uri (argv[i], NULL);
|
||||
GESTimelineFileSource *src = ges_timeline_filesource_new (uri);
|
||||
|
||||
g_assert (src);
|
||||
|
@ -142,7 +142,7 @@ main (int argc, gchar ** argv)
|
|||
if (gst_uri_is_valid (argv[1])) {
|
||||
output_uri = g_strdup (argv[1]);
|
||||
} else {
|
||||
output_uri = g_strdup_printf ("file://%s", argv[1]);
|
||||
output_uri = gst_filename_to_uri (argv[1], NULL);
|
||||
}
|
||||
profile = make_encoding_profile (audio, container);
|
||||
if (!ges_timeline_pipeline_set_render_settings (pipeline, output_uri,
|
||||
|
|
|
@ -35,7 +35,7 @@ GESTimelineObject *
|
|||
make_source (char *path, guint64 start, guint64 duration, gint priority,
|
||||
gchar * text)
|
||||
{
|
||||
char *uri = g_strdup_printf ("file://%s", path);
|
||||
gchar *uri = gst_filename_to_uri (path, NULL);
|
||||
|
||||
GESTimelineObject *ret =
|
||||
GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
|
||||
|
|
|
@ -40,7 +40,7 @@ GESTimelineObject *
|
|||
make_source (gchar * path, guint64 start, guint64 duration, guint64 inpoint,
|
||||
gint priority)
|
||||
{
|
||||
char *uri = g_strdup_printf ("file://%s", path);
|
||||
gchar *uri = gst_filename_to_uri (path, NULL);
|
||||
|
||||
GESTimelineObject *ret =
|
||||
GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
|
||||
|
|
Loading…
Reference in a new issue