ReVue KITSwift reference Guides
  • RevueSDK
  • Revue
  • setFrameCrypto(encrypt:decrypt:getMaxSize:userData:)

Instance Method

setFrameCrypto(encrypt:decrypt:getMaxSize:userData:)

Installs, replaces, or removes frame crypto with C callbacks (the C callback version).

@discardableResult @MainActor func setFrameCrypto(encrypt: FrameEncryptCallback?, decrypt: FrameDecryptCallback?, getMaxSize: FrameGetMaxSizeCallback?, userData: UnsafeMutableRawPointer?) -> Int32

Return Value

The RevueKit result code (0 on success).

Discussion

The callbacks work directly on the SDK’s buffers, so no frame is copied. For most Swift code, setFrameCryptor(_:) is simpler and lets the SDK manage memory.

Important

userData is owned by the App, and the SDK never retains or releases it. A media thread may still be using the previous userData when it is replaced or removed, so release a replaced userData only after destroy() returns.