1
votes

At the moment I'm developing a DirectShow application that helps users configuring their TV capture cards. This configuration will later be used in another program.

I use the ICaptureGraphBuilder2::RenderStream method to render both video and audio. The source of my graph depends on which device the user selected, but this is mostly a device in the category WDM Video Capture Filter.

Here's my problem. Some devices won't work, because they need more than just a source filter. For example, I have a webcam that has a seperate filter for the audio. Another example, I have a TV tuner card that has it's own Encoder/Mux.

Since my application is supposed to work with most of the capture devices out there, is there a generic way to detect if there are, next to the source filter, additional filters required for the graph to work?

I could enumerate through all filters and check if their names are similar to each other, but names can't be trusted...

1

1 Answers

0
votes

DirectShow as a framework is basically a flexible DIY set of filters. You have a scattered set of them, and they (some) are also categorized, where enumerating a category you might make some assumptions as for included feature set.

In particular, there is no direct correspondence between video and audio (and other media types as well) sources. What you can do is to prompt user to choose devices (such as as a part of app configuration) and assume they are related and send sync'ed content, if applicable.

Another common task is to connect a crossbar, which you might be interested in working with TV tuners. There is a helper for this in Capture Graph Builder object, and you can leverage it. See "Supporting Filters" remark in ICaptureGraphBuilder2::FindInterface.