|
List Info
Thread: CR: Fix crash in vidsite...
|
|
| CR: Fix crash in vidsite... |
  United States |
2007-05-09 13:29:00 |
Synopsis
========
This change fixes several bugs filed against the site on
Cayenne as used by the windows player. The internal bug
numbers are:
193461 HTR: Crash in vidsite.dll trying to.....
193913 HTR: Crash in vidsite.dll after adding....
193949 Deaddlock playing remote SMIL with RV content
193976 HTR player crash after loading and playing....
194427 crash after.....
Each bug above seemed to die with a different stack trace.
I
believe however that they are all related. What was
happening
was that we had some timing issue going on where the
renderers
were actually blt'ing frames before the site got its first
WM_PAINT message. When the site gets its first WM_PAINT
message
it checks the resolution and bit depth of the screen to see
if
we need to re-create the DirectX surfaces. The problem comes
in
when a renderer is trying to use the site in one thread
while
we are tearing down and rebuilding the surfaces. This
results
in random crashes. Here is one such stack trace of a crash:
Thread 1:
I420toRGB32_DBLROW2X_FAST_STRETCH2XPLUS()
IMAGE_STRETCH2XPLUS()
YUVtoRGB2(dest_format, ...)
I420toRGB32(dest_ptr, dest....)
ColorFuncAccess::ColorConvert(cidOut, dest_ptr...)
CBaseRootSurface::MinimalBlt(pImageData,
pBitmapInfo,....)
CBaseRootSurface::Blt(pImageData, pBitmapInfo,...)
CBaseSurface::Blt(pImageData, pBitmapInfo, rDestRect,
rSrcRect)
CWinSurface2::Blt(pImageData, pBitmapInfo, rDestRect,
rSrcRect)
CBaseSurface::OptimizedBlt(pImageBits, rDestRect,
rSrcRect)
CVideoRenderer::UpdateVideoSurface(pVideoSurface, ...)
CVideoRenderer::UpdateDisplay(pEvent, bSystemEvent,
bIsVisible)
CVideoRenderer::HandleEvent(pEvent)
CHXMultiInstanceSiteUser::HandleEvent(pEvent)
CHXSiteUserProxy::HandleEvent(pEvent)
CHXBaseSite::ForceRedraw()
CHXMultiInstanceSiteUserSupplier::ForceRedraw()
CVideoRenderer::ForceRefresh()
CVideoRenderer::SchedulerCallback(bIsScheduled,
bResched,....)
CVideoRenderer::BltIfNeeded()
CVideoFormat: ecodeFra
me(ulMaxExtraFrames)
CVideoRenderer::OnPace(ulId)
CVideoPaceMaker::ThreadRoutine(pArg)
HXWinThread::HXWinThreadStartRoutine(p)
_threadstartex(ptd)
7c80b683
Thread 2:
WinDraw2_IsDDAvailable(lpwd)
CWinBaseRootSurface::_IsHardwareAccelerationAvail()
CWinBaseRootSurface::_CreateCompositionSurface()
CBaseRootSurface::ReInitSurfaces()
CHXBaseSite::ReInitSurfaces()
CHXBaseSite::ChangeResolution()
CHXBaseSite::CheckDisplayMode(hdc)
CHXWinSite::HandleWndProc(hWnd, message, wParam, lParam,
lResult)
HXxWinHookSiteProc(hWnd, message, uParam, lParam)
77d48734
77d48816
77d4b4c0
77d4b50c
7c90eae3
77d494d2
77d4b530
77d496c7
CRCAEventLoopWin: oStep(th
isRunCount, bHandleQuitMsg)
CRCAEventLoopWin::Run()
CRPApp::RunRPApp()
WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
WinMainCRTStartup()
7c816fd7
Fix
===
The fix is simply to call CheckDisplayMode(NULL) earlier
then the first
WM_PAINT message. I ended up doing this in
BeginOptimizedBlt(). Each
renderer that will use the video surface will call this
method before
doing so. This fixes the problem by initialing the values
CheckDisplayMode() uses to decide if it will re-init the
surfaces:
_GetDeviceCaps(hdc, newBitsPerPixel, newHozRes,
newVertRes);
if (m_nOldBitsPerPixel != newBitsPerPixel ||
newHozRes != m_nOldHorzRes || newVertRes != m_nOldVertRes)
{
m_nOldBitsPerPixel = newBitsPerPixel;
m_nOldHorzRes = newHozRes;
m_nOldVertRes = newVertRes;
ChangeResolution();
}
I also cleaned up a couple casting warnings....
Files Modified
==============
video/sitelib/basesurf.cpp
Branch(s)
=========
HEAD, 150Cay, 204Cay.
Platforms and Profiles Functionality verified
=============================================
windows/all-defines. Linux all defines.
QA Instructions
===============
I tested this on linux and windows. However, this CR does
change when surfaces are created (root's composition
surface). So, testing on the Mac is needed. I don't see
any problems but we should make sure.
--greg.
Index: basesurf.cpp
============================================================
=======
RCS file: /cvsroot/video/sitelib/basesurf.cpp,v
retrieving revision 1.18.4.7
diff -u -w -r1.18.4.7 basesurf.cpp
--- basesurf.cpp 24 Jan 2007 19:20:29 -0000
1.18.4.7
+++ basesurf.cpp 9 May 2007 18:18:35 -0000
 -203,7
+203,7 
IHXPreferences* pPreferences = NULL;
IHXBuffer* pBuffer = NULL;
- HXFLOAT fTmp = m_fScrollBarZoom;
+ HXFLOAT fTmp =
(float)m_fScrollBarZoom;
HXBOOL bYUY2First = FALSE;
ReadPrefBOOL(m_pContext,
"AllowOverlayShrinking", m_bAllowOverlayShrinking
);
 -218,7
+218,7 
m_pyuvInputMngr->SetOutputPriority(CID_I420, list, 4);
}
ReadPrefFLOAT(m_pContext, "SiteZoomFactor",
fTmp );
- m_fScrollBarZoom = fTmp;
+ m_fScrollBarZoom = (double)fTmp;
m_pContext->QueryInterface(IID_IHXOverlayManager,
(void**)&m_pOverlayManager);
 -3991,6
+3991,7 
return HXR_FAIL;
}
+
// Are the new parameters the same as the old
paramaters? If not
// then delete the old surfaces.
if (m_pOptimizedFormat && pBitmapInfo)
 -4007,6
+4008,12 
m_pSite->_TLSLock();
+ //XXXgfw fixes several bugs. For one such bug and a
full
+ //description of why we need to check this here see
internal
+ //bug number 193976 or the commit mail for this
change.
+
m_pSite->m_pTopLevelSite->CheckDisplayMode(NULL);
HX_DELETE(m_pOptimizedFormat);
m_pOptimizedFormat = new HXBitmapInfoHeader;
_______________________________________________
Video-dev mailing list
Video-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev
|
|
| RE: CR: Fix crash in vidsite... |
  United States |
2007-05-09 15:54:18 |
Looks good.
=============================================
Eric Hyche (ehyche real.com)
Technical Lead
RealNetworks, Inc.
> -----Original Message-----
> From: video-dev-bounces helixcommunity.org
> [mailto:video-dev-bounces helixcommunity.org] On
Behalf Of Greg Wright
> Sent: Wednesday, May 09, 2007 2:29 PM
> To: video-dev
> Subject: [Video-dev] CR: Fix crash in vidsite...
>
> Synopsis
> ========
>
> This change fixes several bugs filed against the site
on
> Cayenne as used by the windows player. The internal
bug
> numbers are:
>
> 193461 HTR: Crash in vidsite.dll trying to.....
> 193913 HTR: Crash in vidsite.dll after adding....
> 193949 Deaddlock playing remote SMIL with RV content
> 193976 HTR player crash after loading and playing....
> 194427 crash after.....
>
>
> Each bug above seemed to die with a different stack
trace. I
> believe however that they are all related. What was
happening
> was that we had some timing issue going on where the
renderers
> were actually blt'ing frames before the site got its
first
> WM_PAINT message. When the site gets its first WM_PAINT
message
> it checks the resolution and bit depth of the screen to
see if
> we need to re-create the DirectX surfaces. The problem
comes in
> when a renderer is trying to use the site in one thread
while
> we are tearing down and rebuilding the surfaces. This
results
> in random crashes. Here is one such stack trace of a
crash:
>
>
> Thread 1:
>
> I420toRGB32_DBLROW2X_FAST_STRETCH2XPLUS()
> IMAGE_STRETCH2XPLUS()
> YUVtoRGB2(dest_format, ...)
> I420toRGB32(dest_ptr, dest....)
> ColorFuncAccess::ColorConvert(cidOut, dest_ptr...)
> CBaseRootSurface::MinimalBlt(pImageData,
pBitmapInfo,....)
> CBaseRootSurface::Blt(pImageData, pBitmapInfo,...)
> CBaseSurface::Blt(pImageData, pBitmapInfo,
rDestRect, rSrcRect)
> CWinSurface2::Blt(pImageData, pBitmapInfo,
rDestRect, rSrcRect)
> CBaseSurface::OptimizedBlt(pImageBits, rDestRect,
rSrcRect)
> CVideoRenderer::UpdateVideoSurface(pVideoSurface,
...)
> CVideoRenderer::UpdateDisplay(pEvent, bSystemEvent,
bIsVisible)
> CVideoRenderer::HandleEvent(pEvent)
> CHXMultiInstanceSiteUser::HandleEvent(pEvent)
> CHXSiteUserProxy::HandleEvent(pEvent)
> CHXBaseSite::ForceRedraw()
> CHXMultiInstanceSiteUserSupplier::ForceRedraw()
> CVideoRenderer::ForceRefresh()
> CVideoRenderer::SchedulerCallback(bIsScheduled,
bResched,....)
> CVideoRenderer::BltIfNeeded()
> CVideoFormat: ecodeFra
me(ulMaxExtraFrames)
> CVideoRenderer::OnPace(ulId)
> CVideoPaceMaker::ThreadRoutine(pArg)
> HXWinThread::HXWinThreadStartRoutine(p)
> _threadstartex(ptd)
> 7c80b683
>
> Thread 2:
>
> WinDraw2_IsDDAvailable(lpwd)
> CWinBaseRootSurface::_IsHardwareAccelerationAvail()
> CWinBaseRootSurface::_CreateCompositionSurface()
> CBaseRootSurface::ReInitSurfaces()
> CHXBaseSite::ReInitSurfaces()
> CHXBaseSite::ChangeResolution()
> CHXBaseSite::CheckDisplayMode(hdc)
> CHXWinSite::HandleWndProc(hWnd, message, wParam,
> lParam, lResult)
> HXxWinHookSiteProc(hWnd, message, uParam, lParam)
> 77d48734
> 77d48816
> 77d4b4c0
> 77d4b50c
> 7c90eae3
> 77d494d2
> 77d4b530
> 77d496c7
> CRCAEventLoopWin: oStep(th
isRunCount, bHandleQuitMsg)
> CRCAEventLoopWin::Run()
> CRPApp::RunRPApp()
> WinMain(hInstance, hPrevInstance, lpCmdLine,
nCmdShow)
> WinMainCRTStartup()
> 7c816fd7
>
> Fix
> ===
>
> The fix is simply to call CheckDisplayMode(NULL)
earlier then
> the first
> WM_PAINT message. I ended up doing this in
BeginOptimizedBlt(). Each
> renderer that will use the video surface will call this
method before
> doing so. This fixes the problem by initialing the
values
> CheckDisplayMode() uses to decide if it will re-init
the surfaces:
>
> _GetDeviceCaps(hdc, newBitsPerPixel,
newHozRes,
> newVertRes);
>
> if (m_nOldBitsPerPixel != newBitsPerPixel
||
> newHozRes != m_nOldHorzRes || newVertRes !=
m_nOldVertRes)
> {
> m_nOldBitsPerPixel =
newBitsPerPixel;
> m_nOldHorzRes = newHozRes;
> m_nOldVertRes = newVertRes;
> ChangeResolution();
> }
>
>
> I also cleaned up a couple casting warnings....
>
> Files Modified
> ==============
> video/sitelib/basesurf.cpp
>
> Branch(s)
> =========
> HEAD, 150Cay, 204Cay.
>
>
> Platforms and Profiles Functionality verified
> =============================================
> windows/all-defines. Linux all defines.
>
> QA Instructions
> ===============
> I tested this on linux and windows. However, this CR
does
> change when surfaces are created (root's composition
> surface). So, testing on the Mac is needed. I don't
see
> any problems but we should make sure.
>
>
> --greg.
>
>
> Index: basesurf.cpp
>
============================================================
=======
> RCS file: /cvsroot/video/sitelib/basesurf.cpp,v
> retrieving revision 1.18.4.7
> diff -u -w -r1.18.4.7 basesurf.cpp
> --- basesurf.cpp 24 Jan 2007 19:20:29 -0000
1.18.4.7
> +++ basesurf.cpp 9 May 2007 18:18:35 -0000
>  -203,7 +203,7 
>
> IHXPreferences* pPreferences = NULL;
> IHXBuffer* pBuffer = NULL;
> - HXFLOAT fTmp = m_fScrollBarZoom;
> + HXFLOAT fTmp =
(float)m_fScrollBarZoom;
> HXBOOL bYUY2First = FALSE;
>
> ReadPrefBOOL(m_pContext,
"AllowOverlayShrinking",
> m_bAllowOverlayShrinking );
>  -218,7 +218,7 
>
> m_pyuvInputMngr->SetOutputPriority(CID_I420, list,
4);
> }
> ReadPrefFLOAT(m_pContext,
"SiteZoomFactor", fTmp );
> - m_fScrollBarZoom = fTmp;
> + m_fScrollBarZoom = (double)fTmp;
>
>
m_pContext->QueryInterface(IID_IHXOverlayManager,
> (void**)&m_pOverlayManager);
>
>  -3991,6 +3991,7 
> return HXR_FAIL;
> }
>
> +
> // Are the new parameters the same as the old
paramaters? If not
> // then delete the old surfaces.
> if (m_pOptimizedFormat && pBitmapInfo)
>  -4007,6 +4008,12 
>
> m_pSite->_TLSLock();
>
> + //XXXgfw fixes several bugs. For one such bug and
a full
> + //description of why we need to check this here
see internal
> + //bug number 193976 or the commit mail for this
change.
> +
m_pSite->m_pTopLevelSite->CheckDisplayMode(NULL);
>
> HX_DELETE(m_pOptimizedFormat);
> m_pOptimizedFormat = new HXBitmapInfoHeader;
>
> _______________________________________________
> Video-dev mailing list
> Video-dev helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/video
-dev
>
_______________________________________________
Video-dev mailing list
Video-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev
|
|
| Re: CR: Fix crash in vidsite... |
  United States |
2007-05-09 16:14:41 |
This is now checked into HEAD, 150Cay and 204Cay.
--greg.
Eric Hyche wrote:
> Looks good.
>
> =============================================
> Eric Hyche (ehyche real.com)
> Technical Lead
> RealNetworks, Inc.
>
>> -----Original Message-----
>> From: video-dev-bounces helixcommunity.org
>> [mailto:video-dev-bounces helixcommunity.org] On
Behalf Of Greg Wright
>> Sent: Wednesday, May 09, 2007 2:29 PM
>> To: video-dev
>> Subject: [Video-dev] CR: Fix crash in vidsite...
>>
>> Synopsis
>> ========
>>
>> This change fixes several bugs filed against the
site on
>> Cayenne as used by the windows player. The internal
bug
>> numbers are:
>>
>> 193461 HTR: Crash in vidsite.dll trying to.....
>> 193913 HTR: Crash in vidsite.dll after adding....
>> 193949 Deaddlock playing remote SMIL with RV
content
>> 193976 HTR player crash after loading and
playing....
>> 194427 crash after.....
>>
>>
>> Each bug above seemed to die with a different stack
trace. I
>> believe however that they are all related. What was
happening
>> was that we had some timing issue going on where
the renderers
>> were actually blt'ing frames before the site got
its first
>> WM_PAINT message. When the site gets its first
WM_PAINT message
>> it checks the resolution and bit depth of the
screen to see if
>> we need to re-create the DirectX surfaces. The
problem comes in
>> when a renderer is trying to use the site in one
thread while
>> we are tearing down and rebuilding the surfaces.
This results
>> in random crashes. Here is one such stack trace of
a crash:
>>
>>
>> Thread 1:
>>
>> I420toRGB32_DBLROW2X_FAST_STRETCH2XPLUS()
>> IMAGE_STRETCH2XPLUS()
>> YUVtoRGB2(dest_format, ...)
>> I420toRGB32(dest_ptr, dest....)
>> ColorFuncAccess::ColorConvert(cidOut,
dest_ptr...)
>> CBaseRootSurface::MinimalBlt(pImageData,
pBitmapInfo,....)
>> CBaseRootSurface::Blt(pImageData,
pBitmapInfo,...)
>> CBaseSurface::Blt(pImageData, pBitmapInfo,
rDestRect, rSrcRect)
>> CWinSurface2::Blt(pImageData, pBitmapInfo,
rDestRect, rSrcRect)
>> CBaseSurface::OptimizedBlt(pImageBits,
rDestRect, rSrcRect)
>>
CVideoRenderer::UpdateVideoSurface(pVideoSurface, ...)
>> CVideoRenderer::UpdateDisplay(pEvent,
bSystemEvent, bIsVisible)
>> CVideoRenderer::HandleEvent(pEvent)
>> CHXMultiInstanceSiteUser::HandleEvent(pEvent)
>> CHXSiteUserProxy::HandleEvent(pEvent)
>> CHXBaseSite::ForceRedraw()
>> CHXMultiInstanceSiteUserSupplier::ForceRedraw()
>> CVideoRenderer::ForceRefresh()
>> CVideoRenderer::SchedulerCallback(bIsScheduled,
bResched,....)
>> CVideoRenderer::BltIfNeeded()
>> CVideoFormat: ecodeFra
me(ulMaxExtraFrames)
>> CVideoRenderer::OnPace(ulId)
>> CVideoPaceMaker::ThreadRoutine(pArg)
>> HXWinThread::HXWinThreadStartRoutine(p)
>> _threadstartex(ptd)
>> 7c80b683
>>
>> Thread 2:
>>
>> WinDraw2_IsDDAvailable(lpwd)
>>
CWinBaseRootSurface::_IsHardwareAccelerationAvail()
>>
CWinBaseRootSurface::_CreateCompositionSurface()
>> CBaseRootSurface::ReInitSurfaces()
>> CHXBaseSite::ReInitSurfaces()
>> CHXBaseSite::ChangeResolution()
>> CHXBaseSite::CheckDisplayMode(hdc)
>> CHXWinSite::HandleWndProc(hWnd, message, wParam,
>> lParam, lResult)
>> HXxWinHookSiteProc(hWnd, message, uParam,
lParam)
>> 77d48734
>> 77d48816
>> 77d4b4c0
>> 77d4b50c
>> 7c90eae3
>> 77d494d2
>> 77d4b530
>> 77d496c7
>> CRCAEventLoopWin: oStep(th
isRunCount, bHandleQuitMsg)
>> CRCAEventLoopWin::Run()
>> CRPApp::RunRPApp()
>> WinMain(hInstance, hPrevInstance, lpCmdLine,
nCmdShow)
>> WinMainCRTStartup()
>> 7c816fd7
>>
>> Fix
>> ===
>>
>> The fix is simply to call CheckDisplayMode(NULL)
earlier then
>> the first
>> WM_PAINT message. I ended up doing this in
BeginOptimizedBlt(). Each
>> renderer that will use the video surface will call
this method before
>> doing so. This fixes the problem by initialing the
values
>> CheckDisplayMode() uses to decide if it will
re-init the surfaces:
>>
>> _GetDeviceCaps(hdc, newBitsPerPixel,
newHozRes,
>> newVertRes);
>>
>> if (m_nOldBitsPerPixel !=
newBitsPerPixel ||
>> newHozRes != m_nOldHorzRes || newVertRes !=
m_nOldVertRes)
>> {
>> m_nOldBitsPerPixel =
newBitsPerPixel;
>> m_nOldHorzRes =
newHozRes;
>> m_nOldVertRes =
newVertRes;
>> ChangeResolution();
>> }
>>
>>
>> I also cleaned up a couple casting warnings....
>>
>> Files Modified
>> ==============
>> video/sitelib/basesurf.cpp
>>
>> Branch(s)
>> =========
>> HEAD, 150Cay, 204Cay.
>>
>>
>> Platforms and Profiles Functionality verified
>> =============================================
>> windows/all-defines. Linux all defines.
>>
>> QA Instructions
>> ===============
>> I tested this on linux and windows. However, this
CR does
>> change when surfaces are created (root's
composition
>> surface). So, testing on the Mac is needed. I don't
see
>> any problems but we should make sure.
>>
>>
>> --greg.
>>
>>
>> Index: basesurf.cpp
>>
============================================================
=======
>> RCS file: /cvsroot/video/sitelib/basesurf.cpp,v
>> retrieving revision 1.18.4.7
>> diff -u -w -r1.18.4.7 basesurf.cpp
>> --- basesurf.cpp 24 Jan 2007 19:20:29 -0000
1.18.4.7
>> +++ basesurf.cpp 9 May 2007 18:18:35 -0000
>>  -203,7 +203,7 
>>
>> IHXPreferences* pPreferences = NULL;
>> IHXBuffer* pBuffer = NULL;
>> - HXFLOAT fTmp =
m_fScrollBarZoom;
>> + HXFLOAT fTmp =
(float)m_fScrollBarZoom;
>> HXBOOL bYUY2First = FALSE;
>>
>> ReadPrefBOOL(m_pContext,
"AllowOverlayShrinking",
>> m_bAllowOverlayShrinking );
>>  -218,7 +218,7 
>>
>> m_pyuvInputMngr->SetOutputPriority(CID_I420,
list, 4);
>> }
>> ReadPrefFLOAT(m_pContext,
"SiteZoomFactor", fTmp );
>> - m_fScrollBarZoom = fTmp;
>> + m_fScrollBarZoom = (double)fTmp;
>>
>>
m_pContext->QueryInterface(IID_IHXOverlayManager,
>> (void**)&m_pOverlayManager);
>>
>>  -3991,6 +3991,7 
>> return HXR_FAIL;
>> }
>>
>> +
>> // Are the new parameters the same as the old
paramaters? If not
>> // then delete the old surfaces.
>> if (m_pOptimizedFormat &&
pBitmapInfo)
>>  -4007,6 +4008,12 
>>
>> m_pSite->_TLSLock();
>>
>> + //XXXgfw fixes several bugs. For one such bug
and a full
>> + //description of why we need to check this
here see internal
>> + //bug number 193976 or the commit mail for
this change.
>> +
m_pSite->m_pTopLevelSite->CheckDisplayMode(NULL);
>>
>> HX_DELETE(m_pOptimizedFormat);
>> m_pOptimizedFormat = new HXBitmapInfoHeader;
>>
>> _______________________________________________
>> Video-dev mailing list
>> Video-dev helixcommunity.org
>> http://lists.helixcommunity.org/mailman/listinfo/video
-dev
>>
>
>
> _______________________________________________
> Video-dev mailing list
> Video-dev helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/video
-dev
_______________________________________________
Video-dev mailing list
Video-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev
|
|
[1-3]
|
|