From 0b1c903196be33b07fb322ede9e6b0b8f9a004df Mon Sep 17 00:00:00 2001 From: supeng Date: Fri, 30 Sep 2022 00:27:37 +0800 Subject: [PATCH] modify camera xts on branch 3.2Beta3 Signed-off-by: supeng --- .../test/CameraJSUnitPhotoPromise.test.ets | 5 ++- .../test/CameraJSUnitVideoAsync.test.ets | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets index be40df9c6..a878e3c7b 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets @@ -2991,7 +2991,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { await CaptureSessionPromise.addInput(camera1InputPromise); - + // 创建预览输出流 + let previewOutput = await cameraObj.createPreviewOutput(surfaceId); // 创建ImageReceiver对象,并设置照片参数 let imageReceiver = await image.createImageReceiver(640, 480, 4, 8); @@ -2999,6 +3000,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { let photoSurfaceId = await imageReceiver.getReceivingSurfaceId(); // 创建拍照输出流 let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId)); + // 向会话中添加预览输入流 + await CaptureSessionPromise.addOutput(previewOutput); // 向会话中添加拍照输出流 await CaptureSessionPromise.addOutput(photoOutput); diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets index d17c75a4d..49ab3077b 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets @@ -1101,6 +1101,37 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + /** + * @tc.number : VA_COMMIT_CONFIG_CALLBACK_0100 + * @tc.name : CommitConfig async api + * @tc.desc : CommitConfig async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('VA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') + } else { + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 to operate') + await sleep(1) + captureSession.commitConfig(async (err, data) => { + if (!err) { + console.info(TAG + 'Entering CommitConfig data is not null || undefined') + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 success') + } else { + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 err: ' + err.message) + } + expect(true).assertTrue(); + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + } + }) + //framerate /** * @tc.number : GET_FRAME_RATE_RANGE -- GitLab