diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets index 5e362356f4a724b8d902ee3b79371df380a7505e..67cf45620b5e97a4371f5d0fd35afd45f410989b 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets @@ -96,7 +96,7 @@ export default function cameraEnumTest() { */ it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------"); - console.info("CameraType: "+ JSON.stringify(camera.CameraType)); + console.info("CameraType: " + JSON.stringify(camera.CameraType)); expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue(); @@ -301,16 +301,27 @@ export default function cameraEnumTest() { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100--------------"); + console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100--------------"); expect(camera.CameraErrorCode.INVALID_ARGUMENT == 7400101).assertTrue(); + console.info(TAG + "--------------INVALID_ARGUMENT--------------"); expect(camera.CameraErrorCode.OPERATION_NOT_ALLOWED == 7400102).assertTrue(); + console.info(TAG + "--------------OPERATION_NOT_ALLOWED--------------"); expect(camera.CameraErrorCode.SESSION_NOT_CONFIG == 7400103).assertTrue(); + console.info(TAG + "--------------SESSION_NOT_CONFIG--------------"); expect(camera.CameraErrorCode.SESSION_NOT_RUNNING == 7400104).assertTrue(); + console.info(TAG + "--------------SESSION_NOT_RUNNING--------------"); expect(camera.CameraErrorCode.SESSION_CONFIG_LOCKED == 7400105).assertTrue(); + console.info(TAG + "--------------SESSION_CONFIG_LOCKED--------------"); expect(camera.CameraErrorCode.DEVICE_SETTING_LOCKED == 7400106).assertTrue(); - expect(camera.CameraErrorCode.CONFLICT_CAMERA == 7400107).assertTrue(); + console.info(TAG + "--------------DEVICE_SETTING_LOCKED--------------"); + // expect(camera.CameraErrorCode.CONFLICT_CAMERA == 7400107).assertTrue(); + // console.info(TAG + "--------------CONFLICT_CAMERA--------------"); expect(camera.CameraErrorCode.DEVICE_DISABLED == 7400108).assertTrue(); + console.info(TAG + "--------------DEVICE_DISABLED--------------"); + expect(camera.CameraErrorCode.DEVICE_PREEMPTED == 7400109).assertTrue(); + console.info(TAG + "--------------DEVICE_PREEMPTED --------------"); expect(camera.CameraErrorCode.SERVICE_FATAL_ERROR == 7400201).assertTrue(); + console.info(TAG + "--------------SERVICE_FATAL_ERROR--------------"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100 ends here"); done(); }) diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets index 6af2acc5fd65ae46496a15395705fad6899f7226..d95cde098f4ccdd747ea3ca151e4ca5c25438df2 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets @@ -26,7 +26,7 @@ let videoProfile = { audioCodec: 'audio/mp4a-latm', audioSampleRate: 48000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -230,7 +230,7 @@ export default function CameraErrorCodeUsecaseTest() { async function getvideosurface() { await getFd('ErrorCodeCameraOutput.mp4'); videoConfig.url = fdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'createVideoRecorder called') videoRecorder = recorder @@ -334,7 +334,7 @@ export default function CameraErrorCodeUsecaseTest() { await releaseInput(); } if (!isEmpty(mCameraSession)) { - releaseCameraSessionInstance(); + await releaseCameraSessionInstance(); } }) @@ -1712,6 +1712,10 @@ export default function CameraErrorCodeUsecaseTest() { */ it('SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSPOINT_0100', 0, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSPOINT_0100--------------"); + if(mCameraSession){ + mCameraSession.release(); + mCameraSession = null; + } await createInput(0); createCameraSessionInstance(); mCameraSession.addInput(mCameraInput); diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets index 0007ce5202a84e629e7924c958f908976baec3ad..4e561e104af6b39789a108f5effbdd8428582ccc 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets @@ -40,7 +40,7 @@ let videoProfile = { audioCodec: 'audio/mp4a-latm', audioSampleRate: 48000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -96,10 +96,12 @@ export default function cameraJSUnitOutput() { async function getFd(pathName) { let displayName = pathName; const mediaTest = mediaLibrary.getMediaLibrary(); + console.log(TAG + 'mediaTest: ' + JSON.stringify(mediaTest)) let fileKeyObj = mediaLibrary.FileKey; let mediaType = mediaLibrary.MediaType.VIDEO; let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); + console.log(TAG + 'dataUri id: ' + JSON.stringify(dataUri)) if (dataUri != undefined) { let args = dataUri.id.toString(); let fetchOp = { @@ -109,6 +111,7 @@ export default function cameraJSUnitOutput() { let fetchFileResult = await mediaTest.getFileAssets(fetchOp); fileAsset = await fetchFileResult.getAllObject(); fdNumber = await fileAsset[0].open('Rw'); + console.log(TAG + 'fdNumber id: ' + JSON.stringify(fdNumber)) fdPath = "fd://" + fdNumber.toString(); } } @@ -127,8 +130,9 @@ export default function cameraJSUnitOutput() { async function getvideosurface() { await getFd('CameraOutput.mp4'); - videoConfig.url = fdPath; - media.createVideoRecorder((err, recorder) => { + await sleep(2000); + videoConfig.url = fdPath; + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'createVideoRecorder called') videoRecorder = recorder @@ -152,7 +156,7 @@ export default function cameraJSUnitOutput() { }) } else { - console.info(TAG + 'createVideoRecorder FAILED') + console.info(TAG + 'createVideoRecorder FAILED ,Code' + err.code) } }) } @@ -195,6 +199,7 @@ export default function cameraJSUnitOutput() { beforeAll(async function () { await getImageReceiverSurfaceId(); await getvideosurface(); + sleep(2000); console.info('beforeAll case'); }) diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets index e2e7cc76ef3bb3535ebf6c79f0f4067b58bef6df..7f91638c1192c42cddd2a6419d2c0e3f1e14939f 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets @@ -42,7 +42,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -111,7 +111,7 @@ export default function cameraManagerTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraManager.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets index 0906584427ae134f5e3f320c1a6d5ac002a6e4f2..74d3373a75e4bcf4bbed57358fbfa61de9ad1513 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets @@ -51,7 +51,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -133,7 +133,7 @@ export default function cameraSessionTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraSessionBase.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets index 026441d6aefc29b9bcfbeeafd7b472077bc7ac33..9ec032c8a204c7cac1064eb8638bf8ef63a3a384 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets @@ -56,7 +56,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -188,7 +188,7 @@ export default function cameraSessionExposureTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraSessionExposure.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder @@ -1322,7 +1322,7 @@ export default function cameraSessionExposureTest() { for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100 start for camera[" + i + "]"); let exposureBias = mExposureBiasRangeArray[i][0]; - if (exposureBias == 0) { + if (exposureBias == 0 || isNaN(exposureBias)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100 exposureBias is 0"); } else { await startCameraSession(i); diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets index 7ba5839129815733c02194e4909009afb2fc6195..be05515f4ead4a5c34507de57d27f8572bb99975 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets @@ -54,7 +54,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -139,7 +139,7 @@ export default function cameraSessionFlashTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraSessionFlush.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets index 936662a5f857b9cc7ca31954a80d49f591ad0727..092e539ca14f18c3444584807751b915f13cb5ae 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets @@ -53,7 +53,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -185,7 +185,7 @@ export default function cameraSessionFocusTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraSessionFocus.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets index ffff459a779b59b62632362f89080b32713bc572..a903b88961fa6308f485e56e3adaed0d322a58f6 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets @@ -53,7 +53,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -138,7 +138,7 @@ export default function cameraSessionVideoStabilizationTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraSessionVideoStabilization.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets index 103ca7370ad95bade17ad1a452e2fd76458884d3..0a245e3dde5ba9f0f68f8822eb3d3b6e9498a34c 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets @@ -55,7 +55,7 @@ let mVideoProfileCfg = { audioSampleRate: 48000, durationTime: 1000, fileFormat: 'mp4', - videoBitrate: 48000, + videoBitrate: 2000000, videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, @@ -140,7 +140,7 @@ export default function cameraSessionZoomRatioTest() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraSessionZoomRatio.mp4'); mVideoConfig.url = mFdPath; - media.createVideoRecorder((err, recorder) => { + media.createAVRecorder((err, recorder) => { if (!err) { console.info(TAG + 'Entering create video receiver') mVideoRecorder = recorder