source/dvr_type_define.h
Go to the documentation of this file.
00001 #ifndef __DVR_TYPE_DEFINE_H__ 00002 #define __DVR_TYPE_DEFINE_H__ 00003 00004 #include "dvr_scenario_define.h" 00005 00006 #ifndef TRUE 00007 #define TRUE 1 00008 #endif 00009 00010 #ifndef FALSE 00011 #define FALSE 0 00012 #endif 00013 00014 #define GMDVR_MEM_CFG_FILE "/mnt/mtd/gmdvr_mem.cfg" 00015 #define GMDVR_MAKE_FOURCC(a,b,c,d) (int)((a)|(b)<<8|(c)<<16|(d)<<24) 00016 00017 #define GMVAL_DO_NOT_CARE (-54172099) 00018 #define GMVAL_RATE(val,base) ((base<<16)|val) 00019 00020 #define GMVAL_RT_GET_VAL(rate) (rate&0x0000FFFF) 00021 #define GMVAL_RT_GET_BASE(rate) (rate>>16) 00022 00023 //Graph ID 00024 #define GFID_DISP(plane_num)(0x10000+plane_num) 00025 #define GFID_ENC(ch_num) (0x20000+ch_num) 00026 #define GFID_DEC(ch_num) (0x30000+ch_num) 00027 00028 /** 00029 * @brief function tag for videograph level 00030 */ 00031 typedef struct FuncTag_tag{ 00032 //bit24~27 is reserved 00033 int func : 28; ///< functional tag 00034 int cas_ch : 4; ///< cascade channel 00035 int lv_ch; ///< liveview channel 00036 int rec_ch; ///< record channel 00037 int pb_ch; ///< playback channel 00038 }FuncTag; 00039 /* 00040 func cas_ch lv_ch rec_ch pb_ch 00041 | | | | | 00042 xxxx xxxx xxxx xx xx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 00043 */ 00044 #define MTHD_USE_CMP 0x1 00045 00046 #define FN_NONE 0x0 00047 #define FN_LIVEVIEW 0x1 00048 #define FN_RECORD 0x2 00049 #define FN_PLAYBACK 0x4 00050 #define FN_CASCADE 0x8 00051 #define FN_LCD_PARAM 0x10 00052 #define FN_PLANE_PARAM 0x20 00053 #define FN_SUB1_RECORD 0x40 00054 #define FN_SUB2_RECORD 0x80 00055 #define FN_SUB3_RECORD 0x100 00056 #define FN_SUB4_RECORD 0x200 00057 #define FN_SUB5_RECORD 0x400 00058 #define FN_SUB6_RECORD 0x800 00059 #define FN_SUB7_RECORD 0x1000 00060 #define FN_SUB8_RECORD 0x2000 00061 #define FN_UPDATE_METHOD 0x10000 00062 #define FN_PB_SCL_LINK 0x20000 00063 #define FN_METHOD_USE_CMP 0x8000000 00064 #define FN_SUB_ALL_RECORD (FN_RECORD|FN_SUB1_RECORD|FN_SUB2_RECORD|FN_SUB3_RECORD|FN_SUB4_RECORD|FN_SUB5_RECORD|FN_SUB6_RECORD|FN_SUB7_RECORD|FN_SUB8_RECORD) 00065 00066 00067 #define FN_RESET_TAG(ptag) { (ptag)->func=0; (ptag)->lv_ch=0; (ptag)->rec_ch=0; (ptag)->pb_ch=0; (ptag)->cas_ch=0; } 00068 #define FN_COPY_TAG(newt,ptag) { (newt)->func=(ptag)->func; (newt)->lv_ch=(ptag)->lv_ch; (newt)->rec_ch=(ptag)->rec_ch; (newt)->pb_ch=(ptag)->pb_ch; (newt)->cas_ch=(ptag)->cas_ch; } 00069 #define FN_SET_LV_CH(ptag, ch_num) { (ptag)->func|=FN_LIVEVIEW; (ptag)->lv_ch|=(0x1<<ch_num); } 00070 #define FN_SET_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00071 #define FN_SET_SUB1_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB1_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00072 #define FN_SET_SUB2_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB2_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00073 #define FN_SET_SUB3_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB3_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00074 #define FN_SET_SUB4_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB4_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00075 #define FN_SET_SUB5_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB5_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00076 #define FN_SET_SUB6_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB6_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00077 #define FN_SET_SUB7_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB7_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00078 #define FN_SET_SUB8_REC_CH(ptag, ch_num) { (ptag)->func|=(FN_SUB8_RECORD); (ptag)->rec_ch|=(0x1<<ch_num); } 00079 #define FN_SET_PB_CH(ptag, ch_num) { (ptag)->func|=FN_PLAYBACK; (ptag)->pb_ch|=(0x1<<ch_num); } 00080 #define FN_SET_CAS_CH(ptag, ch_num) { (ptag)->func|=FN_CASCADE; (ptag)->cas_ch|=(0x1<<ch_num); } 00081 #define FN_SET_FUNC(ptag, fnc) { (ptag)->func|=fnc; } 00082 #define FN_REMOVE_FUNC(ptag, fnc) { (ptag)->func&=(~fnc); } 00083 #define FN_SET_ALL(ptag) { (ptag)->func=(0xFF); /* Note: 'func' value doesn't include FN_UPDATE_METHOD. */ \ 00084 (ptag)->lv_ch=0xFFFFFFFF; (ptag)->rec_ch=0xFFFFFFFF; (ptag)->pb_ch=0xFFFFFFFF; (ptag)->cas_ch=0xF; } 00085 #define FN_IS_UPDATE(ptag) ((ptag)->func&FN_UPDATE_METHOD) 00086 #define FN_COMPARE(ptagA, ptagB) ( ((ptagA)->func==(ptagB)->func) && ((ptagA)->lv_ch==(ptagB)->lv_ch) && ((ptagA)->rec_ch==(ptagB)->rec_ch) && ((ptagA)->pb_ch==(ptagB)->pb_ch) && ((ptagA)->cas_ch==(ptagB)->cas_ch) ) 00087 #define FN_IS_EMPTY(ptag) ( ((ptag)->func==0) && ((ptag)->lv_ch==0) && ((ptag)->rec_ch==0) && ((ptag)->pb_ch==0) && ((ptag)->cas_ch==0) ) 00088 #define FN_IS_FN(ptag, fn) ( (ptag)->func&(fn) ) 00089 #define FN_REMOVE_LV_CH(ptag, ch) ( (ptag)->lv_ch&=(~ch) ) 00090 /* FN_CHECK_MASK uses AND(&) operation on ptagA with ptagB, and check channel values for LV,REC,PB,CAS */ 00091 #if 1 00092 #define FN_CHECK_MASK(ptagA,ptagB) \ 00093 ((((ptagA)->func&(ptagB)->func)==FN_LIVEVIEW)?((ptagA)->lv_ch&(ptagB)->lv_ch): \ 00094 ((((ptagA)->func&(ptagB)->func)==FN_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00095 ((((ptagA)->func&(ptagB)->func)==FN_SUB1_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00096 ((((ptagA)->func&(ptagB)->func)==FN_SUB2_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00097 ((((ptagA)->func&(ptagB)->func)==FN_SUB3_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00098 ((((ptagA)->func&(ptagB)->func)==FN_SUB4_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00099 ((((ptagA)->func&(ptagB)->func)==FN_SUB5_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00100 ((((ptagA)->func&(ptagB)->func)==FN_SUB6_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00101 ((((ptagA)->func&(ptagB)->func)==FN_SUB7_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00102 ((((ptagA)->func&(ptagB)->func)==FN_SUB8_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00103 ((((ptagA)->func&(ptagB)->func)==FN_PLAYBACK)?((ptagA)->pb_ch&(ptagB)->pb_ch): \ 00104 ((((ptagA)->func&(ptagB)->func)==FN_CASCADE)?((ptagA)->cas_ch&(ptagB)->cas_ch): \ 00105 ((ptagA)->func&(ptagB)->func) )))))))))))) 00106 #else 00107 #define FN_CHECK_MASK(ptagA,ptagB) \ 00108 ((((ptagA)->func&(ptagB)->func)==FN_LIVEVIEW)?((ptagA)->lv_ch&(ptagB)->lv_ch): \ 00109 ((((ptagA)->func&(ptagB)->func)==FN_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00110 ((((ptagA)->func&(ptagB)->func)==FN_SUB1_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00111 ((((ptagA)->func&(ptagB)->func)==FN_SUB2_RECORD)?((ptagA)->rec_ch&(ptagB)->rec_ch): \ 00112 ((((ptagA)->func&(ptagB)->func)==FN_PLAYBACK)?((ptagA)->pb_ch&(ptagB)->pb_ch): \ 00113 ((((ptagA)->func&(ptagB)->func)==FN_CASCADE)?((ptagA)->cas_ch&(ptagB)->cas_ch): \ 00114 ((ptagA)->func&(ptagB)->func) )))))) 00115 #endif 00116 #define FN_ITEMS(ptag) (ptag)->func, (ptag)->lv_ch, (ptag)->rec_ch, (ptag)->pb_ch, (ptag)->cas_ch 00117 00118 /* Queue name. 00119 Note => the length of queue must be smaller than MAX_NAME_SIZE. */ 00120 #define QNAME_LCD "lcd" 00121 #define QNAME_3DI_SCL "3di_scl" 00122 #define QNAME_LV_SCL "lv_scl" 00123 #define QNAME_ENC_IN "enc_in" 00124 #define QNAME_ENC_OUT "enc_out" 00125 #define QNAME_SS_ENC_IN "ssenc_in" 00126 #define QNAME_SS_ENC_OUT "ssenc_out" 00127 #define QNAME_SUB1_ENC_IN "sub1enc_in" 00128 #define QNAME_SUB1_ENC_OUT "sub1enc_out" 00129 #define QNAME_SUB2_ENC_IN "sub2enc_in" 00130 #define QNAME_SUB2_ENC_OUT "sub2enc_out" 00131 #define QNAME_DEC_IN "dec_in" 00132 #define QNAME_PB_SCL "pb_scl" 00133 #if TWO_STAGES_SCALER 00134 #define QNAME_PB_SCL2 "pb_scl2" 00135 #endif 00136 00137 typedef enum QueueID_tag { 00138 QID_LCD=10, 00139 QID_3DI_SCL, 00140 QID_LV_SCL, 00141 QID_ENC_IN, 00142 QID_ENC_OUT, 00143 QID_SS_ENC_IN, 00144 QID_SS_ENC_OUT, 00145 QID_SUB1_ENC_IN, 00146 QID_SUB1_ENC_OUT, 00147 QID_SUB2_ENC_IN, 00148 QID_SUB2_ENC_OUT, 00149 QID_DEC_IN, 00150 QID_PB_SCL 00151 }QueueID; 00152 00153 /** 00154 * @brief set width and height 00155 */ 00156 typedef struct DIM_tag { 00157 int width; ///< width in pixel 00158 int height; ///< height in pixel 00159 }DIM; 00160 00161 /** 00162 * @brief set size and position 00163 */ 00164 typedef struct RECT_tag { 00165 int x; ///< x position 00166 int y; ///< y positon 00167 int width; ///< width in pixel 00168 int height; ///< height in pixel 00169 }RECT; 00170 00171 /** 00172 * @brief set position x and y 00173 */ 00174 typedef struct POS_tag { 00175 int x; ///< x position 00176 int y; ///< y positon 00177 }POS; 00178 00179 /** 00180 * @brief set ROI position x, y, width, height, and enable/disable 00181 */ 00182 typedef struct ROI_ALL_tag { 00183 /*! Enable the ROI function, TRUE/FALSE */ 00184 int is_use_ROI; 00185 /*! #RECT_tag */ 00186 RECT win; 00187 }ROI_ALL; 00188 00189 00190 /** 00191 * @brief set queue memory configuration 00192 */ 00193 typedef struct QueueMemConfig_tag { 00194 int size; ///< size of buffer 00195 int count; ///< the number of buffers 00196 int ddr_num; ///< the DDR number 00197 int limit_count; ///< Max count of in-used buffer 00198 }QueMemCfg; 00199 00200 /** 00201 * @brief set dvr graph queue configuration 00202 */ 00203 typedef struct dvr_graph_vqueuet_tag 00204 { 00205 struct v_queue_t *que; 00206 int size; ///< size of buffer 00207 int count; ///< the number of buffers 00208 int ddr; ///< the DDR number 00209 int limit_count; ///< Max count of in-used buffer 00210 FuncTag user_tag; ///< function tag for videograph level 00211 }dvr_graph_vqueuet; 00212 00213 /** 00214 * @brief dvr bit-stream data 00215 */ 00216 typedef struct dvr_bs_data_tag { 00217 struct timeval timestamp; 00218 int offset; ///< bitstream buffer offset. 00219 int length; ///< bitstream buffer length. 00220 int is_keyframe; ///< 1: current frame is a keyframe. 0: current frame is not a keyframe. 00221 int mv_offset; ///< motion vector offset 00222 int mv_length; ///< motion vector length 00223 00224 //internal use 00225 void *p_job; ///< internal use 00226 int stream; ///< internal use 00227 /*! 0: current P frame was encoded as referenced. */ 00228 /*! 1: current P frame was encoded as non-referenced */ 00229 int NonRef; 00230 int reserved[8]; 00231 }dvr_bs_data; 00232 00233 typedef struct dvr_rate_tag { 00234 int numerator; ///< Not in use 00235 int denominator; ///< Not in use 00236 int reserved[4]; ///< Not in use 00237 }dvr_ratio; 00238 00239 /** 00240 * @brief dvr video parameter. 00241 */ 00242 typedef struct video_process_tag { 00243 /*! TRUE : enable 3D deinterlace , False : disable 3D deinterlace */ 00244 int is_3DI; 00245 /*! TRUE : enable 3D denoise , False : disable 3D denoise */ 00246 int is_denoise; 00247 /*! #GM3DIFrameTypeTag */ 00248 int denoise_mode; 00249 int reserved[4]; 00250 }video_process; 00251 00252 /** 00253 * @brief scalar parameter 00254 */ 00255 typedef struct ScalerParamtag { 00256 /*! #ScaleColorModeTag */ 00257 int src_fmt; ///< source format 00258 /*! #ScaleColorModeTag */ 00259 int dst_fmt; ///< destination format 00260 /*! #ScaleMethodTag */ 00261 int scale_mode; 00262 int is_dither; ///< Not in use 00263 int is_correction; ///< Not in use 00264 int is_album; ///< Not in use 00265 int des_level; ///< Not in use 00266 int reserved[8]; 00267 } ScalerParam; 00268 00269 typedef enum EncodeType_tag { 00270 ENC_TYPE_H264 = 0, 00271 ENC_TYPE_MPEG, 00272 ENC_TYPE_MJPEG, 00273 ENC_TYPE_YUV422, 00274 ENC_TYPE_COUNT 00275 }EncodeType; 00276 00277 /* debug level */ 00278 #define DBG_ENTITY_FNC 0x01 00279 #define DBG_ENTITY_JOB_FLOW 0x02 00280 #define DBG_DVR_FNC 0x04 00281 #define DBG_DVR_DATA_FLOW 0x08 00282 #define DBG_GRAPH_FNC 0x10 00283 #define DBG_GRAPH_DATA 0x20 00284 00285 00286 typedef enum LCDOutputColorTypeTag { 00287 LCD_COLOR_YUV422, 00288 LCD_COLOR_YUV420, 00289 LCD_COLOR_RGB = 16, 00290 LCD_COLOR_ARGB = 16, 00291 LCD_COLOR_RGB888, 00292 LCD_COLOR_RGB565, 00293 LCD_COLOR_RGB555, 00294 LCD_COLOR_RGB444, 00295 LCD_COLOR_RGB8 00296 }LCDOutputColorType; 00297 00298 #define MCP_VIDEO_NTSC 0 ///< video mode : NTSC 00299 #define MCP_VIDEO_PAL 1 ///< video mode : PAL 00300 #define MCP_VIDEO_VGA 2 ///< video mode : VGA 00301 00302 typedef enum LCDOutputModeTag { 00303 LCD_PROGRESSIVE = 0, 00304 LCD_INTERLACING = 1 00305 }LCDOutputMode; 00306 00307 typedef enum LiveviewFrameTypeTag { 00308 LVFRAME_EVEN_ODD=0, 00309 LVFRAME_ENLARGE_ONE_FIELD=1, 00310 LVFRAME_WEAVED_TWO_FIELDS=2, 00311 LVFRAME_GM3DI_FORMAT=3 00312 }LiveviewFrameType; 00313 00314 typedef enum LiveviewFrameModeTag { 00315 LVFRAME_FRAME_MODE=0, 00316 LVFRAME_FIELD_MODE=1, 00317 LVFRAME_FIELD_MODE2=2 /* Treat every field as a complete frame, must work with LVFRAME_ENLARGE_ONE_FIELD */ 00318 }LiveviewFrameMode; 00319 00320 typedef enum GM3DIFrameTypeTag { 00321 GM3DI_FIELD=1, 00322 GM3DI_FRAME=2 00323 }GM3DIFrameType; 00324 00325 00326 typedef enum LiveviewDMAOrderTag { 00327 DMAORDER_PACKET=0, 00328 DMAORDER_3PLANAR=1, 00329 DMAORDER_2PLANAR=2 00330 }LiveviewDMAOrder; 00331 00332 typedef enum LiveviewScalerRatioTag { 00333 CAPSCALER_KEEP_RATIO=0, 00334 CAPSCALER_NOT_KEEP_RATIO=1 00335 }LiveviewScalerRatio; 00336 00337 00338 typedef enum CaptureColorModeTag { 00339 CAPCOLOR_RGB888=0, 00340 CAPCOLOR_RGB565=1, 00341 CAPCOLOR_YUV422=2, 00342 CAPCOLOR_YUV420_M0=3, 00343 CAPCOLOR_YUV420_M1=4 00344 }CaptureColorMode; 00345 00346 typedef enum EncoderInputFormatTag { 00347 ENC_INPUT_H2642D=0, 00348 ENC_INPUT_MP42D=1, 00349 ENC_INPUT_1D420=2, 00350 ENC_INPUT_1D422=3 00351 }EncoderInputFormat; 00352 00353 typedef enum DecoderOutputColorTag { 00354 DEC_OUTPUT_COLOR_YUV420=4, 00355 DEC_OUTPUT_COLOR_YUV422=5 00356 }DecoderOutputColor; 00357 00358 typedef enum JpegEncInputFormatTag{ 00359 JCS_yuv420 = 0, 00360 JCS_yuv422 = 1, 00361 JCS_yuv211 = 2, 00362 JCS_yuv333 = 3, 00363 JCS_yuv222 = 4, 00364 JCS_yuv111 = 5, 00365 JCS_yuv400 = 6 00366 } JpegEncInputFormat; 00367 00368 typedef enum JpegEnc420InputFormatTag{ 00369 JENC_INPUT_MP42D=0, 00370 JENC_INPUT_1D420=1, 00371 JENC_INPUT_H2642D=2, 00372 JENC_INPUT_DMAWRP420=3, 00373 JENC_INPUT_1D422=4 00374 } JpegEnc420InputFormat; 00375 00376 typedef enum ScaleMethodTag { 00377 SCALE_LINEAR=0, 00378 SCALE_NON_LINEAR, 00379 SCALE_METHOD_COUNT 00380 }ScaleMethod; 00381 00382 typedef enum ScaleColorModeTag { 00383 SCALE_RGB888=0, 00384 SCALE_RGB565=1, 00385 SCALE_H264_YUV420_MODE0=2, 00386 SCALE_H264_YUV420_MODE1=3, 00387 SCALE_YUV444=4, 00388 SCALE_YUV422=5, 00389 SCALE_MP4_YUV420_MODE0=6, 00390 SCALE_MP4_YUV420_MODE1=7 00391 }ScaleColorMode; 00392 00393 00394 typedef enum CapturePathTag { 00395 CAPPATH_DEFAULT=0, //If Liveview, use path1, If Record, use path2 00396 CAPPATH_PATH_1, 00397 CAPPATH_PATH_2 00398 }CapturePath; 00399 00400 00401 typedef enum LCDResolutionTag { 00402 LCD_RES_D1, /* 720x576 or 720x480 */ 00403 LCD_RES_SVGA, /* 800x600 */ 00404 LCD_RES_XGA, /* 1024x768 */ 00405 LCD_RES_XVGA, /* 1280x960 */ 00406 LCD_RES_SXGA, /* 1280x1024*/ 00407 LCD_RES_1360x768, /* 1360x768 */ 00408 LCD_RES_COUNT 00409 }LCDResolution; 00410 00411 00412 #define DEFAULT_D1_WIDTH 720 00413 #define DEFAULT_D1_HEIGHT 576 00414 #define DEFAULT_CIF_WIDTH 352 00415 #define DEFAULT_CIF_HEIGHT 288 00416 #define DEFAULT_QCIF_WIDTH 176 00417 #define DEFAULT_QCIF_HEIGHT 144 00418 00419 #endif /* __DVR_TYPE_DEFINE_H__ */ 00420 00421 00422 00423 00424
Generated on Wed Jun 15 2011 15:51:00 for This describe GM8126 ioctl functions by 1.7.1