I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine.
Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is performing.
Is there any way to see debug output from GraphBuilder when it assembles a graph?
Is there a way to dump a working graph to see how it was put together?
Any other ideas for unraveling the mystery that lives in the DirectShow box?
Thanks! -Z
IGraphBuilder::SetLogFile (see http://msdn.microsoft.com/en-us/library/dd390091(v=vs.85).aspx) will give you lots of useful diagnostic information about what happens during graph building. Pass in a file handle (e.g. opened by CreateFile) and cast it to a DWORD_PTR. Call again with NULL to finish logging before you close the file handle.
The code in the following blog post for dumping a graph will give you some extra information to interpret the numbers in the log file.
http://rxwen.blogspot.com/2010/04/directshow-debugging-tips.html
You need to:
To register your filter graph as a "connectable" graph, call this with your filter graph:
And call this before you release the graph:
`
There is a detailed MSDN entry on this. http://msdn.microsoft.com/en-us/library/windows/desktop/dd390650(v=vs.85).aspx
You could "save" the graph (serialize it) to a .grf graphedit file, possibly: https://stackoverflow.com/a/10612735/32453
Also it appears that graphedit can "remote attach" to a running graph? http://rxwen.blogspot.com/2010/04/directshow-debugging-tips.html
Older versions of DirectX, I belive 9a, but not 9b had a "debug mode" for dshow. It would output logs of debug info into the debug console.
So download an older version, set it to debug. then open up debugview or load graphedt.exe in visual studio to see the debug info.
You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph...
In order to find your graph in the list, you have to register it in the running object table:
After destroying your graph, you should remove it from the ROT by calling IRunningObjectTable::Revoke