OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 package org.webrtc; | |
12 | |
13 import org.webrtc.CameraEnumerationAndroid.CaptureFormat; | |
14 | |
15 import android.content.Context; | |
16 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
| |
17 import android.os.SystemClock; | |
18 | |
19 import java.util.List; | |
20 | |
21 public class Camera1Capturer extends CameraCapturer { | |
22 private final boolean captureToTexture; | |
23 | |
24 public Camera1Capturer(String cameraName, CameraEventsHandler eventsHandler, | |
25 boolean captureToTexture) { | |
26 super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture)); | |
27 | |
28 this.captureToTexture = captureToTexture; | |
29 } | |
30 | |
31 @Override | |
32 public List<CaptureFormat> getSupportedFormats() { | |
33 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.
| |
34 } | |
35 | |
36 @Override | |
37 protected void createCameraSession( | |
38 CameraSession.CreateSessionCallback createSessionCallback, CameraEventsHan dler eventsHandler, | |
39 Context applicationContext, CameraVideoCapturer.CapturerObserver capturerO bserver, | |
40 SurfaceTextureHelper surfaceTextureHelper, | |
41 String cameraName, int width, int height, int framerate) { | |
42 Camera1Session.create( | |
43 createSessionCallback, eventsHandler, captureToTexture, | |
44 applicationContext, capturerObserver, surfaceTextureHelper, | |
45 Camera1Enumerator.getCameraIndex(cameraName), width, height, framerate); | |
46 } | |
47 | |
48 private int getCameraIndex() { | |
49 return Camera1Enumerator.getCameraIndex(getCameraName()); | |
50 } | |
51 } | |
OLD | NEW |