I've started to use gstreamer for bygfoot media API.
This API contains (now) those functions :
//start to init GStreamer
gint mediaPlayer_init();
//play a sound and return from function when sound is stop
gint mediaPlayer_playSoundToEnd(const gchar *path);
The implementation is on going, the configure.in script has been modified to check for GSTREAMER and add a #define into config.h
BUT nothing is working now :-s
-> compil problem
I've wanted to add three more functions :
//Start to play a sound (needthread :-s
gint mediaPlayer_playSoundAndComeBack(const gchar *path,gint * soundId);
//stop a sound which is playing
gint mediaPlayer_stopSound(gint soundId);
//Play a video. return when video is stop.
gint mediaPlayer_playVideo(const gchar * path);
PS : all this code is on my computer, with a copy/paste from GStream Developer doc.
Media with Gstreamer
Media with Gstreamer
Geovah - geovah@jabber.sk- (yes i'm french...)
i'm not sure config.h is the right file to tinker with (i never edited it).
from the gstreamer docs: into the h file. put it also into main.c and call somewhere in main() (after 'g_init' or so).
put all sound-related funcs into sound.c.
gyözö
from the gstreamer docs:
so, you should make files 'sound.c/h' and putgstreamer docs wrote:Initializing GStreamer
When writing a GStreamer application, you can simply include gst/gst.h to get access to the library functions. Besides that, you will also need to intialize the GStreamer library.
Code: Select all
#include <gst/gst.h>
Code: Select all
gst_init (&argc, &argv);
put all sound-related funcs into sound.c.
gyözö
Press any key to continue or any other key to quit.
I've not directly edit config.h but this file is modified to have a #define HAVE_GSTREAMER if gstreamer is detected on the current computer with a ./configure --enable-gstreamergyboth wrote:i'm not sure config.h is the right file to tinker with (i never edited it).
This is why i have modified the configure.in file
My .c file looks like :
Code: Select all
#ifdef HAVE_GSTREAMER
gint mediaPlayer_int(int argc,char * argv[]) {
}
#else
gint mediaPlayer_init(int argc,char *argv[]) {
return 0;
}
#endif
the one who want to play sound always call mediaPlayer_playSound().
My filename are mediaplayer.h and mediaplayer.c since i planned to support video.gyboth wrote: put all sound-related funcs into sound.c.
gyözö
in order to simplyfi the code, I started to only support Ogg/Vorbis audio file.
Geovah - geovah@jabber.sk- (yes i'm french...)
I don't have access to my computer because i'm at work but the probleme is a bad header : error in gst/gst.h , very strange.gyboth wrote:what kind of error do you get? i mean, what exactly?
gyözö
If you want, as soon as the ./configure --enable-gstreamer works totaly and mediaPlayer.c works (a little), I can send U or commit the code to the CVS.
Geovah - geovah@jabber.sk- (yes i'm french...)
ok, sounds like you know what you're doing.GeoVah wrote:I've not directly edit config.h but this file is modified to have a #define HAVE_GSTREAMER if gstreamer is detected on the current computer with a ./configure --enable-gstreamer
This is why i have modified the configure.in file
reasonable. may i ask you to make functions and variables lower-case and underscore-separated? that's the Bygfoot and GTK way of doing them, and it makes the code more consistent if you use it too. like this:the one who want to play sound always call mediaPlayer_playSound().
Code: Select all
mediaplayer_play_sound(const gchar *sound_file)
Code: Select all
GeovahSoundStruct
even betterMy filename are mediaplayer.h and mediaplayer.c since i planned to support video.gyboth wrote: put all sound-related funcs into sound.c.
gyözö
i'd say we use ogg as the default format (the obvious choice for a GPL OSS). but maybe it's possible to create code that recognises the format, so that users can use their own mp3s and wavs, too, if they want.in order to simplyfi the code, I started to only support Ogg/Vorbis audio file.
send it to me first. and thanks for working on it, it's great that i don't have to do itGeoVah wrote:If you want, as soon as the ./configure --enable-gstreamer works totaly and mediaPlayer.c works (a little), I can send U or commit the code to the CVS.
gyözö
Press any key to continue or any other key to quit.
I think things are starting to bend towards oog. Im certainly doing my bit on this side of the world to Ogg everything:)
Im not sure exactly what you guys are up to but let me know if you need sound effects or music
Im not sure exactly what you guys are up to but let me know if you need sound effects or music
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
What type are you?