RK3288 USBcamera 相机预览左右镜像问题

目录  : framework\av\services\camera\libcameraservice\apil  
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) {

猜你喜欢

转载自blog.csdn.net/qq1226176787/article/details/83014760
今日推荐