Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
14th May 2017, 22:08 | #263 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
Colorspace matrix? Virtualdub understands 2 types of matrix 601/709. So it is set to one of these when encoding.
__________________
VirtualDub2 |
14th May 2017, 22:09 | #264 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Quote:
Copying any non-standard format to the clipboard is probably complicated. IIRC you have to render multiple versions of your data so each client application gets the best version it can accept (see: Photoshop etc). I can understand if shekh gives a very low priority to something like that. |
|
15th May 2017, 10:21 | #266 | Link | |
Registered User
Join Date: Mar 2015
Posts: 775
|
Quote:
Afaik no other clipboard picture format is widely supported; I tried to support alpha channel and gave up. Why it does not work with some formats should be fixed, for some (historical?) reasons VD implemented 2 picture conversion routines: one is normal and the other (used for clipboard copy) covers only subset of formats.
__________________
VirtualDub2 |
|
15th May 2017, 11:29 | #267 | Link | |
Registered User
Join Date: Mar 2015
Posts: 775
|
Quote:
1) explicit - navigate to compression -> pixel format, set colorspace to rec 709 2) auto - when compression->pixel format is set to auto, it will match source file format/colorspace (not last filter!) However "auto" is disabled with x264 codec. "no change" option for colorspace seems ill-defined for output (in most cases it means default=601). If you want to keep filter output as is, you need to repeat same settings as the filter. For example: If your last filter is alias format "709-FR" Select "709-FR" in compression->pixel format dialog (it will be indicated in "save video" too). In this setup there will be no colorspace change between filters and compression.
__________________
VirtualDub2 |
|
23rd May 2017, 09:55 | #268 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
SDK evolution suggestion.
I'm still using "standard" SDK, didn't make the leap to use yours yet (but intend to in a not too far future), but i've made a small change, maybe you can do the same in your next release. The VDXVideoFilter class offers a "constructor" with the Init function, but doesn't offer a "destructor". So, i've added a DeInit function (because i needed it). The following change in the code are: VideoFilter.h Code:
virtual bool Init(); virtual void DeInit(); virtual uint32 GetParams()=0; Code:
bool VDXVideoFilter::Init() { return true; } void VDXVideoFilter::DeInit() { } void VDXVideoFilter::Start() { } .... void __cdecl VDXVideoFilter::FilterDeinit (VDXFilterActivation *fa, const VDXFilterFunctions *ff) { VDXVideoFilter *pThis = *reinterpret_cast<VDXVideoFilter **>(fa->filter_data); pThis->fa=fa; pThis->DeInit(); pThis->~VDXVideoFilter(); } |
23rd May 2017, 10:10 | #269 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
Just checked, this is not necessary.
There is virtual destructor: Code:
class VDXVideoFilter { public: VDXVideoFilter(); virtual ~VDXVideoFilter(); Code:
void __cdecl VDXVideoFilter::FilterDeinit (VDXFilterActivation *fa, const VDXFilterFunctions *ff) { (*reinterpret_cast<VDXVideoFilter **>(fa->filter_data))->~VDXVideoFilter(); }
__________________
VirtualDub2 |
23rd May 2017, 10:25 | #270 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Yes, but how do i put the code i need to run on "destructor" if i don't create the DeInit function ?
Because you musn't create your own constructor/destructor in your filter, because of the copy there is sometimes, so if you want a specific code to be run on constructor, you have to put it on Init function, but it's missing actualy a DeInit function to do the same thing. Because of the interface, there is "copy constructor" operations on the instance filter, when you call the interface menu, etc. The existance of the Init function ensure that a specific constructor code will be run only once, and not several times, and the same with the DeInit. You can't create/change the destructor (and also the constructor), to put your code, otherwise it will be called each time a copy of the object will be created. There is the Init function for that for the constructor, but there is not such function for the destructor. The value added by DeInit is to ensure that your code wil be runned only when the system will call FilterDeinit. The same way Init ensure that your code wil be runned only when the system will call FilterInit. Last edited by jpsdr; 23rd May 2017 at 10:30. |
23rd May 2017, 11:25 | #271 | Link | |
Registered User
Join Date: Mar 2015
Posts: 775
|
I say DeInit has no value because it does not do anything differently.
You can see in your code: Code:
void __cdecl VDXVideoFilter::FilterDeinit (VDXFilterActivation *fa, const VDXFilterFunctions *ff) { VDXVideoFilter *pThis = *reinterpret_cast<VDXVideoFilter **>(fa->filter_data); pThis->fa=fa; pThis->DeInit(); pThis->~VDXVideoFilter(); } Quote:
I understand the idea of Init-Deinit symmetry, but it is impossible. The instance can be created differently, but is must always destroy itself the same way, no matter how it was created. There is no way you can run a complete destructor for "initial" object and partial destructor for cloned object. This cannot work. I remember the copy-constructor issue. The proper filter example: Code:
class Filter: public VDXVideoFilter { public: Param param; void* buf; Filter(){ init(); } Filter(const Filter& a){ init(); param=a.param; } void init(){ buf=0; } ~Filter(){ free(buf); } }; default constructor "Filter(){ init(); }" copy constructor "Filter(const Filter& a){ init(); param=a.param; }" helper function to avoid typing the same shit in both constructors "void init(){ buf=0; }" destructor "~Filter(){ free(buf); }" This is bare generic minimum to implement/think of. What If instead I write something like this: Code:
class Filter: public VDXVideoFilter { public: Param param; void* buf; virtual Init(){ buf=0; } virtual DeInit(){ free(buf); } }; Code:
Filter(const Filter& a){ param=a.param; buf=a.buf; } How do you plan to sort this with virtual DeInit? It does not help at all. Only copy constructor can decide what to do.
__________________
VirtualDub2 |
|
23rd May 2017, 12:19 | #272 | Link | |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Quote:
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. |
|
23rd May 2017, 12:57 | #273 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Quote:
. |
|
23rd May 2017, 13:16 | #274 | Link | |||||
Registered User
Join Date: Mar 2015
Posts: 775
|
The part you probably misread in the sdk:
Quote:
Quote:
Quote:
The only sane rule is: everything you allocate must be reasonably freed. Where exactly to put something can only be advice, not rule. btw can you share sdk 1.2? It seems I have lost it (only 1.1 is still on virtualdub.org) If you want to read help to the letter: Quote:
Quote:
initProc = Constructor (constructor is wrapper for initProc) deinitProc = Destructor (destructor is wrapper for deinitProc) copyProc = Copy constructor (copy constructor is wrapper for copyProc) Do you still insist to ignore copy constructor? Why there exists virtual VDXVideoFilter::Init? IMO you are supposed to ignore it unless you want to return error to deny filter usage (maybe it cannot find required library). Init is called anyway after constructor is called but there is no way to return error from a constructor.
__________________
VirtualDub2 |
|||||
23rd May 2017, 13:31 | #275 | Link | |
Registered User
Join Date: Mar 2015
Posts: 775
|
Quote:
I think it is good idea to show all steps "source (YUV420) -> filters (RGB24) -> compression (YUV420)"
__________________
VirtualDub2 |
|
23rd May 2017, 13:39 | #276 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
I'll send you by mail the SDK when back home. So, according what you said, the "only" purpose of VDXVideoFilter::Init is to be able to return value and throw exception.
If i don't want to do either of them, i could just create a constructor (and also a destructor if needed) of my filter class, and it will also do the trick. Ok. I'll restore to the original, and add a destructor to my filter created from VDXVideoFilter instead do to the DeInit job, and keep Init, as it's allready implemented. |
24th May 2017, 11:40 | #278 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Posting link would be nicer and available to anyone
EDIT: VDub Filter SDK versions v1.00, v1.05, and v1.10 EDIT: LINK DELETED
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 24th May 2017 at 12:09. |
24th May 2017, 12:03 | #279 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
Added here so hopefully I dont lose it again.
Anyone has source code for these chm docs?
__________________
VirtualDub2 |
24th May 2017, 12:09 | #280 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
All versions in one package, VDUB_FiltSDK_1-00_1-05_1-10_1-20.zip
http://www.mediafire.com/file/axfipb..._1-10_1-20.zip
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
|