Exemplo n.º 1
0
void _print_key_list(FILE *fp)
{
	const s8 *name;
	s32 len = 0, tmp;

	LIST_FOREACH(iter, _keysets)
		if((tmp = strlen(((keyset_t *)iter->value)->name)) > len)
			len = tmp;

	fprintf(fp, " Name");
	_print_align(fp, " ", len, 4);
	fprintf(fp, " Type  Revision Version SELF-Type\n");

	LIST_FOREACH(iter, _keysets)
	{
		keyset_t *ks = (keyset_t *)iter->value;
		fprintf(fp, " %s", ks->name);
		_print_align(fp, " ", len, strlen(ks->name));
		fprintf(fp, " %-5s 0x%04X   %s   ", _get_name(_key_types, ks->type), ks->key_revision, sce_version_to_str(ks->version));
		if(ks->type == KEYTYPE_SELF)
		{
			name = _get_name(_self_types, ks->self_type);
			if(name != NULL)
				fprintf(fp, "[%s]\n", name);
			else
				fprintf(fp, "0x%08X\n", ks->self_type);
		}
		else
			fprintf(fp, "\n");
	}
Exemplo n.º 2
0
static int _add_osd (Page* currentPage, char* text, int streamID)
{
	char buffer[MAXSTRLEN] = {0};
	char name[NAME_LEN] = {0};
	sprintf(buffer,"<fieldset><legend>Stream %d</legend><br>\n",streamID);
	strcat(text,buffer);
	/*memset(buffer,0,MAXSTRLEN);
	sprintf(buffer,"onchange=\"addOSD('no_rotate', %d)\"",streamID);
	_get_name(name,streamID,"no_rotate");*/
	strcat(text,"&nbsp; &nbsp;");

	checkBox_Input checkBox;

	/*
	* No Rotate not required
	*/
#if 0
	/*memset(&checkBox, 0, sizeof(checkBox_Input));
	checkBox.label = "No Rotate";
	checkBox.name = name;
	checkBox.value = osd_params[_get_osd_Index(streamID, "no_rotate")].value;
	checkBox.action = buffer;
	(&virtual_PageOps)->create_checkbox(currentPage, text, &checkBox);
	strcat(text,"&nbsp; &nbsp;");*/
#endif

	memset(buffer,0,MAXSTRLEN);
	sprintf(buffer,"onchange=\"addOSD('bmp', %d)\"",streamID);
	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"bmp_enable");

	memset(&checkBox, 0, sizeof(checkBox_Input));
	checkBox.label = "Add BMP (8-bits, < 80K)";
	checkBox.name = name;
	checkBox.value = osd_params[_get_osd_Index(streamID, "bmp_enable")].value;
	checkBox.action = buffer;
	(&virtual_PageOps)->create_checkbox(currentPage, text, &checkBox);
	strcat(text,"&nbsp; &nbsp;");

	memset(buffer,0,MAXSTRLEN);
	sprintf(buffer,"onchange=\"addOSD('time', %d)\"",streamID);
	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"time_enable");
	memset(&checkBox, 0, sizeof(checkBox_Input));
	checkBox.label = "Add current time";
	checkBox.name = name;
	checkBox.value = osd_params[_get_osd_Index(streamID, "time_enable")].value;
	checkBox.action = buffer;
	(&virtual_PageOps)->create_checkbox(currentPage, text, &checkBox);
	strcat(text,"<br><br>");

	_add_expand_osd_text(currentPage,text,streamID);
	strcat(text,"<br></fieldset><br>\n");
	return 0;
}
Exemplo n.º 3
0
static int _add_osd_text_box (Page* currentPage, char* text, int streamID, char* enabled)
{
	strcat(text,"<fieldset><legend>Text Box (0~100%)</legend><br>");
	char name[NAME_LEN] = {0};
	text_Entry text_entry;

	_get_name(name,streamID,"text_startx");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Offset X : ";
	text_entry.name = name;
	text_entry.value = osd_params[_get_osd_Index(streamID, "text_startx")].value;
	text_entry.maxlen = 2;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"&nbsp; &nbsp; ");

	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"text_starty");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Y : ";
	text_entry.name = name;
	text_entry.value = osd_params[_get_osd_Index(streamID, "text_starty")].value;
	text_entry.maxlen = 2;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"<br><br>");

	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"text_boxw");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Width : ";
	text_entry.name = name;
	text_entry.value = osd_params[_get_osd_Index(streamID, "text_boxw")].value;
	text_entry.maxlen = 2;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"&nbsp; &nbsp; ");


	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"text_boxh");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Height : ";
	text_entry.name = name;
	text_entry.value = osd_params[_get_osd_Index(streamID, "text_boxh")].value;
	text_entry.maxlen = 2;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"<br>");

	strcat(text,"<br></fieldset>");
	return 0;
}
Exemplo n.º 4
0
char *GeoIP_name_by_addr (GeoIP* gi, const char *addr) {
	unsigned long ipnum;
	if (addr == NULL) {
		return 0;
	}
	ipnum = _GeoIP_addr_to_num(addr);
	return _get_name(gi, ipnum);
}
Exemplo n.º 5
0
char *GeoIP_name_by_name (GeoIP* gi, const char *name) {
	unsigned long ipnum;
	if (name == NULL) {
		return 0;
	}
	if (!(ipnum = _GeoIP_lookupaddress(name)))
		return 0;
	return _get_name(gi, ipnum);
}
Exemplo n.º 6
0
/*! 获取路径的INODE,成功返回true,当前仅仅支持绝对路径,先尝点甜头 !*/
MinixInode *eat_path(String path){
    if(isNullp(path) || !(*path)) return NULL;
    char name[MINIX_NAME_LEN]; 
    String pth = path;
    MinixInode *inode = &root_inode;
    while(*pth && inode){
        memset(name,0,MINIX_NAME_LEN);
        pth = _get_name(pth,name);
        inode = search_dir(inode,name);
    }
    return inode;
}
Exemplo n.º 7
0
static int _add_mjpeg(Page* currentPage, char* text, int streamId, char * enabled)
{
	char* fieldset = "<fieldset><legend>MJPEG</legend><br>";
	strncat(text, fieldset, strlen(fieldset));
	char name[NAME_LEN] = {0};
	int index = 0;
	_get_name(name,streamId,"quality");
	index = _get_stream_params_index(streamId, "quality");

	text_Entry text_entry;
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Quality(0 - 100)";
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 4;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	char* fieldset_end = "<br></fieldset><br>";
	strncat(text, fieldset_end, strlen(fieldset_end));

	return 0;
}
Exemplo n.º 8
0
static int _add_expand_osd_text (Page* currentPage, char* text, int streamID)
{
	char headerID[NAME_LEN] = {0};
	char expandID[NAME_LEN] = {0};
	char name[NAME_LEN] = {0};
	char enabled[NAME_LEN] = {0};
	char buffer[MAXSTRLEN] = {0};
	sprintf(headerID,"text%d",streamID);
	sprintf(expandID,"osd_text%d",streamID);
	_get_name(name,streamID,"text_enable");
	if (osd_params[_get_osd_Index(streamID,"text_enable")].value == 0) {
		strcat(enabled,"disabled");
	} else {
		strcat(enabled,"");
	}
	sprintf(buffer,"<div class=\"expandstyle\"><span id=\"%s\" \
		onClick=\"expandOSDText('%s', '%s', 280, %d)\">",headerID,headerID,expandID,streamID);
	strcat(text,buffer);
	strcat(text,"<img src=\"../img/expand.gif\" /></span>");
	memset(buffer,0,MAXSTRLEN);
	sprintf(buffer,"onclick=\"addOSD('text', %d)\"",streamID);
	checkBox_Input checkBox;
	memset(&checkBox, 0, sizeof(checkBox_Input));
	checkBox.label = "Add text string";
	checkBox.name = name;
	checkBox.value = osd_params[_get_osd_Index(streamID, "text_enable")].value;
	checkBox.action = buffer;
	(&virtual_PageOps)->create_checkbox(currentPage, text, &checkBox);


	strcat(text,"<br><br>\n");
	memset(buffer,0,MAXSTRLEN);
	sprintf(buffer,"<div class=\"expandcontent\" id=\"%s\">",expandID);
	strcat(text,buffer);
	_add_osd_text(currentPage,text,streamID,enabled);
	strcat(text,"</div></div>");
	return 0;
}
Exemplo n.º 9
0
static int _add_encode_format (Page* currentPage, char* text, int streamId, char* enabled, int encMode)
{
	sprintf(text, "<fieldset><legend>Stream %d</legend><br>\n", streamId);
	char name[NAME_LEN] = {0};
	int index =0;
	int value = 0;
	char action[MAXSTRLEN] = {0};
	//type
	memset(options,0,MAX_OPTION_LEN*sizeof(Label_Option));

	options[OFF].value = OFF;
	strcat(options[OFF].option, "OFF");

	options[H_264].value = H_264;
	strcat(options[H_264].option, "H.264");

	options[MJPEG].value = MJPEG;
	strcat(options[MJPEG].option, "MJPEG");

	_get_name(name,streamId, "type");
	index = _get_enc_params_index(streamId, "type");
	select_Label select_label;
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Type :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = TYPE_LEN;
	select_label.value = enc_params[index].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text, "&nbsp; &nbsp; ");

	//enc_fps
	memset(options, 0, MAX_OPTION_LEN*sizeof(Label_Option));
	strcat(options[ENC_FPS_60].option, "60");
	options[ENC_FPS_60].value = FPS_60;

	strcat(options[ENC_FPS_30].option, "30");
	options[ENC_FPS_30].value = FPS_30;

	strcat(options[ENC_FPS_25].option, "25");
	options[ENC_FPS_25].value = FPS_25;

	strcat(options[ENC_FPS_20].option, "20");
	options[ENC_FPS_20].value = FPS_20;

	strcat(options[ENC_FPS_15].option, "15");
	options[ENC_FPS_15].value = FPS_15;

	strcat(options[ENC_FPS_10].option, "10");
	options[ENC_FPS_10].value = FPS_10;

	strcat(options[ENC_FPS_6].option, "6");
	options[ENC_FPS_6].value = FPS_6;

	strcat(options[ENC_FPS_5].option, "5");
	options[ENC_FPS_5].value = FPS_5;

	strcat(options[ENC_FPS_4].option, "4");
	options[ENC_FPS_4].value = FPS_4;

	strcat(options[ENC_FPS_3].option, "3");
	options[ENC_FPS_3].value = FPS_3;

	strcat(options[ENC_FPS_2].option, "2");
	options[ENC_FPS_2].value = FPS_2;

	strcat(options[ENC_FPS_1].option, "1");
	options[ENC_FPS_1].value = FPS_1;

	memset(name, 0, NAME_LEN);
	_get_name(name,streamId,"enc_fps");
	index = _get_enc_params_index(streamId, "enc_fps");
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Encode FPS :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = ENC_FPS_LIST_LEN;
	select_label.value = enc_params[index].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text, "&nbsp; &nbsp; ");


	//dptz
	memset(options,0,MAX_OPTION_LEN*sizeof(Label_Option));
	strcat(options[DPTZ_DISABLE].option, "Disable");
	options[DPTZ_DISABLE].value = DPTZ_DISABLE;
	strcat(options[DPTZ_ENABLE].option, "Enable");
	options[DPTZ_ENABLE].value = DPTZ_ENABLE;

	if (((enc_params[_get_enc_params_index(streamId, "width")].value) == 0 )||\
		((enc_params[_get_enc_params_index(streamId, "height")].value) == 0)) {
		value = create_res(1280,720);
	}
	else {
		value = create_res(enc_params[_get_enc_params_index(streamId,"width")].value,\
			enc_params[_get_enc_params_index(streamId,"height")].value);
	}


	if (encMode == ENC_LOW_DELAY) {
		strcat(action, "disabled");
	}
	else {
		if (strcmp(enabled,"disabled") == 0) {
			strcat(action,"disabled");
		}
		else {
			strcat(action,"");
		}
	}

	memset(name, 0, NAME_LEN);
	_get_name(name, streamId, "dptz");
	index = _get_enc_params_index(streamId, "dptz");
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "DPTZ Type :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = DPTZ_LEN;
	select_label.value = enc_params[index].value;
	select_label.action = action;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text, "<br><br>\n");

	//resolution
	memset(options, 0, MAX_OPTION_LEN*sizeof(Label_Option));
	memset(action, 0, MAXSTRLEN);
	sprintf(action, "onchange=\"setDPTZMode(this.options[this.selectedIndex].value, %d)\" %s",\
		streamId, enabled);
	memset(name, 0, NAME_LEN);
	_get_name(name, streamId, "resolution");
	if ((encMode != ENC_HIGH_MP) || (streamId != 0)) {
		strcat(options[RES_OPS_1920x1080].option, "1920 x 1080");
		options[RES_OPS_1920x1080].value = RES_1920x1080;

		strcat(options[RES_OPS_1440x1080].option, "1440 x 1080");
		options[RES_OPS_1440x1080].value = RES_1440x1080;

		strcat(options[RES_OPS_1280x1024].option, "1280 x 1024");
		options[RES_OPS_1280x1024].value = RES_1280x1024;

		strcat(options[RES_OPS_1280x960].option, "1280 x 960");
		options[RES_OPS_1280x960].value = RES_1280x960;

		strcat(options[RES_OPS_1280x720].option, "1280 x 720");
		options[RES_OPS_1280x720].value = RES_1280x720;

		strcat(options[RES_OPS_800x600].option, "800 x 600");
		options[RES_OPS_800x600].value = RES_800x600;

		strcat(options[RES_OPS_720x576].option, "720 x 576");
		options[RES_OPS_720x576].value = RES_720x576;

		strcat(options[RES_OPS_720x480].option, "720 x 480");
		options[RES_OPS_720x480].value = RES_720x480;

		strcat(options[RES_OPS_640x480].option, "640 x 480");
		options[RES_OPS_640x480].value = RES_640x480;

		strcat(options[RES_OPS_352x288].option, "352 x 288");
		options[RES_OPS_352x288].value = RES_352x288;

		strcat(options[RES_OPS_352x240].option, "352 x 240");
		options[RES_OPS_352x240].value = RES_352x240;

		strcat(options[RES_OPS_320x240].option, "320 x 240");
		options[RES_OPS_320x240].value = RES_320x240;

		strcat(options[RES_OPS_176x144].option, "176 x 144");
		options[RES_OPS_176x144].value = RES_176x144;

		strcat(options[RES_OPS_176x120].option, "176 x 120");
		options[RES_OPS_176x120].value = RES_176x120;

		strcat(options[RES_OPS_160x120].option, "160 x 120");
		options[RES_OPS_160x120].value = RES_160x120;

		memset(&select_label, 0, sizeof(select_Label));
		select_label.label = "Resolution :";
		select_label.name = name;
		select_label.options = options;
		select_label.option_len = RES_OPTIONS_LEN;
		select_label.value = value;
		select_label.action = action;
		(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	}else {
		strcat(options[HIGHRES_OPS_2592x1944].option, "2592x1944 (5.0M)");
		options[HIGHRES_OPS_2592x1944].value = HIGHRES_2592x1944;

		strcat(options[HIGHRES_OPS_2560x1440].option, "2560x1440 (3.7M)");
		options[HIGHRES_OPS_2560x1440].value = HIGHRES_2560x1440;

		strcat(options[HIGHRES_OPS_2304x1296].option, "2304x1296 (3.0M)");
		options[HIGHRES_OPS_2304x1296].value = HIGHRES_2304x1296;

		strcat(options[HIGHRES_OPS_2048x1536].option, "2048x1536 (3.0M)");
		options[HIGHRES_OPS_2048x1536].value = HIGHRES_2048x1536;

		memset(&select_label, 0, sizeof(select_Label));
		select_label.label = "Resolution :";
		select_label.name = name;
		select_label.options = options;
		select_label.option_len = HIGHRES_OPTIONS_LEN;
		select_label.value = value;
		select_label.action = action;
		(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	}
	strcat(text,"&nbsp; &nbsp; ");

	/*
		Flip & Rotate
	*/
	memset(options, 0, MAX_OPTION_LEN*sizeof(Label_Option));
	strcat(options[FR_OPS_NORMAL].option, "Normal");
	options[FR_OPS_NORMAL].value = FR_NORMAL;

	strcat(options[FR_OPS_HFLIP].option, "Horizontal Flip");
	options[FR_OPS_HFLIP].value = FR_HFLIP;

	strcat(options[FR_OPS_VFLIP].option, "Vertical Flip");
	options[FR_OPS_VFLIP].value = FR_VFLIP;

	strcat(options[FR_OPS_ROTATE_90].option, "Rotate Clockwise 90");
	options[FR_OPS_ROTATE_90].value = FR_ROTATE_90;

	strcat(options[FR_OPS_ROTATE_180].option, "Rotate 180");
	options[FR_OPS_ROTATE_180].value = FR_ROTATE_180;

	strcat(options[FR_OPS_ROTATE_270].option, "Rotate Clockwise 270");
	options[FR_OPS_ROTATE_270].value = FR_ROTATE_270;

	memset(name, 0, NAME_LEN);
	_get_name(name,streamId,"flip_rotate");
	index = _get_enc_params_index(streamId, "flip_rotate");
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Flip & Rotate :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = FR_OPTIONS_LEN;
	select_label.value = enc_params[index].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);

	_add_expand_format(currentPage, text, streamId, enabled);

	char* fieldset_end = "</fieldset><br>";
	strncat(text, fieldset_end, strlen(fieldset_end));

	return 0;
}
Exemplo n.º 10
0
static int _add_h264 (Page* currentPage, char* text, int streamId, char * enabled)
{
	char* fieldset = "<fieldset><legend>H.264</legend><br>";
	strncat(text, fieldset, strlen(fieldset));
	char string[MAXSTRLEN] = {0};
	char action[MAXSTRLEN] = {0};
	char text_buffer[MAXSTRLEN] = {0};
	char name[NAME_LEN] = {0};
	if (streamId == 0) {
		strcat(string, "(1-3)");
		strcat(action, "");
	}
	else {
		strcat(string, "");
		strcat(action, "disabled");
	}
	strncat(action, enabled, strlen(enabled));

	text_Entry text_entry;
	// type: M
	sprintf(text_buffer, "M %s :", string);
	_get_name(name, streamId, "M");
	int index = _get_stream_params_index(streamId, "M");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = text_buffer;
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 1;
	text_entry.ro = action;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"&nbsp; &nbsp;");

	//type: N
	memset(name,0,NAME_LEN);
	_get_name(name,streamId,"N");
	index = _get_stream_params_index(streamId,"N");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "N (1-255) :";
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 3;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"<br><br>");

	//type:idr
	memset(name,0,NAME_LEN);
	_get_name(name,streamId,"idr_interval");
	index = _get_stream_params_index(streamId,"idr_interval");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "IDR interval (1-100) :";
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 4;
	text_entry.ro = enabled;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"<br><br>");

	memset(options, 0, MAX_OPTION_LEN*sizeof(Label_Option));
	select_Label select_label;
	//profile
	memset(name,0,NAME_LEN);
	_get_name(name,streamId,"profile");
	index = _get_stream_params_index(streamId,"profile");
	strcat(options[0].option,"Main");
	options[0].value = PROFILE_MAIN;
	strcat(options[1].option,"Baseline");
	options[1].value = PROFILE_BASELINE;
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Profile :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = 2;
	select_label.value = stream_params[index].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text,"<br><br>");

	//brc
	memset(options, 0, MAX_OPTION_LEN*sizeof(Label_Option));
	strcat(options[CBR].option, "CBR");
	options[CBR].value = BRC_CBR;

	strcat(options[VBR].option, "VBR");
	options[VBR].value = BRC_VBR;

	strcat(options[CBR_Q].option, "CBR (keep quality)");
	options[CBR_Q].value = BRC_CBRQ;

	strcat(options[VBR_Q].option, "VBR (keep quality)");
	options[VBR_Q].value = BRC_VBRQ;

	memset(action, 0, MAXSTRLEN);
	sprintf(action, "onchange=\"setBRCMode(this.options[this.selectedIndex].value, %d)\" %s",\
		streamId, enabled);
	memset(name, 0, NAME_LEN);
	_get_name(name, streamId, "brc");
	index = _get_stream_params_index(streamId, "brc");
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Bitrate control :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = BRC_LEN;
	select_label.value = stream_params[index].value;
	select_label.action = action;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text, "<br><br>");

	memset(action,0,MAXSTRLEN);
	if (stream_params[index].value & 0x1) {
		strcat(action, "disabled");
	}
	else {
		strcat(action, "");
	}
	if ((strcmp(action, "disabled") == 0) || (strcmp(enabled, "disabled") == 0)) {
		memset(action, 0, MAXSTRLEN);
		strcat(action, "disabled");
	}

	//cbr_avg_bps
	memset(name, 0, NAME_LEN);
	_get_name(name, streamId, "cbr_avg_bps");
	index = _get_stream_params_index(streamId, "cbr_avg_bps");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Average Bitrate  :";
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 10;
	text_entry.ro = action;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text,"<br><br>");

	//vbr_min_bps
	memset(name, 0, NAME_LEN);
	_get_name(name, streamId, "vbr_min_bps");
	index = _get_stream_params_index(streamId, "vbr_min_bps");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Min bitrate (bps) :";
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 10;
	text_entry.ro = action;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);
	strcat(text, "&nbsp; &nbsp; ");

	//vbr_max_bps
	memset(name, 0, NAME_LEN);
	_get_name(name,streamId, "vbr_max_bps");
	index = _get_stream_params_index(streamId, "vbr_max_bps");
	memset(&text_entry, 0, sizeof(text_Entry));
	text_entry.label = "Max bitrate (bps) :";
	text_entry.name = name;
	text_entry.value = stream_params[index].value;
	text_entry.maxlen = 10;
	text_entry.ro = action;
	(&virtual_PageOps)->create_text_entry(currentPage, text, &text_entry);

	char* fieldset_end = "<br></fieldset><br>";
	strncat(text, fieldset_end, strlen(fieldset_end));

	return 0;
}
Exemplo n.º 11
0
static int _create_params ()
{
	int i = 0;
	int j = 0;
	int streamID;
	char ret[NAME_LEN] = {0};
	for(streamID = 0; streamID < 4; streamID++) {
		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "h264_id");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "M");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "N");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "idr_interval");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "gop_model");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "profile");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "brc");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "cbr_avg_bps");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "vbr_min_bps");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "vbr_max_bps");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "quality");
		strcat(stream_params[i].param_name,ret);
		stream_params[i].value = 0;
		i++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "type");
		strcat(enc_params[j].param_name,ret);
		enc_params[j].value = 0;
		j++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "enc_fps");
		strcat(enc_params[j].param_name,ret);
		enc_params[j].value = 0;
		j++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "dptz");
		strcat(enc_params[j].param_name,ret);
		enc_params[j].value = 0;
		j++;

		memset(ret,0,NAME_LEN);
		_get_name(ret, streamID, "flip_rotate");
		strcat(enc_params[j].param_name,ret);
		enc_params[j].value = 0;
		j++;

	}

	strcat(enc_params[j].param_name,"enc_mode");
	enc_params[j].value = 0;
	j++;

	strcat(enc_params[j].param_name,"s0_width");
	enc_params[j].value = 1280;
	j++;

	strcat(enc_params[j].param_name,"s0_height");
	enc_params[j].value = 720;
	j++;

	strcat(enc_params[j].param_name,"s1_width");
	enc_params[j].value = 720;
	j++;

	strcat(enc_params[j].param_name,"s1_height");
	enc_params[j].value = 480;
	j++;

	strcat(enc_params[j].param_name,"s2_width");
	enc_params[j].value = 352;
	j++;

	strcat(enc_params[j].param_name,"s2_height");
	enc_params[j].value = 240;
	j++;

	strcat(enc_params[j].param_name,"s3_width");
	enc_params[j].value = 352;
	j++;

	strcat(enc_params[j].param_name,"s3_height");
	enc_params[j].value = 240;

	return 0;

}
Exemplo n.º 12
0
static int _create_params ()
{
	char name[NAME_LEN] = {0};
	int i;
	memset(osd_params, 0, sizeof(ParamData)*OSD_PARAM_NUM);
	for (i = 0; i < STREAM_NUM; i++) {
		memset(name,0,NAME_LEN);
		_get_name(name, i, "no_rotate");
		strcat(osd_params[_get_osd_Index(i, "no_rotate")].param_name, name);
		osd_params[_get_osd_Index(i, "no_rotate")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "bmp_enable");
		strcat(osd_params[_get_osd_Index(i, "bmp_enable")].param_name, name);
		osd_params[_get_osd_Index(i, "bmp_enable")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "time_enable");
		strcat(osd_params[_get_osd_Index(i, "time_enable")].param_name, name);
		osd_params[_get_osd_Index(i, "time_enable")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_enable");
		strcat(osd_params[_get_osd_Index(i, "text_enable")].param_name, name);
		osd_params[_get_osd_Index(i, "text_enable")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text");
		strcat(osd_params[_get_osd_Index(i, "text")].param_name, name);
		osd_params[_get_osd_Index(i, "text")].value = -100;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_size");
		strcat(osd_params[_get_osd_Index(i, "text_size")].param_name, name);
		osd_params[_get_osd_Index(i, "text_size")].value = FTSIZE_NORMAL;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_outline");
		strcat(osd_params[_get_osd_Index(i, "text_outline")].param_name, name);
		osd_params[_get_osd_Index(i, "text_outline")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_color");
		strcat(osd_params[_get_osd_Index(i, "text_color")].param_name, name);
		osd_params[_get_osd_Index(i, "text_color")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_bold");
		strcat(osd_params[_get_osd_Index(i, "text_bold")].param_name, name);
		osd_params[_get_osd_Index(i, "text_bold")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_italic");
		strcat(osd_params[_get_osd_Index(i, "text_italic")].param_name, name);
		osd_params[_get_osd_Index(i, "text_italic")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_startx");
		strcat(osd_params[_get_osd_Index(i, "text_startx")].param_name, name);
		osd_params[_get_osd_Index(i, "text_startx")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_starty");
		strcat(osd_params[_get_osd_Index(i, "text_starty")].param_name, name);
		osd_params[_get_osd_Index(i, "text_starty")].value = 0;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_boxw");
		strcat(osd_params[_get_osd_Index(i, "text_boxw")].param_name, name);
		osd_params[_get_osd_Index(i, "text_boxw")].value = 50;

		memset(name,0,NAME_LEN);
		_get_name(name, i, "text_boxh");
		strcat(osd_params[_get_osd_Index(i, "text_boxh")].param_name, name);
		osd_params[_get_osd_Index(i, "text_boxh")].value = 50;
	}
	return 0;
}
Exemplo n.º 13
0
static int _add_osd_text (Page* currentPage, char* text, int streamID, char* enabled)
{
	strcat(text,"<fieldset><legend>OSD Text</legend><br>");
	char name[NAME_LEN] = {0};
	_get_name(name,streamID,"text");
	char content[MAXSTRLEN]= {0};
	strcat(content,osd_params[_get_osd_Index(streamID,"text")].param_value);
	int len = strlen(content);
	int i = 0;
	if ((content[0] == '"') && (content[len - 1] == '"')) {
		content[len-1] = '\0';
		while ((content[i + 1] != '\0')&&(content[i] != '\0')) {
			content[i] = content[i + 1];
			i++;
		}
	}
	wide_text_Entry wide_text_entry;
	memset(&wide_text_entry, 0, sizeof(wide_text_Entry));
	wide_text_entry.label = "Content (32 character) : ";
	wide_text_entry.name = name;
	wide_text_entry.value = content;
	wide_text_entry.maxlen = 32;
	wide_text_entry.ro = enabled;
	(&virtual_PageOps)->create_wide_text_entry(currentPage, text, &wide_text_entry);
	strcat(text,"<br><br>");

	// text size
	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"text_size");

	memset(options,0,sizeof(Label_Option)*MAX_OPTION_LEN);
	strcat(options[FTSIZE_OPS_SMALLER].option, "Smaller");
	options[FTSIZE_OPS_SMALLER].value = FTSIZE_SMALLER;

	strcat(options[FTSIZE_OPS_SMALL].option, "Small");
	options[FTSIZE_OPS_SMALL].value = FTSIZE_SMALL;

	strcat(options[FTSIZE_OPS_MIDDLE].option, "Middle");
	options[FTSIZE_OPS_MIDDLE].value = FTSIZE_NORMAL;

	strcat(options[FTSIZE_OPS_LARGE].option, "Large");
	options[FTSIZE_OPS_LARGE].value = FTSIZE_LARGE;

	strcat(options[FTSIZE_OPS_LARGER].option, "Larger");
	options[FTSIZE_OPS_LARGER].value = FTSIZE_LARGER;

	if (osd_params[_get_osd_Index(streamID,"text_size")].value == 0) {
		osd_params[_get_osd_Index(streamID,"text_size")].value = FTSIZE_NORMAL;
	}
	select_Label select_label;
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Font size :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = FTSIZE_OPS_NUM;
	select_label.value = osd_params[_get_osd_Index(streamID,"text_size")].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text,"&nbsp; &nbsp; ");


	//text color
	memset(name,0,NAME_LEN);
	_get_name(name,streamID,"text_color");
	memset(options,0,sizeof(Label_Option)*MAX_OPTION_LEN);
	strcat(options[COLOR_OPS_BLACK].option, "Black");
	options[COLOR_OPS_BLACK].value = COLOR_BLACK;

	strcat(options[COLOR_OPS_RED].option, "Red");
	options[COLOR_OPS_RED].value = COLOR_RED;

	strcat(options[COLOR_OPS_BLUE].option, "Blue");
	options[COLOR_OPS_BLUE].value = COLOR_BLUE;

	strcat(options[COLOR_OPS_GREEN].option, "Green");
	options[COLOR_OPS_GREEN].value = COLOR_GREEN;

	strcat(options[COLOR_OPS_YELLOW].option, "Yellow");
	options[COLOR_OPS_YELLOW].value = COLOR_YELLOW;

	strcat(options[COLOR_OPS_MAGENTA].option, "Magenta");
	options[COLOR_OPS_MAGENTA].value = COLOR_MEGENTA;

	strcat(options[COLOR_OPS_CYAN].option, "Cyan");
	options[COLOR_OPS_CYAN].value = COLOR_CYAN;

	strcat(options[COLOR_OPS_WHITE].option, "White");
	options[COLOR_OPS_WHITE].value = COLOR_WHITE;

	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Color :";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = COLOR_OPS_NUM;
	select_label.value = osd_params[_get_osd_Index(streamID,"text_color")].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text,"<br><br>");

	//text outline
	memset(name,0,NAME_LEN);
	memset(options,0,8*sizeof(Label_Option));
	_get_name(name,streamID,"text_outline");
	strcat(options[0].option, "0");
	options[0].value = 0;

	strcat(options[1].option, "1");
	options[1].value = 1;

	strcat(options[2].option, "2");
	options[2].value = 2;

	strcat(options[3].option, "3");
	options[3].value = 3;

	strcat(text,"&nbsp; &nbsp; ");
	memset(&select_label, 0, sizeof(select_Label));
	select_label.label = "Outline";
	select_label.name = name;
	select_label.options = options;
	select_label.option_len = 4;
	select_label.value = osd_params[_get_osd_Index(streamID,"text_outline")].value;
	select_label.action = enabled;
	(&virtual_PageOps)->create_select_label(currentPage, text, &select_label);
	strcat(text,"&nbsp; &nbsp;");


	// text bold
	memset(name,0,NAME_LEN);
	_get_name(name, streamID, "text_bold");
	checkBox_Input checkBox;
	memset(&checkBox, 0, sizeof(checkBox_Input));
	checkBox.label = "Bold";
	checkBox.name = name;
	checkBox.value = osd_params[_get_osd_Index(streamID, "text_bold")].value;
	checkBox.action = enabled;
	(&virtual_PageOps)->create_checkbox(currentPage, text, &checkBox);
	strcat(text,"&nbsp; &nbsp;");


	//text italic
	memset(name,0,NAME_LEN);
	_get_name(name, streamID, "text_italic");
	memset(&checkBox, 0, sizeof(checkBox_Input));
	checkBox.label = "Italic";
	checkBox.name = name;
	checkBox.value = osd_params[_get_osd_Index(streamID, "text_italic")].value;
	checkBox.action = enabled;
	(&virtual_PageOps)->create_checkbox(currentPage, text, &checkBox);
	strcat(text,"<br><br>");
	_add_osd_text_box(currentPage, text, streamID, enabled);
	strcat(text,"<br></fieldset><br>");
	return 0;
}
Exemplo n.º 14
0
char *GeoIP_name_by_ipnum (GeoIP* gi, unsigned long ipnum) {
	return _get_name(gi,ipnum);  
}