With OMAP35x/DM37x EVM ,we will face issue of image corruption while rendering the camera output to the screen because of presence of Virtual Rotate Frame Buffer(VRFB). But if we want to use both VRFB and Camera preview to work together in WinCE 6.0 ,we can set the renderer of the DShow camera application to use the GDI mode instead of the DirectDraw renderer.The code used in WinCE 6.0,
IAMVideoRendererMode::SetMode(DWORD dwMode)
Where dwMode - AM_VIDEO_RENDERER_MODE_DDRAW (or) AM_VIDEO_RENDERER_MODE_GDI
|
But in the WEC7,there is a change in the DShow renderer (i.e., Video Mixing Renderer(VMR)),which does not support the IAMVideoRendererMode interface or method which we used in WinCE 6.0 to switch the GDI mode.
In this blog ,I will show how to fix this issue. But it will have a disadvantage of very low frame rate in the rendering because of not using the hardware overlay.
In VMR we can control the renderer preferences using the IVMRFilterConfig::SetRenderingPrefs() method.
For this issue here is the fix, we can force the VMR to use the RenderPrefs_ForceOffscreen instead of Overlays, which is more or less the same functionality as used in the WinCE 6.0.
IVMRFilterConfig *pVMRConfig;
hr = m_pVMRRenderer.QueryInterface(&pVMRConfig );
if(FAILED(hr) || pVMRConfig == NULL)
{
FAIL(TEXT("Retrieving the IID_IVMRFilterConfig failed."));
}
hr = pVMRConfig->SetRenderingPrefs( RenderPrefs_ForceOffscreen| RenderPrefs_AllowOffscreen );
if ( FAILED(hr) )
{
FAIL( TEXT("%S: ERROR %d@%S – failed to set the rendering prefs. (0x%08x)" ), __FUNCTION__, __LINE__, __FILE__, hr );
}
|
You must be logged in to post a comment.