beautypg.com

3 directshow programming guide, 1 filters, Filters – ADLINK PCIe-2602 User Manual

Page 63: 3directshow programming guide

background image

DirectShow Programming Guide

53

PCIe-2602-FLR

3

DirectShow Programming Guide

.

The goal when writing a DirectShow Application is to construct a
filter graph by connecting several filters together, to execute tasks
such as previewing or capturing video/audio, and multiplexing to
write to a file. Each filter performs a single operation and pass data
from its output is pinned to the input of the next filter in the graph.

To build a capture graph using a program, the interface pointer of
the capture filter must first be obtained. The ADLINK SDI Capture
filter can be obtained through the system device enumerator.

After holding an interface pointer to the capture filter object,
method IGraphBuilder::AddSourceFilter adds the source filter
object to the filter graph. IFilterGraph::AddFilter adds other down-
stream filters to the filter graph.

After filters are added, calling IFilterGraph::ConnectDirect or
IGraphBuilder::Connect connect output pins from upstream filters
to the input pins of the downstream filters.

Calling IAMCrossbar::Route to switch source channel, via meth-
ods IMediaControl::Run, IMediaControl::Pause or IMediaCon-
trol::Stop changes the filter state to running, paused or stopped.

Filters required for capturing video streams are

listed as follows, with detailed information for each and its pins.
Example filter graphs for capturing video streams are also illus-
trated in this chapter with two ways of controlling the device driver.

3.1

Filters

This section lists the filters necessary to construct a filter graph for
capturing a video stream.

NOTE:

NOTE:

Complete documentation for DirectShow application program-
ming can be found at:
http://msdn.microsoft.com/en-us/library/dd390351(VS.85).aspx
by searching for “DirectShow”. If a DirectX SDK is installed,
this documentation is also available from DirectX SDK Help.
The most recent version of DirectShow SDK was moved to
Windows SDK.