Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4c4c8914
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看板
未验证
提交
4c4c8914
编写于
2月 15, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1892 modify flush
Merge pull request !1892 from ling990/ling990
上级
9b659447
877531a3
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
121 addition
and
43 deletion
+121
-43
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
...r/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
+6
-5
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
...er/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
+5
-3
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
+15
-5
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
+14
-3
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
+10
-1
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
.../main/js/test/AudioDecoderReliabilityCallbackTest.test.js
+10
-5
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
+8
-2
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
+14
-7
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
+12
-3
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
+9
-2
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
.../main/js/test/AudioEncoderReliabilityCallbackTest.test.js
+10
-5
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
+8
-2
未找到文件。
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -60,14 +60,13 @@ describe('AudioDecoderFormatCallback', function () {
isVorbis
=
false
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioDecodeProcessor
!=
null
)
{
audioDecodeProcessor
.
release
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case release success
"
);
await
audioDecodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioDecodeProcessor release success
'
);
audioDecodeProcessor
=
null
;
}
)
}
,
failCallback
).
catch
(
failCatch
);
}
})
...
...
@@ -148,6 +147,8 @@ describe('AudioDecoderFormatCallback', function () {
audioDecodeProcessor
.
stop
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
stop success
"
);
inputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
reset success
"
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -60,10 +60,10 @@ describe('AudioDecoderFormatPromise', function () {
isVorbis
=
false
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioDecodeProcessor
!=
null
){
audioDecodeProcessor
.
release
().
then
(()
=>
{
if
(
audioDecodeProcessor
!=
null
)
{
a
wait
a
udioDecodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioDecodeProcessor release success
'
);
audioDecodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -157,6 +157,8 @@ describe('AudioDecoderFormatPromise', function () {
await
audioDecodeProcessor
.
stop
().
then
(()
=>
{
console
.
log
(
"
stop success
"
);
},
failCallback
).
catch
(
failCatch
);
inputQueue
=
[];
outputQueue
=
[];
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
log
(
"
reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -246,11 +246,10 @@ describe('AudioDecoderFunc', function () {
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioDecodeProcessor
!=
null
)
{
audioDecodeProcessor
.
release
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case release success
"
);
await
audioDecodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioDecodeProcessor release success
'
);
audioDecodeProcessor
=
null
;
}
)
}
,
failCallback
).
catch
(
failCatch
);
}
})
...
...
@@ -272,6 +271,8 @@ describe('AudioDecoderFunc', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
writeFile
(
path
,
buf
,
len
){
...
...
@@ -310,6 +311,7 @@ describe('AudioDecoderFunc', function () {
}
async
function
resetWork
()
{
resetParam
();
audioDecodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case reset success
"
);
...
...
@@ -324,6 +326,8 @@ describe('AudioDecoderFunc', function () {
}
async
function
flushWork
()
{
inputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case flush at inputeos success
"
);
...
...
@@ -337,6 +341,7 @@ describe('AudioDecoderFunc', function () {
audioDecodeProcessor
.
stop
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case stop success
"
);
resetParam
();
audioDecodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case reset success
"
);
...
...
@@ -397,7 +402,9 @@ describe('AudioDecoderFunc', function () {
await
flushWork
();
}
else
if
(
workdoneAtEOS
)
{
await
doneWork
(
done
);
}
else
{}
}
else
{
console
.
info
(
"
saw output EOS
"
);
}
}
else
{
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
...
...
@@ -640,6 +647,8 @@ describe('AudioDecoderFunc', function () {
})
});
eventEmitter
.
on
(
'
flush
'
,
()
=>
{
inputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case flush after 2s`
);
...
...
@@ -771,6 +780,7 @@ describe('AudioDecoderFunc', function () {
})
});
eventEmitter
.
on
(
'
reset
'
,
()
=>
{
resetParam
();
audioDecodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case reset 1`
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -243,10 +243,10 @@ describe('AudioDecoderFunc', function () {
ES_LENGTH
=
1500
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioDecodeProcessor
!=
null
)
{
audioDecodeProcessor
.
release
().
then
(()
=>
{
a
wait
a
udioDecodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioDecodeProcessor release success
'
);
audioDecodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -281,6 +281,8 @@ describe('AudioDecoderFunc', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
writeFile
(
path
,
buf
,
len
)
{
...
...
@@ -317,6 +319,7 @@ describe('AudioDecoderFunc', function () {
}
async
function
resetWork
()
{
resetParam
();
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
...
...
@@ -326,6 +329,8 @@ describe('AudioDecoderFunc', function () {
}
async
function
flushWork
()
{
inputQueue
=
[];
outputQueue
=
[];
await
audioDecodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
...
...
@@ -338,6 +343,7 @@ describe('AudioDecoderFunc', function () {
await
audioDecodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop success
"
);
},
failCallback
).
catch
(
failCatch
);
resetParam
();
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -394,7 +400,9 @@ describe('AudioDecoderFunc', function () {
}
else
if
(
workdoneAtEOS
)
{
await
doneWork
();
done
();
}
else
{}
}
else
{
console
.
info
(
"
saw output EOS
"
);
}
}
else
{
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
...
...
@@ -568,6 +576,8 @@ describe('AudioDecoderFunc', function () {
console
.
info
(
"
case start success
"
);
},
failCallback
).
catch
(
failCatch
);
await
sleep
(
3000
).
then
(()
=>
{
inputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush after 5s
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -652,6 +662,7 @@ describe('AudioDecoderFunc', function () {
audioDecodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop after 5s success
"
);
},
failCallback
).
catch
(
failCatch
);});
resetParam
();
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -78,6 +78,8 @@ describe('AudioDecoderMultiInstances', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
writeFile
(
path
,
buf
,
len
)
{
...
...
@@ -114,6 +116,7 @@ describe('AudioDecoderMultiInstances', function () {
}
async
function
resetWork
(
audioDecodeProcessor
)
{
resetParam
();
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
...
...
@@ -123,6 +126,8 @@ describe('AudioDecoderMultiInstances', function () {
}
async
function
flushWork
(
audioDecodeProcessor
)
{
inputQueue
=
[];
outputQueue
=
[];
await
audioDecodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
...
...
@@ -135,6 +140,7 @@ describe('AudioDecoderMultiInstances', function () {
await
audioDecodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop success
"
);
},
failCallback
).
catch
(
failCatch
);
resetParam
();
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -188,7 +194,9 @@ describe('AudioDecoderMultiInstances', function () {
}
else
if
(
workdoneAtEOS
)
{
await
doneWork
(
audioDecodeProcessor
);
done
();
}
else
{}
}
else
{
console
.
info
(
"
saw output EOS
"
);
}
}
else
{
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
...
...
@@ -251,6 +259,7 @@ describe('AudioDecoderMultiInstances', function () {
console
.
info
(
'
case has created 16 decoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset decoder
"
+
j
);
},
failCallback
).
catch
(
failCatch
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -257,14 +257,13 @@ describe('AudioDecoderReliabilityCallback', function () {
ES_LENGTH
=
500
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioDecodeProcessor
!=
null
)
{
audioDecodeProcessor
.
release
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case release success
"
);
await
audioDecodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioDecodeProcessor release success
'
);
audioDecodeProcessor
=
null
;
}
)
}
,
failCallback
).
catch
(
failCatch
);
}
})
...
...
@@ -283,6 +282,8 @@ describe('AudioDecoderReliabilityCallback', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
createAudioDecoder
(
savepath
,
mySteps
,
done
)
{
...
...
@@ -328,6 +329,7 @@ describe('AudioDecoderReliabilityCallback', function () {
audioDecodeProcessor
.
stop
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case stop success
"
);
resetParam
();
audioDecodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case reset success
"
);
...
...
@@ -398,6 +400,8 @@ describe('AudioDecoderReliabilityCallback', function () {
case
FLUSH
:
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
inputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case flush 1`
);
...
...
@@ -422,6 +426,7 @@ describe('AudioDecoderReliabilityCallback', function () {
case
RESET
:
mySteps
.
shift
();
console
.
info
(
`case to reset`
);
resetParam
();
audioDecodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case reset 1`
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -261,10 +261,10 @@ describe('AudioDecoderReliabilityPromise', function () {
expectError
=
false
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioDecodeProcessor
!=
null
)
{
audioDecodeProcessor
.
release
().
then
(()
=>
{
a
wait
a
udioDecodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioDecodeProcessor release success
'
);
audioDecodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -303,6 +303,8 @@ describe('AudioDecoderReliabilityPromise', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
createAudioDecoder
(
savepath
,
mySteps
,
done
)
{
...
...
@@ -348,6 +350,7 @@ describe('AudioDecoderReliabilityPromise', function () {
await
audioDecodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop success
"
);
},
failCallback
).
catch
(
failCatch
);
resetParam
();
await
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -409,6 +412,8 @@ describe('AudioDecoderReliabilityPromise', function () {
case
FLUSH
:
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
inputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
`case flush 1`
);
if
(
flushAtEOS
)
{
...
...
@@ -431,6 +436,7 @@ describe('AudioDecoderReliabilityPromise', function () {
case
RESET
:
mySteps
.
shift
();
console
.
info
(
`case to reset`
);
resetParam
();
audioDecodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
`case reset 1`
);
nextStep
(
mySteps
,
done
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -63,14 +63,13 @@ describe('AudioEncoderFuncCallback', function () {
ES_LENGTH
=
2000
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioEncodeProcessor
!=
null
)
{
audioEncodeProcessor
.
release
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case release success
"
);
await
audioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioEncodeProcessor release success
'
);
audioEncodeProcessor
=
null
;
}
)
}
,
failCallback
).
catch
(
failCatch
);
}
})
...
...
@@ -91,6 +90,8 @@ describe('AudioEncoderFuncCallback', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
writeHead
(
path
,
len
)
{
...
...
@@ -156,6 +157,7 @@ describe('AudioEncoderFuncCallback', function () {
}
async
function
resetWork
()
{
resetParam
();
audioEncodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case reset success
"
);
...
...
@@ -166,6 +168,8 @@ describe('AudioEncoderFuncCallback', function () {
}
async
function
flushWork
()
{
inputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case flush at inputeos success
"
);
...
...
@@ -179,6 +183,7 @@ describe('AudioEncoderFuncCallback', function () {
audioEncodeProcessor
.
stop
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case stop success
"
);
resetParam
();
audioEncodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
audioEncodeProcessor
.
release
((
err
)
=>
{
...
...
@@ -290,7 +295,6 @@ describe('AudioEncoderFuncCallback', function () {
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_00_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
test set EOS after last frame and reset
"
);
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
mediaDescription
=
{
...
...
@@ -356,7 +360,7 @@ describe('AudioEncoderFuncCallback', function () {
}
})
})
media
.
createAudioEncoderByName
(
'
av
de
c_aac
'
,
(
err
,
processor
)
=>
{
media
.
createAudioEncoderByName
(
'
av
en
c_aac
'
,
(
err
,
processor
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case createAudioEncoder by mime 1`
);
audioEncodeProcessor
=
processor
;
...
...
@@ -473,6 +477,8 @@ describe('AudioEncoderFuncCallback', function () {
})
});
eventEmitter
.
on
(
'
flush
'
,
()
=>
{
inputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case flush after 5s`
);
...
...
@@ -603,6 +609,7 @@ describe('AudioEncoderFuncCallback', function () {
})
});
eventEmitter
.
on
(
'
reset
'
,
()
=>
{
resetParam
();
audioEncodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case reset 1`
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -63,10 +63,10 @@ describe('AudioEncoderFuncPromise', function () {
ES_LENGTH
=
2000
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioEncodeProcessor
!=
null
)
{
audioEncodeProcessor
.
release
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioEncodeProcessor release success
'
);
audioEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -100,6 +100,8 @@ describe('AudioEncoderFuncPromise', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
writeHead
(
path
,
len
)
{
...
...
@@ -165,6 +167,7 @@ describe('AudioEncoderFuncPromise', function () {
}
async
function
resetWork
()
{
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
...
...
@@ -174,6 +177,8 @@ describe('AudioEncoderFuncPromise', function () {
}
async
function
flushWork
()
{
inputQueue
=
[];
outputQueue
=
[];
await
audioEncodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
...
...
@@ -186,6 +191,7 @@ describe('AudioEncoderFuncPromise', function () {
await
audioEncodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop success
"
);
},
failCallback
).
catch
(
failCatch
);
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -427,6 +433,8 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
"
case start success
"
)
},
failCallback
).
catch
(
failCatch
);
await
sleep
(
5000
).
then
(()
=>
{
inputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush after 5s
"
)
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -511,6 +519,7 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
stop after 5s success
"
);
},
failCallback
).
catch
(
failCatch
);});
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -627,7 +636,7 @@ describe('AudioEncoderFuncPromise', function () {
},
failCallback
).
catch
(
failCatch
);
let
savepath2
=
BASIC_PATH
+
'
0601.txt
'
;
workdoneAtEOS
=
true
;
setCallback
(
audioEncodeProcessor
,
savepath2
,
done
);
setCallback
(
savepath2
,
done
);
await
audioEncodeProcessor
.
prepare
().
then
(()
=>
{
console
.
info
(
"
prepare2 success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -92,6 +92,8 @@ describe('AudioEncoderFuncPromise', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
writeHead
(
path
,
len
)
{
...
...
@@ -157,6 +159,7 @@ describe('AudioEncoderFuncPromise', function () {
}
async
function
resetWork
(
audioEncodeProcessor
)
{
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
if
(
needrelease
)
{
...
...
@@ -166,6 +169,8 @@ describe('AudioEncoderFuncPromise', function () {
}
async
function
flushWork
(
audioEncodeProcessor
)
{
inputQueue
=
[];
outputQueue
=
[];
await
audioEncodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
...
...
@@ -178,6 +183,7 @@ describe('AudioEncoderFuncPromise', function () {
await
audioEncodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop success
"
);
},
failCallback
).
catch
(
failCatch
);
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -276,14 +282,14 @@ describe('AudioEncoderFuncPromise', function () {
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_
PROMISE_
0100
* @tc.number : SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
* @tc.name : 001.create 16 encoder
* @tc.desc : basic encode function
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_
PROMISE_
0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple encoder instances
"
);
let
array
=
new
Array
();
for
(
let
i
=
0
;
i
<
16
;
i
+=
1
)
{
...
...
@@ -299,6 +305,7 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
'
case has created 16 encoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset encoder
"
+
j
);
},
failCallback
).
catch
(
failCatch
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -80,14 +80,13 @@ describe('AudioEncoderSTTCallback', function () {
ES_LENGTH
=
200
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioEncodeProcessor
!=
null
)
{
audioEncodeProcessor
.
release
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case release success
"
);
await
audioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioEncodeProcessor release success
'
);
audioEncodeProcessor
=
null
;
}
)
}
,
failCallback
).
catch
(
failCatch
);
}
})
...
...
@@ -106,6 +105,8 @@ describe('AudioEncoderSTTCallback', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
createAudioEncoder
(
savepath
,
mySteps
,
done
)
{
...
...
@@ -178,6 +179,7 @@ describe('AudioEncoderSTTCallback', function () {
audioEncodeProcessor
.
stop
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case stop success
"
);
resetParam
();
audioEncodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
log
(
"
case reset success
"
);
...
...
@@ -247,6 +249,8 @@ describe('AudioEncoderSTTCallback', function () {
case
FLUSH
:
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
inputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case flush 1`
);
...
...
@@ -271,6 +275,7 @@ describe('AudioEncoderSTTCallback', function () {
case
RESET
:
mySteps
.
shift
();
console
.
info
(
`case to reset`
);
resetParam
();
audioEncodeProcessor
.
reset
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case reset 1`
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
浏览文件 @
4c4c8914
...
...
@@ -82,10 +82,10 @@ describe('AudioEncoderSTTPromise', function () {
expectError
=
false
;
})
afterEach
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
if
(
audioEncodeProcessor
!=
null
)
{
audioEncodeProcessor
.
release
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
'
audioEncodeProcessor release success
'
);
audioEncodeProcessor
=
null
;
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -123,6 +123,8 @@ describe('AudioEncoderSTTPromise', function () {
timestamp
=
0
;
sawInputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
outputQueue
=
[];
}
function
createAudioEncoder
(
savepath
,
mySteps
,
done
)
{
...
...
@@ -195,6 +197,7 @@ describe('AudioEncoderSTTPromise', function () {
await
audioEncodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
"
case stop success
"
);
},
failCallback
).
catch
(
failCatch
);
resetParam
();
await
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
"
case reset success
"
);
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -257,6 +260,8 @@ describe('AudioEncoderSTTPromise', function () {
case
FLUSH
:
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
inputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
`case flush 1`
);
if
(
flushAtEOS
)
{
...
...
@@ -279,6 +284,7 @@ describe('AudioEncoderSTTPromise', function () {
case
RESET
:
mySteps
.
shift
();
console
.
info
(
`case to reset`
);
resetParam
();
audioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
`case reset 1`
);
nextStep
(
mySteps
,
done
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录