📄 mmidc_win32_simu.h
字号:
/******************************************************************************/
// Description: Query DCAM current status
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: current status, 0 refer to idle
// value format is shown as following:
// bit[0] -----------LCM busy
// bit[1] -----------previewing
// bit[2] -----------reviewing
// bit[3] -----------capturing
// bit[15-4]---------reserved
// bit[30-16]--------error category
// bit[31]-----------error flag
// Note: none
/******************************************************************************/
#define DC_STATUS_IDLE 0
#define DC_OPERATION_PREVIEWING 1
#define DC_OPERATION_REVIEWING 2
#define DC_OPERATION_CAPTURING 4
#define DC_OPERATION_RECORDING 8
#define DC_OPERATION_DECODING 0x10
#define DC_STATUS_PREVIEW_FIRST 0x20
#define DC_STATUS_DEC_FIRST 0x40
#define DC_STATUS_ENCODE_DONE 0x80
#define DC_STATUS_DECODE_DONE 0x100
#define DC_STATUS_DMA_DONE 0x200
#define DC_STATUS_LCM_BUSY 0x400
#define DC_STATUS_ERROR 0xffff0000
int DC_QueryStatus(void);
/******************************************************************************
** following function is for mjpg demuxer
******************************************************************************/
/******************************************************************************/
// Description: set mjpg parameters
// Author: Zhemin.Lin&Benny.Zhou
// Input: pst_param point to the mjpg parameter
// Output: none
// Return: 0 successful
// others failed
// Note: before start preview, call this function to set parameters
/******************************************************************************/
typedef struct
{
int i_sensor_sequence; /* sensor mode*/
int i_lcd; /* display on which lcd, only for mjpg*/
RECT_T st_disp_rect; /* display rectangular on LCD, only for mjpg*/
RECT_T st_trim_rect; /* trim rectangular*/
int i_frame_rate; /* frame rate*/
int b_prefilter; /* if 0, disable prefilter, else enable*/
int i_smooth; /* if prefilter is enable, this field specify
* the smoothnees the image, the large value
* refer to hight smoothness
*/
int i_quality; /* image quality, large value refer to hight quality*/
uint16 w_target_width; /* target jpeg width*/
uint16 w_target_height; /* target jpeg height*/
BOOLEAN b_is_scale; /*t-path review will use this
*if 0, disable scale video when capturing, else enable*/
RECT_T st_norm_rect; /**/
}DC_MJPG_PARAM_T;
int DC_SetMjpgRecParam(const DC_MJPG_PARAM_T *pst_param);
/******************************************************************************/
// Description: start mjpg capture
// Author: Zhemin.Lin&Benny.Zhou
// Input: dw_framenum total frame number, 0 is forbidden
// (-1) refer to record infinite.
// Output: none
// Return: 0 successful
// others failed
// Note: before call this function, you can call DC_SetSnapshotParam()
// to config parameters
/******************************************************************************/
typedef int (*DC_RECORD_CALLBACK_FUNC)( /*return: 0 successful, others failed*/
uint32 i_frame,
DC_FRAME_T *p_frame
);
int DC_StartMjpgRec(uint32 dw_framenum, DC_RECORD_CALLBACK_FUNC pf_callback);
/******************************************************************************/
// Description: stop mjpg capture
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: 0 successful
// others failed
// Note: none
/******************************************************************************/
int DC_StopMjpgRec(void);
/******************************************************************************/
// Description: start mjpg decode
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: 0 successful
// others failed
// Note: before this you can call DC_SetReviewParam() to set review
// parameters
/******************************************************************************/
int DC_StartMjpgDec(void);
/******************************************************************************/
// Description: send a frame to decode
// Author: Zhemin.Lin&Benny.Zhou
// Input: p_frame point to frame structure, please refer to block_t
// Output: none
// Return: 0 successful
// others failed
// Note: none
/******************************************************************************/
int DC_DecAFrame(void *p_frame, uint32 len, int is_first_frame, int is_invert);
/******************************************************************************/
// Description: stop mjpg decoding
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: 0 successful
// others failed
// Note: none
/******************************************************************************/
int DC_StopMjpgDec(void);
/******************************************************************************/
// Description: set Mpeg4Play parameters
// Author: Zhemin.Lin&Benny.Zhou
// Input: pst_param point to the Mpeg4Play parameter
// Output: none
// Return: 0 successful
// others failed
// Note: before start preview, call this function to set parameters
/******************************************************************************/
int DC_SetMpeg4PlayParam(const DC_REVIEW_PARAM_T *pst_param);
/******************************************************************************/
// Description: start transform YUV to RGB
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: 0 successful
// others failed
// Note: before this you can call DC_SetReviewParam() to set review
// parameters
/******************************************************************************/
int DC_StartYUV2RGB(void);
/******************************************************************************/
// Description: transform YUV to RGB for mpeg4 decode
// Author: Zhemin.Lin&Benny.Zhou
// Input: p_frame point to frame structure, please refer to block_t
// Output: none
// Return: 0 successful
// others failed
// Note: none
/******************************************************************************/
int DC_TransAFrame(void *p_frame, uint32 len, uint32 is_invert);
/******************************************************************************/
// Description: set mpeg4 parameters
// Author: Zhemin.Lin&Benny.Zhou
// Input: pst_param point to the mjpg parameter
// Output: none
// Return: 0 successful
// others failed
// Note: before start preview, call this function to set parameters
/******************************************************************************/
int DC_SetMpeg4RecParam(const DC_MJPG_PARAM_T *pst_param);
/******************************************************************************/
// Description: start mpeg4 record
// Author: Zhemin.Lin&Benny.Zhou
// Input: dw_framenum total frame number, 0 is forbidden
// (-1) refer to record infinite.
// Output: none
// Return: 0 successful
// others failed
// Note: before call this function, you can call DC_SetSnapshotParam()
// to config parameters
/******************************************************************************/
int DC_StartMpeg4Rec(uint32 dw_framenum, DC_RECORD_CALLBACK_FUNC pf_callback);
/******************************************************************************/
// Description: stop mpeg4 record
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: 0 successful
// others failed
// Note: none
/******************************************************************************/
int DC_StopMpeg4Rec(void);
int DC_SingleModeAutoFocus(const DC_PREVIEW_PARAM_T *pst_param);
typedef enum
{
SENSOR_MODEMAX_1600_1200, //2M
SENSOR_MODEMAX_1280_1024, //1.3M
SENSOR_MODEMAX_640_480, //0.3M
SENSOR_MODEMAX_INVALID
}PROD_SENSOR_MAX_MODE_E;
/**---------------------------------------------------------------------------*
** Data Structures *
**---------------------------------------------------------------------------*/
/*****************************************************************************/
// Description: get sensor max mode size
// Author: Bruce.Chi
// Note:
/*****************************************************************************/
PUBLIC PROD_SENSOR_MAX_MODE_E PRODDC_GetSensorMaxMode(void);
/******************************************************************************/
// Description: set scale factor & fraction
// Author: Jing.li
// Input: pt_scale: scale parameter pointer
// op_id: operation type
// Output: none
// Return: 0 successful
// others failed
// Note:
/******************************************************************************/
PUBLIC BOOLEAN DC_SetScaleParam(SCALE_T *pt_scale, uint8 op_id);
/******************************************************************************/
// Description: capture YUV data
// Author: jing.li
// Input: none
// Output: none
// Return: 0 uccessful
// others failed
// Note: none
/*******************************************************************************/
PUBLIC int DC_DoSnapshotYUV(void);
/******************************************************************************/
// Description: play back YUV data from buffer
// Author: jing.li
// Input: p_buf: yuv data buffer
// len: yuv data length
// width: yuv data width
// height: yuv data height;
// pf_callback: callback function pointer
// Output: none
// Return: 0 successful
// others failed
/******************************************************************************/
PUBLIC int DC_PlaybackYUVFromBuf(
uint8 *p_buf,
uint32 len,
uint16 width,
uint16 height,
PLAYBACK_SET_FUNC pf_callback
);
/******************************************************************************/
// Description:Get Capture YUV buffer
// Author: jing.li
// Input: none
// Output: yuv_size: yuv data size
// Return: yuv data buffer address
/******************************************************************************/
PUBLIC uint8* DC_GetYUVBuffer(uint32* yuv_size);
/******************************************************************************/
// Description:encode zoom yuv data
// Author: jing.li
// Input: none
// Output: none
// Return: 0 successful
// others failed
/******************************************************************************/
PUBLIC uint32 DC_DoEncodeZoomData(void);
#ifdef __cplusplus
}
#endif
#endif /*#ifndef DIGITALCAMERA_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -