Search code examples
winapivideodirectshowvideo-capturegraphedit

Graphedit intelligent connect - weird behavior


I am building a graph using ICaptureGraphBuilder2 in my directshow code.

I am adding instance of my camera and a VMR9 renderer to the graph and I try to intelligent connect it using RenderStream API using capture pin and format MEDIATYPE_video implemented.

If I use ROT to export the resultant graph built, I can see a smarttee filter, decompressor filter and a color space converter filter in between my source and render filters.

But in Graphedit, I build my own graph with the same source and render filters and try to intelligent connect it using rightclick->renderpin in my capture pin, no intermediates are getting added.

Why is this weird behavior ?


Solution

  • It is behavior by design, IGraphBuilder::Render vs. ICaptureGraphBuilder2::RenderStream. MSDN has the differences documented:

    Smart Tee. Some capture filters have a capture pin but no preview pin. To preview, the capture pin must be connected to the Smart Tee Filter. This filter splits the data into two streams, a capture stream and a preview stream. When you specify PIN_CATEGORY_PREVIEW or PIN_CATEGORY_CAPTURE, the method inserts a Smart Tee filter if one is needed. Then it renders the specified stream on the Smart Tee filter. If you render a preview stream and the method uses a Smart Tee filter, it returns VFW_S_NOPREVIEWPIN.