Microsoft DirectX 9.0

Building the DVD Filter Graph

The recommended way to build the DVD playback filter graph is to have a DVD Graph Builder object do it for you automatically. This approach is demonstrated below and in the DVD sample application. If you need to build your DVD filter graph manually, you can do so by following the basic rules of graph building discussed elsewhere in the DirectShow documentation. Generally, you should not manually add, remove, connect, or disconnect individual filters in the graph created by the DVD Graph Builder, because doing so might confuse the cleanup code.

When creating an instance of the DVD Graph Builder object, an application receives a pointer to the object's IDvdGraphBuilder interface. Call IDvdGraphBuilder::GetFiltergraph to obtain the filter graph manager's IGraphBuilder interface, and then call QueryInterface on IGraphBuilder to obtain IMediaEventEx. Use this interface to begin receiving events before building the rest of the graph. This will ensure that your application receives events from the DVD Navigator when it is initialized. To build the graph, simply call the IDvdGraphBuilder::RenderDvdVideoVolume method. For more information, see Building the Filter Graph.

On Windows XP, without the DirectX 9 runtimes, the DVD Graph Builder will always use the Video Mixing Renderer 7 (VMR-7) in the graph, unless:

On any system with a software MPEG-2 decoder and the DirectX 9 runtimes installed, the application should attempt to create the DVD Graph Builder with the AM_DVD_VMR9_ONLY f lag in the dwFlags parameter of IDvdGraphBuilder::RenderDvdVideoVolume. This method instructs the DVD Graph Builder to use only the Video Mixing Renderer 9 (VMR-9). When this flag is specified, if the graph builder cannot use the VMR-9 in the graph due to any reason, for example if

then RenderDvdVideoVolume will fail, and the application has the option of attempting to build the graph with the VMR-7 or the Overlay Mixer.

Also, since the VMR-9 does not support video ports or analog overlays, if the filter graph is using a hardware MPEG-2 decoder, especially for video, then the application must use the Overlay Mixer in all such cases.

An application can also call IDvdGraphBuilder::GetDvdInterface for any of the VMR-9 interfaces, which will result in the VMR-9 being inserted in the graph. The application then has an opportunity to configure the VMR-9 before starting to build the graph.