| Dowitchers Tutorial 1 |
|
|
|
|
This is an introduction to programming Dowitchers applications. We just wrote the shortest program to display a video. I suppose there is a need for "Tutorial 0" which would explain the basic concepts of programming audio and video on Microsoft with DirectShow: things like media types and samples, pins and filters, and the graph of filters for an application. Maybe I'll just paste in the Introduction to my tutorials "Programming DirectShow application in C#". The support files (including all the source code) can be found here. Assuming you have a basic understanding of the previous concepts, we start our program with a declaration of the Dowitchers namespaces:
Then we create a form, a panel and a VideoControl objects that will be used to display the video:
Now, we are reading for some real Dowitchers code:
We create a Graph object, then a presenter object that wraps the Managed DirectX device used for the application. We are now ready to call the Graph AddSource method to try to identify the media format used and setup the appropriate internal data structures. If this succeeds, we call the Render method with filter object returned by the AddSource method. Then we get the graph running. We are now ready to display the result and we make sure that when the user closes the window, we stopped all worker threads:
That's it. If you're familiar with DirectShow, you should feel right at home with Dowitchers. With the Vfw wrapper, you should be able to play most avi files if you have ffshow installed on your machine. |
| < Prev | Next > |
|---|














