The enhanced video renderer (EVR) is a component that displays video on the user's monitor. Two versions of the EVR exist:
* The EVR media sink, for Media Foundation applications.
* The EVR filter, for DirectShow applications.
Both versions use the same internal objects to render video, and they share many of the same interfaces.
The EVR can mix up to 16 video streams. The first input stream is called the reference stream. The reference stream always appears first in the z-order. Any additional streams are called substreams, and are mixed on top of the reference stream. The application can change the z-order of the substreams, but no substream can be first in the z-order.
The graphics driver determines which video formats are supported, but typically they are limited to the following:
*
Reference stream: Progressive or interlaced YUV with no per-pixel alpha (such as NV12 or YUY2); or progressive RGB.
*
Substreams: Progressive YUV with per-pixel-alpha, such as AYUV or AI44.
The available substream formats might depend on the format of the reference stream. For more information, see EVR Media Type Negotiation.
Internally, the EVR uses an object called the mixer to composite the frames from the input streams onto one surface for rendering. The mixer also performs deinterlacing and color correction. The output from the mixer is the final composited video frame. Then a second object called the presenter renders this frame to the display. The presenter schedules when the frames are rendered and manages the Direct3D device. Applications can replace either of these objects with their own custom implementations.
The output frame rate is locked to the reference stream. Whenever the substreams receive new frames, the mixer holds onto them. When the reference stream receives a new frame, the mixer composites that frame with the substream frames. (If the reference stream is interlaced, a complete reference frame may require more than one media sample.) It is possible for a substream to receive more than one frame while the mixer is waiting for a reference frame. In that case, the mixer simply discards the previous substream frame.
Because the presenter creates the Direct3D device, it is also responsible for sharing the device with other pipeline objects that need to access DirectX Video Acceleration (DXVA) services. In particular, the EVR mixer uses the DXVA video processing services to deinterlace and mix the video. External to the EVR, software decoders may use DXVA for accelerated video decoding. The presenter shares the Direct3D device by means of the Direct3D Device Manager. The following diagram shows the internal architecture of the EVR. (The software decoder, shaded in gray, is not part of the EVR.)
Architectural diagram showing the Software Decoder, EVR, Mixer, Presenter, Device Manager, SCVA Decoding, DXVA Video Processor, and Direct3D Service