Accessing the bus of an element in the pipeline

Srinath, Kamaldeep kasrinat at akamai.com
Mon Nov 3 06:48:33 PST 2014


Hello,

I have a gstreamer application and have added a bus watch to the GstBus of the pipeline. In  the call back method for this bus watch, I am detecting the message type GST_MESSAGE_BUFFERING. The goal is to “post” this message to the bus of a particular GstElement in the running pipeline.

My questions:
- Is this possible?
- Is it possible instead to access the bus of the running pipeline from inside a gstreamer filter and post a message to the pipeline’s bus directly from the filter?
- Why do gst_bus_post(element’s bus, msg) AND gst_element_post_message(element, message) not work?

Here’s my sample code:

Inside the app:

        case GST_MESSAGE_BUFFERING:
        {
            gint percent;
            GstElement* filter = NULL;
            GstBus* mybus = NULL;

            gst_message_parse_buffering(msg, &percent);
            if (pipeline != NULL)
            {
                filter = gst_bin_get_by_name(GST_BIN(pipeline), gst_element_get_name(myfilter));
                mybus = gst_element_get_bus(filter);

                gst_bus_post(mybus, msg);  // Wont work.
                gst_element_post_message(filter, msg); //Wont work either.
                gst_object_unref(mabus);
                g_free(filter);
            }
        }



Thanks for pointing out what’s not right here.

Kamal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141103/c0612193/attachment-0001.html>


More information about the gstreamer-devel mailing list