⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ircmd_video.c

📁 OSD显示,单片机实现,ICCAVR! 代码风格严谨,为高人所写.我仅为了上传换取资料
💻 C
📖 第 1 页 / 共 2 页
字号:
/*
*  Terry,2003/8/20 08:21PM
*  
*/
//#define P_SCAN_ONLY_CHG_INT_MODE]
#ifdef ADD_DVI311_SETUP
#include "spv301.h"
#endif
#ifdef DVD_SETUP_REENG
#include "setup_VA.h"
#include "setup_def.h"
#endif
#ifdef QSI_PLATFORM //qsi: merge by johnson 20040712
void ircmd_tvout(void);
//qsi: add by sharon
#endif

#if defined(DVB_MENU_SETUP_STYLE)||(defined(SUPPORT_DVB_GUI_NEW)&&defined(DVB_IR_PSCAN_ON))            //sunzhh add 2005-3-7
UINT8 rem_format_id;
#endif

const UINT8 tv_out_map[MODE_MAX_PSCAN] = {VIDEO_SET_MODE};//{INTERLACE,TV_SVIDEO,TV_RGB,P_SCAN,PC_VGA};
const UINT8 video_setup_id[] = {VIDEO_SETUP_STRING};//nono 2003-7-14 10:12

#define MODE_MAX_FORMAT TV_FORMAT_MAX
UINT8 ap_tv_out_id = 0;
//UINT8 is_ap_svideo;

#ifdef  DYNAMIC_SPECTRUM  //fengjl  3-10-30 15:04
void Show3dspectrum(void);
#endif    

#ifdef BBK_DVD//zhaoyanhua add 3-11-26 16:41
#define VIDEO_OUTPUT_ADDR   240
#define VIDEO_VFD_DELAY_TIME  100
int  tv_output_vfd_time = 0;
#endif

#ifdef SUPPORT_OSDID3//suqiaoli add 2004-3-26 
extern void osd_init_OSDID3(void);
extern void show_id3(void);
#endif
#ifdef SUPPORT_CD_TEXT//lizhx add 2004/08/24
#include"CDTextUtil.h"
#endif
#ifdef SUPPORT_MP4_SUBTITLE  // David 2004-5-12
extern void osd_init_OSDSRT(void);
#endif

//========================== Decleration the Functions ========================
static inline void    ircmd_TV_format_toggle(void);

// ============================================================================
// Video  Video  Video  Video  Video
// ============================================================================
void setup_tv_out(UINT8 id)
{
    int old_mode=p_scan;
    extern UINT8 srv_on;
    
#ifdef TVOUT6_4DAC_ON   //terry,2003-8-19 17:44
    if(id==TV_SVIDEO)
    #ifdef SPHE1000 //MIKEY 2004.07.06
        tv_dacoff( (0x01<<4)|(0x01<<5) );  // dac off        //SPHE1000 use DAC C as C signal in S-Video 
    #else 
        #ifdef MP_BOARD_216_PIN_NON_SHARE   // ronnie 2004/09/09
        	tv_dacoff( (0x01<<1)|(0x01<<2) );
        #else	
        	tv_dacoff( (0x01<<3)|(0x01<<4)|(0x01<<5) );  // dac off
        #endif
    #endif 
#ifdef P_SCAN_TURNOFF_CVBS_SVIDEO
    else if( (id==P_SCAN)||(id==PC_VGA)||(id==INTERLACE)||(id==TV_RGB) )//nono 20030920
    #ifdef SPHE1000
        tv_dacoff( (0x01<<1) );  // dac off
    #else
        tv_dacoff( (0x01<<1)|(0x01<<2) );  // dac off
    #endif
#endif
#ifdef S_VIDEO_RGB_OUT_IN_THE_SAME_TIME//4-1-15 16:05
    else if(id==TV_RGB)
        tv_dacoff( (0x00<<1)|(0x00<<2)|(0x00<<3)|(0x00<<4)|(0x00<<5) );  // dac off
#endif//S_VIDEO_RGB_OUT_IN_THE_SAME_TIME
    else
    #ifdef SPHE1000	//wrwu, 2004/11/03, fix a bug of the SPHE100X changing video output
    	tv_dacoff(0);
    #else
        tv_dacoff( (0x01<<1)|(0x01<<2) );  // dac off
	#endif
    

#endif//#ifdef TVOUT6_4DAC_ON   //terry,2003-8-19 17:44 

#ifdef ADD_PC_VGA_OUT//PC_VGA_OUT//nono change the name of the definition.5-8-22 21:14
	//axelchen 2005/8/10 ////yangli mov form mainproc.c 2005/9/5
    extern UINT8 eTITLEKEY[5]; 
    extern void cssx_set_titlekey(UINT8 title_key[5]);//nono 5-8-29 18:05 del warning msg.
    if (id != PC_VGA)//(tv_out_id != PC_VGA) 
        cssx_set_titlekey(eTITLEKEY);
#endif  

//wanghaoying 2003-11-6 22:54
#ifdef TV_USE_4_DAC
#ifdef SETUP_CVBS_OUTPUT        
    if (id == CVBS )
    {//terry,2003/12/25 09:19PM
        tv_dacoff( (0x01<<1)|(0x01<<2)|(0x01<<3)|(0x01<<4)|(0x01<<5) );
    }
	 else if(id==TV_RGB)   //zhongshan for rgb not output in the define
        tv_dacoff( (0x00<<1)|(0x00<<2)|(0x00<<3)|(0x00<<4)|(0x00<<5) );  // dac off
#endif
#endif
    
//gerry add for gbm,when we set to S-VIDEO,tv dac3 will be off,2004-5-13 15:44
//#define S_VIDEO_SET_TV_DAC3_OFF
#if defined(TV_USE_4_DAC)&&defined(S_VIDEO_SET_TV_DAC3_OFF)
    if(id==TV_SVIDEO)
        tv_dacoff( (0x01<<3) );  // dac off
    else
        tv_dacoff( (0x00<<3) );  // dac on    
#endif//#if defined(TV_USE_4_DAC)&&defined(S_VIDEO_SET_TV_DAC3_OFF)
    
    
    if( (id==INTERLACE)||(id==TV_RGB)||(id==TV_SVIDEO) )//terry,2003/8/3 05:30PM
    {
        tv_setup_int();             
        p_scan=0;
    }
#ifdef SETUP_CVBS_OUTPUT        //wanghaoying 2003-11-6 22:55
    else if( id==CVBS )//terry,2003/8/3 05:30PM
    {
        tv_setup_int();             
        p_scan=0;
    }
    #endif
    else
    {
#ifdef ADD_DVI311_SETUP
        if(id==P_SCAN)
        {
            #ifdef For_TsingHua//Modifed by chenzhao on 2004-12-14 15:34  
            if(dvi311_tv_mode>0x84)
                dvi311_mode=Mode_480P;           //576P   @kevin 2k40708
            else if(dvi311_tv_mode==0x84)
                dvi311_mode=Mode_576P;           //480P @kevin 2k406708
            #ifdef DVD_SETUP_REENG//Modifed by chenzhao on 2004-11-24 21:8   
                setup_VA[SETUP_VA_SPV311MODE]=dvi311_mode+MIN_ITEM_SEL;
            #endif
            #endif
            #ifdef For_TsingHua
            tv_setup_nint();                
            p_scan=1;
            #endif
        }    
        if(id==PC_VGA)
        {
            //dvi311_mode=5;           //SVGA @kevin 2k406708
            if(Power_off_311==1)   //setoutput   @kevin0710
            {
                close_pll(0xff);
            
            }//reset 311  kevin0710
            #ifdef For_TsingHua
            setup_tv_out(1);
            #endif
        }    
        scaler_main();
#else
        tv_setup_nint();                
        p_scan=1; //kevin forbid it for HDDVD @2k40706
 #endif
    }  
#ifdef ADD_DVI311_SETUP
    HD_display(id);
#endif
    
    if(p_scan!=old_mode)
    {
        if (full_scrn & SETUP)
        {
            //printf("show setup page\n");
            osd_init_setup();

#ifdef SETUP_TAB
            ShowSetupPage(2);
#else
            ShowSetupPage();
#endif
        }else if(srv_on)
        {
            #if defined(SUPPORT_DVB_GUI_NEW)&&defined(DVB_IR_PSCAN_ON)
            if(Is_Dvb_State())
            {
                if(g_CurScreenType == SCREEN_TYPE_FULL)
                {
                    //printf_w("DVBMenu_Init in setup_tv_out()............\n");
                    DVBMenu_Init();//Return2HideMenu();
                }
            }
            else      
            #endif 
            osd_init();

            //printf("setup tv out,osd enable\n");
        }
    }
    tv_setup_output(id);
    tv_out_id=id;
#ifdef  DYNAMIC_SPECTRUM        
    if(bEqDisplay)
        Show3dspectrum();           
#endif
#ifdef SUPPORT_OSDID3//liweihua add 2004-1-9 10:21
   if(Is_MP3_STATE())
   {
    osd_init_OSDID3();
    show_id3();
    }
#endif 
#ifdef SUPPORT_CD_TEXT//lizhx add 2004/08/24
    if( cd_type_loaded == CDDA )
    {
        osd_init_CDText();
        show_CDText( v11_trk_now );
    }
#endif  
#ifdef SUPPORT_MP4_SUBTITLE  // David 2004-5-12
  // mimitsai add for support audio/video external subtitle 050818
/*    if ((GetCurrentFileType() == CDROM_MP4) 
         #if 0//def TELL_FROM_MP4_EXT_NAME//nono modify 20050527
         || (GetCurrentFileType() == CDROM_AVI)
         #endif
        )*/
    // mimitsai modify for supporting all kinds of types audio/video format        
    if(cd_type_loaded == CDROM)  
    {
        osd_init_OSDSRT();
    }
#endif
    
#ifdef GBM_USE_VFD_CONTROL_P_SCAN_LED       //gerry,2004-2-20 14:23
    if(full_scrn==SETUP)
    {
    if(p_scan==0)
    write_vfd_led(0xf);     //3 led are all off,2004-2-19 21:03
    else//GBM_USE_VFD_CONTROL_P_SCAN_LED
    write_vfd_led(0xe);     //only p-san led on,2004-2-19 21:03
    }
#endif//GBM_USE_VFD_CONTROL_P_SCAN_LED    
}

void search_ap_tv_out_id(void)
{
    UINT8 i;
    
    for(i=0;i<=MODE_MAX_PSCAN;i++)    
    {
      if(tv_out_id == tv_out_map[i])
      {
        ap_tv_out_id = i;
        return;
      }      
    }
    ap_tv_out_id = 0;
}

//terry,2004/2/4 06:05PM
#ifndef MINTON_DVD                            //hq, let "AUTO" between "NTSC" and "PAL" for ngailik,4-2-17 1:00

const UINT8  TV_format_table[] = {
#ifdef  SUPPORT_NTSC
    MODE_NTSC,
#endif
#ifdef  SUPPORT_NTSCJ
    MODE_NTSCJ,
#endif
#ifdef  SUPPORT_PAL
    MODE_PAL,
#endif
#ifdef  SUPPORT_PAL60
    MODE_PAL60,
#endif
#ifdef  SUPPORT_PALM
    MODE_PALM,
#endif
#ifdef  SUPPORT_PALN
    MODE_PALN,
#endif
#ifdef  SUPPORT_PALNc
    MODE_PALNC,
#endif
    MODE_AUTO
};

#else

const UINT8  TV_format_table[] = 
{
    MODE_NTSC,
    MODE_AUTO,
    MODE_PAL
};
#endif                   //end ifndef MINTON_DVD, hq,4-2-17 1:03 
//terry,2004/2/5 12:11PM
UINT8 tv_format_sel=0;
void update_tv_format_sel(void)
{
   //int i;
   UINT8 i;//nono 2004-2-20 0:38 cancel warning...
   
   for(i=0;i<sizeof(TV_format_table)/sizeof(TV_format_table[0]);i++)
   {
    if(TV_format_table[i]==tv_format)
    {
       tv_format_sel=i;
       break;
    }
   }
}

static inline void    ircmd_TV_format_toggle(void)
{
    UINT8 id=STR_OS_PAL;

#ifdef SUPPORT_MIDIDISK_TITLE  //ouyang add for the lyric will move down when read title 050408
        if (bIsPlayMidiTitle)
        {
		invalid_key();
		return;
        }
#endif
#ifdef NEWSTYLE_WINDOW  // alan, 2003/8/27 10:06AM
    if (full_scrn&MESSAGE)
    {
        invalid_key();
        return;
    }
#endif  
    
#ifndef ADJUSTING_ACTION_VALID_RIGHT_NOW
    if(action_click)
#endif
    {
        tv_format_sel++;
        if (tv_format_sel>=sizeof(TV_format_table)/sizeof(TV_format_table[0])) {
           tv_format_sel=0;
        }
        tv_format = TV_format_table[tv_format_sel];
        
        setup_tv_format(tv_format);
        
        osd_move_subtitle_region(); // 2005/07/12 yltseng

#ifdef ADD_DVI311_SETUP
        if(tv_format==MODE_NTSC)
            dvi311_tv_mode=0x85;    //NTSC
        else if(tv_format==MODE_PAL)
            dvi311_tv_mode=0x84;
        else if(tv_format==MODE_PAL60)
            dvi311_tv_mode=0x86;

        if(tv_out_id!=P_SCAN)                                   //not HD output  kevin@2k0708
        {
            if((dvi311_tv_mode>0x84&&dvi311_mode==Mode_576P)//576P   @kevin 2k40525
            ||(dvi311_tv_mode==0x84&&dvi311_mode==Mode_480P))//480P @kevin 2k40525 change for display correct !
            {
                #ifdef DVI311_NO_PC_MODE
                    if(dvi311_tv_mode>0x84)
                        dvi311_mode=Mode_480P;
                    else if(dvi311_tv_mode==0x84)
                        dvi311_mode=Mode_576P;                        
                #else
            dvi311_mode=Mode_VGA;//SVGA
                #endif
            }
        }
        else if(tv_out_id==P_SCAN)                                   //not HD output  kevin@2k0708
        {
            if(dvi311_tv_mode>0x84&&dvi311_mode==Mode_576P)// NTSC and 480P   @kevin 2k40708
                dvi311_mode=Mode_480P;
            if(dvi311_tv_mode==0x84&&dvi311_mode==Mode_480P)// PAL and 576P   @kevin 2k40708
        dvi311_mode=Mode_576P;
        }
        
        scaler_main();
#endif

    }
#ifdef SUPPORT_SCANMODE_SWITCH
    SwitchRegionTVformat();
#endif               //ouyang2004.07.23
    switch(tv_format)
    {
    case MODE_NTSC:     id=STR_OS_NTSC;break;
    case MODE_PAL:      id=STR_OS_PAL; break;
    case MODE_AUTO:     id=STR_OS_AUTO; break;
#ifdef SUPPORT_PAL60
    case MODE_PAL60:    id=STR_OS_PAL60; break;
#endif
#ifdef SUPPORT_PALM     //gerry,2004-1-8 13:48
    case MODE_PALM:     id=STR_OS_PALM; break;
#endif//SUPPORT_PALM
#ifdef SUPPORT_PALN
    case MODE_PALN:     id=STR_OS_PALN; break;
#endif
#ifdef SUPPORT_PALNc
    case MODE_PALNC:    id=STR_OS_PALNc; break;
#endif
    }

//terry,2004/2/5 12:04PM move
#ifndef FORMAT_KEY_NOT_CHANGE_SETUP//BBK_DVD  // fengjl add for bbk   4-1-12 10:54
    setup_SetTV_format(id); //update setup menu item
#endif

    OSD1000ISP_STATUS(tv_format, OSDIR_PAL_NTSC);
    #if defined(DVB_MENU_SETUP_STYLE)||(defined(SUPPORT_DVB_GUI_NEW)&&defined(DVB_IR_PSCAN_ON))            //sunzhh add 2005-3-7
    rem_format_id = id; 
    #endif    
    PrintOsdMsg(STR_OS_TV_SYS|(id<<OSDSTR_ID_TOTL_BIT),REGION1,1,4);

#ifdef NEWSTYLE_WINDOW
    if(full_scrn==MESSAGE)
    {
        full_scrn = 0;
    #if defined(BBK_DVD)&&defined(DISC_INFO_KEY)  //fengjl edit 2004-04-28 11:10
        ircmd_disc_info();
    #else
        ircmd_goto();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -