RK3288 攝像頭左右鏡像


系統:Android 5.1

 

設置攝像頭左右鏡像

diff --git a/frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp b/frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp
index 070be2d..0250f92 100755
--- a/frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp
+++ b/frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp
@@ -654,8 +654,8 @@ 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);
+        orientation = getOrientation(arg1, 1);
         if (orientation == -1) return BAD_VALUE;
 
         if (mOrientation != orientation) {

 

代碼原意是如果攝像頭是前置攝像頭,就左右鏡像;如果是后置攝像頭,就不用左右鏡像。

修改的本質是切換前后攝像頭,所以也可更改如下:

orientation = getOrientation(arg1, mCameraFacing != CAMERA_FACING_FRONT);

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM