CAPTURE_DEVICE_RET V4l2CapDeviceBase :: DevSetConfig(struct capture_config_t *pCapcfg){

        CAMERA_LOG_FUNC;
        if (mCameraDevice <= 0 || pCapcfg == NULL){
            return CAPTURE_DEVICE_ERR_BAD_PARAM;
        }

        CAPTURE_DEVICE_RET ret = CAPTURE_DEVICE_ERR_NONE;
        if(mCapCfg.fmt != pCapcfg->fmt || mCapCfg.width != pCapcfg->width || mCapCfg.height != pCapcfg->height
                || mCapCfg.tv.denominator/mCapCfg.tv.numerator != pCapcfg->tv.denominator/pCapcfg->tv.numerator) {
            mCapCfg.fmt = pCapcfg->fmt;
            mCapCfg.width = pCapcfg->width;
            mCapCfg.height = pCapcfg->height;
            mCapCfg.tv.denominator = pCapcfg->tv.denominator;
            mCapCfg.tv.numerator = pCapcfg->tv.numerator;
            CAMERA_LOG_RUNTIME("V4l2SetConfig=width=%d,height=%d", mCapCfg.width, mCapCfg.height);
            ret = V4l2SetConfig(pCapcfg);
            if(ret < 0) {
                return ret;
            }
            mCapCfg.rotate = SENSOR_PREVIEW_ROATE_INVALID;
        }

        if(mCapCfg.rotate != pCapcfg->rotate) {
            mCapCfg.rotate = pCapcfg->rotate;
            CAMERA_LOG_RUNTIME("V4l2SetRot=rotate=%d", mCapCfg.rotate);
            if(V4l2SetRot(pCapcfg) < 0)
                return CAPTURE_DEVICE_ERR_SYS_CALL;
        }

        return ret;

    }
CAPTURE_DEVICE_ERR_RET V4l2CapDeviceBase :: DevSetConfig(struct capture_config_t *pCapcfg) {

    CAMERA_HAL_LOG_FUNC;
    if (mCameraDevice <= 0 || pCapcfg == NULL) {
        return CAPTURE_DEVICE_ERR_BAD_PARAM;
    }

    mCapCfg = *pCapcfg;
    return V4l2SetConfig(pCapcfg);

}