GDCL Home About GDCL DirectShow WinNt & WDM
GDCL Home / Technology / Drivers / Streaming

WDM Streaming

WDM Streaming provides a kernel-mode streaming architecture similar to DirectShow, based on the common Windows Driver Model in Windows 98 and Windows 2000. It provides a high-bandwidth, low-latency communication mechanism between WDM device drivers and is used for audio and video devices at present.

WDM Streaming uses DirectShow to do the graph building. Each WDM Streaming device is represented by a DirectShow filter in user mode, and the graph building and application interfaces all interact with the user-mode filters. Once the graph is started, however, the kernel-mode components can communicate directly (by shared kernel-mode memory, for example). This scheme allows communication in a generic manner between filters at a much higher performance level than would be achieved if transitions to and from kernel mode were required.

WDM Streaming filters are based on the standard i/o request packet model. The interfaces and methods used by DirectShow are replaced by IOCTL codes and property sets, but other than that, the models are very similar, with buffer allocators, reference clocks and media types behaving in a similar manner. The graph of connected kernel-mode filters is built as a stack of layered device drivers.

The architecture of WDM Streaming is very similar to DirectShow in most aspects, but there are some significant differences:

  • Time: DirectShow clocks report a reference time which continues running monotonically to allow many graphs to synchronise start and stop events to the same clock. In WDM Streaming however, the master clock reports a "media time" value, which corresponds to the media sample currently being rendered. When the graph is stopped or paused, the clock stops. The proxies hide this difference when a clock is shared between DirectShow and KS.
  • One-way calls: a graph of WDM Streaming filters is built as a stack of devices. Higher-level devices can pass read or write requests to lower level devices as IRPs. However, the lower-level device cannot make unsolicited calls back up the stack, whereas a pair of DirectShow pins can easily use the COM QueryInterface mechanism to communicate in both directions at once.
  • Format Negotiation: WDM Streaming uses a Data Format structure that is compatible with the DirectShow media type. However, there is also a Data Range structure, in which a single structure can describe a range of related data formats.
  • Medium: as well as the media type or data format, WDM Streaming pins can have a medium GUID associated with them. This defines a specific hardware path: two pins that are on separate filters but are connected in hardware would have the same medium GUID to ensure they were connected to each other. This can be queried in DirectShow using the IKsObject COM interface, but DirectShow filters themselves do not support medium GUIDs.

The KSProxy user mode component creates DirectShow filters for each WDM Streaming filter, with a pin for each pin factory. If the pin is connected to a user-mode component, data is transferred to and from user mode; if the pin is connected directly to another WDM Streaming component, the data will be transferred directly in kernel mode. The DirectShow filter supports plug-ins to extend the functionality in user mode based on the property sets supported by the device. A COM plug-in can be defined that creates a user-mode COM interface for any component that supports a specific kernel-mode property set, and a property page plug-in can be defined to provide a UI.

Device Driver Topics

WDM Drivers
Kernel Streaming
KS Minidriver Models
Windows NT Drivers

Related Topics

Microsoft's WDM Streaming white paper
Video Capture overview
Microsoft's Windows Driver Foundation