gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
194 stars 72 forks source link

WebRTCBin.createAnswer() callback not called sporadically (promise garbage collected) #270

Open jw-meelogic opened 1 year ago

jw-meelogic commented 1 year ago

Looks like the promise which is used inside the method sometimes gets garbage collected before callback is called.

reproducible with:

webRtcBin.createAnswer(answer -> {
   System.out.println("ANSWER");
});
System.gc();
neilcsmith-net commented 1 year ago

Yes, think I can see where the problem lies there. Most of the webrrc code was donated by someone who has not contributed for some time. Few options to consider to fix. Do you want to take it on?

jw-meelogic commented 1 year ago

See pull request

neilcsmith-net commented 1 year ago

See pull request

Thanks. That might be the simplest way to fix this, although I have a slight concern on that implementation.

As and when we know whether there will be any further releases of this library, I'll review and/or merge.

jw-meelogic commented 1 year ago

Extended the pull request with data channel support.