From 1d1fa35c6cad7a42bcd66ee950ae6c3d9662c5b0 Mon Sep 17 00:00:00 2001 From: qinliwen Date: Mon, 3 Apr 2023 20:08:30 +0800 Subject: [PATCH] =?UTF-8?q?<=E4=BF=AE=E5=A4=8DcameraVideo=E5=92=8CcameraPr?= =?UTF-8?q?eviewFormat=E5=88=87=E6=8D=A2format=E9=97=AE=E9=A2=98>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinliwen --- .../src/main/ets/pages/model/CameraService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/validator/acts_validator/src/main/ets/pages/model/CameraService.ts b/validator/acts_validator/src/main/ets/pages/model/CameraService.ts index 194e5c1a4..3168b2a9d 100644 --- a/validator/acts_validator/src/main/ets/pages/model/CameraService.ts +++ b/validator/acts_validator/src/main/ets/pages/model/CameraService.ts @@ -141,12 +141,14 @@ class CameraService { this.videoConfig.videoSourceType = 0 } Logger.info(this.tag, `cameraDeviceIndex success: ${cameraDeviceIndex}`) - previewObj.format = this.cameraOutputCapability.previewProfiles[0].format - Logger.info(this.tag, `previewObj format: ${previewObj.format}`) await this.releaseCamera() await this.getCameraManagerFn() await this.getSupportedCamerasFn() await this.getSupportedOutputCapabilityFn(cameraDeviceIndex) + if (previewObj){ + previewObj.format = this.cameraOutputCapability.previewProfiles[0].format + Logger.info(this.tag, `previewObj format: ${previewObj.format}`) + } await this.createPreviewOutputFn(previewObj ? previewObj : this.cameraOutputCapability.previewProfiles[0], surfaceId) // await this.createPhotoOutputFn(this.photoProfileObj) await this.createPhotoOutputFn(obj ? obj : this.cameraOutputCapability.photoProfiles[photoIndex?photoIndex:0]) -- GitLab