1

Currently I'm writing a DirectShow based application that should help users configuring their TV capture cards, since GraphEdit seems to be too difficult for most to understand. The idea is that this application exports the generated Graph to a .GRF file, that will be used in another application.

Users can select which device (IMoniker) should be used to create a source filter, and can change some settings regarding video / audio.

Next to exporting .GRF files, my application should also have the feature to import such files. My question is: how do I find what moniker / device was used to create the source filter in the imported graph?

I tried creating a list of source filters for all connected devices, and comparing those to the source filter in the imported graph, but that did not seem to work.

Rudey
  • 4,717
  • 4
  • 42
  • 84

1 Answers1

2

You cannot tell moniker from created instance. To distinguish between monikers and be able to find the one you need, use their IMoniker::GetDisplayName string as a unique persistent identifier.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • I have an example where the display name isn't unique, so I can't use the name of the instance to find out which IMoniker was used to create it. – Rudey Nov 14 '12 at 09:55
  • 1
    It's hardly possible, are you sure you are not confusing moniker display name, and friendly name of the filter. I think it is what is happening. – Roman R. Nov 14 '12 at 10:02
  • Ah, you're right, I am confusing both names. I now understand that I can use this DisplayName to identify IMonikers, but can I find out which DisplayName is linked to which source filter? – Rudey Nov 14 '12 at 10:12
  • 1
    No you cannot. Once instantiated, the object does not know the path it came from. It is up to you to remember moniker display name to be able to instantiate again. This is not on GRF file, so perhaps your choice of using it to completely describe topology is not the best solution. – Roman R. Nov 14 '12 at 10:16
  • If it is not in the .GRF file, I know enough, thank you. I will probably end up creating another file which remembers which moniker was used. – Rudey Nov 14 '12 at 10:23