DescriptionI extended the current CaptureAPIType exposure on chrome://media-internals page to work on ANDROID with the enum types defined below.
enum CaptureApiType {
API1,
API2_LEGACY,
API2_FULL,
API2_LIMITED,
TANGO,
API_TYPE_UNKNOWN
};
Enums are sourced from media/video/capture/video_capture_device.h file and auto-generated on the Android Java side by using java_cpp_enum scripts. They correspond to the same int values, and this is how it is communicated to cpp side on media/video/capture/android/video_capture_device_factory_android.cc.
+------------+
|VideoCapture|
+--+-------+-+
| |
+----------------+-+ +-+-----------------+
|VideoCaptureCamera| |VideoCaptureCamera2|
+---+------------+-+ +-------------------+
| |
+-------------+-----+ ----+-------------+
|VideoCaptureAndroid| |VideoCaptureTango|
+-------------------+ +-----------------+
On Java side, camera class structure is as above. CaptureApiType is defined by static getCaptureApiType() methods in each child.
Note that media/video/capture/android/imageformat_list.h is deleted as it is currently not used. Instead, enums defined on media/video/capture/android/video_capture_device_factory_android.h were autogenerated on Java side using java_cpp_enum scripts.
BUG=458743
TEST=Built with gyp and deployed:
- on Nexus 7, shows API2_LEGACY
- on Nexus 5, shows API2_LIMITED for front camera and API2_FULL for back camera
I added Android tests to MediaInternalsVideoCaptureDeviceTest.* and tested on Nexus 7.
Looked for the adding unittests on video_capture_device_unittest but ANDROID tests are currently disabled with a TODO specified[0]. I will investigate further, but let me know if you have suggestions.
[0] https://code.google.com/p/chromium/codesearch#chromium/src/media/video/capture/video_capture_device_unittest.cc&l=42
Committed: https://crrev.com/86e26b25645c2661089e72df2e2625745dc6e758
Cr-Commit-Position: refs/heads/master@{#322066}
Patch Set 1 : #Patch Set 2 : Added MediaInternalsVideoCaptureDeviceTest.* #
Total comments: 14
Patch Set 3 : mcasas@ comments and FakeVCD fix. #Patch Set 4 : Fixed naming. #Patch Set 5 : Rebased. #Patch Set 6 : Removed android_webview changes. #Messages
Total messages: 24 (9 generated)
|