Exemplo n.º 1
0
static void win_tpe_load_setting(void)
{
	EDIT_FIELD	*edf;
	MULTISEL	*msel;
	T_NODE     t_node;

	edit_tp_ok = 0;
    edit_tp_exist = 0;
	if(edit_tp_mode == EDIT_TP_MODE_EDIT)
		get_tp_by_id(edit_tp_id, &t_node);
	else
	{
		t_node.frq = 3000;
		t_node.sym = 1000;
		t_node.pol = 0;
	}

	edf = &tpe_edt1;
	OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)" MHz");
	OSD_SetEditFieldContent(edf, STRING_NUMBER, t_node.frq);
	OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS);

	
	edf = &tpe_edt2;
	OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)" KS/s");
	OSD_SetEditFieldContent(edf, STRING_NUMBER, t_node.sym);
	OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS);

	msel = &tpe_msel3;
	OSD_SetMultiselSel(msel, t_node.pol);
	OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS);
}
Exemplo n.º 2
0
static void as_dvbs_preset_tuning(void *param)
{
    struct as_tuning_param *atp;
    T_NODE *tp;
    atp = (struct as_tuning_param *)param;

    if (atp->finish == TRUE)
	{
    	return;
	}
    while ((INT32)atp->pos <= as_info->tp_nr)
    {
        tp = &as_info->xp;
        if (get_tp_by_id(as_info->tp_id[atp->pos], tp)!=SUCCESS)
    	{
        		break;
    	}
        atp->nit_enable = as_info->tp_nit[atp->pos];
        atp->si_enable = as_info->tp_si[atp->pos];
        atp->tp_id = as_info->tp_id[atp->pos++];
        atp->timeout = as_frontend_tuning(as_info, tp) + osal_get_tick();
        return;
    }
    atp->finish = TRUE;
}
Exemplo n.º 3
0
void info_load(void)
{
	char str[50];
	UINT16 audioPID,ttxPID,subtPID;
	UINT32 cur_audio;
	TEXT_FIELD *txt;
	P_NODE p_node;
	T_NODE t_node;
	S_NODE s_node;
	
	sys_data_get_curprog_info(&p_node);
	get_tp_by_id(p_node.tp_id,&t_node);
	get_sat_by_id(t_node.sat_id, &s_node);

	cur_audio = (p_node.cur_audio >= p_node.audio_count) ? 0 : p_node.cur_audio;
	audioPID = p_node.audio_pid[cur_audio];
	ttxPID = p_node.teletext_pid;
	subtPID = p_node.subtitle_pid;
	if(p_node.audio_count == 0)
		sprintf(str,"V %d  No Audio  P %d",p_node.video_pid,p_node.pcr_pid);
	else
	{
		UINT8 str_audio_type[32];
		if(audioPID & AC3_DES_EXIST)
			STRCPY(str_audio_type, "AC3");
		else if(audioPID & AAC_DES_EXIST)
			STRCPY(str_audio_type, "AAC");
		else if(audioPID & ADTS_AAC_DES_EXIST)
			STRCPY(str_audio_type, "AAC");
		else
			MEMSET(str_audio_type, 0, sizeof(str_audio_type));
		
		sprintf(str,"V %d  A %d%s  P %d",p_node.video_pid,audioPID & 0x1FFF,str_audio_type, p_node.pcr_pid);
	}
	txt = &txt_pidinfo;
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
	
	txt = &txt_satname;
#ifndef DB_USE_UNICODE_STRING
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)s_node.sat_name);
#else
	OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)s_node.sat_name);
#endif

	sprintf(str,"%d/%s/%d", t_node.frq, (t_node.pol==0) ? "H" : "V",t_node.sym);
	txt = &txt_tpinfo;
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
	
	txt = &txt_progname;
#ifndef DB_USE_UNICODE_STRING
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)p_node.service_name);
#else
	OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)p_node.service_name);
#endif

	txt = &txt_string4;
	OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"PID");
}
Exemplo n.º 4
0
static UINT32 win_tpe_check_input(void)
{
	EDIT_FIELD	*edf;
	MULTISEL	*msel;
	T_NODE     t_node;
	UINT32 freq,symb,pol;
	UINT32 i,tp_cn;
	UINT8 back_saved;

    edit_tp_yesno = WIN_POP_CHOICE_NULL;
	edf = &tpe_edt1;
	OSD_GetEditFieldIntValue(edf, &freq);

	edf = &tpe_edt2;
	OSD_GetEditFieldIntValue(edf, &symb);

	msel = &tpe_msel3;
	pol  = OSD_GetMultiselSel(msel);	


	if(edit_tp_mode == EDIT_TP_MODE_EDIT)
	{
		get_tp_by_id(edit_tp_id, &t_node);
		if(t_node.frq == freq && t_node.sym == symb && t_node.pol == pol)
			return 0;
		else
			goto CHECK_DUPLICATE;
	}
	else
		goto CHECK_DUPLICATE;

CHECK_DUPLICATE:
	tp_cn = get_tp_num_sat(edit_tp_sat_id);
	for(i=0;i<tp_cn;i++)
	{
		get_tp_at(edit_tp_sat_id, i, &t_node);
		if(edit_tp_mode == EDIT_TP_MODE_EDIT && t_node.tp_id == edit_tp_id)
			continue;
		if(t_node.frq == freq && t_node.sym == symb && t_node.pol == pol)
		{
			//win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_init(WIN_POPUP_TYPE_OKNO);
			//win_compopup_set_msg(NULL,NULL,RS_POPUP_TP_EXIST);
            win_compopup_set_msg(is_exist,NULL,0);
            edit_tp_yesno = win_compopup_open_ext(&back_saved);
			return (i+1);///1;
		}
	}

	return 0;
}
Exemplo n.º 5
0
static int SetTP(unsigned int argc, unsigned char *argv[])
{
    UINT32 freq;	
    UINT32 sym;	
    UINT16 channel;

    T_NODE t_node;	
    P_NODE p_node;		

    if (argc != 3)
    {
        SH_PRINTF("Usage: SetPara <freq> <sym>\n");
        return -1;
    }	
    
    freq = ATOI(argv[1]);
    sym = ATOI(argv[2]);
    
    reset_group();
    channel = sys_data_get_cur_group_cur_mode_channel();
    get_prog_at(channel,&p_node);
    get_tp_by_id(p_node.tp_id, &t_node);
    recreate_tp_view(VIEW_SINGLE_SAT, t_node.sat_id);

    t_node.frq = freq;
    t_node.sym = sym;

    modify_tp(t_node.tp_id,&t_node);    
    api_play_channel(p_node.prog_id, TRUE, FALSE, TRUE); 
    //UIChChgPlayProg(0,p_node.prog_id);
    //UIChChgPlayProg(0,CC_CMD_RESET_CRNT_CH);//for 3501D sfu test
    //UIChChgPlayProg(0,p_node.prog_id);
    
    //LIB_ASH_OC('\r'); 
    //LIB_ASH_OC('\n'); 	

    LIB_ASH_OC('S');
    LIB_ASH_OC('U');        
    LIB_ASH_OC('C');
    LIB_ASH_OC('C');        
    LIB_ASH_OC('E');        
    LIB_ASH_OC('S');        	
    LIB_ASH_OC('S');        		

    LIB_ASH_OC('\r'); 
    LIB_ASH_OC('\n'); 	
	reset_perflag();
    return 0;    
}
Exemplo n.º 6
0
eit_event_info_t* epg_get_first_event(INT32 prog_idx, UINT32 event_type,date_time *dt,INT32 *event_num)
{
	P_NODE service_info;
	T_NODE tp_info;
	UINT16 service_id,orig_nw_id,ts_id;
	eit_tp_t *tp=NULL;
	eit_event_info_t *ep=NULL;
	eit_service_info_t *sp=NULL;
		

	
	if (SUCCESS==get_prog_at(prog_idx,&service_info))
	{
		service_id=service_info.prog_number;
		get_tp_by_id(service_info.tp_id, &tp_info);
		orig_nw_id=tp_info.network_id;
		ts_id=tp_info.t_s_id;

#ifdef EPG_NETWORK_PATCH
		tp=epg_get_tp(get_tp_header(),service_info.tp_id,ts_id);
#else
		tp=epg_get_tp(get_tp_header(),orig_nw_id,ts_id);
#endif
		*event_num=0;
		if (NULL==tp)
			return NULL;

		sp=epg_get_service(tp,service_id);
		if (NULL== sp)
			return NULL;
		if (event_type==PRESENT_EVENT)
		{
			ep=epg_get_present_event(sp);
		}	
		else if  (event_type==FOLLOWING_EVENT)
			ep=epg_get_following_event(sp);
		else
		{
//			ep=epg_get_schdedule_event(sp,date,event_num);
			ep=sp->sch_event_header[0];
		}			
		return ep;
		//		return epg_get_event(get_tp_header(), orig_nw_id, ts_id, service_id, event_type, dt, event_num);
		
	}
	else	
		return NULL;		
}
Exemplo n.º 7
0
void win_otaset_load_default_setting(BOOL checkonly)
{
	INT8 rule[20];
	UINT32 freq, symbol, constellation, freq_def;
	P_NODE p_node;
	T_NODE t_node;
	UINT32 prog_num;
	UINT16 cur_channel;
	UINT8  dot_pos;

	UINT32 channel_number=0,fi=0;

	SYSTEM_DATA*	sys_data;
	sys_data = sys_data_get();

    if(sys_data->current_ft_count > 0)
    {
	    ota_symb = sys_data->current_ft[0].c_param.sym;
	    ota_modulation = sys_data->current_ft[0].c_param.constellation;
    }

	get_default_bandparam(sys_data->country, (Band_param *)&uCountryParam);

	prog_num = get_prog_num(VIEW_ALL | TV_CHAN | RADIO_CHAN , 0);
	if (0 != prog_num)
	{
		get_prog_at( sys_data_get_cur_group_cur_mode_channel(),&p_node);
		get_tp_by_id(p_node.tp_id,&t_node);

		ota_freq = t_node.frq;
		ota_symb = t_node.sym;
		ota_modulation= t_node.FEC_inner;
	}
    else
    {
		ota_freq = uCountryParam[0].start_freq;
		ota_symb = sys_data->current_ft[0].c_param.sym;
		ota_modulation= sys_data->current_ft[0].c_param.constellation;
	}
	ota_pid = OTA_DATA_PID;
Exemplo n.º 8
0
eit_event_info_t* epg_get_cur_service_event(INT32 prog_idx, UINT32 event_type,date_time *dt,INT32 *event_num)
{
	P_NODE service_info;
	T_NODE tp_info;
	UINT16 service_id,orig_nw_id,ts_id;
	eit_tp_t tp;
	
	if (SUCCESS==get_prog_at(prog_idx,&service_info))
	{
		service_id=service_info.prog_number;
		get_tp_by_id(service_info.tp_id, &tp_info);
		orig_nw_id=tp_info.network_id;
		ts_id=tp_info.t_s_id;

#ifdef EPG_NETWORK_PATCH
		return epg_get_event(get_tp_header(), service_info.tp_id, ts_id, service_id, event_type, dt, event_num);
#else
		return epg_get_event(get_tp_header(), orig_nw_id, ts_id, service_id, event_type, dt, event_num);
#endif		
	}
	else	
		return NULL;		
}
Exemplo n.º 9
0
static void win_search_program_append(UINT32 tp_idx, UINT16 prog_idx)
{
	UINT32 si,i,j,n,cnt,str_len;
	UINT16* pstr;
	OSD_RECT rect;
	UINT8	shidx;
	char    str[30];
	
	DBG_PRINTF("Enter %s....\n",__FUNCTION__);
	
	if(prog_idx != INVALID_ID)
	{
		P_NODE p_node;

		get_prog_at(prog_idx, &p_node);
		MEMCPY(&win_search_cur_prog[p_node.av_flag], &p_node, sizeof(p_node));
		
		srch_ch_cnt[p_node.av_flag] ++;		
		cnt = srch_ch_cnt[p_node.av_flag];

		if(cnt <= INFOR_CHAN_CNT)
		{
			si = 0;
			n = cnt;
		}
		else
		{
			si = cnt - INFOR_CHAN_CNT;
			n = INFOR_CHAN_CNT;
		}

		if(si != 0)
		{
			for(i=0;i<n - 1;i++)
				MEMCPY(display_strs[10 + p_node.av_flag*10 + i], display_strs[10 + p_node.av_flag*10 + i + 1], MAX_DISP_STR_LEN*2);
		}

		pstr = display_strs[10 + p_node.av_flag*10 + n - 1];		
		if(p_node.ca_mode)
			ComAscStr2Uni("$", pstr);
		else
			ComAscStr2Uni("", pstr);
		str_len = ComUniStrLen(pstr);
		ComUniStrCopyChar((UINT8*)&pstr[str_len] ,p_node.service_name);

		if(p_node.av_flag == PROG_TV_MODE)
		{
			rect.uLeft 	= TVB_L + 20;//INFO_TV_L;
			rect.uTop  	= TVB_T + INFO_TXT_H;//INFO_TV_T+4;
			rect.uWidth = INFO_TV_W;
			rect.uHeight= INFO_TXT_H;
			shidx = TV_TXT_SH_IDX;
		}
		else
		{
			rect.uLeft 	= RADIOB_L + 20;//INFO_RADIO_L;
			rect.uTop  	= RADIOB_T + INFO_TXT_H;//INFO_RADIO_T+4;
			rect.uWidth = INFO_TV_W;//INFO_RADIO_W;
			rect.uHeight= INFO_TXT_H;
			shidx = RADIO_TXT_SH_IDX;
		}
		
		for(i=0;i<n;i++)
		{
			pstr = display_strs[10 + p_node.av_flag*10 + i];
			//win_srch_draw_info(&rect, NULL,pstr, shidx);
			win_srch_draw_info_ex(&rect, NULL,pstr, INFOMATION_TXT_IDX);
			rect.uTop += rect.uHeight;
		}


		rect.uTop = TVB_T+3;
		rect.uLeft += (rect.uWidth-80);
		rect.uWidth = 80;
        rect.uHeight = TXT_H;
		sprintf(str,"%d",cnt);
		win_srch_draw_info(&rect, str,NULL, shidx);
		tp_chsrched = 1;
		
	}

	if(tp_idx != 0xFFFFFFFF)
	{
		T_NODE t_node;
		S_NODE s_node;

		get_tp_by_id(tp_idx, &t_node);
		//get_sat_at(cur_sat_pos, VIEW_ALL,&s_node);
		get_sat_by_id(cur_sat_id, &s_node);
		srch_tp_cnt ++;

		cnt = srch_tp_cnt;
		if(cnt <= INFOR_TP_CNT)
		{
			si = 0;
			n = cnt;
		}
		else
		{
			si = cnt - INFOR_TP_CNT;
			n = INFOR_TP_CNT;
		}
		
		if(si != 0)
		{
			for(i=0;i<n - 1;i++)
			{
				MEMCPY(display_strs[ 30 + i], display_strs[30 + i + 1], MAX_DISP_STR_LEN*2);
			}
		}
		if(n>1)
		{
			pstr = display_strs[ 30 + n - 2];
#if 0			
			str_len = ComUniStrLen(pstr);
#else
			str_len = tp_info_chw_tbl[0] + tp_info_chw_tbl[1] + tp_info_chw_tbl[2] + tp_info_chw_tbl[3] + tp_info_chw_tbl[4];
#endif
			if(tp_chsrched)
				ComAscStr2Uni("OK", &pstr[str_len]);
			else
				ComAscStr2Uni("Failed", &pstr[str_len]);
		}

		pstr = display_strs[30 + n - 1];
		
		sprintf(str,"%d",srch_tp_cnt);
		ComAscStr2Uni(str,&pstr[0]);

#if 0		
		str_len = ComUniStrLen(pstr);
		str_len = tp_info_chw_tbl[0];
		ComUniStrCopyChar(&pstr[str_len], s_node.sat_name);
		str_len = ComUniStrLen(pstr);
		sprintf(str," %d %c %d ... ",t_node.frq,(t_node.pol == 0)? 'H' : 'V',t_node.sym);
		ComAscStr2Uni(str,&pstr[str_len]);
#else
		str_len = tp_info_chw_tbl[0];
		ComUniStrCopyChar((UINT8*)&pstr[str_len], s_node.sat_name);
		
		str_len += tp_info_chw_tbl[1];
		sprintf(str,"%d",t_node.frq);
		ComAscStr2Uni(str,&pstr[str_len]);
		
		str_len += tp_info_chw_tbl[2];
		sprintf(str,"%c",(t_node.pol == 0)? 'H' : 'V');
		ComAscStr2Uni(str,&pstr[str_len]);

		str_len += tp_info_chw_tbl[3];
		sprintf(str,"%d",t_node.sym);
		ComAscStr2Uni(str,&pstr[str_len]);

		str_len += tp_info_chw_tbl[4];
		STRCPY(str,"");
		ComAscStr2Uni(str,&pstr[str_len]);

#endif

		
		tp_chsrched = 0;
		
		rect.uLeft 	= INFO_TP_L;
		rect.uTop  	= INFO_TP_T;
		rect.uWidth = INFO_TP_W;
		rect.uHeight= INFO_TXT_H;
		shidx = TP_TXT_SH_IDX;
		for(i=0;i<n;i++)
		{
			
			pstr = display_strs[30 + i];
#if 0			
			win_srch_draw_info(&rect, NULL,pstr, shidx);
#else
			rect.uLeft 	= INFO_TP_L;
			str_len = 0;
			pstr = display_strs[30 + i];
			for(j=0;j<7;j++)
			{
				rect.uWidth = tp_info_w_tbl[j] - 2;	
				if(j != 5)
					win_srch_draw_info(&rect, NULL,pstr, shidx);				
				else
					win_srch_draw_info(&rect, "...",NULL, shidx);
				rect.uLeft +=  tp_info_w_tbl[j] ;
				if(j < 5)
				{
					pstr += tp_info_chw_tbl[j];
					//pstr += str_len;
				}
			}
#endif

			rect.uTop += rect.uHeight;
		}		

		
	}

	DBG_PRINTF("Exit %s....\n",__FUNCTION__);	
}
Exemplo n.º 10
0
INT32 si_sdtt_parser(UINT8 *section, INT32 length, 
	struct section_parameter *param)
{
	INT32 i,j;	// sec_offset;
	UINT16 current_ver;
	//UINT16 program_number;
	struct sdtt_section*info;
	struct sdtt_content *content;
	//struct program_map *maps;
	struct sdtt_section_info *s_info = (struct sdtt_section_info *)param->priv;	//??

	if (section==NULL) {
	//	s_info->map_counter = 0;
		return SI_SUCCESS;
	} 

	//get current version
	current_ver=SYS_SW_VERSION;


	info = (struct sdtt_section *)section;
	content = (struct sdtt_content *)(section+sizeof(struct sdtt_section));

	for(i=0;i<info->numer_of_content;i++)
	{
		UINT16 cont_desc_len,sche_desc_len,trg_ver,new_ver,sch_time_N;
		UINT32 down_desc_total_len,down_desc_pase_size;
		struct sch_time *sched_time;
		struct SDTT_DL_CONT_DESC_1 *down_desc;

		cont_desc_len = content->content_ds_len_lo|(((UINT16)content->content_ds_len_hi)<<4);
		sche_desc_len =  content->schedule_ds_len_lo|(((UINT16)content->schedule_ds_len_hi)<<4);
		sch_time_N = (sche_desc_len/sizeof(struct sch_time));
		down_desc_total_len = cont_desc_len - sche_desc_len;
		sched_time = (struct sch_time *)(((UINT8 *)content)+sizeof(struct sdtt_content));
		down_desc = (struct SDTT_DL_CONT_DESC_1 *)(((UINT8 *)sched_time)+sche_desc_len);

		for(down_desc_pase_size=0;down_desc_pase_size<down_desc_total_len;)
		{
			UINT16 desc_len;
			UINT8 *desc_point;
			
			if(down_desc->compab_flag!=1)
				goto NEXT_CONT; 	//I can't check the model inf, skip it... 

			desc_point = (((UINT8 *)down_desc) + sizeof(struct SDTT_DL_CONT_DESC_1));
			desc_len = si_sdtt_parser_compab_desc((struct SDTT_COMPAB_DESC_1 *)desc_point);

			if(desc_len==0)	//Error parsering Compatibility Desc table
				goto NEXT_CONT;

			down_desc_pase_size += (sizeof(struct SDTT_DL_CONT_DESC_1) + desc_len);
			desc_point += desc_len;

			if(down_desc->mod_inf_flag==1)
			{				
				desc_len = st_sdtt_parser_module_desc(desc_point);
				down_desc_pase_size += desc_len;
				desc_point += desc_len;
			}

			//Private data
			desc_len = (*desc_point);
			desc_point += (desc_len+1);
			down_desc_pase_size += (desc_len+1);

			//text info
			if(down_desc->txt_inf_flag==1)
			{
				desc_point += 3;	//3 Bytes, ISO_639_Lang_code
				desc_len = (*desc_point);
				desc_point += (desc_len+1);
				down_desc_pase_size += (desc_len+1+3);
			}

			down_desc = (struct SDTT_DL_CONT_DESC_1 *)desc_point;	//Point to next download cont desc...			
		}

		//check version
		trg_ver = SDTT_MERG_UINT16(content->target_ver_hi,content->target_ver_lo);
		new_ver = SDTT_MERG_UINT16(content->new_ver_hi,content->new_ver_lo);
		
		switch(content->ver_indicator)
		{
			case SDTT_VER_INDICAT_ALL:
				//Do Nothing...
				break;
		
			case SDTT_VER_INDICAT_LATER:
				if(trg_ver<current_ver)
					goto NEXT_CONT;

				break;
		
			case SDTT_VER_INDICAT_EARLIER:
				if(current_ver<trg_ver)
					goto NEXT_CONT;

				break;
		
			case SDTT_VER_INDICAT_ONLY:
				if(trg_ver!=current_ver)
					goto NEXT_CONT;

				break;
		}

		{
			//Set Timer
			date_time dtSet,dtGet;	
			UINT32 mjd_time,set_dur_time,get_dur_time = 0,fForce;
			UINT8 temp;
			P_NODE p_node;
			T_NODE t_node;

			fForce = content->download_level;

			if(sch_time_N>0)
			{
				for(j=0;j<sch_time_N;j++)
				{
					#define BCD2DEC(a)		((a>>4)*10+(a&0x0F))

					mjd_time =(	(((UINT32)sched_time[j].sch_time_start[0])<<8) |
								(((UINT32)sched_time[j].sch_time_start[1])) );

					dtSet.hour = BCD2DEC(sched_time[j].sch_time_start[2]);
					dtSet.min = BCD2DEC(sched_time[j].sch_time_start[3]);
					dtSet.sec = BCD2DEC(sched_time[j].sch_time_start[4]);

					set_dur_time =(	(((UINT32)sched_time[j].sch_time_duration[0])<<16) |
								(((UINT32)sched_time[j].sch_time_duration[1])<<8) |
								(((UINT32)sched_time[j].sch_time_duration[2])) );						

					mjd_to_ymd(mjd_time,&dtSet.year,&dtSet.month,&dtSet.day,&temp);
					
					api_ota_check_timerinfo(&dtSet,&set_dur_time,&fForce);

					dtGet = dtSet;
					get_dur_time = set_dur_time;
				}
			}
			else
			{
				//Update Now...
				get_local_time(&dtSet);
				convert_time_by_offset2(&dtGet,&dtSet,0,0,3);	//Set time as 3 second later...
				get_dur_time = 1;
			}

			if (get_prog_at(m_SdttChanIndex, &p_node) != SUCCESS)
				return SI_SUCCESS;
			
			get_tp_by_id(p_node.tp_id, &t_node);
			
			sys_data_set_ota_band(t_node.bandwidth*1000);
			sys_data_set_ota_freq(t_node.frq);

			api_ota_timer_open(dtGet,get_dur_time,fForce);
		}		
	
NEXT_CONT:
		content = (struct sdtt_content *)((UINT8 *)content + sizeof(struct sdtt_content) + cont_desc_len);		
	}



	#if 0	
	info->numer_of_content=*(section+sizeof(struct section_header)+6); //get number of content
	sec_offset=sizeof(struct section_header)+7;	//move to start of content 
	for(i=0;  i<info->numer_of_content; i++)
	{
		content=(struct sdtt_content *)(section+sec_offset);	
		//if (SI_MERGE_UINT16(content->group) ==0x1234) //match group?
		{
			//-->It should be fixed!!
			if (( (current_ver <=(SI_MERGE_UINT16(content->target_ver_hi))) && (content->ver_indicator)==2) ||

			((current_ver >=(SI_MERGE_UINT16(content->target_ver_hi))) && (content->ver_indicator)==1) ||
			((current_ver ==(SI_MERGE_UINT16(content->target_ver_hi))) && (content->ver_indicator)==3) ||
			((content->ver_indicator)==0)  )
			{
				// match download
				
				// start to get schedule information
				
			}	
	    	}
		
		sec_offset+=(4+SI_MERGE_UINT16(content->schedule_ds_len_hi));
	}
	#endif

	return SI_SUCCESS;
}
Exemplo n.º 11
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	S_NODE  s_node;
	P_NODE p_node;
	T_NODE t_node;
	bID = OSD_GetObjID(pObj);
	INT16 i=0;
	INT16 n =0;
	UINT16 prog_num =0;
	UINT8 av_flag = 0;


	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(1500);
					si_monitor_off(0xFFFFFFFF);
					n = get_sat_num(VIEW_ALL);
					
					recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
					for(i=0;i<n;i++)
					{
						get_sat_at(i, VIEW_ALL,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
					}
					
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                        		break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);

					si_monitor_off(0xFFFFFFFF);
					n = get_sat_num(VIEW_ALL);
					
					recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
					for(i=0;i<n;i++)
					{
						get_sat_at(i, VIEW_ALL,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
					}
					
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);
					sort_prog_node(PROG_FTA_SORT);	
					av_flag = sys_data_get_cur_chan_mode();
					prog_num = get_prog_num(VIEW_ALL | av_flag, 0);
			              libc_printf("prog_num11111111==%d\n",prog_num);
					for(i=prog_num-1;i>=0;i--)
					{
						get_prog_at(i,&p_node);
						get_tp_by_id(p_node.tp_id, &t_node);
						get_sat_by_id(t_node.sat_id, &s_node);

					    if(p_node.ca_mode == 0)
					    {
					        libc_printf("iiiiiiiiiiiiiiiiii====%d\n",i);
						 del_prog_at((UINT16)i);
					    }
					}
						
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
					break;

				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);
					sort_prog_node(PROG_FTA_SORT_EXT);	
					av_flag = sys_data_get_cur_chan_mode();
					prog_num = get_prog_num(VIEW_ALL | av_flag, 0);
			              libc_printf("prog_num222222222==%d\n",prog_num);
					for(i=prog_num-1;i>=0;i--)
					{
						get_prog_at(i,&p_node);
						get_tp_by_id(p_node.tp_id, &t_node);
						get_sat_by_id(t_node.sat_id, &s_node);
					    if(p_node.ca_mode)
					    {
					   	 libc_printf("i===============%d\n",i);
						 del_prog_at((UINT16)i);
					    }
					}

					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                    			break;

				default:
					break;
				}
			
		}
		break;
	}

	return ret;
}
Exemplo n.º 12
0
int ipanel_get_service_ByPID(Service_Info *service)
{
    int i=0;
    short prog_cnt = 0;
    P_NODE prog;
    T_NODE tp;

    prog_cnt = get_prog_num(VIEW_ALL|PROG_ALL_MODE, 0);
    for(i = 0; i < prog_cnt; i++)
    {
        if(SUCCESS!=get_prog_at(i, &prog))
            return -1;
        ipanel_porting_dprintf("-->[ipanel_get_service_ByPID] service_id=%d,service_type=%d,.\n",
                                prog.prog_number,prog.service_type); 
         if(service->service_type!=prog.service_type)
		 	continue;
         if(service->video_pid != 0x0)
         {
            //use video_pid cross frq and do something
            if((service->video_pid == prog.video_pid)&&(service->audio_pid== (UINT32)prog.audio_pid[0])&&(service->pcr_pid==prog.pcr_pid))
             {
			 	progpos=get_prog_pos(prog.prog_id);
                if(SUCCESS != get_tp_by_id(prog.tp_id, &tp))
                {
                    ipanel_porting_dprintf("[ipanel_get_service_ByPID]  get_tp_by_id failed \n");
                    return -1;
                }
                service->ts_id = tp.t_s_id;
				service->net_id = tp.network_id;
                service->frequency = tp.frq;
                service->symbol_rate = tp.sym;
                service->modulation = tp.FEC_inner;
                service->service_type = prog.service_type;
                service->pcr_pid = prog.pcr_pid;
                service->video_pid = prog.video_pid;
                service->audio_pid = (UINT32)prog.audio_pid[0];
				service->service_id=prog.prog_number;
                return 0;
             }
         }
         else if(service->audio_pid != 0x0)
         {
             //use audio_pid cross frq and do something
            // if(service->audio_pid == (UINT32)prog.audio_pid[0])
             if((service->video_pid == prog.video_pid)&&(service->audio_pid== (UINT32)prog.audio_pid[0])&&(service->pcr_pid==prog.pcr_pid))
             {      
			 	 progpos=get_prog_pos(prog.prog_id);
                if(SUCCESS != get_tp_by_id(prog.tp_id, &tp))
                {
                    ipanel_porting_dprintf("[ipanel_get_service_ByPID]  get_tp_by_id failed \n");
                    return -1;
                }
                service->ts_id = tp.t_s_id;
				service->net_id = tp.network_id;
                service->frequency = tp.frq;
                service->symbol_rate = tp.sym;
                service->modulation = tp.FEC_inner;
                service->service_type = prog.service_type;
                service->pcr_pid = prog.pcr_pid;
                service->video_pid = prog.video_pid;
                service->audio_pid = (UINT32)prog.audio_pid[0];
				service->service_id=prog.prog_number;
                return 0;
             }
         }
    }
    ipanel_porting_dprintf("[ipanel_get_service_ByPID] no found  failed \n");
    return -1;
        
}