Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java

Issue 2434533003: Remove check for numberOfCameras from AppRTC Mobile PeerConnectionClient. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
index 4ed34120e4f276e54c972997c0a9416e3a70b297..8166b90adc2ee1be67e86a8d6bc1815f8ec4acfd 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
@@ -19,10 +19,6 @@ import android.util.Log;
import org.webrtc.AudioSource;
import org.webrtc.AudioTrack;
-import org.webrtc.Camera1Enumerator;
-import org.webrtc.Camera2Enumerator;
-import org.webrtc.CameraEnumerationAndroid;
-import org.webrtc.CameraEnumerator;
import org.webrtc.CameraVideoCapturer;
import org.webrtc.DataChannel;
import org.webrtc.EglBase;
@@ -41,9 +37,6 @@ import org.webrtc.StatsObserver;
import org.webrtc.StatsReport;
import org.webrtc.VideoCapturer;
import org.webrtc.VideoRenderer;
-import org.webrtc.VideoCapturerAndroid;
-import org.webrtc.CameraVideoCapturer;
-import org.webrtc.FileVideoCapturer;
import org.webrtc.VideoSource;
import org.webrtc.VideoTrack;
import org.webrtc.voiceengine.WebRtcAudioManager;
@@ -130,7 +123,6 @@ public class PeerConnectionClient {
private boolean isInitiator;
private SessionDescription localSdp; // either offer or answer SDP
private MediaStream mediaStream;
- private int numberOfCameras;
private VideoCapturer videoCapturer;
// enableVideo is set to true if video should be rendered and sent.
private boolean renderVideo;
@@ -416,8 +408,7 @@ public class PeerConnectionClient {
}
// Check if there is a camera on device and disable video call if not.
- numberOfCameras = CameraEnumerationAndroid.getDeviceCount();
- if (numberOfCameras == 0) {
+ if (videoCapturer == null) {
Log.w(TAG, "No camera on device. Switch to audio only call.");
videoCallEnabled = false;
}
@@ -964,9 +955,8 @@ public class PeerConnectionClient {
private void switchCameraInternal() {
if (videoCapturer instanceof CameraVideoCapturer) {
- if (!videoCallEnabled || numberOfCameras < 2 || isError || videoCapturer == null) {
- Log.e(TAG, "Failed to switch camera. Video: " + videoCallEnabled + ". Error : " + isError
- + ". Number of cameras: " + numberOfCameras);
+ if (!videoCallEnabled || isError || videoCapturer == null) {
+ Log.e(TAG, "Failed to switch camera. Video: " + videoCallEnabled + ". Error : " + isError);
return; // No video is sent or only one camera is available or error happened.
}
Log.d(TAG, "Switch camera");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698