mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 19:21:06 +00:00
Add -o option argument to gstreamer-launch, to specify a file to output the pipeline to, instead of running it.
Original commit message from CVS: Add -o option argument to gstreamer-launch, to specify a file to output the pipeline to, instead of running it.
This commit is contained in:
parent
fd8a8d4d46
commit
216e862be2
1 changed files with 23 additions and 8 deletions
|
@ -94,9 +94,21 @@ main(int argc, char *argv[])
|
||||||
char **argvn;
|
char **argvn;
|
||||||
gchar *cmdline;
|
gchar *cmdline;
|
||||||
int i;
|
int i;
|
||||||
|
gboolean save_pipeline = FALSE;
|
||||||
|
gboolean run_pipeline = TRUE;
|
||||||
|
gchar *savefile = "";
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
|
if (argc >= 3 && !strcmp(argv[1], "-o")) {
|
||||||
|
save_pipeline = TRUE;
|
||||||
|
run_pipeline = FALSE;
|
||||||
|
savefile = argv[2];
|
||||||
|
argv[2] = argv[0];
|
||||||
|
argv+=2;
|
||||||
|
argc-=2;
|
||||||
|
}
|
||||||
|
|
||||||
launch_argc = argc;
|
launch_argc = argc;
|
||||||
launch_argv = argv;
|
launch_argv = argv;
|
||||||
|
|
||||||
|
@ -128,17 +140,20 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
gst_parse_launch (cmdline, GST_BIN (pipeline));
|
gst_parse_launch (cmdline, GST_BIN (pipeline));
|
||||||
|
|
||||||
arg_search(GST_BIN(pipeline),"xid",xid_handler,NULL);
|
if (save_pipeline) {
|
||||||
|
xmlSaveFile (savefile, gst_xml_write (pipeline));
|
||||||
|
}
|
||||||
|
if (run_pipeline) {
|
||||||
|
arg_search(GST_BIN(pipeline),"xid",xid_handler,NULL);
|
||||||
|
|
||||||
// xmlSaveFile("gstreamer-launch.gst",gst_xml_write(pipeline));
|
fprintf(stderr,"RUNNING pipeline\n");
|
||||||
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
||||||
fprintf(stderr,"RUNNING pipeline\n");
|
gtk_idle_add(idle_func,pipeline);
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gtk_main();
|
||||||
|
|
||||||
gtk_idle_add(idle_func,pipeline);
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
gtk_main();
|
}
|
||||||
|
|
||||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue