天天看點

産品百科 | RTC iOS SDK 攝像頭管理方法

功能簡介

阿裡雲 RTC 提供一系列攝像頭管理方法,包括切換前後置攝像頭、縮放鏡頭、曝光設定和對焦功能,您可以在加入頻道前進行設定,幫助您在通話時使成像更清晰、大小與亮度更适宜。

實作方法

在實作該功能之前,需要您已經搭建 AppServer、實作基本功能等操作。詳情請參見

入門概述

具體實作方法如下所示。

  • switchCamera:切換前後攝像頭。
- (int)switchCamera;      
  • 該方法傳回 0 為切換成功,其他為切換失敗。
  • setCameraZoom:設定攝像頭參數。
- (int)setCameraZoom:(float)zoom flash:(BOOL)flash autoFocus:(BOOL)autoFocus;      
  • 參數:
參數 類型 描述
zoom float 變焦的級别。取值:-3~3,預設為 1.0。
flash BOOL 是否打開閃光燈。取值:YES|NO。
autoFocus 是否打開自動對焦。取值:YES|NO。
  • 該方法傳回 0 表示設定成功,其他表示設定失敗。
  • isCameraOn:檢查攝像頭是否打開。
- (BOOL)isCameraOn;      
  • 該方法傳回 YES 表示攝像頭已打開,NO 表示攝像頭沒有打開
  • isCameraFocusPointSupported:檢視攝像頭是否支援手動聚焦。
- (BOOL)isCameraFocusPointSupported;      
  • 該方法傳回 YES 表示支援,NO 表示不支援。
  • isCameraExposurePointSupported:檢視攝像頭是否支援設定曝光區域。
- (BOOL)isCameraExposurePointSupported;      
  • setCameraFocusPoint:設定攝像頭手動聚焦。
- (int)setCameraFocusPoint:(CGPoint)point;      
point CGPoint 聚焦點坐标
  • 該方法傳回 0 表示成功,其他表示失敗。
  • setCameraExposurePoint:設定攝像頭曝光點。
- (int)setCameraExposurePoint:(CGPoint)point;      
曝光點坐标

獲得更多功能實作方法,請參見

AliRtcEngine 接口
「視訊雲技術」你最值得關注的音視訊技術公衆号,每周推送來自阿裡雲一線的實踐技術文章,在這裡與音視訊領域一流工程師交流切磋。
産品百科 | RTC iOS SDK 攝像頭管理方法