Invoking "add-local-ip-address" on GstWebRTCICE

Matthew Waters ystreet00 at gmail.com
Fri Jul 17 02:47:14 UTC 2020



On 17/7/20 7:55 am, Ben Rush wrote:
> Admittedly I seem to occasionally get myself confused when it comes to
> navigating objects and their properties in the GLib Object System.
> Often I find myself exploring sample code and piecing together an
> understanding from that. However, I can't seem to get at what I need
> here and am hoping someone can help. 
>
> First, the main problem I'm attempting to solve is forcing WebRTCBin
> to restrict the addresses and ports used when generating ICE
> candidates. I'm behind a firewall, don't want to / can't use a TURN
> server in my specific scenario, and so would like to specify the exact
> ports / addresses to be considered as candidates. From examining the
> source, it appears as though my only way to do that is to rely on
> emitting this signal with the address information (IP/port): 
>
> https://gstreamer.freedesktop.org/documentation/webrtc/index.html?gi-language=c#GstWebRTCICE::add-local-ip-address
>
> So, I assume I'll need to call g_signal_emit_by_name() with the proper
> arguments, one of which being the object to receive the signal. All
> well and good, except for the fact that the receiving object is of
> type GstWebRTCICE. So, I need to get that object. Per this
> documentation: https://gstreamer.freedesktop.org/documentation/webrtc/index.html?gi-language=c#webrtcbin:ice-agent it
> appears to be a property on the webrtcbin element. 
>
> So, I have this code:  
>
>     _pipeline = gst_parse_launch("webrtcbin bundle-policy=max-bundle
> name=sendrecv "
>         "autoaudiosrc ! audioconvert ! audioresample ! queue ! opusenc
> ! rtpopuspay ! "
>         "queue ! " RTP_CAPS_OPUS "97 ! sendrecv. ", &error);
> .....
>     _webRtcElement = gst_bin_get_by_name(GST_BIN(_pipeline), "sendrecv");
> .....
>             GValue value = { 0, };
>             g_value_init(&value, G_TYPE_OBJECT);
>             g_object_get_property(G_OBJECT(_webRtcElement),
> "ice-agent", &value);
>             GObject* object = (GObject*)g_value_get_object(&value);
>
> But the value of the object is always null. What am I doing wrong? How
> am I navigating this improperly?

Do you have a version of GStreamer that includes that?  The 'ice-agent'
property on webrtcbin and 'add-local-ip-address' on gstwebrtcice is only
available in master and is not in any released version yet.

> Also, I noticed this merge
> request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/856.
> I'm hoping this doesn't mean forcing a particular IP/port is even
> possible with webrtcbin.

This MR would probably by your best bet but it needs updating to place
the necessary properties on the ICE object rather than on webrtcbin itself.

Cheers
-Matt

> Thanks in advance. 
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200717/c51eacfc/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200717/c51eacfc/attachment-0001.sig>


More information about the gstreamer-devel mailing list