set Camera Exposure Compensation on OV5640 MIPI camera on a iMX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

set Camera Exposure Compensation on OV5640 MIPI camera on a iMX6

1,120 Views
sreekanthm
Contributor II

Hi,

I am trying to set the exposure values based on the Android API on Ov5640 MIPI on IMX6 board and I did changes as below in ov5640_mipi.c

case V4L2_CID_EXPOSURE:

     /* turn off AE/AG */

      OV5640_turn_on_AE_AG(0);

      OV5640_set_shutter((__s32)vc->value);

      break;

 

along with below:

status_t Ov5640Mipi::setCameraExposureParams(int32_t expparams)

{

    struct v4l2_control int_control_exp;

    int_control_exp.id = V4L2_CID_EXPOSURE;

    int_control_exp.value = expparams;

    int ret_exp = ioctl(mCameraHandle, VIDIOC_S_CTRL, &int_control_exp);

 

    return NO_ERROR;

}

 

  1. 3. DeviceAdapter.cpp

status_t DeviceAdapter::startDeviceLocked()

{

....

....

....

setCameraExposureCompensation();

}

 

void DeviceAdapter::setCameraExposureCompensation()

{

    int32_t expComp;

    status_t ret1 = NO_ERROR;

 

    ret1 = mMetadaManager->getExposureCompensation(expComp);

    if (ret1 != NO_ERROR) {

        FLOGE("DeviceAdapter: getExposureCompensation failed");

        expComp = 0;

        return;

    }

    ret1 = setCameraExposureParams(expComp);

    if (ret1 != NO_ERROR) {

        FLOGE("DeviceAdapter: setCameraExposureParams failed");

        return;

    }

}

 

status_t DeviceAdapter::setCameraExposureParams(int32_t expparams)

{

    return NO_ERROR;

}

 

  1. MetadaManager.cpp

 

status_t MetadaManager::getExposureCompensation(int32_t &expComp)

{

    camera_metadata_entry_t streams;

    int res = find_camera_metadata_entry(mCurrentRequest,

ANDROID_CONTROL_AE_EXP_COMPENSATION, &streams);

    if (res != NO_ERROR) {

        ALOGE("%s: error reading jpeg Rotation tag", __FUNCTION__);

        return BAD_VALUE;

    }

    expComp = streams.data.i32[0];

    return NO_ERROR;

}

MetadaManager always returns 0 as exposure value,  and no impact on change in Exposure.

 

 

Attached is logcat and routines changed.

Please share your thoughts on what’s missing in my implementation. Let me know if you need further details about the issue / implementation.

 

Thanks in advance.

Labels (3)
0 Kudos
0 Replies