From 6a04c42c713dcce09dac4fb9b9dd4aa29f2acd80 Mon Sep 17 00:00:00 2001 From: akarin Date: Mon, 1 Aug 2022 12:20:20 +0900 Subject: [PATCH] src/vsutl/FilterBase.cpp: fix api4 build Signed-off-by: akarin --- src/vsutl/FilterBase.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vsutl/FilterBase.cpp b/src/vsutl/FilterBase.cpp index 68b1731..a208f9a 100644 --- a/src/vsutl/FilterBase.cpp +++ b/src/vsutl/FilterBase.cpp @@ -173,15 +173,15 @@ std::string FilterBase::get_arg_str (const ::VSMap &in, ::VSMap &out, const char class CustomFunction { const VSAPI &_api; - VSFuncRef *_func; + VSFunction *_func; CustomFunction &operator=(const CustomFunction &rhs) = delete; CustomFunction &operator=(CustomFunction &&rhs) = delete; public: - CustomFunction(const VSAPI &api, VSFuncRef *func) : _api(api), _func(func) + CustomFunction(const VSAPI &api, VSFunction *func) : _api(api), _func(func) { } - CustomFunction(const CustomFunction &rhs) : _api(rhs._api), _func(_api.cloneFuncRef(rhs._func)) + CustomFunction(const CustomFunction &rhs) : _api(rhs._api), _func(_api.addFunctionRef(rhs._func)) { } CustomFunction(CustomFunction &&rhs) : _api(rhs._api), _func(rhs._func) @@ -190,17 +190,17 @@ class CustomFunction { } ~CustomFunction() { - if (_func) _api.freeFunc(_func); + if (_func) _api.freeFunction(_func); } double operator()(double x) { VSMap *_in = nullptr, *_out = nullptr; _in = _api.createMap(); _out = _api.createMap(); - _api.propSetFloat(_in, "x", x, paReplace); - _api.callFunc(_func, _in, _out, NULL, NULL); + _api.mapSetFloat(_in, "x", x, maReplace); + _api.callFunction(_func, _in, _out); _api.freeMap(_in); - const char *errmsg = _api.getError(_out); + const char *errmsg = _api.mapGetError(_out); if (errmsg) { std::cerr << "resample: custom kernel error: " << errmsg << " at x = " << x << std::endl; @@ -208,7 +208,7 @@ class CustomFunction { return 0.0; } int error = 0; - double y = _api.propGetFloat(_out, "val", 0, &error); + double y = _api.mapGetFloat(_out, "val", 0, &error); _api.freeMap(_out); if (error != 0) std::cerr << "resample: custom kernel did not return value for x = " << x << std::endl; @@ -230,7 +230,7 @@ std::function FilterBase::get_arg_func (const ::VSMap &in, ::VSM { int err = 0; clip_neg_arg_pos (pos, in, name_0); - VSFuncRef * tmp_0_ptr = _vsapi.propGetFunc (&in, name_0, pos, &err); + VSFunction * tmp_0_ptr = _vsapi.mapGetFunction (&in, name_0, pos, &err); test_arg_err (out, name_0, err); assert (tmp_0_ptr != 0); return CustomFunction(_vsapi, tmp_0_ptr);