Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4c241029
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看板
提交
4c241029
编写于
4月 03, 2023
作者:
Q
qinliwen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<修复cameraVideo和cameraPreviewFormat切换format问题>
Signed-off-by:
N
qinliwen
<
qinliwen3@huawei.com
>
上级
9bdddb64
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
12 deletion
+22
-12
validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets
...validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets
+1
-1
validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets
...lidator/src/main/ets/pages/Camera/CameraPreviewFormat.ets
+2
-2
validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets
.../acts_validator/src/main/ets/pages/Camera/CameraVideo.ets
+3
-3
validator/acts_validator/src/main/ets/pages/model/CameraService.ts
.../acts_validator/src/main/ets/pages/model/CameraService.ts
+16
-6
未找到文件。
validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets
浏览文件 @
4c241029
...
...
@@ -79,7 +79,7 @@ struct cameraOrientation {
async cameraInit(obj?) {
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex, obj, this.clickFrequency).then(() => {
this.resolution = CameraService.p
reviewSize
Resolution
this.resolution = CameraService.p
hoto
Resolution
this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value)
this.cameraListFn()
})
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets
浏览文件 @
4c241029
...
...
@@ -63,7 +63,7 @@ struct cameraFormat {
}
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.resolutionSelectVal = String(this.resolution[this.clickFrequency].value)
this.cameraListFn()
...
...
@@ -170,7 +170,7 @@ struct cameraFormat {
"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}`)
})
.backgroundColor(Color.Black)
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets
浏览文件 @
4c241029
...
...
@@ -105,8 +105,8 @@ struct cameraOrientation {
}
async cameraInit(obj?) {
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex
, obj
).then(() => {
this.resolution = CameraService.
r
esolution
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex).then(() => {
this.resolution = CameraService.
videoR
esolution
this.resolutionSelectVal = String(this.resolution[this.clickFrequency].value)
this.cameraListFn()
})
...
...
@@ -199,7 +199,7 @@ struct cameraOrientation {
"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}`)
})
.backgroundColor(Color.Black)
...
...
validator/acts_validator/src/main/ets/pages/model/CameraService.ts
浏览文件 @
4c241029
...
...
@@ -77,7 +77,8 @@ class CameraService {
}
private
videoOutputStopBol
:
boolean
=
true
resolution
:
any
=
null
previewSizeResolution
:
any
=
null
photoResolution
:
any
=
null
videoResolution
:
any
=
null
constructor
()
{
try
{
...
...
@@ -132,7 +133,7 @@ class CameraService {
}
}
async
initCamera
(
surfaceId
:
number
,
cameraDeviceIndex
:
number
,
obj
?,
photoIndex
?)
{
async
initCamera
(
surfaceId
:
number
,
cameraDeviceIndex
:
number
,
obj
?,
photoIndex
?
,
previewObj
?
)
{
try
{
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
this
.
videoConfig
.
videoSourceType
=
1
...
...
@@ -140,12 +141,13 @@ 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
)
// await this.createPreviewOutputFn(obj ? obj : this.photoProfileObj, surfaceId)
await
this
.
createPreviewOutputFn
(
this
.
cameraOutputCapability
.
previewProfiles
[
0
],
surfaceId
)
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
])
await
this
.
createCameraInputFn
(
this
.
cameras
[
cameraDeviceIndex
])
...
...
@@ -441,8 +443,9 @@ class CameraService {
this
.
cameraOutputCapability
=
this
.
cameraManager
.
getSupportedOutputCapability
(
this
.
cameras
[
cameraDeviceIndex
])
let
previewSize
=
[]
let
photoSize
=
[]
let
videoSize
=
[]
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
({
value
:
`
${
item
.
size
.
width
}
x
${
item
.
size
.
height
}
`
})
...
...
@@ -453,12 +456,19 @@ class CameraService {
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 photoProfiles:`
+
JSON
.
stringify
(
this
.
cameraOutputCapability
.
photoProfiles
))
Logger
.
info
(
this
.
tag
,
`cameraOutputCapability videoProfiles:`
+
JSON
.
stringify
(
this
.
cameraOutputCapability
.
videoProfiles
))
Logger
.
info
(
this
.
tag
,
`cameraOutputCapability previewProfiles previewSize:`
+
JSON
.
stringify
(
previewSize
))
this
.
resolution
=
previewSize
this
.
previewSizeResolution
=
photoSize
this
.
photoResolution
=
photoSize
this
.
videoResolution
=
videoSize
return
previewSize
}
// 释放会话及其相关参数
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录