2021-09-29 12:30:50 +02:00
|
|
|
//
|
|
|
|
// Created by Marc Rousavy on 29.09.21.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "JFrameProcessorPlugin.h"
|
|
|
|
|
|
|
|
#include <fbjni/fbjni.h>
|
2023-09-01 12:58:32 +02:00
|
|
|
#include <jni.h>
|
2021-09-29 12:30:50 +02:00
|
|
|
|
|
|
|
namespace vision {
|
|
|
|
|
|
|
|
using namespace facebook;
|
|
|
|
using namespace jni;
|
|
|
|
|
2023-08-25 12:22:44 +02:00
|
|
|
using TCallback = jobject(alias_ref<JFrame::javaobject>, alias_ref<JMap<jstring, jobject>> params);
|
2021-09-29 12:30:50 +02:00
|
|
|
|
2023-09-01 12:58:32 +02:00
|
|
|
local_ref<jobject>
|
|
|
|
JFrameProcessorPlugin::callback(const alias_ref<JFrame::javaobject>& frame,
|
|
|
|
const alias_ref<JMap<jstring, jobject>>& 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
|