SBSBSBSB 发表于 2021-2-23 15:29:21

firefly rk3288 外接摄像头人像颠倒,无法旋转

求程序

jpchen 发表于 2021-2-24 10:03:38

USB 摄像头默认是后置的,可以通过如下info->facing的值修改
diff --git a/hardware/rockchip/camera/CameraHal/CameraHal_Module.cpp b/hardware/rockchip/camera/CameraHal/CameraHal_Module.cpp
index 6737e19..85331f7 100755
--- a/hardware/rockchip/camera/CameraHal/CameraHal_Module.cpp
+++ b/hardware/rockchip/camera/CameraHal/CameraHal_Module.cpp
@@ -1331,7 +1331,11 @@ int camera_get_camera_info(int camera_id, struct camera_info *info)
   }
#else
   info->facing = gCamInfos.facing_info.facing;
-    info->orientation = gCamInfos.facing_info.orientation;      
+    info->orientation = gCamInfos.facing_info.orientation;
+    if(camera_id == 1)
+    {
+      info->facing = 1;
+    }   
#endif
end:
   LOGD("%s(%d): camera_%d facing(%d), orientation(%d)",__FUNCTION__,__LINE__,camera_id,info->facing,info->orientation);
页: [1]
查看完整版本: firefly rk3288 外接摄像头人像颠倒,无法旋转