Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > VirtualDub Filters and Filter Development > Virtualdub Plugin Program


Posted by: rudi Mar 7 2003, 10:42 AM
Hi,

Can someone please help me to get a bare minumum of code needed to use virtual dub filters from other programs and please explain to me how to use it... I have tried with borland but with no success. I can load the filter and I can retrieve its description but I can't use it... Please help!!!

Posted by: fccHandler Mar 7 2003, 04:48 PM
You can't use VirtualDub plugins in other programs. See this topic:
http://virtualdub.everwicked.com/index.php?act=ST&f=7&t=1530&s=9c1906063b65103858445b19a0e70fe5

Posted by: rudi Mar 9 2003, 11:36 AM
Thank you for your reply but I am still lost...

I've taken some code from virtualdub which loads the dll, I then get the pointer to the start, run, config, etc functions... My main problem now is it requires something like a FilterActivation structure for every function... I try to create my own by filling the current and last frame with 'n char buffer of 320 * 240 * 3 filled with 0's. It still gives me a access voilation. I need to find out how this FilterActivation (or something like this) works???? I will post the code on monday, I dont have it with me, the other problem I have is that I use Borland C++ Builder ;-)... Is this the problem??? The filter loads ok and I can read the description from, i think its called something like Filterdefinition structure that is created by the Add function... I will check my refrences on monday and correct what I might have wrong here... Will post soon, pleeeeeease help...

Rudi

Posted by: fccHandler Mar 9 2003, 04:25 PM
A good source of information is the official http://www186.pair.com/vdub/filtersdk. Even better, try writing your own filter and you'll have a better understanding of how they work.

The FilterActivation structure is created and managed by VirtualDub internally. The only way to create one yourself is to somehow emulate the code in VirtualDub that initializes the structure (including the function pointers).

It's not entirely impossible, but I think you've got a lot of work ahead.

Posted by: ChristianHJW Mar 9 2003, 10:59 PM
Maybe Avisynth is better for what you are trying to do ?

Posted by: phaeron Mar 10 2003, 12:43 AM
VirtualDub filters use XRGB32, not RGB24. You have to allocate 320*240*4 bytes. The buffer also needs to be dword-aligned, but new/malloc does this for you.

You don't need to support the full API in order to load 99% of the plugin filters out there -- Avisynth only supports the core and mostly works. Warpsharp is one of the few exceptions (oops), and DGraft already patched it to work in Avisynth. I'm probably going to drop a few of the more unused functions, most notably DC support, in a future version anyway.

Posted by: rudi Mar 12 2003, 02:05 PM
Thankyou,

I am looking at avisynth at the moment and I looks very intresting... I will have a play and see if I can get more info and see if I can use it.

Can someone please explain to me how XRGB32 works???

Byte 0 - R
Byte 1 - G
Byte 2 - B
Byte 3 - ????

I will then try this too to see if it makes a difference.

Posted by: phaeron Mar 13 2003, 08:23 AM
XRGB32 on Windows is ordered so that when you access the array as (DWORD *), you have 0xXXRRGGBB in hex for each pixel. That means the byte ordering in memory is:

byte 0: blue
byte 1: green
byte 2: red
byte 3: garbage

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)