Trying to use equaliser with playbin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to use equaliser with playbin

Yogesh Marwaha
Hi,

I'm trying to make use of equaliser with playbin. Here is the relevant
portion of the code: -

-------------------------------------------------------------------------
    GstElement *m_pPlayBin;
    GstElement *m_pVisualisation;
    GstElement *m_pVideoSink;
    GstElement *m_pAudioSink;
    GstElement *m_pEqualiser;
    GstElement *m_pAudioBin;
    GstPad *m_pAudioBinPad;

    m_pPlayBin = gst_element_factory_make("playbin", "gravity-playbin");

    m_pVisualisation = gst_element_factory_make("goom",
"gravity-playbin-visualisation");
    g_object_set(G_OBJECT(m_pPlayBin), "vis-plugin", m_pVisualisation, NULL);

    m_pVideoSink = gst_element_factory_make("xvimagesink",
"gravity-playbin-video");
    g_object_set(G_OBJECT(m_pPlayBin), "video-sink", m_pVideoSink, NULL);

    m_pAudioSink = gst_element_factory_make("alsasink",
"gravity-playbin-audio");
    m_pEqualiser = gst_element_factory_make("equalizer-10bands",
"gravity-equaliser");

    m_pAudioBin = gst_bin_new("audio-bin");
    m_pAudioBinPad = gst_element_get_static_pad(m_pEqualiser, "sink");
    gst_element_add_pad(m_pAudioBin, gst_ghost_pad_new("sink", m_pAudioBinPad));

    gst_bin_add_many(GST_BIN(m_pAudioBin), m_pEqualiser, m_pAudioSink, NULL);

    g_object_set(G_OBJECT(m_pPlayBin), "audio-sink", m_pAudioBin, NULL);

    gst_object_unref(GST_OBJECT(m_pAudioBinPad));

    gst_element_set_state(m_pPlayBin, GST_STATE_READY);
-------------------------------------------------------------------------
When I set the playbin to playing, state changes to GST_STATE_PLAYING
for a while (nothing is heard from the speakers, though visualisation
is repainted for a moment) and then changes to GST_STATE_PAUSED.
Afterwards if I try to set the state again to playing, the program
just stops responding to any further inputs.

Can you please go through the above code snippet and point out where
am I going wrong.

Thanks,


--
Yogesh M
http://snakeeyes.wordpress.com/

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Trying to use equaliser with playbin

Yogesh Marwaha
Got it, I was not doing
gst_element_link_many(m_pEqualiser, m_pAudioSink, NULL);


Thanks anyway

2009/4/20 Yogesh Marwaha <[hidden email]>:

> Hi,
>
> I'm trying to make use of equaliser with playbin. Here is the relevant
> portion of the code: -
>
> -------------------------------------------------------------------------
>    GstElement *m_pPlayBin;
>    GstElement *m_pVisualisation;
>    GstElement *m_pVideoSink;
>    GstElement *m_pAudioSink;
>    GstElement *m_pEqualiser;
>    GstElement *m_pAudioBin;
>    GstPad *m_pAudioBinPad;
>
>    m_pPlayBin = gst_element_factory_make("playbin", "gravity-playbin");
>
>    m_pVisualisation = gst_element_factory_make("goom",
> "gravity-playbin-visualisation");
>    g_object_set(G_OBJECT(m_pPlayBin), "vis-plugin", m_pVisualisation, NULL);
>
>    m_pVideoSink = gst_element_factory_make("xvimagesink",
> "gravity-playbin-video");
>    g_object_set(G_OBJECT(m_pPlayBin), "video-sink", m_pVideoSink, NULL);
>
>    m_pAudioSink = gst_element_factory_make("alsasink",
> "gravity-playbin-audio");
>    m_pEqualiser = gst_element_factory_make("equalizer-10bands",
> "gravity-equaliser");
>
>    m_pAudioBin = gst_bin_new("audio-bin");
>    m_pAudioBinPad = gst_element_get_static_pad(m_pEqualiser, "sink");
>    gst_element_add_pad(m_pAudioBin, gst_ghost_pad_new("sink", m_pAudioBinPad));
>
>    gst_bin_add_many(GST_BIN(m_pAudioBin), m_pEqualiser, m_pAudioSink, NULL);
>
>    g_object_set(G_OBJECT(m_pPlayBin), "audio-sink", m_pAudioBin, NULL);
>
>    gst_object_unref(GST_OBJECT(m_pAudioBinPad));
>
>    gst_element_set_state(m_pPlayBin, GST_STATE_READY);
> -------------------------------------------------------------------------
> When I set the playbin to playing, state changes to GST_STATE_PLAYING
> for a while (nothing is heard from the speakers, though visualisation
> is repainted for a moment) and then changes to GST_STATE_PAUSED.
> Afterwards if I try to set the state again to playing, the program
> just stops responding to any further inputs.
>
> Can you please go through the above code snippet and point out where
> am I going wrong.
>
> Thanks,
>
>
> --
> Yogesh M
> http://snakeeyes.wordpress.com/
>



--
Yogesh M
http://snakeeyes.wordpress.com/
http://linuxdiscs.blogspot.com

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel