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:
Richard Boulton 2001-06-19 10:34:15 +00:00
parent fd8a8d4d46
commit 216e862be2

View file

@ -94,9 +94,21 @@ main(int argc, char *argv[])
char **argvn;
gchar *cmdline;
int i;
gboolean save_pipeline = FALSE;
gboolean run_pipeline = TRUE;
gchar *savefile = "";
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_argv = argv;
@ -128,17 +140,20 @@ main(int argc, char *argv[])
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");
gst_element_set_state (pipeline, GST_STATE_PLAYING);
gtk_idle_add(idle_func,pipeline);
gtk_main();
gtk_idle_add(idle_func,pipeline);
gtk_main();
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_element_set_state (pipeline, GST_STATE_NULL);
}
return 0;
}