]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/blob - tests/old/examples/launch/mp3parselaunch.c
don't mix tabs and spaces
[glsdk/gstreamer0-10.git] / tests / old / examples / launch / mp3parselaunch.c
1 #include <stdlib.h>
2 #include <gst/gst.h>
4 int
5 main (int argc, char *argv[])
6 {
7   GstElement *pipeline;
8   GstElement *filesrc;
9   GError *error = NULL;
11   gst_init (&argc, &argv);
13   if (argc != 2) {
14     g_print ("usage: %s <filename>\n", argv[0]);
15     return -1;
16   }
18   pipeline = (GstElement *)
19       gst_parse_launch ("filesrc name=my_filesrc ! mad ! osssink", &error);
20   if (!pipeline) {
21     fprintf (stderr, "Parse error: %s", error->message);
22     exit (1);
23   }
25   filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_filesrc");
26   g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
28   gst_element_set_state (pipeline, GST_STATE_PLAYING);
30   while (gst_bin_iterate (GST_BIN (pipeline)));
32   gst_element_set_state (pipeline, GST_STATE_NULL);
34   return 0;
35 }