Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
535a851a
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
535a851a
编写于
11月 03, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6326 【媒体子系统】camera 新增枚举类覆盖
Merge pull request !6326 from liuxueqi/monthly_20221018
上级
e5214011
156af7be
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
946 addition
and
863 deletion
+946
-863
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets
...rd/src/main/ets/MainAbility/test/CameraInputTest.test.ets
+53
-34
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
...src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
+37
-12
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
.../src/main/ets/MainAbility/test/CameraManagerTest.test.ets
+243
-284
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
.../main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
+219
-184
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
...n/ets/MainAbility/test/CameraSessionExposureTest.test.ets
+75
-56
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
...main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
+79
-60
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
...main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
+80
-61
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
...Ability/test/CameraSessionVideoStabilizationTest.test.ets
+89
-120
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
.../ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
+71
-52
未找到文件。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets
浏览文件 @
535a851a
...
...
@@ -135,7 +135,7 @@ export default function CameraInputTest(surfaceId) {
console.info(TAG + "Entering getCameraSupportDevicesArray FAILED : " + err.message);
}
})
await sleep(300
0
);
await sleep(300);
*/
if
(
isEmpty
(
mCameraDevicesArray
))
{
console
.
info
(
TAG
+
"getSupportedCameras FAILED"
);
...
...
@@ -222,7 +222,14 @@ export default function CameraInputTest(surfaceId) {
return
false
;
}
mCameraInput
=
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
mCameraInput
=
null
;
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'createCameraInput success'
);
mCameraInput
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'createCameraInput failed, err = '
+
err
.
message
);
});
if
(
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"createCameraInput FAILED"
);
return
false
;
...
...
@@ -262,23 +269,33 @@ export default function CameraInputTest(surfaceId) {
async
function
createOutput
(
idx
:
any
)
{
console
.
info
(
'Enter createOutput'
);
let
cameraOutputCap
=
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]);
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
}
let
cameraOutputCap
=
null
;
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'getSupportedOutputCapability success'
);
cameraOutputCap
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'getSupportedOutputCapability failed, err = '
+
err
.
message
);
mPreviewOutput
=
null
;
});
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
}
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
console
.
info
(
'Exit createOutputs'
);
return
true
;
...
...
@@ -403,7 +420,7 @@ export default function CameraInputTest(surfaceId) {
await
sleep
(
1
);
})
await
sleep
(
300
0
);
await
sleep
(
300
);
if
(
nfyFlag
==
false
)
{
//expect().assertFail();
...
...
@@ -460,7 +477,7 @@ export default function CameraInputTest(surfaceId) {
mCameraSession
.
setFocusMode
(
cameraObj
.
FocusMode
.
FOCUS_MODE_AUTO
);
await
sleep
(
300
0
);
await
sleep
(
300
);
if
(
nfyFlag
==
false
)
{
//expect().assertFail();
...
...
@@ -517,7 +534,7 @@ export default function CameraInputTest(surfaceId) {
mCameraSession
.
setExposureMode
(
cameraObj
.
ExposureMode
.
EXPOSURE_MODE_AUTO
);
await
sleep
(
300
0
);
await
sleep
(
300
);
if
(
nfyFlag
==
false
)
{
//expect().assertFail();
...
...
@@ -557,34 +574,34 @@ export default function CameraInputTest(surfaceId) {
expect
(
isEmpty
(
cameraInput
))
.
assertFalse
();
await
cameraInput
.
open
(
async
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"PASSED open with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
console
.
info
(
TAG
+
"
PASSED open with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
}
else
{
successFlag
=
false
;
console
.
info
(
TAG
+
"open FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
"
open FAILED: "
+
err
.
message
);
}
});
await
sleep
(
400
);
await
cameraInput
.
close
(
async
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"PASSED close with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
console
.
info
(
TAG
+
"
PASSED close with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
}
else
{
successFlag
=
false
;
console
.
info
(
TAG
+
"close FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
"
close FAILED: "
+
err
.
message
);
}
});
await
sleep
(
100
);
await
cameraInput
.
release
(
async
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"PASSED release with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
console
.
info
(
TAG
+
"
PASSED release with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
}
else
{
successFlag
=
false
;
console
.
info
(
TAG
+
"release FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
"
release FAILED: "
+
err
.
message
);
}
});
expect
(
successFlag
)
.
assertEqual
(
true
);
})
.
catch
((
err
)
=>
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Failed To create cameraInput cameraId: "
+
camerasArray
[
i
]
.
cameraId
+
+
JSON
.
stringify
(
err
));
console
.
info
(
TAG
+
"
Failed To create cameraInput cameraId: "
+
camerasArray
[
i
]
.
cameraId
+
+
JSON
.
stringify
(
err
));
});
}
}
...
...
@@ -617,24 +634,24 @@ export default function CameraInputTest(surfaceId) {
expect
(
isEmpty
(
cameraInput
))
.
assertFalse
();
console
.
info
(
TAG
+
functionTag
+
"Entering cameraInput open with camera: "
+
camerasArray
[
i
]
.
cameraId
);
await
cameraInput
.
open
()
.
then
(
async
()
=>
{
console
.
info
(
TAG
+
functionTag
+
"PASSED open with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
console
.
info
(
TAG
+
functionTag
+
"
PASSED open with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
})
.
catch
((
err
)
=>
{
successFlag
=
false
;
console
.
info
(
TAG
+
functionTag
+
"open FAILED: "
+
err
.
message
);
});
;
console
.
info
(
TAG
+
functionTag
+
"
open FAILED: "
+
err
.
message
);
});
await
sleep
(
400
);
await
cameraInput
.
close
()
.
then
(
async
()
=>
{
console
.
info
(
TAG
+
functionTag
+
"PASSED close with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
console
.
info
(
TAG
+
functionTag
+
"
PASSED close with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
})
.
catch
((
err
)
=>
{
successFlag
=
false
;
console
.
info
(
TAG
+
functionTag
+
"close FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
functionTag
+
"
close FAILED: "
+
err
.
message
);
});
await
sleep
(
100
);
await
cameraInput
.
release
()
.
then
(
async
()
=>
{
console
.
info
(
TAG
+
functionTag
+
"PASSED release with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
console
.
info
(
TAG
+
functionTag
+
"
PASSED release with CameraID :"
+
camerasArray
[
i
]
.
cameraId
);
})
.
catch
((
err
)
=>
{
successFlag
=
false
;
console
.
info
(
TAG
+
functionTag
+
"release FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
functionTag
+
"
release FAILED: "
+
err
.
message
);
});
expect
(
successFlag
)
.
assertEqual
(
true
);
}
else
{
...
...
@@ -642,8 +659,10 @@ export default function CameraInputTest(surfaceId) {
console
.
info
(
TAG
+
functionTag
+
" FAILED: "
+
err
.
message
);
}
});
await
sleep
(
600
);
}
await
sleep
(
400
*
camerasArray
.
length
);
//
await sleep(400 * camerasArray.length);
}
console
.
info
(
TAG
+
functionTag
+
"Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 ends here"
);
done
();
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
浏览文件 @
535a851a
...
...
@@ -22,7 +22,17 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const
TAG
=
"CameraUnitTest: "
;
let
captureLocation
=
{
latitude
:
0
,
longitude
:
0
,
altitude
:
0
,
}
let
captureSetting
=
{
quality
:
cameraObj
.
QualityLevel
.
QUALITY_LEVEL_LOW
,
rotation
:
cameraObj
.
ImageRotation
.
ROTATION_0
,
location
:
captureLocation
,
mirror
:
false
}
// 创建视频录制的参数
...
...
@@ -771,18 +781,21 @@ export default function cameraJSUnitOutput(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 captureSession == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
captureSession
.
addOutput
(
metadataOutput
,
async
(
err
)
=>
{
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 success"
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 FAILED: "
+
err
.
message
);
expect
()
.
assertFail
();
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
if
(
!
isEmpty
(
metadataOutput
))
{
captureSession
.
addOutput
(
metadataOutput
,
async
(
err
)
=>
{
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 success"
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 FAILED: "
+
err
.
message
);
expect
()
.
assertFail
();
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
}
}
await
sleep
(
1000
);
done
();
...
...
@@ -1092,6 +1105,7 @@ export default function cameraJSUnitOutput(surfaceId: any) {
expect
()
.
assertFail
();
});
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : "
+
boundingBox
.
width
+
"x"
+
boundingBox
.
height
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : "
+
boundingBox
.
topLeftX
+
"x"
+
boundingBox
.
topLeftY
);
}
await
sleep
(
1000
);
done
();
...
...
@@ -1478,6 +1492,13 @@ export default function cameraJSUnitOutput(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 photoOutput == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.quality = '
+
captureSetting
.
quality
);
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.rotation = '
+
captureSetting
.
rotation
);
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.location.latitude = '
+
captureSetting
.
location
.
latitude
);
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.location.longitude = '
+
captureSetting
.
location
.
longitude
);
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.location.altitude = '
+
captureSetting
.
location
.
altitude
);
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.mirror = '
+
captureSetting
.
mirror
);
await
photoOutput
.
capture
(
captureSetting
)
.
then
((
result
)
=>
{
console
.
info
(
'SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 success :'
+
result
);
})
.
catch
((
err
)
=>
{
...
...
@@ -1575,6 +1596,8 @@ export default function cameraJSUnitOutput(surfaceId: any) {
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100 success"
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100, captureId = "
+
data
.
captureId
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100, timestamp = "
+
data
.
timestamp
);
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: "
+
err
.
message
);
...
...
@@ -1608,6 +1631,8 @@ export default function cameraJSUnitOutput(surfaceId: any) {
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 success"
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100, captureId = "
+
data
.
captureId
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100, frameCount = "
+
data
.
frameCount
);
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 FAILED: "
+
err
.
message
);
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
浏览文件 @
535a851a
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
浏览文件 @
535a851a
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
浏览文件 @
535a851a
...
...
@@ -412,7 +412,14 @@ export default function cameraSessionExposureTest(surfaceId: any) {
return
false
;
}
mCameraInput
=
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
mCameraInput
=
null
;
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'createCameraInput success'
);
mCameraInput
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'createCameraInput failed, err = '
+
err
.
message
);
});
if
(
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"createCameraInput FAILED"
);
return
false
;
...
...
@@ -452,68 +459,80 @@ export default function cameraSessionExposureTest(surfaceId: any) {
async
function
createOutput
(
idx
:
any
)
{
console
.
info
(
'Enter createOutput'
);
let
cameraOutputCap
=
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]);
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
let
cameraOutputCap
=
null
;
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'getSupportedOutputCapability success'
);
cameraOutputCap
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'getSupportedOutputCapability failed, err = '
+
err
.
message
);
mPreviewOutput
=
null
;
mPhotoOutput
=
null
;
});
if
(
!
isEmpty
(
cameraOutputCap
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
}
}
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
*/
}
*/
console
.
info
(
'Exit createOutputs'
);
return
true
;
}
async
function
releaseOutput
()
{
console
.
info
(
'Enter
creat
eOutput'
);
console
.
info
(
'Enter
releas
eOutput'
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
await
mPreviewOutput
.
stop
();
...
...
@@ -529,7 +548,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
await mVideoOutput.release();
}
*/
console
.
info
(
'Exit
creat
eOutput'
);
console
.
info
(
'Exit
releas
eOutput'
);
return
true
;
}
...
...
@@ -577,7 +596,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
console
.
info
(
TAG
+
"Exit startCameraSession"
);
...
...
@@ -596,7 +615,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
if
(
!
isEmpty
(
mCameraInput
))
{
...
...
@@ -698,7 +717,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -740,7 +759,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -902,7 +921,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -944,7 +963,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1106,7 +1125,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1148,7 +1167,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
浏览文件 @
535a851a
...
...
@@ -363,7 +363,14 @@ export default function cameraSessionFlashTest(surfaceId: any) {
return
false
;
}
mCameraInput
=
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
mCameraInput
=
null
;
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'createCameraInput success'
);
mCameraInput
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'createCameraInput failed, err = '
+
err
.
message
);
});
if
(
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"createCameraInput FAILED"
);
return
false
;
...
...
@@ -403,68 +410,80 @@ export default function cameraSessionFlashTest(surfaceId: any) {
async
function
createOutput
(
idx
:
any
)
{
console
.
info
(
'Enter createOutput'
);
let
cameraOutputCap
=
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]);
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
let
cameraOutputCap
=
null
;
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'getSupportedOutputCapability success'
);
cameraOutputCap
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'getSupportedOutputCapability failed, err = '
+
err
.
message
);
mPreviewOutput
=
null
;
mPhotoOutput
=
null
;
});
if
(
!
isEmpty
(
cameraOutputCap
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
}
}
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
*/
}
*/
console
.
info
(
'Exit createOutputs'
);
return
true
;
}
async
function
releaseOutput
()
{
console
.
info
(
'Enter
creat
eOutput'
);
console
.
info
(
'Enter
releas
eOutput'
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
await
mPreviewOutput
.
stop
();
...
...
@@ -480,7 +499,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
await mVideoOutput.release();
}
*/
console
.
info
(
'Exit
creat
eOutput'
);
console
.
info
(
'Exit
releas
eOutput'
);
return
true
;
}
...
...
@@ -528,7 +547,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
console
.
info
(
TAG
+
"Exit startCameraSession"
);
...
...
@@ -547,7 +566,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
if
(
!
isEmpty
(
mCameraInput
))
{
...
...
@@ -649,7 +668,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -691,7 +710,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 FAILED with hasFlash is: "
+
hasFlashPromise
);
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -742,7 +761,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 not support"
);
}
...
...
@@ -788,7 +807,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 not support"
);
}
...
...
@@ -955,7 +974,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 not support"
);
}
...
...
@@ -1001,7 +1020,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 not support"
);
}
...
...
@@ -1167,7 +1186,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 not support"
);
}
...
...
@@ -1213,7 +1232,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 not support"
);
}
...
...
@@ -1379,7 +1398,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 not support"
);
}
...
...
@@ -1425,7 +1444,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 not support"
);
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
浏览文件 @
535a851a
...
...
@@ -408,7 +408,14 @@ export default function cameraSessionFocusTest(surfaceId: any) {
return
false
;
}
mCameraInput
=
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
mCameraInput
=
null
;
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'createCameraInput success'
);
mCameraInput
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'createCameraInput failed, err = '
+
err
.
message
);
});
if
(
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"createCameraInput FAILED"
);
return
false
;
...
...
@@ -448,68 +455,80 @@ export default function cameraSessionFocusTest(surfaceId: any) {
async
function
createOutput
(
idx
:
any
)
{
console
.
info
(
'Enter createOutput'
);
let
cameraOutputCap
=
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]);
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
let
cameraOutputCap
=
null
;
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'getSupportedOutputCapability success'
);
cameraOutputCap
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'getSupportedOutputCapability failed, err = '
+
err
.
message
);
mPreviewOutput
=
null
;
mPhotoOutput
=
null
;
});
if
(
!
isEmpty
(
cameraOutputCap
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
}
}
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
*/
}
*/
console
.
info
(
'Exit createOutputs'
);
return
true
;
}
async
function
releaseOutput
()
{
console
.
info
(
'Enter
creat
eOutput'
);
console
.
info
(
'Enter
releas
eOutput'
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
await
mPreviewOutput
.
stop
();
...
...
@@ -525,7 +544,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
await mVideoOutput.release();
}
*/
console
.
info
(
'Exit
creat
eOutput'
);
console
.
info
(
'Exit
releas
eOutput'
);
return
true
;
}
...
...
@@ -573,7 +592,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
console
.
info
(
TAG
+
"Exit startCameraSession"
);
...
...
@@ -592,7 +611,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
if
(
!
isEmpty
(
mCameraInput
))
{
...
...
@@ -694,7 +713,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -736,7 +755,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -898,7 +917,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -940,7 +959,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1102,7 +1121,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1144,7 +1163,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1306,7 +1325,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1348,7 +1367,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -1457,7 +1476,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with FocusMode is: "
+
focusMode
);
expect
()
.
assertFail
();
}
await
sleep
(
100
0
);
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 not support"
);
}
...
...
@@ -2438,7 +2457,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -2475,7 +2494,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 finish"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 PASSED with FocalLength is: "
+
focalLength
);
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
浏览文件 @
535a851a
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
浏览文件 @
535a851a
...
...
@@ -365,7 +365,14 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
return
false
;
}
mCameraInput
=
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
mCameraInput
=
null
;
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'createCameraInput success'
);
mCameraInput
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'createCameraInput failed, err = '
+
err
.
message
);
});
if
(
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"createCameraInput FAILED"
);
return
false
;
...
...
@@ -405,68 +412,80 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
async
function
createOutput
(
idx
:
any
)
{
console
.
info
(
'Enter createOutput'
);
let
cameraOutputCap
=
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]);
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
let
cameraOutputCap
=
null
;
await
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
])
.
then
((
result
)
=>
{
console
.
info
(
'getSupportedOutputCapability success'
);
cameraOutputCap
=
result
;
})
.
catch
((
err
)
=>
{
console
.
info
(
'getSupportedOutputCapability failed, err = '
+
err
.
message
);
mPreviewOutput
=
null
;
mPhotoOutput
=
null
;
});
if
(
!
isEmpty
(
cameraOutputCap
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
}
}
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
if
(
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"createPreviewOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhotoSurface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
if
(
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"createPhotoOutput FAILED"
);
}
console
.
info
(
TAG
+
"createPhotoOutput: "
+
mPhotoOutput
);
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
*/
}
*/
console
.
info
(
'Exit createOutputs'
);
return
true
;
}
async
function
releaseOutput
()
{
console
.
info
(
'Enter
creat
eOutput'
);
console
.
info
(
'Enter
releas
eOutput'
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
await
mPreviewOutput
.
stop
();
...
...
@@ -482,7 +501,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
await mVideoOutput.release();
}
*/
console
.
info
(
'Exit
creat
eOutput'
);
console
.
info
(
'Exit
releas
eOutput'
);
return
true
;
}
...
...
@@ -530,7 +549,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
console
.
info
(
TAG
+
"Exit startCameraSession"
);
...
...
@@ -549,7 +568,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
}
})
await sleep(100
0
);
await sleep(100);
*/
if
(
!
isEmpty
(
mCameraInput
))
{
...
...
@@ -662,7 +681,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED : "
+
err
.
message
);
}
})
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -713,7 +732,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED"
);
}
await
sleep
(
100
0
);
await
sleep
(
100
);
await
stopCameraSession
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录