Click to See Complete Forum and Search --> : How to play multi - file using DirectShow?


skywen
October 15th, 2004, 07:33 PM
the Video.Open Method can only open a file once?

but how to open multi-file once?

thanks!

Chief
October 27th, 2004, 03:45 AM
Hi Skywen,

there are 2 methods :

/******* 1 *********/
the different steps needed to do this are :

- create a filter graph manager
- query the graph builder interface
(those instances will help you to build the graph and insert/connect filters)

- query the IMediacontrol interface
(helps you to control the graph state run-pause-stop)

- create an async source filter (this one will be able to read your file)
- create an avi splitter filter
- create a renderer filter

then you'll have to connect them as follows :

async source -> avi splitter -> renderer

/******** 2 *********/

use the renderfile() method of the IGraphBuilder interface.
it will create filters and connect them automatically.




For more detailled informations : see http://www.flipcode.com/articles/article_directshow01.shtml
http://www.flipcode.com/articles/article_directshow02.shtml
http://www.flipcode.com/articles/article_directshow03.shtml

Chief
October 27th, 2004, 03:53 AM
I'm sorry i missed the important word in your topic ;-)

to play multiple files you 'll have to use multiple render filters...
the final graph will look like this :

async source 1 -> avi splitter 1 -> video renderer 1

async source 2 -> avi splitter 1 -> video renderer 2

async source n -> avi splitter n -> video renderer n

to display it you should connect each renderer to a different window id.
to do this make use the IVideoWindow interface of the renderer filter and the put_Owner(..) method.