[gst-devel] level element in playbin2

Stefan Kost ensonic at hora-obscura.de
Wed Dec 30 15:30:15 CET 2009


hi,

Am 28.12.2009 14:34, schrieb J. Rios:
> Hello,
>    Im tryign to incorporate the level element into a playbin2. This is
> the significant part of what I have tried
> 
>     GstElement * outputsink;
>     outputsink = gst_element_factory_make( "gconfaudiosink", "audio-sink" );
> ...
>     GstElement * m_Playbin = gst_element_factory_make( "playbin2", "play" );
> ...
>     GstElement * level = gst_element_factory_make( "level", "levelctrl" );
> 
>     GstElement * replay = gst_element_factory_make( "rgvolume",
> "replaygain" );
> 
> 
>     gst_bin_add( GST_BIN( m_Playbin ), level );
>     gst_bin_add( GST_BIN( m_Playbin ), replay );
>     g_object_set( G_OBJECT( m_Playbin ), "audio-sink", outputsink, NULL );
> 
>     g_object_set( level, "message", true, NULL );
> 
>     g_object_set( G_OBJECT( m_Playbin ), "flags", 0x02|0x10, NULL );
> 
>     gst_bus_add_watch( gst_pipeline_get_bus( GST_PIPELINE( m_Playbin ) ),
>             ( GstBusFunc ) gst_bus_async_callback, this );
> 
> 
this cannot work as such. The elements need to be linked in the right order.
What you need to do, is to create an own bin, add level, replay and the
audiosink there, link them and set your bin as the audiosink. You need to add a
ghostpad to the bin and set it to the first (yet unlinked) sink pad of you elements.

Stefan


> The problem I have is that I dont get the Element messages. All the rest
> works fine including the replay-gain volumen but I dont get the level
> messages in the callback function.
> What I want to do is detect when the sound level is below an user
> defined level so I can skip to next track.
> 
> I dunno if this is the correct place to put it but I have been tryign to
> search for this with no success. Please if u know what is wrong or how
> it should work let me know
> 
> Thanks in advance
> J.Rios
> 
> 
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> 
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list