2000-01-30 10:44:33 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <gst/gst.h>
|
2001-01-09 04:39:35 +00:00
|
|
|
#include <gst/gstparse.h>
|
2000-08-28 20:20:55 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2001-01-09 04:39:35 +00:00
|
|
|
int main(int argc,char *argv[]) {
|
|
|
|
GstElement *pipeline;
|
2000-12-31 10:46:16 +00:00
|
|
|
char **argvn;
|
|
|
|
gchar *cmdline;
|
2001-01-09 04:39:35 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
|
|
|
|
pipeline = gst_pipeline_new("launch");
|
2000-12-31 10:46:16 +00:00
|
|
|
|
|
|
|
// make a null-terminated version of argv
|
2001-01-09 04:39:35 +00:00
|
|
|
argvn = g_new0(char *,argc);
|
|
|
|
memcpy(argvn,argv+1,sizeof(char*)*argc);
|
2000-12-31 10:46:16 +00:00
|
|
|
// join the argvs together
|
|
|
|
cmdline = g_strjoinv(" ",argvn);
|
|
|
|
// free the null-terminated argv
|
|
|
|
g_free(argvn);
|
|
|
|
|
2001-01-09 04:39:35 +00:00
|
|
|
gst_parse_launch(cmdline,pipeline);
|
2000-12-31 10:46:16 +00:00
|
|
|
|
2001-01-09 04:39:35 +00:00
|
|
|
fprintf(stderr,"RUNNING pipeline\n");
|
2000-01-30 10:44:33 +00:00
|
|
|
gst_element_set_state(pipeline,GST_STATE_PLAYING);
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2001-01-09 06:48:46 +00:00
|
|
|
while (1)
|
2001-01-04 07:19:11 +00:00
|
|
|
gst_bin_iterate (GST_BIN (pipeline));
|
2000-08-28 20:20:55 +00:00
|
|
|
|
2000-09-09 16:36:10 +00:00
|
|
|
return 0;
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|