AviSynth / AviSynthPlus

AviSynth with improvements
http://avs-plus.net
963 stars 73 forks source link

C++ `struct AVS_Linkage` not harmonizing with C `struct AVS_Library` #334

Open Enyium opened 1 year ago

Enyium commented 1 year ago

I didn't check everything. I just noticed that the C struct AVS_Library (avisynth_c.h) contains

  // V9
  AVSC_DECLARE_FUNC(avs_is_property_writable);
  AVSC_DECLARE_FUNC(avs_make_property_writable);

But the C++ struct AVS_Linkage (avisynth.h) only has

  // V9: VideoFrame helper
  bool          (VideoFrame::*IsPropertyWritable)() const;

and not MakePropertyWritable(). Doesn't this prevent calling this function?

And avs_..._property_writable() are in turn missing in the function list in avs_load_library(). Is avs_load_library() old, because avs_..._property_writable() are mentioned elsewhere in the header file? If so, can it be removed?

@pinterf: You said we must not forget to bump the interface version number. Is there also something regarding avisynth_c.h and the interface additions we must not forget?

pinterf commented 1 year ago

MakePropertyWritableis an IScriptEnvironmentmethod, unlike IsPropertyWritable. This is why only the latter appears in AVS_Linkage.

As far as I know, C plugins (there is not much I am aware of), don't use avs_load_library. They have their own loader into their own struct. avs_load_library is just a helper function with some convenience conversion of some functions which would be missed from the old Avisynth. Anyways, unlike avisynth.h, avisynth_c.h is usually edited or converted.

But yes, those two v9 entries are missing from AVSC_LOAD_FUNC, accidentally.

As for what must be arranged and ported for C interface, I'm gonna return to the topic later next week.