* Rename `JImageProxyHostObject` -> `FrameHostObject` * `FrameProcessorPlugin` -> `JFrameProcessorPlugin` 1/2 * `FrameProcessorPlugin` -> `JFrameProcessorPlugin` 2/2 * Make `const` * Make `getName()` instance based * Update JFrameProcessorPlugin.h * Update JImageProxy.h * `T` * T * Remove default ctor * Use `TSelf` again * Return `local_ref<CameraView*>` instead of `CameraView*` * Make `findCameraViewById` return a raw pointer again... * Extract `setFrameProcessor` and `unsetFrameProcessor` * Use `global_ref` * Use `static_cast` for `FrameHostObject` * Update FrameProcessorRuntimeManager.cpp * Fix reference lint error * linelength * Fix `unsetFrameProcessor` call
31 lines
834 B
C++
31 lines
834 B
C++
//
|
|
// 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;
|
|
|
|
using TCallback = jobject(alias_ref<JImageProxy::javaobject>, alias_ref<JArrayClass<jobject>>);
|
|
|
|
local_ref<jobject> JFrameProcessorPlugin::callback(alias_ref<JImageProxy::javaobject> image,
|
|
alias_ref<JArrayClass<jobject>> params) const {
|
|
auto callbackMethod = getClass()->getMethod<TCallback>("callback");
|
|
|
|
auto result = callbackMethod(self(), image, params);
|
|
return make_local(result);
|
|
}
|
|
|
|
std::string JFrameProcessorPlugin::getName() const {
|
|
auto getNameMethod = getClass()->getMethod<jstring()>("getName");
|
|
return getNameMethod(self())->toStdString();
|
|
}
|
|
|
|
} // namespace vision
|