webrtcbin how to add-local-ip-address

389 views
Skip to first unread message

lionel mazeyrat

unread,
Sep 6, 2021, 2:24:51 PM9/6/21
to gstreamer-java
I try to add-local-ip-address for a webrtc bin based on example :

but I can't figure out how to set the local ip adress parameter ?


GstWebRTCICE 
GObject.Object ╰──GObject.InitiallyUnowned ╰──Gst.Object ╰──GstWebRTCICE
Action Signals
add-local-ip-address let ret = object.emit ("add-local-ip-address", address);

Add a local IP address to use for ICE candidate gathering. If none are supplied, they will be discovered automatically. Calling this signal stops automatic ICE gathering.

Parameters:

object (Gst.Element ) – 

the GstWebRTCICE

address (String) – 

The local IP address

Returns (Number) – 

whether the address could be added.

Flags: Run Last / Action

Neil C Smith

unread,
Sep 7, 2021, 7:04:19 AM9/7/21
to gstream...@googlegroups.com
Hi,

On Mon, 6 Sept 2021 at 19:24, lionel mazeyrat <lionel....@gmail.com> wrote:
>
> I try to add-local-ip-address for a webrtc bin based on example :
>
> https://github.com/gstreamer-java/gst1-java-examples/blob/master/WebRTCSendRecv/src/main/java/org/freedesktop/gstreamer/examples/WebRTCSendRecv.java
>
> but I can't figure out how to set the local ip adress parameter ?
>
> https://gstreamer.freedesktop.org/documentation/webrtc/index.html?gi-language=javascript#GstWebRTCICE
>
Probably using GObject::emit. I think you might need to pass a JNA
PointerByReference, check for a result, and then get the String from
there.

See code at https://github.com/gstreamer-java/gst1-java-core/blob/master/src/org/freedesktop/gstreamer/glib/GObject.java#L137
but use the other emit() method. Be good to fix up this area and get
the variant accepting a Class to support more than just NativeObject.
Unfortunately, it's not been a priority area for us so far, and the
inherited code is mostly as was, and not documented.

Best wishes,

Neil


--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD

lionel mazeyrat

unread,
May 28, 2022, 3:49:22 AM5/28/22
to gstreamer-java
where do you find a  PointerByReference for  GstWebRTCICE ?

lionel mazeyrat

unread,
Feb 11, 2023, 5:40:40 AM2/11/23
to gstreamer-java
anybody else interested in better webrtcbin settings with GstWebRTCICE  object acces to manage "dd-local-ip-address" and  min-rtp-port and max-rtp-port ???

lionel mazeyrat

unread,
Sep 17, 2023, 5:33:15 AM9/17/23
to gstreamer-java
Still looking for a solution to set min-rtp-port and max-rtp-port....


Le samedi 11 février 2023 à 11:40:40 UTC+1, lionel mazeyrat a écrit :
anybody else interested in better webrtcbin settings with GstWebRTCICE  object acces to manage "add-local-ip-address" and  min-rtp-port and max-rtp-port ???

Neil C Smith

unread,
Sep 17, 2023, 5:57:50 AM9/17/23
to gstream...@googlegroups.com
Hi,

On Sun, 17 Sept 2023 at 10:33, lionel mazeyrat
<lionel....@gmail.com> wrote:
> Still looking for a solution to set min-rtp-port and max-rtp-port....
>
> https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/119

As things currently stand, gst1-java-core is no longer under active
development - see
https://groups.google.com/g/gstreamer-java/c/Beeb5rRVRWU/m/VPQjyzKQAQAJ

So, the solution is probably to undertake your own low-level binding
of the native GStreamer features your project actually requires, using
JNA or Panama directly. This is something I've done for a number of
clients in the past, and something I'm now considering for my own
projects.

It is a shame to no longer have a comprehensive, higher-level Java
binding in active development, but as of now there seems not to be an
interest in sustaining it.

Best wishes,

Neil

--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : 3rd Floor Suite, 207 Regent Street,
London, W1B 3HH, England

lionel mazeyrat

unread,
Sep 17, 2023, 12:33:06 PM9/17/23
to gstream...@googlegroups.com
It's really a shame. Video support for Java is very limited. Low level is far more difficult to master and error prone.

Perhaps a commercial version officielle the core library could be an option if the license price is reasonable 

--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/CAPxOS5H1KhQHHwcga0HE%3D%3DEX-FZVZVzu3p-E06fYYvDNu7OpAQ%40mail.gmail.com.

lionel mazeyrat

unread,
Sep 18, 2023, 3:52:28 PM9/18/23
to gstreamer-java
I will try something like:

    private final ON_NEGOTIATION_NEEDED onNegotiationNeeded = elem -> {
Element webRTCICE = Natives.objectFor(webRTCBin.get("ice-agent"), Element.class, false, true)
webRTCICE.emit("min_rtp_port",40000)
webRTCICE.emit("max_rtp_port",40100)

        LOG.info(() -> "onNegotiationNeeded: " + elem.getName());

        // When webrtcbin has created the offer, it will hit our callback and we
        // send SDP offer over the websocket to signalling server
        webRTCBin.createOffer(onOfferCreated);
    };

but I am not sure about Natives.objectFor parameters : false, true ?
Reply all
Reply to author
Forward
0 new messages