setVideoDecoderConfig method

Future<int?> setVideoDecoderConfig({
  1. required string streamId,
  2. required VideoDecoderConfig config,
})

@detail api @brief Before subscribing to the remote video stream, set the remote video data decoding method @param streamId The remote stream ID specifies which video stream to decode. @param config Video decoding method. See VideoDecoderConfig{@link #VideoDecoderConfig}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note - When you want to custom decode a remote stream, you need to call registerRemoteEncodedVideoFrameObserver{@link #RTCEngine#registerRemoteEncodedVideoFrameObserver} to register the remote video stream monitor, and then call the interface to set the decoding method to custom decoding. The monitored video data will be called back through onRemoteEncodedVideoFrame{@link #IRemoteEncodedVideoFrameObserver#onRemoteEncodedVideoFrame}. - Since version 3.56, for automatic subscription, you can set the RoomId and UserId of key as nullptr. In this case, the decoding settings set by calling the API applies to all remote main streams or screen sharing streams based on the StreamIndex value of key.

Implementation

Future<int?> setVideoDecoderConfig(
    {required string streamId, required VideoDecoderConfig config}) async {
  $a() => ($instance as $p_a.RTCEngine).setVideoDecoderConfig(
      streamId, t_VideoDecoderConfig.code_to_android(config));
  $i() => ($instance as $p_i.ByteRTCEngine).setVideoDecoderConfig(
      streamId, t_VideoDecoderConfig.code_to_ios(config));

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}