• emircan's avatar
    I extended the current CaptureAPIType exposure on chrome://media-internals... · 86e26b25
    emircan authored
    I 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
    
    Review URL: https://codereview.chromium.org/1014943005
    
    Cr-Commit-Position: refs/heads/master@{#322066}
    86e26b25
video_capture_device.cc 5.02 KB