The Windows 95 operating system provides the interface between client-applications and video capture device drivers-applications do not call the drivers directly. Although capture drivers are fundamentally 16-bit DLLs, they can contain flat 32-bit code for efficiency. In addition, the Plug and Play portion of capture drivers are implemented as a 32-bit VxD.
The following enhancements have been made for Windows 95:
Video capture device drivers can transfer data through four different logical channels. The destination or source of each channel is the frame buffer that is part of the video capture hardware. Although some capture devices may not implement a physical frame buffer capable of containing complete video frames, the four channels are still used to control the flow of video information. The four channels and the frame buffer are shown in the following illustration:
Data channels in the video capture driver.
The video capture channel (External In) is a source of video information placed in the frame buffer. The video source might be a video camera, video player, or television tuner. The format of both the incoming signal and the data placed in the frame buffer is controlled by the video capture hardware.
The video capture device can display the frame buffer data by using the video display channel (External Out). In practice, this could be with a second monitor or a video overlay device.
The device driver and application will use the video in channel (Video In) to transfer the video data to application supplied buffers.
The device driver and application can play captured data by using the video out channel (Video Out) to transfer data back into the frame buffer. Playback through this channel might be to review a sequence just captured or to play data from a file.
To supply minimum services, video capture drivers must support the External In and Video In channels.
Note
The Video Out channel is not currently used. The interface for video compression and decompression drivers is currently used to display video output from an AVI file..
Video capture applications call the capture engine provided by AVICap32.dll. This DLL accepts high-level commands from client applications, and converts them into low-level messages that are sent to capture drivers. AVICap32.dll allows client applications access to a window of the AVICap class. The AVICap window class displays the incoming video signal, allocates buffers for the video data, generates and manipulates palettes, and stores video and audio to an AVI file. For a complete description of the application interface to AVICap32.dll, see the video capture section of the Microsoft Win32 Programmer's Reference.
The examples in this chapter were extracted from a sample device driver for the Orchid Vidiola video capture hardware. This device is similar to a number of capture cards which use the Auravision VxP500 capture and scaling chip. The driver for the Orchid Vidiola implements a subset of the Plug and Play specification.
The Orchid Vidiola sample driver consists of three components. Source files for each component are contained in subdirectories branching from ddk\mmedia\samples\auravis.
Directory | Component | 16 or 32 | Description |
DRV | AVCapt.drv | 16 (some 32-bit flat segments) | The main capture driver which includes the DriverProc entry point |
VXD | AVVXP500.vxd | 32 | Plug and play support VxD which includes |
AVWIN | AVWin.dll | 16 | A support DLL which is entirely unique to the Auravision driver. |
AVCapt.drv is the core capture driver. It is a Ring3 DLL. By convention, capture drivers use the DRV extension rather than DLL.
AVWin.dll is a separate support DLL called by AVCapt.drv. This functionality is separate from AVCapt.drv purely for historical reasons. Most drivers will have only a capture driver (*.drv) and an associated plug and play VxD. Therefore, AVWin.dll will not be described further in this document.
The Orchid Vidiola can only participate in Plug and Play to a limited extent. For example, the base port and IRQ are not software configurable, but must be manually configured by the user via jumpers. For this reason, the sample VxD does not implement the full range of plug and play functionality such as dynamic resource assignment.
Note
The Video for Windows Developers Kit (VFWDK) included sample capture drivers for the Truevision Bravado and Creative Labs Video Blaster. While these drivers did not include PnP capabilities, they are generally simpler than the Vidiola driver and provide another useful reference when developing your own capture driver.