Microsoft DirectX 8.0 |
The Overlay Mixer filter is essentially a Microsoft® DirectDraw®-based video renderer. It uses destination color keying to mix video surfaces with overlays in scenarios such as line 21 closed captioning or digital video disc (DVD) subpicture data. This filter is used primarily in DVD playback and video capture applications, but you can use it in any scenario where you need to apply an overlay to a video surface.
It is added to the filter graph automatically when applications use the IDVDGraphBuilder and ICaptureGraphBuilder2 interfaces to create the graph. The Overlay Mixer will never be pulled into a graph automatically by the filter graph manager when rendering a file, since its merit is MERIT_DO_NOT_USE. Game applications can use the Overlay Mixer in limited ways to add video to the game screen.
(Note: The Overlay Mixer2 filter is identical to the Overlay Mixer except for two important distinctions: the Overlay Mixer supports the VIDEOINFO and VIDEOINFO2 format types, while the Overlay Mixer2 supports only the VIDEOINFO2 format type, and Overlay Mixer2 has a merit of MERIT_UNLIKELY, meaning it may in some situations be pulled into a graph automatically when the filter graph manager renders a file. This filter is primarily used in TV preview/capture graphs.)
Applications can control certain behavior on the Overlay Mixer through its IMixerPinConfig2 interface, but application developers should never be concerned with the details of the mixer's internal workings as described in this article. The following information is provided for the benefit of filter developers, and game developers who want to use the Overlay Mixer's DirectDraw Exclusive Mode.
The Overlay Mixer exposes an input pin for each incoming stream. Typically, there are three input pins: Pin 0 for video data and Pins 1 and 2 for line 21 and DVD subpicture data. Internally, the Overlay Mixer uses DirectDraw to render video. It creates a DirectDraw object with a primary surface comprising the entire desktop, and an overlay surface whose rectangle is defined by the size of the video stream connected to Pin 0. If the decoder does not specify a color key, the Overlay Mixer uses default color keys: dark gray for more recent graphics cards and magenta for older 256-color cards.
Note In the current version of the Overlay Mixer, the results are undefined if the decoder passes in two video streams to be rendered simultaneously in the same place on the overlay surface, as sometimes occurs with DVDs that contain both subpicture and line 21 streams. The video might flicker, or display only one of the streams.
The Overlay Mixer's input pins typically connect to an upstream video decoder (or decoders if a separate decoder is handling the line 21 or DVD subpicture data). The incoming video data must always connect to the Overlay Mixer's Pin 0. The line 21 or subpicture data streams, whether they come from the same video decoder or not, connect on Pin 1 or greater. If the decoder is a software decoder that uses the host CPU exclusively, then the connection between the decoder and the Overlay Mixer's Pin 0 is a standard IMemInputPin interface connection. If the decoder uses hardware acceleration, then its connection to Pin 0 on the Overlay Mixer must be an IAMVideoAccelerator connection. These two types of connections are mutually exclusive.
Filters that wrap a hardware decoder and connect to the Overlay Mixer through a video port must implement IVPConfig. The Overlay Mixer implements the IVPNotify interface, which calls into IVPConfig on the decoder to set and retrieve various control information. This mechanism enables the decoder to specify information about the overlay surfaces it requires, and it enables the Overlay Mixer to inform the decoder of the location of those surfaces in the video memory. The Overlay Mixer is also responsible for ensuring that the video rectangle is scaled correctly. Video capture scenarios present certain issues with respect to scaling of the preview image and the capture of interleaved video frames. If you are developing a filter or WDM driver for a hardware video capture device, refer to the IVPConfig and IVPNotify reference pages for more information on these topics.
The Overlay Mixer is not used in 1394 or USB capture scenarios. It is used in video capture over the PCI bus.
When connected to the Overlay Mixer, the Microsoft® DirectShow® Video Renderer filter does not actually render the video at all. The connection is an IOverlay connection rather than an IMemInputPin connection. This enables the Overlay Mixer to do the actual rendering, so that the Video Renderer is responsible only for creating the window and controlling its size and location on the desktop. This window can be a top-level window, or a child window within an application. The Overlay Mixer and Video Renderer hold a continual conversation during graph operation by means of IOverlay on the video renderer and IOverlayNotify on the Overlay Mixer. In addition to window size and position information, the Video Renderer passes its window handle through the Overlay Mixer to DirectDraw, which manages the rectangle clipping. Applications can control the Video Renderer through its IVideoWindow and IBasicVideo2 interfaces.
The Overlay Mixer's DirectDraw exclusive mode enables games to display video on some part of the screen. In this mode, the Overlay Mixer renders the video directly to a DirectDraw surface created by the game application, rather than to a window provided by the Video Renderer. This enables games to control the color key. To use the Overlay Mixer in DirectDraw exclusive mode, create an instance of the Overlay Mixer and obtain its IDDrawExclModeVideo interface before building the filter graph, and add the DirectDraw surfaces to the Overlay Mixer. The Overlay Mixer will ensure that the rendering is done into the DirectDraw surface. One significant limitation of this mode is that the game does not get access to the actual video bits. If you use IDDrawExclModeVideo, your application creates the primary surface, and the Overlay Mixer creates the overlay surface.
You can also use DirectDraw exclusive mode to perform windowless renderingfor example, in a Web pagebut this is not recommended, because the Overlay Mixer does not perform any mixing in this mode. This means that no line 21 or subpicture data can be displayed. To write a DVD playback application in windowless mode, the recommended approach is to use the MSWebDVD ActiveX® control.
Filter Interfaces | IAMOverlayFX, IAMVideoDecimationProperties, IBaseFilter, IDDrawExclModeVideo, IKsPropertySet, IMediaPosition, IMediaSeeking, IQualProp |
---|---|
Input Pin Media Types | Major Type: MEDIATYPE_Video Subtypes:
|
Input Pin Interfaces | IAMVideoAccelerator, IKsPropertySet, IMemInputPin, IMixerPinConfig, IMixerPinConfig2, IOverlay (pin 0 only), IPin, IPinConnection, IQualityControl, IVPNotify, IVPNotify2 |
Output Pin Media Types | MEDIATYPE_Video, MEDIASUBTYPE_Overlay |
Output Pin Interfaces | IPin, IQualityControl |
Filter CLSID | CLSID_OverlayMixer |
Property Page CLSID | No property page. |
Executable | qdvd.dll |
Merit | MERIT_DO_NOT_USE |
Category | CLSID_LegacyAmFilterCategory |