-
public class CameraOrchestratorSchedules com.otaliastudios.cameraview.engine.CameraEngine actions, so that they always run on the same thread. We need to be extra careful (not as easy as posting on a Handler) because the engine has different states, and some actions will modify the engine state - turn it on or tear it down. Other actions might need a specific state to be executed. And most importantly, some actions will finish asynchronously, so subsequent actions should wait for the previous to finish, but without blocking the thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCameraOrchestrator.Callback
-
Constructor Summary
Constructors Constructor Description CameraOrchestrator(CameraOrchestrator.Callback callback)
-
Method Summary
Modifier and Type Method Description Task<Void>schedule(@NonNull() String name, boolean dispatchExceptions, @NonNull() Runnable job)Task<Void>scheduleDelayed(@NonNull() String name, boolean dispatchExceptions, long minDelay, @NonNull() Runnable job)<T> Task<T>schedule(@NonNull() String name, boolean dispatchExceptions, @NonNull() Callable<Task<T>> scheduler)voidremove(@NonNull() String name)voidtrim(@NonNull() String name, int allowed)voidreset()-
-
Constructor Detail
-
CameraOrchestrator
CameraOrchestrator(CameraOrchestrator.Callback callback)
-
-
Method Detail
-
schedule
@NonNull() Task<Void> schedule(@NonNull() String name, boolean dispatchExceptions, @NonNull() Runnable job)
-
scheduleDelayed
@NonNull() Task<Void> scheduleDelayed(@NonNull() String name, boolean dispatchExceptions, long minDelay, @NonNull() Runnable job)
-
schedule
@NonNull() <T> Task<T> schedule(@NonNull() String name, boolean dispatchExceptions, @NonNull() Callable<Task<T>> scheduler)
-
reset
void reset()
-
-
-
-