Showing posts with label DirectShow. Show all posts
Showing posts with label DirectShow. Show all posts

Wednesday, December 9, 2009

GraphEdit

GraphEdit is a visual tool for building and testing filter graphs and it is provided as an executable with the DirectX SDK. GraphEdit can be used to verify the filter arrangement that we are going to implement in code level is working properly. It is possible to use GraphEdit in two ways to verify that. We can test the filter graph with the GraphEdit before write any application code or we can load a filter graph that the application creates to verify that our application is building the correct graph. Using the GraphEdit following basic tasks can be done.
  • Create and modify filter graphs.
  • Run, Pause and seek a filter graph.
  • View the property pages of the filters.
  • View the media types of pin connections.
Following figure shows a simple filter graph created using the GraphEdit to play a video file.


In the GraphEdit filters are displayed as boxes with a text caption inside it, which shows the name of the filter. Pins appear as small squares along the edges of the filters and input pins are shown on the left side of the filter and the output pins are shown on the right side of the filter. The arrows which connects one input pin to another output pin represents the connections between the filters.

Saturday, December 5, 2009

DirectShow Filter Graph

The basic building block of the DirectShow is called Filter and it is a software component that performs some operation on a multimedia stream. Filter Graph is a set of connected filters and an application performs any task by connecting chains of filters together. DirectShow applications don’t need to manage all the data flow within the filters. Application make high level API calls such as run of stop to move or stop data between the filters. There is a high level component which controls the data flow in filters and it is called Filter Graph Manager. It provides methods for the application to build the filter graph by connecting the filters together. All the filters and the Filter Graph Manager are all COM objects.

Filters can be grouped in to several broad categories. But the distinctions between these categories are not obsolete and some filters can put in to several categories. According to the DirectShow MSDN filters can be categorized in to five main categories as below.

  • Source filters – Source filters introduces data in to the graph. The data might come from a file, camera, network or anywhere else. Each source filter handles a different type of data source.
Ex: RTP source filters, Video capture Filter.
  • Transform filters – Transform filters takes an input stream, process the data and creates an output stream.
Ex: Encoders, Decoders, Color Space Converters.
  • Renderer filters – Renderer filters sit at the end of the filter chain of the filter graph and they receive data and present it to the user.
Ex: Video Renderer , Audio Renderer, File Writer
  • Splitter filters- Splitter filters splits and input stream in to two or more outputs.
Ex:AVI splitter- parses a byte stream into separate video and audio streams.
  • MUX filters – MUX filters take multiple inputs and combine them in to a single stream.
Ex: AVI MUX – takes audio and video streams and produces an AVI formatted byte stream.

Friday, December 4, 2009

Microsoft DirectShow API

When developing the softphone application I had to use Microsoft DirectShow API to handle multimedia.

Microsoft DirectShow API is the media streaming architecture for streaming media on the Microsoft Windows platform. Working with multimedia is a challenge due to the following reasons.
  • Multimedia streams contains large amount of data and need to process quickly.
  • Audio and video must be synchronized and played at the same rate.
  • Data can be comes from many sources like local files, networks, cameras etc.
  • Data may come with wide variety of formats.
  • The programmer doesn’t have knowledge about the hardware of the end user’s system.
The DirectShow is designed overcome above problems and the main design goal of the DirectShow is to simplify the task of creating digital media applications on the Windows platform by isolating applications from the complexities of the data transports, hardware differences and synchronization.

DirectShow provides the support for high quality capture and play back of multimedia streams and it supports wide variety of formats like ASF, MPEG, AVI, MP3, and WAV. DirectShow is based on Component Object Model (COM) where COM is and interface standard for software componentry introduced by Microsoft in 1993. It is used to enable inter process communication and dynamic object creation in large range of programming languages. So to write a DirectShow application or a component it is necessary to have a understanding about the COM client programming.

DirectShow can be used to development of applications like audio-video capture applications, file players, TV and DVD players, video editing applications, file format converters and many more. IF the programmer needs to write his own DirectShow component to support new formats or custom effects, it provides access to the underlying stream control architecture.