Index: webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
diff --git a/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java b/webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
similarity index 52% |
copy from webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java |
copy to webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
index 78d1f04a4365bc619604143d33959f01cc7e9dde..05c3c2970d22dfe83c86129829f77fafeed6ef4e 100644 |
--- a/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java |
+++ b/webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
@@ -10,20 +10,20 @@ |
package org.webrtc; |
-import android.annotation.TargetApi; |
+import org.webrtc.CameraEnumerationAndroid.CaptureFormat; |
+ |
import android.content.Context; |
-import android.hardware.camera2.CameraManager; |
-@TargetApi(21) |
-public class Camera2Capturer extends CameraCapturer { |
- private final Context context; |
- private final CameraManager cameraManager; |
+import java.util.List; |
+ |
+public class Camera1Capturer extends CameraCapturer { |
+ private final boolean captureToTexture; |
- public Camera2Capturer(Context context, String cameraName, CameraEventsHandler eventsHandler) { |
- super(cameraName, eventsHandler, new Camera2Enumerator(context)); |
+ public Camera1Capturer(String cameraName, CameraEventsHandler eventsHandler, |
+ boolean captureToTexture) { |
+ super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture)); |
- this.context = context; |
- cameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE); |
+ this.captureToTexture = captureToTexture; |
} |
@Override |
@@ -31,10 +31,8 @@ public class Camera2Capturer extends CameraCapturer { |
CameraSession.CreateSessionCallback createSessionCallback, CameraSession.Events events, |
Context applicationContext, SurfaceTextureHelper surfaceTextureHelper, |
String cameraName, int width, int height, int framerate) { |
- Camera2Session.create( |
- createSessionCallback, events, |
- applicationContext, cameraManager, |
- surfaceTextureHelper, |
- cameraName, width, height, framerate); |
+ Camera1Session.create( |
+ createSessionCallback, events, captureToTexture, applicationContext, surfaceTextureHelper, |
+ Camera1Enumerator.getCameraIndex(cameraName), width, height, framerate); |
} |
} |