OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 package org.webrtc; | 11 package org.webrtc; |
12 | 12 |
13 import org.webrtc.CameraEnumerationAndroid.CaptureFormat; | |
14 | |
15 import android.content.Context; | 13 import android.content.Context; |
16 | 14 import android.media.MediaRecorder; |
17 import java.util.List; | |
18 | 15 |
19 public class Camera1Capturer extends CameraCapturer { | 16 public class Camera1Capturer extends CameraCapturer { |
20 private final boolean captureToTexture; | 17 private final boolean captureToTexture; |
21 | 18 |
22 public Camera1Capturer( | 19 public Camera1Capturer( |
23 String cameraName, CameraEventsHandler eventsHandler, boolean captureToTex
ture) { | 20 String cameraName, CameraEventsHandler eventsHandler, boolean captureToTex
ture) { |
24 super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture)); | 21 super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture)); |
25 | 22 |
26 this.captureToTexture = captureToTexture; | 23 this.captureToTexture = captureToTexture; |
27 } | 24 } |
28 | 25 |
29 @Override | 26 @Override |
30 protected void createCameraSession(CameraSession.CreateSessionCallback createS
essionCallback, | 27 protected void createCameraSession(CameraSession.CreateSessionCallback createS
essionCallback, |
31 CameraSession.Events events, Context applicationContext, | 28 CameraSession.Events events, Context applicationContext, |
32 SurfaceTextureHelper surfaceTextureHelper, String cameraName, int width, i
nt height, | 29 SurfaceTextureHelper surfaceTextureHelper, MediaRecorder mediaRecorder, St
ring cameraName, |
33 int framerate) { | 30 int width, int height, int framerate) { |
| 31 if (mediaRecorder != null) { |
| 32 throw new RuntimeException("MediaRecoder is not supported for camera 1."); |
| 33 } |
34 Camera1Session.create(createSessionCallback, events, captureToTexture, appli
cationContext, | 34 Camera1Session.create(createSessionCallback, events, captureToTexture, appli
cationContext, |
35 surfaceTextureHelper, Camera1Enumerator.getCameraIndex(cameraName), widt
h, height, | 35 surfaceTextureHelper, Camera1Enumerator.getCameraIndex(cameraName), widt
h, height, |
36 framerate); | 36 framerate); |
37 } | 37 } |
38 } | 38 } |
OLD | NEW |