Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
800b04b9
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看板
提交
800b04b9
编写于
8月 23, 2023
作者:
D
dongwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用例多设备适配 问题修复
Signed-off-by:
N
dongwei
<
dongwei@kaihong.com
>
上级
3e575387
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
98 addition
and
114 deletion
+98
-114
multimedia/media/media_js_standard/avRecorder/src/main/js/test/AvVideoRecorderFuncTestOne.test.js
...order/src/main/js/test/AvVideoRecorderFuncTestOne.test.js
+98
-114
未找到文件。
multimedia/media/media_js_standard/avRecorder/src/main/js/test/AvVideoRecorderFuncTestOne.test.js
浏览文件 @
800b04b9
...
...
@@ -16,6 +16,7 @@
import
deviceInfo
from
'
@ohos.deviceInfo
'
import
media
from
'
@ohos.multimedia.media
'
import
camera
from
'
@ohos.multimedia.camera
'
import
display
from
'
@ohos.display
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
*
as
avRecorderTestBase
from
'
../../../../../AVRecorderTestBase.js
'
;
import
*
as
avVideoRecorderTestBase
from
'
../../../../../AvVideoRecorderTestBase.js
'
;
...
...
@@ -41,7 +42,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
48000
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -51,7 +52,7 @@ export default function avVideoRecorderTestOne() {
let
avConfig
=
{
audioSourceType
:
media
.
AudioSourceType
.
AUDIO_SOURCE_TYPE_MIC
,
videoSourceType
:
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
,
profile
:
avProfile
,
profile
:
avProfile
,
url
:
'
fd://35
'
,
// 参考应用文件访问与管理开发示例新建并读写一个文件
rotation
:
0
,
// 视频旋转角度,默认为0不旋转,支持的值为0、90、180、270
location
:
{
latitude
:
30
,
longitude
:
130
},
...
...
@@ -59,7 +60,7 @@ export default function avVideoRecorderTestOne() {
let
avProfileMpeg
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
videoBitrate
:
10
0000
,
videoBitrate
:
28
0000
,
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
...
...
@@ -80,7 +81,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
48000
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
videoBitrate
:
10
0000
,
videoBitrate
:
28
0000
,
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
...
...
@@ -98,7 +99,7 @@ export default function avVideoRecorderTestOne() {
}
let
avProfileH264
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
videoBitrate
:
10
0000
,
videoBitrate
:
28
0000
,
videoCodec
:
media
.
CodecMimeType
.
VIDEO_AVC
,
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
...
...
@@ -119,7 +120,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
48000
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
videoBitrate
:
10
0000
,
videoBitrate
:
28
0000
,
videoCodec
:
media
.
CodecMimeType
.
VIDEO_AVC
,
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
...
...
@@ -172,16 +173,10 @@ export default function avVideoRecorderTestOne() {
let
previewOutput
;
let
cameraOutputCap
;
let
videoSurfaceId
=
null
;
let
myProfile
=
null
;
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll in1
'
);
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
console
.
info
(
TAG
+
'
rk3568 avConfig.videoSourceType is :
'
+
avConfig
.
videoSourceType
)
}
else
{
avConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
console
.
info
(
TAG
+
'
rk3568 avConfig.videoSourceType is :
'
+
avConfig
.
videoSourceType
)
}
let
permissionName1
=
'
ohos.permission.MICROPHONE
'
;
let
permissionName2
=
'
ohos.permission.MEDIA_LOCATION
'
;
let
permissionName3
=
'
ohos.permission.READ_MEDIA
'
;
...
...
@@ -191,6 +186,36 @@ export default function avVideoRecorderTestOne() {
await
mediaTestBase
.
getPermission
(
permissionNames
);
await
mediaTestBase
.
msleepAsync
(
5000
);
await
mediaTestBase
.
driveFn
(
4
)
let
context
=
globalThis
.
contextVideo
;
console
.
info
(
'
initCamera 002
'
);
cameraManager
=
camera
.
getCameraManager
(
context
)
console
.
info
(
'
initCamera 003
'
);
if
(
!
cameraManager
)
{
console
.
error
(
"
camera.getCameraManager error
"
)
return
;
}
let
cameras
=
cameraManager
.
getSupportedCameras
();
let
cameraDevice
=
cameras
[
0
];
console
.
info
(
'
initCamera 006
'
);
let
cameraOutputCapability
=
cameraManager
.
getSupportedOutputCapability
(
cameraDevice
);
console
.
info
(
'
initCamera 007
'
);
let
defaultDisplay
=
null
;
try
{
defaultDisplay
=
display
.
getDefaultDisplaySync
();
}
catch
(
exception
)
{
console
.
error
(
'
Failed to obtain the default display object. Code:
'
+
JSON
.
stringify
(
exception
));
}
let
availableVideoProfileList
=
[];
getVideoProfile
(
cameraOutputCapability
.
videoProfiles
,
defaultDisplay
.
width
,
defaultDisplay
.
height
,
availableVideoProfileList
,
0
);
myProfile
=
availableVideoProfileList
[
0
];
let
configs
=
[
avConfig
,
avConfigMpeg
,
avConfigMpegAac
,
avConfigH264
,
avConfigH264Aac
]
for
(
let
i
=
0
;
i
<
configs
.
length
;
i
++
)
{
isRkDevice
(
configs
[
i
])
}
avConfigH264
.
profile
.
videoBitrate
=
280000
;
avConfigH264Aac
.
profile
.
videoBitrate
=
280000
;
console
.
info
(
'
beforeAll out
'
);
})
...
...
@@ -216,31 +241,41 @@ export default function avVideoRecorderTestOne() {
console
.
info
(
'
afterAll case
'
);
})
async
function
initCamera
(
avRecorder
,
avConfig
,
recorderTime
,
steps
,
done
)
{
console
.
info
(
'
initCamera 001
'
);
// 创建CameraManager对象
let
context
=
globalThis
.
contextVideo
;
console
.
info
(
'
initCamera 002
'
);
cameraManager
=
camera
.
getCameraManager
(
context
)
console
.
info
(
'
initCamera 003
'
);
if
(
!
cameraManager
)
{
console
.
error
(
"
camera.getCameraManager error
"
)
return
;
function
getVideoProfile
(
sizeList
,
width
,
height
,
toList
,
index
)
{
console
.
log
(
'
display width:
'
+
width
+
'
, height:
'
+
height
);
let
videoProfile
=
undefined
;
for
(
let
i
=
0
;
i
<
sizeList
.
length
;
i
++
)
{
const
size
=
sizeList
[
i
].
size
;
if
(
isCorrectSize
(
size
,
width
,
height
))
{
if
(
!
videoProfile
||
size
.
width
>
videoProfile
.
size
.
width
)
{
videoProfile
=
sizeList
[
i
];
}
}
}
toList
[
index
]
=
videoProfile
;
console
.
log
(
'
choosen videoProfile:
'
+
JSON
.
stringify
(
videoProfile
));
}
function
isCorrectSize
(
size
,
standardWidth
,
standardHeight
)
{
return
(
size
.
width
<=
standardWidth
)
&&
(
size
.
height
<=
standardHeight
);
}
console
.
info
(
'
initCamera 004
'
);
console
.
info
(
'
initCamera 005
'
);
function
isRkDevice
(
avConfig
)
{
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
avConfig
.
profile
.
videoFrameWidth
=
myProfile
.
size
.
width
;
avConfig
.
profile
.
videoFrameHeight
=
myProfile
.
size
.
height
;
}
async
function
initCamera
(
avRecorder
,
avConfig
,
recorderTime
,
steps
,
done
)
{
// 获取相机列表
let
cameras
=
cameraManager
.
getSupportedCameras
();
let
cameraDevice
=
cameras
[
0
];
console
.
info
(
'
initCamera 006
'
);
// 查询相机设备在模式下支持的输出能力
let
cameraOutputCapability
=
cameraManager
.
getSupportedOutputCapability
(
cameraDevice
);
console
.
info
(
'
initCamera 007
'
);
console
.
info
(
'
getSupportedOutputCapability success
'
);
console
.
log
(
`cameraOutputCapability previewProfiles:
${
cameraOutputCapability
.
previewProfiles
}
`
);
console
.
log
(
`cameraOutputCapability photoProfiles:
${
cameraOutputCapability
.
photoProfiles
}
`
);
console
.
log
(
`cameraOutputCapability videoProfiles:
${
cameraOutputCapability
.
videoProfiles
}
`
);
// 创建相机输入流
try
{
cameraInput
=
cameraManager
.
createCameraInput
(
cameraDevice
);
...
...
@@ -254,7 +289,8 @@ export default function avVideoRecorderTestOne() {
})
// 创建VideoOutput对象
let
profile
=
cameraOutputCapability
.
videoProfiles
[
0
];
// let profile = cameraOutputCapability.videoProfiles[0];
let
profile
=
myProfile
;
try
{
videoOutput
=
cameraManager
.
createVideoOutput
(
profile
,
videoSurfaceId
)
console
.
info
(
'
createVideoOutput success
'
);
...
...
@@ -2638,7 +2674,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
48000
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -2656,11 +2692,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -2693,7 +2725,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
-
1
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -2711,11 +2743,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -2766,11 +2794,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -2803,7 +2827,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
48000
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -2821,11 +2845,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -4150,7 +4170,7 @@ export default function avVideoRecorderTestOne() {
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_1000 start
'
)
let
avNewProfile
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -4167,11 +4187,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -4206,7 +4222,7 @@ export default function avVideoRecorderTestOne() {
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_1100 start
'
)
let
avNewProfile
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -4223,11 +4239,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -4264,7 +4276,7 @@ export default function avVideoRecorderTestOne() {
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_1200 start
'
)
let
avNewProfile
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -4281,11 +4293,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -4324,7 +4332,7 @@ export default function avVideoRecorderTestOne() {
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_1300 start
'
)
let
avNewProfile
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -4341,11 +4349,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -4382,7 +4386,7 @@ export default function avVideoRecorderTestOne() {
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_1400 start
'
)
let
avNewProfile
=
{
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -4399,11 +4403,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// setAvRecorderCallback
CREATE_PROMISE_EVENT
,
SETONCALLBACK_EVENT
,
...
...
@@ -5176,7 +5176,7 @@ export default function avVideoRecorderTestOne() {
audioSampleRate
:
48000
,
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
videoBitrate
:
28
0000
,
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
...
...
@@ -5194,11 +5194,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// init avRecorder
CREATE_CALLBACK_EVENT
,
SETONCALLBACK_EVENT
,
PREPARE_CALLBACK_EVENT
,
...
...
@@ -5227,7 +5223,7 @@ export default function avVideoRecorderTestOne() {
audioSampleRate
:
-
1
,
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
videoBitrate
:
28
0000
,
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
...
...
@@ -5245,11 +5241,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// init avRecorder
CREATE_CALLBACK_EVENT
,
SETONCALLBACK_EVENT
,
PREPARE_CALLBACK_EVENT
,
...
...
@@ -5296,11 +5288,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// init avRecorder
CREATE_CALLBACK_EVENT
,
SETONCALLBACK_EVENT
,
PREPARE_CALLBACK_EVENT
,
...
...
@@ -5329,7 +5317,7 @@ export default function avVideoRecorderTestOne() {
audioCodec
:
media
.
CodecMimeType
.
AUDIO_AAC
,
audioSampleRate
:
48000
,
fileFormat
:
media
.
ContainerFormatType
.
CFT_MPEG_4
,
// 视频文件封装格式,只支持MP4
videoBitrate
:
10
0000
,
// 视频比特率
videoBitrate
:
28
0000
,
// 视频比特率
videoCodec
:
media
.
CodecMimeType
.
VIDEO_MPEG4
,
// 视频文件编码格式,支持mpeg4和avc两种格式
videoFrameWidth
:
640
,
// 视频分辨率的宽
videoFrameHeight
:
480
,
// 视频分辨率的高
...
...
@@ -5347,11 +5335,7 @@ export default function avVideoRecorderTestOne() {
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
;
avNewConfig
.
url
=
fdPath
;
if
(
deviceInfo
.
deviceType
===
'
default
'
)
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_ES
}
else
{
avNewConfig
.
videoSourceType
=
media
.
VideoSourceType
.
VIDEO_SOURCE_TYPE_SURFACE_YUV
}
isRkDevice
(
avNewConfig
)
let
mySteps
=
new
Array
(
// init avRecorder
CREATE_CALLBACK_EVENT
,
SETONCALLBACK_EVENT
,
PREPARE_CALLBACK_EVENT
,
...
...
@@ -6535,7 +6519,7 @@ export default function avVideoRecorderTestOne() {
it
(
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_MPEG4_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_MPEG4_1100 start
'
)
avProfileMpegAac
.
videoFrameRate
=
6
0
avProfileMpegAac
.
videoFrameRate
=
3
0
let
fileName
=
avVideoRecorderTestBase
.
resourceName
()
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
...
...
@@ -6596,7 +6580,7 @@ export default function avVideoRecorderTestOne() {
// end
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
avRecorder
,
avConfigMpeg
Aac
,
recorderTime
,
mySteps
,
done
);
eventEmitter
.
emit
(
mySteps
[
0
],
avRecorder
,
avConfigMpeg
,
recorderTime
,
mySteps
,
done
);
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_MPEG4_1200 end
'
)
})
...
...
@@ -7026,7 +7010,7 @@ export default function avVideoRecorderTestOne() {
it
(
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_CALLBACK_MPEG4_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_CALLBACK_MPEG4_1100 start
'
)
avProfileMpegAac
.
videoFrameRate
=
6
0
avProfileMpegAac
.
videoFrameRate
=
3
0
let
fileName
=
avVideoRecorderTestBase
.
resourceName
()
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
...
...
@@ -7501,7 +7485,7 @@ export default function avVideoRecorderTestOne() {
it
(
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_H264_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_PROMISE_H264_1100 start
'
)
avProfileH264Aac
.
videoFrameRate
=
6
0
avProfileH264Aac
.
videoFrameRate
=
3
0
let
fileName
=
avVideoRecorderTestBase
.
resourceName
()
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
...
...
@@ -7992,7 +7976,7 @@ export default function avVideoRecorderTestOne() {
it
(
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_CALLBACK_H264_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_MULTIMEDIA_AVRECORDER_VIDEO_FUNCTION_CALLBACK_H264_1100 start
'
)
avProfileH264Aac
.
videoFrameRate
=
6
0
avProfileH264Aac
.
videoFrameRate
=
3
0
let
fileName
=
avVideoRecorderTestBase
.
resourceName
()
fdObject
=
await
mediaTestBase
.
getAvRecorderFd
(
fileName
,
"
video
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录