zoukankan      html  css  js  c++  java
  • 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);
  • 相关阅读:
    Zookeeper环境搭建
    Zookeeper介绍
    相关错题
    数据库前三章测试题
    数据库相关练习题
    SQL语句操作数据
    用表组织数据
    创建和管理SQL Server数据库
    登陆数据库
    C#部分试题实例
  • 原文地址:https://www.cnblogs.com/lialong1st/p/9173682.html
Copyright © 2011-2022 走看看