`
`Page 1of24
`
`MQi@[.jjj,M l!i.! 11ij Topic Contents
`
`l@i§il!MM
`
`Getting Started
`
`This section introduces you to the DirectShow SDK and helps you get oriented. It includes a
`description of the SDK, information about porting from previous versions, background needed
`to understand different parts of DirectShow, a guide to the documentation, and answers to
`frequently asked questions.
`
`· What is DirectShow?
`
`· What's New in the DirectShow SDK?
`
`· Porting Code from Active Movie
`
`· What Background Do You Need?
`
`· Documentation Roadmap
`
`· Frequently Asked Questions
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jjj,M 111.l:.!j Topic Contents
`
`l@i§il!MM
`
`What is DirectShow?
`
`The Microsoft® DirectShow™ SDK gives developers access to DirectShow services, which
`provide playback multimedia streams from local files or Internet servers, and capture of
`multimedia streams from devices. Specifically, this enables playback of video and audio
`content compressed in various formats, including MPEG, Apple® QuickTime®, audio-video
`interleaved (AVI), and WAV, and both Video for Windows-based capture and WDM-based
`(Windows Driver Model) capture.
`
`At the heart of the DirectShow services is a modular system of pluggable components called
`filters, arranged in a configuration called a filter graph. A component called the filter graph
`manager oversees the connection of these filters and controls the stream's data flow.
`
`Applications control the filter graph's activities by communicating with the filter graph
`manager. You can do this indirectly by using the ActiveMovie Control, or directly by calling
`COM interface methods. The SDK also enables you to create your own filters using the
`DirectShow class library. The base classes in the C/C++ library implement the required COM
`interfaces on the filters and provide the basic filter framework.
`
`1
`
`SAMSUNG 1004
`
`
`
`Getting Started
`
`Page 2of24
`
`The DirectShow SDK is based on several other Microsoft services and supports at least one
`other Microsoft service. For example, the video display components in DirectShow rely on
`Microsoft® DirectX® services whenever possible.
`
`The amount you must know about an underlying or supported technology depends on what you
`are doing. For example, you'll need to understand COM programming if you are using C or C++
`to control DirectShow playback or create a filter. But you don't need to understand COM
`programming to use the ActiveMovie Control.
`
`DirectShow developers can use the following Microsoft services (you can find information about
`most of these in the Platform SDK or on the World Wide Web at
`http://www.microsoft.com/msd n/.)
`
`• DirectX
`• Component Object Model (COM)
`• Media control interface (MCI)
`
`You can also use the following Microsoft languages for DirectShow development:
`
`• Microsoft Visual Basic® - used to create and control filter graphs.
`• Microsoft Visual C++® - used to create and control filter graphs, and create filters.
`
`See the product documentation for more information on these languages.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Q'41[.]1!,+ 1 !1·HM Topic Contents
`
`ifflj[§ii!¥M
`
`+Q<@[.]ij,+ 111.11119 Topic Contents 1@1§11!¥+
`
`What's New in the DirectShow SOK?
`
`The Microsoft® DirectShow™ SDK (formerly the Microsoft ActiveMovie™ SDK) is now part of
`the Microsoft DirectX® Media SDK. Features added since ActiveMovie 1.x include video and
`audio capture and compression, device enumeration, digital versatile disc (DVD) support,
`digital video (DV) support, cutlist support, device control and timecode support, and
`multimedia streaming. See the topics in the following lists for details of all the DirectShow
`SDK's new features. For the most recent updates to this documentation, consult the Microsoft
`DirectX Web site at http ://www.microsoft.com/DirectX/.
`
`Articles
`
`• Porting Code from ActiveMovie
`• What Background Do You Need?
`• Documentation Roadmap
`• About Capture Filter Graphs
`
`2
`
`
`
`Getting Started
`
`Page 3 of24
`
`• Improving Capture Performance
`• Creating a Capture Application
`• Write an Audio Capture Filter
`• Write a Video Capture Filter
`• Enumerate and Access Hardware Devices in DirectShow Applications
`• DVD for Title Vendors
`• DirectShow DVD Support
`• About Cutlists
`• Using Cutlists
`• About Compression Filters
`• Recompress an AV! File
`• DV Data in the AV! File Format
`• AV! 2.0 File Format Extensions
`• Play a Movie in a Window Using DirectDrawEx and Multimedia Streaming
`• Play a Movie from C++
`• Control the Video Playback Window from C++
`• Display a Filter's Property Page from C++
`• Use Multimedia Streaming in DirectShow Applications
`• Build a Filter or Application with Visual C++ 5.x
`• Exposing Capture and Compression Formats
`• About the DirectShow Filter Graph Editor
`• Using the Filter Graph Editor
`• About WDM Video Capture
`• Using DirectDrawEx
`
`Multimedia Streaming
`
`• About the Multimedia Streaming Architecture
`• List of Multimedia Streaming Interfaces
`• Multimedia Streaming Reference
`• Multimedia Streaming Data Types
`• Error and Success Codes for Multimedia Streaming
`• Multimedia Streaming Component Objects
`• Multimedia Streaming Sample Code
`
`DirectDrawEx
`
`• What Is DirectDrawEx?
`• !DirectDrawFactory Interface
`• !DirectDraw3 Interface
`
`DirectShow COM Interfaces
`
`The following lists group the new DirectShow interfaces by area. In addition, the Multimedia
`Streaming Reference contains interfaces specific to multimedia streaming.
`
`Capture, Compression, Device Enumeration, and Windows Driver Model (WDM)
`Capture Interfaces
`
`• IAMAudiolnputMixer
`
`3
`
`
`
`Getting Started
`
`Page 4 of24
`
`• !AM BufferNeqotiation
`• IAMCrossba r
`• IAMDroppedFrames
`• IAMStreamConfiq
`• IAMStreamControl
`• IAMStreamSelect
`• IAMTVTuner
`• IAMVfwCaptureDialoqs
`• IAMVfwCompressDialoqs
`• IAMVideoCompression
`• IAMVideoProcAmp
`• !CaptureGraphBuilder
`• !ConfiqAviMux
`• !Confiqlnterleavinq
`• !CreateDevEnum
`• !FileSinkFilter2
`• !FilterGraph2
`• !MediaPropertyBaq
`• !SeekinqPassThru
`
`DirectSound Interface
`
`• IAMDirectSound
`
`Digital Versatile Disc (DVD), Closed Captioning, Property Set, and Video Port (VP)
`Interfaces
`
`• IAMLine21Decoder
`• !DvdControl
`• !DvdGraphBuilder
`• !Dvdlnfo
`• !KsPropertySet
`• IVPBaseConfiq
`• IVPBaseNotify
`• IVPConfiq
`• IVPNotify
`
`Cutlist Interfaces
`
`• IAMAudioCutlistElement
`• IAMCutlistElement
`• ICutlistGraphBuilder
`• !FileClip
`• IAMFileCutlistElement
`• IStandardCutlist
`• IAMVideoCutlistElement
`
`Device Control and Timecode Interfaces
`
`• IAMExtDevice
`
`4
`
`
`
`Getting Started
`
`Page 5 of24
`
`• !AM ExtTra nsport
`• IAMTimecodeDisplay
`• IAMTimecodeGenerator
`• IAMTimecodeReader
`
`Memory Allocation/Media Sample Interfaces
`
`• IAMDevMemoryAllocator
`• IAMDevMemoryControl
`• !MediaSample2
`
`Samples
`
`• AMCap Sample (DirectShow Capture Application)
`• CL Text Sample (Text Cutlist Application)
`• ShowStrm Sample (Multimedia Streaming Application)
`• Simpled Sample (Cutlist Application)
`• Vcrctrl Sample (VCR Control Filter)
`• VidClip Sample (Video Editing Application)
`• VidCap Sample (Video Capture Filter)
`• Dvdsampl Sample (DVD Player Application)
`• PlayFile Sample (Simple Playback Application)
`• InWindow Sample (Window Playback Application)
`• MPEGProp Sample (MPEG Property Page Display Application)
`
`Filters
`
`The following lists group the filters by category. Some filters can fit in more than one category
`so be sure to look at the different categories to see what new filters are available.
`
`Capture, WDM Capture, and File Writing Filters
`
`• Analog Video Crossbar
`• Audio Capture
`• AV! MUX
`• File Writer
`• TV Audio
`• TV Tuner
`• VFW Video Capture
`• WDM Video Capture
`
`Digital Video (DV) Filters
`
`• DV Muxer
`• DV Splitter
`• DV Video Decoder
`• DV Video Encoder
`
`Cutlist Filter
`
`5
`
`
`
`Getting Started
`
`Page 6 of24
`
`• Cutlist File Source
`
`Closed Captioning Filters
`
`• Lyric Parser
`• Line 21 Decoder
`• Multi-File Parser
`• SAM! CCC) Parser
`
`Compression and Decompression Filters (Codecs)
`
`• ACM Audio Compressor
`• AV! Compressor
`• Indeo 4.3 Video Compression
`• Indeo 4.3 Video Decompression
`• Indeo 5.0 Audio Decompression
`• Indeo 5.0 Video Compression
`• Indeo 5.0 Video Decompression
`• QuickTime Decompressor
`• TrueMotion 2.0 Decompressor
`
`Parser, Renderer, and Mixer Filters
`
`• AV! Draw
`• DSound Audio Renderer
`• File Stream Renderer
`• Internal Script Command Renderer
`• MIDI Parser
`• MIDI Renderer
`• Overlay Mixer
`
`DVD Filter
`
`• DVD Navigator
`
`Classes, Functions, and Macros
`
`• CBaseRenderer callback function class
`• CBaseStrea mControl class
`• Functions for creating DLLs and registering and unregistering filters
`• !Unknown Macro
`
`The following material relating to the ActiveMovie Control has been significantly updated:
`
`• About the DirectShow ActiveMovie Control
`• Control Events
`• Control Methods
`• Control Properties
`• Control Property Sheet
`
`6
`
`
`
`Getting Started
`
`Page 7of24
`
`• Control Shortcut Keys
`• Using the ActiveMovie Control in HTML Pages
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`w Q<M [.] +• 111.H5 Topic Contents •@M* 1gnw
`MQi§1[.]1!,M 11!.HM Topic Contents
`
`i@faii!MM
`
`Porting Code from ActiveMovie
`
`This article describes the steps you must take to port your Microsoft® ActiveMovie™ 1.0 code
`to Microsoft DirectShow™.
`
`Contents of this article:
`
`• Recompiling ActiveMovie 1.0 Code with DirectShow
`• Interfaces and Services Improved Since ActiveMovie 1.0
`
`Recompiling ActiveMovie 1.0 Code with DirectShow
`
`If you are recompiling your ActiveMovie 1.0 code with the DirectShow header files and
`libraries, you must make the following changes:
`
`1. The name of the IFilter interface has been changed to IBaseFilter. You need to change
`the name to compile with DirectShow libraries and headers. ActiveMovie 1.0 binaries will
`continue to work because the IID (Interface Identifier) GUID for the interface is still the
`same.
`2. The constructor of the CBasePropertyPage: :CBasePropertyPage function has one less
`parameter. Once again, if you are recompiling your code with the DirectShow base class
`libraries, you will have to modify the parameters for the CBasePropertyPage constructor.
`
`The old prototype for the constructor was:
`
`CBasePropertyPage (TCHAR *pName,
`LPUNKNOWN punk,
`HRESULT * phr,
`int Dialo gid,
`int Titleid ) ;
`
`II Debug only name
`II COM Delegator
`II Return code
`II Reso urce ID
`II To get title
`
`The new prototype is:
`
`CBasePropertyPage(TCHAR *pName,
`LPUNKNOWN punk,
`int Dialogid,
`int Titleid ) ;
`
`II Debug only name
`II COM Delegato r
`II Resource ID
`II To get title
`
`7
`
`
`
`Getting Started
`
`Page 8of24
`
`Interfaces and Services Improved Since ActiveMovie 1.0
`
`Some interfaces and services in ActiveMovie 1.0 have been improved in DirectShow. You
`should use the following improved interfaces and services:
`
`1. A new interface, IFilterMapper2, has been introduced to support the concept of filter
`categories and registering filters in correct categories. IFilterMapper will still work for
`filters that were shipped with ActiveMovie 1.0 and are now part of the standard filters in
`the Filter Graph Editor. IFilterMapper might not do the right thing for filters that are in
`the new categories. For example, you might end up with filters that you can't instantiate.
`2. The AMovieSetupRegisterFilter2 function has been added to use IFilterMapper2.
`AMovieSetupRegisterFilter will still work and will use IFilterMapper.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`MQ<§i[.jjj,M Ill.HS Topic Contents
`
`lmll§lllMM
`
`8 4'41M+• 111.q9 Topic Contents 1@1§111$8
`
`What Background Do You Need?
`
`The amount you need to know for a particular DirectShow task depends on the task. For
`example, you must understand basic COM principles and C or C++ to create a filter. But you
`don't need to understand either to use the ActiveMovie Control.
`
`The following tables show what you might need to know to perform different tasks and get the
`most out of the DirectShow documentation. To find the information you need, see
`Documentation Roadmap for a description of what you'll find in the different sections of the
`DirectShow documentation. See Where Can I Learn About... for the location of answers to
`specific questions within the DirectShow documentation, and see How to Get More Information
`for the location of useful information outside the DirectShow documentation.
`
`The following table shows the background you might need to understand different sections of
`the DirectShow documentation.
`Background needed
`Section
`Getting Started None.
`Using the
`You must know Microsoft® Visual Basic® or CIC++ if you're using the control
`from within them. If you're using the control as an end-user and not
`ActiveMovie
`developing applications with it, the section is self-sufficient.
`Control
`None.
`DirectShow
`Basics
`Application
`Developer's
`Guide
`Filter
`Developer's
`Guide
`
`You must know the language you are developing your application in, and
`basic COM programming.
`
`You must be experienced with C/C++ and basic COM programming.
`
`8
`
`
`
`Getting Started
`
`Page 9of24
`
`C/C++
`Reference
`
`Filters and
`Samples
`
`Appendixes
`
`Glossary
`
`You must know C/C++ and basic COM. For the "Debugging" section, it would
`be useful to understand basic debugging procedures, such as how to generate
`debug information or check for memory leaks. For the Event Notification
`Codes section, it might be helpful to know a little about Windows messaging.
`You must know C/C++ and basic COM. Depending on your filter, you might
`need to know a little about DirectSound® and DirectDraw® , or understand
`multimedia capture and compression.
`You must know a little about C to understand Reserved Identifiers, and you
`need to know a little about multimedia to understand Media Types.
`None.
`
`Background needed
`None.
`
`None.
`
`The following table shows the background you might need to accomplish a sampling of tasks in
`DirectShow.
`Task
`Use the
`ActiveMovie
`Control as an end-
`user.
`Use the Filter
`Graph Editor tool.
`You must be experienced with C/C++ and basic COM.
`Write a filter.
`Create or control a You must be familiar with Visual Basic and basic COM.
`filter graph in
`Visual Basic.
`Play a movie.
`
`To play a movie in a Visual Basic or C/C++ application, you must be
`familiar with those languages and with basic COM programming. To play a
`movie from a Web page, you should be familiar with HTML, but the
`DirectShow documents will explain the rudiments, such as using the
`OBJECT and HREF tags.
`You must be familiar with C/C++ and basic COM.
`
`Write a media(cid:173)
`streaming
`application.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`•;<MM+' 111.],.[9 Topic Contents
`
`lmli§lllMM
`
`8 4'41M+• 111.q9 Topic Contents
`
`1@1§111$8
`
`Documentation Roadmap
`
`The Microsoft® DirectShow™ SDK documentation is delivered in HTML format (which you can
`read by using a browser) and in .ivt format (which you can read using Microsoft InfoViewer).
`The Microsoft Developer Network (MSDN) Library and Microsoft Visual C++®, as well as other
`Microsoft products, install InfoViewer for you.
`
`When you install the DirectShow SDK, the HTML documentation is always installed. The HTML
`
`9
`
`
`
`Getting Started
`
`Page 10 of24
`
`start page, Start.htm, is available in the main installation directory (Dxmedia by default). If
`the DirectShow installation finds InfoViewer on your computer, it also installs and registers
`the .ivt documentation. The next time you open InfoViewer (through Visual C++, MSDN, or
`another program) the DirectShow SDK documentation will be available under the "DirectX
`Media SDK" heading.
`
`For the most recent updates to this documentation, consult the Microsoft DirectX Web site at
`http://www. microsoft.comlDirectXI.
`
`The DirectShow SDK documentation contains general sections that provide information useful
`to everyone, and sections that apply to particular tasks. Getting Started and DirectShow Basics
`contain high-level information useful to everyone. ActiveMovie Control, APPiication Developer's
`.G..u..i.de_, and Filter's Developer's Guide contain procedures and technical information specific to
`their respective topics. Multimedia Streaming describes the simplified streaming interfaces that
`enable developers to interface to a stream without creating a custom renderer or source filter.
`DirectDrawEx describes the DirectDrawEx dynamic-link library, which extends the current
`functionality of DirectDraw. Filters and Samples contains a brief description of the filters and
`sample applications shipped with DirectShow. CIC++ Reference is the DirectShow Reference.
`APPendixes contain supplemental information to the reference, and Glossary defines
`DirectShow terms.
`
`See What Background Do You Need? to find out what background different tasks require.
`
`Contents of this article:
`
`• Where Can I Learn About ...
`• How to Get More Information
`
`To help you find the information you need, the following list describes the content of each
`section in the DirectShow documentation and when you will typically use it.
`
`• Getting Started - gives general information about DirectShow, such as background
`needed to use DirectShow, material new in this release, and frequently asked questions.
`Read this section to orient yourself when first starting with DirectShow.
`• ActiveMovie Control - describes the ActiveMovie Control's features and how to use it to
`play back movies in different applications, such as C/C++, Visual Basic, or an HTML Web
`page. This section also contains the HTML reference and the Visual Basic 5.x reference,
`which describes using DirectShow COM interfaces as Visual Basic objects. Read this
`section if you want to use the control.
`• DirectShow Basics - contains overview articles covering basic DirectShow concepts, such
`as filter graph architecture and data flow, how to use the Filter Graph Editor tool, and a
`list of the filters and sample filters supplied with DirectShow. Read this section for a
`high-level introduction to DirectShow, whether you are developing your own filters or
`developing an application that uses the supplied filters.
`• Application Developer's Guide - contains articles about developing applications,
`including a discussion of media streaming, a list of application interfaces, and step-by(cid:173)
`step procedures for adding features to your applications. Read this section if you want to
`develop applications with DirectShow.
`• Filter's Developer's Guide - contains technical articles about creating filters, including
`different filter types, connecting and controlling filters, and step-by-step procedures for
`creating specific filters, such as capture filters and DirectSound renderer filters. Read this
`section if you want to write your own filters.
`• CIC++ Reference - contains the COM interface and class library references, structures,
`
`10
`
`
`
`Getting Started
`
`Page 11 of24
`
`utility functions, events, error messages, and debugging tips. Read this section to get
`details about an interface or a data type.
`• Filters and Samples - contains a brief description of the filters and sample applications
`shipped with DirectShow and available for use or for modification in your own
`applications. Read this section to create a prototype application from the supplied filters
`or to see if the filter you want to create already exists.
`• Multimedia Streaming - contains an overview of the multimedia streaming architecture,
`a list of the multimedia streaming interfaces, and the multimedia interface references.
`Read this section to learn how to use the multimedia streaming interfaces to
`automatically negotiate the transfer and conversion of data from the source to the
`application, so you don't have to write code to handle the connection, transfer of data,
`data conversion, and actual data rendering or file storage. The streaming interfaces
`provide a uniform and predictable method of data access and control, which makes it
`easy for an application to play back data, regardless of its original source or format.
`• DirectDrawEx - contains an overview of the DirectDrawEx dynamic-link library, which
`extends the current functionality of DirectDraw, and reference material for the
`!DirectDrawFactory and !DirectDraw3 interfaces.
`• Appendixes - contains miscellaneous technical information, including a list of
`AM MEDIA TYPE structure values supported in DirectShow, information about time
`stamps and DirectShow DVD support, country codes and channel-to-frequency mappings
`for TV tuner applications, and the reserved identifiers in the DirectShow header files.
`Read this section if you need details about one of these topics.
`• Glossary - defines DirectShow-specific terminology you might not be familiar with.
`
`Where Can I Learn About ...
`
`This section tells you where to find information in the DirectShow documentation about specific
`tasks and topics. Also see the "Frequently Asked Questions" section for answers to common
`questions.
`
`Q. Where should I begin reading in the DirectShow documentation?
`
`A. Read for an overview and then read the articles in the and sections that match your
`interest. See Debugging with DirectShow for debugging information.
`
`Q: Where can I find information about capture?
`
`A: See the following capture topics .
`
`• About Capture Filter Graphs
`• Improving Capture Performance
`• Creating a Capture Application
`• Recompress an AV! File
`• Write an Audio Capture Filter
`• Write a Video Capture Filter
`• Enumerate and Access Hardware Devices in DirectShow Applications
`
`DirectShow provides the following capture-related filters. The video renderer is often used for
`purposes other than capture.
`
`• ACM Audio Compressor
`• Audio Capture
`
`11
`
`
`
`Getting Started
`
`Page 12 of 24
`
`• AVI MUX
`• DV Muxer filter
`• File Writer
`• VFW Video Capture
`• VidCap Sample (Video Capture Filter)
`• Video Renderer
`
`Capture-related interfaces:
`
`• IAMAudioinputMixer
`• IAMDroppedFrames
`• IAMStreamConfig
`• IAMVfwCaptureDialogs
`• IAMVfwCompressDialogs
`• IAMVideoCompression
`• I Ca ptu reG ra ph Bui Ider
`• ICreateDevEnum
`
`Q. Where can I find information about playing back movies using the C or C++
`language?
`
`A. Read Play a Movie from C++ in the.
`
`Q. Where can I find information about playing back movies using Microsoft® Visual
`Basic®?
`
`A. If you are using the ActiveMovie Control, see Using the ActiveMovie Control in Visual Basic.
`If you are constructing or controlling a filter graph with Visual Basic, see Constructing Filter
`Graphs Using Visual Basic and Controlling Filter Graphs Using Visual Basic in the section.
`
`Q. Where can I find information about playing back movies from a Web page?
`
`A. Read Using the ActiveMovie Control in HTML Pages in the section.
`
`Q. Where can I find a class hierarchy diagram for the DirectShow base classes?
`
`A. Each class in the DirectShow C++ Class Library section has its own class hierarchy diagram
`at the top of its opening page.
`
`Q. Where can I find information about the filters shipped with DirectShow?
`
`A. For a description of each of the filters included with the DirectShow run time, as well as the
`sample filters included with the SDK, see . When the SDK is installed, all sample filters are
`built and registered.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQi§i[.jjj,M 11!.HS Topic Contents
`• QIM [.] +• I !!·HM Topic Contents l@i§il/¥8
`
`lmll§I 11¥8
`
`12
`
`
`
`Getting Started
`
`Page 13of24
`
`How to Get More Information
`
`You can find most of the information you need beyond a knowledge of your particular
`programming language and the DirectShow documents themselves in the Platform SDK,
`available in the Microsoft Developer Network. See http://www.microsoft.com/msdn/ for more
`information.
`
`COM Overview and DirectShow and COM can give you an introduction to Component Object
`Model (COM), and this might suffice for many development tasks in DirectShow. If you need
`more information, see the "COM" section in the Platform SDK, or an introductory book such as
`Understanding ActiveX OLE by David Chappell.
`
`For more information about DirectDraw or DirectSound, see the Microsoft DirectX® SDK
`documentation in the Platform SDK.
`
`For more information about multimedia in general, see the "Graphics and Multimedia Services"
`section in the Platform SDK.
`
`For more information about Microsoft Windows® messaging, see the "Win32 Messages" section
`in the "Reference" portion of the Platform SDK.
`
`For more information about media control interface (MCI), see the "MCI" section in the
`Platform SDK.
`
`For more information about CIC++ programming, read the product documentation for your
`CIC++ compiler (such as the Microsoft Visual C++® documentation), or a standard C or C++
`programming book. For more information about Visual Basic programming, read the Visual
`Basic product documentation.
`
`© 1997 Microsoft Corporation . All rights reserved . Terms of Use.
`
`•;<MM+' •11·!:.!¥ Topic Contents
`
`lmli§lllMM
`
`Frequently Asked Questions
`
`This section answers many frequently asked questions about DirectShow. It is divided into
`three parts: answers to general questions, answers to questions asked by application
`developers, and answers to questions asked by filter developers.
`
`Contents of this article:
`
`• Genera I Questions
`• Redistribution Questions
`• Application Development Questions
`
`13
`
`
`
`Getting Started
`
`Page 14of24
`
`• Filter Development Questions
`
`General Questions
`
`Q. What are the differences between DirectShow'M, DirectDraw®, DirectSound®, and
`DirectX®?
`
`A. For an overview of these Microsoft® technologies as well as many others, see
`http://www.microsoft.com/d irectx/.
`
`Q. What operating systems does DirectShow support?
`
`A. DirectShow supports Windows® 95 or later and Windows NT® version 4.x or later.
`
`Q. Is there an DirectShow Hardware Compatibility List (HCL)?
`
`A. No. DirectShow uses all DirectDraw® and DirectSound hardware capabilities where they are
`available. Where no special hardware is available, DirectShow uses GD! to draw video and the
`waveOut* Multimedia AP!s to play back audio.
`
`Q. What multimedia file formats does DirectShow support?
`
`A. DirectShow supports the following formats.
`
`• MIDI (.mid)
`• MPEG-1 (.mpg, .mpeg, .mpv, .mp2, .mpa, .mpe)
`• Audio-video interleaved (.avi)
`• Nonproprietary Apple® QuickTime® files (.mov, .qt)
`• Wave (.wav)
`• AU (.au, .snd)
`• AIFF (.aif, .aifc, .aiff)
`
`Q. Where can I obtain detailed file format specifications?
`
`A. One source is Encyclopedia of Graphics File Formats, second edition, by James D. Murray
`and William vanRyper, published by O'Reilly & Associates, Inc. That book describes MPEG-1,
`AV!, and some QuickTime file formats. See AV! 2.0 File Format Extensions for more
`information about DirectShow's support of this format.
`
`Q. Does DirectShow provide video capture services?
`
`A. Yes, DirectShow provides video capture.
`
`Q. What version of Internet Explorer do I need to use DirectShow for Web content?
`
`A. DirectShow is designed for Internet Explorer 3.x and later.
`
`Q. What HTML tags would I use with DirectShow?
`
`A. For information on the HTML tags to use to play movies using DirectShow, see Using the
`ActiveMovie Control in HTML Pages.
`
`14
`
`
`
`Getting Started
`
`Page 15 of24
`
`Q. Is there any sample code showing how to program DirectShow?
`
`A. The DirectShow SDK includes sample source code in C, C++, and Microsoft Visual Basic®.
`For more information, see DirectShow Samoles.
`
`Q. What compiler do I need for DirectShow development?
`
`A. DirectShow was designed with Visual C++® 5.x in mind, but any compiler capable of
`generating Component Object Model (COM) objects should work once the compiler's
`environment has been configured correctly. The base class libraries might need to be rebuilt to
`work completely since compilers can vary between versions.
`
`Q. Do I need a compiler to play back movies?
`
`A. No. Once DirectShow is installed, double-click any media file to view it. If you want more
`specialized applications, you can program DirectShow by using either C/C++ (in which case a
`compiler is required) or any Automation-compatible language (such as Visual Basic).
`
`Q. When will DirectShow be integrated with Microsoft's operating systems?
`
`A. DirectShow will be included in the next and future versions of Windows.
`
`Q. Is the source for the ActiveMovie Control (Amovie.ocx) available?
`
`A. No, the source is not available.
`
`Q. What DirectX technologies are available on Windows NT?
`
`A. Windows NT 5.x supports DirectX Foundation 5.x, including DirectDraw, DirectPlay®,
`DirectSound, Direct3D®, and Directlnput®. Windows NT 4.x supports DirectDraw, DirectPlay,
`and DirectSound.
`
`Q. Can you recommend any reference books for Windows programming or COM?
`
`A. Several books from Microsoft Press, including Advanced Windows by Jeffrey Richter and
`Understanding ActiveX and OLE by David Chappell, make great references for DirectShow
`developers.
`
`Q. What is a GUID?
`
`A. A globally unique identifier (GUID) is a 128-bit (16-byte) integer that an algorithm creates.
`The algorithm uses several criteria, including the current date, time, and a machine identifier,
`to ensure that it will be unique. GU!Ds are used extensively in the Component Object Model
`(COM) and have an important role in DirectShow.
`
`Q. How do I get a .G..U.IQ?
`
`A. GU!Ds can be generated using Guidgen.exe. Guidgen, a Windows-native program, is
`included with Microsoft's Visual C++® products. Developers can also use Uuidgen.exe, a
`console application, in the Platform SDK.
`
`15
`
`
`
`Getting Started
`
`Page 16 of 24
`
`Q. When do I need to call Ouerylnterface?
`
`A. Whenever you need to obtain an interface for an object.
`
`Q. What are some typical "getting started" problems with COM?
`
`A. Some typical problems involving COM are:
`
`• Forgetting to create a new GUID is a very common problem in filter development. For
`example, if you create a new filter based on one of the sample filters, you must create a
`new G..UlQ for your filter. Otherwise, when you install your filter, it will overwrite the
`information that was already registered for the sample filter. Create a new G..UlQ by using
`the Guidgen.exe tool.
`• Omitting the address of(&)' operator in the last parameter of a call to Ouerylnterface or
`CoCreatelnstance causes an exception when trying to use the object specified in that last
`parameter. The problem can be difficult to debug, because the void cast required
`prevents a compiler warning. The following example shows both the bad and the good
`syntax in a call to Queryinterface.
`
`!Unknown *pUnk;
`
`II bad -- you will hit an exception when you try to use punk
`II HRESULT hr= pObject->Queryinterface(IID IPersist,
`II
`(void **)punk); II<-- bad
`
`//good
`HRESULT hr
`
`note the '&' is required for the last parameter
`pObject->Queryinterface(IID IPersist,
`(void **)&punk); II<-- good
`
`Redistribution Questions
`
`Q. What parts of DirectShow can I redistribute?
`
`A. The SDK includes a redistributable package under the Redist directory.
`
`Q. Is the source to the Filter Graph Editor (Graphedt.exe) tool available? Can the
`Filter Graph Editor be redistributed?
`
`A. No, the source is not available, and Graphedt.exe is not redistributable.
`
`Q. How can I install the DirectX Media redistributables package from my application?
`
`A. The DirectX Media redistributable package is called Dxmedia.exe. An application must
`register itself as a client of the redist package by running Dxmedia.exe with the -id switch and
`a unique identifier for the application, as shown in the following syntax:
`
`dxmedia.exe -id:identifier
`
`The identifier should uniquely identify your application. It can be the GUID of your registered
`application, or a unique string. You should probably not use a string such as "game," but a
`more distinctive string. For example:
`
`16
`
`
`
`Getting Started
`
`Page 17 of24
`
`dxmedia.exe -id:myrocketgame
`
`-or-
`
`dxmedia.exe -id:my_GUID
`
`The identifier is required. If you simply type "Dxmedia.exe" or simply double-click on the
`Dxmedia.exe icon, nothing will be installed.
`
`The same syntax is used for all platforms, Windows 95, Windows NT x86, and Windows NT
`Alpha. Note that each processor has its own executable (either an Alpha or an x86 version).
`
`If successful, the installation can return one of the following success codes:
`
`the installation completed successfully.
`• ERROR_SUCCESS -
`the installation was successful, but changes
`• ERROR_SUCCESS_REBOOT_REQUIRED -
`will not be effective unti