?? utl.c
字號:
_printf("\nDir: %hx, File: %x !\n", __bFMPlayingDir+1, nItem);
#endif
//Kevin1.22a, avoid _dwTimerCount_MainLoop being erroneously modified by somebody s.t.
// MONITOR_AudioStream() will never be called
// e.g. _dwTimerCount_MainLoop=0x172e9a (wrong) _dwCountSystem=0x12a209
// The below in cc.c will never hold:
// if ( (UTL_GetSysTimer () > _dwTimerCount_MainLoop) )
{
extern DWORD _dwTimerCount_MainLoop;
_dwTimerCount_MainLoop=0;
}
UTL_GetPlayRange ( nItem );
// Micky1.21, CodeReview --- remove
// wyc1.21
/*
if ( __bModeCmd == KEY_FF )
UTL_ChangeCDROMSpeed ( 2 );
*/
// DVD_170Micky, enhance MP3 display time method
// accumulate frames count.
_dwTotalFrameCount=0;
_dwPreFrameCount=0;
// must clear repeat AB status when change play item or stop
if (__bRepeatAB != REPEAT_NONE)
{
__bRepeatAB=REPEAT_NONE;
// this will clear the MSG_PLAYING
// if time is 0, the OSD won't be cleared!
OSD_OUTPUT_MACRO(MSG_REPEATAB, REPEAT_NONE, 1);
}
#ifndef NO_DVD // ** TCH0.373;
if ( __wDiscType & BOOK_DVD ) // ** TCH0.375; Modify it after release as it will cause strange status
{
// The player is wait-up from STOP mode. Force NV-State Machine enter a normal
NV_Action ( ACTION_PLAY, NULL );
}
#endif // NO_DVD
#ifndef SIMP_DVD
// ** TCH0.27; Set the inhibit value to force servo stop.
// Servo need to wake-up again when SERVO_ReadSectors/ SetSectors set again.
SERVO_SetSectors ( __dwTimeEnd+1, __dwTimeEnd );
#endif // SIMP_DVD
//DVD_043-1SEQUENCE
//update sequence header count
W99AV_WriteDRAMData(W99AV_DRAM_UPDATE_SEQ, W99AV_UPDATE_SEQUENCE_COUNT);
// LLY.275a begin ...
// Following procedure only need to done while play new item
// Not, pause --> play case
#ifdef _TIME_CIRCLE // TCC172r, __dwPreTimeCircle should be used only if defined _TIME_CIRCLE
__dwPreTimeCircle=__dwTimeBegin;
__bNormalCount=0;
#endif
//DVD_037RECOVER
{
__bRecoverStage=0;
}
// LLY.275a, clear FM_Trigger() relative info. before playing new item
__bFMStage=STAGE_PREPAREINFO;
// LLY.276-1, disable __btPlayEnd while playing a new item
// Otherwise,
__btPlayEnd=FALSE;
// LLY2.78b-2, clear this value while playing new item
// Otherwise, nobody to clear this value while CDDA title
// So, MONITOR module will set __btPlayEnd=TRUE
// Thus, if we play a small size JPG file, then push CDDA title
// it will cause CDDA title playing abnormal (playing a while then change track)
// wyc2.85, rename to __bJPGVar
__bJPGVar = NULL;
// Micky0.85, only PCM dsp codes contain the DTS/ PCM detection.
// must always load PCM codes-> detection DTS or PCM-> need re-load DTS codes for DTS
// from 085, UTL_SetPlayItemMode will reference __bCDDA_DTS before SteAudioType.
// this method will cause extra loading for CDDA-DTS title
// it will load PCM code-> detection-> then load back code.
// need consider more....
//Kevin0.85, reset __bCDDA_DTS while changing to another track. UTL_SetPlayItemMode() will reload PCM ucode, buffer, ...
// DSP will detect and/or set CD-DTS in UTL_GetCDDAFormat(UTL_GETCDDAFORMAT_RUNTIME);
// LJY1.10, don't set as unknow, so won't do track by track detection
// some CD-DST track may be detected error, cause noise.
// __bCDDA_DTS = CDDA_FORMAT_UNKNOWN;
}
// wyc1.24, because JPG picture will become scramble picture and continue decode & display without error message. So F/W can't detect
// this kind of error, so just doing one time H/W reset every 350 JPG slide to recover it if heppened.
if ((__wDiscType & CDROM_M1) && (__bAttrPlay == ATTR_JPG))
{
if (__wFMJPGPlayCount >= 350)
{
__bModePlay = MODE_PLAYUNKNOW;
__wFMJPGPlayCount = 0;
}
}
// *** MEM; Move to below UTL_GetPlayRange(); It may reset in UTL_GetPlayRange()
// Here is necessary for setting mode
// it'll set the nItem Playing mode
UTL_SetPlayItemMode ( nItem );
// *** MEM;
// wyc1.24, JPG don't need to initial here and will initial in other place.
if ( ! dwTime )
{
if (__bAttrPlayNew != ATTR_JPG)
__wMonitorLackIFD=0; // in isr.c
}
// LLY.161-2, detect CDDA format : pure/DTS CDDA
// while playing CDDA from track begin
// LLY.274p, checking CDDA playing mode method has changed
//if ( (__bModePlay&MODE_PLAYCDDA) && !dwTime )
// Micky1.24-3, fix CD/ JVC-CDDA power on resume don't work
// still don't lnow the real issue.
// if( (__bAttrPlay==ATTR_CDDA) && !dwTime )
if( (__bAttrPlay==ATTR_CDDA) && (!dwTime || __btNewTime))
{
// wyc.172-CDDA, when playing CDDA medley title we not execute CD-DTS title checking when across tracks.
#ifdef SUPPORT_PLAY_MEDLEYCDDA
//LJY1.23, use non-DTS instead of CDDA_PURE becasue CDG bitstream is no longer CDDA_BITSTREAM_PURE.
if ((__bCDDAAutoChTrk) && (!(__bCDDA_DTS & CDDA_BITSTREAM_DTS)))
{
// tell dsp start to decode pure CDDA,
W99AV_WriteDM (W99AV_DM_DECODE_PURECDDA, 1) ;
__bCDDAAutoChTrk = FALSE;
}
else
#endif // #ifdef SUPPORT_PLAY_MEDLEYCDDA
UTL_GetCDDAFormat(UTL_GETCDDAFORMAT_RUNTIME);
}
// wyc.170-2, execute the read Q-channel command to get the information for de-emphasis
#ifdef SUPPORT_AUDIO_DEEMPHASYS
// LLY.274p, checking playing mode method has updated
//if (__bModePlay&MODE_PLAYCDDA)
if(__bAttrPlay == ATTR_CDDA)
UTL_SetCDDADeEmphasis();
#endif // #ifdef SUPPORT_AUDIO_DEEMPHASYS
// DVD_171Micky, when pause-> play, do servo pre-seek
// fix pause-> servo stop running-> play, A/V play unsmooth
if (__btPause)
{
extern DWORD gdwNextLBA;
UTL_PreStartServo( gdwNextLBA);
}
if (!__btPlaying && (!__btPause || __btNewTime))
{
// must check W9922QF, how about A/V sync initial
// DVD_155Micky, use hal new define API
HAL_AVSync(HAL_AVSYNC_INITIAL, 0);
// f/w 0.32
// for run time detect audio frequency
// for different frequency MP3
if( ( __wDiscType & BOOK_SVCD ) || (__wDiscType & BOOK_M1) )
{
//012 W99AV_ClearInterrupt(INT_ECC);
HAL_Monitor( HAL_MONITOR_AUDIO_FREQ_PREPARE);
// LLY.101, assign the audio checking type as "CHECK_AUDIO_FREQ"
//__btCheckAudioType=TRUE;
__bCheckAudioType |= CHECK_AUDIO_FREQ;
//Kevin1.25, fix "SPDIF discont. while changing files" and "Freq wrong at file beginning"
#ifdef SUPPORT_WMA
if(__bAttrPlay==ATTR_WMA) //DSP sets DM[0xe9d]=1 (start decoding) after reset
W99AV_WriteDM(W99AV_DM_WMA_FREQ_READ_FLAG, 0); //Step 1: host tells DSP to wait for decoding only while changing files
#endif
if(__bAttrPlay==ATTR_MP3) //DSP sets DM[0x7d1]=1 (start decoding) after reset
W99AV_WriteDM(W99AV_DM_MP3_FREQ_READ_FLAG, 0); //Step 1: host tells DSP to wait for decoding only while changing files
}
else
{
// LLY.101, clear "CHECK_AUDIO_FREQ" part
//__btCheckAudioType=FALSE;
__bCheckAudioType &= ~CHECK_AUDIO_FREQ;
}
// do not reset data for auto play end
// test the ROCK tt7->8, auto playend under HOST I/F
// Micky1.21, CodeReview --- remove
// wyc1.21
/*
if (!__btPlayEnd)
{
SERVO_ResetData();
}
*/
}
if ( dwTime )
{
// must play from the specified time
__dwTimeNow= dwTime;
}
else
{
// f/w 0.45
// move this to UTL_PlayItem
// do this only dwTime==0
// or some information might be cleared when hang reset
// only send once for each play, but for same still, can't set again
if (!__btPause) // KEY_SCB to the begin in PBC mode, it's in PAUSE
{
// DVD_276Micky, bit reduce
/// BIT btTemp;
//DVD021, MICKY
// if ((__bModePlay==MODE_PLAYCDDA) || (__bModePlay==MODE_PLAYMOTION))
if (__bModePlay & MODE_STILL)
{
// DVD_276Micky, bit reduce
__btTemp=FALSE;
}
else
// play item is motion, panel must update mm:ss:ff
// DVD_276Micky, bit reduce
__btTemp=TRUE;
OSD_OUTPUT_MACRO ( MSG_MOTION, __btTemp, 0);
}
// LJY1.10, as don't do track by track detection, must play from begining.
/*
// must play from the play item beginning
// But, DTS-CD must not send from start -- TCC161
// LLY.274p, checking CDDA playing mode method has changed
//if( (__bModePlay&MODE_PLAYCDDA) && (__bCDDA_DTS & CDDA_BITSTREAM_DTS))
if( (__bAttrPlay==ATTR_CDDA) && (__bCDDA_DTS & CDDA_BITSTREAM_DTS))
;
else
*/
__dwTimeNow= __dwTimeBegin;
}
// The __dwTimeNow store the starting sector to play
// playing from the play item beginning
if ( ! __btPause )
{
// convert the command state(__bModeCmd) into MPEG command
UTL_TransferCommandID(__bModeCmd);
}
// Play MPEG data
// LLY.274p, checking CDDA playing mode method has changed
//if ( ! (__bModePlay & MODE_PLAYCDDA ) )
if( !(__bAttrPlay==ATTR_CDDA) )
{
// Micky1.37, (Pause)don't need to control gbServoRunning when ServoAutoCtrl = 1
// only CDIF need to close
// the method will cause freeze->pause->play hang.
if (__bServoAutoCtrl == FALSE) // Brian2.37a, keep this, otherwise Pause->Play will hang
{
HAL_ControlCDIF(HAL_CDIF_CLOSE);
}
// for auto pause re-entry
bEX1=EX1;
EX1=0;
// f/w 0.46
// must enable interrupt first
// or IFD may lost
if ( !dwTime )
{
// wyc1.24-2, make MODE_PLAYVIDEO & MODE_PLAYAUDIO don't initial __bFirstPlay because of not using it.
if ((__bModePlay != MODE_PLAYVIDEO) && (__bModePlay != MODE_PLAYAUDIO))
__bFirstPlay= 1;
{
W99AV_ClearInterrupt(INT_IFD);
__dwIER |=INT_IFD;
W99AV_EnableInterrupt(__dwIER);
EX1= 1;
}
}
// LLY2.78b-2, remove this setting while playing a new item
// Otherwise, nobody to clear this value while CDDA title
// So, MONITOR module will set __btPlayEnd=TRUE
// Thus, if we play a small size JPG file, then push CDDA title
// it will cause CDDA title playing abnormal (playing a while then change track)
// open CD-IF data, and check MSF match
if (__wDiscType & BOOK_DVD) // TCC278, for mini-DVD use UTL_PlayFromTime, not call it here.
__btTemp = TRUE ;
else
__btTemp= UTL_PlayFromTime ( __dwTimeNow );
// find MSF fail
if ( ! __btTemp )
{
//LJY2.37a, fix the antishock hang-up issue at the beginning of "純み賓VCD2.0" playback.
// not to open CDIF outright, let it be recovered by ASP recovery mechanism in MONITOR_CheckBUffer().
#ifdef SUPPORT_ANTISHOCK
__dwPrevTime = __dwTimeNow;
#else
// CD-ROM go to new time
//DVD_046-1DVDIF
SERVO_ReadSectors ( __dwTimeNow-5 , __dwTimeEnd);
// SERVO_ReadSectors ( __dwTimeNow- SERVO_LEADING , __dwTimeEnd);
// just open the data with out checking MSF
HAL_ControlCDIF(HAL_CDIF_OPEN);
#endif
}
// wyc1.10, remove the code of prefill JPG buffer because of not need it now.
/*
#ifdef SUPPORT_CDIF
// LLY2.78b-3, wait audio buffer to reach desired level for large size files
// or finish data sending for small size files
// Then, continue to go
// Otherwise, JPEG decoding may fail while do following things together
// [1] Sending data from CDIF & [2] Do "preset frame buffer command"
// wyc2.85, rename to __bJPGVar
__bJPGVar |= UTL_JPG_CONN_BITS;
if ( (__bCurrentIF == BITSTREAM_CDIF) && (__bAttrPlay == ATTR_JPG) && !__bThumbnailMode )
{
// wyc2.85, use buffer size to compute the value to decide small picture or big picture.
// wyc0.90, need to adjust the size, the followsize need to smaller than parameter in HAL_PreFillBuffer. Because if one picture send
// 45 sectors and we think it's completed but HAL_PreFillBuffer can't send it completed here. Then the remain data are all un-input.
if(__dwTimeEnd - __dwTimeBegin < (((__dwW99AVVBUFFSIZE-10000)/1000)*2)) // picture size is small
__bJPGVar |= UTL_JPG_SMALL_SIZE; // imply that desired sector has been sent once time
// Wait audio buffer to reach a level
// Then continue to go
// Notice: the desired threshold value must be
// > 90 sector * 2048 bytes = 46080 bytes, and
// < JPEG buffer size: 52K DW
// wyc2.85, use buffer size instead of real number.
HAL_PreFillBuffer(HAL_FILL_JPEG_BUFFER, __dwW99AVVBUFFSIZE-8000);
}
#endif // SUPPORT_CDIF
*/
__btPlaying= TRUE;
// do not send play command when freeze->pause->resume
// there's no Freeze command in chip
// freeze->pause->resume, must open audio output only
// other need send command for starting decoding
// Micky1.21, CodeReview --- modify
// - remove __btVideoFreeze, reference __bModeCmd/ bKeyPrevious=KEY_FREEZE directly
// Freeze pause-> play, the the freeze mode will be cleared
// Freeze pause-> freeze, will do at KEY_FREEZE, won't go this flow.
// if ( __btPause && !__btVideoFreeze)
if ( __btPause )
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -