未验证 提交 c96f43eb 编写于 作者: O openharmony_ci 提交者: Gitee

!8329 修复媒体validator问题

Merge pull request !8329 from 秦莉文/OpenHarmony-3.2-Release
...@@ -117,7 +117,7 @@ struct audioOutputRouting { ...@@ -117,7 +117,7 @@ struct audioOutputRouting {
} }
} }
Row(){ Row(){
Text('测试目的:\n当设备连接蓝牙耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持蓝牙外设\n2. 按下播放按钮\n3. 连接华为蓝牙耳机\n4. 拔出蓝牙耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持蓝牙耳机连接或者插拔蓝牙耳机后接收到路由通知、路由显示正确,且连接蓝牙后音频通过蓝牙耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp') Text('测试目的:\n当设备连接蓝牙耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持蓝牙外设\n2. 按下播放按钮\n3. 连接蓝牙耳机\n4. 拔出蓝牙耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持蓝牙耳机连接或者插拔蓝牙耳机后接收到路由通知、路由显示正确,且连接蓝牙后音频通过蓝牙耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp')
} }
Row(){ Row(){
......
...@@ -117,7 +117,7 @@ struct audioOutputRouting { ...@@ -117,7 +117,7 @@ struct audioOutputRouting {
} }
} }
Row(){ Row(){
Text('测试目的:\n当设备连接TypeC耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持TypeC外设\n2. 按下播放按钮\n3. 连接华为TypeC耳机\n4. 拔出TypeC耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持TypeC耳机连接或者插拔TypeC耳机后接收到路由通知、路由显示正确,且连接TypeC后音频通过TypeC耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp') Text('测试目的:\n当设备连接TypeC耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持TypeC外设\n2. 按下播放按钮\n3. 连接TypeC耳机\n4. 拔出TypeC耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持TypeC耳机连接或者插拔TypeC耳机后接收到路由通知、路由显示正确,且连接TypeC后音频通过TypeC耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp')
} }
Row(){ Row(){
......
...@@ -117,7 +117,7 @@ struct audioOutputRouting { ...@@ -117,7 +117,7 @@ struct audioOutputRouting {
} }
} }
Row(){ Row(){
Text('测试目的:\n当设备连接3.5mm有线耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持3.5mm耳机外设\n2. 按下播放按钮\n3. 连接华为3.5mm有线耳机\n4. 拔出3.5mm有线耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持有线耳机输入或者插入和拔出有线耳机后接收到路由通知,路由显示正确,且连接外设后音频通过外设播放,则用例pass').fontColor(Color.White).fontSize('18fp') Text('测试目的:\n当设备连接3.5mm有线耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持3.5mm耳机外设\n2. 按下播放按钮\n3. 连接3.5mm有线耳机\n4. 拔出3.5mm有线耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持有线耳机输入或者插入和拔出有线耳机后接收到路由通知,路由显示正确,且连接外设后音频通过外设播放,则用例pass').fontColor(Color.White).fontSize('18fp')
} }
Row(){ Row(){
......
...@@ -61,6 +61,8 @@ struct cameraOrientation { ...@@ -61,6 +61,8 @@ struct cameraOrientation {
this.imageRotation = this.imageRotation + 90 this.imageRotation = this.imageRotation + 90
if (this.imageRotation > 270 && this.clickFrequency > 3) { if (this.imageRotation > 270 && this.clickFrequency > 3) {
this.imageRotation = 0 this.imageRotation = 0
}
if (this.cameraListLength > 1){
this.cameraDeviceIndex = 1 this.cameraDeviceIndex = 1
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex) CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex)
} }
...@@ -69,12 +71,14 @@ struct cameraOrientation { ...@@ -69,12 +71,14 @@ struct cameraOrientation {
cameraListFn() { cameraListFn() {
this.cameraListLength = CameraService.cameras.length this.cameraListLength = CameraService.cameras.length
Logger.info(this.tag, `cameraListFn cameraListLength: ${this.cameraListLength}`)
this.testingFrequency = this.cameraListLength * 4
Logger.info(this.tag, `cameraListFn testingFrequency: ${this.testingFrequency}`)
for (let index = 0; index < this.cameraListLength; index++) { for (let index = 0; index < this.cameraListLength; index++) {
this.cameraList.push({ this.cameraList.push({
value: `Camera ${index}` value: `Camera ${index}`
}) })
} }
this.testingFrequency = this.cameraListLength * 4
} }
handleTakePicture = (assetUri: string) => { handleTakePicture = (assetUri: string) => {
...@@ -83,10 +87,11 @@ struct cameraOrientation { ...@@ -83,10 +87,11 @@ struct cameraOrientation {
} }
onPageShow() { onPageShow() {
Logger.info(this.tag, `takePicture end, assetUri`) Logger.info(this.tag, `cameraOrientation onPageShow`)
// @ts-ignore // @ts-ignore
this.surfaceId = this.mXComponentController.getXComponentSurfaceId() this.surfaceId = this.mXComponentController.getXComponentSurfaceId()
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex).then(() => { CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex).then(() => {
Logger.info(this.tag, `onPageShow initCamera start`)
this.cameraListFn() this.cameraListFn()
}) })
} }
...@@ -165,7 +170,7 @@ struct cameraOrientation { ...@@ -165,7 +170,7 @@ struct cameraOrientation {
FillColor: $FillColor, FillColor: $FillColor,
name: $name, name: $name,
Vue: $Vue, Vue: $Vue,
testingFrequency: this.testingFrequency, testingFrequency: $testingFrequency,
isEnabled: $isEnabled, isEnabled: $isEnabled,
clickFrequency: $clickFrequency clickFrequency: $clickFrequency
}).height('10%').width('100%') }).height('10%').width('100%')
......
...@@ -79,7 +79,7 @@ struct cameraOrientation { ...@@ -79,7 +79,7 @@ struct cameraOrientation {
async cameraInit(obj?) { async cameraInit(obj?) {
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj, this.clickFrequency).then(() => { CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj, this.clickFrequency).then(() => {
this.resolution = CameraService.previewSizeResolution this.resolution = CameraService.photoResolution
this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value) this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value)
this.cameraListFn() this.cameraListFn()
}) })
...@@ -174,6 +174,7 @@ struct cameraOrientation { ...@@ -174,6 +174,7 @@ struct cameraOrientation {
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj) CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj)
Logger.info(this.tag, `onSelect Rotation index: ${index}, value: ${value}, obj: ${obj}`) Logger.info(this.tag, `onSelect Rotation index: ${index}, value: ${value}, obj: ${obj}`)
}) })
.backgroundColor(Color.Black)
Select(this.cameraList) Select(this.cameraList)
.selected(this.cameraDeviceIndex) .selected(this.cameraDeviceIndex)
.value(this.cameraDeviceIndex ? 'Camera 1' : 'Camera 0') .value(this.cameraDeviceIndex ? 'Camera 1' : 'Camera 0')
...@@ -189,6 +190,7 @@ struct cameraOrientation { ...@@ -189,6 +190,7 @@ struct cameraOrientation {
this.cameraListFn() this.cameraListFn()
}) })
}) })
.backgroundColor(Color.Black)
}.justifyContent(FlexAlign.SpaceEvenly) }.justifyContent(FlexAlign.SpaceEvenly)
Text(`提示:不同拍照分辨率下进行拍摄,图片拍摄成功且与预览画面一致则选择pass,否则选择fail`) Text(`提示:不同拍照分辨率下进行拍摄,图片拍摄成功且与预览画面一致则选择pass,否则选择fail`)
......
...@@ -63,7 +63,7 @@ struct cameraFormat { ...@@ -63,7 +63,7 @@ struct cameraFormat {
} }
async cameraInit(obj?) { async cameraInit(obj?) {
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj).then(() => { CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, undefined, undefined, obj).then(() => {
this.resolution = CameraService.resolution this.resolution = CameraService.resolution
this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value) this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value)
this.cameraListFn() this.cameraListFn()
...@@ -170,9 +170,10 @@ struct cameraFormat { ...@@ -170,9 +170,10 @@ struct cameraFormat {
"height": objH "height": objH
} }
} }
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj) CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, undefined, undefined, obj)
Logger.info(this.tag, `onSelect Rotation index: ${index}, value: ${value}, obj: ${obj}`) Logger.info(this.tag, `onSelect Rotation index: ${index}, value: ${value}, obj: ${obj}`)
}) })
.backgroundColor(Color.Black)
Select(this.cameraList) Select(this.cameraList)
.selected(this.cameraDeviceIndex) .selected(this.cameraDeviceIndex)
.value(this.cameraDeviceIndex ? 'Camera 1' : 'Camera 0') .value(this.cameraDeviceIndex ? 'Camera 1' : 'Camera 0')
...@@ -186,6 +187,7 @@ struct cameraFormat { ...@@ -186,6 +187,7 @@ struct cameraFormat {
this.cameraDeviceIndex = index this.cameraDeviceIndex = index
this.cameraInit() this.cameraInit()
}) })
.backgroundColor(Color.Black)
}.size({ width: '100%', height: '50%' }).justifyContent(FlexAlign.SpaceEvenly) }.size({ width: '100%', height: '50%' }).justifyContent(FlexAlign.SpaceEvenly)
Row() { Row() {
...@@ -201,6 +203,7 @@ struct cameraFormat { ...@@ -201,6 +203,7 @@ struct cameraFormat {
.onSelect((index: number, value) => { .onSelect((index: number, value) => {
Logger.info(this.tag, `onSelect format index: ${index}, value: ${value}`) Logger.info(this.tag, `onSelect format index: ${index}, value: ${value}`)
}) })
.backgroundColor(Color.Black)
Button('下一个') Button('下一个')
.borderRadius(8) .borderRadius(8)
.backgroundColor(0x317aff) .backgroundColor(0x317aff)
......
...@@ -158,6 +158,7 @@ struct cameraOrientation { ...@@ -158,6 +158,7 @@ struct cameraOrientation {
this.cameraListFn() this.cameraListFn()
}) })
}) })
.backgroundColor(Color.Black)
Text(`提示:`).fontSize('16fp').fontColor(Color.White) Text(`提示:`).fontSize('16fp').fontColor(Color.White)
Text(`期望拍摄${this.cameraListLength*10}张照片,实际拍摄${this.clickSerialPhotoVal}张,如果一致请选择pass,否则选择fail`) Text(`期望拍摄${this.cameraListLength*10}张照片,实际拍摄${this.clickSerialPhotoVal}张,如果一致请选择pass,否则选择fail`)
.fontSize('16fp').fontColor(Color.White) .fontSize('16fp').fontColor(Color.White)
......
...@@ -105,8 +105,8 @@ struct cameraOrientation { ...@@ -105,8 +105,8 @@ struct cameraOrientation {
} }
async cameraInit(obj?) { async cameraInit(obj?) {
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj).then(() => { CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex).then(() => {
this.resolution = CameraService.resolution this.resolution = CameraService.videoResolution
this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value) this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value)
this.cameraListFn() this.cameraListFn()
}) })
...@@ -199,9 +199,10 @@ struct cameraOrientation { ...@@ -199,9 +199,10 @@ struct cameraOrientation {
"height": objH "height": objH
} }
} }
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj) CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex)
Logger.info(this.tag, `onSelect Rotation index: ${index}, value: ${value}, obj: ${obj}`) Logger.info(this.tag, `onSelect Rotation index: ${index}, value: ${value}, obj: ${obj}`)
}) })
.backgroundColor(Color.Black)
Select(this.cameraList) Select(this.cameraList)
.selected(this.cameraDeviceIndex) .selected(this.cameraDeviceIndex)
.value(this.cameraDeviceIndex ? 'Camera 1' : 'Camera 0') .value(this.cameraDeviceIndex ? 'Camera 1' : 'Camera 0')
...@@ -216,6 +217,7 @@ struct cameraOrientation { ...@@ -216,6 +217,7 @@ struct cameraOrientation {
this.cameraDeviceIndex = index this.cameraDeviceIndex = index
this.cameraInit() this.cameraInit()
}) })
.backgroundColor(Color.Black)
Select([{ value: 'YUV' }]) Select([{ value: 'YUV' }])
.selected(0) .selected(0)
.value('YUV') .value('YUV')
...@@ -229,6 +231,7 @@ struct cameraOrientation { ...@@ -229,6 +231,7 @@ struct cameraOrientation {
.onSelect((index: number, value) => { .onSelect((index: number, value) => {
Logger.info(this.tag, `onSelect format index: ${index}, value: ${value}`) Logger.info(this.tag, `onSelect format index: ${index}, value: ${value}`)
}) })
.backgroundColor(Color.Black)
}.size({ width: '100%', height: '50%' }) }.size({ width: '100%', height: '50%' })
Row() { Row() {
......
...@@ -32,7 +32,7 @@ export struct CustomContainer { ...@@ -32,7 +32,7 @@ export struct CustomContainer {
Url : string = ''; Url : string = '';
title : string = ''; title : string = '';
StepTips: string = ''; StepTips: string = '';
testingFrequency: number @Link testingFrequency: number
@Link clickFrequency: number @Link clickFrequency: number
@Builder @Builder
PassBtn(text: Resource, isFullScreen: boolean) { PassBtn(text: Resource, isFullScreen: boolean) {
...@@ -52,6 +52,8 @@ export struct CustomContainer { ...@@ -52,6 +52,8 @@ export struct CustomContainer {
this.isEnabled = true this.isEnabled = true
this.Vue = false this.Vue = false
this.clickFrequency++ this.clickFrequency++
Logger.info(`TAG`, `clickFrequency: ${this.clickFrequency}`)
Logger.info(`TAG`, `testingFrequency: ${this.testingFrequency}`)
if (this.clickFrequency === this.testingFrequency){ if (this.clickFrequency === this.testingFrequency){
router.back({ router.back({
url:this.Url, url:this.Url,
......
...@@ -77,7 +77,8 @@ class CameraService { ...@@ -77,7 +77,8 @@ class CameraService {
} }
private videoOutputStopBol: boolean = true private videoOutputStopBol: boolean = true
resolution: any = null resolution: any = null
previewSizeResolution: any = null photoResolution: any = null
videoResolution: any = null
constructor() { constructor() {
try { try {
...@@ -132,7 +133,7 @@ class CameraService { ...@@ -132,7 +133,7 @@ class CameraService {
} }
} }
async initCamera(surfaceId: number, cameraDeviceIndex: number, obj?, photoIndex?) { async initCamera(surfaceId: number, cameraDeviceIndex: number, obj?, photoIndex?, previewObj?) {
try { try {
if (deviceInfo.deviceType === 'default') { if (deviceInfo.deviceType === 'default') {
this.videoConfig.videoSourceType = 1 this.videoConfig.videoSourceType = 1
...@@ -144,8 +145,11 @@ class CameraService { ...@@ -144,8 +145,11 @@ class CameraService {
await this.getCameraManagerFn() await this.getCameraManagerFn()
await this.getSupportedCamerasFn() await this.getSupportedCamerasFn()
await this.getSupportedOutputCapabilityFn(cameraDeviceIndex) await this.getSupportedOutputCapabilityFn(cameraDeviceIndex)
// await this.createPreviewOutputFn(obj ? obj : this.photoProfileObj, surfaceId) if (previewObj){
await this.createPreviewOutputFn(this.cameraOutputCapability.previewProfiles[0], surfaceId) 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(this.photoProfileObj)
await this.createPhotoOutputFn(obj ? obj : this.cameraOutputCapability.photoProfiles[photoIndex?photoIndex:0]) await this.createPhotoOutputFn(obj ? obj : this.cameraOutputCapability.photoProfiles[photoIndex?photoIndex:0])
await this.createCameraInputFn(this.cameras[cameraDeviceIndex]) await this.createCameraInputFn(this.cameras[cameraDeviceIndex])
...@@ -441,8 +445,9 @@ class CameraService { ...@@ -441,8 +445,9 @@ class CameraService {
this.cameraOutputCapability = this.cameraManager.getSupportedOutputCapability(this.cameras[cameraDeviceIndex]) this.cameraOutputCapability = this.cameraManager.getSupportedOutputCapability(this.cameras[cameraDeviceIndex])
let previewSize = [] let previewSize = []
let photoSize = [] let photoSize = []
let videoSize = []
this.cameraOutputCapability.previewProfiles.forEach((item, index) => { this.cameraOutputCapability.previewProfiles.forEach((item, index) => {
// Logger.info(this.tag, `cameraOutputCapability previewProfiles index: ${index}, item:` + JSON.stringify(item)) Logger.info(this.tag, `cameraOutputCapability previewProfiles index: ${index}, item:` + JSON.stringify(item))
previewSize.push({ previewSize.push({
value: `${item.size.width}x${item.size.height}` value: `${item.size.width}x${item.size.height}`
}) })
...@@ -453,12 +458,19 @@ class CameraService { ...@@ -453,12 +458,19 @@ class CameraService {
value: `${item.size.width}x${item.size.height}` value: `${item.size.width}x${item.size.height}`
}) })
}) })
this.cameraOutputCapability.videoProfiles.forEach((item, index) => {
Logger.info(this.tag, `cameraOutputCapability videoProfiles index: ${index}, item:` + JSON.stringify(item))
videoSize.push({
value: `${item.size.width}x${item.size.height}`
})
})
Logger.info(this.tag, `cameraOutputCapability previewProfiles:` + JSON.stringify(this.cameraOutputCapability.previewProfiles)) Logger.info(this.tag, `cameraOutputCapability previewProfiles:` + JSON.stringify(this.cameraOutputCapability.previewProfiles))
Logger.info(this.tag, `cameraOutputCapability photoProfiles:` + JSON.stringify(this.cameraOutputCapability.photoProfiles)) Logger.info(this.tag, `cameraOutputCapability photoProfiles:` + JSON.stringify(this.cameraOutputCapability.photoProfiles))
Logger.info(this.tag, `cameraOutputCapability videoProfiles:` + JSON.stringify(this.cameraOutputCapability.videoProfiles)) Logger.info(this.tag, `cameraOutputCapability videoProfiles:` + JSON.stringify(this.cameraOutputCapability.videoProfiles))
Logger.info(this.tag, `cameraOutputCapability previewProfiles previewSize:` + JSON.stringify(previewSize)) Logger.info(this.tag, `cameraOutputCapability previewProfiles previewSize:` + JSON.stringify(previewSize))
this.resolution = previewSize this.resolution = previewSize
this.previewSizeResolution = photoSize this.photoResolution = photoSize
this.videoResolution = videoSize
return previewSize return previewSize
} }
// 释放会话及其相关参数 // 释放会话及其相关参数
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册