I'm working on an application that helps users configure their TV tuner cards. Basically the user selects a device, and the application generates a graph file (.GRF) as output. However, there are a few settings the user should be able to change. These settings include the video standard (PAL, NTSC, SECAM), video input (Tuner, Composite, SVideo), and so on.
In GraphEdit this can be accomplished by right clicking the desired filter, and select "Filter Properties...". However, I have no clue how to achieve the same in code.
Question 1: How do I change properties of DirectShow filters in code?
Because I use ICaptureGraphBuilder2::RenderStream to build my graph, I'm only holding references to the source filter and renderer. Most of the properties I would like to be able to change are found on other filters, such as the crossbar filter, which is added automatically by the RenderStream method.
Question 2: How do I obtain references to other filters in my graph, so I can change their properties?
Note: I won't use FindFilterByName because my application is supposed to work with most of the TV tuner cards, and every card as a different name.
Edit: I have found a way to obtain a reference to these filters by enumerating through EnumFilters. I then use QueryFilterInfo on every filter to find its name. This is different than using FindFilterByName, because I can now use Contains to find certain words (like "Crossbar"). However, I already have an example where the crossbar filter is named ("... Xbar"), so I'm still looking for a more generic way to do this. I wish I could find filters by their category...
By the way, I'm currently using the DirectShow.Net library, but I believe the approach should be the same as with the C++ library. However, I don't fully understand the C++ syntax, so if you are planning to post (a reference to) a code example, it would be a big help if it were in C# or VB.NET.
Solution: See the accepted answers comments. I need to cast the filters which properties needs to be changed to their respective interface. For example, the crossbar filter needs to be casted to the IAMCrossbar interface. With this interface I can now change all crossbar related properties.