Move camera implementation details away from the public API.
Moves CameraCapturer, CameraSession, Camera1Session and Camera2Session away from the public API. BUG=webrtc:7172 Review-Url: https://codereview.webrtc.org/2699713004 Cr-Commit-Position: refs/heads/master@{#16723}
This commit is contained in:
@ -131,14 +131,10 @@ android_library("libjingle_peerconnection_java") {
|
|||||||
"api/org/webrtc/CallSessionFileRotatingLogSink.java",
|
"api/org/webrtc/CallSessionFileRotatingLogSink.java",
|
||||||
"api/org/webrtc/Camera1Capturer.java",
|
"api/org/webrtc/Camera1Capturer.java",
|
||||||
"api/org/webrtc/Camera1Enumerator.java",
|
"api/org/webrtc/Camera1Enumerator.java",
|
||||||
"api/org/webrtc/Camera1Session.java",
|
|
||||||
"api/org/webrtc/Camera2Capturer.java",
|
"api/org/webrtc/Camera2Capturer.java",
|
||||||
"api/org/webrtc/Camera2Enumerator.java",
|
"api/org/webrtc/Camera2Enumerator.java",
|
||||||
"api/org/webrtc/Camera2Session.java",
|
|
||||||
"api/org/webrtc/CameraCapturer.java",
|
|
||||||
"api/org/webrtc/CameraEnumerationAndroid.java",
|
"api/org/webrtc/CameraEnumerationAndroid.java",
|
||||||
"api/org/webrtc/CameraEnumerator.java",
|
"api/org/webrtc/CameraEnumerator.java",
|
||||||
"api/org/webrtc/CameraSession.java",
|
|
||||||
"api/org/webrtc/CameraVideoCapturer.java",
|
"api/org/webrtc/CameraVideoCapturer.java",
|
||||||
"api/org/webrtc/DataChannel.java",
|
"api/org/webrtc/DataChannel.java",
|
||||||
"api/org/webrtc/DtmfSender.java",
|
"api/org/webrtc/DtmfSender.java",
|
||||||
@ -181,6 +177,10 @@ android_library("libjingle_peerconnection_java") {
|
|||||||
"api/org/webrtc/VideoSource.java",
|
"api/org/webrtc/VideoSource.java",
|
||||||
"api/org/webrtc/VideoTrack.java",
|
"api/org/webrtc/VideoTrack.java",
|
||||||
"api/org/webrtc/YuvConverter.java",
|
"api/org/webrtc/YuvConverter.java",
|
||||||
|
"src/java/org/webrtc/Camera1Session.java",
|
||||||
|
"src/java/org/webrtc/Camera2Session.java",
|
||||||
|
"src/java/org/webrtc/CameraCapturer.java",
|
||||||
|
"src/java/org/webrtc/CameraSession.java",
|
||||||
]
|
]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
|
import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class Camera1Session implements CameraSession {
|
class Camera1Session implements CameraSession {
|
||||||
private static final String TAG = "Camera1Session";
|
private static final String TAG = "Camera1Session";
|
||||||
private static final int NUMBER_OF_CAPTURE_BUFFERS = 3;
|
private static final int NUMBER_OF_CAPTURE_BUFFERS = 3;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
|
import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
|
||||||
|
|
||||||
@TargetApi(21)
|
@TargetApi(21)
|
||||||
public class Camera2Session implements CameraSession {
|
class Camera2Session implements CameraSession {
|
||||||
private static final String TAG = "Camera2Session";
|
private static final String TAG = "Camera2Session";
|
||||||
|
|
||||||
private static final Histogram camera2StartTimeMsHistogram =
|
private static final Histogram camera2StartTimeMsHistogram =
|
||||||
@ -167,7 +167,7 @@ public class Camera2Session implements CameraSession {
|
|||||||
// Set auto exposure fps range.
|
// Set auto exposure fps range.
|
||||||
captureRequestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE,
|
captureRequestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE,
|
||||||
new Range<Integer>(captureFormat.framerate.min / fpsUnitFactor,
|
new Range<Integer>(captureFormat.framerate.min / fpsUnitFactor,
|
||||||
captureFormat.framerate.max / fpsUnitFactor));
|
captureFormat.framerate.max / fpsUnitFactor));
|
||||||
captureRequestBuilder.set(
|
captureRequestBuilder.set(
|
||||||
CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);
|
CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);
|
||||||
captureRequestBuilder.set(CaptureRequest.CONTROL_AE_LOCK, false);
|
captureRequestBuilder.set(CaptureRequest.CONTROL_AE_LOCK, false);
|
||||||
@ -16,7 +16,7 @@ import android.os.Looper;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public abstract class CameraCapturer implements CameraVideoCapturer {
|
abstract class CameraCapturer implements CameraVideoCapturer {
|
||||||
enum SwitchState {
|
enum SwitchState {
|
||||||
IDLE, // No switch requested.
|
IDLE, // No switch requested.
|
||||||
PENDING, // Waiting for previous capture session to open.
|
PENDING, // Waiting for previous capture session to open.
|
||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
package org.webrtc;
|
package org.webrtc;
|
||||||
|
|
||||||
public interface CameraSession {
|
interface CameraSession {
|
||||||
enum FailureType { ERROR, DISCONNECTED }
|
enum FailureType { ERROR, DISCONNECTED }
|
||||||
|
|
||||||
// Callbacks are fired on the camera thread.
|
// Callbacks are fired on the camera thread.
|
||||||
Reference in New Issue
Block a user