I am currently developing an application that uses DirectShow. The application should support many different webcams that probably have a lot of different output pin ColorSpace configurations (RGB, YUV, I420, etc).
When encoding i will always be using the same encoding filter and mux + file writer - however i won't know how to connect the Output pin on the Source filter to the input pin on the encoding filter, because it will depend on the source filter's output ColorSpace.
Examples:
- Source1 (RGB24) -> Color Space Converter -> RGB2YUV - > Encoder -> Mux -> File Writer.
- Source2 (YUV) -> Encoder -> Mux -> File Writer.
- Source3 (MJPG) -> MJPEG Decompressor -> Color Space Converter -> RGB2YUV -> Encoder -> Mux -> File Writer.
And so on.. meaning there could be lots of different filter configurations up until the encoder.
My question is now, is it perfectly okay to use Intelligent Connect() instead of ConnectDirect() to connect the Source filter to the encoder filter?
Or would I have to check the media type of the source output pin each time, and manually build the graph up depending on the Color Space (RGB,YUV..) of the source output pin?
Is there an easy way to do that, that I might not know about - seems like there could be and endless amount of possibilities to connect the source filter to the encoder..
Thanks for your help.