I have written a push source filter that I use privately in my Delphi 6 application. The application uses the DSPACK DirectShow component library. By privately I mean I simply add instances of the filter directly to my Filter Graph, instead of the filter residing in an external DLL (.ax file).
Should I create a unique class ID (GUID) for each instance of the Filter I create, or is it safe to use the same class ID between all instances created? I am concerned about this because each instance of the Filter creates a local data storage object for holding data queued for the Filter. The local data storage object is written to by other code within the host application thereby pushing data into into the Filter Graph via my push source filter .
I don't now enough about DirectShow to know how method pointers lookups are done to know if my design is safe. When I add an instance of a Filter to a graph directly, does DirectShow store the interface method pointers the Filter Graph will call by object reference, or by the class ID? If it's the former then everything will be fine, but if it's the latter, then that could be a problem if the same instance gets all the method calls. Does anyone know the answer to this design question?
Class identifier is specific to a class, not to class instance. Your filter class should have its own unique identifier, and all instances of the class would share it on runtime. If you are copying code from another project, you need to make sure you replace all existing CLSID, IID, LIBID identifiers with newly generated ones.