RawVideoSinkListener
public protocol RawVideoSinkListener : AnyObject
Raw video sink listener.
-
Notifies that the
sink
starts.Declaration
Swift
func didStart(sink: RawVideoSink, videoFormat: VideoFormat)
Parameters
sink
raw video sink
videoFormat
provides information on the format of the delivered frames
-
Delivers a
frame
to thesink
.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
Frame.copy
andrelease
the delivered frame immediately.Declaration
Swift
func frameReady(sink: RawVideoSink, frame: RawVideoSinkFrame)
Parameters
sink
raw video sink
frame
new frame available
-
Notifies that the
sink
stops.Declaration
Swift
func didStop(sink: RawVideoSink)
Parameters
sink
raw video sink