Log in

View Full Version : Use of unregistered filters.


CyberShaman
25th December 2004, 17:54
I'm building an video player and would like to bundle some decoders with the program. Is it possible to use directshow filters without them being registered?

For example.
If there is a "xvid.ax" in my program folder, can i use it even if it's not registered or is it necesery to run it through "regsvr32". I'm no guru in directshow or COM.

DaveEL
25th December 2004, 18:18
Originally posted by CyberShaman
I'm building an video player and would like to bundle some decoders with the program. Is it possible to use directshow filters without them being registered?

For example.
If there is a "xvid.ax" in my program folder, can i use it even if it's not registered or is it necesery to run it through "regsvr32". I'm no guru in directshow or COM.


Yes it can be done.... but

You do need to be a dshow/com guru (basically the automatic graph generation won't work so you will need to do that yourself).

Dave

CyberShaman
25th December 2004, 18:42
Well i'm no guru but i'm not that beginner either. I do know how to create graphs and thats exatly how this program will operate. It's going to be something similar to graphedit. I'm pretty fast learner so if you have any pointers on where to start please let me know.

DaveEL
25th December 2004, 23:21
Media player classic

DaveEL

diehardii
26th December 2004, 03:11
The caveat is that if you have the code to these filters, it will be much easier. Without the code, I'm not sure if you can do this. With the code, just instantiate your filter with new. If you don't have the code, this will be hard because you will have to loadlibrary, but you won't have any idea of how to access it via COM. Good luck.

~Steve

CyberShaman
26th December 2004, 12:30
Success! :cool:

This seems to work: (Delphi code)

var
DllGetClassObject: function(const CLSID, IID: TGUID; var Obj): HResult; stdcall;
ClassF: IClassFactory;
base: IBaseFilter;
LibHandle: Integer
begin
LibHandle:= LoadLibrary('xvid.ax');
DllGetClassObject:= GetProcAddress(LibHandle, 'DllGetClassObject');
DllGetClassObject(CLSID_XVID, IClassFactory, ClassF);
ClassF.CreateInstance(nil, IID_IBaseFilter, base);

FilterGraph.AddFilter(base, 'Xvid Decoder')
end;