2021-07-30 10:27:45 +02:00
|
|
|
package com.mrousavy.camera.frameprocessor;
|
|
|
|
|
|
|
|
import com.facebook.jni.HybridData;
|
|
|
|
import com.facebook.proguard.annotations.DoNotStrip;
|
2021-08-25 11:33:57 +02:00
|
|
|
import java.util.concurrent.ExecutorService;
|
2021-07-30 10:27:45 +02:00
|
|
|
|
|
|
|
@SuppressWarnings("JavaJniMissingFunction") // using fbjni here
|
|
|
|
public class VisionCameraScheduler {
|
2021-08-25 11:33:57 +02:00
|
|
|
@SuppressWarnings({"unused", "FieldCanBeLocal"})
|
2021-07-30 10:27:45 +02:00
|
|
|
@DoNotStrip
|
|
|
|
private final HybridData mHybridData;
|
2021-08-25 11:33:57 +02:00
|
|
|
private final ExecutorService frameProcessorThread;
|
2021-07-30 10:27:45 +02:00
|
|
|
|
2021-08-25 11:33:57 +02:00
|
|
|
public VisionCameraScheduler(ExecutorService frameProcessorThread) {
|
|
|
|
this.frameProcessorThread = frameProcessorThread;
|
2021-07-30 10:27:45 +02:00
|
|
|
mHybridData = initHybrid();
|
|
|
|
}
|
|
|
|
|
|
|
|
private native HybridData initHybrid();
|
|
|
|
private native void triggerUI();
|
|
|
|
|
2021-08-25 11:33:57 +02:00
|
|
|
@SuppressWarnings("unused")
|
2021-07-30 10:27:45 +02:00
|
|
|
@DoNotStrip
|
|
|
|
private void scheduleTrigger() {
|
2021-08-25 11:33:57 +02:00
|
|
|
frameProcessorThread.submit(this::triggerUI);
|
2021-07-30 10:27:45 +02:00
|
|
|
}
|
|
|
|
}
|