微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > FM50AF自动对焦模式下(配OV5647),点击屏幕触发对焦时相机报错退出

FM50AF自动对焦模式下(配OV5647),点击屏幕触发对焦时相机报错退出

时间:10-02 整理:3721RD 点击:
FM50AF自动对焦模式下(配OV5647),点击屏幕触发对焦时相机报错退出
log 如下:
24:  CAMERA area bottom coordinate is invalid 1250 (checkCamArea){#1797:mediatek/source/external/camera/MT6575/CamAdapter/mHal/mHalCamParameters.cpp}
24:  Error area! (parseCamAreas){#1743:mediatek/source/external/camera/mt6575/CamAdapter/mHal/mHalCamParameters.cpp}
24:  [parseCamAreas] X
24:  [setParameters]ERROR: metering areas = (-1000,-1000,686,1250,1) (setParameters){#1314:mediatek/source/external/camera/mt6575/CamAdapter/mHal/mHalCamParameters.cpp}
26:  Shutting down VM
26:  threadid=1: thread exiting with uncaught exception (group=0x40cb1258)
30:  FATAL EXCEPTION: main
30:  java.lang.RuntimeException: setParameters failed
30:      at android.hardware.Camera.native_setParameters(Native Method)
30:      at android.hardware.Camera.setParameters(Camera.java:1687)
30:      at com.android.camera.Camera.setCameraParameters(Camera.java:3021)
30:      at com.android.camera.Camera.setFocusParameters(Camera.java:1415)
30:      at com.android.camera.FocusManager.ontouch(FocusManager.java:406)
30:      at com.android.camera.Camera.myontouch(Camera.java:2517)
30:      at com.android.camera.Camera.access$6800(Camera.java:127)
30:         handleMessage(Camera.java:3684)
30:      at android.os.Handler.dispatchMessage(Handler.java:99)
30:      at android.os.Looper.loop(Looper.java:137)
30:      at android.app.ActivityThread.main(ActivityThread.java:4503)
30:      at java.lang.reflect.Method.invokeNative(Native Method)
30:      at java.lang.reflect.Method.invoke(Method.java:511)
30:      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
30:      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
30:      at dalvik.system.NativeStart.main(Native Method)
37:    Force finishing activity com.android.camera/.Camera
查看了mHalCamParameters.cpp中checkCamArea代码如下:
/******************************************************************************
*
*******************************************************************************/
#define CAM_AREA_LEFT                    (-1000)
#define CAM_AREA_TOP                     (-1000)
#define CAM_AREA_RIGHT                   (1000)
#define CAM_AREA_BOTTOM                (1000)
#define CAM_AREA_WEIGHT_MIN         (1)
#define CAM_AREA_WEIGHT_MAX        (1000)
bool
mtkCameraHardware::
checkCamArea(camera_area_t const &area)
{
    //Handles the invalid regin corner case.
    if ( ( 0 == area.top ) && ( 0 == area.left ) && ( 0 == area.bottom ) && ( 0 == area.right ) && ( 0 == area.weight ) ) {
        return true;
    }
    if ( ( CAM_AREA_WEIGHT_MIN > area.weight ) ||  ( CAM_AREA_WEIGHT_MAX < area.weight ) ) {
        CAM_LOGE("Camera area weight is invalid %d", area.weight);
        return false;
    }
    if ( ( CAM_AREA_TOP > area.top ) || ( CAM_AREA_BOTTOM < area.top ) ) {
        CAM_LOGE("Camera area top coordinate is invalid %d", area.top );
        return false;
    }
    if ( ( CAM_AREA_TOP > area.bottom ) || ( CAM_AREA_BOTTOM < area.bottom ) ) {
        CAM_LOGE("Camera area bottom coordinate is invalid %d", area.bottom );
        return false;
    }
    if ( ( CAM_AREA_LEFT > area.left ) || ( CAM_AREA_RIGHT < area.left ) ) {
        CAM_LOGE("Camera area left coordinate is invalid %d", area.left );
        return false;
    }
    if ( ( CAM_AREA_LEFT > area.right ) || ( CAM_AREA_RIGHT < area.right ) ) {
        CAM_LOGE("Camera area right coordinate is invalid %d", area.right );
        return false;
    }
    if ( area.left >= area.right ) {
        CAM_LOGE("Camera area left larger than right");
        return false;
    }
    if ( area.top >= area.bottom ) {
        CAM_LOGE("Camera area top larger than bottom");
        return false;
    }
    return true;
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top