Thanks that worked fine.<br>This is how did it if someone else is interested. I removed all the error checking code and kept only the significant part.<br><br> ...<br> GstElement * outputsink = gst_element_factory_make( "gconfaudiosink", "audio-sink" );<br>
GstElement * m_Playbin = gst_element_factory_make( "playbin2", "play" );<br> GstElement * level = gst_element_factory_make( "level", "gulevelctrl" );<br> g_object_set( level, "message", TRUE, NULL );<br>
g_object_set( level, "interval", gint64( 250000000 ), NULL );<br><br> GstElement * replay = gst_element_factory_make( "rgvolume", "replaygain" );<br> g_object_set( replay, "album-mode", false, NULL );<br>
<br> gst_bin_add( GST_BIN( m_Playbin ), replay );<br><br><br> GstElement * sinkbin = gst_bin_new( "outsinkbin" );<br><br> GstElement * converter = gst_element_factory_make( "audioconvert", "aconvert" );<br>
<br> GstPad * pad;<br> GstPad * ghostpad;<br><br> gst_bin_add_many( GST_BIN( sinkbin ), converter, level, outputsink, NULL );<br> gst_element_link_many( converter, level, outputsink, NULL );<br>
<br> pad = gst_element_get_pad( converter, "sink" );<br> ghostpad = gst_ghost_pad_new( "sink", pad );<br> gst_element_add_pad( sinkbin, ghostpad );<br> gst_object_unref( pad );<br>
<br> g_object_set( G_OBJECT( m_Playbin ), "audio-sink", sinkbin, NULL );<br><br> g_object_set( G_OBJECT( m_Playbin ), "flags", 0x02|0x10, NULL );<br> ...<br><br>This way it worked fine and get the level messages. <br>
<br>Thank you all for your help<br>Greets J.Rios<br><br><br><div class="gmail_quote">On Wed, Dec 30, 2009 at 2:30 PM, Stefan Kost <span dir="ltr"><<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">hi,<br>
<br>
Am 28.12.2009 14:34, schrieb J. Rios:<br>
<div class="im">> Hello,<br>
> Im tryign to incorporate the level element into a playbin2. This is<br>
> the significant part of what I have tried<br>
><br>
> GstElement * outputsink;<br>
> outputsink = gst_element_factory_make( "gconfaudiosink", "audio-sink" );<br>
> ...<br>
> GstElement * m_Playbin = gst_element_factory_make( "playbin2", "play" );<br>
> ...<br>
> GstElement * level = gst_element_factory_make( "level", "levelctrl" );<br>
><br>
> GstElement * replay = gst_element_factory_make( "rgvolume",<br>
> "replaygain" );<br>
><br>
><br>
> gst_bin_add( GST_BIN( m_Playbin ), level );<br>
> gst_bin_add( GST_BIN( m_Playbin ), replay );<br>
> g_object_set( G_OBJECT( m_Playbin ), "audio-sink", outputsink, NULL );<br>
><br>
> g_object_set( level, "message", true, NULL );<br>
><br>
> g_object_set( G_OBJECT( m_Playbin ), "flags", 0x02|0x10, NULL );<br>
><br>
> gst_bus_add_watch( gst_pipeline_get_bus( GST_PIPELINE( m_Playbin ) ),<br>
> ( GstBusFunc ) gst_bus_async_callback, this );<br>
><br>
><br>
</div>this cannot work as such. The elements need to be linked in the right order.<br>
What you need to do, is to create an own bin, add level, replay and the<br>
audiosink there, link them and set your bin as the audiosink. You need to add a<br>
ghostpad to the bin and set it to the first (yet unlinked) sink pad of you elements.<br>
<font color="#888888"><br>
Stefan<br>
</font><div class="im"><br>
<br>
> The problem I have is that I dont get the Element messages. All the rest<br>
> works fine including the replay-gain volumen but I dont get the level<br>
> messages in the callback function.<br>
> What I want to do is detect when the sound level is below an user<br>
> defined level so I can skip to next track.<br>
><br>
> I dunno if this is the correct place to put it but I have been tryign to<br>
> search for this with no success. Please if u know what is wrong or how<br>
> it should work let me know<br>
><br>
> Thanks in advance<br>
> J.Rios<br>
><br>
><br>
><br>
</div><div><div></div><div class="h5">> ------------------------------------------------------------------------------<br>
> This SF.Net email is sponsored by the Verizon Developer Community<br>
> Take advantage of Verizon's best-in-class app development support<br>
> A streamlined, 14 day to market process makes app distribution fast and easy<br>
> Join now and get one step closer to millions of Verizon customers<br>
> <a href="http://p.sf.net/sfu/verizon-dev2dev" target="_blank">http://p.sf.net/sfu/verizon-dev2dev</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br>
</div></div></blockquote></div><br>