[gst-devel] Re: problem with the getting the output of goom
Vincent Torri
Vincent.Torri at iecn.u-nancy.fr
Sun Feb 12 10:17:02 CET 2006
I've solved that problem
Vincent Torri
On Fri, 10 Feb 2006, Vincent Torri wrote:
>
> Hello,
>
> i would like to display the output of the goom element. In the pipeline, I
> have the following elements :
>
> +---------------------------------------------------------------+
> | +------+ +-------------+ |
> | | tee | | | pipeline |
> | | +---+ audio sink | |
> | | | | | |
> | | | +-------------+ |
> | | | |
> | | | +----------------------------------------------+ |
> | | | | vis bin | |
> | | | | +------+ +------+ +-------+ +------+ | |
> | | | | | | | | | | | | | |
> | | +---+---+ conv +---+ goom +---+ queue +---+ fake | | |
> | | | | | | | | | | | sink | | |
> | | | | +------+ +------+ +-------+ +------+ | |
> | +------+ +----------------------------------------------+ |
> +---------------------------------------------------------------+
>
> I have a tee and an audio sink.
>
> 1) When there is a video stream, the vis bin is not added and the pipeline
> plays the video and audio perfectly.
>
> 2) When there is no video, I add the vis bin, like above: I create a bin
> that I add to the pipeline, I link it to the tee. I connect to the
> fakesink a callback on the handoff signal. The audio plays well, but the
> handoff callback is not called.
>
> Here is the construction of the vis bin :
>
> static GstElement *
> _em_visualisation_sink_create (Emotion_Gstreamer_Video *ev,
> Emotion_Video_Sink *vsink)
> {
> GstElement *visbin;
> GstElement *conv;
> GstElement *vis;
> GstElement *queue;
> GstPad *pad;
>
> visbin = gst_bin_new ("visbin");
>
> conv = gst_element_factory_make ("audioconvert", "aconv");
> vis = gst_element_factory_make ("goom", "vis");
> queue = gst_element_factory_make ("queue", NULL);
> vsink->sink = gst_element_factory_make ("fakesink", NULL);
> g_object_set (G_OBJECT (vsink->sink), "sync", TRUE, NULL);
> g_object_set (G_OBJECT (vsink->sink), "signal-handoffs", TRUE, NULL);
> g_signal_connect (G_OBJECT (vsink->sink),
> "handoff",
> G_CALLBACK (cb_handoff), ev);
>
> gst_bin_add_many (GST_BIN (visbin), conv, vis, queue, vsink->sink,
> NULL);
> gst_element_link_many (conv, vis, queue, vsink->sink, NULL);
>
> pad = gst_element_get_pad (conv, "sink");
> gst_element_add_pad (visbin, gst_ghost_pad_new ("sink", pad));
> gst_object_unref (pad);
>
> return visbin;
> }
>
> Here is how I add that bin:
>
> {
> GstElement *vissink;
> GstElement *tee;
> GstPad *vispad;
> GstPad *teepad;
>
> vissink = _em_visualisation_sink_create (ev);
> gst_bin_add (GST_BIN (ev->pipeline), vissink);
> tee = gst_bin_get_by_name (GST_BIN (ev->pipeline), "tee1");
>
> vispad = gst_element_get_pad (vissink, "sink");
> teepad = gst_element_get_request_pad (tee, "src%d");
> gst_pad_link (teepad, vispad);
> gst_object_unref (teepad);
> gst_object_unref (vispad);
>
> gst_element_set_state (vissink, GST_STATE_PAUSED);
> }
>
> It's not a problem with the audio as the audio stream plays fine. The
> callback is just not called.
>
> I've also tried to not use the vis bin, and add and link directly the
> elements (and set them in the PAUSED state). Same problem.
>
> Maybe it's a stupid thing like an element not linked or not added, but I
> have verified that a lot of times.
>
> Maybe it's a bit deeper and I don't see the problem.
>
> Does someone see a problem with that code ?
>
> thank you
>
> Vincent Torri
>
More information about the gstreamer-devel
mailing list