Thread: VirtualDub2
View Single Post
Old 23rd May 2017, 12:19   #272  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
Quote:
There is no way you can run a complete destructor for "initial" object and partial destructor for cloned object.
It think it's possible if the system call FilterInit and FilterDeinit only on "initial" object, and not the cloned.
This way, on cloned objet, "partial" constructor/destructor, without the specific code put in Init/DeInit will not be called.
And if "buff" is not allocated in constructor, but in Start, it must be freed in End, not DeInit or destructor.
The exemple code you put is not compatible with the filter SDK way. You de-allocate things on FilterDeinit (or deinitProc) only if they have been allocated on FilterInit (or initProc).

When you look at the SDK 1.2 help, in "Reference -> Video filter functions", there is initProc and deinitProc. All the "constructor stuff" must be put on initProc, and all the "destructor stuff" in deinitProc, they are "symmetrical", that what the SDK help says (well... not fully, because you can throw exceptions on initProc but not on deinitProc, but if we leave this appart). The Init in VDXVideoFilter class is somhow a wrapper to initProc (the same there is for Start/startProc, etc...), but there is actualy no wrapper for deinitProc, this is what i intended to do with DeInit.

Of course, SDK said also to put maximum allocation/buffer in Start and free of these in End, but there is things i have to do in initProc and deinitProc, and not in Start and End.

Last edited by jpsdr; 23rd May 2017 at 13:08.
jpsdr is offline   Reply With Quote