setCameraCapturerConfiguration method
Sets the camera capturer configuration.
For a video call or live broadcast, generally the SDK controls the camera output parameters. When the default camera capture settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration:
- If the resolution or frame rate of the captured raw video data are higher than those set by RtcEngine.setVideoEncoderConfiguration, processing video frames requires extra CPU and RAM usage and degrades performance. We recommend setting config as CameraCaptureOutputPreference.Performance to avoid such problems.
- If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting config as CameraCaptureOutputPreference.Performance to optimize CPU and RAM usage.
- If you want better quality for the local video preview, we recommend setting config as CameraCaptureOutputPreference.Preview.
Note
- Call this method before enabling the local camera. That said, you can call this method before calling RtcEngine.joinChannel, RtcEngine.enableVideo, or RtcEngine.enableLocalVideo, depending on which method you use to turn on your local camera.
Parameter config
The camera capturer configuration. See CameraCapturerConfiguration.
Implementation
@override
Future<void> setCameraCapturerConfiguration(
CameraCapturerConfiguration config) {
return _invokeMethod(
'setCameraCapturerConfiguration', {'config': config.toJson()});
}