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

📄 pthread_search.h

📁 1、基于韩国at2041芯片开发的Linux环境的DVR代码。 2、以原来代码进行了修改。 3、主要修改网络通讯出现异常问题处理 4、硬盘覆盖录像不起作用
💻 H
字号:
/* set tabstop=4 */
/********************************************************************************
 *                                                                              *
 * Copyright(C) 2004  Penta-Micro                                               *
 *                                                                              *
 * ALL RIGHT RESERVED                                                           *
 *                                                                              *
 * This software is the property of Penta-Micro and is furnished under          *
 * license by Penta-Micro. This software may be used only in accordance         *	
 * with the terms of said license. This copyright notice may not be             *
 * removed, modified or obliterated without the prior written permission        *
 * of Penta-Micro.                                                              *
 *                                                                              *
 * This software may not be copyed, transmitted, provided to or otherwise       *
 * made available to any other person, company, corporation	or other entity     *
 * except as specified in the terms of said license.                            *
 *                                                                              *
 * No right, title, ownership or other interest in the software is hereby       *
 * granted or transferred.                                                      *
 *                                                                              *
 * The information contained herein is subject to change without notice and     *
 * should not be construed as a commitment by Penta-Micro.                      *
 *                                                                              *
 ********************************************************************************
 
  MODULE NAME:  PTHREAD_SEARCH.H
  
  REVISION HISTORY:
  
  Date       Ver Name                  Description
  ---------- --- --------------------- -----------------------------------------
 06/30/2004 2.0 CheulBeck(whitefe)       Created 
 07/20/2005 2.1 JiGwanKang(xchannel)  Modified
 ...............................................................................
 
  DESCRIPTION:
  
  This Module contains definition for Search function.
  
 ...............................................................................
*/    
 
#ifndef __PTHREAD_SEARCH_H
#define __PTHREAD_SEARCH_H


/** ************************************************************************* ** 
 ** includes
 ** ************************************************************************* **/
#include <time.h>

#include "typedef.h"

 
/** ************************************************************************* ** 
 ** defines
 ** ************************************************************************* **/
#define MAX_FILELIST_NUM	1000
#define FILELIST_NUM		10
#define MAX_PLAY_STEP		5


/** ************************************************************************* ** 
 ** typedefs
 ** ************************************************************************* **/
typedef enum {
	SEARCH_MAIN = 0,
	SEARCH_FILELIST,
	SEARCH_PLAYBACK,
	SEARCH_MAX_ID
} SEARCH_ID;

typedef enum {
	SM_TOP_MENU = 0,
	SM_START_TIME,
	VALUE_ST_YEAR,	
	VALUE_ST_MONTH,	
	VALUE_ST_DAY,	
	VALUE_ST_HOUR,	
	VALUE_ST_MIN,	
	VALUE_ST_SEC,	
	SM_END_TIME,
	VALUE_ET_YEAR,	
	VALUE_ET_MONTH,		// 10
	VALUE_ET_DAY,	
	VALUE_ET_HOUR,	
	VALUE_ET_MIN,	
	VALUE_ET_SEC,	
	SM_SELECT_TIME,
	VALUE_SLT_YEAR,	
	VALUE_SLT_MONTH,	
	VALUE_SLT_DAY,	
	VALUE_SLT_HOUR,		// 19
} ITEM_SEARCH_MAIN;

typedef enum {
	SF_TOP_MENU = 0,
	VALUE_REC_MODE,
	SF_RM_DISP,	
	VALUE_LIST1,	
	VALUE_L1_CONTI,	
	VALUE_L1_MOTION,	
	VALUE_L1_SENSOR,	
	VALUE_LIST2,	
	VALUE_L2_CONTI,	
	VALUE_L2_MOTION,	
	VALUE_L2_SENSOR,	// 10	
	VALUE_LIST3,	
	VALUE_L3_CONTI,	
	VALUE_L3_MOTION,	
	VALUE_L3_SENSOR,	
	VALUE_LIST4,	
	VALUE_L4_CONTI,	
	VALUE_L4_MOTION,	
	VALUE_L4_SENSOR,	
	VALUE_LIST5,	
	VALUE_L5_CONTI,		// 20
	VALUE_L5_MOTION,	
	VALUE_L5_SENSOR,	
	VALUE_LIST6,	
	VALUE_L6_CONTI,	
	VALUE_L6_MOTION,	
	VALUE_L6_SENSOR,	
	VALUE_LIST7,	
	VALUE_L7_CONTI,	
	VALUE_L7_MOTION,	
	VALUE_L7_SENSOR,	// 30
	VALUE_LIST8,	
	VALUE_L8_CONTI,	
	VALUE_L8_MOTION,	
	VALUE_L8_SENSOR,	
	VALUE_LIST9,	
	VALUE_L9_CONTI,	
	VALUE_L9_MOTION,	
	VALUE_L9_SENSOR,	
	VALUE_LIST10,	
	VALUE_L10_CONTI,	// 40
	VALUE_L10_MOTION,	
	VALUE_L10_SENSOR,	
} ITEM_SEARCH_FILELIST;

typedef struct __SEARCH_LIST__ {
	UNS16		mode;					// '0' All, '1' Conti, '2' Motion, '3' Sensor
	UNS16		total_num;				// total number for search file list	
	S32			cur_db_fp;				// current search db file pointer
	S32			next_db_fp;				// next search db file pointer
	UNS32		start_num;				// start search list number	
	UNS32		end_num;				// end search list number
	UNS16		list_num;				// search list number
	/* xchannel : must be modify ( too much )*/
	DB_RECORD	db_nrec[MAX_FILELIST_NUM];	// file lsit for search display 
} SEARCH_LIST;

typedef struct __SEARCH_OBJECT__ {
	UNS16		sig_id;
	UNS16		sig_value;
	SEARCH_ID	prev_id;	
	SEARCH_ID	cur_id;
	SEARCH_ID	next_id;
	S16			cur_loc;	
	S16			osd_loc;
	UNS16		create_menu;	
	UNS16		upgrade_menu;
	struct tm 	tm_start;
	struct tm 	tm_end;	
	struct tm 	tm_select;
	struct tm	tm_before;
	struct tm	tm_after;
	SETUP_PARAM	*param;
	STATE_DEC		*psd;
	SEARCH_LIST	search_list;
} SEARCH_OBJECT;

typedef struct __SEARCH_FUNC__
{
	RETURN (*func_ptr)(SEARCH_OBJECT *pso);
} SEARCH_FUNC;

typedef struct __FUNC_ID__ {
	SEARCH_FUNC func_id[SEARCH_MAX_ID];	
} FUNC_ID;

/* Definition for SEARCH MENU */
typedef struct{
	S16    xstart;
	S16    ystart;
	S16    color;
	UNS8 str[50];
	S16    attribute;
	S16    font_space;
	S16    active;
	S16    value;
} MENU_FONT_t;

typedef struct{
	S16    start;
	S16    end;
} MENU_ACTIVE_ITEM_t;

#define SEARCH_MAX_ITEMS 60
#define font_xstart(x)		(x)
#define font_ystart(x)		(x)

static MENU_ACTIVE_ITEM_t search_menu_active[SEARCH_MAX_ID] = {
	{16,19},{3,39},{2,12}
};

static MENU_FONT_t search_menu_font[SEARCH_MAX_ID][SEARCH_MAX_ITEMS] = {
	{      //SEARCH   0
		  {	font_xstart( 7), font_ystart( 7), WHITE, "PLEASE SELECT PLAYBACK TIME.",	0,0,0,0	// 00
		},{	font_xstart( 5), font_ystart( 9), WHITE, "START TIME :        /     :  :",	                  0,0,0,0
		},{	font_xstart(18), font_ystart( 9), WHITE, "2005",						                  0,0,0,0
		},{	font_xstart(23), font_ystart( 9), WHITE, "01",							            0,0,0,0
		},{	font_xstart(26), font_ystart( 9), WHITE, "01",							            0,0,0,0
		},{	font_xstart(29), font_ystart( 9), WHITE, "12",							            0,0,0,0
		},{	font_xstart(32), font_ystart( 9), WHITE, "00",							            0,0,0,0
		},{	font_xstart(35), font_ystart( 9), WHITE, "00",							            0,0,0,0
		},{	font_xstart( 5), font_ystart(10), WHITE, "END   TIME :        /     :  :",	                  0,0,0,0
		},{	font_xstart(18), font_ystart(10), WHITE, "2005",						                  0,0,0,0
		},{	font_xstart(23), font_ystart(10), WHITE, "01",							            0,0,0,0	// 10
		},{	font_xstart(26), font_ystart(10), WHITE, "01",							            0,0,0,0
		},{	font_xstart(29), font_ystart(10), WHITE, "12",							            0,0,0,0
		},{	font_xstart(32), font_ystart(10), WHITE, "00",							            0,0,0,0
		},{	font_xstart(35), font_ystart(10), WHITE, "00",							            0,0,0,0
		},{	font_xstart( 5), font_ystart(12), WHITE, "SELECT     :        /     :00:00",	            0,0,0,0
		},{	font_xstart(18), font_ystart(12), WHITE, "2005",						                  0,0,1,0
		},{	font_xstart(23), font_ystart(12), WHITE, "01",							            0,0,1,0
		},{	font_xstart(26), font_ystart(12), WHITE, "01",							            0,0,1,0
		},{	font_xstart(29), font_ystart(12), WHITE, "12",							            0,0,1,0	//19
		},{	-1,			-1,			FILL,     "",			1,0,-1
		},
	},		
	{      //SEARCH FILE LIST   1
		  {	font_xstart(10), font_ystart( 3), WHITE, "SEARCH FILE LIST: ",	                        0,0,0,0	// 00
		},{	font_xstart(28), font_ystart( 3), WHITE, "ALL   ",				                        0,0,1,0
		},{	font_xstart(27), font_ystart( 5), WHITE, "CRec MRec SRec",		                        0,0,0,0
		},{	font_xstart( 4), font_ystart( 6), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart( 6), WHITE, "C",						                        0,0,0,0
		},{	font_xstart(34), font_ystart( 6), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart( 6), WHITE, "S",						                        0,0,0,0
		},{	font_xstart( 4), font_ystart( 7), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart( 7), WHITE, "C",						                        0,0,0,0
		},{	font_xstart(34), font_ystart( 7), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart( 7), WHITE, "S",						                        0,0,0,0	// 10
		},{	font_xstart( 4), font_ystart( 8), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart( 8), WHITE, "C",						                        0,0,0,0
		},{	font_xstart(34), font_ystart( 8), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart( 8), WHITE, "S",						                        0,0,0,0		
		},{	font_xstart( 4), font_ystart( 9), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart( 9), WHITE, "C",						                        0,0,0,0
		},{	font_xstart(34), font_ystart( 9), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart( 9), WHITE, "S",						                        0,0,0,0		
		},{	font_xstart( 4), font_ystart(10), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart(10), WHITE, "C",						                  0,0,0,0	// 20
		},{	font_xstart(34), font_ystart(10), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart(10), WHITE, "S",						                  0,0,0,0		
		},{	font_xstart( 4), font_ystart(11), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart(11), WHITE, "C",						                  0,0,0,0
		},{	font_xstart(34), font_ystart(11), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart(11), WHITE, "S",						                  0,0,0,0		
		},{	font_xstart( 4), font_ystart(12), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart(12), WHITE, "C",						                  0,0,0,0
		},{	font_xstart(34), font_ystart(12), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart(12), WHITE, "S",						                  0,0,0,0	// 30
		},{	font_xstart( 4), font_ystart(13), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart(13), WHITE, "C",						                  0,0,0,0
		},{	font_xstart(34), font_ystart(13), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart(13), WHITE, "S",						                  0,0,0,0		
		},{	font_xstart( 4), font_ystart(14), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart(14), WHITE, "C",						                  0,0,0,0
		},{	font_xstart(34), font_ystart(14), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart(14), WHITE, "S",						                  0,0,0,0		
		},{	font_xstart( 4), font_ystart(15), WHITE, "",						                        0,0,1,0
		},{	font_xstart(29), font_ystart(15), WHITE, "C",						                  0,0,0,0	// 40
		},{	font_xstart(34), font_ystart(15), WHITE, "M",						                  0,0,0,0
		},{	font_xstart(39), font_ystart(15), WHITE, "S",						                  0,0,0,0		
		},{	-1,			-1,			FILL,     "",			1,0,-1
		},
	}
};

  
/** ************************************************************************* ** 
 ** function prototypes
 ** ************************************************************************* **/
void	            *pthread_search(void *args);
RETURN	search_create_menu(SEARCH_ID id);
void            search_clear_menu(SEARCH_ID id);
void	            search_select_menu(SEARCH_OBJECT *pso, S16 up_down);
void	            search_update_osd(SEARCH_OBJECT *pso);
RETURN	search_main(SEARCH_OBJECT *pso);
RETURN	search_filelist(SEARCH_OBJECT *pso);
RETURN	search_playback(SEARCH_OBJECT *pso);
RETURN	get_search_list(SEARCH_OBJECT *pso);
RETURN	set_osd_for_search_list(SEARCH_OBJECT *pso);
S16		      get_start_end_time(SEARCH_OBJECT *pso);
RETURN	from_str_to_time(char	*str_time, struct tm *Time);
UNS32        db_record_matching(DB_RECORD *db, UNS32 fp);
#endif /* __PTHREAD_SEARCH_H */

⌨️ 快捷键说明

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