[gst-devel] No EOS with OGG and decodebin
Stefan Bambach
stefanb at bambach.intra
Fri Jul 22 03:37:17 CEST 2005
Hi,
> > When decoding ogg files, than it will play and at the end I get NO EOS !
>
> Why don't you use playbin?
>
> Anyway, Totem does about the same and it works fine there, so either
> you're using an old version of GStreamer or something else is wrong.
> Update to 0.8.10 and retry if you didn't use that already. If it still
> doesn't work, please post some code. The examples in the manual, which
> use Ogg, work fine for me, also w.r.t. EOS.
I want to play all audio medias that are supported by gst. Need "seek", "pause", "eos",
"getposition", "gettotal", "getmode (PLAY, PAUSE, ...)" and "setmode" Features. So let's say
standard audio player features....
All other formats (WAV, WMA, MP3, FLAC, ...) are working pretty well. So I can't be that
bad.
used packages:
- gstreamer-0.8.10
- gst-plugins-0.8.10
- gst-ffmpeg-0.8.5
totem: will have a look at it.
I used main parts from "examples/manual/threads.c".
decodebin.c example does not use a thread and threads.c use a gst_main(), that I do not
have. But please see my code snippet below.
What example should I use ? And what have to be changed ?
------
...
gst_init(NULL, NULL);
// loading plugins manually (no registry.xml on target...)
// but it doesn't matter. have the same problem on my normal
// workstation linux
gst_plugin_load("alsa");
gst_plugin_load("mpegaudioparse");
gst_plugin_load("mad");
gst_plugin_load("ffmpeg");
gst_plugin_load("flac");
gst_plugin_load("ogg");
gst_plugin_load("vorbis");
main = gst_thread_new("main");
g_signal_connect(G_OBJECT(main), "state-change", G_CALLBACK(main_state_change), NULL);
src = gst_element_factory_make("filesrc", "src");
g_object_set(G_OBJECT(src), "location", filename, NULL);
dec = gst_element_factory_make("decodebin", "dec");
g_signal_connect(G_OBJECT(dec), "new-decoded-pad", G_CALLBACK(main_newpad), NULL);
sink = gst_element_factory_make("alsasink", "sink");
g_signal_connect(G_OBJECT(sink), "eos", G_CALLBACK(main_eos), NULL);
gst_bin_add_many(GST_BIN(main), src, dec, NULL);
gst_element_link_many(src, dec, NULL);
gst_element_set_state(sink, GST_STATE_PAUSED);
gst_element_set_state(main, GST_STATE_PLAYING);
...
static void main_eos(GstElement *element, gpointer data)
{
MSG_DEBUG("have eos, quitting ('%s')", GST_ELEMENT_NAME(element));
}
static void main_newpad (GstElement *decodebin, GstPad *pad, gboolean last,
gpointer data)
{
// link it to main
gst_pad_link(pad, gst_element_get_pad(sink, "sink"));
gst_bin_add(GST_BIN(main), sink);
gst_bin_sync_children_state(GST_BIN(main));
}
static void main_state_change(GstElement *element, GstElementState oldstate,
GstElementState state, gpointer data)
{
MSG_DEBUG("main_state_change: called for '%s'", GST_ELEMENT_NAME(element));
}
------
ciao. Stefan
More information about the gstreamer-devel
mailing list