Log in

View Full Version : GetVersion() question


esby
25th March 2004, 01:21
I am wondering about the actual use of GetVersion()

Since i'm never seen it redefined...
And if it is supposed to allow to check plugin version,
there's something:
- Obviously wrong
- Or that I obviously keep missing...

because if GetVersion() implementation is
{ return AVISYNTH_INTERFACE_VERSION;}

No matter what version we upgrade avs, it will keep telling avs
the filter has been build for this version...

Which I find somewhat useless...

Now if it is supposed to tell for which version the filter was created,
it should be [ return <insertFixedVersionNumberHere> ;}

And the checks in avs (for external filter only i suppose)
should be customized depending the actual support.
let's take a totally fictive example:
supposed we get a version 3.5 and 4.5... ( which will not happend for tomorrow anyway)
supposing 3.5 supports FilterVersionReply 2 3 4
and supposing 4.5 supports 4 & 5

the only implementation that would change would be the one defining the check.
And i'm using 3.5 for 2 3 4, just to put another problem.
If we have a compatibility break, the fact the version number replied is integer, we will not able to detect it properly,
unless FilterVersionReplies are not linked linearly to AvsVersionNumbers (which can be decimal...)

So what i suggests is something like that:

AVS version <----> possible filter version reply
1 <--------------> 1
2 <--------------> 2,3,4
3 <--------------> 5,6,7
etc.

That would allow to easily detect non compatibility,
introduced by adding new member-functions to ICLip...
And since there is no implementation of version 3,
we can use as many filter version number as we'll ever need,
until v3 is out...

esby

stickboy
25th March 2004, 03:21
I believe that AVISYNTH_INTERFACE_VERSION represents the version number of the plug-in interface; I don't think it is directly related to the AviSynth version.

I would guess that the intent is that if the public structures change, the runtime can query a filter to determine which version of the structures the plug-in expects. If it doesn't match the structure versions the runtime uses, the runtime then could reject the plug-in or could make the appropriate structure transformations.

But as far as I can tell, GetVersion() is never called anywhere, so I don't think it matters.

If the interface remains constant and a filter is dependent on the exact version of the AviSynth runtime, then it could perform its own checks through env->Invoke("VersionNumber", ...).

esby
25th March 2004, 04:06
mmm indeed it is defined in the avisynth.h ( -. I was blind)

Actually i might use GetVersion()
to recognize external plugins at runtime from internal (applied to DStreaming),
But that would mean 'reserving' (in the 'future')
the versionreply 3 for the plugins based on version2+directStreamStructure...

While versionreply 2 would be the actual plugins...
(or the future ones, supposing nothing drastically change)

esby