Fix WebRTC

This commit is contained in:
Mario Danic 2018-10-06 06:38:21 +02:00
parent 088a21e4b9
commit 27eaf02485
3 changed files with 6 additions and 2 deletions

View File

@ -166,7 +166,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.8.0@aar'
implementation 'org.webrtc:google-webrtc:1.0.24896'
implementation 'org.webrtc:google-webrtc:1.0.23295'
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
implementation 'com.yarolegovich:lovely-dialog:1.1.0'

View File

@ -95,6 +95,7 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Lif
PeerConnectionFactory.initialize(PeerConnectionFactory.InitializationOptions.builder(this)
.setEnableVideoHwAcceleration(MagicWebRTCUtils.shouldEnableVideoHardwareAcceleration())
.createInitializationOptions());
} catch (UnsatisfiedLinkError e) {
Log.w(TAG, e);

View File

@ -330,6 +330,9 @@ public class CallController extends BaseController {
PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
peerConnectionFactory = PeerConnectionFactory.builder().createPeerConnectionFactory();
peerConnectionFactory.setVideoHwAccelerationOptions(rootEglBase.getEglBaseContext(),
rootEglBase.getEglBaseContext());
//Create MediaConstraints - Will be useful for specifying video and audio constraints.
audioConstraints = new MediaConstraints();
videoConstraints = new MediaConstraints();
@ -530,7 +533,7 @@ public class CallController extends BaseController {
//Create a VideoSource instance
if (videoCapturer != null) {
videoSource = peerConnectionFactory.createVideoSource(false);
videoSource = peerConnectionFactory.createVideoSource(videoCapturer);
localVideoTrack = peerConnectionFactory.createVideoTrack("NCv0", videoSource);
localMediaStream.addTrack(localVideoTrack);
localVideoTrack.setEnabled(false);