setVideoCaptureRotation method

Future<int?> setVideoCaptureRotation(
  1. VideoRotation rotation
)

@detail api @hiddensdk(audiosdk) @author wangxiaosen @brief 设置本端采集的视频帧的旋转角度。
当摄像头倒置或者倾斜安装时,可调用本接口进行调整。对于手机等普通设备,可调用 setVideoRotationMode{@link #RTCEngine#setVideoRotationMode} 实现旋转。 @param rotation 相机朝向角度,默认为 VIDEO_ROTATION_0(0),无旋转角度。详见 VideoRotation{@link #VideoRotation}。 @return - 0: 调用成功。 - < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明 @note - 对于内部采集的视频画面,如果已调用 setVideoRotationMode{@link #RTCEngine#setVideoRotationMode} 设置了旋转方向,会在此基础上叠加旋转角度。 - 调用本接口也将对自定义采集视频画面生效,在原有的旋转角度基础上叠加本次设置。 - 视频贴纸特效或通过 enableVirtualBackground{@link #IVideoEffect#enableVirtualBackground} 增加的虚拟背景,也会跟随本接口的设置进行旋转。 - 本地渲染视频和发送到远端的视频都会相应旋转,但不会应用到单流转推中。如果希望在单流转推的视频中应用旋转,调用 setVideoOrientation{@link #RTCEngine#setVideoOrientation}。

Implementation

Future<int?> setVideoCaptureRotation(VideoRotation rotation) async {
  $a() => ($instance as $p_a.RTCEngine)
      .setVideoCaptureRotation(t_VideoRotation.code_to_android(rotation));
  $i() => ($instance as $p_i.ByteRTCEngine)
      .setVideoCaptureRotation(t_VideoRotation.code_to_ios(rotation));

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