onFrame

open fun onFrame(sink: RawVideoSink, frame: RawVideoSink.Frame)

Delivers a frame to the sink.

Client owns the delivered frame and MUST release it when no longer needed, otherwise its memory will be leaked.

In addition, Frame instances that are delivered directly to the sink through this callback may be backed by hardware/decoder buffers and not by usual native heap memory. Thus, it is important to release those frames as fast as possible, to prevent any video pipeline stall/crash.

In case a longer processing time is required on the frame, consider working on a copy and release the delivered frame immediately.