Mario Danic 6 vuotta sitten
vanhempi
commit
27eaf02485

+ 1 - 1
app/build.gradle

@@ -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'

+ 1 - 0
app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.java

@@ -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);

+ 4 - 1
app/src/main/java/com/nextcloud/talk/controllers/CallController.java

@@ -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);