mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-05 11:59:48 +01:00
Use Camera2 where available
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
effcc34ae2
commit
84db3be5c8
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.activities;
|
package com.nextcloud.talk.activities;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -72,6 +73,7 @@ import org.parceler.Parcels;
|
|||||||
import org.webrtc.AudioSource;
|
import org.webrtc.AudioSource;
|
||||||
import org.webrtc.AudioTrack;
|
import org.webrtc.AudioTrack;
|
||||||
import org.webrtc.Camera1Enumerator;
|
import org.webrtc.Camera1Enumerator;
|
||||||
|
import org.webrtc.Camera2Enumerator;
|
||||||
import org.webrtc.CameraEnumerator;
|
import org.webrtc.CameraEnumerator;
|
||||||
import org.webrtc.EglBase;
|
import org.webrtc.EglBase;
|
||||||
import org.webrtc.IceCandidate;
|
import org.webrtc.IceCandidate;
|
||||||
@ -115,7 +117,8 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
private static final String TAG = "CallActivity";
|
private static final String TAG = "CallActivity";
|
||||||
private static final String[] PERMISSIONS_CALL = {
|
private static final String[] PERMISSIONS_CALL = {
|
||||||
android.Manifest.permission.CAMERA,
|
android.Manifest.permission.CAMERA,
|
||||||
android.Manifest.permission.RECORD_AUDIO
|
android.Manifest.permission.RECORD_AUDIO,
|
||||||
|
Manifest.permission.MODIFY_AUDIO_SETTINGS
|
||||||
};
|
};
|
||||||
@BindView(R.id.pip_video_view)
|
@BindView(R.id.pip_video_view)
|
||||||
SurfaceViewRenderer pipVideoView;
|
SurfaceViewRenderer pipVideoView;
|
||||||
@ -187,7 +190,15 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private VideoCapturer createVideoCapturer() {
|
private VideoCapturer createVideoCapturer() {
|
||||||
videoCapturer = createCameraCapturer(new Camera1Enumerator(false));
|
CameraEnumerator cameraEnumerator;
|
||||||
|
|
||||||
|
if (Camera2Enumerator.isSupported(this)) {
|
||||||
|
cameraEnumerator = new Camera2Enumerator(this);
|
||||||
|
} else {
|
||||||
|
cameraEnumerator = new Camera1Enumerator(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
videoCapturer = createCameraCapturer(cameraEnumerator);
|
||||||
return videoCapturer;
|
return videoCapturer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user