📄 logo_select.c
字号:
#include "Basic_typedefs.h"
#include "S5h_capability.h"
#include "Sys_call_abstract.h"
#include "S5h_types.h"
#include "S5h_api.h"
#include "S5h_lowapi.h"
#include "S5l_memmap.h"
#include "vd.h"
#include "vutil.h"
#include "Viddec_api.h"
#if VIDEO_LOGO
BOOL bLogoMode = FALSE;
extern void CopyPM2( long *src_addr, long *dst_addr,unsigned int size);
extern BOOL bPreModeIsLogo;
extern UCHAR guc8FrameRateCode;
extern S5L_DisplayStdType_t gOutput_tv_system;
/*
* KBA #1706@2005# : If want to use another logo, uncomment the same !
* ---One at a time!
*/
#if LOGO_176X120
//#include "a176_logo_5K.h" /* NTSC */
// #include "a176_logo_6K.h" /* NTSC */
// #include "a176_logo_8k.h" /* NTSC */
#include "a176_logo_11K.h" /* NTSC */
#else /* !LOGO_176X120 */
#if (DOUBLE_LOGO_GPIO || DOUBLE_LOGO_IIC)//BY May 060412
#include "c1_11k.h" /* PAL */
#include "a1_a352_logo_5K.h" /* NTSC */
#include "Gpio_api.h"
//#include "..\..\Custom\include\Gpio_api.h"
#else
#include "c1_11k.h" /* PAL */
#endif
#if DOUBLE_LOGO_IIC//BY May 060417
#include "I2c_api.h"
#include "Vcd_def.h"
#endif
//#include "c1_11k.h" /* PAL */
// #include "ajsw_p_33k.h" /* PAL */
// #include "c1_n_9k.h" /* NTSC */
//#include "c2_10k.h" /* PAL */
// #include "a352_logo_5K.h" /* NTSC */
// #include "a352_logo_7K.h" /* NTSC */
// #include "a352_logo_10K.h" /* NTSC */
// #include "a352_logo_11K.h" /* NTSC */
// #include "a352_logo_16K.h" /* NTSC */
#endif /* !LOGO_176X120 */ /* NTSC */
VOID VD_PlayLogo ( VOID )
{
ULONG ulLogoAdd,
ulTempSize;
S5L_MemMap_t *pstMemMap;
#if DOUBLE_LOGO_GPIO //BY May 060412
unsigned char flag_logo;
SetInputModeGPIO_16();
flag_logo = GetPortGPIO_16();
#endif
#if DOUBLE_LOGO_IIC
unsigned char flag_logo;
UCHAR temp;
temp = SL9908_Load_LogoFlag();
if(temp == 0xab)
flag_logo = 0;
else if(temp == 0xba)
flag_logo = 1;
else
flag_logo = 1;
#endif
if ( bLogoMode == FALSE )
{
bLogoMode = TRUE;
bPreModeIsLogo = TRUE;
MIX_SetBgColor ( MIXER_LOGO_BACKGROUND_COLOR );
#if MOVE_LOGO_TO_CODE
#if (DOUBLE_LOGO_GPIO || DOUBLE_LOGO_IIC)//BY May 060412
if(flag_logo)
ulLogoAdd = (ULONG)&a_logo[0];
else
ulLogoAdd = (ULONG)&a1_logo[0];
#else
ulLogoAdd = (ULONG)&a_logo[0];
#endif
/* For Align ! */
if ( ulLogoAdd & 0xF )
ulLogoAdd -= ( ulLogoAdd & 0xF );
pstMemMap = S5L_GetMemoryInfo ( MM_VIDEO_BUF );
#if (DOUBLE_LOGO_GPIO || DOUBLE_LOGO_IIC)//BY May 060412
if(flag_logo)
ulTempSize = sizeof ( a_logo )+32;
else
ulTempSize = sizeof ( a1_logo )+32;
#else
ulTempSize = sizeof ( a_logo )+32;
#endif
#if 0
DMA_COPY ( pstMemMap->ul32StartAdd, ulLogoAdd, (ulTempSize>>2) );
#else
// modify kang kee jin
CopyPM2( (long *)ulLogoAdd, (long *)MM_VIDEO_BUFF_CALM_VIEW, (ulTempSize>>1));
#endif
#if 0
IO_WData32_EX ( (unsigned char *)&rPTR0_B2R_CTRL_H, 0x0000, 0x003f0 );
IO_WData32_EX ( (unsigned char *)&rPTR1_B2R_CTRL_H, 0x0000, 0x003f0 );
IO_WData32_EX ( (unsigned char *)&rPTR2_B2R_CTRL_H, 0x0000, 0x003f0 );
#endif
if ( PlayMem ( pstMemMap->ul32StartAdd, ulTempSize ) != TRUE )
{
#if VD_DEBUG_PRINT
SysPrintf ( "Failed to play the Logo\n" );
#endif
bLogoMode = FALSE;
}
#else /* !MOVE_LOGO_TO_CODE */
#if (DOUBLE_LOGO_GPIO || DOUBLE_LOGO_IIC)//BY May 060412
if(flag_logo)
ulLogoAdd = (ULONG)&a_logo[0];
else
ulLogoAdd = (ULONG)&a1_logo[0];
#else
ulLogoAdd = (ULONG)&a_logo[0];
#endif
ulLogoAdd+= 0x8000000;
#if (DOUBLE_LOGO_GPIO || DOUBLE_LOGO_IIC)//BY May 060412
if(flag_logo)
if ( PlayMem ( ulLogoAdd, sizeof ( a_logo ) ) != TRUE )
else
if ( PlayMem ( ulLogoAdd, sizeof ( a1_logo ) ) != TRUE )
#else
if ( PlayMem ( ulLogoAdd, sizeof ( a_logo ) ) != TRUE )
#endif
{
#if VD_DEBUG_PRINT
SysPrintf ( "Failed to play the Logo\n" );
#endif
bLogoMode = FALSE;
}
#endif /* !MOVE_LOGO_TO_CODE */
}
}
VOID VD_ClearLogoState ( VOID )
{
if ( bLogoMode )
{
/* Force change in the next decode command */
guc8FrameRateCode = 0;
bLogoMode = FALSE;
}
}
BOOL PlayMem ( ULONG ulAddr, ULONG ulSize )
{
ULONG ulTR6, ulTR0, ui16LocVertSize;
UINT8 ui8LocFrameRate;
UINT uiTimeOut;
S5L_MemMap_t *pstMemMap;
FieldRateConv_t enFieldRate;
MIX_SetVideoEn ( FALSE );
if ( ulAddr == 0 || ulSize == 0 )
return FALSE;
VD_SET_CMD((unsigned long)VD_FLUSH_BUF);
/* Set the Input ptrs for the VD */
VD_IN_BUF_PTR ( (ULONG)ulAddr );
VD_IN_BUF_STOP ( (ULONG)(ulAddr + ulSize + 128 ) );
pstMemMap = S5L_GetMemoryInfo ( MM_FRAME_BUF );
if ( pstMemMap == 0 )
return FALSE;
Y0_PTRTo_CHANGE ( (unsigned long)pstMemMap->ul32StartAdd );
Y0_PTRTe_CHANGE ( (unsigned long)(pstMemMap->ul32StartAdd + 101376 ) );
VP_SET_CUR_PTR0 ( (ULONG)pstMemMap->ul32StartAdd );
VP_SET_CUR_PTR1 ( (ULONG)(pstMemMap->ul32StartAdd + 101376 ) );
VD_SET_CMD ( (unsigned long)VD_DATA_AVAIL );
VD_SET_CMD ((unsigned long)VD_PARSE_STREAM );
uiTimeOut = 0;
while ( 1 )
{
SysSleep ( 5 );
uiTimeOut++;
ulTR6 = IO_RData32_EX ( (unsigned char *)&rVD_TR6_H );
if ( ( (unsigned long)(ulTR6 & 0x00007000)>>12) == PICTURE_TYPE_I || uiTimeOut >= 10 )
{
#if VD_DEBUG_PRINT
SysPrintf ( "I Frame !!!\n" );
#endif
break;
}
}
if ( uiTimeOut >= 10 )
{
#if VD_DEBUG_PRINT
SysPrintf ( "Failed to Play !!!\n" );
#endif
return FALSE;
}
else
{
ulTR0 = IO_RData32_EX ( (unsigned char *)&rVD_TR0_H );
ui16LocVertSize = (UINT16)( ( ulTR0 >> 16 ) & 0x00000FFF );
if ( gOutput_tv_system == DISPLAY_NTSC_M )
{
#if LOGO_176X120
VP_SetStdMode ( VP_MODE_LOGO_NTSC, 1 );
#else
VP_SetStdMode ( ( ( ui16LocVertSize == 240 ) ? VP_MODE_NTSC : VP_MODE_PAL_TO_NTSC ), 1 );
#endif
MIX_SetMode ( MIX_NTSC );
}
else
{
#if LOGO_176X120
VP_SetStdMode ( VP_MODE_LOGO_PAL, 1 );
#else
VP_SetStdMode ( ( ( ui16LocVertSize == 288 ) ? VP_MODE_PAL: VP_MODE_NTSC_TO_PAL ), 1 );
#endif
MIX_SetMode ( MIX_PAL );
}
}
VD_SET_CMD ((unsigned long)VD_DEC_PIC );
/* SD */
SD_SetOnOff ( SD_ON );
return TRUE;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -