📄 cc.c
字号:
// Do flow trigger after title detction. // When FlowState need to be release, 1) no input keys && 2) non-input modes // then can do _ProceedFlowState. // LLY0.62, need to check F/W key input or not // Otherwise, __bFWKey maybe overwitten within _ProceedFlowState() for auto play or power on resume if ( (__bFlowState & FLOW_TRIGGER) && !__bSetupMode && (__bISRKey == KEY_NO_KEY) && (__bFWKey == KEY_NO_KEY) ) { _ProceedFlowState(); }/// 7.2) Disc Flow Trigger __bTemp= LOBYTE ( __wDiscType ) & 0x0f;#ifndef NO_DISC_MODE //CoCo2.37p // ** DVD-TCH0.20; if ( __wDiscType & BOOK_DVD ) {#ifndef NO_DIGEST#ifndef NO_DVDDIGEST unverified. // Micky0.80 // wyc.100 if (__btDIGEST) { if (__bISRKey!=KEY_PLAY) { DIGEST_Trigger(); } } else#endif // NO_DVDDIGEST#endif { NV_Trigger (); // ** TCH0.25; if ( __btPlaying ) { NV_Trigger (); } }#ifndef NO_DVDDIGEST // wyc.100 , prepare DVD digest, because when execute DVD digest from stop mode, // in some titles will have some problems, so DIGEST_PreDVDDigest is responsible // for entering playing mode first then execute digest command.#ifdef PRE_DVDDIGEST DIGEST_PreDVDDigest();#endif // PRE_DVDDIGEST#endif // NO_DIGEST } else // ** DVD-TCH0.20;#endif //#ifndef NO_DISC_MODE //CoCo2.37p #ifdef SUPPORT_DELETE_FILE_IN_THUMB_UI if (__bThumbnailMode) THUMB_Trigger(); //CoCo.jpeg#endif //SUPPORT_DELETE_FILE_IN_THUMB_UI switch ( __bTemp ) {#ifndef NO_MP3 case BOOK_CDROM: //alex080, support cdrom auto upgrade /* Chuan1.05, Remove AutoUpgrade flow. It will do at infofilter if (__bAUTOUPGD) { AUTOUPGD_Upgrade(AUTOUPGD_SOURCE_CDIF); break; } */ // LLY.274p-1, Check if playable CDROM title if ( (__wDiscType & CDROM_M1) ) MM_Trigger(); if (__bThumbnailMode) THUMB_Trigger(); //CoCo.jpeg break;#endif case BOOK_CDDA: case BOOK_CDI: case BOOK_VCD:#ifndef NO_DISC_MODE //++CoCo2.37p if ( __btPBC ) { if ( ! (__wStatus & ID_ENDLIST ) ) { __wStatus= VCD20_Trigger (); if ( __wStatus & ID_ENDLIST ) { // Enter END_LIST, Show LOGO and CDROM Stop OSD_OUTPUT_MACRO ( MSG_ENDLIST, NULL_0, NULL_0 ); // DVD_101bMicky, fix VCD 2.0 pause/slow-> enter end list // the OSD still don't update?? __bFWKey = KEY_STOP; } } } else#endif //#ifndef NO_DISC_MODE //++CoCo2.37p {#ifndef NO_DIGEST // DIGEST mode only calls Trigger Function DIGEST_Trigger(); //jyliu.pc908#endif LINEAR_Trigger (); // wyc1.11-909#ifndef NO_CDG CDG_Trigger(); //LJY0.95, for CDG trigger#endif // } break; default: break; }/// End Of Section[7] : The DVD Channel Flow Trigger// ==============================================================/// Section[8] : Monitor the System status/// 8.1) Monitor The System Hang/// 8.2) Monitor The Time Update/// 8.3) Monitor The Buffer Control/// 8.4) Monitor The Bitstream Info.// ==============================================================/// 8.1) Monitor The System Hang // wyc0.95, rename to MONITOR_RecoverSystem. MONITOR_RecoverSystem();// Micky0.90, fix OSD message won't be cleared when time out if tray is opened// 8.2 is necessary for OSD_TRIGGER_MACRO to clear time out message/// 8.2) Monitor The Time Update // LLY2.36a, don't update OSD time here while SCAN mode // Since, current procedure will break SCAN waiting period to let main flow can press input key // So, if go here, OSD time maybe updated during this period. // In other ways, OSD time only updated while I frame decoded done during SCAN mode. if(__bModeCmd != KEY_SCB && __bModeCmd != KEY_SCF) { UTL_TriggerShowTime (); // ** TCH0.99-1; }// Micky0.86, fix the problem no disc or open will show cmd_ack_err.(UTL_OutputShowTime-> SrcFilter_GetCurrentPos)// Section 8.3/8.4 are not necessary when no disc & illegal disc. // 8.1 is necessary for auto power down/ screen saver.../ close tray(service_420)??if ( (__wDiscType != NO_DISC_IN_DRIVE) && !(__bDiscInfo & DISCINFO_UNPLAYABLE) ){/// 8.3) Monitor The Buffer Control// Micky2.80, enable buffer control for DIGEST. if ( __btPlaying || __btNewTime // Micky1.20, 4M flash#ifndef NO_DIGEST || (__btDIGEST && (!__bSetupMode)) #endif ) { MONITOR_CheckBuffer (); } // __btPlaying/// 8.4) Monitor The Bitstream Info. // ** TCH0.99-1; begin... // every 1 second to on/off the message for encrypt if ( (OS_GetSysTimer () > _dwTimerCount_MainLoop) ) { // Move from original Timer. Monitor Video or Audio MONITOR_VideoStream(); MONITOR_AudioStream(); // wyc2.22-909s, _dwTimerCount_MainLoop = OS_GetSysTimer() + COUNT_100_MSEC; } // ** TCH0.99-1; end...}/// End Of Section[8] : Monitor the System status// ==============================================================/// Section[9] : Monitor The Tray Status/// 9.1) Check Tray Open by extra force(such as Eject Button)/// 9.2) Check Tray was really closed(By IR Key or extra force)// ============================================================== // Micky1.00_909 //MEDIA_MonitorStatus();/// End Of Section[9] : Monitor The Tray Status/// ****** DVD Channel Sections Only End *********************MAIN_LOOP_END: // Micky0.67-909. release the time. // if necessary, may check if nothing to do then release. OS_YieldThread(); // continue; // continue the while loop. } }#ifdef SUPPORT_STBvoid CC_STB_MainLoop (void){ while ( 1 ) { // elmer2.37, move watchdog mechanism form here to alarm#ifdef SUPPORT_WATCH_DOG REG_SRAM_WATCHDOG++;#endif //MONITOR_CheckWatchDog(); DBG_Polling(); AP_MainLoop(); if( __bChooseMedia != MEDIA_SELECT_STB) { break; } } }#endifvoid Thread_CTKDVD (DWORD index){ // Brian.276-5, for system hang control // initialize the progress count to 0 _dwTimerCount_MainLoop=0;// wyc1.25, add one variable to record flow when detected as wrong disc for debug usage, __bTestFlow = 0;// ==============================================================/// Power On Initialization/// Only need do it once for System.// ==============================================================#ifdef SUPPORT_POWER_SWITCH //process power Switch __bISRKey = PANEL_KeyScan(); //FETCH POWER_SWITCH CONDITION if (__bISRKey == KEY_PICTURE) { __bPowerSw_StandBy = TRUE; //run STANDBY __bPowerSw = TRUE; //Disable IR KEY_POWER } else { __bPowerSw_StandBy = FALSE; } __bISRKey=KEY_NO_KEY;#endif //SUPPORT_POWER_SWITCH INITIAL_System(INITIAL_SYSTEM | HARDWARE_SHUTDOWN); // merge I/R power on sequence with h/w power on. INITIAL_PowerONStatus(INITIAL_POWER_HARDWARE); #ifdef SUPPORT_POWERON_MENU //CoCo2.38#ifndef SUPPORT_PLAY_MEDIA_DIRECTLY_POWER_ON POWERONMENU_Initial(); #endif //SUPPORT_PLAY_MEDIA_DIRECTLY_POWER_ON // elmer2.75, initialize USB and card-reader after POWERONMENU pops out#ifdef CTK_CARDREADER { extern BOOL CARD_SetupSystem(DWORD); CARD_SetupSystem(DECODER_SYSTEM); }#endif#ifndef POWERON_STANDBY#if (USB_SYSTEM == USB2_0_JUNGO) {#ifdef SUPPORT_USB_SWITCH HAL_WriteGPIO(GPIO_A, 23, 0);#endif // wyc2.78-909P, always resume the usbsrc thread because usbsrc won't go when no commands is issued. { extern DWORD _dwMediaUSBOTGChkTime;#ifdef SUPPORT_USB_POWER_BY_IO#ifdef SUPPORT_USB_HOST_DEVICE HAL_WriteGPIO(USB_POWER_GRP, PIN_USB_POWER, 0);#else HAL_WriteGPIO(USB_POWER_GRP, PIN_USB_POWER, 1);#endif //#endif // USBSRC_ThreadResume(); _dwMediaUSBOTGChkTime = OS_GetSysTimer(); } }#endif#endif // POWERON_STANDBY#endif //#ifdef SUPPORT_POWERON_MENU#ifdef LED_BackLight //CoCo2.38 #ifdef SUPPORT_POWER_SWITCH if (__bPowerSw_StandBy) { _bBacklight = 1; TFT_FreeRun(TRUE); TFT_BackLight(FALSE); } else TFT_BackLight(TRUE);#else TFT_BackLight(TRUE);#endif //SUPPORT_POWER_SWITCH#endif //LED_BackLight#ifdef SUPPORT_PLAY_MEDIA_DIRECTLY_POWER_ON POWERONMENU_PowerOnPlayMediaDirectly();#endif //SUPPORT_PLAY_MEDIA_DIRECTLY_POWER_ON//------------------------STB testing code---START---------------------------------------------------#ifdef SUPPORT_STB#ifndef IMAGE_FRAME_SETUP //CoCo2.38 MEDIA_DecidetMedia();#endif //IMAGE_FRAME_SETUP while( 1 ) { // The main monitor loop in player. // Program will always run in this loop except real Power-ON. if( __bChooseMedia == MEDIA_SELECT_STB) { STB_Entry(); CC_STB_MainLoop(); } else { CC_DVD_MainLoop(); } } #else CC_DVD_MainLoop();#endif} // main ()// *********************************************************************// Function : CC_KeyCommand// Description : Process KEY_PLAY, KEY_STOP, KEY_FF, KEY_SF, KEY_SCF, KEY_SCB// KEY_STEP, KEY_FREEZE// Arguments : bKey : The key definition// Return : TRUE only. ???// Side Effect : It'll record __bModeCmd and open __btPlayEnd// *********************************************************************BYTE CC_KeyCommand ( BYTE bKey ){ BYTE bKeyPrevious; BYTE bTemp; // Only fast/npf mode can't toggle? if ( ( (bKey==KEY_FF) || (bKey==KEY_PLAY)) && (__bModeCmd==bKey) && (!__btPause) ) { // Micky0.80, just return invalid key. /* OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1); return TRUE; */ return INVALID_KEY; } bKeyPrevious= __bModeCmd; // optimize codes for step/fast/scan/slow/freeze // For DVD, must query UOP // For other, query still/ CD-DA UOP if ( ( bKey != KEY_PLAY ) && ( bKey != KEY_STOP ) ) {#ifndef NO_DISC_MODE //CoCo2.37p if (__wDiscType & BOOK_DVD)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -