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

📄 utl.~c

📁 ct952 source code use for Digital Frame Photo
💻 ~C
📖 第 1 页 / 共 5 页
字号:
                {                    HAL_PlayCommand(COMMAND_V_CLEAR_STILL, 0);                }		#ifdef SUPPORT_LOGO_AUTO_FULL_SCREEN 		DisplayLogoFlag=FALSE;		#endif                return (TRUE);            }            // release the CPU            OS_YieldThread();        }        // LOGO display fail.        if(dwCnt==FALSE)        {            DBG_Printf(DBG_THREAD_CHEERDVD, DBG_INFO_PRINTF, "Time-Out for LOGO \n");            __bLOGO = LOGO_NONE;        }	#ifdef SUPPORT_LOGO_AUTO_FULL_SCREEN 		DisplayLogoFlag=FALSE;	#endif        return (FALSE);    }    else if(bLogoType == 0x5A)  // For JPEG LOGO    {#ifdef  JPG_SINGLE_FRAME_BUFFER        // LLY2.51, two solutin while JPEG w/ effect to LOGO        // [1] Black the screen before LOGO display        // [2] Complete the JPEG effect, and keep last picture before LOGO display        // Otherwise, user will see garbage during next JPEG (LOGO) decoding peroid        // Since, JPEG w/ effect is always active display @ frame 2        // and next JPEG decoding (LOGO) will use frame 1 & 2        // Notice: this problem only happen @ only one single display buffer.        // LLY2.55, call API to reach the desired goal: MM_CompleteJPGEffect()        // Since, following procedure is done within it from v2.55.        MM_CompleteJPGEffect(TRUE);		//++CoCo2.76, LOGO need to do it here because MM_CompleteJPGEffect() can't judge this case by MM stage.		HALJPEG_EffectConfigure(JPEG_EFFECT_NONE);#if 0        if( (__bAttrPlay == ATTR_JPG) && (__bHALJPEGEffect!=HALJPEG_EFFECT_NONE))        {#ifdef  BLACK_SCREEN_WHILE_JPEG_EFFECT_TO_LOGO            // [1] clear frame buffer 0 (for LOGO) first while back from JPEG w/ Effect            HAL_ClearScreen(HAL_COLOR_BLACK, HAL_CLEAR_SCREEN_JPEG, HAL_DISP_FRAME0);#else   // #ifdef  BLACK_SCREEN_WHILE_JPEG_EFFECT_TO_LOGO#ifdef IMAGE_FRAME_SETUP //CoCo2.38a            extern BYTE __bMMFirstJPEGPlaying;            WORD wResult;            // Notice: 1st picture is not to do while non-image frame setup mode.            //         since JPEG effect only can be enabled by KEY_ANGLE not setup.            //senshong: need check jpeg decoded status is OK            wResult = HALJPEG_Status(HALJPEG_DECODE);            if (!__bMMFirstJPEGPlaying && wResult == JPEG_STATUS_OK)#endif //IMAGE_FRAME_SETUP            {                // Do copy when decode and display ok                HALJPEG_CopyPictureToDisplayBuffer(JPEG_EFFECT_DISP_BUFFER_2_TO_0);            }#endif  // #ifdef  BLACK_SCREEN_WHILE_JPEG_EFFECT_TO_LOGO            __HALJPEGSetting.bFrameBuffer=0;            // Notice: must clear JPEG as none first before call HALJPEG_Display()            //         since, this API will ignore it while JPEG effect on.            __bHALJPEGEffect = HALJPEG_EFFECT_NONE;            HALJPEG_Display(__HALJPEGSetting.bFrameBuffer);            // Notice: must delay 1 VSYNC after change display frame            DISP_DelayVSYNC(1);        }#endif  // #if 0#endif  // #ifdef  JPG_SINGLE_FRAME_BUFFER        // Set playback mode and attribute as JPEG first        __bModePlay = MODE_PLAYUNKNOW;        __bAttrPlayNew = ATTR_JPG;        // Disable thumbnail and JPEG preview mode first        // Since buffer mode configuration will reference it within        // UTL_SetPlayMode() --> UTL_Config_BufferMode(DUMP_BUFF_MM_VIDEO_ONLY_MODE)        __bThumbnailMode=0;        __dwMMJPEGPreview=0;        // Config playback mode as JPEG        UTL_SetPlayMode(MODE_PLAYVIDEO);        // Fill desired date to video buffer directly        HAL_FillVideoBuffer(HAL_VIDEOBUF_MM, pdwPtr, dwSize);        // Reset video decoder        HAL_ResetVideoDecoder(HAL_VIDEO_DECODER1|HAL_VIDEO_DECODER2 );        // Start JPEG Slide Show        // LLY2.56, only can always specify frame index as 0 for JPEG LOGO for single frame buffer mode        // Others, must toggle frame buffer between 0 and 1#ifdef  JPG_SINGLE_FRAME_BUFFER        dwTemp = UTL_ShowJPEG_Slide(JPEG_PARSE_TYPE_NORMAL, 0x0);#else   // #ifdef JPG_SINGLE_FRAME_BUFFER        // Notice: consider to provide a API to report current used frame buffer index        //         ie. don't reference __HALJPEGSetting.bFrameBuffer directly.        //CoCo2.71, fix the bug about the picture may have garbage when show LOGO in 64M solution        if (__dwMMJPGDispOK == FALSE)        {            dwTemp = UTL_ShowJPEG_Slide(JPEG_PARSE_TYPE_NORMAL, __HALJPEGSetting.bFrameBuffer);            __dwMMJPGDispOK = TRUE;        }        else        {			/*            if (__HALJPEGSetting.bFrameBuffer == 0)            {                dwTemp = UTL_ShowJPEG_Slide(0x1);            }            else            {                dwTemp = UTL_ShowJPEG_Slide(0x0);            }			*/			//CoCo2.77			if (__wHALJPEGCurrentDisplayBuf)			{				dwTemp = UTL_ShowJPEG_Slide(JPEG_PARSE_TYPE_NORMAL, 0);			}			else			{				dwTemp = UTL_ShowJPEG_Slide(JPEG_PARSE_TYPE_NORMAL, 1);			}        }#endif  // #ifdef JPG_SINGLE_FRAME_BUFFER        // If decode and display ok, enable LOGO flag as default        if(dwTemp)        {            // Need check if it's necessary to do TV mode setting after JPEG decoding ok            HAL_AdjustTVMode(DISP_NEXTVSYNC);            __bLOGO = LOGO_DEFAULT;            return TRUE;        }        else        {            __bLOGO = LOGO_NONE;            return FALSE;        }    }    // For MPEG motion    else if(bLogoType==0x2C)    {    }    return (FALSE);#else   // #ifndef NO_LOGO    // Always return TRUE while define NO_LOGO    return (TRUE);#endif  // #ifndef NO_LOGO}// Micky_PORTING_OSWRAP/*// LLY0.60, Get eCos timer.//  **************************************************************************//  Function    :   UTL_GetSysTimer//  Description :   Get System timer//  Arguments   :   None//  Return      :   Current system timer (DWORD unit)//  **************************************************************************DWORD    UTL_GetSysTimer(void){#ifdef  SYSTEM_ECOS    __dwSysTime = (DWORD) cyg_counter_current_value(__ClockHandle);    // Chuan1.07, System tick is a multiple of 2. We need divide by 2 to obtain increase number.    __dwCountSystem = __dwSysTime / 2;#endif    return __dwCountSystem;}//  *********************************************************************//  Function    :   UTL_DelayTime//  Description :   Delay until time out//  Arguments   :   dwCount  : the delay time//  Return      :   None//  Side Effect ://  *********************************************************************// LLY0.63, expand delay time unit from WORD to DWORD// Because, COUNT_XXX_SEC is WORD unit, and the add operation maybe larger than 65535// LLY1.15, modify the API define: remove 2nd parameter and don't return value//BIT   UTL_DelayTime( DWORD dwCount, BIT btBreak )void UTL_DelayTime(DWORD dwCount){    _dwTimeStart = UTL_GetSysTimer();    while ( ( UTL_GetSysTimer()- _dwTimeStart ) < dwCount )    {        // LLY0.63, it's un-necessary to do servo monitor control        // Because, servo is a thread now from CT909.        OS_YieldThread();    }//    return  TRUE;}*///  *********************************************************************//  Function    :   UTL_PlayFromTime//  Description :   Specify the desired time for input bitstream//  Arguments   :   dwStart, the desired of starting point//                  dwEnd, the desired time of end point//  Return      :   TRUE is Successful//  *********************************************************************// LLY2.35, give 2nd parameter for end sector address since FAT system need it.//BIT  UTL_PlayFromTime ( DWORD dwTime )BIT UTL_PlayFromTime(DWORD dwStart, DWORD dwEnd){    // LLY0.91, clear the __btPlayEnd flag    // Since, we will issue the new range for parser    // So, previous parser complete flag is invalid.    // Otherwise, we can see the following bug:    // MP3 SCF near the track end --> parser report data sending end --> KEY_SCB    // --> HAL_RESET_AUDIO --> MM_AudioTrigger(): __btPlayEnd=TRUE & ARem is low    // So, issue KEY_NEXT to playback next track.    __btPlayEnd=FALSE;#ifdef  SUPPORT_ENCODE_JPG_PICTURE    // LLY2.51, support JPEG playback from SPI path    if(__SF_SourceGBL[0].bSourceIndex == SOURCE_SPI)    {        // LLY2.51, call SrcFile to re-calculate desired rnage from sector to byte unit        // And, update the start/end value again.        SrcFilter_ReadSectors(__dwSFStreamID, dwStart, dwEnd);        dwStart = __dwSFSPIStartAddr;        dwEnd = __dwSFSPIEndAddr;#ifdef  DEBUG_JPEG_FROM_SPF        DBG_Printf(DBG_THREAD_CHEERDVD, DBG_INFO_PRINTF, "Start: %lx, End: %lx for UTL_PlayFromTime()\n", dwStart, dwEnd);#endif  // #ifdef  DEBUG_JPEG_FROM_SPF        // Notice: must /4 since the unit is DWORD for HLA_FillVideoBuffer()'s dwSize        //         and must plus 1 of calculation size since start and end all included.        HAL_FillVideoBuffer(HAL_VIDEOBUF_MM, (DWORD *)dwStart, (dwEnd-dwStart+1)/4);        // Micky2.11a, integrate video decoder reset procedure into a API.        HAL_ResetVideoDecoder(HAL_VIDEO_DECODER1|HAL_VIDEO_DECODER2 );        return TRUE;    }#endif  // #ifdef  SUPPORT_ENCODE_JPG_PICTURE#ifdef  SUPPORT_FAT_FILE_SYSTEM    // LLY2.35, need do extra operation for FAT system.    if ((__bFileSystem == FILE_SYSTEM_FAT12) || (__bFileSystem == FILE_SYSTEM_FAT16)        || (__bFileSystem == FILE_SYSTEM_FAT32))    {        DWORD   dwOffset;        FAT_CheckUSBSecNum(&dwStart, &dwEnd, __dwTimeBegin, &dwOffset);        __SF_SourceGBL[__dwSFStreamID].dwBlockOffset = dwOffset;    }#endif  // #ifdef  SUPPORT_FAT_FILE_SYSTEM    // LLY1.05, do protection while parser start cmd fail    // ie. don't issue servo command continue.    __bTemp=PARSER_Command( 0, PARSER_CMD_START, 0 );    if(__bTemp)    {        // Tell source filter the desired range and get it        __bTemp = SrcFilter_ReadSectors(__dwSFStreamID, dwStart, dwEnd);#ifdef SUPPORT_JPEG_AUDIO_PLAYING        if (__dwSFDirRead == TRUE)        {            __bMMAudioStreamPause = TRUE;            __bMMVideoStreamPause = FALSE;        }        else        {            __bMMAudioStreamPause = FALSE;            __bMMVideoStreamPause = TRUE;        }#endif        return ( __bTemp );    }    else    {        return __bTemp;    }}// LLY2.53 create//  *************************************************************************//  Function    :   UTL_PlayFromTime_BGItem//  Description :   Specify the desired time for background item//  Arguments   :   dwStart, the desired of starting point//                  dwEnd, the desired time of end point//  Return      :   TRUE is Successful//  Notice      :   This API only can be used for background playback item//  *************************************************************************BIT UTL_PlayFromTime_BGItem(DWORD dwStart, DWORD dwEnd){#ifdef  SUPPORT_FAT_FILE_SYSTEM    // LLY2.35, need do extra operation for FAT system.    if ((__bFileSystem == FILE_SYSTEM_FAT12) || (__bFileSystem == FILE_SYSTEM_FAT16)        || (__bFileSystem == FILE_SYSTEM_FAT32))    {        DWORD   dwOffset;        DWORD   dwBegin;        // Get background playback item range first        MM_GetRange(__MMBackgroundPlayingItem.wDirID, __wBGPlayItem, &dwBegin, &dwOffset);        // Don't reference __dwTimeBegin directly        // Since, it only for forground item.        //FAT_CheckUSBSecNum(&dwStart, &dwEnd, __dwTimeBegin, &dwOffset);        FAT_CheckUSBSecNum(&dwStart, &dwEnd, dwBegin, &dwOffset);        __SF_SourceGBL[BG_ITEM_STREAM_ID].dwBlockOffset = dwOffset;    }#endif  // #ifdef  SUPPORT_FAT_FILE_SYSTEM    // LLY1.05, do protection while parser start cmd fail    // ie. don't issue servo command continue.    __bTemp=PARSER_Command( BG_ITEM_STREAM_ID, PARSER_CMD_START, 0 );    if(__bTemp)    {        // Tell source filter the desired range and get it        __bTemp = SrcFilter_ReadSectors(BG_ITEM_STREAM_ID, dwStart, dwEnd);        if (__dwSFDirRead == TRUE)        {            __bMMAudioStreamPause = FALSE;            __bMMVideoStreamPause = TRUE;        }        else        {            __bMMAudioStreamPause = TRUE;            __bMMVideoStreamPause = FALSE;        }        return ( __bTemp );    }    else    {        return __bTemp;    }}// LLY0.80 create ...//  ********************************************************************************//  Function    :   UTL_MovieASTSetting

⌨️ 快捷键说明

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