开发者

DirectShow - how to debug pin connect failures

I'm using an IGraphBuilder to render a video capture device to the screen. The process involves adding the capture filter to the graph, then adding a VideoMixingRenderer to the graph (which uses a custom allocator) and finally calling graph.Render() to use Intelligent Connect to wire up the pins. Under some circumstances this works well and my custom allocator is properly loaded (and InitializeDevice called), but in other circumstances the custom allocator isn't used and I get an ActiveMovie window displaying the capture device instead of my VMR that was added to the graph. It would appear that intelligent connect doesn't want to wire the capture device filter to the VMR and is instead creating its own renderer. Are there any tools or techniques to debug this? The call to graph.Render() succeeds with an HR of 0 so I'm not getting any information back from DirectShow about a connect failure. Hopefully a diagnostic tool exists that can give me a better view into what's going on in DirectS开发者_如何学编程how.


The intelligent connect logic will create a log file that you can use to track down errors. Use IGraphBuilder::SetLogFile (or the graphedt menu item). This logs all activity during graph building.

The most common reason for failing to connect to the vmr is that the upstream filter insists on using its own allocator, and so does the vmr. It's possible that in some cases you get a transform (eg colour space transform) between the two, and this copies buffers and so will use the vmr's allocator. Something like that, anyway, is a possible explanation.

G

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜