3 /* note: this requires gstreamer 0.10.x and a big list of plugins. */
4 /* it's currently hardcoded to use a big-endian alsasink as sink. */
5 #include <lib/base/eerror.h>
6 #include <lib/base/object.h>
7 #include <lib/base/ebase.h>
9 #include <lib/service/servicemp3.h>
10 #include <lib/service/service.h>
11 #include <lib/base/init_num.h>
12 #include <lib/base/init.h>
17 eServiceFactoryMP3::eServiceFactoryMP3()
19 ePtr<eServiceCenter> sc;
21 eServiceCenter::getPrivInstance(sc);
24 std::list<std::string> extensions;
25 extensions.push_back("mp3");
26 extensions.push_back("ogg");
27 extensions.push_back("mpg");
28 extensions.push_back("vob");
29 extensions.push_back("wav");
30 extensions.push_back("wave");
31 extensions.push_back("mkv");
32 extensions.push_back("avi");
33 sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
36 m_service_info = new eStaticServiceMP3Info();
39 eServiceFactoryMP3::~eServiceFactoryMP3()
41 ePtr<eServiceCenter> sc;
43 eServiceCenter::getPrivInstance(sc);
45 sc->removeServiceFactory(eServiceFactoryMP3::id);
48 DEFINE_REF(eServiceFactoryMP3)
51 RESULT eServiceFactoryMP3::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
54 ptr = new eServiceMP3(ref.path.c_str());
58 RESULT eServiceFactoryMP3::record(const eServiceReference &ref, ePtr<iRecordableService> &ptr)
64 RESULT eServiceFactoryMP3::list(const eServiceReference &, ePtr<iListableService> &ptr)
70 RESULT eServiceFactoryMP3::info(const eServiceReference &ref, ePtr<iStaticServiceInformation> &ptr)
76 RESULT eServiceFactoryMP3::offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr)
83 // eStaticServiceMP3Info
86 // eStaticServiceMP3Info is seperated from eServiceMP3 to give information
87 // about unopened files.
89 // probably eServiceMP3 should use this class as well, and eStaticServiceMP3Info
90 // should have a database backend where ID3-files etc. are cached.
91 // this would allow listing the mp3 database based on certain filters.
93 DEFINE_REF(eStaticServiceMP3Info)
95 eStaticServiceMP3Info::eStaticServiceMP3Info()
99 RESULT eStaticServiceMP3Info::getName(const eServiceReference &ref, std::string &name)
101 size_t last = ref.path.rfind('/');
102 if (last != std::string::npos)
103 name = ref.path.substr(last+1);
109 int eStaticServiceMP3Info::getLength(const eServiceReference &ref)
116 eServiceMP3::eServiceMP3(const char *filename): m_filename(filename), m_pump(eApp, 1)
119 m_audioStreams.clear();
120 m_currentAudioStream = 0;
121 CONNECT(m_pump.recv_msg, eServiceMP3::gstPoll);
122 GstElement *source = 0;
124 GstElement *filter = 0, *decoder = 0, *conv = 0, *flt = 0, *sink = 0; /* for audio */
126 GstElement *audio = 0, *switch_audio = 0, *queue_audio = 0, *video = 0, *queue_video = 0, *videodemux = 0;
129 eDebug("SERVICEMP3 construct!");
131 /* FIXME: currently, decodebin isn't possible for
132 video streams. in that case, make a manual pipeline. */
134 const char *ext = strrchr(filename, '.');
138 int is_mpeg_ps = !(strcasecmp(ext, ".mpeg") && strcasecmp(ext, ".mpg") && strcasecmp(ext, ".vob") && strcasecmp(ext, ".bin"));
139 int is_mpeg_ts = !strcasecmp(ext, ".ts");
140 int is_matroska = !strcasecmp(ext, ".mkv");
141 int is_avi = !strcasecmp(ext, ".avi");
142 int is_mp3 = !strcasecmp(ext, ".mp3"); /* force mp3 instead of decodebin */
143 int is_video = is_mpeg_ps || is_mpeg_ts || is_matroska || is_avi;
144 int is_streaming = !strncmp(filename, "http://", 7);
145 int is_AudioCD = !(strncmp(filename, "/autofs/", 8) || strncmp(filename+strlen(filename)-13, "/track-", 7) || strcasecmp(ext, ".wav"));
147 eDebug("filename: %s, is_mpeg_ps: %d, is_mpeg_ts: %d, is_video: %d, is_streaming: %d, is_mp3: %d, is_matroska: %d, is_avi: %d, is_AudioCD: %d", filename, is_mpeg_ps, is_mpeg_ts, is_video, is_streaming, is_mp3, is_matroska, is_avi, is_AudioCD);
149 int is_audio = !is_video;
153 m_gst_pipeline = gst_pipeline_new ("mediaplayer");
155 eWarning("failed to create pipeline");
159 source = gst_element_factory_make ("cdiocddasrc", "cda-source");
161 g_object_set (G_OBJECT (source), "device", "/dev/cdroms/cdrom0", NULL);
165 if ( !is_streaming && !is_AudioCD )
166 source = gst_element_factory_make ("filesrc", "file-source");
167 else if ( is_streaming )
169 source = gst_element_factory_make ("neonhttpsrc", "http-source");
171 g_object_set (G_OBJECT (source), "automatic-redirect", TRUE, NULL);
175 eWarning("failed to create %s", is_streaming ? "neonhttpsrc" : "filesrc");
176 /* configure source */
177 else if (!is_AudioCD)
178 g_object_set (G_OBJECT (source), "location", filename, NULL);
181 int track = atoi(filename+18);
182 eDebug("play audio CD track #%i",track);
184 g_object_set (G_OBJECT (source), "track", track, NULL);
189 /* filesrc -> decodebin -> audioconvert -> capsfilter -> alsasink */
190 const char *decodertype = is_mp3 ? "mad" : "decodebin";
192 decoder = gst_element_factory_make (decodertype, "decoder");
194 eWarning("failed to create %s decoder", decodertype);
196 /* mp3 decoding needs id3demux to extract ID3 data. 'decodebin' would do that internally. */
199 filter = gst_element_factory_make ("id3demux", "filter");
201 eWarning("failed to create id3demux");
204 conv = gst_element_factory_make ("audioconvert", "converter");
206 eWarning("failed to create audioconvert");
208 flt = gst_element_factory_make ("capsfilter", "flt");
210 eWarning("failed to create capsfilter");
212 /* for some reasons, we need to set the sample format to depth/width=16, because auto negotiation doesn't work. */
213 /* endianness, however, is not required to be set anymore. */
216 GstCaps *caps = gst_caps_new_simple("audio/x-raw-int", /* "endianness", G_TYPE_INT, 4321, */ "depth", G_TYPE_INT, 16, "width", G_TYPE_INT, 16, /*"channels", G_TYPE_INT, 2, */(char*)0);
217 g_object_set (G_OBJECT (flt), "caps", caps, (char*)0);
218 gst_caps_unref(caps);
221 sink = gst_element_factory_make ("alsasink", "alsa-output");
223 eWarning("failed to create osssink");
225 if (source && decoder && conv && sink)
227 } else /* is_video */
229 /* filesrc -> mpegdemux -> | queue_audio -> dvbaudiosink
230 | queue_video -> dvbvideosink */
232 audio = gst_element_factory_make("dvbaudiosink", "audiosink");
233 queue_audio = gst_element_factory_make("queue", "queue_audio");
235 video = gst_element_factory_make("dvbvideosink", "videosink");
236 queue_video = gst_element_factory_make("queue", "queue_video");
239 videodemux = gst_element_factory_make("flupsdemux", "videodemux");
241 videodemux = gst_element_factory_make("flutsdemux", "videodemux");
242 else if (is_matroska)
243 videodemux = gst_element_factory_make("matroskademux", "videodemux");
245 videodemux = gst_element_factory_make("avidemux", "videodemux");
249 eDebug("fluendo mpegdemux not available, falling back to mpegdemux\n");
250 videodemux = gst_element_factory_make("mpegdemux", "videodemux");
253 eDebug("audio: %p, queue_audio %p, video %p, queue_video %p, videodemux %p", audio, queue_audio, video, queue_video, videodemux);
254 if (audio && queue_audio && video && queue_video && videodemux)
256 g_object_set (G_OBJECT (queue_audio), "max-size-bytes", 256*1024, NULL);
257 g_object_set (G_OBJECT (queue_audio), "max-size-buffers", 0, NULL);
258 g_object_set (G_OBJECT (queue_audio), "max-size-time", (guint64)0, NULL);
259 g_object_set (G_OBJECT (queue_video), "max-size-buffers", 0, NULL);
260 g_object_set (G_OBJECT (queue_video), "max-size-bytes", 2*1024*1024, NULL);
261 g_object_set (G_OBJECT (queue_video), "max-size-time", (guint64)0, NULL);
266 if (m_gst_pipeline && all_ok)
268 gst_bus_set_sync_handler(gst_pipeline_get_bus (GST_PIPELINE (m_gst_pipeline)), gstBusSyncHandler, this);
272 queue_audio = gst_element_factory_make("queue", "queue_audio");
273 g_object_set (G_OBJECT (sink), "preroll-queue-len", 80, NULL);
274 gst_bin_add_many (GST_BIN (m_gst_pipeline), source, queue_audio, conv, sink, NULL);
275 gst_element_link_many(source, queue_audio, conv, sink, NULL);
279 queue_audio = gst_element_factory_make("queue", "queue_audio");
283 /* decodebin has dynamic pads. When they get created, we connect them to the audio bin */
284 g_signal_connect (decoder, "new-decoded-pad", G_CALLBACK(gstCBnewPad), this);
285 g_signal_connect (decoder, "unknown-type", G_CALLBACK(gstCBunknownType), this);
286 g_object_set (G_OBJECT (sink), "preroll-queue-len", 80, NULL);
289 /* gst_bin will take the 'floating references' */
290 gst_bin_add_many (GST_BIN (m_gst_pipeline),
291 source, queue_audio, decoder, NULL);
295 /* id3demux also has dynamic pads, which need to be connected to the decoder (this is done in the 'gstCBfilterPadAdded' CB) */
296 gst_bin_add(GST_BIN(m_gst_pipeline), filter);
297 gst_element_link(source, filter);
298 g_signal_connect (filter, "pad-added", G_CALLBACK(gstCBfilterPadAdded), this);
300 /* in decodebin's case we can just connect the source with the decodebin, and decodebin will take care about id3demux (or whatever is required) */
301 gst_element_link_many(source, queue_audio, decoder, NULL);
303 /* create audio bin with the audioconverter, the capsfilter and the audiosink */
304 audio = gst_bin_new ("audiobin");
306 GstPad *audiopad = gst_element_get_static_pad (conv, "sink");
307 gst_bin_add_many(GST_BIN(audio), conv, flt, sink, (char*)0);
308 gst_element_link_many(conv, flt, sink, (char*)0);
309 gst_element_add_pad(audio, gst_ghost_pad_new ("sink", audiopad));
310 gst_object_unref(audiopad);
311 gst_bin_add (GST_BIN(m_gst_pipeline), audio);
313 /* in mad's case, we can directly connect the decoder to the audiobin. otherwise, we do this in gstCBnewPad */
315 gst_element_link(decoder, audio);
316 } else /* is_video */
318 gst_bin_add_many(GST_BIN(m_gst_pipeline), source, videodemux, audio, queue_audio, video, queue_video, NULL);
319 switch_audio = gst_element_factory_make ("input-selector", "switch_audio");
322 g_object_set (G_OBJECT (switch_audio), "select-all", TRUE, NULL);
323 gst_bin_add(GST_BIN(m_gst_pipeline), switch_audio);
324 gst_element_link(switch_audio, queue_audio);
326 gst_element_link(source, videodemux);
327 gst_element_link(queue_audio, audio);
328 gst_element_link(queue_video, video);
329 g_signal_connect(videodemux, "pad-added", G_CALLBACK (gstCBpadAdded), this);
334 gst_object_unref(GST_OBJECT(m_gst_pipeline));
336 gst_object_unref(GST_OBJECT(source));
338 gst_object_unref(GST_OBJECT(decoder));
340 gst_object_unref(GST_OBJECT(conv));
342 gst_object_unref(GST_OBJECT(sink));
345 gst_object_unref(GST_OBJECT(audio));
347 gst_object_unref(GST_OBJECT(queue_audio));
349 gst_object_unref(GST_OBJECT(video));
351 gst_object_unref(GST_OBJECT(queue_video));
353 gst_object_unref(GST_OBJECT(videodemux));
355 eDebug("sorry, can't play.");
359 gst_element_set_state (m_gst_pipeline, GST_STATE_PLAYING);
362 eServiceMP3::~eServiceMP3()
364 if (m_state == stRunning)
368 gst_tag_list_free(m_stream_tags);
372 gst_object_unref (GST_OBJECT (m_gst_pipeline));
373 eDebug("SERVICEMP3 destruct!");
377 DEFINE_REF(eServiceMP3);
379 RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
381 connection = new eConnection((iPlayableService*)this, m_event.connect(event));
385 RESULT eServiceMP3::start()
387 assert(m_state == stIdle);
392 eDebug("starting pipeline");
393 gst_element_set_state (m_gst_pipeline, GST_STATE_PLAYING);
395 m_event(this, evStart);
399 RESULT eServiceMP3::stop()
401 assert(m_state != stIdle);
402 if (m_state == stStopped)
404 eDebug("MP3: %s stop\n", m_filename.c_str());
405 gst_element_set_state(m_gst_pipeline, GST_STATE_NULL);
410 RESULT eServiceMP3::setTarget(int target)
415 RESULT eServiceMP3::pause(ePtr<iPauseableService> &ptr)
421 RESULT eServiceMP3::setSlowMotion(int ratio)
426 RESULT eServiceMP3::setFastForward(int ratio)
432 RESULT eServiceMP3::pause()
436 gst_element_set_state(m_gst_pipeline, GST_STATE_PAUSED);
440 RESULT eServiceMP3::unpause()
444 gst_element_set_state(m_gst_pipeline, GST_STATE_PLAYING);
448 /* iSeekableService */
449 RESULT eServiceMP3::seek(ePtr<iSeekableService> &ptr)
455 RESULT eServiceMP3::getLength(pts_t &pts)
459 if (m_state != stRunning)
462 GstFormat fmt = GST_FORMAT_TIME;
465 if (!gst_element_query_duration(m_gst_pipeline, &fmt, &len))
468 /* len is in nanoseconds. we have 90 000 pts per second. */
474 RESULT eServiceMP3::seekTo(pts_t to)
479 /* convert pts to nanoseconds */
480 gint64 time_nanoseconds = to * 11111LL;
481 if (!gst_element_seek (m_gst_pipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
482 GST_SEEK_TYPE_SET, time_nanoseconds,
483 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
485 eDebug("SEEK failed");
491 RESULT eServiceMP3::seekRelative(int direction, pts_t to)
499 getPlayPosition(ppos);
500 ppos += to * direction;
510 RESULT eServiceMP3::getPlayPosition(pts_t &pts)
514 if (m_state != stRunning)
517 GstFormat fmt = GST_FORMAT_TIME;
520 if (!gst_element_query_position(m_gst_pipeline, &fmt, &len))
523 /* len is in nanoseconds. we have 90 000 pts per second. */
528 RESULT eServiceMP3::setTrickmode(int trick)
530 /* trickmode currently doesn't make any sense for us. */
534 RESULT eServiceMP3::isCurrentlySeekable()
539 RESULT eServiceMP3::info(ePtr<iServiceInformation>&i)
545 RESULT eServiceMP3::getName(std::string &name)
548 size_t n = name.rfind('/');
549 if (n != std::string::npos)
550 name = name.substr(n + 1);
554 int eServiceMP3::getInfo(int w)
569 tag = GST_TAG_TRACK_NUMBER;
572 tag = GST_TAG_TRACK_COUNT;
578 if (!m_stream_tags || !tag)
582 if (gst_tag_list_get_uint(m_stream_tags, tag, &value))
589 std::string eServiceMP3::getInfoString(int w)
598 tag = GST_TAG_ARTIST;
604 tag = GST_TAG_COMMENT;
607 tag = GST_TAG_TRACK_NUMBER;
613 tag = GST_TAG_VIDEO_CODEC;
619 if (!m_stream_tags || !tag)
624 if (gst_tag_list_get_string(m_stream_tags, tag, &value))
626 std::string res = value;
634 RESULT eServiceMP3::audioChannel(ePtr<iAudioChannelSelection> &ptr)
640 RESULT eServiceMP3::audioTracks(ePtr<iAudioTrackSelection> &ptr)
646 int eServiceMP3::getNumberOfTracks()
648 return m_audioStreams.size();
651 int eServiceMP3::getCurrentTrack()
653 return m_currentAudioStream;
656 RESULT eServiceMP3::selectTrack(unsigned int i)
660 GstElement *selector = gst_bin_get_by_name(GST_BIN(m_gst_pipeline),"switch_audio");
663 eDebug("can't switch audio tracks! gst-plugin-selector needed");
666 g_object_get (G_OBJECT (selector), "n-pads", &nb_sources, NULL);
667 g_object_get (G_OBJECT (selector), "active-pad", &active_pad, NULL);
668 if ( i >= m_audioStreams.size() || i >= nb_sources || m_currentAudioStream >= m_audioStreams.size() )
671 sprintf(sinkpad, "sink%d", i);
672 g_object_set (G_OBJECT (selector), "active-pad", gst_element_get_pad (selector, sinkpad), NULL);
673 g_object_get (G_OBJECT (selector), "active-pad", &active_pad, NULL);
675 name = gst_pad_get_name (active_pad);
676 eDebug ("switched audio to (%s)", name);
678 m_currentAudioStream = i;
682 int eServiceMP3::getCurrentChannel()
687 RESULT eServiceMP3::selectChannel(int i)
689 eDebug("eServiceMP3::selectChannel(%i)",i);
693 RESULT eServiceMP3::getTrackInfo(struct iAudioTrackInfo &info, unsigned int i)
695 // eDebug("eServiceMP3::getTrackInfo(&info, %i)",i);
696 if (i >= m_audioStreams.size())
698 if (m_audioStreams[i].type == audioStream::atMP2)
699 info.m_description = "MP2";
700 else if (m_audioStreams[i].type == audioStream::atMP3)
701 info.m_description = "MP3";
702 else if (m_audioStreams[i].type == audioStream::atAC3)
703 info.m_description = "AC3";
704 else if (m_audioStreams[i].type == audioStream::atAAC)
705 info.m_description = "AAC";
706 else if (m_audioStreams[i].type == audioStream::atDTS)
707 info.m_description = "DTS";
709 info.m_description = "???";
710 if (info.m_language.empty())
711 info.m_language = m_audioStreams[i].language_code;
715 void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
722 source = GST_MESSAGE_SRC(msg);
723 sourceName = gst_object_get_name(source);
725 if (gst_message_get_structure(msg))
727 gchar *string = gst_structure_to_string(gst_message_get_structure(msg));
728 eDebug("gst_message from %s: %s", sourceName, string);
732 eDebug("gst_message from %s: %s (without structure)", sourceName, GST_MESSAGE_TYPE_NAME(msg));
734 switch (GST_MESSAGE_TYPE (msg))
736 case GST_MESSAGE_EOS:
737 m_event((iPlayableService*)this, evEOF);
739 case GST_MESSAGE_ERROR:
744 gst_message_parse_error (msg, &err, &debug);
746 eWarning("Gstreamer error: %s (%i)", err->message, err->code );
747 if ( err->domain == GST_STREAM_ERROR && err->code == GST_STREAM_ERROR_DECODE )
749 if ( g_strrstr(sourceName, "videosink") )
750 m_event((iPlayableService*)this, evUser+11);
753 /* TODO: signal error condition to user */
756 case GST_MESSAGE_TAG:
758 GstTagList *tags, *result;
759 gst_message_parse_tag(msg, &tags);
761 result = gst_tag_list_merge(m_stream_tags, tags, GST_TAG_MERGE_PREPEND);
765 gst_tag_list_free(m_stream_tags);
766 m_stream_tags = result;
769 if (gst_tag_list_get_string(tags, GST_TAG_AUDIO_CODEC, &g_audiocodec))
771 std::vector<audioStream>::iterator IterAudioStream = m_audioStreams.begin();
772 while ( IterAudioStream->language_code.length() && IterAudioStream != m_audioStreams.end())
774 if ( g_strrstr(g_audiocodec, "MPEG-1 layer 2") )
775 IterAudioStream->type = audioStream::atMP2;
776 else if ( g_strrstr(g_audiocodec, "AC-3 audio") )
777 IterAudioStream->type = audioStream::atAC3;
779 if ( gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &g_language) )
780 IterAudioStream->language_code = std::string(g_language);
782 g_free (g_audiocodec);
792 GstBusSyncReply eServiceMP3::gstBusSyncHandler(GstBus *bus, GstMessage *message, gpointer user_data)
794 eServiceMP3 *_this = (eServiceMP3*)user_data;
795 _this->m_pump.send(1);
800 void eServiceMP3::gstCBpadAdded(GstElement *decodebin, GstPad *pad, gpointer user_data)
802 eServiceMP3 *_this = (eServiceMP3*)user_data;
803 GstBin *pipeline = GST_BIN(_this->m_gst_pipeline);
805 name = gst_pad_get_name (pad);
806 eDebug ("A new pad %s was created", name);
807 if (g_strrstr(name,"audio")) // mpegdemux, matroskademux, avidemux use video_nn with n=0,1,.., flupsdemux uses stream id
809 GstElement *selector = gst_bin_get_by_name(pipeline , "switch_audio" );
812 _this->m_audioStreams.push_back(audio);
815 GstPadLinkReturn ret = gst_pad_link(pad, gst_element_get_request_pad (selector, "sink%d"));
816 if ( _this->m_audioStreams.size() == 1 )
818 _this->selectTrack(0);
819 gst_element_set_state (_this->m_gst_pipeline, GST_STATE_PLAYING);
822 g_object_set (G_OBJECT (selector), "select-all", FALSE, NULL);
825 gst_pad_link(pad, gst_element_get_static_pad(gst_bin_get_by_name(pipeline,"queue_audio"), "sink"));
827 if (g_strrstr(name,"video"))
829 gst_pad_link(pad, gst_element_get_static_pad(gst_bin_get_by_name(pipeline,"queue_video"), "sink"));
834 void eServiceMP3::gstCBfilterPadAdded(GstElement *filter, GstPad *pad, gpointer user_data)
836 eServiceMP3 *_this = (eServiceMP3*)user_data;
837 GstElement *decoder = gst_bin_get_by_name(GST_BIN(_this->m_gst_pipeline),"decoder");
838 gst_pad_link(pad, gst_element_get_static_pad (decoder, "sink"));
841 void eServiceMP3::gstCBnewPad(GstElement *decodebin, GstPad *pad, gboolean last, gpointer user_data)
843 eServiceMP3 *_this = (eServiceMP3*)user_data;
849 GstElement *audio = gst_bin_get_by_name(GST_BIN(_this->m_gst_pipeline),"audiobin");
850 audiopad = gst_element_get_static_pad (audio, "sink");
851 if ( !audiopad || GST_PAD_IS_LINKED (audiopad)) {
852 eDebug("audio already linked!");
853 g_object_unref (audiopad);
857 /* check media type */
858 caps = gst_pad_get_caps (pad);
859 str = gst_caps_get_structure (caps, 0);
860 eDebug("gst new pad! %s", gst_structure_get_name (str));
862 if (!g_strrstr (gst_structure_get_name (str), "audio")) {
863 gst_caps_unref (caps);
864 gst_object_unref (audiopad);
868 gst_caps_unref (caps);
869 gst_pad_link (pad, audiopad);
872 void eServiceMP3::gstCBunknownType(GstElement *decodebin, GstPad *pad, GstCaps *caps, gpointer user_data)
876 /* check media type */
877 caps = gst_pad_get_caps (pad);
878 str = gst_caps_get_structure (caps, 0);
879 eDebug("unknown type: %s - this can't be decoded.", gst_structure_get_name (str));
880 gst_caps_unref (caps);
883 void eServiceMP3::gstPoll(const int&)
885 /* ok, we have a serious problem here. gstBusSyncHandler sends
886 us the wakup signal, but likely before it was posted.
887 the usleep, an EVIL HACK (DON'T DO THAT!!!) works around this.
889 I need to understand the API a bit more to make this work
893 GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (m_gst_pipeline));
895 while ((message = gst_bus_pop (bus)))
897 gstBusCall(bus, message);
898 gst_message_unref (message);
902 eAutoInitPtr<eServiceFactoryMP3> init_eServiceFactoryMP3(eAutoInitNumbers::service+1, "eServiceFactoryMP3");
904 #warning gstreamer not available, not building media player