2003-02-10 20:32:32 +00:00
|
|
|
#include <stdlib.h>
|
2001-07-07 14:07:03 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
GstElement *pipeline;
|
2002-01-05 23:05:56 +00:00
|
|
|
GstElement *filesrc;
|
2002-04-07 23:32:16 +00:00
|
|
|
GError *error = NULL;
|
2001-07-07 14:07:03 +00:00
|
|
|
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
|
2001-07-07 14:14:42 +00:00
|
|
|
if (argc != 2) {
|
|
|
|
g_print ("usage: %s <filename>\n", argv[0]);
|
|
|
|
return -1;
|
|
|
|
}
|
2001-07-07 14:07:03 +00:00
|
|
|
|
2002-04-07 23:32:16 +00:00
|
|
|
pipeline = (GstElement*) gst_parse_launch ("filesrc name=my_filesrc ! mad ! osssink", &error);
|
|
|
|
if (!pipeline) {
|
|
|
|
fprintf (stderr, "Parse error: %s", error->message);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
2002-01-05 23:05:56 +00:00
|
|
|
filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_filesrc");
|
|
|
|
g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
|
2001-07-07 14:07:03 +00:00
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
|
|
|
|
|
|
|
while (gst_bin_iterate (GST_BIN (pipeline)));
|
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
|
|
|
|
2001-07-07 14:14:42 +00:00
|
|
|
return 0;
|
2001-07-07 14:07:03 +00:00
|
|
|
}
|