[Xbyamp-cvs] xbmp/player AsyncDirectSound.cpp,1.2,1.3 buildtime.h,1.5,1.6 MoviePlayer.cpp,1.14,1.15
Status: Pre-Alpha
Brought to you by:
yamp
Update of /cvsroot/xbyamp/xbmp/player In directory sc8-pr-cvs1:/tmp/cvs-serv26514/player Modified Files: AsyncDirectSound.cpp buildtime.h MoviePlayer.cpp MoviePlayer.h XBoxMediaPlayer.cpp XBoxMediaPlayer.h XBMediaPlayer.plg Log Message: no message Index: AsyncDirectSound.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/AsyncDirectSound.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AsyncDirectSound.cpp 30 Nov 2002 16:02:14 -0000 1.2 --- AsyncDirectSound.cpp 4 Dec 2002 20:57:37 -0000 1.3 *************** *** 45,48 **** --- 45,50 ---- #define VOLUME_MAX DSBVOLUME_MAX + static DWORD dwDonePkts=0; + static DWORD dwSendPkts=0; void CALLBACK CASyncDirectSound::StaticStreamCallback(LPVOID pStreamContext, LPVOID pPacketContext, DWORD dwStatus) { *************** *** 54,57 **** --- 56,60 ---- void CASyncDirectSound::StreamCallback(LPVOID pPacketContext, DWORD dwStatus) { + dwDonePkts++; if (m_iCalcDelay==1) { *************** *** 82,86 **** ZeroMemory(&m_wfx,sizeof(m_wfx)); ! // request a 16-bit stereo primary sound buffer with 22 KHz sampling rate m_wfx.wFormatTag = WAVE_FORMAT_PCM; m_wfx.nChannels = iChannels; --- 85,89 ---- ZeroMemory(&m_wfx,sizeof(m_wfx)); ! // request a 16-bit stereo primary sound buffer with 22 KHz sampling rate m_wfx.wFormatTag = WAVE_FORMAT_PCM; m_wfx.nChannels = iChannels; *************** *** 329,333 **** m_pDSound->GetTime(&m_startTime); } ! m_pStream->Process( &xmpAudio, NULL ); //mp_msg(0,0,"audio decoder process done"); iBytesCopied+=iSize; --- 332,342 ---- m_pDSound->GetTime(&m_startTime); } ! ! ! if (DS_OK != m_pStream->Process( &xmpAudio, NULL )) ! { ! return iBytesCopied; ! } ! dwSendPkts++; //mp_msg(0,0,"audio decoder process done"); iBytesCopied+=iSize; Index: buildtime.h =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/buildtime.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** buildtime.h 3 Dec 2002 17:47:05 -0000 1.5 --- buildtime.h 4 Dec 2002 20:57:40 -0000 1.6 *************** *** 1,4 **** #ifndef BUILD_TIME_H #define BUILD_TIME_H ! #define BUILD_TIME L"build:3-dec-2002 17:45" #endif --- 1,4 ---- #ifndef BUILD_TIME_H #define BUILD_TIME_H ! #define BUILD_TIME L"build:4-dec-2002 21:00" #endif Index: MoviePlayer.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/MoviePlayer.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MoviePlayer.cpp 3 Dec 2002 17:47:05 -0000 1.14 --- MoviePlayer.cpp 4 Dec 2002 20:57:42 -0000 1.15 *************** *** 8,16 **** // - iso9660 // - shoutcast - // - duo's core - // - duo's HW ac3 decoder - // - .m3u // - select audio stream ! // - after a few files i can not play any file anymore??? // // --- 8,13 ---- // - iso9660 // - shoutcast // - select audio stream ! // - // // *************** *** 21,24 **** --- 18,57 ---- // - 15min shutdown on non-debug systems // + // + // softsleep + // -softsleep + // Uses high quality software timers. + // As precise as the RTC without requiring special privileges. + // Comes at the price of higher CPU consumption. + // + // autosync -autosync <factor> (buggy audio drivers) + // Gradually adjusts the A/V sync based on audio delay measurements. + // Specifying '-autosync' 0, the default, will cause frame timing to be based + // entirely on audio delay measurements. + // Specifying '-autosync' 1 will do the same, but will subtly change the A/V + // correction algorithm used. + // An uneven video frame rate in a movie which plays fine with '-nosound can + // often be helped by setting this to an integer value greater than 1. + // The higher the value, the closer the timing will be to -nosound. + // Try '-autosync' 30 to smooth out problems with sound drivers which do + // not implement a perfect audio delay measurement. + // With this value, if large A/V sync offsets occur, they will only take about + // 1 or 2' seconds to settle out. + // This delay in reaction time to sudden A/V offsets should be the only + // side-effect of turning this option on, for all sound drivers. + // + // pts_from_bps -bps / -nobps + // -nobps (.AVI only) + // Do not use average byte/sec value for A/V sync (AVI). + // Helps with some AVI files with broken header. + // + // frame_dropping + // -framedrop (also see -hardframedrop) + // Skips displaying some frames to maintain A/V sync on slow systems. + // Decoding of B frames is also skipped and video filters are not used. + // + // -mc <seconds/frame> + // Maximum A-V sync correction per frame (in seconds). + // ////////////////////////////////////////////////////////////////////// *************** *** 72,76 **** int stream_cache_size=16384; float font_factor=0.75; ! #ifdef __cplusplus } --- 105,109 ---- int stream_cache_size=16384; float font_factor=0.75; ! extern int pts_from_bps; #ifdef __cplusplus } *************** *** 132,139 **** osd_visible=100; delay_corrected=1; ! softsleep=1; step_sec=0; max_framesize=0; ! frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode audio_time_usage=0; total_time_usage_start=0; --- 165,172 ---- osd_visible=100; delay_corrected=1; ! softsleep=0; step_sec=0; max_framesize=0; ! frame_dropping=1; // option 0=no drop 1= drop vo 2= drop decode audio_time_usage=0; total_time_usage_start=0; *************** *** 143,147 **** // movie info: eof=0; ! autosync=1; // 30 might be a good default value. stream=NULL; demuxer=NULL; --- 176,180 ---- // movie info: eof=0; ! autosync=0; // 30 might be a good default value. stream=NULL; demuxer=NULL; *************** *** 293,297 **** if ( XC_AUDIO_FLAGS_ENCODED( dwSpeakerConfig ) & XC_AUDIO_FLAGS_ENABLE_DTS ) { ! mp_msg(0,0,"DTS output (4 channels)"); audio_output_channels=4; } --- 326,330 ---- if ( XC_AUDIO_FLAGS_ENCODED( dwSpeakerConfig ) & XC_AUDIO_FLAGS_ENABLE_DTS ) { ! mp_msg(0,0,"DTS output (5.1 channels)"); audio_output_channels=4; } *************** *** 299,304 **** if ( XC_AUDIO_FLAGS_ENCODED( dwSpeakerConfig ) & XC_AUDIO_FLAGS_ENABLE_AC3 ) { ! mp_msg(0,0,"ac3 output (6 channels)"); ! audio_output_channels=6; } --- 332,337 ---- if ( XC_AUDIO_FLAGS_ENCODED( dwSpeakerConfig ) & XC_AUDIO_FLAGS_ENABLE_AC3 ) { ! mp_msg(0,0,"ac3 output (5 channels)"); ! audio_output_channels=4; } *************** *** 309,312 **** --- 342,348 ---- bool CMoviePlayer::OpenFile(const string &strFileName) { + + pts_from_bps=0; + m_fAVDelay=0; strHostName=""; strProtocol=""; *************** *** 353,360 **** osd_visible=100; delay_corrected=1; ! softsleep=1; step_sec=0; max_framesize=0; ! frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode audio_time_usage=0; total_time_usage_start=0; --- 389,396 ---- osd_visible=100; delay_corrected=1; ! softsleep=0; step_sec=0; max_framesize=0; ! frame_dropping=1; // option 0=no drop 1= drop vo 2= drop decode audio_time_usage=0; total_time_usage_start=0; *************** *** 364,368 **** // movie info: eof=0; ! autosync=1; // 30 might be a good default value. stream=NULL; demuxer=NULL; --- 400,404 ---- // movie info: eof=0; ! autosync=0; // 30 might be a good default value. stream=NULL; demuxer=NULL; *************** *** 436,439 **** --- 472,477 ---- bool CMoviePlayer::OpenCodecs() { + + pts_from_bps=0; mp_msg(0,0,"open codecs\n"); if(sh_video) *************** *** 636,640 **** total_frame_cnt=0; drop_frame_cnt=0; // fix for multifile fps benchmark ! pts_from_bps=0; mp_msg(0,0,"codecs opened\n"); if (sh_video) --- 674,678 ---- total_frame_cnt=0; drop_frame_cnt=0; // fix for multifile fps benchmark ! //pts_from_bps=0; mp_msg(0,0,"codecs opened\n"); if (sh_video) *************** *** 679,682 **** --- 717,721 ---- bool CMoviePlayer::DoProcess() { + pts_from_bps=0; DirectSoundDoWork(); if (m_bPaused) return true; *************** *** 1013,1017 **** if (timeGetTime()-dwTime > 1000) { ! mp_msg(MSGT_AVSYNC,MSGL_DBG2,"### A:%8.3f (%8.3f) V:%8.3f A-V:%7.4f %i ",a_pts,a_pts-audio_delay-delay,v_pts,(a_pts-delay-audio_delay)-v_pts,m_timer); dwTime =timeGetTime(); } --- 1052,1057 ---- if (timeGetTime()-dwTime > 1000) { ! m_fAVDelay=(a_pts-delay-audio_delay)-v_pts; ! mp_msg(MSGT_AVSYNC,MSGL_DBG2,"### A:%8.3f (%8.3f) V:%8.3f A-V:%7.4f %i ",a_pts,a_pts-audio_delay-delay,v_pts,(a_pts-delay-audio_delay)-v_pts,pts_from_bps); dwTime =timeGetTime(); } *************** *** 1386,1388 **** --- 1426,1434 ---- if ( NULL==demuxer->a_streams[iStream]) return false; return true; + } + + float CMoviePlayer::GetAVDelay() + { + return m_fAVDelay; + } Index: MoviePlayer.h =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/MoviePlayer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MoviePlayer.h 3 Dec 2002 17:47:05 -0000 1.4 --- MoviePlayer.h 4 Dec 2002 20:57:47 -0000 1.5 *************** *** 68,71 **** --- 68,72 ---- { public: + float GetAVDelay(); bool HasAudioStream(int iStream); void SelectAudioStream(int iStream); *************** *** 168,171 **** --- 169,173 ---- int output_quality; private: + float m_fAVDelay; string m_strSubtitleName; }; Index: XBoxMediaPlayer.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/XBoxMediaPlayer.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** XBoxMediaPlayer.cpp 3 Dec 2002 17:47:05 -0000 1.12 --- XBoxMediaPlayer.cpp 4 Dec 2002 20:57:49 -0000 1.13 *************** *** 96,100 **** { // Freesyle UI ! m_appState = IN_HOME; m_appPreviousState = IN_HOME; --- 96,100 ---- { // Freesyle UI ! m_bShowDelay=false; m_appState = IN_HOME; m_appPreviousState = IN_HOME; *************** *** 418,422 **** // Create Settings User Interface ! m_pUserInterfaces[IN_SETTINGS] = new CSettingsInterface( m_pMediaPlayer ); if( FAILED( m_pUserInterfaces[IN_SETTINGS]->Create( m_pd3dDevice, &m_fntManager, this) ) ) { --- 418,422 ---- // Create Settings User Interface ! m_pUserInterfaces[IN_SETTINGS] = new CSettingsInterface( ); if( FAILED( m_pUserInterfaces[IN_SETTINGS]->Create( m_pd3dDevice, &m_fntManager, this) ) ) { *************** *** 794,797 **** --- 794,801 ---- } + if (pRemote->wPressedButtons) + { + m_bShowDelay=!m_bShowDelay; + } if (dwCurrentAppState == IN_MOVIE) *************** *** 915,918 **** --- 919,923 ---- } } + m_pUserInterfaces[m_appState]->FrameMove(pGamepad, pRemote, &dwCurrentAppState); *************** *** 1045,1048 **** --- 1050,1060 ---- m_dwShowFlags=0; } + if (m_bShowDelay) + { + WCHAR strOffset[30]; + swprintf(strOffset,L"AV sync %02.2f msec",m_pMediaPlayer->GetAVDelay()); + m_pfntCommon13->DrawText( 200, 40, 0xFFFFFFFF, strOffset); + } + if (!m_pMediaPlayer->IsPlaying()) { Index: XBoxMediaPlayer.h =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/XBoxMediaPlayer.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** XBoxMediaPlayer.h 2 Dec 2002 17:01:23 -0000 1.7 --- XBoxMediaPlayer.h 4 Dec 2002 20:57:52 -0000 1.8 *************** *** 71,74 **** --- 71,75 ---- #include "UI\PhotoInterface.h" #include "UI\SettingsInterface.h" + #include "xbox\mediaplayer.h" #define USER_INTERFACES 12 *************** *** 134,138 **** virtual void OnPlaybackComplete(); ! MediaPlayer* m_pMediaPlayer; protected: --- 135,139 ---- virtual void OnPlaybackComplete(); ! CMediaPlayer* m_pMediaPlayer; protected: *************** *** 143,146 **** --- 144,148 ---- BOOL m_bNetwork; private: + bool m_bShowDelay; int m_iFFSpeed; int m_iAVDelay; Index: XBMediaPlayer.plg =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/XBMediaPlayer.plg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** XBMediaPlayer.plg 3 Dec 2002 17:47:05 -0000 1.4 --- XBMediaPlayer.plg 4 Dec 2002 20:57:55 -0000 1.5 *************** *** 7,34 **** </h3> <h3>Command Lines</h3> ! Creating temporary file "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP339.tmp" with contents [ /nologo /MT /W3 /Gm /GX /Zi /Od /I "D:\Program Files\Microsoft Xbox SDK\samples\xbox\common\include" /I ".." /D "WIN32" /D "_XBOX" /D "NDEBUG" /D "_NETWORKDEBUG" /D "_XDK" /Fp"Release/XBMediaPlayer.pch" /YX /Fo"Release/" /Fd"Release/" /FD /Ztmp /G6 /c - "D:\xbmp2\xbmp\player\UI\AlbumInterface.cpp" - "D:\xbmp2\xbmp\player\UI\ArtistInterface.cpp" - "D:\xbmp2\xbmp\player\UI\AudioSettingsInterface.cpp" - "D:\xbmp2\xbmp\player\UI\CalibrateInterface.cpp" - "D:\xbmp2\xbmp\player\UI\CatalogueInterface.cpp" - "D:\xbmp2\xbmp\player\UI\ClipInterface.cpp" - "D:\xbmp2\xbmp\player\UI\GeneralSettingsInterface.cpp" "D:\xbmp2\xbmp\player\UI\HomeInterface.cpp" - "D:\xbmp2\xbmp\player\UI\MovieInterface.cpp" - "D:\xbmp2\xbmp\player\UI\PhotoInterface.cpp" - "D:\xbmp2\xbmp\player\UI\RatioInterface.cpp" - "D:\xbmp2\xbmp\player\UI\ScreenInterface.cpp" - "D:\xbmp2\xbmp\player\UI\SettingsInterface.cpp" - "D:\xbmp2\xbmp\player\UI\SongsInterface.cpp" - "D:\xbmp2\xbmp\player\UI\UMusic.cpp" - "D:\xbmp2\xbmp\player\UI\UPictures.cpp" - "D:\xbmp2\xbmp\player\UI\UVideos.cpp" - "D:\xbmp2\xbmp\player\XBoxMediaPlayer.cpp" ] ! Creating command line "cl.exe @D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP339.tmp" ! Creating temporary file "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP33A.tmp" with contents [ xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xboxkrnl.lib xonline.lib /nologo /incremental:no /pdb:"Release/XBMediaPlayer.pdb" /debug /machine:I386 /nodefaultlib:"libc" /out:"Release/XBMediaPlayer.exe" /subsystem:xbox /opt:ref /fixed:no /TMP --- 7,17 ---- </h3> <h3>Command Lines</h3> ! Creating temporary file "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP1C5.tmp" with contents [ /nologo /MT /W3 /Gm /GX /Zi /Od /I "D:\Program Files\Microsoft Xbox SDK\samples\xbox\common\include" /I ".." /D "WIN32" /D "_XBOX" /D "NDEBUG" /D "_NETWORKDEBUG" /D "_XDK" /Fp"Release/XBMediaPlayer.pch" /YX /Fo"Release/" /Fd"Release/" /FD /Ztmp /G6 /c "D:\xbmp2\xbmp\player\UI\HomeInterface.cpp" ] ! Creating command line "cl.exe @D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP1C5.tmp" ! Creating temporary file "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP1C6.tmp" with contents [ xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xboxkrnl.lib xonline.lib /nologo /incremental:no /pdb:"Release/XBMediaPlayer.pdb" /debug /machine:I386 /nodefaultlib:"libc" /out:"Release/XBMediaPlayer.exe" /subsystem:xbox /opt:ref /fixed:no /TMP *************** *** 118,152 **** .\Release\xbox_video.obj ] ! Creating command line "link.exe @D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP33A.tmp" Creating command line "imagebld.exe /nologo /testid:"0xFACE007" /testname:"Xbox Media Player" /stack:0x30000 /initflags:0x0 /out:"root\xbplayer.xbe" /limitmem /titleimage:"titleimage.xbx" /testmediatypes:0x80000007 .\Release\XBMediaPlayer.exe " <h3>Output Window</h3> Compiling... - AlbumInterface.cpp - SettingsInterface.cpp - Skipping... (no relevant changes detected) - ArtistInterface.cpp - AudioSettingsInterface.cpp - CalibrateInterface.cpp - CatalogueInterface.cpp - ClipInterface.cpp - GeneralSettingsInterface.cpp HomeInterface.cpp - MovieInterface.cpp - PhotoInterface.cpp - RatioInterface.cpp - ScreenInterface.cpp - SongsInterface.cpp - UMusic.cpp - UPictures.cpp - UVideos.cpp - XBoxMediaPlayer.cpp Linking... Creating Xbox image... IMAGEBLD : warning IM1029: library XONLINE is unapproved IMAGEBLD : warning IM1030: This image may not be accepted for certification ! Creating command line "xbecopy.exe /NOLOGO .\root\xbplayer.xbe "xe:\xbplayer\xbplayer.xbe"" ! Transferring file to Xbox...xe:\xbplayer\xbplayer.xbe ! <h3>Output Window</h3> ! Creating temporary file "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP33C.bat" with contents [ @echo off --- 101,114 ---- .\Release\xbox_video.obj ] ! Creating command line "link.exe @D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP1C6.tmp" Creating command line "imagebld.exe /nologo /testid:"0xFACE007" /testname:"Xbox Media Player" /stack:0x30000 /initflags:0x0 /out:"root\xbplayer.xbe" /limitmem /titleimage:"titleimage.xbx" /testmediatypes:0x80000007 .\Release\XBMediaPlayer.exe " <h3>Output Window</h3> Compiling... HomeInterface.cpp Linking... Creating Xbox image... IMAGEBLD : warning IM1029: library XONLINE is unapproved IMAGEBLD : warning IM1030: This image may not be accepted for certification ! Creating temporary file "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP1C8.bat" with contents [ @echo off *************** *** 155,159 **** rem del Root\xbplayer.bak ] ! Creating command line "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP33C.bat" Patching for retail XBox --- 117,121 ---- rem del Root\xbplayer.bak ] ! Creating command line "D:\DOCUME~1\erwin\LOCALS~1\Temp\RSP1C8.bat" Patching for retail XBox |