多摄像头支持

在外景系统 (EVS) 1.1 中,支持包含多个实体摄像头设备的逻辑摄像头设备。要使用此虚拟设备,设备实现必须支持同步框架

枚举、打开和关闭逻辑摄像头设备

应用可以使用相同的 IEvsEnumerator 方法使用可用的逻辑摄像头设备。返回的 EvsCamera 对象(代表逻辑摄像头设备)必须在元数据中包含以下各项:

  • ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
    如果返回的 EvsCamera 对象表示逻辑摄像头,则其摄像头元数据必须在其 ANDROID_REQUEST_AVAILABLE_CAPABILITIES 字段中包含此功能键。
  • ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS 字段列出了实体摄像头设备标识符。
  • ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE 字段可以使用以下任一枚举值:
    • ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE 用于主主模式下的传感器,不执行硬件快门/曝光同步。
    • ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED 用于主从模式下的传感器,执行硬件快门/曝光同步。 同步的 GMSL2 摄像头必须具有此值。

应用可以通过新的 getPhysicalCameraInfo(stringcameraId) 方法中的 IEvsCamera 检索实体摄像头设备的描述符。

/**
 * Returns the description of the physical camera device that backs this
 * logical camera.
 *
 * If a requested device does not either exist or back this logical device,
 * this method returns a null camera descriptor. And, if this is called on
 * a physical camera device, this method is the same as getCameraInfo_1_1()
 * method if a given device ID is matched. Otherwise, this will return a
 * null camera descriptor.
 *
 * @param  deviceId Physical camera device identifier string.
 * @return info     The description of a member physical camera device.
 *                  This must be the same value as reported by
 *                  EvsEnumerator::getCameraList_1_1().
 */
getPhysicalCameraInfo(string deviceId) generates (CameraDesc info);

配置多摄像头支持

所有逻辑摄像头都需要进行静态定义,并且必须通过配置管理器实现进行枚举。由于 EVS 支持对组中的每台设备进行不同的配置,EVS 会提供成员设备列表,并指示图片拍摄是否同步。

<!-- camera group 0 -->
<group id='group0' synchronized='CALIBRATED'>
    <caps>
        <!-- list of supported controls supported by all physical devices -->
        <supported_controls>
            <control name='BRIGHTNESS' min='0' max='255'/>
            <control name='CONTRAST' min='0' max='255'/>
        </supported_controls>

        <!-- list of stream configuration supported by all physical devices -->
        <stream id='0' width='640' height='480' format='RGBA_8888' framerate='30'/>
    </caps>

    <!-- list of parameters -->
    <characteristics>
        <parameter
            name='REQUEST_AVAILABLE_CAPABILITIES'
            type='enum'
            size='1'
            value='LOGICAL_MULTI_CAMERA'
        />
        <parameter
            name='LOGICAL_MULTI_CAMERA_PHYSICAL_IDS'
            type='byte[]'
            size='2'
            value='/dev/video3,/dev/video4'
        />
    </characteristics>
</group>