setCameraCaptureConfig method Null safety
- NERtcCameraCaptureConfig captureConfig
Set the preferences for the capturing data from local cameras
In video calls or live streaming, the SDK automatically controls the output parameters of the camera. By default, the SDK captures video data with the most appropriate resolution based on the setLocalVideoConfig configuration. However, in some cases, if the capture screen quality cannot meet the actual demand, you can call this API to adjust the camera capture configuration.
- If you want to capture and preview HD quality video, set the capture preferences to CAPTURE_PREFERENCE_OUTPUT_QUALITY. The SDK will automatically apply a higher camera output parameter, and the local capture and preview video will be clearer than the video using the encoding parameters.
- To use the user-defined size of the captured video from the camera, set the capture preferences to CAPTURE_PREFERENCE_MANUAL, and set the width and height of the captured video from the local camera using captureWidth and captureHeight in NERtcCameraCaptureConfig.
Implementation
Future<int> setCameraCaptureConfig(NERtcCameraCaptureConfig captureConfig) async {
IntValue reply = await _api.setCameraCaptureConfig(
SetCameraCaptureConfigRequest()
..preference = captureConfig.preference
..captureWidth = max(0, captureConfig.captureWidth)
..captureHeight = max(0, captureConfig.captureHeight)
);
return reply.value ?? -1;
}