Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b74987b5
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看板
未验证
提交
b74987b5
编写于
8月 04, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4770 修改编解码用例匹配codec状态机修改
Merge pull request !4770 from ling990/ling990
上级
e2bbb397
06f52d87
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
287 addition
and
173 deletion
+287
-173
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
+27
-8
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
+28
-9
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
.../main/js/test/AudioDecoderReliabilityCallbackTest.test.js
+19
-10
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
+19
-10
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
+26
-7
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
+27
-10
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
.../main/js/test/AudioEncoderReliabilityCallbackTest.test.js
+8
-3
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
+21
-16
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js
...ia_js_standard/videoDecoder/src/main/js/test/List.test.js
+0
-2
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
...der/src/main/js/test/VideoDecoderReliCallbackTest.test.js
+7
-3
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
+100
-93
multimedia/media/media_js_standard/videoEncoder/Test.json
multimedia/media/media_js_standard/videoEncoder/Test.json
+0
-2
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncPromiseTest.test.js
.../main/js/test/VideoEncoderHardwareFuncPromiseTest.test.js
+5
-0
未找到文件。
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
浏览文件 @
b74987b5
...
@@ -139,6 +139,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -139,6 +139,7 @@ describe('AudioDecoderFuncCallback', function () {
let
outputCnt
=
0
;
let
outputCnt
=
0
;
let
inputCnt
=
0
;
let
inputCnt
=
0
;
let
frameThreshold
=
10
;
let
frameThreshold
=
10
;
let
lockFlag
=
false
;
beforeAll
(
async
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case 1
'
);
console
.
info
(
'
beforeAll case 1
'
);
...
@@ -254,6 +255,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -254,6 +255,7 @@ describe('AudioDecoderFuncCallback', function () {
ES_LENGTH
=
1500
;
ES_LENGTH
=
1500
;
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -288,6 +290,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -288,6 +290,7 @@ describe('AudioDecoderFuncCallback', function () {
outputQueue
=
[];
outputQueue
=
[];
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
}
}
async
function
getFdRead
(
readPath
,
done
)
{
async
function
getFdRead
(
readPath
,
done
)
{
...
@@ -345,6 +348,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -345,6 +348,7 @@ describe('AudioDecoderFuncCallback', function () {
}
}
async
function
flushWork
(
done
)
{
async
function
flushWork
(
done
)
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
await
getFdRead
(
readpath
,
done
);
await
getFdRead
(
readpath
,
done
);
...
@@ -353,6 +357,11 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -353,6 +357,11 @@ describe('AudioDecoderFuncCallback', function () {
console
.
info
(
"
case flush at inputeos success
"
);
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
resetParam
();
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
lockFlag
=
false
;
audioDecodeProcessor
.
start
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case start after flush success
"
);
});
})
})
}
}
...
@@ -403,10 +412,12 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -403,10 +412,12 @@ describe('AudioDecoderFuncCallback', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
queueInput success
'
);
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
inputCnt
+=
1
;
console
.
info
(
'
queueInput success
'
);
})
inputCnt
+=
1
;
})
}
}
}
}
}
...
@@ -431,9 +442,11 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -431,9 +442,11 @@ describe('AudioDecoderFuncCallback', function () {
else
{
else
{
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
release output success
'
);
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
})
console
.
info
(
'
release output success
'
);
})
}
}
}
}
}
...
@@ -677,12 +690,18 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -677,12 +690,18 @@ describe('AudioDecoderFuncCallback', function () {
})
})
});
});
eventEmitter
.
on
(
'
flush
'
,
()
=>
{
eventEmitter
.
on
(
'
flush
'
,
()
=>
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
((
err
)
=>
{
audioDecodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
expect
(
err
).
assertUndefined
();
console
.
info
(
`case flush after 2s success`
);
console
.
info
(
`case flush after 2s success`
);
})
lockFlag
=
false
;
audioDecodeProcessor
.
start
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case start after flush success`
);
});
});
});
});
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
,
(
err
,
processor
)
=>
{
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
,
(
err
,
processor
)
=>
{
expect
(
err
).
assertUndefined
();
expect
(
err
).
assertUndefined
();
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
浏览文件 @
b74987b5
...
@@ -138,6 +138,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -138,6 +138,7 @@ describe('AudioDecoderFuncPromise', function () {
let
outputCnt
=
0
;
let
outputCnt
=
0
;
let
inputCnt
=
0
;
let
inputCnt
=
0
;
let
frameThreshold
=
10
;
let
frameThreshold
=
10
;
let
lockFlag
=
false
;
beforeAll
(
async
function
()
{
beforeAll
(
async
function
()
{
...
@@ -254,6 +255,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -254,6 +255,7 @@ describe('AudioDecoderFuncPromise', function () {
ES_LENGTH
=
1500
;
ES_LENGTH
=
1500
;
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -298,6 +300,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -298,6 +300,7 @@ describe('AudioDecoderFuncPromise', function () {
outputQueue
=
[];
outputQueue
=
[];
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
}
}
async
function
getFdRead
(
readPath
,
done
)
{
async
function
getFdRead
(
readPath
,
done
)
{
...
@@ -349,6 +352,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -349,6 +352,7 @@ describe('AudioDecoderFuncPromise', function () {
}
}
async
function
flushWork
(
done
)
{
async
function
flushWork
(
done
)
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
await
getFdRead
(
readpath
,
done
);
await
getFdRead
(
readpath
,
done
);
...
@@ -357,6 +361,12 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -357,6 +361,12 @@ describe('AudioDecoderFuncPromise', function () {
resetParam
();
resetParam
();
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
lockFlag
=
false
;
await
audioDecodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
"
case start after flush success
"
);
resetParam
();
workdoneAtEOS
=
true
;
},
failCallback
).
catch
(
failCatch
);
}
}
async
function
doneWork
()
{
async
function
doneWork
()
{
...
@@ -399,10 +409,12 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -399,10 +409,12 @@ describe('AudioDecoderFuncPromise', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
case queueInput success
'
);
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
inputCnt
+=
1
;
console
.
info
(
'
case queueInput success
'
);
});
inputCnt
+=
1
;
});
}
}
}
}
}
...
@@ -430,9 +442,11 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -430,9 +442,11 @@ describe('AudioDecoderFuncPromise', function () {
else
{
else
{
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
release output success
'
);
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
});
console
.
info
(
'
release output success
'
);
});
}
}
}
}
}
...
@@ -605,12 +619,17 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -605,12 +619,17 @@ describe('AudioDecoderFuncPromise', function () {
await
audioDecodeProcessor
.
start
().
then
(()
=>
{
await
audioDecodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
"
case start success
"
);
console
.
info
(
"
case start success
"
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
await
sleep
(
500
).
then
(()
=>
{
await
sleep
(
500
).
then
(
async
()
=>
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
().
then
(()
=>
{
a
wait
a
udioDecodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush after 5s
"
);
console
.
info
(
"
case flush after 5s
"
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
lockFlag
=
false
;
await
audioDecodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
"
case start after flush success
"
);
},
failCallback
).
catch
(
failCatch
);
})
})
})
})
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
浏览文件 @
b74987b5
...
@@ -147,6 +147,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -147,6 +147,7 @@ describe('AudioDecoderReliabilityCallback', function () {
"
audio_sample_format
"
:
1
,
"
audio_sample_format
"
:
1
,
};
};
let
fdRead
;
let
fdRead
;
let
lockFlag
=
false
;
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
...
@@ -257,6 +258,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -257,6 +258,7 @@ describe('AudioDecoderReliabilityCallback', function () {
381
,
410
,
394
,
386
,
345
,
345
,
354
,
397
,
386
,
375
,
390
,
347
,
411
,
381
,
383
,
374
,
379
,
381
,
410
,
394
,
386
,
345
,
345
,
354
,
397
,
386
,
375
,
390
,
347
,
411
,
381
,
383
,
374
,
379
,
380
,
378
,
391
,
380
,
339
,
390
,
383
,
375
];
380
,
378
,
391
,
380
,
339
,
390
,
383
,
375
];
ES_LENGTH
=
500
;
ES_LENGTH
=
500
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -287,6 +289,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -287,6 +289,7 @@ describe('AudioDecoderReliabilityCallback', function () {
sawOutputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
lockFlag
=
false
;
}
}
async
function
createAudioDecoder
(
savepath
,
mySteps
,
done
)
{
async
function
createAudioDecoder
(
savepath
,
mySteps
,
done
)
{
...
@@ -399,6 +402,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -399,6 +402,7 @@ describe('AudioDecoderReliabilityCallback', function () {
case
FLUSH
:
case
FLUSH
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
console
.
info
(
`case to flush`
);
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
(
async
(
err
)
=>
{
audioDecodeProcessor
.
flush
(
async
(
err
)
=>
{
...
@@ -410,6 +414,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -410,6 +414,7 @@ describe('AudioDecoderReliabilityCallback', function () {
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
flushAtEOS
=
false
;
flushAtEOS
=
false
;
}
}
lockFlag
=
false
;
nextStep
(
mySteps
,
mediaDescription
,
done
);
nextStep
(
mySteps
,
mediaDescription
,
done
);
});
});
break
;
break
;
...
@@ -518,9 +523,11 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -518,9 +523,11 @@ describe('AudioDecoderReliabilityCallback', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
queueInput success
'
);
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
})
console
.
info
(
'
queueInput success
'
);
})
}
}
}
}
}
...
@@ -538,9 +545,11 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -538,9 +545,11 @@ describe('AudioDecoderReliabilityCallback', function () {
else
{
else
{
console
.
info
(
"
not last frame, continue
"
);
console
.
info
(
"
not last frame, continue
"
);
}
}
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
release output success
'
);
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
})
console
.
info
(
'
release output success
'
);
})
}
}
}
}
}
...
@@ -879,7 +888,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -879,7 +888,7 @@ describe('AudioDecoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
start_0500.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
start_0500.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
_ERROR
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
END
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -979,7 +988,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -979,7 +988,7 @@ describe('AudioDecoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0400.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0400.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -994,7 +1003,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -994,7 +1003,7 @@ describe('AudioDecoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0500.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0500.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -1023,7 +1032,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -1023,7 +1032,7 @@ describe('AudioDecoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0700
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0700.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0700.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
HOLDON
,
FLUSH
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
HOLDON
,
FLUSH
,
START
,
END
);
EOSFrameNum
=
2
;
EOSFrameNum
=
2
;
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
浏览文件 @
b74987b5
...
@@ -149,6 +149,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -149,6 +149,7 @@ describe('AudioDecoderReliabilityPromise', function () {
};
};
let
expectError
=
false
;
let
expectError
=
false
;
let
fdRead
;
let
fdRead
;
let
lockFlag
=
false
;
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
...
@@ -261,6 +262,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -261,6 +262,7 @@ describe('AudioDecoderReliabilityPromise', function () {
380
,
378
,
391
,
380
,
339
,
390
,
383
,
375
];
380
,
378
,
391
,
380
,
339
,
390
,
383
,
375
];
ES_LENGTH
=
500
;
ES_LENGTH
=
500
;
expectError
=
false
;
expectError
=
false
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -308,6 +310,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -308,6 +310,7 @@ describe('AudioDecoderReliabilityPromise', function () {
sawOutputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
lockFlag
=
false
;
}
}
async
function
createAudioDecoder
(
savepath
,
mySteps
,
done
)
{
async
function
createAudioDecoder
(
savepath
,
mySteps
,
done
)
{
...
@@ -416,6 +419,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -416,6 +419,7 @@ describe('AudioDecoderReliabilityPromise', function () {
case
FLUSH
:
case
FLUSH
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
console
.
info
(
`case to flush`
);
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioDecodeProcessor
.
flush
().
then
(
async
()
=>
{
audioDecodeProcessor
.
flush
().
then
(
async
()
=>
{
...
@@ -426,6 +430,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -426,6 +430,7 @@ describe('AudioDecoderReliabilityPromise', function () {
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
flushAtEOS
=
false
;
flushAtEOS
=
false
;
}
}
lockFlag
=
false
;
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
break
;
break
;
...
@@ -525,9 +530,11 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -525,9 +530,11 @@ describe('AudioDecoderReliabilityPromise', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
case queueInput success
'
);
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
});
console
.
info
(
'
case queueInput success
'
);
});
}
}
}
}
}
...
@@ -546,9 +553,11 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -546,9 +553,11 @@ describe('AudioDecoderReliabilityPromise', function () {
else
{
else
{
console
.
info
(
"
not last frame, continue
"
);
console
.
info
(
"
not last frame, continue
"
);
}
}
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
release output success
'
);
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
});
console
.
info
(
'
release output success
'
);
});
}
}
}
}
}
...
@@ -885,7 +894,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -885,7 +894,7 @@ describe('AudioDecoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_START_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_START_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
start_0500.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
start_0500.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
_ERROR
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
END
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -985,7 +994,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -985,7 +994,7 @@ describe('AudioDecoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0400.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0400.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -1000,7 +1009,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -1000,7 +1009,7 @@ describe('AudioDecoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0500.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0500.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -1029,7 +1038,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -1029,7 +1038,7 @@ describe('AudioDecoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0700.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0700.pcm
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
HOLDON
,
FLUSH
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
HOLDON
,
FLUSH
,
START
,
END
);
EOSFrameNum
=
2
;
EOSFrameNum
=
2
;
createAudioDecoder
(
savepath
,
mySteps
,
done
);
createAudioDecoder
(
savepath
,
mySteps
,
done
);
})
})
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
浏览文件 @
b74987b5
...
@@ -47,6 +47,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -47,6 +47,7 @@ describe('AudioEncoderFuncCallback', function () {
let
outputCnt
=
0
;
let
outputCnt
=
0
;
let
inputCnt
=
0
;
let
inputCnt
=
0
;
let
frameThreshold
=
10
;
let
frameThreshold
=
10
;
let
lockFlag
=
false
;
beforeAll
(
async
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case 1
'
);
console
.
info
(
'
beforeAll case 1
'
);
...
@@ -72,6 +73,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -72,6 +73,7 @@ describe('AudioEncoderFuncCallback', function () {
ES_LENGTH
=
1500
;
ES_LENGTH
=
1500
;
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -105,6 +107,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -105,6 +107,7 @@ describe('AudioEncoderFuncCallback', function () {
outputQueue
=
[];
outputQueue
=
[];
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
}
}
async
function
getFdRead
(
readPath
,
done
)
{
async
function
getFdRead
(
readPath
,
done
)
{
...
@@ -162,6 +165,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -162,6 +165,7 @@ describe('AudioEncoderFuncCallback', function () {
}
}
async
function
flushWork
(
done
)
{
async
function
flushWork
(
done
)
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
await
getFdRead
(
readpath
,
done
);
await
getFdRead
(
readpath
,
done
);
...
@@ -170,6 +174,11 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -170,6 +174,11 @@ describe('AudioEncoderFuncCallback', function () {
console
.
info
(
"
case flush at inputeos success
"
);
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
resetParam
();
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
lockFlag
=
false
;
audioEncodeProcessor
.
start
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
"
case start after flush success
"
);
})
})
})
}
}
...
@@ -218,10 +227,12 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -218,10 +227,12 @@ describe('AudioEncoderFuncCallback', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
queueInput success
'
);
audioEncodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
inputCnt
+=
1
;
console
.
info
(
'
queueInput success
'
);
})
inputCnt
+=
1
;
})
}
}
}
}
}
...
@@ -246,9 +257,11 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -246,9 +257,11 @@ describe('AudioEncoderFuncCallback', function () {
else
{
else
{
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
release output success
'
);
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
})
console
.
info
(
'
release output success
'
);
})
}
}
}
}
}
...
@@ -481,11 +494,17 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -481,11 +494,17 @@ describe('AudioEncoderFuncCallback', function () {
})
})
});
});
eventEmitter
.
on
(
'
flush
'
,
()
=>
{
eventEmitter
.
on
(
'
flush
'
,
()
=>
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
((
err
)
=>
{
audioEncodeProcessor
.
flush
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
expect
(
err
).
assertUndefined
();
console
.
info
(
`case flush after 2s success`
);
console
.
info
(
`case flush after 2s success`
);
lockFlag
=
false
;
audioEncodeProcessor
.
start
((
err
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
`case start after flush success`
);
})
})
})
});
});
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
,
(
err
,
processor
)
=>
{
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
,
(
err
,
processor
)
=>
{
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
浏览文件 @
b74987b5
...
@@ -47,6 +47,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -47,6 +47,7 @@ describe('AudioEncoderFuncPromise', function () {
let
outputCnt
=
0
;
let
outputCnt
=
0
;
let
inputCnt
=
0
;
let
inputCnt
=
0
;
let
frameThreshold
=
10
;
let
frameThreshold
=
10
;
let
lockFlag
=
false
;
beforeAll
(
async
function
()
{
beforeAll
(
async
function
()
{
...
@@ -73,6 +74,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -73,6 +74,7 @@ describe('AudioEncoderFuncPromise', function () {
ES_LENGTH
=
1500
;
ES_LENGTH
=
1500
;
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -116,6 +118,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -116,6 +118,7 @@ describe('AudioEncoderFuncPromise', function () {
outputQueue
=
[];
outputQueue
=
[];
outputCnt
=
0
;
outputCnt
=
0
;
inputCnt
=
0
;
inputCnt
=
0
;
lockFlag
=
false
;
}
}
async
function
getFdRead
(
readPath
,
done
)
{
async
function
getFdRead
(
readPath
,
done
)
{
...
@@ -160,6 +163,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -160,6 +163,7 @@ describe('AudioEncoderFuncPromise', function () {
}
}
async
function
flushWork
(
done
)
{
async
function
flushWork
(
done
)
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
await
getFdRead
(
readpath
,
done
);
await
getFdRead
(
readpath
,
done
);
...
@@ -167,6 +171,10 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -167,6 +171,10 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
"
case flush at inputeos success
"
);
console
.
info
(
"
case flush at inputeos success
"
);
resetParam
();
resetParam
();
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
lockFlag
=
false
;
},
failCallback
).
catch
(
failCatch
);
await
audioEncodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
"
case start after flush success
"
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -212,10 +220,12 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -212,10 +220,12 @@ describe('AudioEncoderFuncPromise', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
case queueInput success
'
);
await
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
inputCnt
+=
1
;
console
.
info
(
'
case queueInput success
'
);
});
inputCnt
+=
1
;
});
}
}
}
}
}
...
@@ -242,9 +252,11 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -242,9 +252,11 @@ describe('AudioEncoderFuncPromise', function () {
else
{
else
{
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
if
(
!
lockFlag
)
{
console
.
info
(
'
release output success
'
);
await
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
});
console
.
info
(
'
release output success
'
);
});
}
}
}
}
}
...
@@ -423,11 +435,16 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -423,11 +435,16 @@ describe('AudioEncoderFuncPromise', function () {
await
audioEncodeProcessor
.
start
().
then
(()
=>
{
await
audioEncodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
"
case start success
"
)
console
.
info
(
"
case start success
"
)
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
await
sleep
(
500
).
then
(()
=>
{
await
sleep
(
500
).
then
(
async
()
=>
{
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
().
then
(()
=>
{
await
audioEncodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
"
case flush after 5s
"
)
console
.
info
(
"
case flush after 5s
"
);
lockFlag
=
false
;
},
failCallback
).
catch
(
failCatch
);
await
audioEncodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
"
case start after flush success
"
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
});
});
})
})
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
浏览文件 @
b74987b5
...
@@ -59,6 +59,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -59,6 +59,7 @@ describe('AudioEncoderReliabilityCallback', function () {
"
audio_sample_format
"
:
1
,
"
audio_sample_format
"
:
1
,
};
};
let
fdRead
;
let
fdRead
;
let
lockFlag
=
false
;
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
...
@@ -80,6 +81,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -80,6 +81,7 @@ describe('AudioEncoderReliabilityCallback', function () {
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
ES_LENGTH
=
200
;
ES_LENGTH
=
200
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -110,6 +112,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -110,6 +112,7 @@ describe('AudioEncoderReliabilityCallback', function () {
sawOutputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
lockFlag
=
false
;
}
}
async
function
createAudioEncoder
(
savepath
,
mySteps
,
done
)
{
async
function
createAudioEncoder
(
savepath
,
mySteps
,
done
)
{
...
@@ -220,6 +223,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -220,6 +223,7 @@ describe('AudioEncoderReliabilityCallback', function () {
case
FLUSH
:
case
FLUSH
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
console
.
info
(
`case to flush`
);
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
(
async
(
err
)
=>
{
audioEncodeProcessor
.
flush
(
async
(
err
)
=>
{
...
@@ -231,6 +235,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -231,6 +235,7 @@ describe('AudioEncoderReliabilityCallback', function () {
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
flushAtEOS
=
false
;
flushAtEOS
=
false
;
}
}
lockFlag
=
false
;
nextStep
(
mySteps
,
mediaDescription
,
done
);
nextStep
(
mySteps
,
mediaDescription
,
done
);
});
});
break
;
break
;
...
@@ -699,7 +704,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -699,7 +704,7 @@ describe('AudioEncoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
start_0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
start_0500.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
_ERROR
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
END
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -799,7 +804,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -799,7 +804,7 @@ describe('AudioEncoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0400.es
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0400.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -814,7 +819,7 @@ describe('AudioEncoderReliabilityCallback', function () {
...
@@ -814,7 +819,7 @@ describe('AudioEncoderReliabilityCallback', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0500.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
浏览文件 @
b74987b5
...
@@ -60,6 +60,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -60,6 +60,7 @@ describe('AudioEncoderReliabilityPromise', function () {
};
};
let
expectError
=
false
;
let
expectError
=
false
;
let
fdRead
;
let
fdRead
;
let
lockFlag
=
false
;
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
...
@@ -82,6 +83,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -82,6 +83,7 @@ describe('AudioEncoderReliabilityPromise', function () {
outputQueue
=
[];
outputQueue
=
[];
ES_LENGTH
=
200
;
ES_LENGTH
=
200
;
expectError
=
false
;
expectError
=
false
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -128,6 +130,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -128,6 +130,7 @@ describe('AudioEncoderReliabilityPromise', function () {
sawOutputEOS
=
false
;
sawOutputEOS
=
false
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
lockFlag
=
false
;
}
}
async
function
createAudioEncoder
(
savepath
,
mySteps
,
done
)
{
async
function
createAudioEncoder
(
savepath
,
mySteps
,
done
)
{
...
@@ -189,7 +192,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -189,7 +192,7 @@ describe('AudioEncoderReliabilityPromise', function () {
async
function
nextStep
(
mySteps
,
done
)
{
async
function
nextStep
(
mySteps
,
done
)
{
console
.
info
(
"
case myStep[0]:
"
+
mySteps
[
0
]);
console
.
info
(
"
case myStep[0]:
"
+
mySteps
[
0
]);
if
(
mySteps
[
0
]
==
END
)
{
if
(
mySteps
[
0
]
==
END
)
{
audioEncodeProcessor
.
release
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
release
().
then
(()
=>
{
console
.
info
(
"
case release success
"
);
console
.
info
(
"
case release success
"
);
audioEncodeProcessor
=
null
;
audioEncodeProcessor
=
null
;
done
();
done
();
...
@@ -199,7 +202,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -199,7 +202,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
CONFIGURE
:
case
CONFIGURE
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to configure`
);
console
.
info
(
`case to configure`
);
audioEncodeProcessor
.
configure
(
mediaDescription
).
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
configure
(
mediaDescription
).
then
(()
=>
{
console
.
info
(
`case configure 1`
);
console
.
info
(
`case configure 1`
);
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
...
@@ -207,7 +210,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -207,7 +210,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
PREPARE
:
case
PREPARE
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to prepare`
);
console
.
info
(
`case to prepare`
);
audioEncodeProcessor
.
prepare
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
prepare
().
then
(()
=>
{
console
.
info
(
`case prepare 1`
);
console
.
info
(
`case prepare 1`
);
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
...
@@ -221,7 +224,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -221,7 +224,7 @@ describe('AudioEncoderReliabilityPromise', function () {
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
enqueueInputs
(
inputQueue
);
enqueueInputs
(
inputQueue
);
}
}
audioEncodeProcessor
.
start
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
`case start 1`
);
console
.
info
(
`case start 1`
);
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
...
@@ -229,9 +232,10 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -229,9 +232,10 @@ describe('AudioEncoderReliabilityPromise', function () {
case
FLUSH
:
case
FLUSH
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to flush`
);
console
.
info
(
`case to flush`
);
lockFlag
=
true
;
inputQueue
=
[];
inputQueue
=
[];
outputQueue
=
[];
outputQueue
=
[];
audioEncodeProcessor
.
flush
().
then
(
async
()
=>
{
a
wait
a
udioEncodeProcessor
.
flush
().
then
(
async
()
=>
{
console
.
info
(
`case flush 1`
);
console
.
info
(
`case flush 1`
);
if
(
flushAtEOS
)
{
if
(
flushAtEOS
)
{
await
getFdRead
(
AUDIOPATH
,
done
);
await
getFdRead
(
AUDIOPATH
,
done
);
...
@@ -239,13 +243,14 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -239,13 +243,14 @@ describe('AudioEncoderReliabilityPromise', function () {
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
flushAtEOS
=
false
;
flushAtEOS
=
false
;
}
}
lockFlag
=
false
;
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
break
;
break
;
case
STOP
:
case
STOP
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to stop`
);
console
.
info
(
`case to stop`
);
audioEncodeProcessor
.
stop
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
`case stop 1`
);
console
.
info
(
`case stop 1`
);
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
...
@@ -254,7 +259,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -254,7 +259,7 @@ describe('AudioEncoderReliabilityPromise', function () {
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to reset`
);
console
.
info
(
`case to reset`
);
resetParam
();
resetParam
();
audioEncodeProcessor
.
reset
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
reset
().
then
(()
=>
{
console
.
info
(
`case reset 1`
);
console
.
info
(
`case reset 1`
);
nextStep
(
mySteps
,
done
);
nextStep
(
mySteps
,
done
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
...
@@ -272,7 +277,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -272,7 +277,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
CONFIGURE_ERROR
:
case
CONFIGURE_ERROR
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to configure 2`
);
console
.
info
(
`case to configure 2`
);
audioEncodeProcessor
.
configure
(
mediaDescription
).
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
configure
(
mediaDescription
).
then
(()
=>
{
console
.
info
(
`case configure error 1`
);
console
.
info
(
`case configure error 1`
);
expect
(
expectError
).
assertTrue
();
expect
(
expectError
).
assertTrue
();
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
...
@@ -280,7 +285,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -280,7 +285,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
PREPARE_ERROR
:
case
PREPARE_ERROR
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to prepare 2`
);
console
.
info
(
`case to prepare 2`
);
audioEncodeProcessor
.
prepare
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
prepare
().
then
(()
=>
{
console
.
info
(
`case prepare error 1`
);
console
.
info
(
`case prepare error 1`
);
expect
(
expectError
).
assertTrue
();
expect
(
expectError
).
assertTrue
();
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
...
@@ -288,7 +293,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -288,7 +293,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
START_ERROR
:
case
START_ERROR
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to start 2`
);
console
.
info
(
`case to start 2`
);
audioEncodeProcessor
.
start
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
start
().
then
(()
=>
{
console
.
info
(
`case start error 1`
);
console
.
info
(
`case start error 1`
);
expect
(
expectError
).
assertTrue
();
expect
(
expectError
).
assertTrue
();
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
...
@@ -296,7 +301,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -296,7 +301,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
FLUSH_ERROR
:
case
FLUSH_ERROR
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to flush 2`
);
console
.
info
(
`case to flush 2`
);
audioEncodeProcessor
.
flush
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
flush
().
then
(()
=>
{
console
.
info
(
`case flush error 1`
);
console
.
info
(
`case flush error 1`
);
expect
(
expectError
).
assertTrue
();
expect
(
expectError
).
assertTrue
();
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
...
@@ -304,7 +309,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -304,7 +309,7 @@ describe('AudioEncoderReliabilityPromise', function () {
case
STOP_ERROR
:
case
STOP_ERROR
:
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case to stop 2`
);
console
.
info
(
`case to stop 2`
);
audioEncodeProcessor
.
stop
().
then
(()
=>
{
a
wait
a
udioEncodeProcessor
.
stop
().
then
(()
=>
{
console
.
info
(
`case stop error 1`
);
console
.
info
(
`case stop error 1`
);
expect
(
expectError
).
assertTrue
();
expect
(
expectError
).
assertTrue
();
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
},
(
err
)
=>
{
failCallbackTrue
(
err
,
mySteps
,
done
)}).
catch
(
failCatch
);
...
@@ -701,7 +706,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -701,7 +706,7 @@ describe('AudioEncoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
start_0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
start_0500.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
_ERROR
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
END
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -801,7 +806,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -801,7 +806,7 @@ describe('AudioEncoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0400.es
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0400.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -816,7 +821,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -816,7 +821,7 @@ describe('AudioEncoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0500.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
FLUSH
,
WAITFORALLOUTS
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
FLUSH
,
START
,
FLUSH
,
START
,
WAITFORALLOUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
@@ -845,7 +850,7 @@ describe('AudioEncoderReliabilityPromise', function () {
...
@@ -845,7 +850,7 @@ describe('AudioEncoderReliabilityPromise', function () {
*/
*/
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
let
savepath
=
BASIC_PATH
+
'
flush_0700.es
'
;
let
savepath
=
BASIC_PATH
+
'
flush_0700.es
'
;
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
HOLDON
,
FLUSH
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
PREPARE
,
START
,
HOLDON
,
FLUSH
,
START
,
END
);
EOSFrameNum
=
2
;
EOSFrameNum
=
2
;
createAudioEncoder
(
savepath
,
mySteps
,
done
);
createAudioEncoder
(
savepath
,
mySteps
,
done
);
})
})
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js
浏览文件 @
b74987b5
...
@@ -19,6 +19,4 @@ require('./VideoDecoderReliCallbackTest.test.js')
...
@@ -19,6 +19,4 @@ require('./VideoDecoderReliCallbackTest.test.js')
require
(
'
./VideoDecoderReliPromiseTest.test.js
'
)
require
(
'
./VideoDecoderReliPromiseTest.test.js
'
)
require
(
'
./VideoDecoderSoftwareFuncCallbackTest.test.js
'
)
require
(
'
./VideoDecoderSoftwareFuncCallbackTest.test.js
'
)
require
(
'
./VideoDecoderSoftwareFuncPromiseTest.test.js
'
)
require
(
'
./VideoDecoderSoftwareFuncPromiseTest.test.js
'
)
require
(
'
./VideoDecoderSoftwareReliCallbackTest.test.js
'
)
require
(
'
./VideoDecoderSoftwareReliPromiseTest.test.js
'
)
require
(
'
./VideoDecoderEnumTest.test.js
'
)
require
(
'
./VideoDecoderEnumTest.test.js
'
)
\ No newline at end of file
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
浏览文件 @
b74987b5
...
@@ -75,6 +75,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -75,6 +75,7 @@ describe('VideoDecoderReliCallbackTest', function () {
1798
,
170
,
124
,
121
,
1666
,
157
,
128
,
130
,
1678
,
135
,
118
,
1804
,
169
,
135
,
125
,
1837
,
168
,
124
,
124
];
1798
,
170
,
124
,
121
,
1666
,
157
,
128
,
130
,
1678
,
135
,
118
,
1804
,
169
,
135
,
125
,
1837
,
168
,
124
,
124
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_60FPS_320
;
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_60FPS_320
;
let
fdRead
;
let
fdRead
;
let
lockFlag
=
false
;
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
...
@@ -97,6 +98,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -97,6 +98,7 @@ describe('VideoDecoderReliCallbackTest', function () {
inputEosFlag
=
false
;
inputEosFlag
=
false
;
position
=
0
;
position
=
0
;
surfaceID
=
globalThis
.
value
;
surfaceID
=
globalThis
.
value
;
lockFlag
=
false
;
})
})
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
...
@@ -245,6 +247,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -245,6 +247,7 @@ describe('VideoDecoderReliCallbackTest', function () {
});
});
}
}
function
toFlush
(
mySteps
,
done
,
expectFail
)
{
function
toFlush
(
mySteps
,
done
,
expectFail
)
{
lockFlag
=
true
;
videoDecodeProcessor
.
flush
((
err
)
=>
{
videoDecodeProcessor
.
flush
((
err
)
=>
{
console
.
info
(
`case flush callback`
);
console
.
info
(
`case flush callback`
);
printError
(
err
,
expectFail
);
printError
(
err
,
expectFail
);
...
@@ -255,6 +258,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -255,6 +258,7 @@ describe('VideoDecoderReliCallbackTest', function () {
timestamp
=
0
;
timestamp
=
0
;
frameCountIn
=
1
;
frameCountIn
=
1
;
}
}
lockFlag
=
false
;
toNextStep
(
mySteps
,
done
);
toNextStep
(
mySteps
,
done
);
});
});
}
}
...
@@ -474,7 +478,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -474,7 +478,7 @@ describe('VideoDecoderReliCallbackTest', function () {
*/
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_01_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_01_0200
'
,
0
,
async
function
(
done
)
{
let
mySteps
=
new
Array
(
DECODE_STEP
.
CONFIGURE
,
DECODE_STEP
.
SETSURFACE
,
DECODE_STEP
.
PREPARE
,
DECODE_STEP
.
START
,
let
mySteps
=
new
Array
(
DECODE_STEP
.
CONFIGURE
,
DECODE_STEP
.
SETSURFACE
,
DECODE_STEP
.
PREPARE
,
DECODE_STEP
.
START
,
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
WAIT_FOR_ALL_OUTS
);
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
START
,
DECODE_STEP
.
WAIT_FOR_ALL_OUTS
);
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
toCreateVideoDecoderByMime
(
'
video/avc
'
,
mySteps
,
done
);
toCreateVideoDecoderByMime
(
'
video/avc
'
,
mySteps
,
done
);
})
})
...
@@ -825,7 +829,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -825,7 +829,7 @@ describe('VideoDecoderReliCallbackTest', function () {
*/
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
mySteps
=
new
Array
(
DECODE_STEP
.
CONFIGURE
,
DECODE_STEP
.
SETSURFACE
,
DECODE_STEP
.
PREPARE
,
DECODE_STEP
.
START
,
let
mySteps
=
new
Array
(
DECODE_STEP
.
CONFIGURE
,
DECODE_STEP
.
SETSURFACE
,
DECODE_STEP
.
PREPARE
,
DECODE_STEP
.
START
,
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
START
,
DECODE_STEP
.
ERROR
,
DECODE_STEP
.
RELEASE
);
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
START
,
DECODE_STEP
.
RELEASE
);
toCreateVideoDecoderByMime
(
'
video/avc
'
,
mySteps
,
done
);
toCreateVideoDecoderByMime
(
'
video/avc
'
,
mySteps
,
done
);
})
})
...
@@ -937,7 +941,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -937,7 +941,7 @@ describe('VideoDecoderReliCallbackTest', function () {
*/
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
mySteps
=
new
Array
(
DECODE_STEP
.
CONFIGURE
,
DECODE_STEP
.
SETSURFACE
,
DECODE_STEP
.
PREPARE
,
DECODE_STEP
.
START
,
let
mySteps
=
new
Array
(
DECODE_STEP
.
CONFIGURE
,
DECODE_STEP
.
SETSURFACE
,
DECODE_STEP
.
PREPARE
,
DECODE_STEP
.
START
,
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
RELEASE
);
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
START
,
DECODE_STEP
.
FLUSH
,
DECODE_STEP
.
RELEASE
);
toCreateVideoDecoderByMime
(
'
video/avc
'
,
mySteps
,
done
);
toCreateVideoDecoderByMime
(
'
video/avc
'
,
mySteps
,
done
);
})
})
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
浏览文件 @
b74987b5
此差异已折叠。
点击以展开。
multimedia/media/media_js_standard/videoEncoder/Test.json
浏览文件 @
b74987b5
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"setenforce 0"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/*"
,
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/"
,
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/"
,
"chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/"
"chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/"
...
@@ -41,7 +40,6 @@
...
@@ -41,7 +40,6 @@
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/*"
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/*"
],
],
"teardown-command"
:[
"teardown-command"
:[
"setenforce 1"
]
]
}
}
]
]
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncPromiseTest.test.js
浏览文件 @
b74987b5
...
@@ -681,6 +681,7 @@ describe('videoHardwareEncoderFuncPromise', function () {
...
@@ -681,6 +681,7 @@ describe('videoHardwareEncoderFuncPromise', function () {
needRelease
=
true
;
needRelease
=
true
;
await
toStartEnc
();
await
toStartEnc
();
await
toFlushDec
();
await
toFlushDec
();
await
toStartDec
();
});
});
})
})
...
@@ -705,10 +706,12 @@ describe('videoHardwareEncoderFuncPromise', function () {
...
@@ -705,10 +706,12 @@ describe('videoHardwareEncoderFuncPromise', function () {
await
sleep
(
5000
);
await
sleep
(
5000
);
expect
(
outputEncEos
).
assertFalse
();
expect
(
outputEncEos
).
assertFalse
();
await
toFlushEnc
();
await
toFlushEnc
();
await
toStartEnc
();
resetReadParam
();
resetReadParam
();
resetStateParam
();
resetStateParam
();
needRelease
=
true
;
needRelease
=
true
;
await
toFlushDec
();
await
toFlushDec
();
await
toStartDec
();
})
})
/* *
/* *
...
@@ -731,10 +734,12 @@ describe('videoHardwareEncoderFuncPromise', function () {
...
@@ -731,10 +734,12 @@ describe('videoHardwareEncoderFuncPromise', function () {
await
startDecProcess
(
mime
,
srcPath
,
mediaDescription2
,
done
);
await
startDecProcess
(
mime
,
srcPath
,
mediaDescription2
,
done
);
eventEmitter
.
on
(
'
flushAtEos
'
,
async
()
=>
{
eventEmitter
.
on
(
'
flushAtEos
'
,
async
()
=>
{
await
toFlushEnc
();
await
toFlushEnc
();
await
toStartEnc
();
resetReadParam
();
resetReadParam
();
resetStateParam
();
resetStateParam
();
needRelease
=
true
;
needRelease
=
true
;
await
toFlushDec
();
await
toFlushDec
();
await
toStartDec
();
});
});
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录