Index: webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
diff --git a/webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java b/webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1083cb003d015758339706d119164c14ae75b204 |
--- /dev/null |
+++ b/webrtc/api/android/java/src/org/webrtc/Camera1Capturer.java |
@@ -0,0 +1,51 @@ |
+/* |
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+package org.webrtc; |
+ |
+import org.webrtc.CameraEnumerationAndroid.CaptureFormat; |
+ |
+import android.content.Context; |
+import android.os.Handler; |
magjed_webrtc
2016/08/11 12:57:13
You have some unused imports here, no?
sakal
2016/08/15 09:11:57
Yeah, my plugin had malfunctioned and I have learn
|
+import android.os.SystemClock; |
+ |
+import java.util.List; |
+ |
+public class Camera1Capturer extends CameraCapturer { |
+ private final boolean captureToTexture; |
+ |
+ public Camera1Capturer(String cameraName, CameraEventsHandler eventsHandler, |
+ boolean captureToTexture) { |
+ super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture)); |
+ |
+ this.captureToTexture = captureToTexture; |
+ } |
+ |
+ @Override |
+ public List<CaptureFormat> getSupportedFormats() { |
+ return Camera1Enumerator.getSupportedFormats(getCameraIndex()); |
magjed_webrtc
2016/08/11 12:57:13
Inline getCameraIndex() and remove the function.
sakal
2016/08/15 09:11:57
Done.
|
+ } |
+ |
+ @Override |
+ protected void createCameraSession( |
+ CameraSession.CreateSessionCallback createSessionCallback, CameraEventsHandler eventsHandler, |
+ Context applicationContext, CameraVideoCapturer.CapturerObserver capturerObserver, |
+ SurfaceTextureHelper surfaceTextureHelper, |
+ String cameraName, int width, int height, int framerate) { |
+ Camera1Session.create( |
+ createSessionCallback, eventsHandler, captureToTexture, |
+ applicationContext, capturerObserver, surfaceTextureHelper, |
+ Camera1Enumerator.getCameraIndex(cameraName), width, height, framerate); |
+ } |
+ |
+ private int getCameraIndex() { |
+ return Camera1Enumerator.getCameraIndex(getCameraName()); |
+ } |
+} |