Upload
yossi-cohen
View
4.039
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Introduction to DirectShow programming 1st of nine lessons
Citation preview
www.dsp-ip.comFast Forward Your Development
Introduction to DirectShow - 1
Windows Media Streaming Architecture
www.dsp-ip.comFast Forward Your Development
Intel - Motivation & Goals
DirectShow is the most common architecture for:
•STB and IP-STB media streaming and broadcast reception
•PC Streaming Goals•Understand STB architecture, its
advantages and disadvantages•Fast prototyping and application building
for testing and demonstrations
www.dsp-ip.comFast Forward Your Development
What is DirectX•DirectX is Microsoft's component based
architecture for media processing.•Similar streaming architecture were
designed by:▫Real ▫Emblaze (RapidMedia)▫Linux (GStreaming)
•Media processing ▫Audio▫Video▫Transport streams▫text.
www.dsp-ip.comFast Forward Your Development
DirectX – Why we need it?•Software reusability
▫Code blocks can be reused and inherited▫Common Interfaces
•Easy connection between 3rd party modules
•Which components?▫Compression▫color conversion▫audio effects▫Transport stream handlers
www.dsp-ip.comFast Forward Your Development
BACKGROUND
DirectX Evolution from proprietary Codec to Filter base architecture
www.dsp-ip.comFast Forward Your Development
VFW• VFW architecture – a Plug-In
architecture that supported CODEC and CAPTURE Interfaces for Audio & Video stream manipulation.
• Advantages – All the CODECs have the same interfaces. There is no need specific modifications for each codec
Capture CODEC
Control Interfaces
IO Interfaces
www.dsp-ip.comFast Forward Your Development
VFW Problems Rigid architectureRigid architecture OnlyOnly three types of filters three types of filters How to add costume filters that split or How to add costume filters that split or
mux transport stream?mux transport stream? Rigid interfaces creates a problem to the Rigid interfaces creates a problem to the
future progress of the architecturefuture progress of the architecture
www.dsp-ip.comFast Forward Your Development
Active Movie•A Filter base architecture that support
customize filters•The architecture is built using:
▫Filters that manipulates the stream▫Pins that handle filter connection ▫graph management which
Connect the filters (automatically) Manage filters states (run, pause, stop) Transfer messages between filters
www.dsp-ip.comFast Forward Your Development
DirectX•Evolution of Active Movie (Audio & Video)
to other aspects:▫DirectShow – (previously ActiveMovie)
Audio/Video/Text.▫DirectDraw/Direct3D – Graphics.▫DirectSound – Sound effects and 3D sound.▫DirectPlay/DirectInput – Multiplayer Game
tools.▫DirectMusic – Automatic music generation
www.dsp-ip.comFast Forward Your Development
INTRODUCTION TO DIRECTSHOW
Hands-on DirectShow : GraphEdit
www.dsp-ip.comFast Forward Your Development
GraphEdit
•Visual Interface for graph building and testing.
www.dsp-ip.comFast Forward Your Development
GraphEdt – Rendering a file•Render a media file•The graph build is what the OS does when
you double-click on a file.•File rendering options:
▫Drag a media file to graph edit▫Use File->Open File▫Use:
graph->Insert filters use the circled button as a short cut
Select File Source Async. Right click on output pin and select render
www.dsp-ip.comFast Forward Your Development
GraphEdt - Play with it
•Use the: Play, Pause, and Stop commands▫Notice the file progress bar
•Use the slider to change the current play position
www.dsp-ip.comFast Forward Your Development
GraphEdit – A bit more• Try looking at filter properties:• Use right-click on the filter and select
“Filter Properties”• We will later look at the Interface that
enables the communication to property pages.
• Example of Source file property• This property is used only for monitoring
and not for controls. Why?
www.dsp-ip.comFast Forward Your Development
The Translator video• Lets view it using Graphedt Media\Metargemet.wmv• This video is a nice example for information
processing architecture• The information is:
▫ Generated at the source (Keren)▫ Processed and translated by a “transform unit” (Riki –
translator)▫ Rendered to the students▫ Feedback messages are passed from the Renderer to the
source via the translator
TeacherInfo. Source
Smart Student“Transform”
Student“Renderer"
www.dsp-ip.comFast Forward Your Development
DirectShow Basic ideas
•Information processing is a sequential process
•Each processing unit has a clear function•The Source “Push” or pump information to
processing units (Blue). Data information is always Unidirectional: “Downstream”
•Feedback is sent from the Renderer(s) to the source (Orange) – “Upstream”
•No Information loops
Source
“Transform” “Renderer"
www.dsp-ip.comFast Forward Your Development
Information passing architecture
•There are basically two methods:▫Push ▫Pull
•Those architecture differ in ▫threading, ▫Which filter is the active filter▫Where is the “Brain” of the graph
www.dsp-ip.comFast Forward Your Development
Push Architecture
•Source is active•Source generate Media Samples•information is pushed by the source •Like in the case of the “Metargemet”•Source is active, owns the “processing
thread”•Used in
▫ASF/WMA/WMV files▫Video capture (USB cam, video cards)▫BDA capture
www.dsp-ip.comFast Forward Your Development
Pull Architecture•Information is pulled by a non-source filter•Source is passive•Does not own the “processing thread”•In most file processing schemes (AVI,
MPEG2) the source is “dumb” and passive and the parser (demuxer) holds the “knowledge” of file parsing.
www.dsp-ip.comFast Forward Your Development
Components required•Data Processing unit– used for:
▫Media data Generation▫Media data manipulation/transform▫Media data rendering
•Interfaces – Generic Interfaces between data processing units ▫In “Metargemet” we use “Air Interface” with
two basic media descriptors•Media descriptors
▫In “Metargemet” we use two media types: Archaic speech media between Source and Transform “Sleng” between Transform (Riki) and Renderer
(Student)•Management unit (in “Translator” –
class/school)
www.dsp-ip.comFast Forward Your Development
Naming•Data processing unit = Filter
▫Used for data manipulation and transform.•Filter Interface = Pin
▫Used to define the connection between filters
▫Include information about: Direction Memory required Media Type
www.dsp-ip.comFast Forward Your Development
Naming - 2
•Media Descriptor = Media Type▫Include information about the media passed
•Data Unit = Media Sample▫Include the data itself▫Include information about the data
www.dsp-ip.comFast Forward Your Development
Filters•ActiveX objects
▫(Use COM Interfaces)•Manipulates data•Have Pin as members for interfacing other
filters•Three basic types: Source, Render,
Transform •Identification: GUID•Control – property pages
www.dsp-ip.comFast Forward Your Development
Pin
• Filters have one or more IO Interfaces - pins• Pin is a class which basically holds interfaces to
which connect processing modules (filters)• Pins could be exposed or hidden
▫ Look at Infinite Pin tee filter▫ Dynamic creation of pins for many types of filters:
Infinite Pin T MPEG and AVI Splitters
• Two basic type: ▫ Input ▫ Output
www.dsp-ip.comFast Forward Your Development
Graph Builder•Create a streaming process for example:
▫Read from file▫Demux▫Decode▫Encode▫Stream to network
•Tasks:▫Loads the filters▫connect Filters▫Change filter states▫Disconnect filters▫Remove filters from graph.
•The graph is always unidirectional (No loops)
•Have three basic states: Play, Pause, Stop.
www.dsp-ip.comFast Forward Your Development
DMOs
•DirectX® Media Objects (DMOs) •Create stream processing object that
could operate without a graph (Filters could only work as part of a graph)
•DMOs could operate inside a graph using a “DMO Wrapper” which acts as a filter
•Advantage▫Simpler interface▫No need to create a graph
www.dsp-ip.comFast Forward Your Development
DSP-IP Contact informationFor Course materials & lecture request contact: For Course materials & lecture request contact:
For projects development services contact: For projects development services contact:
Adi YakovAdi YakovTraining and Courses ManagerTraining and Courses [email protected]+972-9-8651933+972-9-8651933
www.dsp-ip.com Mail : Mail : [email protected] Phone: Phone: +972-9-8850956, +972-9-8850956, Fax : +972-50- 8962910Fax : +972-50- 8962910
Alona AshkenaziAlona AshkenaziTechnology Management Technology Management Services Services : : [email protected]+972-9-8850956+972-9-8850956