enableAlphaChannelVideoEncode method
@hidden(macOS)
@valid since 3.58
@detail api
@hiddensdk(audiosdk)
@region Video Management
@author zhuhongshuyu
@brief Enables the Alpha channel encoding feature for custom capture video frames.
Suitable for scenarios where the video subject needs to be separated from the background at the push-streaming end, and the background can be custom rendered at the receive-streaming end.
@param alphaLayout The arrangement position of the separated Alpha channel relative to the RGB channel information. Currently, only ByteRTCAlphaLayout.ByteRTCAlphaLayoutTop is supported, which is positioned above the RGB channel information.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- This API only applies to custom capture video frames that use ByteRTCVideoPixelFormat.ByteRTCVideoPixelFormatCVPixelBuffer.
- This API must be called before publishing the video stream.
- After enabling Alpha channel encoding with this API, you need to call pushExternalVideoFrame:{@link #ByteRTCEngine#pushExternalVideoFrame} to push custom captured video frames to the RTC SDK. If a video frame format that is not supported is pushed, the call to pushExternalVideoFrame:{@link #ByteRTCEngine#pushExternalVideoFrame} will return the error code ByteRTCReturnStatus.ByteRTCReturnStatusParameterErr.
Implementation
FutureOr<int> enableAlphaChannelVideoEncode(
ByteRTCAlphaLayout alphaLayout) async {
return await nativeCall(
'enableAlphaChannelVideoEncode:', [alphaLayout.$value]);
}