I'm not a C++ dev at all, so it's just a monkey copy-pasting some code from JNI_Device_CreateSendTransport to JNI_Device_Load.
What was done:
Added options parameter to Device.load(String routerRtpCapabilities, PeerConnection.Options options)
Updated Device.nativeLoad
Updated jni headers with jni-generator.sh
Updated JNI_Device_Load in device_jni.cpp
Fixed tests
Why was it done?
To fix the issue #12, the problem is with multiple instances of PeerConnectionFactory created by mediasoup-client internally. So, applications must provide a shared instance using options in Device.loadDevice.createSendTransport and Device.createRecvTransport
final String routerRtpCapabilities = mProtoo.syncRequest("getRouterRtpCapabilities");
final PeerConnection.Options options = new PeerConnection.Options();
options.setFactory(mPeerConnectionUtils.getSharedPeerConnectionFactory(mContext));
mMediasoupDevice = new Device();
mMediasoupDevice.load(routerRtpCapabilities, options);
I'm not a C++ dev at all, so it's just a monkey copy-pasting some code from JNI_Device_CreateSendTransport to JNI_Device_Load.
What was done:
Device.load(String routerRtpCapabilities, PeerConnection.Options options)
Device.nativeLoad
jni-generator.sh
device_jni.cpp
Why was it done? To fix the issue #12, the problem is with multiple instances of PeerConnectionFactory created by mediasoup-client internally. So, applications must provide a shared instance using options in
Device.load
Device.createSendTransport
andDevice.createRecvTransport