RTSP Server from a manually created and linked pipeline

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

RTSP Server from a manually created and linked pipeline

bomba
Hello,

I want to manually create each element of the pipeline and create an RTSP server that launches it.

The default method :
    gst_rtsp_media_factory_set_launch (factory, "( element ! element ! rtppayload name=pay0 )");
Won't work for me.

I wonder if something like:
    gst_bin_add_many (GST_BIN (pipeline), element, element, rtppayload);
    gst_rtsp_media_factory_set_launch (factory, pipeline);
is possible, and how can it be accomplished.


Best regards,
J
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

Dmitry Valento
Hello, bomba
I'm doing the same thing.

Take a look on this answer:

http://gstreamer-devel.966125.n4.nabble.com/Using-C-API-based-pipelines-in-RTSP-server-without-launch-arg-tp4680144p4680176.html

I've made almost the same - but I reimplement
_GstRTSPMediaFactoryClass->construct() instead of create_element()
vfunc. Both variants work.


On 10/28/2016 04:22 PM, bomba wrote:

> Hello,
>
> I want to manually create each element of the pipeline and create an RTSP
> server that launches it.
>
> The default method :
>      gst_rtsp_media_factory_set_launch (factory, "( element ! element !
> rtppayload name=pay0 )");
> Won't work for me.
>
> I wonder if something like:
>      gst_bin_add_many (GST_BIN (pipeline), element, element, rtppayload);
>      gst_rtsp_media_factory_set_launch (factory, pipeline);
> is possible, and how can it be accomplished.
>
>
> Best regards,
> J
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/RTSP-Server-from-a-manually-created-and-linked-pipeline-tp4680305.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

Dmitry Valento
In reply to this post by bomba
You may examine GstRTSPMediaFactoryURI as example of inheritance
GstRTSPMediaFactory. Which also override create_element() vfunc.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

bomba
In reply to this post by Dmitry Valento
Hi Dimitri!

How did you do that?

default_construct (GstRTSPMediaFactory * factory, const GstRTSPUrl * url)
{
}

to

default_construct (GstRTSPMediaFactory * factory, GstElement * pipeline)
{
}

?
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

Dmitry Valento
It should look like this (mandatory instructions):


static GstRTSPMedia
*rtsp_media_factory_shared_construct(GstRTSPMediaFactory *factory, const
GstRTSPUrl *url)
{

  GstRTSPMedia *media = g_object_new(GST_TYPE_RTSP_MEDIA, "element",
your_bin, NULL);

  gst_rtsp_media_collect_streams (media);

  gst_rtsp_media_take_pipeline(media, GST_PIPELINE_CAST(your_pipeline));

  return media;

}


On 10/28/2016 04:55 PM, bomba wrote:

> Hi Dimitri!
>
> How did you do that?
>
> default_construct (GstRTSPMediaFactory * factory, const GstRTSPUrl * url)
> {
> }
>
> to
>
> default_construct (GstRTSPMediaFactory * factory, GstElement * pipeline)
> {
> }
>
> ?
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/RTSP-Server-from-a-manually-created-and-linked-pipeline-tp4680305p4680307.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

bomba
  GstRTSPMedia *media = g_object_new(GST_TYPE_RTSP_MEDIA, "element",
your_bin, NULL);

What is "your_bin" ?
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

Dmitry Valento
On 10/28/2016 07:01 PM, bomba wrote:
>>    GstRTSPMedia *media = g_object_new(GST_TYPE_RTSP_MEDIA, "element",
>> your_bin, NULL);
> What is "your_bin" ?
>
your_bin - container for all your GstElements. You have to add
GstElements to it.
your_pipeline - top-level container, which will include "your_bin".
"your_pipeline" is used for catch Bus messages.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

bomba
I ended up overriding create_element().

Not sure about how to get bus messages at this point.

+         si.bus = gst_pipeline_get_bus (GST_PIPELINE (si.pipeline));
+         if (!si.bus)
+                 g_printerr ("Could not get bus\n");
+
+         gst_bus_add_signal_watch (si.bus);
+
+         /*      Connect to bus messages */
+         g_signal_connect (si.bus, "message", G_CALLBACK (bus_message), &si);

Does not produce any effect.
Reply | Threaded
Open this post in threaded view
|

Re: RTSP Server from a manually created and linked pipeline

Dmitry Valento
At first, make sure that your pipeline is a really top-level element.

It's better to get Bus after constructing of full RTSP pipeline. You may
use signal "media-constructed" for this purpose:

g_signal_connect(factory, "media-constructed",
G_CALLBACK(store_media_pipeline), (gpointer)NULL);

At second, try to pop Bus messages manually in main loop (without signal
connection), like:
gst_bus_timed_pop_filtered(bus, 1000000, GST_MESSAGE_ANY);

On 11/02/2016 01:51 PM, bomba wrote:

> I ended up overriding create_element().
>
> Not sure about how to get bus messages at this point.
>
> +         si.bus = gst_pipeline_get_bus (GST_PIPELINE (si.pipeline));
> +         if (!si.bus)
> +                 g_printerr ("Could not get bus\n");
> +
> +         gst_bus_add_signal_watch (si.bus);
> +
> +         /*      Connect to bus messages */
> +         g_signal_connect (si.bus, "message", G_CALLBACK (bus_message),
> &si);
>
> Does not produce any effect.
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/RTSP-Server-from-a-manually-created-and-linked-pipeline-tp4680305p4680395.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel