SinchLocalVideoFrameDelegate

public protocol SinchLocalVideoFrameDelegate : AnyObject

Delegate for locally captured video frames: observe or modify each frame before it is encoded and sent. Assign via SinchVideoController.localVideoFrameDelegate.

The cvPixelBuffer passed to onLocalVideoFrame(_:completionHandler:) is the SDK-owned frame captured from the camera; do not retain or release it. Call the completion handler exactly once with that buffer (optionally mutated in place) or a new one you created. The SDK takes ownership of whatever you pass and releases the input itself.

Important

Calling the completion handler is mandatory (otherwise the pipeline stalls) and may occur on any queue.
  • Undocumented

    Declaration

    Swift

    typealias OnFrameCompletionHandler = (_ buffer: CVPixelBuffer) -> Void
  • Called for every frame captured from the local camera, before it is encoded and sent to the remote peer(s).

    Declaration

    Swift

    func onLocalVideoFrame(_ cvPixelBuffer: CVPixelBuffer, completionHandler: @escaping OnFrameCompletionHandler)

    Parameters

    cvPixelBuffer

    The captured video frame buffer (SDK-owned).

    completionHandler

    Completion handler, to be invoked exactly once with the frame to send (the same buffer or a new one).