Example #1
0
/* Set Background Color of VPO for Single Color Background */
void hde_back_color(UINT8 bY, UINT8 bCb, UINT8 bCr)
{
    struct  YCbCrColor color;

    color.uY = bY;
    color.uCb = bCb;
    color.uCr = bCr;
    vpo_ioctl((struct vpo_device *)dev_get_by_type(NULL, HLD_DEV_TYPE_DIS), VPO_IO_SET_BG_COLOR, (UINT32)(&color));
#ifdef DUAL_VIDEO_OUTPUT
    vpo_ioctl((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 1), VPO_IO_SET_BG_COLOR, (UINT32)&color);
#endif
}
/*
 * Class:     com_dvb_DvbSystemSetting
 * Method:    setBrightness
 * Signature: (I)Z
 */
JNIEXPORT jboolean JNICALL Java_DvbSystemSetting_setBrightness
  (JNIEnv *env, jclass cls, jint value) {
	LOGD("%s,%d value = %d ",__FUNCTION__,__LINE__, value);

	struct vpo_io_video_enhance vp_ve_par;
	struct vpo_device * vp_dev;

	vp_dev= (struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 0);
	if(value > 100)
            value  = 100;
       else if(value < 0)
        value =50;
	vp_ve_par.grade=value ;//42+2*value;
	vp_ve_par.changed_flag=VPO_IO_SET_ENHANCE_BRIGHTNESS;
	
	if(NULL==vp_dev)
	{
           return 0;
	}
	else if( vpo_ioctl(vp_dev,VPO_IO_VIDEO_ENHANCE, (UINT32)&vp_ve_par) == 0)
	{
		return 1;
	}
	else
		return 0;

}
Example #3
0
void BackToFullScrPlay()
{
	OSD_RECT rect;
	UINT16 cur_channel;
	UINT8 no_channel = 0, back_saved;

	ap_clear_all_menus();
	menu_stack_pop_all();

	cur_channel = sys_data_get_cur_group_cur_mode_channel();
	recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE , 0);
	if (get_prog_num(VIEW_ALL | PROG_TV_MODE, 0) == 0)
	{
		no_channel = 1;
	}
	if (get_prog_num(VIEW_ALL | PROG_RADIO_MODE, 0) > 0)
	{
		if (no_channel)
			sys_data_set_cur_chan_mode(RADIO_CHAN);
		no_channel = 0;
	}

	if (no_channel)
	{
		if (OSD_ObjOpen((POBJECT_HEAD) &g_win_mainmenu, MENU_OPEN_TYPE_STACK) != PROC_LEAVE)
			menu_stack_push((POBJECT_HEAD) &g_win_mainmenu);
	}
	else
	{
		hde_set_mode(VIEW_MODE_FULL);
		vpo_ioctl(g_vpo_dev, VPO_IO_DIRECT_ZOOM, 0);
		/* Clear OSD */
		OSD_GetRectOnScreen(&rect);
		OSDDrv_RegionFill((HANDLE)g_osd_dev, 0, &rect, OSD_TRANSPARENT_COLOR);
		/* show mute & pause status*/
		ShowMuteOnOff();
		ShowPauseOnOff();
//		ap_cas_message_show();
		/* show channel index */
		key_pan_display_channel(cur_channel);

		if(GetChannelParrentLock())
		{
			api_play_channel(cur_channel,TRUE,TRUE,FALSE);
		}
		//--{{{退到全屏播放的时候,弹出INFO BAR
		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)CHANNEL_BAR_HANDLE, TRUE);	
	}
}
Example #4
0
void do_set_display_effect(UINT8 type,UINT8 value)
{
	struct vpo_io_video_enhance vp_ve_par;
    struct vpo_device * vp_dev;

	switch ( type )
	{
		case ENUM_DISP_BRIGHTNESS:
			/* this value is for driver to take effect*/
			vp_ve_par.grade=value;  
			/* this value is for system_data to record,
			 * here we can always get  positive number when we  do scaling
			 */
            system_config.display_effect.brightness=(value-42)/2; 
            vp_ve_par.changed_flag=VPO_IO_SET_ENHANCE_BRIGHTNESS;
			break;
		case ENUM_DISP_CONTRAST:
			vp_ve_par.grade=value; 
            system_config.display_effect.contrast=(value-30)/5;
            vp_ve_par.changed_flag=VPO_IO_SET_ENHANCE_CONTRAST;
			break;
		case ENUM_DISP_SATURATION:
			vp_ve_par.grade=value;
            system_config.display_effect.saturation=(value-10)/10;
            vp_ve_par.changed_flag=VPO_IO_SET_ENHANCE_SATURATION;
			break;
		default:
			break;
	}

     vp_dev= (struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 0);
     if(NULL==vp_dev)
     {
           return;
     }
     else
     {
           vpo_ioctl(vp_dev,VPO_IO_VIDEO_ENHANCE, (UINT32)&vp_ve_par);
     }
}
Example #5
0
/* Set the View Mode of VPO Window */
void hde_set_mode(UINT32 mode)
{
    struct MPSource_CallBack MPCallBack;
    struct PIPSource_CallBack PIPCallBack;
    struct VDec_StatusInfo vdec_info;
    struct VDecPIPInfo tInitInfo;
    UINT32 waittime=0, wait_total_time = 0;
    struct vdec_device *pDecvDevice = (struct vdec_device *)get_selected_decoder();
    BOOL need_to_wait = FALSE;
    BOOL need_to_set_output = FALSE;
    UINT8 ulock = 0;
    struct nim_device *nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0);
    struct vpo_device *pDisDevice = (struct vpo_device *)dev_get_by_type(NULL, HLD_DEV_TYPE_DIS);
#ifdef DUAL_VIDEO_OUTPUT
    struct vpo_device *pDisDevice_O = (struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 1);
#endif
    struct vpo_io_get_info dis_info;

    switch(mode)
    {
    case VIEW_MODE_PREVIEW:
        if ((l_hde_mode != mode) || (l_hde_uIsPreviewResize == 1))
        {
            ENTER_CCHDE_API();
#if(	VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_VE_SCALE)

#ifdef HDTV_SUPPORT
            /* Check Frame Size, If Input Frame is HD, Set VE to Dview Mode */
            vpo_ioctl(pDisDevice, VPO_IO_GET_INFO, (UINT32) &dis_info);
#ifdef DUAL_VIDEO_OUTPUT
            vpo_ioctl(pDisDevice_O, VPO_IO_GET_INFO, (UINT32) &dis_info);
#endif
            if(is_cur_decoder_avc())
            {
                vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                if(vdec_info.pic_width > 720 || vdec_info.pic_height > 576)
                {
                    need_to_wait = TRUE;
                }
                else
                    need_to_wait = FALSE;
            }
            else
            {
                need_to_wait = TRUE;
                vdec_stop(pDecvDevice,TRUE,TRUE);
            }
            if(need_to_wait)
            {
                tInitInfo.adv_setting.init_mode = 1;
                tInitInfo.adv_setting.out_sys = dis_info.tvsys;
                tInitInfo.adv_setting.bprogressive = dis_info.bprogressive;
#ifdef DUAL_VIDEO_OUTPUT
                if(is_cur_decoder_avc())
#else
                if(0)
#endif
                {
                    vdec_set_output(pDecvDevice,DUAL_PREVIEW_MODE, &tInitInfo, &MPCallBack, &PIPCallBack);
                }
                else
                {
                    vdec_set_output(pDecvDevice,	DUAL_PREVIEW_MODE, &tInitInfo, &MPCallBack, &PIPCallBack);
                }
            }
            if(!is_cur_decoder_avc())
            {
                vdec_start(pDecvDevice);
            }
            if(is_cur_decoder_avc() && need_to_wait)
            {
                struct dmx_device *dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0);

                //For H264, we have to wait for 1st picture decoded, then call vpo_zoom, otherwise, it could cause below issue:
                //1. DE under run, because DE can scale down HD full size picture to preview size
                //2. In full screen mode, VE mapping is H264 mapping mode, in preview mode, VE mapping is MPEG2 mapping mode
                //--Michael Xie 2007/8/29
                wait_total_time = VE_MODE_SWITCH_TIME;
                while(waittime<wait_total_time)
                {
                    nim_get_lock(nim, &ulock);
                    if(!ulock)
                        break;
                    if(RET_SUCCESS == dmx_io_control(dmx, IS_AV_SCRAMBLED, 0))
                        break;
                    vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                    if(vdec_info.uFirstPicShowed)
                    {
                        wait_total_time = H264_VE_MODE_SWITCH_TIME;
                    }

                    if(vdec_info.output_mode == PREVIEW_MODE)
                    {
                        osal_task_sleep(100);
                        break;
                    }
                    osal_task_sleep(1);
                    waittime++;
                }
            }

            vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
#ifdef DUAL_VIDEO_OUTPUT
            vpo_zoom(pDisDevice_O, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
#endif

#else
            //Set Video Decoder Output Mode (PREVIEW_MODE)
            tInitInfo.src_rect.uStartX = l_hde_rectSrcFull_adjusted.uStartX>>1;
            tInitInfo.src_rect.uStartY= l_hde_rectSrcFull_adjusted.uStartY>>1;
            tInitInfo.src_rect.uWidth = PICTURE_WIDTH - 2*tInitInfo.src_rect.uStartX;
            tInitInfo.src_rect.uHeight = PICTURE_HEIGHT - 2*tInitInfo.src_rect.uStartY;
            tInitInfo.dst_rect.uStartX = l_hde_rectScrnPreview.uStartX;
            tInitInfo.dst_rect.uStartY= l_hde_rectScrnPreview.uStartY;
            tInitInfo.dst_rect.uWidth = l_hde_rectScrnPreview.uWidth;
            tInitInfo.dst_rect.uHeight = l_hde_rectScrnPreview.uHeight;
            vdec_set_output(pDecvDevice,PREVIEW_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);

            //Wait Video Decoder Output Mode Switch to PREVIEW_MODE
            vdec_info.output_mode = VIEW_MODE_FULL;
            while((vdec_info.output_mode != PREVIEW_MODE)&&(waittime<VE_MODE_SWITCH_TIME))
            {
                nim_get_lock(nim, &ulock);
                if(!ulock)
                    break;
                osal_task_sleep(1);
                waittime++;
                vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
            }

            //Switch Video Decoder Output Mode to PREVIEW_MODE Forcely
            if(vdec_info.output_mode != PREVIEW_MODE)
            {
                PRINTF("switch to preview forcely\n");

                vdec_stop(pDecvDevice,sys_data_get_cur_chan_mode() == PROG_TV_MODE,FALSE);
                vdec_set_output(pDecvDevice,PREVIEW_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);
                vdec_start(pDecvDevice);
            }
#endif
#elif(VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_DE_SCALE)
            //If is DE Scale Operation, then adjust VPO Full Srceen to Preview Screen directly
            if(0 == l_hde_preview_method)
                vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
            //If is VE Scale Operation, first set Video Decoder Output Mode(PIP_MODE),
            //then adjust VPO Full Srceen to Preview Screen
            else if(1 == l_hde_preview_method)
            {
                if(l_hde_mode == VIEW_MODE_PREVIEW)
                {
                    vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
                }
                else
                {
                    //Set Video Decoder Output Mode (IND_PIP_MODE)
                    tInitInfo.src_rect.uStartX = l_hde_rectSrcFull_adjusted.uStartX>>1;
                    tInitInfo.src_rect.uStartY= l_hde_rectSrcFull_adjusted.uStartY>>1;
                    tInitInfo.src_rect.uWidth = PICTURE_WIDTH - 2*tInitInfo.src_rect.uStartX;
                    tInitInfo.src_rect.uHeight = PICTURE_HEIGHT - 2*tInitInfo.src_rect.uStartY;
                    tInitInfo.dst_rect.uStartX = l_hde_rectScrnPreview.uStartX;
                    tInitInfo.dst_rect.uStartY= l_hde_rectScrnPreview.uStartY;
                    tInitInfo.dst_rect.uWidth = l_hde_rectScrnPreview.uWidth;
                    tInitInfo.dst_rect.uHeight = l_hde_rectScrnPreview.uHeight;
                    tInitInfo.pipSize.uWidth=l_hde_rectScrnPreview.uWidth;
                    tInitInfo.pipSize.uHeight=l_hde_rectScrnPreview.uHeight/5;
                    vdec_set_output(pDecvDevice,IND_PIP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);

                    //After Video Decoder Output Mode switch to PIP_MODE, then adjust VPO
                    vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                    if(VDEC27_STOPPED == vdec_info.uCurStatus)
                    {
                        vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
                    }
                    else
                    {
                        waittime = 0;
                        while((vdec_info.output_mode != PIP_MODE)&&(waittime<VE_MODE_SWITCH_TIME_29E))
                        {
                            nim_get_lock(nim, &ulock);
                            if(!ulock)
                                break;
                            osal_task_sleep(20);
                            waittime += 20;
                            vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                        }
                        if(vdec_info.output_mode != PIP_MODE)
                        {
                            vdec_stop(pDecvDevice,TRUE,FALSE);
                            vdec_set_output(pDecvDevice,IND_PIP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);
                            vdec_start(pDecvDevice);
                            vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
                        }
                        else
                        {
                            vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview);
                        }
                    }
                    vpo_ioctl(pDisDevice, VPO_IO_ADJUST_LM_IN_PREVIEW, 1);

                }
            }
#endif
        }
        l_hde_uIsPreviewResize = 0;
        LEAVE_CCHDE_API();
        break;
    case VIEW_MODE_MULTI:
        break;
    case VIEW_MODE_FULL:
    default:
        if (l_hde_mode != mode)
        {
            ENTER_CCHDE_API();
#if(	VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_VE_SCALE)
#ifdef HDTV_SUPPORT
            // convert VE to MP mode
            vpo_ioctl(pDisDevice, VPO_IO_GET_INFO, (UINT32) &dis_info);
#ifdef DUAL_VIDEO_OUTPUT
            vpo_ioctl(pDisDevice_O, VPO_IO_GET_INFO, (UINT32) &dis_info);
#endif
            need_to_set_output = FALSE;
            if(is_cur_decoder_avc())
            {
                vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                if(vdec_info.pic_width > 720 || vdec_info.pic_height > 576)
                {
                    need_to_wait = TRUE;
                }
                else if(vdec_info.pic_width == 0 || vdec_info.pic_height == 0)
                {
                    need_to_set_output = TRUE;
                }
                else
                    need_to_wait = FALSE;
            }
            else
            {
                need_to_wait = TRUE;
                vdec_stop(pDecvDevice,TRUE,TRUE);
            }

            if(need_to_wait || need_to_set_output)
            {
                tInitInfo.adv_setting.init_mode = 0;
                tInitInfo.adv_setting.out_sys = dis_info.tvsys;
                tInitInfo.adv_setting.bprogressive = dis_info.bprogressive;
#ifdef DUAL_VIDEO_OUTPUT
                if(is_cur_decoder_avc())
#else
                if(0)
#endif
                {
                    vdec_set_output(pDecvDevice,DUAL_MODE, &tInitInfo, &MPCallBack, &PIPCallBack);
                }
                else
                {
                    vdec_set_output(pDecvDevice,DUAL_MODE, &tInitInfo, &MPCallBack, &PIPCallBack);
                }
            }
            if(!is_cur_decoder_avc())
            {
                vdec_start(pDecvDevice);
            }

            vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull);
#ifdef DUAL_VIDEO_OUTPUT
            vpo_zoom(pDisDevice_O, &l_hde_rectSrcFull, &l_hde_rectScrnFull);
#endif
            osal_task_sleep(50);
            if(is_cur_decoder_avc() && need_to_wait)
            {
                struct dmx_device *dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0);

                wait_total_time = VE_MODE_SWITCH_TIME;
                while(waittime<wait_total_time)
                {
                    nim_get_lock(nim, &ulock);
                    if(!ulock)
                        break;
                    if(RET_SUCCESS == dmx_io_control(dmx, IS_AV_SCRAMBLED, 0))
                        break;
                    vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                    if(vdec_info.uFirstPicShowed)
                    {
                        wait_total_time = H264_VE_MODE_SWITCH_TIME;
                    }

                    if(vdec_info.output_mode == MP_MODE)
                    {
                        break;
                    }
                    osal_task_sleep(1);
                    waittime++;
                }
            }

#else
            //Set Video Decoder Output Mode (MP_MODE)
            tInitInfo.buse_sml_buf = FALSE;
            tInitInfo.src_rect.uStartX = l_hde_rectSrcFull.uStartX;
            tInitInfo.src_rect.uStartY= l_hde_rectSrcFull.uStartY;
            tInitInfo.src_rect.uWidth = l_hde_rectSrcFull.uWidth;
            tInitInfo.src_rect.uHeight = l_hde_rectSrcFull.uHeight;
            tInitInfo.dst_rect.uStartX = l_hde_rectScrnFull.uStartX;
            tInitInfo.dst_rect.uStartY= l_hde_rectScrnFull.uStartY;
            tInitInfo.dst_rect.uWidth = l_hde_rectScrnFull.uWidth;
            tInitInfo.dst_rect.uHeight = l_hde_rectScrnFull.uHeight;
            vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);

            //Wait Video Decoder Output Mode Switch to MP_MODE
            vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
            while(((vdec_info.output_mode != MP_MODE)||(vdec_info.use_sml_buf))&&(waittime<VE_MODE_SWITCH_TIME))
            {
                nim_get_lock(nim, &ulock);
                if(!ulock)
                    break;
                osal_task_sleep(1);
                waittime++;
                vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
            }
            //Switch Video Decoder Output Mode to MP_MODE Forcely
            if((vdec_info.output_mode != MP_MODE)||(vdec_info.use_sml_buf))
            {
                PRINTF("switch to mp forcely\n");

                vdec_stop(pDecvDevice,TRUE,FALSE);
                vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);
                vdec_start(pDecvDevice);
            }
#endif
#elif(VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_DE_SCALE)
            //If is DE Scale Operation, then adjust VPO to Full Srceen directly
            if(0 == l_hde_preview_method)
                vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull);
            //If is VE Scale Operation, first set Video Decoder Output Mode(MP_MODE),
            //then adjust VPO to Full Srceen
            else if(1 == l_hde_preview_method)
            {
                //Set Video Decoder Output Mode (MP_MODE)
                tInitInfo.src_rect.uStartX = l_hde_rectSrcFull.uStartX;
                tInitInfo.src_rect.uStartY= l_hde_rectSrcFull.uStartY;
                tInitInfo.src_rect.uWidth = l_hde_rectSrcFull.uWidth;
                tInitInfo.src_rect.uHeight = l_hde_rectSrcFull.uHeight;
                tInitInfo.dst_rect.uStartX = l_hde_rectScrnFull.uStartX;
                tInitInfo.dst_rect.uStartY= l_hde_rectScrnFull.uStartY;
                tInitInfo.dst_rect.uWidth = l_hde_rectScrnFull.uWidth;
                tInitInfo.dst_rect.uHeight = l_hde_rectScrnFull.uHeight;
                vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);

                //After Video Decoder Output Mode switch to MP_MODE, then adjust VPO
                vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                if(VDEC27_STOPPED == vdec_info.uCurStatus)
                {
                    vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull);
                }
                else
                {
                    waittime = 0;
                    while((vdec_info.output_mode != MP_MODE)&&(waittime<VE_MODE_SWITCH_TIME_29E))
                    {
                        nim_get_lock(nim, &ulock);
                        if(!ulock)
                            break;
                        osal_task_sleep(20);
                        waittime += 20;
                        vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info);
                    }
                    if(vdec_info.output_mode != MP_MODE)
                    {
                        vdec_stop(pDecvDevice,TRUE,FALSE);
                        vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack);
                        vdec_start(pDecvDevice);
                        vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull);
                    }
                    else
                    {
                        vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull);
                    }
                }

                vpo_ioctl(pDisDevice, VPO_IO_ADJUST_LM_IN_PREVIEW, 0);
            }
#endif
            LEAVE_CCHDE_API();
        }
    }
Example #6
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
}