Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
dbcb7b17
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看板
未验证
提交
dbcb7b17
编写于
3月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2801 修改音频编码资源文件测试代码+代码整改
Merge pull request !2801 from ling990/OpenHarmony-3.1-Release
上级
4749c98a
07038e1b
变更
24
显示空白变更内容
内联
并排
Showing
24 changed file
with
495 addition
and
565 deletion
+495
-565
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
...udioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
+0
-1
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
.../main/js/test/AudioDecoderReliabilityCallbackTest.test.js
+1
-2
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
+1
-2
multimedia/media/media_js_standard/audioEncoder/Test.json
multimedia/media/media_js_standard/audioEncoder/Test.json
+2
-3
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
+42
-39
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
+42
-41
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
+10
-7
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
.../main/js/test/AudioEncoderReliabilityCallbackTest.test.js
+9
-11
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
+9
-11
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
...ideoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
+39
-48
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
...der/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
+48
-58
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
+39
-49
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
...der/src/main/js/test/VideoDecoderReliCallbackTest.test.js
+35
-45
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
+37
-47
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
+41
-51
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
+33
-43
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
+35
-45
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
+37
-47
multimedia/media/media_js_standard/videoEncoder/Test.json
multimedia/media/media_js_standard/videoEncoder/Test.json
+1
-1
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
...r/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
+3
-9
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
+7
-1
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
+7
-1
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
.../test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
+8
-0
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
...s/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
+9
-3
未找到文件。
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -28,7 +28,6 @@ describe('AudioDecoderEnum', function () {
afterEach
(
function
()
{
console
.
info
(
'
afterEach case
'
);
wait
(
2000
);
})
afterAll
(
function
()
{
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -538,8 +538,7 @@ describe('AudioDecoderReliabilityCallback', function () {
}
}
else
{
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
not last frame, continue
"
);
}
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -541,8 +541,7 @@ describe('AudioDecoderReliabilityPromise', function () {
}
}
else
{
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
not last frame, continue
"
);
}
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
...
...
multimedia/media/media_js_standard/audioEncoder/Test.json
浏览文件 @
dbcb7b17
{
"description"
:
"Configuration for audio
Play
er Tests"
,
"description"
:
"Configuration for audio
Encod
er Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
...
...
@@ -19,8 +19,7 @@
"pre-push"
:
[
],
"push"
:
[
"./resource/audio/audioEncode/S32LE.pcm ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/"
,
"./resource/audio/audioEncode/S32LE_2.pcm ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/"
"./resource/audio/audioEncode/S16LE.pcm ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/"
]
},
{
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -19,8 +19,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
AudioEncoderFuncCallback
'
,
function
()
{
const
RESOURCEPATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/
'
const
AUDIOPATH
=
RESOURCEPATH
+
'
S32LE.pcm
'
;
const
AUDIOPATH2
=
RESOURCEPATH
+
'
S32LE_2.pcm
'
;
const
AUDIOPATH
=
RESOURCEPATH
+
'
S16LE.pcm
'
;
const
BASIC_PATH
=
RESOURCEPATH
+
'
results/encode_func_callback_
'
;
let
audioEncodeProcessor
;
let
readStreamSync
;
...
...
@@ -61,7 +60,7 @@ describe('AudioEncoderFuncCallback', function () {
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
ES_LENGTH
=
20
00
;
ES_LENGTH
=
15
00
;
})
afterEach
(
async
function
()
{
...
...
@@ -139,8 +138,8 @@ describe('AudioEncoderFuncCallback', function () {
console
.
info
(
"
start add ADTS to Packet
"
);
let
packetLen
=
len
+
7
;
// 7: head length
let
profile
=
2
;
// 2: AAC LC
let
freqIdx
=
3
;
// 3: 480
00HZ
let
chanCfg
=
1
;
// 1: 1
channel
let
freqIdx
=
4
;
// 4: 441
00HZ
let
chanCfg
=
2
;
// 2: 2
channel
view
[
0
]
=
0xFF
;
view
[
1
]
=
0xF9
;
view
[
2
]
=
((
profile
-
1
)
<<
6
)
+
(
freqIdx
<<
2
)
+
(
chanCfg
>>
2
);
...
...
@@ -163,7 +162,11 @@ describe('AudioEncoderFuncCallback', function () {
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
audioEncodeProcessor
=
null
audioEncodeProcessor
.
release
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case release success
"
);
audioEncodeProcessor
=
null
;
})
}
})
}
...
...
@@ -299,14 +302,14 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
mediaDescription2
=
{
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
}
let
savepath
=
BASIC_PATH
+
'
callback0000.es
'
;
let
savepath
=
BASIC_PATH
+
'
0000.aac
'
;
needGetMediaDes
=
true
;
workdoneAtEOS
=
true
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
@@ -382,11 +385,11 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
callback0100.es
'
;
let
savepath
=
BASIC_PATH
+
'
0100.aac
'
;
eosframenum
=
500
;
workdoneAtEOS
=
true
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
@@ -440,11 +443,11 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
callback0200.es
'
;
let
savepath
=
BASIC_PATH
+
'
0200.aac
'
;
workdoneAtEOS
=
true
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
audioEncodeProcessor
.
getAudioEncoderCaps
((
err
,
Audiocaps
)
=>
{
...
...
@@ -506,11 +509,11 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
callback0300.es
'
;
let
savepath
=
BASIC_PATH
+
'
0300.aac
'
;
eosframenum
=
500
;
flushAtEOS
=
true
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
@@ -564,11 +567,11 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
callback0400.es
'
;
let
savepath
=
BASIC_PATH
+
'
0400.aac
'
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
audioEncodeProcessor
.
getAudioEncoderCaps
((
err
,
Audiocaps
)
=>
{
expect
(
err
).
assertUndefined
();
...
...
@@ -646,11 +649,11 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
callback0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
0500.aac
'
;
eosframenum
=
100
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
audioEncodeProcessor
.
getAudioEncoderCaps
((
err
,
Audiocaps
)
=>
{
...
...
@@ -725,17 +728,17 @@ describe('AudioEncoderFuncCallback', function () {
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
callback0600.es
'
;
let
savepath
=
BASIC_PATH
+
'
0600.aac
'
;
eosframenum
=
100
;
resetAtEOS
=
true
;
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
hasreconfigured
=
false
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
@@ -777,8 +780,8 @@ describe('AudioEncoderFuncCallback', function () {
expect
(
err
).
assertUndefined
();
console
.
info
(
`case configure 2`
);
resetParam
();
readFile
(
AUDIOPATH
2
)
savepath
=
BASIC_PATH
+
'
callback0601.es
'
;
readFile
(
AUDIOPATH
)
savepath
=
BASIC_PATH
+
'
0601.aac
'
;
workdoneAtEOS
=
true
;
hasreconfigured
=
true
;
eventEmitter
.
emit
(
'
prepare
'
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -19,8 +19,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
AudioEncoderFuncPromise
'
,
function
()
{
const
RESOURCEPATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/
'
const
AUDIOPATH
=
RESOURCEPATH
+
'
S32LE.pcm
'
;
const
AUDIOPATH2
=
RESOURCEPATH
+
'
S32LE_2.pcm
'
;
const
AUDIOPATH
=
RESOURCEPATH
+
'
S16LE.pcm
'
;
const
BASIC_PATH
=
RESOURCEPATH
+
'
results/encode_func_promise_
'
;
let
audioEncodeProcessor
;
let
readStreamSync
;
...
...
@@ -38,7 +37,7 @@ describe('AudioEncoderFuncPromise', function () {
let
inputQueue
=
[];
let
outputQueue
=
[];
const
ES
=
[
0
,
4096
];
let
ES_LENGTH
=
20
00
;
let
ES_LENGTH
=
15
00
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -61,7 +60,7 @@ describe('AudioEncoderFuncPromise', function () {
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
ES_LENGTH
=
20
00
;
ES_LENGTH
=
15
00
;
})
afterEach
(
async
function
()
{
...
...
@@ -150,8 +149,8 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
"
start add ADTS to Packet
"
);
let
packetLen
=
len
+
7
;
// 7: head length
let
profile
=
2
;
// 2: AAC LC
let
freqIdx
=
3
;
// 3: 480
00HZ
let
chanCfg
=
1
;
// 1: 1
channel
let
freqIdx
=
4
;
// 4: 441
00HZ
let
chanCfg
=
2
;
// 2: 2
channel
view
[
0
]
=
0xFF
;
view
[
1
]
=
0xF9
;
view
[
2
]
=
((
profile
-
1
)
<<
6
)
+
(
freqIdx
<<
2
)
+
(
chanCfg
>>
2
);
...
...
@@ -169,9 +168,12 @@ describe('AudioEncoderFuncPromise', function () {
async
function
resetWork
()
{
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
await
audioEncodeProcessor
.
reset
().
then
(
async
()
=>
{
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
await
audioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
"
case release success
"
);
},
failCallback
).
catch
(
failCatch
);
audioEncodeProcessor
=
null
;
}
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -202,7 +204,6 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor
=
null
;
}
function
sleep
(
time
)
{
return
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
time
));
}
...
...
@@ -304,14 +305,14 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_00_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test set EOS after last frame and reset
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
mediaDescription2
=
{
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
}
let
savepath
=
BASIC_PATH
+
'
0000.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0000.
aac
'
;
needgetMediaDes
=
true
;
workdoneAtEOS
=
true
;
await
media
.
getMediaCapability
().
then
((
mediaCaps
)
=>
{
...
...
@@ -369,11 +370,11 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_01_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test set EOS manually before last frame and reset
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0100.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0100.
aac
'
;
eosframenum
=
500
;
workdoneAtEOS
=
true
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
...
@@ -408,11 +409,11 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_01_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test flush at running state
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0200.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0200.
aac
'
;
workdoneAtEOS
=
true
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
console
.
info
(
"
case create createAudioEncoder success
"
);
...
...
@@ -453,11 +454,11 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_01_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test flush at EOS state
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0300.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0300.
aac
'
;
eosframenum
=
500
;
flushAtEOS
=
true
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
...
@@ -492,11 +493,11 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_01_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test stop at running state and reset
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0400.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0400.
aac
'
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
console
.
info
(
"
case create createAudioEncoder success
"
);
audioEncodeProcessor
=
processor
;
...
...
@@ -542,11 +543,11 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_01_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test stop and restart
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0500.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0500.
aac
'
;
eosframenum
=
100
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
console
.
info
(
"
case create createAudioEncoder success
"
);
...
...
@@ -596,11 +597,11 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_01_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test reconfigure for new file with the same format
"
);
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0600.
es
'
;
let
savepath
=
BASIC_PATH
+
'
0600.
aac
'
;
eosframenum
=
100
;
resetAtEOS
=
true
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
...
@@ -623,9 +624,9 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
"
case start success
"
);
},
failCallback
).
catch
(
failCatch
);
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
}
await
sleep
(
10000
).
then
(()
=>
{
console
.
info
(
"
start configure 2
"
);
...
...
@@ -633,9 +634,9 @@ describe('AudioEncoderFuncPromise', function () {
await
audioEncodeProcessor
.
configure
(
mediaDescription2
).
then
(()
=>
{
console
.
info
(
"
configure 2 success
"
);
resetParam
();
readFile
(
AUDIOPATH
2
);
readFile
(
AUDIOPATH
);
},
failCallback
).
catch
(
failCatch
);
let
savepath2
=
BASIC_PATH
+
'
0601.
es
'
;
let
savepath2
=
BASIC_PATH
+
'
0601.
aac
'
;
workdoneAtEOS
=
true
;
setCallback
(
savepath2
,
done
);
await
audioEncodeProcessor
.
prepare
().
then
(()
=>
{
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -19,7 +19,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
AudioEncoderFuncPromise
'
,
function
()
{
const
RESOURCEPATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/
'
const
AUDIOPATH
=
RESOURCEPATH
+
'
S
32
LE.pcm
'
;
const
AUDIOPATH
=
RESOURCEPATH
+
'
S
16
LE.pcm
'
;
let
readStreamSync
;
let
eosframenum
=
0
;
let
stopAtEOS
=
false
;
...
...
@@ -35,7 +35,7 @@ describe('AudioEncoderFuncPromise', function () {
let
inputQueue
=
[];
let
outputQueue
=
[];
const
ES
=
[
0
,
4096
];
let
ES_LENGTH
=
20
00
;
let
ES_LENGTH
=
15
00
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -57,7 +57,7 @@ describe('AudioEncoderFuncPromise', function () {
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
ES_LENGTH
=
20
00
;
ES_LENGTH
=
15
00
;
})
afterEach
(
function
()
{
...
...
@@ -140,8 +140,8 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
"
start add ADTS to Packet
"
);
let
packetLen
=
len
+
7
;
// 7: head length
let
profile
=
2
;
// 2: AAC LC
let
freqIdx
=
3
;
// 3: 480
00HZ
let
chanCfg
=
1
;
// 1: 1
channel
let
freqIdx
=
4
;
// 4: 441
00HZ
let
chanCfg
=
2
;
// 2: 2
channel
view
[
0
]
=
0xFF
;
view
[
1
]
=
0xF9
;
view
[
2
]
=
((
profile
-
1
)
<<
6
)
+
(
freqIdx
<<
2
)
+
(
chanCfg
>>
2
);
...
...
@@ -159,9 +159,12 @@ describe('AudioEncoderFuncPromise', function () {
async
function
resetWork
(
audioEncodeProcessor
)
{
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
await
audioEncodeProcessor
.
reset
().
then
(
async
()
=>
{
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
await
audioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
"
case release success
"
);
},
failCallback
).
catch
(
failCatch
);
audioEncodeProcessor
=
null
;
}
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -309,8 +312,8 @@ describe('AudioEncoderFuncPromise', function () {
},
failCallback
).
catch
(
failCatch
);
await
array
[
j
].
release
().
then
(()
=>
{
console
.
info
(
"
case release success
"
);
array
[
j
]
=
null
;
},
failCallback
).
catch
(
failCatch
);
array
[
j
]
=
null
;
}
done
();
})
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -17,9 +17,9 @@ import media from '@ohos.multimedia.media'
import
Fileio
from
'
@ohos.fileio
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
describe
(
'
AudioEncoder
STT
Callback
'
,
function
()
{
describe
(
'
AudioEncoder
Reliability
Callback
'
,
function
()
{
const
RESOURCEPATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/
'
const
AUDIOPATH
=
RESOURCEPATH
+
'
S
32
LE.pcm
'
;
const
AUDIOPATH
=
RESOURCEPATH
+
'
S
16
LE.pcm
'
;
const
BASIC_PATH
=
RESOURCEPATH
+
'
results/encode_reliability_callback_
'
;
const
END
=
0
;
const
CONFIGURE
=
1
;
...
...
@@ -54,9 +54,9 @@ describe('AudioEncoderSTTCallback', function () {
let
ES_LENGTH
=
200
;
let
mime
=
'
audio/mp4a-latm
'
;
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
};
beforeAll
(
function
()
{
...
...
@@ -86,8 +86,8 @@ describe('AudioEncoderSTTCallback', function () {
if
(
audioEncodeProcessor
!=
null
)
{
await
audioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioEncodeProcessor release success
'
);
audioEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
audioEncodeProcessor
=
null
;
}
})
...
...
@@ -165,8 +165,8 @@ describe('AudioEncoderSTTCallback', function () {
console
.
info
(
"
start add ADTS to Packet
"
);
let
packetLen
=
len
+
7
;
// 7: head length
let
profile
=
2
;
// 2: AAC LC
let
freqIdx
=
3
;
// 3: 480
00HZ
let
chanCfg
=
1
;
// 1: 1
channel
let
freqIdx
=
4
;
// 4: 441
00HZ
let
chanCfg
=
2
;
// 2: 2
channel
view
[
0
]
=
0xFF
;
view
[
1
]
=
0xF9
;
view
[
2
]
=
((
profile
-
1
)
<<
6
)
+
(
freqIdx
<<
2
)
+
(
chanCfg
>>
2
);
...
...
@@ -386,9 +386,7 @@ describe('AudioEncoderSTTCallback', function () {
}
}
else
{
writeHead
(
savepath
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
not last frame, continue
"
);
}
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -17,9 +17,9 @@ import media from '@ohos.multimedia.media'
import
Fileio
from
'
@ohos.fileio
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
describe
(
'
AudioEncoder
STT
Promise
'
,
function
()
{
describe
(
'
AudioEncoder
Reliability
Promise
'
,
function
()
{
const
RESOURCEPATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/
'
const
AUDIOPATH
=
RESOURCEPATH
+
'
S
32
LE.pcm
'
;
const
AUDIOPATH
=
RESOURCEPATH
+
'
S
16
LE.pcm
'
;
const
BASIC_PATH
=
RESOURCEPATH
+
'
results/encode_reliability_promise_
'
;
const
END
=
0
;
const
CONFIGURE
=
1
;
...
...
@@ -54,9 +54,9 @@ describe('AudioEncoderSTTPromise', function () {
let
ES_LENGTH
=
200
;
let
mime
=
'
audio/mp4a-latm
'
;
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
4
80
00
,
"
audio_sample_format
"
:
3
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
4
41
00
,
"
audio_sample_format
"
:
1
,
};
let
expectError
=
false
;
...
...
@@ -88,8 +88,8 @@ describe('AudioEncoderSTTPromise', function () {
if
(
audioEncodeProcessor
!=
null
)
{
await
audioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioEncodeProcessor release success
'
);
audioEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
audioEncodeProcessor
=
null
;
}
})
...
...
@@ -183,8 +183,8 @@ describe('AudioEncoderSTTPromise', function () {
console
.
info
(
"
start add ADTS to Packet
"
);
let
packetLen
=
len
+
7
;
// 7: head length
let
profile
=
2
;
// 2: AAC LC
let
freqIdx
=
3
;
// 3: 480
00HZ
let
chanCfg
=
1
;
// 1: 1
channel
let
freqIdx
=
4
;
// 4: 441
00HZ
let
chanCfg
=
2
;
// 2: 2
channel
view
[
0
]
=
0xFF
;
view
[
1
]
=
0xF9
;
view
[
2
]
=
((
profile
-
1
)
<<
6
)
+
(
freqIdx
<<
2
)
+
(
chanCfg
>>
2
);
...
...
@@ -391,9 +391,7 @@ describe('AudioEncoderSTTPromise', function () {
}
}
else
{
writeHead
(
savepath
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
not last frame, continue
"
);
}
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -136,10 +136,8 @@ describe('VideoDecoderEnum', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
(
)
{
async
function
enqueueInputs
(
inputObject
)
{
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -171,13 +169,9 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
){
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
){
if
(
outputObject
.
flags
==
1
)
{
nextStep
();
return
;
...
...
@@ -187,7 +181,6 @@ describe('VideoDecoderEnum', function () {
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
}
}
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
...
...
@@ -204,8 +197,7 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
in case: inputBufferAvailable inBuffer.flags:
'
+
inBuffer
.
flags
);
expect
(
inBuffer
.
timeMs
!==
undefined
).
assertTrue
();
console
.
info
(
'
in case: inputBufferAvailable inBuffer.timeMs:
'
+
inBuffer
.
timeMs
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
...
...
@@ -213,8 +205,7 @@ describe('VideoDecoderEnum', function () {
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
},
failCallback
).
catch
(
failCatch
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -177,10 +177,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
(){
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -217,19 +214,15 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
})
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
){
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
){
if
(
outputObject
.
flags
==
1
)
{
nextStep
();
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
renderOutputData
(
outputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
}
else
{
...
...
@@ -237,14 +230,12 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
})
}
}
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
...
...
@@ -253,8 +244,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
expect
(
err
).
assertUndefined
();
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
});
outputQueue
.
push
(
outBuffer
);
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -188,10 +188,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
(){
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -223,30 +220,24 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
){
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
nextStep
();
return
;
}
frameCountOut
++
;
await
videoDecodeProcessor
.
renderOutputData
(
outputObject
).
then
(()
=>
{
await
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
}
}
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
...
...
@@ -254,8 +245,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
},
failCallback
).
catch
(
failCatch
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -172,10 +172,7 @@ describe('VideoDecoderReliCallbackTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
()
{
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
position
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -201,13 +198,9 @@ describe('VideoDecoderReliCallbackTest', function () {
console
.
info
(
'
in case: queueInput success
'
);
})
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
)
{
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
if
(
workdoneAtEOS
)
{
doneWork
(
nextStep
);
...
...
@@ -215,11 +208,10 @@ describe('VideoDecoderReliCallbackTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
renderOutputData
(
outputObject
,
()
=>
{
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
,
()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
})
}
}
function
toConfigure
(
mySteps
,
done
,
expectFail
)
{
videoDecodeProcessor
.
configure
(
mediaDescription
,
(
err
)
=>
{
...
...
@@ -399,14 +391,12 @@ describe('VideoDecoderReliCallbackTest', function () {
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -177,10 +177,7 @@ describe('VideoDecoderReliPromiseTest', function () {
}
}
/* push inputbuffers into codec */
async
function
enqueueInputs
()
{
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
position
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -206,13 +203,9 @@ describe('VideoDecoderReliPromiseTest', function () {
console
.
info
(
'
in case: queueInput success
'
);
},
caseCallback
).
catch
(
failCatch
);
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
)
{
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
if
(
workdoneAtEOS
)
{
await
doneWork
();
...
...
@@ -221,12 +214,11 @@ describe('VideoDecoderReliPromiseTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
renderOutputData
(
outputObject
).
then
(()
=>
{
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
in case: release output success
'
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
caseCallback
).
catch
(
failCatch
);
}
}
function
toConfigure
(
mySteps
,
done
,
failureCallback
,
catchCallback
)
{
videoDecodeProcessor
.
configure
(
mediaDescription
).
then
(()
=>
{
...
...
@@ -396,14 +388,12 @@ describe('VideoDecoderReliPromiseTest', function () {
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -189,10 +189,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
(){
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -222,19 +219,15 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
})
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
){
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
nextStep
();
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
renderOutputData
(
outputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
}
else
{
...
...
@@ -242,20 +235,17 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
})
}
}
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -191,10 +191,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
(){
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -219,36 +216,29 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
){
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
nextStep
();
return
;
}
frameCountOut
++
;
await
videoDecodeProcessor
.
renderOutputData
(
outputObject
).
then
(()
=>
{
await
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
}
}
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -172,10 +172,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
()
{
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
position
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -201,13 +198,9 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
console
.
info
(
'
in case: queueInput success
'
);
})
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
)
{
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
if
(
workdoneAtEOS
)
{
doneWork
(
nextStep
);
...
...
@@ -215,11 +208,10 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
renderOutputData
(
outputObject
,
()
=>
{
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
,
()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
})
}
}
function
toConfigure
(
mySteps
,
done
,
expectFail
)
{
videoDecodeProcessor
.
configure
(
mediaDescription
,
(
err
)
=>
{
...
...
@@ -400,14 +392,12 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -179,10 +179,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
}
/* push inputbuffers into codec */
async
function
enqueueInputs
()
{
console
.
info
(
'
in case: enqueueInputs in
'
);
while
(
inputQueue
.
length
>
0
&&
!
inputEosFlag
)
{
let
inputObject
=
inputQueue
.
shift
();
async
function
enqueueInputs
(
inputObject
)
{
console
.
log
(
'
in case: inputObject.index:
'
+
inputObject
.
index
);
if
(
frameCountIn
<
ES_FRAME_SIZE
.
length
)
{
getContent
(
inputObject
.
data
,
position
,
ES_FRAME_SIZE
[
frameCountIn
]);
...
...
@@ -208,13 +205,9 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
console
.
info
(
'
in case: queueInput success
'
);
},
caseCallback
).
catch
(
failCatch
);
}
}
/* get outputbuffers from codec */
async
function
dequeueOutputs
(
nextStep
)
{
console
.
log
(
'
outputQueue.length:
'
+
outputQueue
.
length
);
while
(
outputQueue
.
length
>
0
){
let
outputObject
=
outputQueue
.
shift
();
async
function
dequeueOutputs
(
nextStep
,
outputObject
)
{
if
(
outputObject
.
flags
==
1
)
{
if
(
workdoneAtEOS
)
{
await
doneWork
();
...
...
@@ -223,12 +216,11 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
renderOutputData
(
outputObject
).
then
(()
=>
{
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
in case: release output success
'
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
caseCallback
).
catch
(
failCatch
);
}
}
function
toConfigure
(
mySteps
,
done
,
failureCallback
,
catchCallback
)
{
videoDecodeProcessor
.
configure
(
mediaDescription
).
then
(()
=>
{
...
...
@@ -399,14 +391,12 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
enqueueInputs
(
inBuffer
);
});
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
,
outBuffer
);
});
videoDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
...
...
multimedia/media/media_js_standard/videoEncoder/Test.json
浏览文件 @
dbcb7b17
{
"description"
:
"Configuration for video
Play
er Tests"
,
"description"
:
"Configuration for video
Encod
er Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -56,12 +56,6 @@ describe('videoEncoderSoftwareMultiInstances', function () {
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
videoEncodeProcessor
!=
null
){
await
videoEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
"
case release success
"
);
videoEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
}
})
afterAll
(
function
()
{
...
...
@@ -255,8 +249,8 @@ describe('videoEncoderSoftwareMultiInstances', function () {
async
function
toRelease
()
{
await
videoEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
"
case release success
"
);
videoEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
videoEncodeProcessor
=
null
;
}
...
...
@@ -287,10 +281,10 @@ describe('videoEncoderSoftwareMultiInstances', function () {
for
(
let
j
=
1
;
j
<
3
;
j
++
)
{
await
array
[
j
].
release
().
then
(()
=>
{
console
.
info
(
"
case release encoder
"
+
j
);
array
[
j
]
=
null
;
},
failCallback
).
catch
(
failCatch
);
array
[
j
]
=
null
;
}
console
.
info
(
'
release
16
encoders success
'
);
console
.
info
(
'
release encoders success
'
);
done
();
});
async
function
runCase
()
{
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -38,8 +38,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
beforeEach
(
async
function
()
{
console
.
info
(
'
beforeEach case
'
);
await
msleep
(
1000
).
then
(()
=>
{
},
failCallback
).
catch
(
failCatch
);
videoEncodeProcessor
=
null
;
mediaTest
=
null
;
surfaceID
=
''
;
...
...
@@ -74,6 +76,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
expect
(
err
==
undefined
).
assertTrue
();
}
function
msleep
(
ms
)
{
return
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
ms
));
}
function
writeFile
(
path
,
buf
,
len
){
try
{
let
writestream
=
Fileio
.
createStreamSync
(
path
,
'
ab+
'
);
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -37,8 +37,10 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
beforeEach
(
async
function
()
{
console
.
info
(
'
beforeEach case
'
);
await
msleep
(
1000
).
then
(()
=>
{
},
failCallback
).
catch
(
failCatch
);
videoEncodeProcessor
=
null
;
mediaTest
=
null
;
surfaceID
=
''
;
...
...
@@ -76,6 +78,10 @@ describe('videoSoftwareEncoderFuncPromise', function () {
expect
(
err
).
assertUndefined
();
}
function
msleep
(
ms
)
{
return
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
ms
));
}
function
resetParam
()
{
outputQueue
=
[];
outputCnt
=
0
;
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -64,6 +64,8 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
beforeEach
(
async
function
()
{
console
.
info
(
'
beforeEach case
'
);
await
msleep
(
1000
).
then
(()
=>
{
},
failCallback
).
catch
(
failCatch
);
videoEncodeProcessor
=
null
;
mediaTest
=
null
;
surfaceID
=
''
;
...
...
@@ -98,6 +100,11 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
console
.
error
(
`in case error failCatch called,errMessage is
${
err
.
message
}
`
);
expect
(
err
==
undefined
).
assertTrue
();
}
function
msleep
(
ms
)
{
return
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
ms
));
}
function
printError
(
err
,
expectFail
)
{
expect
((
err
!=
undefined
)
==
expectFail
).
assertTrue
();
if
(
expectFail
==
false
&&
err
!=
undefined
)
{
...
...
@@ -105,6 +112,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
console
.
error
(
`in case error failCatch called,errMessage is
${
err
.
message
}
`
);
}
}
function
writeFile
(
path
,
buf
,
len
){
try
{
let
writestream
=
Fileio
.
createStreamSync
(
path
,
'
ab+
'
);
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
浏览文件 @
dbcb7b17
...
...
@@ -65,8 +65,10 @@ describe('videoEncoderReliabilityPromise', function () {
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
beforeEach
(
async
function
()
{
console
.
info
(
'
beforeEach case
'
);
await
msleep
(
1000
).
then
(()
=>
{
},
failCallback
).
catch
(
failCatch
);
videoEncodeProcessor
=
null
;
surfaceID
=
''
;
outputQueue
=
[];
...
...
@@ -86,8 +88,8 @@ describe('videoEncoderReliabilityPromise', function () {
if
(
videoEncodeProcessor
!=
null
)
{
await
videoEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
`case release 1`
);
videoEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
videoEncodeProcessor
=
null
;
}
})
...
...
@@ -111,6 +113,10 @@ describe('videoEncoderReliabilityPromise', function () {
expect
(
err
).
assertUndefined
();
}
function
msleep
(
ms
)
{
return
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
ms
));
}
function
resetParam
()
{
outputQueue
=
[];
outputCnt
=
0
;
...
...
@@ -1353,7 +1359,7 @@ describe('videoEncoderReliabilityPromise', function () {
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
eos_0500.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
GETSURFACE
,
SETSTREAMPARAM
,
PREPARE
,
START
,
STARTSTREAM
,
HOLDON
,
JUDGE_EOS
,
STOP
,
START
,
STOP
,
STOPSTREAM
,
END
);
JUDGE_EOS
,
STOP
,
START
,
STOP
,
STOPSTREAM
,
RELEASE
,
END
);
frameTotal
=
2
;
createVideoEncoder
(
savepath
,
mySteps
,
done
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录