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

📄 utl.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
// ******  Big modification History Area  ******// LLY0.60, remove the un-necessary code:// - MSG_CDROM_DECODE// - MODE_NOT_CLEAR_PROGRAM// - USE_DEBUG_CMD// - SUPPORT_AV_SYSTEM// - IDATA: __bMin, __bSec, __bFrame// - data: __dwSysTimer// - _WINDVD// - SFR for control booting from SRAM or FLASH.// - HAL_Monitor(HAL_MONITOR_AUDIO_FREQ_PREPARE);// - HAL_Monitor(HAL_MONITOR_VIDEO_STATUS_PREPARE);// - _TIME_CIRCLE// - SUPPORT_CDIF// - CDDA_WAITSERVO// - UTL_DSPuCodeBackup// - __dwSectorCDROMBegin, __dwSectorCDROMEnd// - __bLastModePlay// - HAL_ControlCDIF()// - function body of UTL_ReadSectors()// LLY0.85, remove the code of "reset buffer for OSD display abnormal" issue// while SUPPORT_ANTISHOCK case.// Since it's un-necessary for CT909 solution.// LLY1.15, remove the un-necessary code for code reduce// - UTL_ReadSectors(): since it's un-necessary for CT909// LLY1.20, integrate MP4/ AVI/ DIVX/ Nero Digital related code// - Rename pDivXBitsContent as pBitsContent// - UTL_DivXASTSetting() as UTL_MovieASTSetting()// LLY2.04, remove the un-necessary global variables// ex. temp global variables// LLY2.35, remove UTL_FATPlayFromTime() since it has integrated w/ UTL_PlayFromTime()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ***** Global Define Area *****// If define it, it will print-out the scan mode relative message//#define DEBUG_SCAN_MODE// If define it, it will print-out the play item range message//#define DEBUG_PLAY_RANGE// If define it, it will print-out the desired total time//#define DEBUG_TOTAL_TIME// If define it, it will print-out the pre-scan information//#define DEBUG_PRESCAN// If define it, it will print-out the DRM relative information//#define DEBUG_DRM// If define it, it will print-out the jump position information for SCAN mode//#define DEBUG_SCAN_JUMP// If define it, it will print-out parser end padding enable or disable control status//#define DEBUG_END_PADDING// If define it, it will print-out desired audio ID for *.VOB//#define DEBUG_AUDIO_ID// If define it, it will print-out current buffer mode setting.//#define DEBUG_BUFFER_MODE// If define it, it will print-out show time related information.//#define DEBUG_SHOWTIME// If define it, it will print-out AVI GoTime related information.//#define DEBUG_AVI_GOTIME// If define it, it will print-out WMA GoTime related information.//#define DEBUG_WMA_GOTIME// If define it, it will print-out WMA SCAN mode related information//#define DEBUG_WMA_SCAN// If define it, it will print-out AVI Index/ SP/ Servo dump-in buffer address//#define DEBUG_AVI_IDX_SP_SERVO_BUFFER// If define it, it will print-out some information while playback JPEG from SPI Flash//#define DEBUG_JPEG_FROM_SPF// If define it, it will print-out some information while do single JPEG slide show//#define DEBUG_JPEG_SHOW// Grievous2.77, if define it, we will not need to wait for 3~4 sec to start playback when it is scan/goto/repeat mode.// Since sometimes (previous index position < audio position < go time position = index position <= video position) is happen,// parser will begin from previous index position.// And this solution may loss about half second audio instead of playback directly.// #define UTL_SCAN_QUICK// If define it, it will force find 1st non-DTS audio stream while playback *.VOB#define FIND_NODTS_AUDIO// If define it, it don't support DivX 311 format.//#define NO_DIVX_311// if define it, only enable the APIs for simple UTL#ifdef  ECOS909#define SIMP_UTL#endif  // #ifdef ECOS909///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// *****  Include header file Area  *****// The file "winav.h" must be included in first line#include "winav.h"#include "cc.h"     // for variable reference#include "utl.h"#include "comutl.h"#include "hal.h"#include "infofilter.h"#include "digest.h"#include "input.h"  // for KEY_xxx reference#include "chips.h"#include "osd.h"#include "srcfilter.h"  // LLY0.60, since SrcFilter_GetCurretPos()#include "initial.h"#include "navigate.h"#include "Mmanager.h"#include "subpict.h"  // LLY0.80, in order to usage SP/ OGT type ID#include "cdg.h"  //LJY0.95#include "char_subpict.h"#ifdef  SIMP_UTL#include "ecoscc.h"// Define the variable which is only used for real DVD system// [Media Manager Module]DWORD   __dwMMJPEGDisplayTime;#define     MM_GetFileType(a, b)           EXTNAME_NONE// [CC Module]//LLY0.72, BYTE    __bNextHWReset;BYTE    __bSTCRunning;DWORD   _dwTimerCount_MainLoop;BYTE    __bRepeatAB=REPEAT_NONE;BIT     __btNewTime;BIT     __btTemp;DWORD   __dwTimeNow;// [UTL Module]#define     UTL_OutputShowTime()#define     UTL_SetCDDADeEmphasis()#define     UTL_PreStartServo(a, b)#define     UTL_TransferCommandID(a)// [NV Module]#define     NV_Action(a, b)#else   // #ifdef SIMP_UTL#include "cell.h"#include "monitor.h"#include "linear.h"     //Kevin0.86, add#include "panel.h"	// LLY0.60, since PANEL_Output() & PANEL_Trigger() usage// Micky2.80, include "thumb.h" for reference __bThumbnailMode.#include "thumb.h"#include "setup.h"  // LLY2.60, for UTL_QuerySetting()#ifndef NO_DRM#include "osddivx.h"        // For DivX DRM playback control#endif  // #ifndef NO_DRM#endif  // #ifdef SIMP_UTL#include "comdec.h"#include "parser.h"#include "disp.h"  // LLY0.65, for using DISP_FrameBufferSet()#include "jpegdec.h"    // LLY2.51, include to support UTL_ShowJPEG#undef      SUPPORT_PRINTF/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ***** Extern other module's global variable Area *****extern  BYTE    __bSlowLevel;extern  WORD    __wSlowSpeed;  // in "cc.c"extern  BYTE    __bDVDDigest;extern  BYTE    __bSTCRunning;// CSC0.81, for reference DVD copyright informationextern COPYINFO    cpinfo ;extern BYTE    __bTVE_JPEG; //TRUE: TVE setting for JPEG; FALSE: TVE setting for MPEGextern BYTE _bHALJPEGRandomEffectType;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ***** Declare Global Variable Area *****BYTE    __bCheckAudioType;// Micky2.80, review global variables init=CHECK_NONE;BIT     __btCheckVideoType;// Micky2.80, review global variables init=FALSE;BYTE    __bModePlay;//Micky2.80, review global variables init.= MODE_PLAYUNKNOW;      ////LLY0.72, BYTE    __bLastModePlay;// LLY.038, keep the previous play mode before enter CDROM decodingBYTE    __bModePlayPreCDROM;// Micky2.80, review global variables init= MODE_PLAYUNKNOW;// LLY.274p, keep the current and new desired playing mode attributeBYTE    __bAttrPlay;BYTE    __bAttrPlayNew;BYTE    __bMin, __bSec, __bFrame;BYTE    __bLOGO;BYTE        _bJumpTime = FALSE;// LLY2.04, remove _dwUTLTemp, _dwUTLTemp1, _dwUTLTemp2, _bUTLTemp1, wITLTemp1//DVD_051Micky// it records the stable time value// to prevent the time value is undated by interrupt//DWORD  __dwSysTime;// support a function to read stable timeDWORD   _dwTriggerShowTime; // Next TRIGGER OSD/PANEL time// LLY0.63, expand the unit from BYTE to DWORD// Because, COUNT_XXX_MSEC maybe larger than BYTE unitDWORD   _dwGap_TriggerShowTime; // Gap for trigger show timeDWORD   _dwTimePrev;        // ** TCH0.99-1; record the previous show timeDWORD   _dwUTLNextTriggerCount;   // ** TCH1.70-2; record SysTimer for next Trigger.// DVD_170Micky, enhance MP3 display time method// accumulate frames count.DWORD    _dwTotalFrameCount;   // total decoded frames count for current trackDWORD    _dwPreFrameCount;     // previous frame count number// wyc.172-CDDA, support a flag to represent playing across tracks automatically.BYTE    __bCDDAAutoChTrk;DWORD   _dwTimeStart;   // record the start time for while loop// Keep previous scan time for next scan time-out controlDWORD   __dwScanTime=0;// LLY2.71, keep previous issue SCAN CMD time for error protection to wait SCAN_DONE flagDWORD   __dwCmdTime=0;//BYTE    __bBrightnessDuration=0;// LLY0.75, define a pointer to a DivX bitstream content structurePPARSER_BITS_CONTENT    pBitsContent;// LLY0.75, define a variable to keep last SCR value for *.vob/ *.dat/ *.mpgDWORD   __dwLastSCR;// LLY0.75, keep total time of current playback file.DWORD   __dwFileTime;// LLY0.76-1, keep sector number of one second for CDROM motion fileDWORD   __dwSectorPerSec;// LLY0.80, keep cuffer buffer estimate time for VCD/ SVCD/ CDDA title// Since, the buffer maybe reset by HAL_RESET_VIDEO/ HAL_RESET_AUDIODWORD   __dwBufferTime;// LLY0.80, keep desired Subpicture/ OGT type for decoder to set run length tableBYTE    __dwSPType;// LLY0.85, keep desired video IDBYTE    __bVideoID;// LLY0.95, Keep DRM playback stateBYTE    __bDRMPlayState;// LLY0.95, keep DivX DRM remain view countBYTE    __bDRMRemainView;// LLY0.96, keep if the DivX index table existBYTE    __bNoDivXIndexTbl;// LLY1.02, keep last position time (in msec format) for DivX scan mode.DWORD   __dwScanBaseTime;// LLY1.02, keep previous play item indexWORD   __wPrevPlayItem;// LLY1.02, keep previous play item directoryWORD    __wPrevPlayDir;// LLY1.02, the flag used check if the previous and new play item are sameBYTE    __bSameItem;// wyc2.14-909s,BYTE   _bUTLSrcBuffMod;// LLY2.15, add a variable to keep desired debug mode// Notice: must set the default value during _INITIAL_Variables_PowerON()//SYuan2.77 : expand __bDebugMode  to DWORD, and for Setting HAL-TX, RX Indenpendent//BYTE    __bDebugMode;DWORD    _dwDBGMode;// LLY2.21, initial frame buffer mode as unknownBYTE    __bFrameBufMode=UTL_FRAMEBUF_UNKNOWN;WORD    __wFrameWidth; // LLY2.22// LLY2.55, add a variable to keep video content format of current AVI containerDWORD   __dwAVIVideoFMT;// Grievous2.60, add a variable to keep bits for each sampleBYTE    __bBitsPerSample;// Grievous2.78, add a variable to keep internal/external subpicture modeBYTE    __bUTLSPTextMode;       // 1: internal mode ; 0: external mode ; 2: unknown// Chuan2.22, Add a global variable to record BFR setting.#ifdef SUPPORT_BFR_MODE // B-Frame redundancy#ifdef CONFIG_BFR_BY_FWBYTE  _bBFRMode = FALSE;#endif  // #ifdef CONFIG_BFR_BY_FW#endif  // #ifdef SUPPORT_BFR_MODE//wyc2.17-909S, rename SUPPORT_LANGUAGE_STUDY as SLOW_MODE_CONFIG#if (SLOW_MODE_CONFIG != NORMAL_SLOW_MODE)BYTE    __bLangStudyFlag = FALSE;#endif//#define LOGO_FROM_FLASH// LLY2.38, porting CoCo's code to support multi-LOGO// LLY2.51, remove this variables//BYTE __bLOGOIndex = 0;// LLY1.06-1, include "logoaddr.h" if define LOGO_FROM_FLASH to get logo data address within flash// Otherwise, include the "logo.txt"#ifdef  LOGO_FROM_FLASH// LLY2.15, using new method to find logo address#include "romld.h"//#include "logoaddr.h"// Define the start address within flash for logo data//#define LOGO_START_ADDR   (*(volatile DWORD *)(_BOOT_LOGOAddress))#else   // #ifdef LOGO_FROM_FLASHBYTE    aLogoData[] ={#ifndef NO_LOGO#ifdef  RELEASE_SETTING#include "logo.txt"#else   // #ifdef RELEASE_SETTING#include "logo_dbg.txt"#endif  // #ifdef RELEASE_SETTING#else   // #ifndef NO_LOGO0#endif  // #ifndef NO_LOGO} ;#endif  // #ifdef LOGO_FROM_FLASH

⌨️ 快捷键说明

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