Exemplo n.º 1
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.º 2
0
/*
 * get one feed's detail information and fill to feed node
 * some info such as tp info, can't find in database, we have to retreive from nit
 */
static void fill_feed_detail_info(struct FEED_INFO *info, UINT32 sat_id, UINT32 prog_id)
{
	INT32 ret = MULTIFEED_FAILURE, ret2 = MULTIFEED_FAILURE;
	T_NODE t_node;
	P_NODE p_node, p_node2;
	P_NODE *feed_pnode;
	DB_VIEW *last_view;
	UINT16 last_filter_mode, i;
	UINT32 last_view_param;

	get_prog_by_id(prog_id, &p_node);

	// first check db whether has the infomation
	ret = find_tp_in_db(sat_id, info->original_network_id, info->transport_stream_id, &t_node);

	if(ret != MULTIFEED_SUCCESS)
	{
		// if already got the nit, then search the buffer, and update to db
		ret = search_node( multifeed_table_buff, 1024, info->original_network_id, info->transport_stream_id, &t_node);
		
		if( ret!=MULTIFEED_SUCCESS )
		{
			// not recieve nit data yet, so request nit data
			ret = find_tp_in_nit(info->original_network_id, info->transport_stream_id, &t_node);
		}
		
		if(ret == MULTIFEED_SUCCESS)
		{
			last_view			=	(DB_VIEW *)get_cur_view();
			last_filter_mode	=	last_view->cur_filter_mode;
			last_view_param		=	last_view->view_param;
			if(last_view->cur_type==TYPE_PROG_NODE)
			{
				recreate_tp_view(VIEW_ALL ,0);
				ret = add_node(TYPE_TP_NODE, sat_id, (void*)&t_node);
				if(ret == SUCCESS)
					update_data();
				recreate_prog_view(last_filter_mode, last_view_param);
			}
			else
			{
				ret = add_node(TYPE_TP_NODE, sat_id, (void*)&t_node);
				if(ret == SUCCESS)
					update_data();			
			}
		}
	}

	// maybe the subfeed is one of the channels, and that channel 
	// maybe locked by parent, so we have to get this information
	if( p_node.prog_number != info->service_id )
	{
		i = 0;
		while(SUCCESS == get_prog_at(i, &p_node2))
		{
			if(( p_node2.tp_id == t_node.tp_id ) && ( p_node2.prog_number == info->service_id ))
			{
				mf_debug("feed: (%s, sid: %d) is Channel: %s\n", \
							info->name, info->service_id, p_node2.service_name );
				ret2 = MULTIFEED_SUCCESS;
				break;
			}
			i++;
		}
	}
	if(ret == SUCCESS)
	{
		info->is_known	=	1;
		feed_pnode		=	&(info->p_node);
		
		MEMCPY(feed_pnode, &p_node, sizeof(P_NODE));
		feed_pnode->tp_id			=	t_node.tp_id;
		feed_pnode->prog_number		=	info->service_id;
		if( ret2 != MULTIFEED_SUCCESS)
		{
			feed_pnode->pmt_pid		=	0x1FFF;
			feed_pnode->audio_count	=	1;
			feed_pnode->audio_pid[0]=	feed_pnode->pcr_pid = feed_pnode->video_pid = 0x1FFF;
		}
		else
		{
			feed_pnode->av_flag		=	p_node2.av_flag;
			feed_pnode->ca_mode		=	p_node2.ca_mode;
			feed_pnode->video_pid	=	p_node2.video_pid;
			feed_pnode->pcr_pid		=	p_node2.pcr_pid;
			feed_pnode->h264_flag	=	p_node2.h264_flag;
			feed_pnode->pmt_pid		=	p_node2.pmt_pid;
			feed_pnode->pmt_version	=	p_node2.pmt_version;
			feed_pnode->service_type=	p_node2.service_type;
			feed_pnode->audio_channel=	p_node2.audio_channel;
			feed_pnode->audio_select=	p_node2.audio_select;
			feed_pnode->lock_flag	=	p_node2.lock_flag;// parent lock
			feed_pnode->audio_count	=	p_node2.audio_count;
			MEMCPY( feed_pnode->audio_pid, p_node2.audio_pid, sizeof(UINT16)*MAX_AUDIO_CNT );
			MEMCPY( feed_pnode->audio_lang, p_node2.audio_lang, sizeof(UINT16)*MAX_AUDIO_CNT );
		}
		mf_debug("feed: tp_id: %d, frq: %d\n", feed_pnode->tp_id, t_node.frq );
	}
}
Exemplo n.º 3
0
void win_otaset_load_default_setting(BOOL checkonly)
{
	UINT8 sat_pos;	
    UINT32 sat_num;
    UINT32 tp_num;
    UINT32 tp_pos;
    UINT32 i,j;
    S_NODE s_node;
    T_NODE t_node;

	sat_num = get_tuner_sat_cnt(OTA_TUNER_IDX);

	// When enter tp list window, the tp view have been switch to VIEW_SINGLE_SAT.
	// switch it to VIEW_ALL.
	recreate_tp_view(VIEW_ALL ,0);


	SAT_NUM = sat_num;
	SAT_POS = 0;


	sat_pos = 0xFF;
	tp_pos = INVALID_POS_NUM;

	if(!checkonly)
	{
		for(i=0;i<sat_num;i++)
	    {
	    	get_tuner_sat(OTA_TUNER_IDX, i, &s_node);

	        if(s_node.sat_orbit == OTA_DATA_SAT_POS)
	        {
	            sat_pos = i;
	            tp_num = get_tp_num_sat(s_node.sat_id);
	            for(j=0;j<tp_num;j++)
	            {
	                get_tp_at(s_node.sat_id,j,&t_node);
	                if(  t_node.frq >= (OTA_DATA_TP_FREQ - 3)
	                    && t_node.frq <= (OTA_DATA_TP_FREQ + 3)
	                    && t_node.sym >= (OTA_DATA_TP_SYMB - 500)
	                    && t_node.sym <= (OTA_DATA_TP_SYMB + 500)
	                    && t_node.pol == OTA_DATA_TP_POL)
	                    {
	                        tp_pos = j;
	                        break;
	                    }
	            }
	            
	            break;
	        }
	    }
		
		if(sat_pos == 0xFF)
			sat_pos = 0;
		
	}
	else
	{
		sat_pos = ota_satpos;
		if(sat_pos >= sat_num)
			sat_pos = 0;
		tp_pos = TP_POS ;
	}
	SAT_POS = sat_pos;

	ota_satpos = sat_pos;

	get_tuner_sat(OTA_TUNER_IDX, sat_pos, &s_node);
	tp_num = get_tp_num_sat(s_node.sat_id);

	TP_NUM = tp_num;
	if(tp_pos >= tp_num)
		tp_pos = 0;
	TP_POS = tp_pos;	

	if(TP_NUM > 0)
	{
		 get_tp_at(s_node.sat_id,tp_pos,&t_node);
		 ota_freq = t_node.frq;
		 ota_symb = t_node.sym;
		 ota_pol 	= t_node.pol;
	}
	else
	{

		ota_freq = OTA_DATA_TP_FREQ;
		ota_symb = OTA_DATA_TP_SYMB;
		ota_pol  = OTA_DATA_TP_POL;
	}

	ota_pid = OTA_DATA_PID;
Exemplo n.º 4
0
static void win_tplist_load_sat(BOOL updatesat)
{
	UINT16 i,tp_num,focus_pos,max_top;
	OBJLIST* ol;
	CONTAINER* item;	
	TEXT_FIELD* txt;	
	SCROLL_BAR* sb;	
	S_NODE s_node;	
	T_NODE prog_tp_node;

	if(cur_tp_sat_idx >= get_tuner_sat_cnt(TUNER_EITHER) )
		cur_tp_sat_idx= 0;
	
	get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node);
	
	ol = &tplst_olist;
	txt = &tplst_sat;
	sb = &tplst_scb;

	recreate_tp_view(VIEW_SINGLE_SAT, s_node.sat_id);
	tp_num = get_tp_num_sat(s_node.sat_id);
	OSD_SetObjListCount(ol, tp_num);	/* Set count */
	focus_pos = tp_list_pos;//OSD_GetObjListCurPoint(ol);

    if (tp_num > OSD_GetObjListPage(ol))
        max_top = tp_num - OSD_GetObjListPage(ol);
    else
        max_top = 0;

    if (focus_pos == 0xffff)
    {
    	if(playing_pnode.sat_id == s_node.sat_id)
    	{
    		for(i = 0;i < tp_num;i++)
    		{
    			get_tp_at(playing_pnode.sat_id, i, &prog_tp_node);
    			if(prog_tp_node.tp_id == playing_pnode.tp_id)
    			{
    				focus_pos = i;
                	if (focus_pos > max_top)
                        tp_list_top = max_top;
                    else
                        tp_list_top = focus_pos;
    				break;
    			}
    		}
    	}
    }
	if(focus_pos >= tp_num)
	{
		focus_pos = 0;
        tp_list_top = 0;
	}
	
	OSD_SetObjListCurPoint(ol, focus_pos);
	OSD_SetObjListNewPoint(ol, focus_pos);
	OSD_SetObjListTop(ol, tp_list_top);
	OSD_SetScrollBarMax(sb,tp_num);
	OSD_SetScrollBarPos(sb, focus_pos);

	win_tplist_set_sat_display();

	if(updatesat)
		OSD_DrawObject( (POBJECT_HEAD)txt, C_UPDATE_ALL);		

}
Exemplo n.º 5
0
static PRESULT satlst_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;

	switch(event)
	{
	case EVN_PRE_OPEN:
		win_init_pstring(30);
		win_satlist_check_focusID(1);
		win_satlist_load_sat_select();
		wincom_open_subtitle(pObj,RS_SATELLITE_LIST,0);
		break;
	case EVN_POST_OPEN:
		wincom_open_help_1(pObj,satlist_helpinfo , HELP_CNT);
		break;
	case EVN_PRE_CLOSE:
		win_satlist_save_sat_select();
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		wincom_close_subtitle();
		wincom_close_help();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		sys_data_check_channel_groups();
		break;
		
	case EVN_MSG_GOT:
		{
 //added by Eric.Ren, 接收control task 的消息,处理kingofsat  更新,2010.7.30
#ifdef KINGOFSAT_SUPPORT
			OBJLIST* ol;
			UINT16 sel;
			S_NODE s_node;
			INT32 kingofsat_tp_num = 0;  //可更新的TP个数
			UINT8 back_saved;
			
			if(param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				if((INT32)param2 < 0)
				{
					win_compopup_smsg_restoreback();

					win_compopup_init(WIN_POPUP_TYPE_SMSG);                        
					win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
					win_compopup_set_msg("Downloading error,Try again!", NULL, 0);
					win_compopup_open_ext(&back_saved);			

					osal_task_sleep(2000);
					win_compopup_smsg_restoreback();
					
					break ;
				}
				ol = &satlist_olist;
				sel = OSD_GetObjListCurPoint(ol);
				get_sat_at(sel,VIEW_ALL,&s_node);

				//判断是有可更新的TP 数据
				kingofsat_get_tp_num(&kingofsat_tp_num);
				if(kingofsat_tp_num == 0)
				{
					win_compopup_smsg_restoreback();
					win_compopup_init(WIN_POPUP_TYPE_SMSG);                        
					win_compopup_set_frame(MSG_POPUP_LAYER_L, MSG_POPUP_LAYER_T, MSG_POPUP_LAYER_W, MSG_POPUP_LAYER_H);
					win_compopup_set_msg("NO TP in downloading data!", NULL, 0);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
					
					break;
				}
				
				kingofsat_parse();		//解析下载数据
				recreate_tp_view(VIEW_SINGLE_SAT, s_node.sat_id);//创建TP view
				kingofsat_update(s_node.sat_id);	//更新数据
				kingofsat_destroy();	//释放资源

				OSD_TrackObject( (POBJECT_HEAD)&g_win_satlist, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

				recreate_sat_view(VIEW_ALL, 0); //创建SAT view
			}

#endif
			break;
		}

	default:
		break;		
		
	}

	return ret;
}