📄 camera_sensor_para_ov7660.c
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* camera_sensor_para.c
*
* Project:
* --------
* MT6238
*
* Description:
* ------------
* Camera Operation Parameter for sensor driver related.
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*----------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#include "drv_features.h"
#if (defined(DRV_ISP_6238_SERIES))
#if defined(ISP_SUPPORT)
#include "camera_para.h"
//#include "isp_flashlight.h"
#include "med_api.h"
#include "camera_info_OV7660.h"
#include "isp_if.h"
void OV7660_CameraDriverInitOperationPara(CameraDriverOperationParaStruct *p_oper_data)
{
p_oper_data->capture_delay_frame = 3;//2; /* wait stable frame when sensor change mode (pre to cap) */
p_oper_data->preview_delay_frame = 2; /* wait stable frame when sensor change mode (cap to pre) */
p_oper_data->preview_display_wait_frame = 2; /* wait stable frame when sensor change mode (cap to pre) */
p_oper_data->ae_cal_delay_frame = 0; /* The frame of calculation default 0 */
p_oper_data->ae_shut_delay_frame = 1; /* The frame of setting shutter default 0 for TG int */
p_oper_data->ae_sensor_gain_delay_frame = 2; /* The frame of setting sensor gain */
p_oper_data->ae_isp_gain_delay_frame = 3; /* The frame of setting gain */
p_oper_data->ae_cal_period = 4; /* AE AWB calculation period */
#if(defined(XENON_FLASHLIGHT_ANTI_RED_EYE))
p_oper_data->flashlight_mode = FLASHLIGHT_XENON_IGBT;
#elif(defined(XENON_FLASHLIGHT))
p_oper_data->flashlight_mode = FLASHLIGHT_XENON_SCR;
#elif(defined(LED_FLASHLIGHT_SUPPORT))
p_oper_data->flashlight_mode = FLASHLIGHT_LED_PEAK;
#elif(defined(LED_ONOFF_SUPPORT))
p_oper_data->flashlight_mode = FLASHLIGHT_LED_ONOFF;
#else
p_oper_data->flashlight_mode = FLASHLIGHT_NONE;
#endif
p_oper_data->flashlight_delta_main_lum = 65; // 1.015*64(1.015X)
}
void OV7660_get_capture_mode_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 6;
p_info->support_item[0] = CAM_MODE_NORMAL;
p_info->support_item[1] = CAM_MODE_BEST_SHOT;
p_info->support_item[2] = CAM_MODE_CONT_SHOT;
p_info->support_item[3] = CAM_MODE_BURST_SHOT;
p_info->support_item[4] = CAM_MODE_EV_BRACKETING;
p_info->support_item[5] = CAM_MODE_ADD_FRAME;
}
void OV7660_get_camera_scene_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 7;
p_info->support_item[0] = OV7660_CAMERA_AUTO_DSC;
p_info->support_item[1] = OV7660_CAMERA_PORTRAIT;
p_info->support_item[2] = OV7660_CAMERA_LANDSCAPE;
p_info->support_item[3] = OV7660_CAMERA_SPORT;
p_info->support_item[4] = OV7660_CAMERA_ISO_ANTI_HAND_SHAKE;
p_info->support_item[5] = OV7660_CAMERA_NIGHTSCENE;
p_info->support_item[6] = OV7660_CAMERA_DOCUMENT;
}
void OV7660_get_capture_size_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 4;
p_info->support_item[0] = CAM_SIZE_WALLPAPER;
p_info->support_item[1] = CAM_SIZE_VGA;
p_info->support_item[2] = CAM_SIZE_1M;
p_info->support_item[3] = CAM_SIZE_2M;
//p_info->support_item[4] = CAM_SIZE_3M;
}
void OV7660_get_flashlight_ability(cam_fun_info *p_info){
#if(defined(OV7660_RAW_MAIN) || defined(OV7660_RAW_BAK1) )
#if(defined(XENON_FLASHLIGHT_ANTI_RED_EYE))
p_info->is_support = KAL_TRUE;
p_info->item_count = 4;
p_info->support_item[0] = CAM_FLASH_OFF;
p_info->support_item[1] = CAM_FLASH_ON;
p_info->support_item[2] = CAM_FLASH_AUTO;
p_info->support_item[3] = CAM_FLASH_REDEYE;
#elif(defined(XENON_FLASHLIGHT))
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_FLASH_OFF;
p_info->support_item[1] = CAM_FLASH_ON;
p_info->support_item[2] = CAM_FLASH_AUTO;
#elif(defined(LED_FLASHLIGHT_SUPPORT))
p_info->is_support = KAL_TRUE;
p_info->item_count = 4;
p_info->support_item[0] = CAM_FLASH_OFF;
p_info->support_item[1] = CAM_FLASH_ON;
p_info->support_item[2] = CAM_FLASH_AUTO;
p_info->support_item[3] = CAM_FLASH_REDEYE;
#else
p_info->is_support = KAL_FALSE;
p_info->item_count = 0;
#endif
#else // sub camera
p_info->is_support = KAL_FALSE;
p_info->item_count = 0;
#endif
}
void OV7660_get_af_range_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_AF_RANGE_AUTO;
p_info->support_item[1] = CAM_AF_RANGE_MACRO;
p_info->support_item[2] = CAM_AF_RANGE_LANDSCAPE;
}
void OV7660_get_iso_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 5;
p_info->support_item[0] = OV7660_CAMERA_ISO100;
p_info->support_item[1] = OV7660_CAMERA_ISO200;
p_info->support_item[2] = OV7660_CAMERA_ISO400;
p_info->support_item[3] = OV7660_CAMERA_ISO800;
p_info->support_item[4] = OV7660_CAMERA_ISO1600;
}
void OV7660_get_binning_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 2;
p_info->support_item[0] = OV7660_CAMERA_ISO800;
p_info->support_item[1] = OV7660_CAMERA_ISO1600;
}
void OV7660_get_wb_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 7;
p_info->support_item[0] = CAM_WB_AUTO;
p_info->support_item[1] = CAM_WB_CLOUD;
p_info->support_item[2] = CAM_WB_DAYLIGHT;
p_info->support_item[3] = CAM_WB_INCANDESCENCE;
p_info->support_item[4] = CAM_WB_FLUORESCENT;
p_info->support_item[5] = CAM_WB_TUNGSTEN;
p_info->support_item[6] = CAM_WB_MANUAL;
}
void OV7660_get_effect_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 15;
p_info->support_item[0] = CAM_EFFECT_ENC_NORMAL;
p_info->support_item[1] = CAM_EFFECT_ENC_GRAYSCALE;
p_info->support_item[2] = CAM_EFFECT_ENC_SEPIA;
p_info->support_item[3] = CAM_EFFECT_ENC_SEPIAGREEN;
p_info->support_item[4] = CAM_EFFECT_ENC_SEPIABLUE;
p_info->support_item[5] = CAM_EFFECT_ENC_COLORINV;
p_info->support_item[6] = CAM_EFFECT_ENC_GRAYINV;
p_info->support_item[7] = CAM_EFFECT_ENC_BLACKBOARD;
p_info->support_item[8] = CAM_EFFECT_ENC_WHITEBOARD;
p_info->support_item[9] = CAM_EFFECT_ENC_COPPERCARVING;
p_info->support_item[10] = CAM_EFFECT_ENC_EMBOSSMENT;
p_info->support_item[11] = CAM_EFFECT_ENC_BLUECARVING;
p_info->support_item[12] = CAM_EFFECT_ENC_JEAN;
p_info->support_item[13] = CAM_EFFECT_ENC_SKETCH;
p_info->support_item[14] = CAM_EFFECT_ENC_OIL;
}
void OV7660_get_af_mode_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 5;
p_info->support_item[0] = CAM_AF_OFF;
p_info->support_item[1] = CAM_AF_SINGLE_ZONE;
p_info->support_item[2] = CAM_AF_MULTI5_ZONE;
p_info->support_item[3] = CAM_AF_CONTINUOUS;
p_info->support_item[4] = CAM_AF_MANUAL_MODE;
}
void OV7660_get_ae_meter_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 4;
p_info->support_item[0] = CAM_AE_METER_AUTO;
p_info->support_item[1] = CAM_AE_METER_SPOT;
p_info->support_item[2] = CAM_AE_METER_CENTRAL;
p_info->support_item[3] = CAM_AE_METER_AVERAGE;
}
void OV7660_get_sharpness_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_SHARPNESS_HIGH;
p_info->support_item[1] = CAM_SHARPNESS_MEDIUM;
p_info->support_item[2] = CAM_SHARPNESS_LOW;
}
void OV7660_get_contrast_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_CONTRAST_HIGH;
p_info->support_item[1] = CAM_CONTRAST_MEDIUM;
p_info->support_item[2] = CAM_CONTRAST_LOW;
}
void OV7660_get_saturation_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_SATURATION_HIGH;
p_info->support_item[1] = CAM_SATURATION_MEDIUM;
p_info->support_item[2] = CAM_SATURATION_LOW;
}
void OV7660_get_ev_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 10;
p_info->support_item[0] = CAM_EV_NEG_4_3;
p_info->support_item[1] = CAM_EV_NEG_3_3;
p_info->support_item[2] = CAM_EV_NEG_2_3;
p_info->support_item[3] = CAM_EV_NEG_1_3;
p_info->support_item[4] = CAM_EV_ZERO;
p_info->support_item[5] = CAM_EV_POS_1_3;
p_info->support_item[6] = CAM_EV_POS_2_3;
p_info->support_item[7] = CAM_EV_POS_3_3;
p_info->support_item[8] = CAM_EV_POS_4_3;
p_info->support_item[9] = CAM_EV_NIGHT_SHOT;
}
void OV7660_get_banding_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 2;
p_info->support_item[0] = CAM_BANDING_50HZ;
p_info->support_item[1] = CAM_BANDING_60HZ;
}
void OV7660_get_zoom_ability(cam_zoom_info *p_info){ //different structure
p_info->is_support = KAL_TRUE;
p_info->zoom_steps = 40;
p_info->max_zoom_factor = 800;
}
void OV7660_get_video_scene_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 2;
p_info->support_item[0] = OV7660_CAMERA_VIDEO_AUTO;
p_info->support_item[1] = OV7660_CAMERA_VIDEO_NIGHT;
}
void OV7660_get_video_codec_ability(cam_fun_info *p_info){
p_info->is_support = KAL_TRUE;
p_info->item_count = 2;
p_info->support_item[0] = CAM_VIDEO_CODEDEC_MPEG;
p_info->support_item[1] = CAM_VIDEO_CODEDEV_H263;
}
void OV7660_get_video_size_ability(cam_fun_info *p_info){
#if(defined(__CAMCORDER_PACKAGE_SLIM__))
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_VIDEO_SIZE_QCIF;
p_info->support_item[1] = CAM_VIDEO_SIZE_QVGA;
p_info->support_item[2] = CAM_VIDEO_SIZE_CIF;
#else
p_info->is_support = KAL_TRUE;
p_info->item_count = 3;
p_info->support_item[0] = CAM_VIDEO_SIZE_QCIF;
p_info->support_item[1] = CAM_VIDEO_SIZE_QVGA;
p_info->support_item[2] = CAM_VIDEO_SIZE_VGA;
#endif
}
camera_capability_func_struct OV7660_camera_capability = {
OV7660_get_capture_mode_ability,
OV7660_get_camera_scene_ability,
OV7660_get_capture_size_ability,
OV7660_get_flashlight_ability,
OV7660_get_af_range_ability,
OV7660_get_iso_ability,
OV7660_get_binning_ability,
OV7660_get_wb_ability,
OV7660_get_effect_ability,
OV7660_get_af_mode_ability,
OV7660_get_ae_meter_ability,
OV7660_get_sharpness_ability,
OV7660_get_contrast_ability,
OV7660_get_saturation_ability,
OV7660_get_ev_ability,
OV7660_get_banding_ability,
OV7660_get_zoom_ability,
OV7660_get_video_scene_ability,
OV7660_get_video_codec_ability,
OV7660_get_video_size_ability
};
//void camera_capability_func_config(camera_capability_func_struct** camera_capability_func) {
// (*camera_capability_func) = &camera_capability_MT9T012;
//}
CAP_SIZE OV7660_camera_iso_imgsize_upperbound(CAM_SCENE_MODE iso_value)
{
switch (iso_value)
{
case CAM_ISO800:
return CAM_SIZE_VGA;
break;
case CAM_ISO1600:
return CAM_SIZE_VGA;
break;
default:
return CAM_SIZE_VGA;
break;
}
}
CAMERA_INTERFACE_ENUM OV7660_camera_interface_support(void) {
return CAM_RAW_SUPPORT;
}
camera_module_info_func_struct OV7660_camera_module_info = {
OV7660_camera_interface_support
};
#endif//#if defined(ISP_SUPPORT)
#endif //#if (defined(DRV_ISP_6238_SERIES))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -