示例#1
0
static PRESULT av_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bID;
	UINT32 sel;
	UINT16* Uni_str;
	SYSTEM_DATA* sys_data;
	OSD_RECT rect;
	COM_POP_LIST_PARAM_T param;

#ifdef HDMI_CERTIFICATION_UI
	MULTISEL * msel;
#endif

	bID = OSD_GetObjID(pObj);
	sys_data = sys_data_get();
	switch(event)
	{
		case EVN_PRE_CHANGE:
			sel = *((UINT32*)param1);
			break;
			
		case EVN_POST_CHANGE:
			sel = param1;
			switch(bID)
			{
				case TVMODE_ID:
					sys_data->avset.tv_mode = tvmode_osd_to_setting(sel);
					api_video_set_tvout(sys_data->avset.tv_mode);	
#ifdef HDMI_CERTIFICATION_UI
					msel = av_item_set[TVASPECT_ID - 1];
					if( check_tv_display_in_hd_mode() )
					{
						win_av_set_ratio(sys_data,3);	// 16:9
						sys_data_set_display_mode(&(sys_data->avset));

						OSD_SetMultiselCount(msel, 1);
						OSD_SetMultiselSel(msel, 3);
					}
					else
					{
						OSD_SetMultiselCount(msel, TV_RATIO_NCNT);
					}
					OSD_DrawObject((POBJECT_HEAD)msel, C_UPDATE_CONTENT);
					OSD_DrawObject((POBJECT_HEAD)&win_av_con, C_UPDATE_CONTENT);
#endif  					
					break;

				case TVASPECT_ID:
#ifdef HDMI_CERTIFICATION_UI					
					msel = av_item_set[TVASPECT_ID - 1];
					if( check_tv_display_in_hd_mode() )
					{	
						win_av_set_ratio(sys_data,3);	// 16:9
						OSD_SetMultiselSel(msel, 3);
					}
					else
#endif						
					{
						win_av_set_ratio(sys_data,sel);
					}
					sys_data_set_display_mode(&(sys_data->avset));			
					break;
					
				case VIDEOOUT_ID:
#ifdef HDTV_SUPPORT
					if (sel == 0)
					{
						sys_data->avset.scart_out = SCART_YUV;
					    sys_data->avset.tv_mode = TV_MODE_1080I_25;
						api_Scart_RGB_OnOff(0);
					}
					else
					{
						sys_data->avset.scart_out = SCART_RGB;
					    api_Scart_RGB_OnOff(1);
					}
#ifndef GPIO_RGB_YUV_SWITCH
					api_video_set_tvout(sys_data->avset.tv_mode);
#endif
					win_av_load_tv_mode_setting(TRUE);
#else			
					sys_data->avset.scart_out = sel;
					if(sel == SCART_CVBS)
					{
						api_Scart_RGB_OnOff(0);
		                #ifdef VDAC_USE_SVIDEO_TYPE
						api_Svideo_OnOff(0);
		                #endif
					}
					else if(sel == SCART_RGB)
					{
						api_Scart_RGB_OnOff(1);
						//api_Svideo_OnOff(0);/*RGB output will cut off svideo output,ommit here*/
					}
					else
					{
						api_Scart_RGB_OnOff(0);
		                #ifdef VDAC_USE_SVIDEO_TYPE
						api_Svideo_OnOff(1);
		                #endif
					}
#endif
					win_av_set_vcrloop_action(TRUE);
					if(sys_data->avset.scart_out == SCART_RGB)
						api_Scart_OutPut_Switch(1);
					else
						api_Scart_OutPut_Switch(sys_data->vcrloopmode);
					break;
					
				case VCR_ID:
					sys_data->vcrloopmode = sel;
					api_Scart_OutPut_Switch(sys_data->vcrloopmode );
					break;
					
				case RFSYSTEM_ID:
					sys_data->avset.rf_mode = sel;
					win_check_rf_channel(sys_data);
					OSD_SetMultiselSelTable(av_item_set[RFCHAN_ID - 1], rf_ch_range[sel]);					
					sys_data_set_rf(sys_data->avset.rf_mode, sys_data->avset.rf_channel);
					break;
					
				case RFCHAN_ID:
					sys_data->avset.rf_channel = sel;
					sys_data_set_rf(sys_data->avset.rf_mode, sys_data->avset.rf_channel);
					break;
					
#ifdef HDTV_SUPPORT
				case HDMIOUT_ID:
#ifdef HDMI_CERTIFICATION_UI
					if(!check_hdmi_out_in_dvi_mode())
					{	
						// STB only output RGB in DVI mode
						sys_data->avset.video_format = convert_ui_hdmi_out_sel_to_sys_video_format(sel);
						sys_data_set_video_format(sys_data->avset.video_format);
					}
#else
					sys_data->avset.video_format = sel;
					sys_data_set_video_format(sys_data->avset.video_format);
#endif
					break;
				case AUDIOOUT_ID:
					sys_data->avset.audio_output = sel;
					sys_data_set_audio_output(sys_data->avset.audio_output);
					break;
#endif
#if (SUPPORT_DUAL_OUTPUT_ONOFF)
				case DUALOUT_ID:
					sys_data->avset.dual_output = sel;
					sys_data_set_dual_output(sys_data->avset.dual_output);
					break;
#endif
			} 		
			break;
			
		case EVN_REQUEST_STRING:
			sel = param1;
			Uni_str= (UINT16*)param2;
			switch(bID)
			{
				case TVMODE_ID:
					ComAscStr2Uni(get_tv_mode_string(sel), Uni_str);
					break;
					
				case TVASPECT_ID:
#ifdef HDMI_CERTIFICATION_UI
					if( check_tv_display_in_hd_mode() )					
					{
						sel = 3; // 16:9
					}
#endif					
					ComAscStr2Uni(tv_ratio[sel], Uni_str);
					break;
#ifdef HDTV_SUPPORT
				case VIDEOOUT_ID:
					ComAscStr2Uni(video_output[sel], Uni_str);
					break;
#endif
		//		case VCR_ID:			break;
				case RFSYSTEM_ID:
					ComAscStr2Uni(rf_mode_stings[sel], Uni_str);
					break;
		//		case RFCHAN_ID:			break;		
			}
			break;
		
		case EVN_UNKNOWN_ACTION:
			win_av_enter_key(bID);		
			break;
	}
 	return ret;
}
示例#2
0
static PRESULT av_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bID;
	UINT32 sel;
	UINT16* Uni_str;
	SYSTEM_DATA* sys_data;
	OSD_RECT rect;
	COM_POP_LIST_PARAM_T param;

	bID = OSD_GetObjID(pObj);
	sys_data = sys_data_get();
	switch(event)
	{
	case EVN_PRE_CHANGE://51
		sel = *((UINT32*)param1);
		break;
	case EVN_POST_CHANGE://52
		sel = param1;
		switch(bID)
		{
		case TVMODE_ID:
			sys_data->avset.tv_mode = tvmode_osd_to_setting(sel);
			api_video_set_tvout(sys_data->avset.tv_mode);	
			break;
		case TVASPECT_ID:
			win_av_set_ratio(sys_data,sel);
			sys_data_set_display_mode(&(sys_data->avset));			
			break;
		case VIDEOOUT_ID:
#ifdef HDTV_SUPPORT
            if (sel == 0)
				sys_data->avset.scart_out = SCART_YUV;
            else
				sys_data->avset.scart_out = SCART_RGB;
#else			
			sys_data->avset.scart_out = sel;
#endif
			if(sel == SCART_CVBS)
			{
				api_Scart_RGB_OnOff(0);
#ifdef VDAC_USE_SVIDEO_TYPE
				api_Svideo_OnOff(0);
#endif
			}
			else if(sel == SCART_RGB)
			{
				api_Scart_RGB_OnOff(1);
				//api_Svideo_OnOff(0);/*RGB output will cut off svideo output,ommit here*/
			}
			else
			{
				api_Scart_RGB_OnOff(0);
#ifdef VDAC_USE_SVIDEO_TYPE
				api_Svideo_OnOff(1);
#endif
			}
#if(SYS_MAIN_BOARD == BOARD_DB_M3602_04V01)
					system_config.avset.scart_out = sys_data->avset.scart_out;

					if(sel != 0) // RGB
					{		
						MULTISEL * msel;	
						if(TV_MODE_PAL != sys_data->avset.tv_mode || TV_MODE_NTSC358 != sys_data->avset.tv_mode)
						{
							sys_data->avset.tv_mode = TV_MODE_PAL;
							system_config.avset.tv_mode = TV_MODE_PAL;
						}
						msel = av_item_set[TVMODE_ID - 1];
						OSD_SetMultiselCount(msel, get_tv_mode_count());

						sel = tvmode_setting_to_osd(sys_data->avset.tv_mode);
						OSD_SetMultiselSel(msel, sel);
						msel->bSelType = STRING_ANSI;
						msel->pSelTable = tv_mode_sd;
						OSD_DrawObject((POBJECT_HEAD)&av_item_con1, C_UPDATE_ALL);
						msel->bSelType = STRING_PROC;
						g_rgb_yuv_changed = 1;
					}
					else // YUV
					{
						MULTISEL * msel;

						msel = av_item_set[TVMODE_ID - 1];
						OSD_SetMultiselCount(msel, get_tv_mode_count());

						sel = tvmode_setting_to_osd(sys_data->avset.tv_mode);
						OSD_SetMultiselSel(msel, sel);
						msel->bSelType = STRING_ANSI;
						msel->pSelTable = tv_mode;
						OSD_DrawObject((POBJECT_HEAD)&av_item_con1, C_UPDATE_ALL);
						msel->bSelType = STRING_PROC;
						g_rgb_yuv_changed = 1;
					}
					api_video_set_tvout(sys_data->avset.tv_mode);
					g_rgb_yuv_changed = 0;
#endif
			win_av_set_vcrloop_action(TRUE);
			if(sys_data->avset.scart_out == SCART_RGB)
				api_Scart_OutPut_Switch(1);
			else
				api_Scart_OutPut_Switch(sys_data->vcrloopmode);			
			break;
		case VCR_ID:
			sys_data->vcrloopmode = sel;
			api_Scart_OutPut_Switch(sys_data->vcrloopmode );
			break;
		case RFSYSTEM_ID:
			sys_data->avset.rf_mode = sel;
			win_check_rf_channel(sys_data);
			OSD_SetMultiselSelTable(av_item_set[RFCHAN_ID - 1], rf_ch_range[sel]);
			
			sys_data_set_rf(sys_data->avset.rf_mode, sys_data->avset.rf_channel);
			break;
		case RFCHAN_ID:
			sys_data->avset.rf_channel = sel;
			sys_data_set_rf(sys_data->avset.rf_mode, sys_data->avset.rf_channel);
			break;		
#ifdef HDTV_SUPPORT
		case HDMIOUT_ID:
			sys_data->avset.video_format = sel;
			sys_data_set_video_format(sys_data->avset.video_format);
			break;
		case AUDIOOUT_ID:
			sys_data->avset.audio_output = sel;
			sys_data_set_audio_output(sys_data->avset.audio_output);
			break;
#endif
#if (SUPPORT_DUAL_OUTPUT_ONOFF)
		case DUALOUT_ID:
			sys_data->avset.dual_output = sel;
			sys_data_set_dual_output(sys_data->avset.dual_output);
			break;
#endif
		}
 		
		break; 
	case EVN_REQUEST_STRING:
		sel = param1;
		Uni_str= (UINT16*)param2;
		switch(bID)
		{
		case TVMODE_ID:
			ComAscStr2Uni(get_tv_mode_string(sel), Uni_str);
			break;
		case TVASPECT_ID:
			ComAscStr2Uni(tv_ratio[sel], Uni_str);
			break;
#ifdef HDTV_SUPPORT
		case VIDEOOUT_ID:
			ComAscStr2Uni(video_output[sel], Uni_str);
			break;
#endif
//		case VCR_ID:			break;
		case RFSYSTEM_ID:
			ComAscStr2Uni(rf_mode_stings[sel], Uni_str);
			break;
//		case RFCHAN_ID:			break;		
		}
		break;
		
	case EVN_UNKNOWN_ACTION:
		win_av_enter_key(bID);
		
		break;
	}
 	return ret;
}
示例#3
0
void power_off_process(void)
{
	struct  YCbCrColor bgcolor;
	extern struct rfm_device*   g_rfm_dev;
	extern struct scart_device* g_scart_dev;

#ifdef DVR_PVR_SUPPORT
	api_pvr_clear_up_all();
#endif	

	// SE: Mute before scart power off to avoid noise
	api_audio_set_mute(TRUE);

#if defined(HW_SS830C)||defined(HW_SS830C2)
	//Wirte GPIO#5 to high to avoid noise (used on SS830C)
	HAL_GPIO_BIT_DIR_SET(5, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(5, 1);
#endif

	api_Scart_TVSAT_Switch(0);
	api_Scart_Power_OnOff(0);
	api_Scart_RGB_OnOff(0);/*CVBS mode*/
#ifdef VDAC_USE_SVIDEO_TYPE
	api_Svideo_OnOff(0);
#endif
	api_Scart_OutPut_Switch(0);
	SetLNBShortDetect(0);
	Set12VShortDetect(0);
	api_LNB_power(0);
#if(SYS_12V_SWITCH == SYS_FUNC_ON)
	 api_diseqc_set_12v(g_nim_dev, 0);
#endif    

#ifdef USB_MP_SUPPORT
	if(system_state == SYS_STATE_USB_MP)
	{
		ap_udisk_close();
	}
#endif

#ifndef NEW_DEMO_FRAME
	if(hde_get_mode() != VIEW_MODE_MULTI)
	    UIChChgStopProg(TRUE);    
#endif

#if	(TTX_ON == 1)
	ttx_enable(FALSE);
#endif
#if (SUBTITLE_ON == 1)
	subt_enable(FALSE);
#endif
	sie_close();

	OSD_ShowOnOff(OSDDRV_OFF);
#ifdef NEW_DEMO_FRAME
	sim_close_monitor(0);
#else
	si_monitor_off(0xFFFFFFFF);
#endif
	stop_tdt();
	epg_off();
	vpo_win_onoff(g_vpo_dev, FALSE);
#ifdef DUAL_VIDEO_OUTPUT
	if(g_sd_vpo_dev != NULL)
		vpo_win_onoff(g_sd_vpo_dev,TRUE);
#endif
	dm_set_onoff(0);

	bgcolor.uY = 16;
	bgcolor.uCb = 128;
	bgcolor.uCr = 128;		
	vpo_ioctl(g_vpo_dev,VPO_IO_SET_BG_COLOR,(UINT32)&bgcolor);

	//close drivers	
	dmx_stop( g_dmx_dev);
	dmx_close( g_dmx_dev);
    if (g_dmx_dev2)
    {
    	dmx_stop(g_dmx_dev2);
	    dmx_close(g_dmx_dev2);
    }
	deca_stop(g_deca_dev,0,ADEC_STOP_IMM);
	deca_close(g_deca_dev);
	vdec_close(g_decv_dev);

// Power HDMI phy at standby mode.
#ifdef HDTV_SUPPORT
	struct hdmi_device *hdmi_dev;
	hdmi_dev = (struct hdmi_device *)dev_get_by_id(HLD_DEV_TYPE_HDMI, 0);
	if (hdmi_dev != NULL)
	{
		if (SUCCESS != hdmi_dev->close(hdmi_dev))
		{
			PRINTF("hdmi_close failed!!\n");
			ASSERT(0);
		}
	}
#endif
	
	vpo_close(g_vpo_dev);
#ifdef DUAL_VIDEO_OUTPUT
	if(RET_SUCCESS!=vpo_close((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 1)))
		ASSERT(0);
#endif
    snd_close(g_snd_dev);
	nim_close(g_nim_dev);
	if(g_nim_dev2)
		nim_close(g_nim_dev2);
	if(g_rfm_dev)
		rfm_close(g_rfm_dev);
#if (SYS_MAIN_BOARD == BOARD_M3329E_DEMO01V01 || SYS_MAIN_BOARD == BOARD_DB_M3602_02V01 || SYS_MAIN_BOARD == BOARD_DB_M3602_04V01)
	if(g_scart_dev)
		scart_close(g_scart_dev);
#endif
	led_display_flag = 0;
#if (SYS_MAIN_BOARD == BOARD_S3602_DEMO)
	// Power off
	HAL_GPIO_BIT_DIR_SET(25, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(25, 0);
#elif (SYS_MAIN_BOARD == BOARD_DB_M3602_02V01 || SYS_MAIN_BOARD == BOARD_DB_M3602_04V01)
	// Power off
/*alfred.wu 不允许ali的power off*/	
/*	
	HAL_GPIO_BIT_DIR_SET(61, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(61, 1);
	
	// Tuner LNB power off
	HAL_GPIO_BIT_DIR_SET(73, HAL_GPIO_O_DIR);
	HAL_GPIO_BIT_SET(73, 1);
*//*end*/
#endif
}