Chapter 3: Programming DirectShow Applications

Chapter 3

Programming DirectShow Applications

Although sample DirectShow filter graphs can be constructed and tested in GraphEdit, application programmers want to use standard programming languages either C or C++ to construct DirectShow applications. Although Visual Basic is an easy-to-learn and fully functional programming environment, the Visual Basic support for DirectShow programming interfaces is minimal. If you re a Visual Basic programmer, don t despair: nearly everything that follows is useful information, even if it can t be directly applied to your programming needs. For the purposes of this text, we ll be using the Microsoft Visual C++ integrated development environment, which provides a robust platform for the design and testing of DirectShow applications.

The design of a DirectShow application is straightforward and generally has three logical parts: initialization, where the application environment is established, followed by the construction of the DirectShow filter graph; execution, when the filter graph enters the running state and processes a stream of data; and cleanup, when data structures are deallocated and system resources released. This isn t significantly different from the model used by any other Windows application, and as a result, DirectShow applications can be combined with existing Windows applications very easily.

Before we can dive in and create a simple media player using DirectShow, a player that can be used to play any media types for which there are corresponding DirectShow filters (at the very least, these will include AVI, WAV, and Windows Media files), we need to cover some ground for programmers unfamiliar with the Microsoft Component Object Model (COM) programming interfaces. The DirectShow programming interfaces to filters and filter graphs present themselves as COM objects, so most DirectShow applications are COM-intensive. Although this might sound daunting, you don t need to know very much about COM to write fully functional DirectShow programs.



Programming Microsoft DirectShow for Digital Video and Television
Programming Microsoft DirectShow for Digital Video and Television (Pro-Developer)
ISBN: 0735618216
EAN: 2147483647
Year: 2002
Pages: 108
Authors: Mark D. Pesce

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net