瑞芯微Rockchip开发者社区
直播中

shawon

12年用户 617经验值
私信 关注
[问答]

请问大神怎样去解决RK3288 USBcamera相机预览左右镜像的问题呢

请问大神怎样去解决RK3288 USBcamera相机预览左右镜像的问题呢?

回帖(1)

谢辅仁

2022-2-10 09:58:43
目录  : frameworkavservicescameralibcameraserviceapil  
diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp
index 6e91290cc..771a6dcef 100644
--- a/services/camera/libcameraservice/api1/CameraClient.cpp
+++ b/services/camera/libcameraservice/api1/CameraClient.cpp
@@ -645,6 +645,8 @@ status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
     int orientation;
     //CAMERA_CMD_STOP_FACE_DETECTION needn't get mLock,or will cause deadlock with datacallback,zyc
     if(cmd == CAMERA_CMD_STOP_FACE_DETECTION){
+    if(mCameraFacing == CAMERA_FACING_FRONT)
+      orientation = 0;
         return mHardware->sendCommand(cmd, arg1, arg2);
     }
     
@@ -654,7 +656,7 @@ status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {

     if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) {
         // Mirror the preview if the camera is front-facing.
-        orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
+        orientation = getOrientation(arg1, mCameraFacing ==! CAMERA_FACING_FRONT);
         if (orientation == -1) return BAD_VALUE;

         if (mOrientation != orientation) {
举报

更多回帖

发帖
×
20
完善资料,
赚取积分