Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
DirectShow
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Architecture== DirectShow divides a complex multimedia task (e.g. video playback) into a sequence of fundamental processing steps known as [[Filter (software)|filters]].<ref>[https://msdn.microsoft.com/en-us/library/ms786509(VS.85).aspx Introduction to DirectShow application programming]</ref><ref>[https://msdn.microsoft.com/en-us/library/ms783354(VS.85).aspx DirectShow system overview]</ref> Each filter{{snd}}which represents one stage in the processing of the data{{snd}}has input and/or output ''pins'' that may be used to connect the filter to other filters. The generic nature of this connection mechanism enables filters to be connected in various ways so as to implement different complex functions.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ms778825(VS.85).aspx|title=About DirectShow filters|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}}</ref> To implement a specific complex task, a developer must first build a [[filter graph]] by creating instances of the required filters, and then connecting the filters together.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783701(VS.85).aspx|title=Overview of graph building|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}}</ref> There are three main types of filters: ;Source filters: These provide the source streams of data. For example, reading raw bytes from any media file. ;Transform filters: These transform data that is provided from other filter's output. For example, doing a transform such as adding text on top of video or uncompressing an MPEG frame. ;Renderer filters: These render the data. For example, sending audio to the sound card, drawing video on the screen or writing data to a file. During the rendering process, the filter graph searches the [[Windows Registry]] for registered filters and builds its graph of filters based on the locations provided. After this, it connects the filters together, and, at the developer's request, executes (i.e., plays, pauses, etc.) the created graph.{{Citation needed|date=August 2010}} DirectShow filter graphs are widely used in video playback (in which the filters implement functions such as file parsing, video and audio demultiplexing, decompressing and rendering) as well as for video and audio recording, editing, encoding, transcoding or network transmission of media. Interactive tasks such as DVD navigation may also be controlled by DirectShow.{{Citation needed|date=August 2010}}<!--whole paragraph citations needed--> [[Image:dsmp3graph.gif|thumb|center|962px|Filter graph of an [[mp3]] file, as rendered by the DirectShow sample in [[GraphEdit]], an application with a [[GUI]] for DirectShow used to visually build and test filter graphs.<ref name="GraphEdit">{{cite web|url=https://msdn.microsoft.com/en-us/library/dd390950.aspx|title=Overview of GraphEdit|work=MSDN Library|publisher=Microsoft|access-date=2010-08-17}}</ref> In this picture the boxes represent filters and the grey dots appearing on the sides of the filters represent pins.]] In the above example, from left to right, the graph contains a ''source filter'' to read an MP3 file, [[Stream (computing)|stream]] splitter and decoder filters to parse and decode the audio, and a ''rendering filter'' to play the raw audio samples. Each filter has one or more pins that can be used to connect that filter to other filters. Every pin functions either as an output or input source for data to flow from one filter to another. Depending on the filter, data is either "pulled" from an input pin or "pushed" to an output pin in order to transfer data between filters. Each pin can only connect to one other pin and they have to agree on what kind of data they are sending.{{Citation needed|date=August 2010}} Most filters are built using a set of C++ classes provided in the DirectShow SDK, called the DirectShow Base Classes.{{Citation needed|date=August 2010}} These handle much of the creation, registration and connection logic for the filter.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783325(VS.85).aspx|title=DirectShow Base Classes|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}}</ref> For the filter graph to use filters automatically, they need to be registered in a separate DirectShow registry entry as well as being registered with COM. This registration can be managed by the DirectShow Base Classes. However, if the application adds the filters manually, they do not need to be registered at all.{{Citation needed|date=August 2010}} Unfortunately, it is difficult to modify a graph that is already running. It is usually easier to stop the graph and create a new graph from scratch. Starting with DirectShow 8.0, dynamic graph building, dynamic reconnection, and filter chains were introduced to help alter the graph while it was running.<ref name="DynamicGraphs">{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783499(VS.85).aspx|title=Dynamic Graph Building|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}}</ref> However, some filter vendors ignore this feature, making graph modification problematic after a graph has begun processing.{{Citation needed|date=August 2010}} Although DirectShow is capable of dynamically building a graph to render a given media type, in certain instances it is difficult for developers to rely on this functionality and they need to resort to manually building filter graphs if the resulting filter graph is variable.{{Citation needed|date=April 2008}} It is possible for filter graphs to change over time as new filters are installed on the computer.{{Citation needed|date=August 2010}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)