- RevueSDK
- CameraCapturer
- set(options:)
Instance Method
set(options:)
即時更新擷取選項(解析度、FPS、鏡頭)
@discardableResult func set(options: CameraCaptureOptions) async throws -> BoolParameters
- options
新的擷取選項
Return Value
true —— 擷取中,且新選項已生效(新解析度已套用;有換鏡頭時要的那顆已換上)。 false —— 鏡頭停止中(只記住,startCapture() 時套用)、換鏡頭加不進去已還原, 或還沒換就被之後的呼叫取代(同 switchCameraPosition())
Discussion
CameraCaptureOptions 的欄位都是 let:要改設定就 copyWith 後傳進來。
Throws
CameraCapturerError.deviceNotAvailable——options.position那個方向沒有鏡頭, 或擷取中options.device那顆建不出 input(例如已拔除;停止中只記住,startCapture()開不起來時改用position那顆);丟錯時options與position都不變
try await capturer.set(options: capturer.options.copyWith(
dimensions: .h1080_169,
fps: 15
))