Microsoft DirectX 8.1 (C++) |
The following illustration shows an analog TV filter graph based on the ATI All-In-Wonder card. This graph renders video, audio, and closed-captioned text, and also captures the video and audio to an uncompressed AVI file. (Although this filter graph is somewhat complex, it can be created using the Capture Graph Builder with only a few lines of code. Graph building is discussed later in this section.)
TV Tuner: This filter is always the first filter in the graph, although no data actually passes through it. Applications use its IAMTVTuner interface to set the channel-to-frequency mappings, perform channel selection and to obtain information about which video standard the hardware supports.
Analog Video Crossbar: The crossbar filter is a routing device that applications use to set up the correct data paths for the input signals on the hardware. This filter supports the IAMCrossbar interface. The input pins on this filter represent the physical input from the antenna, cable, and/or auxiliary lines (such as a VCR). Any of the input signals can be routed to one or more of the outputs. The ATI graph illustrated previously has two crossbar filters. The upstream crossbar is for external inputs, and the second is for multiple inputs to the hardware video decoder (also called the analog-to-digital converter), which is represented by the capture filter in the graph. Other cards may have different crossbar configurations.
WDM Video Capture Filter: This kernel-mode filter represents the analog-to-digital converter on the hardware. It is the first filter in the graph that actually processes the video signal. Microsoft provides the driver that supports the Brooktree 829 capture chip used in video port devices, and IHVs supply drivers for the Brooktree 848, 878, and other video chips. All these drivers use the WDM Video Capture plug-in to provide property pages and expose their COM interfaces. The drivers and the plug-in appear as a single "filter" to applications. Applications use the IAMAnalogVideoDecoder interface on this filter to get and set the supported analog video format, the status of the horizontal sync, and the output bus. The capture filter is capable of creating two separate video streams for output, one for rendering and one for capture. The rendering pin (named VP for Video Port) always connects to the Video Port Manager.
The capture filter outputs the VBI data on a separate pin; some cards may output raw VBI data and some perform the VBI decoding in hardware. If the card supports hardware decoding of VBI data, its pin will typically have a friendly name of “HWCC” and will have a pin category of PINNAME_VIDEO_CC_CAPTURE. This pin must be connected directly to the pin of the same name on the CC Decoder or WST Decoder. (If the card supports hardware decoding of NABTS data, its pin will typically be called “HWNABTS” and will have a pin category of PINNAME_VIDEO_NABTS_CAPTURE and it must be connected directly to the NABTS/FEC VBI Codec Filter.) All the Microsoft VBI filters correctly handle both raw and decoded data. Since the All-In-Wonder card has a video port, the Bt829 capture filter is used; it has an output pin to the Video Port Manager, which will correctly configure the video memory for the CC overlays that will be provided by the Line 21 Decoder 2. This filter connects to input pin 1 or greater on the Video Mixing Renderer.
Even if you are only interested in capturing the video data from the capture pin, you will still need to connect the other output pins in order for the capture pin to work properly. Just connect the other pins to the appropriate input pins on the Video Port Manager (VPM) without connecting the VPM’s output pins to any downstream filters.
Video Port Manager: On Windows® XP Home Edition and Professional, this filter replaces the old VBI Surface Allocator and also takes over the Video Port management functionality of the Overlay Mixer, which is replaced by the Video Mixing Renderer.
AVI Decompressor: The AVI Decompressor filter is a wrapper filter for Video Compression Manager codecs. In an analog TV capture graph, it wraps the MSYUV Color Space Converter Codec, which converts the video stream from UYVY to RGB before sending it to the AVI Multiplexer.
Audio Capture: The Audio Capture filter receives the digitized audio from the Audio Decoder output pin on the crossbar. Note that the data is received on the CD Audio input pin of the Audio Capture filter. This pin actually represents the internal input on the sound card, which can be from any internal source on the host system, not just the CD drive. The other input pins on the Audio Capture filter generally represent the analog inputs for external devices such as microphones, tape players, and so on. The exact pin configuration and pin names might vary on different sound cards. In the graph shown previously, the Audio Capture filter delivers the audio data to the AVI Mux filter.
Note that this graph does not contain an Audio Renderer filter; this filter is not necessary when the TV card is connected to the sound card by an external cable (or "dongle") to the sound card's input jack. If this cable is not used, then the graph shown above would use the Smart Tee filter downstream from the Audio Capture filter to deliver audio to the DirectSound Renderer Filter as well as to the AVI Mux.
Tee/Sink-to-Sink Converter: This filter accepts the VBI information from the capture filter and splits it into separate streams for each of the data services present on the signal. Microsoft provides VBI codecs for Closed Caption, NABTS, and World Standard Teletext (WST). In the previous graph, the only service being captured is Closed Caption.
CC Decoder: The CC VBI decoder is a kernel-mode stream class filter that decodes CC data from the sampled waveforms provided by the capture filter. It has two input pins, VBI and HWCC. If the capture filter has an HWCC pin (indicating that it supports hardware decoding of the VBI data), then this pin must be connected directly to the CC Decoder’s HWCC pin (pin category PINNAME_VIDEO_CC_CAPTURE). The CC Decoder has up to eight output pins, each of which can select their own lines and substreams. Its job is to process captured VBI lines and deliver decoded CC data to the Line 21 Decoder and/or to interested applications. The first output pin is connected to the Line 21 Decoder.
Line 21 Decoder 2: The Line 21 Decoder 2 is used when the Video Mixing Renderer is in the filter graph. It accepts decoded closed-captioned data from the CC Decoder and generates the bitmaps which will be overlaid on top of the video rectangle. This data is then passed to the Video Mixing Renderer.
NABTS/FEC VBI Codec Filter (Not shown): The NABTS/FEC VBI Codec is a ring-0 stream class filter that decodes NABTS data from the sampled waveforms provided by the capture filter. It has two input pins, VBI and HWNABTS. It has up to eight output pins, each of which can select their own VBI scan lines and substreams. Its job is to process captured VBI lines and to distribute decoded and/or forward-error-corrected NABTS data to the BDA SLIP Deframer filter and then to BDA IP Sink, which makes the IP data available to any application via Winsock.
WST Codec and WST Decoder 2 filters (Not shown): These filters are ring-0 stream class filters that handle teletext data on PAL systems. The WST Codec has one input pin which receives raw VBI data. It has up to eight output pins, each of which can select their own lines and substreams. Its job is to process captured VBI lines and to distribute decoded teletext data to interested applications. The first output pin is connected to the WST Decoder which creates the bitmaps for the hardware overlay in the same way as the Line21 Decoder 2 works for closed-captioned data.
Video Mixing Renderer: This DirectShow filter performs the actual rendering of the video onto the system's video memory. It is used with both video port and non-video port types of hardware. The VMR replaces the old Overlay Mixer and Video Renderer filters on previous versions of Windows®. In Windows XP Home Edition and Windows XP Professional, the VMR is the default video renderer and appears with that name in GraphEdit. For more information on the Video Mixing Renderer, see Using the Video Mixing Renderer.