⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cam_api.c

📁 最新MTK手机软件源码
💻 C
📖 第 1 页 / 共 2 页
字号:
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_barcode_stop_capture_and_decode(module_type src_mod_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_barcode_stop_capture_req(src_mod_id);
    CAM_WAIT_EVENT(CAM_EVT_STOP_CAPTURE_BARCODE);
}
#endif

/*****************************************************************************
 * FUNCTION
 *  media_cam_capture
 * DESCRIPTION
 *  This function is to capture the image.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  capture         [?]         
 * RETURNS
 *  void
 *****************************************************************************/
kal_int32 media_cam_capture(module_type src_mod_id, void *capture)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_result = MED_RES_OK;
    cam_send_capture_req(src_mod_id, capture);
    CAM_WAIT_EVENT(CAM_EVT_CAPTURE);
    return cam_result;
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_set_param
 * DESCRIPTION
 *  This function is to set the parameter of camera.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  param_id        [IN]        
 *  value           [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_set_param(module_type src_mod_id, kal_uint16 param_id, kal_int16 value)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_set_param_req(src_mod_id, param_id, value);
    CAM_WAIT_EVENT(CAM_EVT_SET_PARAM);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_set_flash
 * DESCRIPTION
 *  This function is to set the flash for camera.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  flash_mode      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_set_flash(module_type src_mod_id, kal_int16 flash_mode)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_set_flash_req(src_mod_id, flash_mode);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_set_af
 * DESCRIPTION
 *  This function is to set the parameter of AF.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  param_id        [IN]        
 *  value           [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_set_af(module_type src_mod_id, kal_uint16 param_id, kal_int16 value)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_set_param_req(src_mod_id, param_id, value);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_cal_mwb
 * DESCRIPTION
 *  This function is to calculate the mwb.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  pmwb            [?]         
 *  op_type         [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_cal_mwb(module_type src_mod_id, cam_mwb_process_struct *pmwb, kal_uint8 op_type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_cal_mwb_req(src_mod_id, pmwb, op_type);
    CAM_WAIT_EVENT(CAM_EVT_MWB_OP);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_mwb_operation
 * DESCRIPTION
 *  *
 *  This function is to do mwb relate operation
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  op_type         [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_mwb_operation(module_type src_mod_id, kal_uint8 op_type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_mwb_operation_req(src_mod_id, op_type);
    CAM_WAIT_EVENT(CAM_EVT_MWB_OP);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_set_overlay_palette
 * DESCRIPTION
 *  This function is to set the overlay palette for camera.
 * PARAMETERS
 *  src_mod_id              [IN]        
 *  palette_size            [IN]        
 *  palette_addr_ptr        [?]         
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_set_overlay_palette(module_type src_mod_id, kal_uint8 palette_size, kal_uint32 *palette_addr_ptr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_set_overlay_palette_req(src_mod_id, palette_size, palette_addr_ptr);
    CAM_WAIT_EVENT(CAM_EVT_SET_PAL);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_start_fast_zoom
 * DESCRIPTION
 *  This function is to start fast zoom for camera.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  zoom_in         [IN]        
 *  zoom_limit      [IN]        
 *  zoom_step       [IN]        
 *  zoom_speed      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_start_fast_zoom(
        module_type src_mod_id,
        kal_bool zoom_in,
        kal_uint8 zoom_limit,
        kal_uint8 zoom_step,
        kal_uint8 zoom_speed)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_start_fast_zoom_req(src_mod_id, zoom_in, zoom_limit, zoom_step, zoom_speed);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_stop_fast_zoom
 * DESCRIPTION
 *  This function is to stop fast zoom for camera.
 * PARAMETERS
 *  src_mod_id      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_stop_fast_zoom(module_type src_mod_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_stop_fast_zoom_req(src_mod_id);
    CAM_WAIT_EVENT(CAM_EVT_STOP_FAST_ZOOM);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_get_fast_zoom_factor
 * DESCRIPTION
 *  This function is to get the fast zoom factor for camera.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  factor          [?]         
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_get_fast_zoom_factor(module_type src_mod_id, kal_uint8 *factor)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_get_fast_zoom_factor_req(src_mod_id, factor);
    CAM_WAIT_EVENT(CAM_EVT_GET_FAST_ZOOM_FACTOR);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_get_focus_steps
 * DESCRIPTION
 *  This function is to get the focus steps for camera.
 * PARAMETERS
 *  src_mod_id          [IN]        
 *  total_steps         [?]         
 *  current_steps       [?]         
 *  flag                [?]         
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_get_focus_steps(
        module_type src_mod_id,
        kal_uint32 *total_steps,
        kal_uint32 *current_steps,
        kal_bool *flag)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cam_send_get_focus_steps_req(src_mod_id, total_steps, current_steps, flag);
    CAM_WAIT_EVENT(CAM_EVT_GET_FOCUS_STEPS);
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_flash_setting
 * DESCRIPTION
 *  This function is to set ledlight on/off
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  flag            [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_cam_flash_setting(module_type src_mod_id, kal_bool flag)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef ISP_SUPPORT
    isp_led_setting(flag);
#endif 
}


/*****************************************************************************
 * FUNCTION
 *  media_cam_get_max_zoom_factor
 * DESCRIPTION
 *  This function is to get the max zoom factor
 * PARAMETERS
 *  target_width        [IN]        
 *  target_height       [IN]        
 *  kal_uint16 image_width(?)
 *  kal_uint16 image_height(?)
 * RETURNS
 *  kal_uint8 max_zoom_factor
 *****************************************************************************/
kal_uint8 media_cam_get_max_zoom_factor(kal_uint16 target_width, kal_uint16 target_height)
{
#ifdef ISP_SUPPORT
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return get_max_digital_zoom_factor(target_width, target_height);
#else /* ISP_SUPPORT */ 
    return 0;
#endif /* ISP_SUPPORT */ 
}
#endif /* __MED_CAM_MOD__ */ 

#endif /* MED_NOT_PRESENT */ 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -