Comparing the Video Renderer Filters


So far, we ve been glossing over the fact that DirectShow has more than one video rendering filter. In our filter graph diagram, we just labeled one of the boxes video renderer and left it at that. However, for historical reasons, and because each release of DirectShow needed to remain backward-compatible , there are no fewer than five distinct video renderer filters to choose from:

  • The video renderer that first shipped in DirectShow was named, appropriately, the Video Renderer filter. It is still the default video renderer on operating systems earlier than Windows XP. Whenever possible, the Video Renderer uses DirectDraw to draw the video frames onto the screen. Otherwise, it uses GDI, which is slower than DirectDraw but is actually not bad on newer computers. Unfortunately for our purposes, the Video Renderer uses very old versions of the DirectDraw interfaces. These work perfectly well for ordinary playback, but they don t give us the features that we need for 3-D graphics.

  • On computers running Windows XP, the default video renderer is the Video Mixing Renderer 7 (VMR-7). This filter uses DirectDraw 7 interfaces and has lots of cool features, such as alpha-blending multiple videos . However, the VMR-7 is not available on earlier platforms, and it does not use the latest Direct3D interfaces.

  • The newest video renderer is the Video Mixing Renderer 9 (VMR-9), introduced in DirectX 9.0. It is available for all versions of Windows that are supported by DirectX 9.0 or later. Its capabilities are similar to those of the VMR-7, but it uses Direct3D surfaces instead of DirectDraw surfaces, and it always uses the version 9 interfaces. The only catch is that the VMR-9 is not the default video renderer on any platform. This is because it has higher hardware requirements than the older Video Renderer filter. If it were the default renderer, it might break existing applications on some computers.

  • The Overlay Mixer filter, although now considered obsolete, was designed for destination color keying (for example, to display DVD subpicture data) and to support hardware overlay.

  • The Full Screen Renderer filter was designed for displaying full-screen video on older graphics cards. To avoid stretching the video, it would switch the display to a very low resolution. Modern graphics cards don t have any problems stretching video to full-screen, so this filter is obsolete.

All the video applications in this book use the VMR-9, because it has the features needed to combine video and 3-D graphics. By default, however, the RenderFile method will always use either the old Video Renderer filter or the VMR-7. To use the VMR-9, therefore, an application must explicitly select it. You ll learn how to do that shortly.

Note  

When we refer to the VMR in this book, we always mean the VMR-9 unless we specify the VMR-7. The two filters use different COM interfaces and have somewhat different capabilities. However, much of the information in this book can be applied to the VMR-7 as well.




Fundamentals of Audio and Video Programming for Games
Fundamentals of Audio and Video Programming for Games (Pro-Developer)
ISBN: 073561945X
EAN: 2147483647
Year: 2003
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net