DescriptionWIP: Android Camera2 capture implementation
The Java interface is here:
webrtc/api/java/src/org/webrtc/VideoCapturer.java
The Camera(1) implementation is here:
webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java
The Camera2 implementation is the new file:
webrtc/api/java/android/org/webrtc/VideoCapturerAndroid2.java
The camera implementations should probably be renamed to Camera1Capturer and Camera2Capturer to not be confused with the interface.
The file webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java should only contain generic enumeration stuff for both camera1 and camera2, but now most parts are hardcoded to camera1. There is an Enumerator interface in that file that currently looks like this:
public interface Enumerator {
/**
* Returns a list of supported CaptureFormats for the camera with index |cameraId|.
*/
List<CaptureFormat> getSupportedFormats(int cameraId);
}
that Camera1Enumerator and Camera2Enumerator implements. It needs to be changed to something like:
public interface Enumerator {
/**
* Returns device names that can be used to create a new VideoCapturer.
*/
List<String> getDeviceNames();
boolean isFrontFacing(String cameraid);
/**
* Returns a list of supported CaptureFormats for |cameraId|.
*/
List<CaptureFormat> getSupportedFormats(String cameraId);
}
Also, we need to add tests for camera2. We probably need to refactor the tests first so they can be used for both implementations. Hopefully we only need to support capturing to Surface/texture for camera2, i.e. not byte-buffer capture.
This CL should also be split up into many smaller ones.
Patch Set 1 : Refactor enumeration for re-use with camera2 #Patch Set 2 : Camera2 #Patch Set 3 : Fix CaptureFormat jni parsing #Messages
Total messages: 7 (5 generated)
|