setLocalVideoSink method
- id<
ByteRTCVideoSinkDelegate> videoSink, - ByteRTCVideoSinkPixelFormat requiredFormat
@detail api
@hiddensdk(audiosdk)
@deprecated since 3.57, use setLocalVideoSink:withLocalRenderConfig:{@link #ByteRTCEngine#setLocalVideoSink:withLocalRenderConfig} instead.
@region Custom Video Capturing & Rendering
@author sunhang.io
@brief Binds the local video stream to a custom renderer.
@param videoSink Custom video renderer. See ByteRTCVideoSinkDelegate{@link #ByteRTCVideoSinkDelegate}.
@param requiredFormat Video frame encoding format that applys to custom rendering. See ByteRTCVideoSinkPixelFormat{@link #ByteRTCVideoSinkPixelFormat}.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- RTC SDK uses its own renderer (internal renderer) for video rendering by default.
- If you need to unbind the video stream from the custom render, you must set videoSink to null. The binding status will be cleared when you leave room.
- You should call this API before joining the room, and after receiving rtcEngine:onFirstLocalVideoFrameCaptured:withFrameInfo:{@link #ByteRTCEngineDelegate#rtcEngine:onFirstLocalVideoFrameCaptured:withFrameInfo} which reports that the first local video frame has been successfully captured.
- This method gets video frames that have undergone preprocessing. If you need to obtain video frames from other positions, such as after capture, you should call setLocalVideoSink:withLocalRenderConfig:{@link #ByteRTCEngine#setLocalVideoSink:withLocalRenderConfig} instead.
Implementation
FutureOr<int> setLocalVideoSink(id<ByteRTCVideoSinkDelegate> videoSink,
ByteRTCVideoSinkPixelFormat requiredFormat) async {
return await nativeCall('setLocalVideoSink:withPixelFormat:',
[videoSink, requiredFormat.$value]);
}