queryCameraFocalLengthCapability

Queries the focal length capability supported by the camera.

virtual int queryCameraFocalLengthCapability(agora::rtc::FocalLengthInfo* focalLengthInfos, int& size) = 0;

Details

If you want to enable the wide-angle or ultra-wide-angle mode for camera capture, it is recommended to start by calling this method to check whether the device supports the required focal length capability. Then, adjust the camera's focal length configuration based on the query result by calling setCameraCapturerConfiguration, ensuring the best camera capture performance.

Attention: This method is for Android and iOS only.

Parameters

focalLengthInfos
Input and output parameter. The pointer to an array of FocalLengthInfo objects:
  • Input value: The pointer to an array of FocalLengthInfo objects, used to store focal length information.
  • Output value: After the method is executed, output the queried focal length information.
size
Input and output parameter. The number of focal length information items:
  • Input value: Specifies the maximum number of focal length information items that focalLengthInfos can hold. Ensure this value is not less than 8, meaning focalLengthInfos has space for at least 8 focal length information items.
  • Output value: After the method is executed, output the number of focal length information items retrieved.

Returns

  • 0: Success.
  • < 0: Failure.