OpenHarmony 3.2 Release如何采用相机相关Native API切换相机的前后摄像头?
如题,OpenHarmony 3.2 Release如何采用Native API切换相机的前后摄像头,目前默认获取的摄像头个数为1(尽管设备存在两个摄像头), 代码片段如下:```sptr camManagerObj = CameraManager::GetInstance();camManage
如题,OpenHarmony 3.2 Release如何采用Native API切换相机的前后摄像头,目前默认获取的摄像头个数为1(尽管设备存在两个摄像头), 代码片段如下:
```
sptr<CameraManager> camManagerObj = CameraManager::GetInstance();
camManagerObj->SetCallback(std::make_shared<TestCameraMngerCallback>(testName));
std::vector<sptr<CameraDevice>> cameraObjList = camManagerObj->GetSupportedCameras();
LOGI("Camera ID count: %lu\n", cameraObjList.size());
for (auto info : cameraObjList) {
LOGI("Camera ID: %s, position: %d, camera type: %d, connection type: %d\n", info->GetID().c_str(),
info->GetPosition(), info->GetCameraType(), info->GetConnectionType());
}
```
更多推荐
所有评论(0)