RTP & RTCP restream using rtpbin.
Sebastian Dröge
sebastian at centricular.com
Thu Oct 20 04:31:51 UTC 2016
On Wed, 2016-10-19 at 05:15 -0700, stproj wrote:
> Greetings,
>
> I'm trying to built a streaming application that involves streaming and
> restreaming to different machines the same source and daisy chain them.
>
> What i want to do for starters, is to make rtpbin both a receiver and a
> transmitter of an rtp stream, and its respective rtcp streams. Below, im
> providing the part where I'm trying to link rtpsrc to rtpbin and rtpbin to
> rtpsink, but it doesn't work (can't link rtpbin to rtpsink). If u have any
> suggestion on how should i move pls share the knowledge!!
>
> Thank you in advance,
> S.
>
>
>
> /* the rtpbin element */
> rtpbin = gst_element_factory_make ("rtpbin", "rtpbin");
> g_assert (rtpbin);
>
> gst_bin_add (GST_BIN (pipeline), rtpbin);
>
> /* now link all to the rtpbin, start by getting an RTP sinkpad for session
> 0 */
> srcpad = gst_element_get_static_pad (rtpsrc, "src");
> sinkpad = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_0");
> lres = gst_pad_link (srcpad, sinkpad);
> g_assert (lres == GST_PAD_LINK_OK);
> gst_object_unref (srcpad);
>
> /* get the RTP srcpad that was created when we requested the sinkpad above
> and
> * link it to the rtpsink sinkpad*/
> srcpad = gst_element_get_request_pad (rtpbin, "send_rtp_src_0");
> sinkpad = gst_element_get_static_pad (rtpsink, "sink");
> if (gst_pad_link (srcpad,sinkpad) != GST_PAD_LINK_OK)
> g_error ("Failed to link rtpbin to rtpsink");
"send_rtp_src_%u" is a sometimes pad on rtpbin, not a request pad. It
will appear (check the pad-added signal) at some point and then you can
link it.
You probably also want "recv_rtp_src_%u_%u_%u", which is the pad that
is created (also later, see pad-added) from "recv_rtp_sink_%u".
--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161020/d4c73d6a/attachment.sig>
More information about the gstreamer-devel
mailing list