registerLocalVideoProcessor method

FutureOr<int> registerLocalVideoProcessor(
  1. IVideoProcessor processor,
  2. VideoPreprocessorConfig config
)

@detail api @hiddensdk(audiosdk) @author zhushufan.ref @brief Set up a custom video preprocessor.
Using this video preprocessor, you can call processVideoFrame{@link #IVideoProcessor#processVideoFrame} to preprocess the video frames collected by the RTC SDK, and use the processed video frames for RTC audio & video communication. @param processor Custom video processor. See IVideoProcessor{@link #IVideoProcessor}. If null is passed in, the video frames captured by the RTC SDK are not preprocessed.
SDK only holds weak references to the processor, you should guarantee its Life Time. @param config Customize the settings applicable to the video preprocessor. See VideoPreprocessorConfig{@link #VideoPreprocessorConfig}.
Currently, the required_pixel_format in'config 'only supports:' I420 ',' TEXTURE_2D 'and'Unknown':
- When set to'Unknown', the RTC SDK gives the format of the video frame for processing by the processor, that is, the format of the capture. You can get the actual captured video frame format through pixelFormat{@link #IVideoFrame#pixelFormat}. The supported formats are: 'I420', 'TEXTURE_2D' and 'TEXTURE_OES'
- When set to 'I420' or 'TEXTURE_2D', the RTC SDK will convert the captured video into the corresponding format for pre-processing. This method call fails when - Is set to another value. @return - 0: Success. - < 0: Failure. See ReturnStatus{@link #ReturnStatus} for more details. @note After preprocessing, the video frame format returned to the RTC SDK only supports' I420 'and' TEXTURE_2D '.

Implementation

FutureOr<int> registerLocalVideoProcessor(
    IVideoProcessor processor, VideoPreprocessorConfig config) async {
  return await nativeCall('registerLocalVideoProcessor', [processor, config]);
}