[gst-devel] why is it not working ?
Laurent Belmonte
lolo3d at tuxfamily.org
Wed Oct 8 02:37:03 CEST 2003
The code in attachement, command line for compile :
gcc test.c gst-audio.c `pkg-config gstreamer-0.6 gtk+-2.0 --libs
--cflags`
hit 'f' key to start the sample play ( the problem, that is not working
..)
On Tue, 2003-10-07 at 10:54, Thomas Vander Stichele wrote:
> two things:
>
> a) your code is very hard to read - please choose a coding style wrt.
> spacing and braces and parentheses, and stick with it. Alternatively,
> use indent on it before posting your code.
>
> b) I'm missing some essential code in your example; key_pressed is never
> used, there are ellipses where I would like to see code, channel struct
> isn't defined, ...
>
> It would be a lot easier to try and debug a compiling example :)
>
> Thomas
>
> On Tue, 2003-10-07 at 10:37, Laurent Belmonte wrote:
> > Hi,
> >
> > I am writing some code that use gstreamer, but i cant stand why it is
> > not working :
> >
> >
> > static void idle(gpointer user_data) {
> > gst_bin_iterate( main_bin);
> > }
> >
> > static void key_pressed(..) {
> > channel = create_channel(id,"/my_song.mp3");
> >
> > gst_element_set_state( main_bin, GST_STATE_PAUSED);
> > gst_bin_add( main_bin, channel->pipe);
> >
> > pad = gst_element_get_request_pad( adder,"sink%d");
> > sprintf(buffer,"channel%d",channel->id);
> >
> > gst_pad_link (gst_element_get_pad (channel->pipe, buffer), pad);
> >
> > gst_element_set_state(main_bin,GST_STATE_PLAYING);
> > }
> >
> > static channel * create_channel(int id,const gchar * location ) {
> > sprintf(buffer,"pipeline%d",channel->id);
> > channel->pipe = gst_bin_new(buffer);
> >
> > sprintf(buffer,"filesrc%d",channel->id);
> > channel->filesrc = gst_element_factory_make("filesrc",buffer);
> >
> > gst_bin_add( GST_BIN(channel->pipe), channel->filesrc);
> >
> > decoder = gst_element_factory_make("mad","mpg123");
> >
> > gst_bin_add( GST_BIN(channel->pipe), decoder);
> >
> > gst_element_link(channel->filesrc,decoder);
> >
> > sprintf(buffer,"channel%d",channel->id);
> > gst_element_add_ghost_pad( channel->pipe,
> > gst_element_get_pad(decoder,"src"),buffer);
> > return channel;
> > }
> >
> > main() {
> > adder = gst_element_factory_make("adder","mixer");
> > output = gst_element_factory_make("osssink","output");
> >
> > main_bin = gst_pipeline_new("bin");
> >
> > gst_bin_add( GST_BIN( main_bin),adder);
> > gst_bin_add( GST_BIN( main_bin),output);
> >
> > gst_pad_link(gst_element_get_pad(adder,"src"),
> > gst_element_get_pad(output,"sink"));
> >
> > gst_element_set_state( main_bin, GST_STATE_PLAYING);
> > gtk_idle_add(idle,NULL);
> >
> > ..
> > gtk_main();
> > return 0;
> > }
> >
> > help me please !
> >
> > Regards,
> > Laurent Belmonte
> > http://monkey-bubble.tuxfamily.org
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
> Dave/Dina : future TV today ! - http://davedina.apestaart.org/
> <-*- thomas (dot) apestaart (dot) org -*->
> "Two million women and only one Flasheart..."
> <-*- thomas (at) apestaart (dot) org -*->
> URGent, best radio on the net - 24/7 ! - http://urgent.rug.ac.be/
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gst-audio.c
Type: text/x-c
Size: 5253 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20031008/1a6cb52f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gst-audio.h
Type: text/x-c-header
Size: 1937 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20031008/1a6cb52f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-c
Size: 764 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20031008/1a6cb52f/attachment-0002.bin>
More information about the gstreamer-devel
mailing list