在外景系統 (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 相機必須具有此值。
-
應用程序可以通過IEvsCamera
在新的getPhysicalCameraInfo(stringcameraId)
方法中檢索物理相機設備的描述符。
/** * 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>