Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

1– Introduction To Direct Show


Published on

Introduction to DirectShow programming 1st of nine lessons

Published in: Technology, Business

1– Introduction To Direct Show

  1. 1. Introduction to DirectShow - 1 Windows Media Streaming Architecture Fast Forward Your Development
  2. 2. 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 Fast Forward Your Development
  3. 3. 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. Fast Forward Your Development
  4. 4. 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 Fast Forward Your Development
  5. 5. BACKGROUND DirectX Evolution from proprietary Codec to Filter base architecture Fast Forward Your Development
  6. 6. 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 IO Interfaces Capture CODEC Control Interfaces Fast Forward Your Development
  7. 7. VFW Problems  Rigid architecture  Only three types of filters  How to add costume filters that split or mux transport stream?  Rigid interfaces creates a problem to the future progress of the architecture Fast Forward Your Development
  8. 8. 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 Fast Forward Your Development
  9. 9. 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 Fast Forward Your Development
  10. 10. INTRODUCTION TO DIRECTSHOW Hands-on DirectShow : GraphEdit Fast Forward Your Development
  11. 11. GraphEdit • Visual Interface for graph building and testing. Fast Forward Your Development
  12. 12. 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 Fast Forward Your Development
  13. 13. 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 Fast Forward Your Development
  14. 14. 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? Fast Forward Your Development
  15. 15. The Translator video • Lets view it using Graphedt MediaMetargemet.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 Teacher Info. Source Smart Student Student “Transform” “Renderer Fast Forward Your Development
  16. 16. 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 “Renderer “Transform” Fast Forward Your Development
  17. 17. 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 Fast Forward Your Development
  18. 18. 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 Fast Forward Your Development
  19. 19. 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. Fast Forward Your Development
  20. 20. 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) Fast Forward Your Development
  21. 21. 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 Fast Forward Your Development
  22. 22. 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 Fast Forward Your Development
  23. 23. 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 Fast Forward Your Development
  24. 24. 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 Fast Forward Your Development
  25. 25. 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. Fast Forward Your Development
  26. 26. 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 Fast Forward Your Development
  27. 27. DSP-IP Contact information For Course materials & lecture request contact: Adi Yakov Training and Courses Manager +972-9-8651933 For projects development services contact: Alona Ashkenazi Technology Management Services : +972-9-8850956 Mail : Phone: +972-9-8850956, Fax : +972-50- 8962910 Fast Forward Your Development