Protocols

The following protocols are available globally.

  • The delegate of a SinchAudioController object must adopt the SinchAudioControllerDelegate protocol. The methods handle audio related state changes.

    See more

    Declaration

    Swift

    public protocol SinchAudioControllerDelegate : AnyObject
  • The delegate for local audio recording events.

    The callbacks allow observing and modifying the raw PCM audio captured from the microphone before it is handed to the WebRTC engine for processing, encoding and transmission.

    Assign via SinchAudioController.localAudioFrameDelegate.

    Important

    All callbacks are delivered synchronously on the SDK’s internal real-time audio threads, in the order audioRecordingDidStart(with:), onLocalAudioFrame(_:), audioRecordingDidStop(with:). Implementations must not block — any significant delay will cause audio glitches.
    See more

    Declaration

    Swift

    public protocol SinchLocalAudioFrameDelegate : AnyObject
  • The delegate for remote audio playout events.

    The callbacks allow observing and modifying the decoded PCM audio received from the remote party before it is written to the audio output device.

    Assign via SinchAudioController.remoteAudioFrameDelegate.

    Important

    All callbacks are delivered synchronously on the SDK’s internal real-time audio threads, in the order audioPlayoutDidStart(with:), onRemoteAudioFrame(_:), audioPlayoutDidStop(with:). Implementations must not block — any significant delay will cause audio glitches.
    See more

    Declaration

    Swift

    public protocol SinchRemoteAudioFrameDelegate : AnyObject
  • The delegate of a SinchCall object must adopt the SinchCallDelegate protocol. The required methods handle call state changes.

    Call State Progression

    For a complete outgoing call, the delegate methods will be called in the following order:

    • callDidProgress:
    • callDidRing:
    • `callDidAnswer:
    • callDidEstablish:
    • callDidEnd:

    For a complete incoming call, the delegate methods will be called in the following order, after the client delegate method SinchClientDelegate client:didReceiveIncomingCall: has been called:

    • `callDidAnswer:
    • callDidEstablish:
    • callDidEnd:
    See more

    Declaration

    Swift

    public protocol SinchCallDelegate : AnyObject
  • SinchCallClient delegate protocol

    See more

    Declaration

    Swift

    public protocol SinchCallClientDelegate : AnyObject
  • The delegate of a SinchClient object must adopt the SinchClientDelegate protocol. The required methods allows responding to client state changes (start and stop), and providing user registration credentials (JWT).

    See more

    Declaration

    Swift

    public protocol SinchClientDelegate : AnyObject
  • Delegate of SinchManagedPush

    See more

    Declaration

    Swift

    public protocol SinchManagedPushDelegate : 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.
    See more

    Declaration

    Swift

    public protocol SinchLocalVideoFrameDelegate : AnyObject
  • Delegate for received remote video frames: observe or modify each decoded frame before it is rendered. Assign via SinchVideoController.remoteVideoFrameDelegate.

    The cvPixelBuffer passed to onRemoteVideoFrame(_:completionHandler:) is the SDK-owned frame decoded from the remote stream; 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 rendering stalls) and may occur on any queue.
    See more

    Declaration

    Swift

    public protocol SinchRemoteVideoFrameDelegate : AnyObject