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

📄 pthread_setup.c

📁 1、基于韩国at2041芯片开发的Linux环境的DVR代码。 2、以原来代码进行了修改。 3、主要修改网络通讯出现异常问题处理 4、硬盘覆盖录像不起作用
💻 C
📖 第 1 页 / 共 5 页
字号:
				} else if (pso->param->sys.camera[pso->cur_loc - 8].contrast >= 127) {					pso->param->sys.camera[pso->cur_loc - 8].contrast = -128;				}				sprintf(temp, "%4d", pso->param->sys.camera[pso->cur_loc - 8].contrast);				strcpy(mft[pso->cur_loc].str, temp);				tw2834_write_reg(TW2834_PAGE0, 0x11 + 0x40 * (pso->cur_loc - 8), (UNS8)(pso->param->sys.camera[pso->cur_loc - 8].contrast+128)); 			} else if (pso->cur_loc >= 13 && pso->cur_loc <= 16) {				if (pso->param->sys.camera[pso->cur_loc - 13].color <= 126) {					pso->param->sys.camera[pso->cur_loc - 13].color ++;				} else if (pso->param->sys.camera[pso->cur_loc - 13].color >= 127) {					pso->param->sys.camera[pso->cur_loc - 13].color = -128;				}				sprintf(temp, "%4d", pso->param->sys.camera[pso->cur_loc - 13].color);				strcpy(mft[pso->cur_loc].str, temp);				tw2834_write_reg(TW2834_PAGE0, 0x0f + 0x40 * (pso->cur_loc - 13), (UNS8)(pso->param->sys.camera[pso->cur_loc - 13].color+128)); 			}			pso->osd_loc = pso->cur_loc;			mft[pso->osd_loc].color = YELLOW;			mft[pso->osd_loc].attribute = BLINK;							setup_update_osd(pso);				break;		case NUM_MINUS :			if (pso->cur_loc >= 3 && pso->cur_loc <= 6) {				if (pso->param->sys.camera[pso->cur_loc - 3].brightness > -128) {					pso->param->sys.camera[pso->cur_loc - 3].brightness --;				} else if (pso->param->sys.camera[pso->cur_loc - 3].brightness <= -128) {					pso->param->sys.camera[pso->cur_loc - 3].brightness = 127;				}				sprintf(temp, "%4d", pso->param->sys.camera[pso->cur_loc - 3].brightness);				strcpy(mft[pso->cur_loc].str, temp);				tw2834_write_reg(TW2834_PAGE0, 0x12 + 0x40 * (pso->cur_loc - 3), (UNS8)(pso->param->sys.camera[pso->cur_loc - 3].brightness+128)); 			} else if (pso->cur_loc >= 8 && pso->cur_loc <= 11) {				if (pso->param->sys.camera[pso->cur_loc - 8].contrast > -128) {					pso->param->sys.camera[pso->cur_loc - 8].contrast --;				} else if (pso->param->sys.camera[pso->cur_loc - 8].contrast <= -128) {					pso->param->sys.camera[pso->cur_loc - 8].contrast = 127;				}				sprintf(temp, "%4d", pso->param->sys.camera[pso->cur_loc - 8].contrast);				strcpy(mft[pso->cur_loc].str, temp);				tw2834_write_reg(TW2834_PAGE0, 0x11 + 0x40 * (pso->cur_loc - 8), (UNS8)(pso->param->sys.camera[pso->cur_loc - 8].contrast+128)); 			} else if (pso->cur_loc >= 13 && pso->cur_loc <= 16) {				if (pso->param->sys.camera[pso->cur_loc - 13].color > -128) {					pso->param->sys.camera[pso->cur_loc - 13].color --;				} else if (pso->param->sys.camera[pso->cur_loc - 13].color <= -128) {					pso->param->sys.camera[pso->cur_loc - 13].color = 127;				}				sprintf(temp, "%4d", pso->param->sys.camera[pso->cur_loc - 13].color);				strcpy(mft[pso->cur_loc].str, temp);				tw2834_write_reg(TW2834_PAGE0, 0x0f + 0x40 * (pso->cur_loc - 13), (UNS8)(pso->param->sys.camera[pso->cur_loc - 13].color+128)); 			}			pso->osd_loc = pso->cur_loc;			mft[pso->osd_loc].color = YELLOW;			mft[pso->osd_loc].attribute = BLINK;							setup_update_osd(pso);							break;											case SUB_MINUS : 			/* return to start position */						location_cur = &setup_menu_active[pso->cur_id];			location_cur->start = 3;			pso->cur_id = SETUP_SYSTEM_PARAM;					pso->create_menu = 1;			break;		default :			break;	}	return SUCCESS;}RETURN setup_system_password(SETUP_OBJECT *pso){	UNS16	ii;	UNS16	jj;		MENU_FONT_t 	*mft;		MENU_ACTIVE_ITEM_t	*location_cur; 		/* numeric table list for key input */	UNS16 key_table_list[] = { NUMBER0,NUMBER1,NUMBER2,NUMBER3,NUMBER4,NUMBER5,NUMBER6,NUMBER7,NUMBER8,NUMBER9};	static S32 num_start, num_end;		mft = setup_menu_font[SETUP_SP_PASSWORD];				switch (pso->sig_value) {		case UP :			if (pso->cur_loc == 4) {				setup_select_menu(pso, -2);						}			num_start = 0;			break;		case DOWN :			if (pso->cur_loc == 2) {				setup_select_menu(pso, 2);						}			num_start = 0;			break;		case LEFT :			if (pso->cur_loc == 5) {				setup_select_menu(pso, -1);							} 			num_start = 0;			break;		case RIGHT :			if (pso->cur_loc == 4) {				setup_select_menu(pso, 1);							}			num_start = 0;			break;			case NUMBER0:		case NUMBER1:		case NUMBER2:		case NUMBER3:		case NUMBER4:		case NUMBER5:		case NUMBER6:		case NUMBER7:		case NUMBER8:		case NUMBER9:			for(ii=0; ii < 10; ii++) 				if(key_table_list[ii] == pso->sig_value) 					break;			num_end = strlen(mft[pso->cur_loc].str);			for(jj=0; jj < num_end;jj++) 				if(!isdigit(mft[pso->cur_loc].str[jj]))					return SUCCESS;			mft[pso->cur_loc].str[num_start++] = '0' + ii;			if(num_start >= num_end) {				num_start = 0;				pso->osd_loc = pso->cur_loc;				mft[pso->osd_loc].color = WHITE;				mft[pso->osd_loc].attribute = NORMAL;								setup_update_osd(pso);					if (pso->cur_loc <= 4) {					setup_select_menu(pso, 1);							}				return SUCCESS;			}			pso->osd_loc = pso->cur_loc;			mft[pso->osd_loc].color = YELLOW;			mft[pso->osd_loc].attribute = BLINK;							setup_update_osd(pso);				break;		case SEL :							if (pso->cur_loc == 5) {				/* save password */				num_end = strlen(mft[pso->cur_loc].str);				for (ii = 0; ii < USER_NUM; ii ++) {					pso->param->sys.password[ii].value = 	((mft[2 * ii + 2].str[0] - 0x30) << 12) | 														     	((mft[2 * ii + 2].str[1] - 0x30) << 8) |														     	((mft[2 * ii + 2].str[2] - 0x30) << 4) |														     	 (mft[2 * ii + 2].str[3] - 0x30);				}			}					break;		case SUB_MINUS : 			/* return to start position */						location_cur = &setup_menu_active[pso->cur_id];			location_cur->start = 2;			pso->cur_id = SETUP_SYSTEM_PARAM;					pso->create_menu = 1;			break;		default :			break;	}	return SUCCESS;}RETURN setup_system_hdd_manage(SETUP_OBJECT *pso){	S8		temp[30];		MENU_FONT_t 	*mft;		MENU_ACTIVE_ITEM_t	*location_cur; 	    	S32           record_cnt;	extern UNS32 gv_cur_disk_id;	mft = setup_menu_font[SETUP_SP_HDD_MANAGEMENT];				switch (pso->sig_value) {		case UP :			if (pso->cur_loc >= 5 && pso->cur_loc <= 9) {				setup_select_menu(pso, -1);						} else if (pso->cur_loc == 10) {				setup_select_menu(pso, -2);										}			break;		case DOWN :			if (pso->cur_loc >= 3 && pso->cur_loc <= 8) {				setup_select_menu(pso, 1);						}			break;		case LEFT :			if (pso->cur_loc == 10) {				setup_select_menu(pso, -1);							}			break;		case RIGHT :			if (pso->cur_loc == 9) {				setup_select_menu(pso, 1);							}			break;			case SEL :					if (pso->cur_loc == 3) {				pso->param->sys.disk.slice_time++;				pso->param->sys.disk.slice_time %= 9;				sprintf(temp, "%02d MIN", g_rec_time_list[pso->param->sys.disk.slice_time]);				strcpy(mft[pso->cur_loc].str, temp);					} else if (pso->cur_loc == 5) {			    if(pso->param->sys.disk.over_wt_flag) 			    	pso->param->sys.disk.over_wt_flag = FALSE;			    else 			    	pso->param->sys.disk.over_wt_flag = TRUE;			    	gp_state_thread->state_diskm.state = ENOUGH;			    				strcpy(mft[pso->cur_loc].str, pso->param->sys.disk.over_wt_flag==TRUE ? "YES ": "NO ");			} 			else if (pso->cur_loc == 8) {				pso->disk_format.select_disk++;				pso->disk_format.select_disk %= 4;				sprintf(mft[8].str, "HDD%c", 'A' + pso->disk_format.select_disk);			} else if (pso->cur_loc == 9) {			    /* In the hdd* at the time of encoding format it does not do */				if((gv_cur_disk_id != pso->disk_format.select_disk) || (gp_state_thread->state_enc.state != BUSY)) {						strcpy(mft[pso->cur_loc].str, "PROCESS");						pso->osd_loc = pso->cur_loc;						mft[pso->osd_loc].color = YELLOW;						mft[pso->osd_loc].attribute = BLINK;										setup_update_osd(pso);								sprintf(temp, "/sbin/format_script %d", pso->disk_format.select_disk);						system(temp);						strcpy(mft[pso->cur_loc].str, "START  ");						pso->osd_loc = pso->cur_loc;						mft[pso->osd_loc].color = YELLOW;						mft[pso->osd_loc].attribute = BLINK;										setup_update_osd(pso);					    /* update for main db */						record_cnt = db_record_count();					    /* soting and recreation main db */					    if(record_cnt)							recreate_main_db(record_cnt);				}			} else if (pso->cur_loc == 10) {				strcpy(mft[9].str, "START  ");							location_cur = &setup_menu_active[pso->cur_id];				location_cur->start = 8;				pso->cur_id = SETUP_SYSTEM_PARAM;						pso->create_menu = 1;				break;			}					pso->osd_loc = pso->cur_loc;			mft[pso->osd_loc].color = YELLOW;			mft[pso->osd_loc].attribute = BLINK;							setup_update_osd(pso);							break;		case SUB_MINUS : 			/* return to start position */						strcpy(mft[9].str, "START  ");						location_cur = &setup_menu_active[pso->cur_id];			location_cur->start = 8;			pso->cur_id = SETUP_SYSTEM_PARAM;					pso->create_menu = 1;			break;		default :			break;	}	return SUCCESS;}// pentamicro 2006.01.11RETURN	setup_watermark_setup(SETUP_OBJECT *pso){	UNS16	ii;	UNS8	temp[24];	MENU_FONT_t 	*mft;		PTHREAD_BUF 	signal;	MENU_ACTIVE_ITEM_t	*location_cur;		mft = setup_menu_font[pso->cur_id]; 			switch (pso->sig_value) {		case UP :			if (pso->cur_loc == VALUE_WT_STR) {				setup_select_menu(pso, -2); 							} else if (pso->cur_loc == VALUE_WT_KEY) {				setup_select_menu(pso, -2); 					}				break;		case DOWN : 					if (pso->cur_loc == VALUE_WT_FLAG) {				setup_select_menu(pso, 2);					} else if (pso->cur_loc == VALUE_WT_STR) {				setup_select_menu(pso, 2);								}				break;		case SEL :			if (pso->cur_loc == VALUE_WT_FLAG) {				if (pso->param->enc_attr.wm.flag_wm) {					pso->param->enc_attr.wm.flag_wm = 0;					strcpy(mft[pso->cur_loc].str, "Off");				} else {					pso->param->enc_attr.wm.flag_wm = 1;					strcpy(mft[pso->cur_loc].str, " On");									}				pso->osd_loc = pso->cur_loc;				mft[pso->osd_loc].color = YELLOW;				mft[pso->osd_loc].attribute = BLINK;								setup_update_osd(pso);				} else if (pso->cur_loc == VALUE_WT_STR) {				if (pso->param->enc_attr.wm.strength >= 4) {					pso->param->enc_attr.wm.strength = 0;									} else {					pso->param->enc_attr.wm.strength++;				}					sprintf(temp, "%2d", pso->param->enc_attr.wm.strength);				strcpy(mft[pso->cur_loc].str, temp);							pso->osd_loc = pso->cur_loc;									mft[pso->osd_loc].color = YELLOW;				mft[pso->osd_loc].attribute = BLINK;								setup_update_osd(pso);				} else if (pso->cur_loc == VALUE_WT_KEY) {				if (pso->param->enc_attr.wm.key >= 15) {					pso->param->enc_attr.wm.key = 0;									} else {					pso->param->enc_attr.wm.key++;				}					sprintf(temp, "%2d", pso->param->enc_attr.wm.key);				strcpy(mft[pso->cur_loc].str, temp);							pso->osd_loc = pso->cur_loc;									mft[pso->osd_loc].color = YELLOW;				mft[pso->osd_loc].attribute = BLINK;								setup_update_osd(pso);				}			break;		case SUB_MINUS :				/* return to start position */					location_cur = &setup_menu_active[pso->cur_id];			location_cur->start = 2;				pso->cur_id = SETUP_ENCODER_PARAM;				pso->next_id = SETUP_WATERMARK_SETUP;							pso->create_menu = 1;											break;		default :			break;	}		return SUCCESS;}RETURN	setup_motion_setup(SETUP_OBJECT *pso){	UNS16	ii;	UNS8	temp[24];	MENU_FONT_t 	*mft;		PTHREAD_BUF 	signal;	MENU_ACTIVE_ITEM_t	*location_cur;		mft = setup_menu_font[pso->cur_id]; 			switch (pso->sig_value) {		case UP :			if (pso->cur_loc >= VALUE_MDS_CH1 && pso->cur_loc <= VALUE_MDS_CH4) {				setup_select_menu(pso, -5); 							} else if (pso->cur_loc >= VALUE_MDAS_CH1 && pso->cur_loc <= VALUE_MDAS_CH4) {				setup_select_menu(pso, -5); 					} else if (pso->cur_loc >= VALUE_MDAA_CH1 && pso->cur_loc <= VALUE_MDAA_CH4) {				setup_select_menu(pso, -4); 			} else if (pso->cur_loc >= VALUE_MDAC_CH1 && pso->cur_loc <= VALUE_MDAC_CH4) {				setup_select_menu(pso, -4); 							}				break;		case DOWN : 					if (pso->cur_loc >= VALUE_MDF_CH1 && pso->cur_loc <= VALUE_MDF_CH4) {				setup_select_menu(pso, 5);					} else if (pso->cur_loc >= VALUE_MDS_CH1 && pso->cur_loc <= VALUE_MDS_CH4) {				setup_select_menu(pso, 5);								} else if (pso->cur_loc >= VALUE_MDAS_CH1 && pso->cur_loc <= VALUE_MDAS_CH4) {				setup_select_menu(pso, 4);						} else if (pso->cur_loc >= VALUE_MDAA_CH1 && pso->cur_loc <= VALUE_MDAA_CH4) {				setup_select_menu(pso, 4);				}				break;		case LEFT :			if (pso->cur_loc >= VALUE_MDF_CH1+1 && pso->cur_loc <= VALUE_MDF_CH4) {				setup_select_menu(pso, -1); 						} else if (pso->cur_loc >= VALUE_MDS_CH1+1 &&

⌨️ 快捷键说明

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