Skip to content
Snippets Groups Projects
Commit 216e862b authored by Richard Boulton's avatar Richard Boulton
Browse files

Add -o option argument to gstreamer-launch, to specify a file to output the...

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.
parent fd8a8d4d
No related branches found
No related tags found
No related merge requests found
......@@ -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);
// xmlSaveFile("gstreamer-launch.gst",gst_xml_write(pipeline));
if (save_pipeline) {
xmlSaveFile (savefile, gst_xml_write (pipeline));
}
if (run_pipeline) {
arg_search(GST_BIN(pipeline),"xid",xid_handler,NULL);
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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment