NativeThread
interface NativeThread
A native thread: an Executor on Android, a DispatchQueue on iOS.
Streaming outputs like the CameraFrameOutput expose the NativeThread their callbacks run on, so further work can run on the same thread without any thread hop. A NativeThread may use a thread pool, but it never runs code in parallel: execution is always serial.
See also
Functions
Link copied to clipboard
A CoroutineDispatcher running coroutines on this NativeThread, e.g. to process frames asynchronously on the output's thread with withContext(frameOutput.thread.asCoroutineDispatcher()).
Link copied to clipboard
Runs the given task on this thread.