Convert RTP pipeline to RTSP and it uses GstMessages

Jan Schmidt thaytan at noraisin.net
Thu Nov 16 11:53:21 UTC 2017


Hi,

On 20/10/17 18:55, Toon Heyrman wrote:
> Hi,
>
> I wrote a gstreamer application that has a RTP stream and I want to convert
> this program to a RTSP stream. The major problem is that I used GstMessages
> to communicate from one Element to another via the GstBus in the main
> application. 
>
> The idee is:
> I have a video path with low latency and a computation path that skips a lot
> of frames and has more latency. The GstMessages are send from the
> computation path to the main application and in there I feed the data to an
> annotation element in the video path. 
>
> So what I did in the RTP variant is: 
> I made a pipeline with 'gst_parse_launch' and used this pipeline(as a
> GstElement) to get the GstBus. 
> Add a watch on this bus and use this callback to send the GstMessages to
> another element in the pipeline. (via a pointer to a struct received via
> g_object_get).
>
> When I try to convert this program to one using RTSP, I struggle to get the
> GstMessages from the bus.
> I made a subclass MediaFactory where I override the create_element and save
> a pointer to the pipeline(GstElement) received from gst_parse_launch. 
> Then in the main application I make my MediaFactory and connect the
> media-configure to a callback function. In this callback function I get the
> GstBus(saved in my factory) from the factory and try to add a watch to this
> Bus. 
> But I get an error 'gst_bus_create_watch: assertion 'bus->priv->poll !=
> NULL' failed'.
You get this error because the gst-rtsp-server has already installed a
message watch on the bus, and there can only be 1 at a time.

The only way I can think of to work around that is to place your
elements and pipeline piece inside a custom GstBin instead of the
default one. Derive your own GstBin sub-class,
and override the handle_message virtual method. That way, you can siphon
off the messages you're interested in, and pass the others to the parent
GstBin implementation to get normal behaviour for all other messages.

Regards,
Jan.

> Is this the correct way to receive messages from the created bus in a RTSP
> scenario? 
>
>
> Similar posts:
> http://gstreamer-devel.966125.n4.nabble.com/Using-C-API-based-pipelines-in-RTSP-server-without-quot-launch-quot-arg-td4680144.html#a4680415
> <http://gstreamer-devel.966125.n4.nabble.com/Using-C-API-based-pipelines-in-RTSP-server-without-quot-launch-quot-arg-td4680144.html#a4680415>  
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list