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

Unified Diff: webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java

Issue 2187293002: Session based capturing for Camera1Capturer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@camera2session
Patch Set: Add missing setPictureSize. Created 4 years, 3 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 | « webrtc/api/BUILD.gn ('k') | webrtc/api/android/java/src/org/webrtc/Camera1Session.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « webrtc/api/BUILD.gn ('k') | webrtc/api/android/java/src/org/webrtc/Camera1Session.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698