Malik Çelik Malik Çelik - 1 year ago 105
C# Question

GMFBridge source filter doesn't receive frame

I have a webcam and I want to start/stop video recording without stopping the renderer. That's why I want to use GMFBridge. My graphs are:

Webcam -> FFDShow -> SampleGrabber -> Infinite Tee -> Color Converter -> Renderer

|---> GMFBridge Sink Filter

GMFBridge Source Filter -> Color Space Converter -> Encoder -> File Writer

I do everything like documents (InsertSinkFilter, InsertSourceFilter, BridgeGraphs, etc.) but GMFBridge Source Filter doesn't receive any frame.

The GMFPreview sample in DirectShow.NET samples works but it uses RenderStream function to prepare the graph. The only difference between my code and GMFPreview is I manually add my filters and connect their pins and start the graph (I don't use RenderStream function).

What should I do to receive frame in GMFBridge Source Filter?

Answer Source

I can't believe how stupid mistake I made. I used to do bridge graphs with ICaptureGraphBuilder instances:

Bridge.BridgeGraphs(Graph_builder, Graph_builder2);

but actually I should bridge the graphs with sink filter and source filter parameters:

Bridge.BridgeGraphs(Graph_BridgeSinkFilter, BridgeSourceFilter);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download