2021-09-29 12:30:50 +02:00
|
|
|
//
|
|
|
|
// Created by Marc Rousavy on 29.09.21.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "JFrameProcessorPlugin.h"
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
#include <fbjni/fbjni.h>
|
|
|
|
|
|
|
|
namespace vision {
|
|
|
|
|
|
|
|
using namespace facebook;
|
|
|
|
using namespace jni;
|
|
|
|
|
2023-07-22 00:15:11 +02:00
|
|
|
using TCallback = jobject(alias_ref<JFrame::javaobject>, alias_ref<react::ReadableNativeMap::javaobject> params);
|
2021-09-29 12:30:50 +02:00
|
|
|
|
2023-07-22 00:15:11 +02:00
|
|
|
local_ref<jobject> JFrameProcessorPlugin::callback(const alias_ref<JFrame::javaobject>& frame,
|
|
|
|
const alias_ref<react::ReadableNativeMap::javaobject>& params) const {
|
2021-09-29 12:30:50 +02:00
|
|
|
auto callbackMethod = getClass()->getMethod<TCallback>("callback");
|
|
|
|
|
2023-07-22 00:15:11 +02:00
|
|
|
auto result = callbackMethod(self(), frame, params);
|
2021-09-29 12:30:50 +02:00
|
|
|
return make_local(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace vision
|