Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5cf431dd
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
接近 2 年 前同步成功
通知
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看板
提交
5cf431dd
编写于
3月 14, 2022
作者:
L
ling990
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify testcases Signed-off-by: ling990 <liling96@huawei.com>
Signed-off-by:
N
ling990
<
ling990@qq.com
>
上级
92eab25f
变更
75
隐藏空白更改
内联
并排
Showing
75 changed file
with
323 addition
and
473 deletion
+323
-473
multimedia/media/media_js_standard/audioDecoder/Test.json
multimedia/media/media_js_standard/audioDecoder/Test.json
+10
-10
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
...udioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
+2
-30
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
...r/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
+13
-13
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
...er/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
+13
-13
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
+15
-15
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
+15
-15
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
+9
-10
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
.../main/js/test/AudioDecoderReliabilityCallbackTest.test.js
+6
-6
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
+6
-6
multimedia/media/media_js_standard/audioEncoder/Test.json
multimedia/media/media_js_standard/audioEncoder/Test.json
+10
-10
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
+13
-13
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
+13
-13
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
+9
-10
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
.../main/js/test/AudioEncoderReliabilityCallbackTest.test.js
+6
-6
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
+6
-6
multimedia/media/media_js_standard/audioPlayer/BUILD.gn
multimedia/media/media_js_standard/audioPlayer/BUILD.gn
+1
-1
multimedia/media/media_js_standard/audioPlayer/Test.json
multimedia/media/media_js_standard/audioPlayer/Test.json
+8
-8
multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java
...a/ohos/acts/multimedia/audio/audioplayer/MainAbility.java
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java
...ohos/acts/multimedia/audio/audioplayer/MyApplication.java
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js
.../media_js_standard/audioPlayer/src/main/js/default/app.js
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css
...ard/audioPlayer/src/main/js/default/pages/index/index.css
+0
-15
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml
...ard/audioPlayer/src/main/js/default/pages/index/index.hml
+0
-15
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js
...dard/audioPlayer/src/main/js/default/pages/index/index.js
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js
...dia_js_standard/audioPlayer/src/main/js/test/List.test.js
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
...ioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
...oPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
+1
-1
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
...layer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
+1
-1
multimedia/media/media_js_standard/audioRecorder/BUILD.gn
multimedia/media/media_js_standard/audioRecorder/BUILD.gn
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java
...a/ohos/acts/multimedia/audio/audioplayer/MainAbility.java
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java
...ohos/acts/multimedia/audio/audioplayer/MyApplication.java
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js
...edia_js_standard/audioRecorder/src/main/js/default/app.js
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css
...d/audioRecorder/src/main/js/default/pages/index/index.css
+0
-15
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml
...d/audioRecorder/src/main/js/default/pages/index/index.hml
+0
-15
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js
...rd/audioRecorder/src/main/js/default/pages/index/index.js
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js
...ioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js
...a_js_standard/audioRecorder/src/main/js/test/List.test.js
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
...corder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
+3
-4
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
...order/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
+1
-1
multimedia/media/media_js_standard/videoDecoder/Test.json
multimedia/media/media_js_standard/videoDecoder/Test.json
+17
-16
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
...ideoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
...der/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
+11
-11
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
...der/src/main/js/test/VideoDecoderReliCallbackTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
+6
-6
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
+6
-6
multimedia/media/media_js_standard/videoEncoder/Test.json
multimedia/media/media_js_standard/videoEncoder/Test.json
+10
-10
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
...r/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
+7
-7
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
+3
-3
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
+3
-3
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
.../test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
+3
-3
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
...s/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
+3
-3
multimedia/media/media_js_standard/videoPlayer/BUILD.gn
multimedia/media/media_js_standard/videoPlayer/BUILD.gn
+2
-2
multimedia/media/media_js_standard/videoPlayer/Test.json
multimedia/media/media_js_standard/videoPlayer/Test.json
+8
-8
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/app.js
.../media_js_standard/videoPlayer/src/main/js/default/app.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css
...ard/videoPlayer/src/main/js/default/pages/index/index.css
+0
-15
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml
...ard/videoPlayer/src/main/js/default/pages/index/index.hml
+0
-15
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js
...dard/videoPlayer/src/main/js/default/pages/index/index.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js
...dia_js_standard/videoPlayer/src/main/js/test/List.test.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
...layer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js
.../videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
...ayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
...layer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
+1
-1
multimedia/media/media_js_standard/videoRecorder/BUILD.gn
multimedia/media/media_js_standard/videoRecorder/BUILD.gn
+2
-2
multimedia/media/media_js_standard/videoRecorder/Test.json
multimedia/media/media_js_standard/videoRecorder/Test.json
+2
-2
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js
...edia_js_standard/videoRecorder/src/main/js/default/app.js
+1
-1
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css
...d/videoRecorder/src/main/js/default/pages/index/index.css
+0
-15
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml
...d/videoRecorder/src/main/js/default/pages/index/index.hml
+0
-15
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js
...rd/videoRecorder/src/main/js/default/pages/index/index.js
+1
-1
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js
...a_js_standard/videoRecorder/src/main/js/test/List.test.js
+1
-1
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
...der/src/main/js/test/VideoRecorderAPICallbackTest.test.js
+1
-1
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
...er/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
+10
-10
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
...der/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
+9
-9
未找到文件。
multimedia/media/media_js_standard/audioDecoder/Test.json
浏览文件 @
5cf431dd
...
@@ -4,9 +4,16 @@
...
@@ -4,9 +4,16 @@
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.audio.audiodecoder"
,
"package"
:
"ohos.acts.multimedia.audio.audiodecoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"test-file-name"
:
[
"ActsAudioDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
{
"type"
:
"PushKit"
,
"type"
:
"PushKit"
,
"pre-push"
:
[
"pre-push"
:
[
...
@@ -19,7 +26,7 @@
...
@@ -19,7 +26,7 @@
"./resource/audio/audioDecode/vorbis.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/"
"./resource/audio/audioDecode/vorbis.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/"
]
]
},
},
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results"
,
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results"
,
...
@@ -29,13 +36,6 @@
...
@@ -29,13 +36,6 @@
],
],
"teardown-command"
:[
"teardown-command"
:[
]
]
},
{
"test-file-name"
:
[
"ActsAudioDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
}
]
]
}
}
\ No newline at end of file
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
浏览文件 @
5cf431dd
...
@@ -131,37 +131,9 @@ describe('AudioDecoderEnum', function () {
...
@@ -131,37 +131,9 @@ describe('AudioDecoderEnum', function () {
done
();
done
();
})
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AudioRawFormat_0100
* @tc.name : 003.AudioRawFormat
* @tc.desc : Test Enumerate AudioRawFormat
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_AudioRawFormat_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S8
).
assertEqual
(
1
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_8
).
assertEqual
(
2
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S16_BE
).
assertEqual
(
3
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S16_LE
).
assertEqual
(
4
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_16_BE
).
assertEqual
(
5
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_16_LE
).
assertEqual
(
6
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S24_BE
).
assertEqual
(
7
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S24_LE
).
assertEqual
(
8
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_24_BE
).
assertEqual
(
9
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_24_LE
).
assertEqual
(
10
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S32_BE
).
assertEqual
(
11
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S32_LE
).
assertEqual
(
12
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_32_BE
).
assertEqual
(
13
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_32_LE
).
assertEqual
(
14
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_F32_BE
).
assertEqual
(
15
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_F32_LE
).
assertEqual
(
16
);
done
();
})
/* *
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100
* @tc.name : 00
4
.AVCodecType
* @tc.name : 00
3
.AVCodecType
* @tc.desc : Test Enumerate AVCodecType
* @tc.desc : Test Enumerate AVCodecType
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.type : Function test
...
@@ -177,7 +149,7 @@ describe('AudioDecoderEnum', function () {
...
@@ -177,7 +149,7 @@ describe('AudioDecoderEnum', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100
* @tc.name : 00
5
.CodecMimeType
* @tc.name : 00
4
.CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.type : Function test
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -134,7 +134,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -134,7 +134,7 @@ describe('AudioDecoderFormatCallback', function () {
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
}
}
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
console
.
info
(
'
queueInput success
'
);
})
})
}
}
...
@@ -165,7 +165,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -165,7 +165,7 @@ describe('AudioDecoderFormatCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
log
(
"
write to file success
"
);
console
.
log
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
})
})
}
}
...
@@ -173,12 +173,12 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -173,12 +173,12 @@ describe('AudioDecoderFormatCallback', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
"
inputBufferAvailable
"
);
console
.
info
(
"
inputBufferAvailable
"
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
"
outputBufferAvailable
"
);
console
.
info
(
"
outputBufferAvailable
"
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
@@ -193,7 +193,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -193,7 +193,7 @@ describe('AudioDecoderFormatCallback', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
@@ -213,7 +213,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -213,7 +213,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
aac_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
aac_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -330,7 +330,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -330,7 +330,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
aac_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
aac_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -447,7 +447,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -447,7 +447,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
flac_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flac_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -521,7 +521,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -521,7 +521,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
flac_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flac_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -595,7 +595,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -595,7 +595,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
mp3_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
mp3_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -656,7 +656,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -656,7 +656,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
mp3_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
mp3_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -717,7 +717,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -717,7 +717,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
vorbis_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
vorbis_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -821,7 +821,7 @@ describe('AudioDecoderFormatCallback', function () {
...
@@ -821,7 +821,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
vorbis_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
vorbis_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -144,7 +144,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -144,7 +144,7 @@ describe('AudioDecoderFormatPromise', function () {
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
}
}
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
"
queueInput success
"
)
console
.
info
(
"
queueInput success
"
)
})
})
}
}
...
@@ -173,7 +173,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -173,7 +173,7 @@ describe('AudioDecoderFormatPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
log
(
"
write to file success
"
);
console
.
log
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
})
})
}
}
...
@@ -181,12 +181,12 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -181,12 +181,12 @@ describe('AudioDecoderFormatPromise', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
"
inputBufferAvailable
"
);
console
.
info
(
"
inputBufferAvailable
"
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
"
outputBufferAvailable
"
);
console
.
info
(
"
outputBufferAvailable
"
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
audioDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
@@ -200,7 +200,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -200,7 +200,7 @@ describe('AudioDecoderFormatPromise', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
@@ -218,7 +218,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -218,7 +218,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
aac_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
aac_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -316,7 +316,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -316,7 +316,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
aac_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
aac_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -414,7 +414,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -414,7 +414,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
flac_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flac_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -470,7 +470,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -470,7 +470,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
flac_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
flac_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -526,7 +526,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -526,7 +526,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
mp3_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
mp3_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -567,7 +567,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -567,7 +567,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
mp3_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
mp3_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -608,7 +608,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -608,7 +608,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
vorbis_01.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
vorbis_01.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -693,7 +693,7 @@ describe('AudioDecoderFormatPromise', function () {
...
@@ -693,7 +693,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
vorbis_02.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
vorbis_02.pcm
'
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -384,7 +384,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -384,7 +384,7 @@ describe('AudioDecoderFuncCallback', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
console
.
info
(
'
queueInput success
'
);
})
})
}
}
...
@@ -411,7 +411,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -411,7 +411,7 @@ describe('AudioDecoderFuncCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
})
})
}
}
...
@@ -419,12 +419,12 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -419,12 +419,12 @@ describe('AudioDecoderFuncCallback', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
){
if
(
needGetMediaDes
){
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
@@ -440,7 +440,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -440,7 +440,7 @@ describe('AudioDecoderFuncCallback', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
@@ -460,7 +460,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -460,7 +460,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
needGetMediaDes
=
true
;
needGetMediaDes
=
true
;
...
@@ -541,7 +541,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -541,7 +541,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
eosframenum
=
500
;
eosframenum
=
500
;
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
...
@@ -612,7 +612,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -612,7 +612,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
let
savepath
=
BASIC_PATH
+
'
0200.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0200.pcm
'
;
...
@@ -678,7 +678,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -678,7 +678,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
eosframenum
=
200
;
eosframenum
=
200
;
flushAtEOS
=
true
;
flushAtEOS
=
true
;
...
@@ -737,7 +737,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -737,7 +737,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0400.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0400.pcm
'
;
eventEmitter
.
on
(
'
getAudioDecoderCaps
'
,
()
=>
{
eventEmitter
.
on
(
'
getAudioDecoderCaps
'
,
()
=>
{
...
@@ -819,7 +819,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -819,7 +819,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
eosframenum
=
200
;
eosframenum
=
200
;
let
savepath
=
BASIC_PATH
+
'
0500.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0500.pcm
'
;
...
@@ -898,7 +898,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -898,7 +898,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
eosframenum
=
200
;
eosframenum
=
200
;
resetAtEOS
=
true
;
resetAtEOS
=
true
;
...
@@ -906,7 +906,7 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -906,7 +906,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
16000
,
"
sample_rate
"
:
16000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
hasreconfigured
=
false
;
let
hasreconfigured
=
false
;
eventEmitter
.
on
(
'
getAudioDecoderCaps
'
,
()
=>
{
eventEmitter
.
on
(
'
getAudioDecoderCaps
'
,
()
=>
{
...
@@ -996,12 +996,12 @@ describe('AudioDecoderFuncCallback', function () {
...
@@ -996,12 +996,12 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
hasrecreate
=
false
;
let
hasrecreate
=
false
;
eosframenum
=
200
;
eosframenum
=
200
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -380,7 +380,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -380,7 +380,7 @@ describe('AudioDecoderFuncPromise', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
console
.
info
(
'
case queueInput success
'
);
});
});
}
}
...
@@ -409,7 +409,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -409,7 +409,7 @@ describe('AudioDecoderFuncPromise', function () {
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -417,12 +417,12 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -417,12 +417,12 @@ describe('AudioDecoderFuncPromise', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
"
outputbuffer.flags:
"
+
outBuffer
.
flags
);
console
.
info
(
"
outputbuffer.flags:
"
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
...
@@ -437,7 +437,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -437,7 +437,7 @@ describe('AudioDecoderFuncPromise', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
@@ -455,7 +455,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -455,7 +455,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0000.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0000.pcm
'
;
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
...
@@ -513,7 +513,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -513,7 +513,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0100.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0100.pcm
'
;
eosframenum
=
500
;
eosframenum
=
500
;
...
@@ -553,7 +553,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -553,7 +553,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0200.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0200.pcm
'
;
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
...
@@ -598,7 +598,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -598,7 +598,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0300.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0300.pcm
'
;
eosframenum
=
200
;
eosframenum
=
200
;
...
@@ -637,7 +637,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -637,7 +637,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0400.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0400.pcm
'
;
await
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
await
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
@@ -687,7 +687,7 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -687,7 +687,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0500.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0500.pcm
'
;
eosframenum
=
200
;
eosframenum
=
200
;
...
@@ -741,12 +741,12 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -741,12 +741,12 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
16000
,
"
sample_rate
"
:
16000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0600.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0600.pcm
'
;
eosframenum
=
200
;
eosframenum
=
200
;
...
@@ -818,12 +818,12 @@ describe('AudioDecoderFuncPromise', function () {
...
@@ -818,12 +818,12 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
}
let
savepath
=
BASIC_PATH
+
'
0700.pcm
'
;
let
savepath
=
BASIC_PATH
+
'
0700.pcm
'
;
eosframenum
=
200
;
eosframenum
=
200
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
浏览文件 @
5cf431dd
...
@@ -173,7 +173,7 @@ describe('AudioDecoderMultiInstances', function () {
...
@@ -173,7 +173,7 @@ describe('AudioDecoderMultiInstances', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
console
.
info
(
'
case queueInput success
'
);
});
});
}
}
...
@@ -202,7 +202,7 @@ describe('AudioDecoderMultiInstances', function () {
...
@@ -202,7 +202,7 @@ describe('AudioDecoderMultiInstances', function () {
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -210,12 +210,12 @@ describe('AudioDecoderMultiInstances', function () {
...
@@ -210,12 +210,12 @@ describe('AudioDecoderMultiInstances', function () {
function
setCallback
(
audioDecodeProcessor
,
savepath
,
done
)
{
function
setCallback
(
audioDecodeProcessor
,
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
audioDecodeProcessor
,
inputQueue
);
await
enqueueAllInputs
(
audioDecodeProcessor
,
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
"
outputbuffer.flags:
"
+
outBuffer
.
flags
);
console
.
info
(
"
outputbuffer.flags:
"
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
...
@@ -230,14 +230,14 @@ describe('AudioDecoderMultiInstances', function () {
...
@@ -230,14 +230,14 @@ describe('AudioDecoderMultiInstances', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
/* *
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
* @tc.number : SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
* @tc.name : 001.create
16 decoder
* @tc.name : 001.create
multiple decoders
* @tc.desc : basic decode function
* @tc.desc : basic decode function
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.type : Function test
...
@@ -246,7 +246,7 @@ describe('AudioDecoderMultiInstances', function () {
...
@@ -246,7 +246,7 @@ describe('AudioDecoderMultiInstances', function () {
it
(
'
SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple instances
"
);
console
.
info
(
"
case test multiple instances
"
);
let
array
=
new
Array
();
let
array
=
new
Array
();
for
(
let
i
=
0
;
i
<
16
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
2
;
i
+=
1
)
{
await
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
await
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createAudioDecoder success:
"
+
i
);
console
.
info
(
"
case create createAudioDecoder success:
"
+
i
);
...
@@ -256,9 +256,8 @@ describe('AudioDecoderMultiInstances', function () {
...
@@ -256,9 +256,8 @@ describe('AudioDecoderMultiInstances', function () {
}
}
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
console
.
info
(
'
case has created 16 decoders
'
);
console
.
info
(
'
case has created multiple decoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
2
;
j
++
)
{
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
resetParam
();
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset decoder
"
+
j
);
console
.
info
(
"
reset decoder
"
+
j
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -144,7 +144,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -144,7 +144,7 @@ describe('AudioDecoderReliabilityCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
};
};
beforeAll
(
function
()
{
beforeAll
(
function
()
{
...
@@ -520,7 +520,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -520,7 +520,7 @@ describe('AudioDecoderReliabilityCallback', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
console
.
info
(
'
queueInput success
'
);
})
})
}
}
...
@@ -541,7 +541,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -541,7 +541,7 @@ describe('AudioDecoderReliabilityCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
})
})
}
}
...
@@ -549,12 +549,12 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -549,12 +549,12 @@ describe('AudioDecoderReliabilityCallback', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
@@ -570,7 +570,7 @@ describe('AudioDecoderReliabilityCallback', function () {
...
@@ -570,7 +570,7 @@ describe('AudioDecoderReliabilityCallback', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -145,7 +145,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -145,7 +145,7 @@ describe('AudioDecoderReliabilityPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
};
};
let
expectError
=
false
;
let
expectError
=
false
;
...
@@ -522,7 +522,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -522,7 +522,7 @@ describe('AudioDecoderReliabilityPromise', function () {
}
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
console
.
info
(
'
case queueInput success
'
);
});
});
}
}
...
@@ -544,7 +544,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -544,7 +544,7 @@ describe('AudioDecoderReliabilityPromise', function () {
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -552,12 +552,12 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -552,12 +552,12 @@ describe('AudioDecoderReliabilityPromise', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
audioDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
@@ -571,7 +571,7 @@ describe('AudioDecoderReliabilityPromise', function () {
...
@@ -571,7 +571,7 @@ describe('AudioDecoderReliabilityPromise', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioDecodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
...
multimedia/media/media_js_standard/audioEncoder/Test.json
浏览文件 @
5cf431dd
...
@@ -4,9 +4,16 @@
...
@@ -4,9 +4,16 @@
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.audio.audioencoder"
,
"package"
:
"ohos.acts.multimedia.audio.audioencoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"test-file-name"
:
[
"ActsAudioEncoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
{
"type"
:
"PushKit"
,
"type"
:
"PushKit"
,
"pre-push"
:
[
"pre-push"
:
[
...
@@ -16,7 +23,7 @@
...
@@ -16,7 +23,7 @@
"./resource/audio/audioEncode/S32LE_2.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/"
]
]
},
},
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results"
,
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results"
,
...
@@ -26,13 +33,6 @@
...
@@ -26,13 +33,6 @@
],
],
"teardown-command"
:[
"teardown-command"
:[
]
]
},
{
"test-file-name"
:
[
"ActsAudioEncoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
}
]
]
}
}
\ No newline at end of file
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -224,7 +224,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -224,7 +224,7 @@ describe('AudioEncoderFuncCallback', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
console
.
info
(
'
queueInput success
'
);
})
})
}
}
...
@@ -252,7 +252,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -252,7 +252,7 @@ describe('AudioEncoderFuncCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
})
})
}
}
...
@@ -260,12 +260,12 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -260,12 +260,12 @@ describe('AudioEncoderFuncCallback', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
case inputBufferAvailable
'
);
console
.
info
(
'
case inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
case outputBufferAvailable
'
);
console
.
info
(
'
case outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
audioEncodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
@@ -281,7 +281,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -281,7 +281,7 @@ describe('AudioEncoderFuncCallback', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
case Output format changed:
'
+
format
);
console
.
info
(
'
case Output format changed:
'
+
format
);
});
});
}
}
...
@@ -301,7 +301,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -301,7 +301,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
...
@@ -384,7 +384,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -384,7 +384,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
callback0100.es
'
;
let
savepath
=
BASIC_PATH
+
'
callback0100.es
'
;
eosframenum
=
500
;
eosframenum
=
500
;
...
@@ -442,7 +442,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -442,7 +442,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
callback0200.es
'
;
let
savepath
=
BASIC_PATH
+
'
callback0200.es
'
;
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
...
@@ -508,7 +508,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -508,7 +508,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
callback0300.es
'
;
let
savepath
=
BASIC_PATH
+
'
callback0300.es
'
;
eosframenum
=
500
;
eosframenum
=
500
;
...
@@ -566,7 +566,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -566,7 +566,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
callback0400.es
'
;
let
savepath
=
BASIC_PATH
+
'
callback0400.es
'
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
@@ -648,7 +648,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -648,7 +648,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
callback0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
callback0500.es
'
;
eosframenum
=
100
;
eosframenum
=
100
;
...
@@ -727,7 +727,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -727,7 +727,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
callback0600.es
'
;
let
savepath
=
BASIC_PATH
+
'
callback0600.es
'
;
eosframenum
=
100
;
eosframenum
=
100
;
...
@@ -735,7 +735,7 @@ describe('AudioEncoderFuncCallback', function () {
...
@@ -735,7 +735,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
hasreconfigured
=
false
;
let
hasreconfigured
=
false
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -231,7 +231,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -231,7 +231,7 @@ describe('AudioEncoderFuncPromise', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
console
.
info
(
'
case queueInput success
'
);
});
});
}
}
...
@@ -260,7 +260,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -260,7 +260,7 @@ describe('AudioEncoderFuncPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -268,12 +268,12 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -268,12 +268,12 @@ describe('AudioEncoderFuncPromise', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
(
inputQueue
);
await
enqueueInputs
(
inputQueue
);
});
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needgetMediaDes
)
{
if
(
needgetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
@@ -288,7 +288,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -288,7 +288,7 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
@@ -306,7 +306,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -306,7 +306,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
...
@@ -371,7 +371,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -371,7 +371,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
0100.es
'
;
let
savepath
=
BASIC_PATH
+
'
0100.es
'
;
eosframenum
=
500
;
eosframenum
=
500
;
...
@@ -410,7 +410,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -410,7 +410,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
0200.es
'
;
let
savepath
=
BASIC_PATH
+
'
0200.es
'
;
workdoneAtEOS
=
true
;
workdoneAtEOS
=
true
;
...
@@ -455,7 +455,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -455,7 +455,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
0300.es
'
;
let
savepath
=
BASIC_PATH
+
'
0300.es
'
;
eosframenum
=
500
;
eosframenum
=
500
;
...
@@ -494,7 +494,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -494,7 +494,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
0400.es
'
;
let
savepath
=
BASIC_PATH
+
'
0400.es
'
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
@@ -544,7 +544,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -544,7 +544,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
0500.es
'
;
let
savepath
=
BASIC_PATH
+
'
0500.es
'
;
eosframenum
=
100
;
eosframenum
=
100
;
...
@@ -598,7 +598,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -598,7 +598,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
let
savepath
=
BASIC_PATH
+
'
0600.es
'
;
let
savepath
=
BASIC_PATH
+
'
0600.es
'
;
eosframenum
=
100
;
eosframenum
=
100
;
...
@@ -625,7 +625,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -625,7 +625,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription2
=
{
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
}
await
sleep
(
10000
).
then
(()
=>
{
await
sleep
(
10000
).
then
(()
=>
{
console
.
info
(
"
start configure 2
"
);
console
.
info
(
"
start configure 2
"
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
浏览文件 @
5cf431dd
...
@@ -218,7 +218,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -218,7 +218,7 @@ describe('AudioEncoderFuncPromise', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
console
.
info
(
'
case queueInput success
'
);
});
});
}
}
...
@@ -247,7 +247,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -247,7 +247,7 @@ describe('AudioEncoderFuncPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -255,12 +255,12 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -255,12 +255,12 @@ describe('AudioEncoderFuncPromise', function () {
function
setCallback
(
audioEncodeProcessor
,
savepath
,
done
)
{
function
setCallback
(
audioEncodeProcessor
,
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
(
audioEncodeProcessor
,
inputQueue
);
await
enqueueInputs
(
audioEncodeProcessor
,
inputQueue
);
});
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needgetMediaDes
)
{
if
(
needgetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
@@ -275,14 +275,14 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -275,14 +275,14 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
/* *
/* *
* @tc.number : SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
* @tc.number : SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
* @tc.name : 001.create
16 encoder
* @tc.name : 001.create
multiple encoder2
* @tc.desc : basic encode function
* @tc.desc : basic encode function
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.type : Function test
...
@@ -291,7 +291,7 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -291,7 +291,7 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple encoder instances
"
);
console
.
info
(
"
case test multiple encoder instances
"
);
let
array
=
new
Array
();
let
array
=
new
Array
();
for
(
let
i
=
0
;
i
<
16
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
2
;
i
+=
1
)
{
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createAudioEncoder success:
"
+
i
);
console
.
info
(
"
case create createAudioEncoder success:
"
+
i
);
...
@@ -301,9 +301,8 @@ describe('AudioEncoderFuncPromise', function () {
...
@@ -301,9 +301,8 @@ describe('AudioEncoderFuncPromise', function () {
}
}
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
console
.
info
(
'
case has created 16 encoders
'
);
console
.
info
(
'
case has created multiple encoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
2
;
j
++
)
{
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
resetParam
();
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset encoder
"
+
j
);
console
.
info
(
"
reset encoder
"
+
j
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -56,7 +56,7 @@ describe('AudioEncoderSTTCallback', function () {
...
@@ -56,7 +56,7 @@ describe('AudioEncoderSTTCallback', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
};
};
beforeAll
(
function
()
{
beforeAll
(
function
()
{
...
@@ -368,7 +368,7 @@ describe('AudioEncoderSTTCallback', function () {
...
@@ -368,7 +368,7 @@ describe('AudioEncoderSTTCallback', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
console
.
info
(
'
queueInput success
'
);
})
})
}
}
...
@@ -390,7 +390,7 @@ describe('AudioEncoderSTTCallback', function () {
...
@@ -390,7 +390,7 @@ describe('AudioEncoderSTTCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
})
})
}
}
...
@@ -398,12 +398,12 @@ describe('AudioEncoderSTTCallback', function () {
...
@@ -398,12 +398,12 @@ describe('AudioEncoderSTTCallback', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
case inputBufferAvailable
'
);
console
.
info
(
'
case inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
await
enqueueAllInputs
(
inputQueue
);
});
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
case outputBufferAvailable
'
);
console
.
info
(
'
case outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
audioEncodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
@@ -419,7 +419,7 @@ describe('AudioEncoderSTTCallback', function () {
...
@@ -419,7 +419,7 @@ describe('AudioEncoderSTTCallback', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
case Output format changed:
'
+
format
);
console
.
info
(
'
case Output format changed:
'
+
format
);
});
});
}
}
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -56,7 +56,7 @@ describe('AudioEncoderSTTPromise', function () {
...
@@ -56,7 +56,7 @@ describe('AudioEncoderSTTPromise', function () {
let
mediaDescription
=
{
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
};
};
let
expectError
=
false
;
let
expectError
=
false
;
...
@@ -372,7 +372,7 @@ describe('AudioEncoderSTTPromise', function () {
...
@@ -372,7 +372,7 @@ describe('AudioEncoderSTTPromise', function () {
}
}
timestamp
+=
23
;
timestamp
+=
23
;
frameCnt
+=
1
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
console
.
info
(
'
case queueInput success
'
);
});
});
}
}
...
@@ -395,7 +395,7 @@ describe('AudioEncoderSTTPromise', function () {
...
@@ -395,7 +395,7 @@ describe('AudioEncoderSTTPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
}
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -403,12 +403,12 @@ describe('AudioEncoderSTTPromise', function () {
...
@@ -403,12 +403,12 @@ describe('AudioEncoderSTTPromise', function () {
function
setCallback
(
savepath
,
done
)
{
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
(
inputQueue
);
await
enqueueInputs
(
inputQueue
);
});
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
@@ -423,7 +423,7 @@ describe('AudioEncoderSTTPromise', function () {
...
@@ -423,7 +423,7 @@ describe('AudioEncoderSTTPromise', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
audioEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
audioEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
audioEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
...
multimedia/media/media_js_standard/audioPlayer/BUILD.gn
浏览文件 @
5cf431dd
# Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/Test.json
浏览文件 @
5cf431dd
...
@@ -2,11 +2,18 @@
...
@@ -2,11 +2,18 @@
"description"
:
"Configuration for audioPlayer Tests"
,
"description"
:
"Configuration for audioPlayer Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
12
0000"
,
"test-timeout"
:
"
200
0000"
,
"package"
:
"ohos.acts.multimedia.audio.audioplayer"
,
"package"
:
"ohos.acts.multimedia.audio.audioplayer"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"test-file-name"
:
[
"ActsAudioPlayerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
{
"type"
:
"PushKit"
,
"type"
:
"PushKit"
,
"pre-push"
:
[
"pre-push"
:
[
...
@@ -44,13 +51,6 @@
...
@@ -44,13 +51,6 @@
],
],
"teardown-command"
:[
"teardown-command"
:[
]
]
},
{
"test-file-name"
:
[
"ActsAudioPlayerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
}
]
]
}
}
multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css
浏览文件 @
5cf431dd
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container
{
.container
{
flex-direction
:
column
;
flex-direction
:
column
;
justify-content
:
center
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml
浏览文件 @
5cf431dd
<!--
Copyright (c) 2021-2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<div class="container">
<text class="title">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/BUILD.gn
浏览文件 @
5cf431dd
# Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css
浏览文件 @
5cf431dd
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container
{
.container
{
flex-direction
:
column
;
flex-direction
:
column
;
justify-content
:
center
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml
浏览文件 @
5cf431dd
<!--
Copyright (c) 2021-2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<div class="container">
<text class="title">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -216,9 +216,7 @@ describe('RecorderLocalTestAudioAPI', function () {
...
@@ -216,9 +216,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.level : Level2
* @tc.level : Level2
*/
*/
it
(
'
SUB_MEDIA_RECORDER_createAudioRecorder_API_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_RECORDER_createAudioRecorder_API_0100
'
,
0
,
async
function
(
done
)
{
audioConfig
.
uri
=
fdPath
;
let
testAudioRecorder
=
undefined
;
let
testAudioRecorder
;
expect
(
testAudioRecorder
).
assertNull
();
testAudioRecorder
=
media
.
createAudioRecorder
();
testAudioRecorder
=
media
.
createAudioRecorder
();
expect
(
testAudioRecorder
!=
undefined
).
assertTrue
();
expect
(
testAudioRecorder
!=
undefined
).
assertTrue
();
done
();
done
();
...
@@ -233,6 +231,7 @@ describe('RecorderLocalTestAudioAPI', function () {
...
@@ -233,6 +231,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.level : Level2
* @tc.level : Level2
*/
*/
it
(
'
SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100
'
,
0
,
async
function
(
done
)
{
audioConfig
.
uri
=
fdPath
;
let
testAudioRecorder
=
media
.
createAudioRecorder
();
let
testAudioRecorder
=
media
.
createAudioRecorder
();
expect
(
testAudioRecorder
!=
null
).
assertTrue
();
expect
(
testAudioRecorder
!=
null
).
assertTrue
();
testAudioRecorder
.
prepare
(
audioConfig
);
testAudioRecorder
.
prepare
(
audioConfig
);
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoDecoder/Test.json
浏览文件 @
5cf431dd
...
@@ -4,35 +4,36 @@
...
@@ -4,35 +4,36 @@
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.video.videodecoder"
,
"package"
:
"ohos.acts.multimedia.video.videodecoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"test-file-name"
:
[
"ActsVideoDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
{
"type"
:
"PushKit"
,
"type"
:
"PushKit"
,
"pre-push"
:
[
"pre-push"
:
[
],
],
"push"
:
[
"push"
:
[
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
"
,
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
,
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
"
,
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
,
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
"
,
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
,
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
"
,
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
,
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
"
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
]
]
},
},
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/"
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder"
,
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/*"
],
],
"teardown-command"
:[
"teardown-command"
:[
]
]
},
{
"test-file-name"
:
[
"ActsVideoDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
}
]
]
}
}
\ No newline at end of file
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
浏览文件 @
5cf431dd
...
@@ -33,7 +33,7 @@ describe('VideoDecoderEnum', function () {
...
@@ -33,7 +33,7 @@ describe('VideoDecoderEnum', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
let
ES_FRAME_SIZE
=
[];
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_60FPS_320
=
const
H264_FRAME_SIZE_60FPS_320
=
[
2106
,
11465
];
[
2106
,
11465
];
...
@@ -167,7 +167,7 @@ describe('VideoDecoderEnum', function () {
...
@@ -167,7 +167,7 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
in case: setParameter success
'
);
console
.
info
(
'
in case: setParameter success
'
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -183,7 +183,7 @@ describe('VideoDecoderEnum', function () {
...
@@ -183,7 +183,7 @@ describe('VideoDecoderEnum', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
await
videoDecodeProcessor
.
releaseOutput
(
outputObject
,
true
).
then
(()
=>
{
await
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -191,7 +191,7 @@ describe('VideoDecoderEnum', function () {
...
@@ -191,7 +191,7 @@ describe('VideoDecoderEnum', function () {
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
expect
(
inBuffer
.
index
!==
undefined
).
assertTrue
();
expect
(
inBuffer
.
index
!==
undefined
).
assertTrue
();
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
expect
(
inBuffer
.
data
!==
undefined
).
assertTrue
();
expect
(
inBuffer
.
data
!==
undefined
).
assertTrue
();
...
@@ -208,7 +208,7 @@ describe('VideoDecoderEnum', function () {
...
@@ -208,7 +208,7 @@ describe('VideoDecoderEnum', function () {
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
...
@@ -223,7 +223,7 @@ describe('VideoDecoderEnum', function () {
...
@@ -223,7 +223,7 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
in case: err.code is
'
+
err
.
code
);
console
.
info
(
'
in case: err.code is
'
+
err
.
code
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
console
.
info
(
'
in case: setCallback out
'
);
console
.
info
(
'
in case: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
let
ES_FRAME_SIZE
=
[];
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_60FPS_320
=
const
H264_FRAME_SIZE_60FPS_320
=
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
...
@@ -209,7 +209,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -209,7 +209,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
in case: setParameter success
'
);
console
.
info
(
'
in case: setParameter success
'
);
});
});
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
}
else
{
}
else
{
...
@@ -229,7 +229,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -229,7 +229,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
(
err
)
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
}
else
{
}
else
{
...
@@ -241,13 +241,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -241,13 +241,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
enqueueInputs
();
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
videoDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
videoDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
expect
(
err
).
assertUndefined
();
expect
(
err
).
assertUndefined
();
...
@@ -261,7 +261,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -261,7 +261,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
console
.
info
(
'
in case: setCallback out
'
);
console
.
info
(
'
in case: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
let
ES_FRAME_SIZE
=
[];
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_60FPS_320
=
const
H264_FRAME_SIZE_60FPS_320
=
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
...
@@ -219,7 +219,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -219,7 +219,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
in case: setParameter success
'
);
console
.
info
(
'
in case: setParameter success
'
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -235,7 +235,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -235,7 +235,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
await
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
await
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -243,13 +243,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -243,13 +243,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
...
@@ -262,7 +262,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -262,7 +262,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
console
.
info
(
'
in case: setCallback out
'
);
console
.
info
(
'
in case: setCallback out
'
);
...
@@ -437,8 +437,8 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -437,8 +437,8 @@ describe('VideoDecoderFuncPromiseTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100
* @tc.number : SUB_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100
* @tc.name : 001.creat
16 video decoder
* @tc.name : 001.creat
multiple video decoders
* @tc.desc : creat
16 video decoder
* @tc.desc : creat
multiple video decoders
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.type : Function test
* @tc.level : Level0
* @tc.level : Level0
...
@@ -458,7 +458,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -458,7 +458,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
}
let
array
=
new
Array
();
let
array
=
new
Array
();
eventEmitter
.
on
(
'
releaseAllDecoder
'
,
async
()
=>
{
eventEmitter
.
on
(
'
releaseAllDecoder
'
,
async
()
=>
{
for
(
let
j
=
0
;
j
<
15
;
j
++
)
{
for
(
let
j
=
0
;
j
<
3
;
j
++
)
{
await
array
[
j
].
release
().
then
(()
=>
{
await
array
[
j
].
release
().
then
(()
=>
{
array
[
j
]
=
null
;
array
[
j
]
=
null
;
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
...
@@ -469,11 +469,11 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -469,11 +469,11 @@ describe('VideoDecoderFuncPromiseTest', function () {
videoDecodeProcessor
=
null
;
videoDecodeProcessor
=
null
;
done
();
done
();
})
})
for
(
let
i
=
0
;
i
<
16
;
i
++
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
await
media
.
createVideoDecoderByMime
(
'
video/avc
'
).
then
((
processor
)
=>
{
await
media
.
createVideoDecoderByMime
(
'
video/avc
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
'
in case : createVideoDecoderByMime success
'
);
console
.
info
(
'
in case : createVideoDecoderByMime success
'
);
if
(
i
==
15
)
{
if
(
i
==
2
)
{
videoDecodeProcessor
=
processor
;
videoDecodeProcessor
=
processor
;
}
else
{
}
else
{
array
[
i
]
=
processor
;
array
[
i
]
=
processor
;
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -46,7 +46,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -46,7 +46,7 @@ describe('VideoDecoderReliCallbackTest', function () {
let
inputEosFlag
=
false
;
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
let
mediaDescription
=
{
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
track_type
'
:
1
,
...
@@ -197,7 +197,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -197,7 +197,7 @@ describe('VideoDecoderReliCallbackTest', function () {
}
else
{
}
else
{
inputObject
.
flags
=
4
;
inputObject
.
flags
=
4
;
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
})
})
}
}
...
@@ -215,7 +215,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -215,7 +215,7 @@ describe('VideoDecoderReliCallbackTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
})
})
}
}
...
@@ -397,13 +397,13 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -397,13 +397,13 @@ describe('VideoDecoderReliCallbackTest', function () {
}
}
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
await
dequeueOutputs
(
nextStep
);
...
@@ -413,7 +413,7 @@ describe('VideoDecoderReliCallbackTest', function () {
...
@@ -413,7 +413,7 @@ describe('VideoDecoderReliCallbackTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
}
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -46,7 +46,7 @@ describe('VideoDecoderReliPromiseTest', function () {
...
@@ -46,7 +46,7 @@ describe('VideoDecoderReliPromiseTest', function () {
let
inputEosFlag
=
false
;
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
let
mediaDescription
=
{
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
track_type
'
:
1
,
...
@@ -202,7 +202,7 @@ describe('VideoDecoderReliPromiseTest', function () {
...
@@ -202,7 +202,7 @@ describe('VideoDecoderReliPromiseTest', function () {
}
else
{
}
else
{
inputObject
.
flags
=
4
;
inputObject
.
flags
=
4
;
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
},
caseCallback
).
catch
(
failCatch
);
},
caseCallback
).
catch
(
failCatch
);
}
}
...
@@ -221,7 +221,7 @@ describe('VideoDecoderReliPromiseTest', function () {
...
@@ -221,7 +221,7 @@ describe('VideoDecoderReliPromiseTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
in case: release output success
'
);
console
.
info
(
'
in case: release output success
'
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
caseCallback
).
catch
(
failCatch
);
},
caseCallback
).
catch
(
failCatch
);
...
@@ -394,13 +394,13 @@ describe('VideoDecoderReliPromiseTest', function () {
...
@@ -394,13 +394,13 @@ describe('VideoDecoderReliPromiseTest', function () {
}
}
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
await
dequeueOutputs
(
nextStep
);
...
@@ -410,7 +410,7 @@ describe('VideoDecoderReliPromiseTest', function () {
...
@@ -410,7 +410,7 @@ describe('VideoDecoderReliPromiseTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,
(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,
(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
}
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
let
ES_FRAME_SIZE
=
[];
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_240
=
const
H264_FRAME_SIZE_240
=
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
...
@@ -213,7 +213,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -213,7 +213,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
else
{
}
else
{
inputObject
.
flags
=
4
;
inputObject
.
flags
=
4
;
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
...
@@ -234,7 +234,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -234,7 +234,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
(
err
)
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
}
else
{
}
else
{
...
@@ -246,13 +246,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -246,13 +246,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
enqueueInputs
();
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
dequeueOutputs
(
nextStep
);
dequeueOutputs
(
nextStep
);
...
@@ -262,7 +262,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
...
@@ -262,7 +262,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
console
.
info
(
'
in case: setCallback out
'
);
console
.
info
(
'
in case: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
let
ES_FRAME_SIZE
=
[];
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_240
=
const
H264_FRAME_SIZE_240
=
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
[
2106
,
11465
,
321
,
72
,
472
,
68
,
76
,
79
,
509
,
90
,
677
,
88
,
956
,
99
,
347
,
77
,
452
,
681
,
81
,
1263
,
94
,
106
,
97
,
...
@@ -215,7 +215,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -215,7 +215,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
else
{
}
else
{
inputObject
.
flags
=
4
;
inputObject
.
flags
=
4
;
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -231,7 +231,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -231,7 +231,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
await
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
await
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
},
failCallback
).
catch
(
failCatch
);
}
}
...
@@ -239,13 +239,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -239,13 +239,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
await
dequeueOutputs
(
nextStep
);
...
@@ -255,7 +255,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
...
@@ -255,7 +255,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
console
.
info
(
'
in case: setCallback out
'
);
console
.
info
(
'
in case: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
...
@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
let
inputEosFlag
=
false
;
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
let
mediaDescription
=
{
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
track_type
'
:
1
,
...
@@ -197,7 +197,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
...
@@ -197,7 +197,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
}
else
{
}
else
{
inputObject
.
flags
=
4
;
inputObject
.
flags
=
4
;
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
})
})
}
}
...
@@ -215,7 +215,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
...
@@ -215,7 +215,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
})
})
}
}
...
@@ -398,13 +398,13 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
...
@@ -398,13 +398,13 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
}
}
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
await
dequeueOutputs
(
nextStep
);
...
@@ -414,7 +414,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
...
@@ -414,7 +414,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
}
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
...
@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
let
inputEosFlag
=
false
;
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_320_240_10s.h264
'
;
let
mediaDescription
=
{
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
track_type
'
:
1
,
...
@@ -204,7 +204,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
...
@@ -204,7 +204,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
}
else
{
}
else
{
inputObject
.
flags
=
4
;
inputObject
.
flags
=
4
;
}
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
console
.
info
(
'
in case: queueInput success
'
);
},
caseCallback
).
catch
(
failCatch
);
},
caseCallback
).
catch
(
failCatch
);
}
}
...
@@ -223,7 +223,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
...
@@ -223,7 +223,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
return
;
return
;
}
}
frameCountOut
++
;
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
in case: release output success
'
);
console
.
info
(
'
in case: release output success
'
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
caseCallback
).
catch
(
failCatch
);
},
caseCallback
).
catch
(
failCatch
);
...
@@ -397,13 +397,13 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
...
@@ -397,13 +397,13 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
}
}
function
setCallback
(
nextStep
){
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
await
enqueueInputs
();
});
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
await
dequeueOutputs
(
nextStep
);
...
@@ -413,7 +413,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
...
@@ -413,7 +413,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoDecodeProcessor
.
on
(
'
outputFormat
Changed
'
,
(
format
)
=>
{
videoDecodeProcessor
.
on
(
'
stream
Changed
'
,
(
format
)
=>
{
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
console
.
info
(
'
in case: Output format changed:
'
+
format
.
toString
());
});
});
}
}
...
...
multimedia/media/media_js_standard/videoEncoder/Test.json
浏览文件 @
5cf431dd
...
@@ -4,9 +4,16 @@
...
@@ -4,9 +4,16 @@
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.video.videoencoder"
,
"package"
:
"ohos.acts.multimedia.video.videoencoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"test-file-name"
:
[
"ActsVideoEncoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
{
"type"
:
"PushKit"
,
"type"
:
"PushKit"
,
"pre-push"
:
[
"pre-push"
:
[
...
@@ -14,7 +21,7 @@
...
@@ -14,7 +21,7 @@
"push"
:
[
"push"
:
[
]
]
},
},
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results"
,
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results"
,
...
@@ -24,13 +31,6 @@
...
@@ -24,13 +31,6 @@
],
],
"teardown-command"
:[
"teardown-command"
:[
]
]
},
{
"test-file-name"
:
[
"ActsVideoEncoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
}
]
]
}
}
\ No newline at end of file
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
浏览文件 @
5cf431dd
...
@@ -122,7 +122,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
...
@@ -122,7 +122,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
console
.
info
(
'
not last frame, write data to file
'
);
console
.
info
(
'
not last frame, write data to file
'
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
).
then
(()
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -131,7 +131,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
...
@@ -131,7 +131,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
function
setCallback
(
path
,
nextStep
)
{
function
setCallback
(
path
,
nextStep
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outBuffer.flags:
'
+
outBuffer
.
flags
);
console
.
info
(
'
outBuffer.flags:
'
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
...
@@ -148,7 +148,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
...
@@ -148,7 +148,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
@@ -262,7 +262,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
...
@@ -262,7 +262,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_MULTIINSTANCE_0100
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_MULTIINSTANCE_0100
* @tc.name : 001.create
16 encoder
* @tc.name : 001.create
multiple encoders
* @tc.desc : basic encode function
* @tc.desc : basic encode function
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.type : Function test
...
@@ -284,7 +284,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
...
@@ -284,7 +284,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
let
array
=
new
Array
();
let
array
=
new
Array
();
eventEmitter
.
once
(
'
nextStep
'
,
async
()
=>
{
eventEmitter
.
once
(
'
nextStep
'
,
async
()
=>
{
for
(
let
j
=
1
;
j
<
16
;
j
++
)
{
for
(
let
j
=
1
;
j
<
3
;
j
++
)
{
await
array
[
j
].
release
().
then
(()
=>
{
await
array
[
j
].
release
().
then
(()
=>
{
console
.
info
(
"
case release encoder
"
+
j
);
console
.
info
(
"
case release encoder
"
+
j
);
array
[
j
]
=
null
;
array
[
j
]
=
null
;
...
@@ -303,11 +303,11 @@ describe('videoEncoderSoftwareMultiInstances', function () {
...
@@ -303,11 +303,11 @@ describe('videoEncoderSoftwareMultiInstances', function () {
toStartStream
();
toStartStream
();
await
toStart
();
await
toStart
();
}
}
for
(
let
i
=
1
;
i
<=
16
;
i
+=
1
)
{
for
(
let
i
=
1
;
i
<=
3
;
i
+=
1
)
{
await
media
.
createVideoEncoderByMime
(
mime
).
then
((
processor
)
=>
{
await
media
.
createVideoEncoderByMime
(
mime
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createVideoEncoder success:
"
+
i
);
console
.
info
(
"
case create createVideoEncoder success:
"
+
i
);
if
(
i
==
16
)
{
if
(
i
==
3
)
{
videoEncodeProcessor
=
processor
;
videoEncodeProcessor
=
processor
;
runCase
();
runCase
();
}
else
{
}
else
{
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -94,7 +94,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
...
@@ -94,7 +94,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
}
frameCountOut
++
;
frameCountOut
++
;
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
,
(
err
)
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case release output count:
'
+
frameCountOut
);
console
.
log
(
'
in case release output count:
'
+
frameCountOut
);
}
else
{
}
else
{
...
@@ -112,7 +112,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
...
@@ -112,7 +112,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
}
function
setCallback
(
path
,
nextStep
)
{
function
setCallback
(
path
,
nextStep
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
if
(
stopBuffer
==
false
)
{
if
(
stopBuffer
==
false
)
{
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
...
@@ -123,7 +123,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
...
@@ -123,7 +123,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
in case error called, errName is
'
+
err
);
console
.
info
(
'
in case error called, errName is
'
+
err
);
});
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
if
(
typeof
(
format
)
!=
undefined
)
{
if
(
typeof
(
format
)
!=
undefined
)
{
printDescription
(
format
);
printDescription
(
format
);
}
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -129,7 +129,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
...
@@ -129,7 +129,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
'
not last frame, write data to file
'
);
console
.
info
(
'
not last frame, write data to file
'
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
).
then
(()
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
});
});
}
}
...
@@ -138,7 +138,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
...
@@ -138,7 +138,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
function
setCallback
(
path
,
done
)
{
function
setCallback
(
path
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outBuffer.flags:
'
+
outBuffer
.
flags
);
console
.
info
(
'
outBuffer.flags:
'
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
...
@@ -155,7 +155,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
...
@@ -155,7 +155,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
浏览文件 @
5cf431dd
...
@@ -129,7 +129,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
...
@@ -129,7 +129,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
}
frameCountOut
++
;
frameCountOut
++
;
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
,
(
err
)
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
debug
(
'
in case release output count:
'
+
frameCountOut
);
console
.
debug
(
'
in case release output count:
'
+
frameCountOut
);
}
else
{
}
else
{
...
@@ -146,7 +146,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
...
@@ -146,7 +146,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
}
}
}
function
setCallback
(
path
,
nextStep
)
{
function
setCallback
(
path
,
nextStep
)
{
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
if
(
stopBuffer
==
false
)
{
if
(
stopBuffer
==
false
)
{
outputQueue
.
push
(
outBuffer
);
outputQueue
.
push
(
outBuffer
);
...
@@ -158,7 +158,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
...
@@ -158,7 +158,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,
(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,
(
format
)
=>
{
if
(
typeof
(
format
)
!=
undefined
)
{
if
(
typeof
(
format
)
!=
undefined
)
{
printDescription
(
format
);
printDescription
(
format
);
}
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
浏览文件 @
5cf431dd
...
@@ -246,7 +246,7 @@ describe('videoEncoderReliabilityPromise', function () {
...
@@ -246,7 +246,7 @@ describe('videoEncoderReliabilityPromise', function () {
}
else
{
}
else
{
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
console
.
info
(
"
write to file success
"
);
console
.
info
(
"
write to file success
"
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
).
then
(()
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
console
.
info
(
'
release output success
'
);
frameCountOut
++
;
frameCountOut
++
;
console
.
log
(
'
release output count:
'
+
frameCountOut
);
console
.
log
(
'
release output count:
'
+
frameCountOut
);
...
@@ -257,7 +257,7 @@ describe('videoEncoderReliabilityPromise', function () {
...
@@ -257,7 +257,7 @@ describe('videoEncoderReliabilityPromise', function () {
function
setCallback
(
path
,
done
)
{
function
setCallback
(
path
,
done
)
{
console
.
info
(
'
case callback
'
);
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outBuffer.flags :
'
+
outBuffer
.
flags
);
console
.
info
(
'
outBuffer.flags :
'
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
if
(
needGetMediaDes
)
{
...
@@ -274,7 +274,7 @@ describe('videoEncoderReliabilityPromise', function () {
...
@@ -274,7 +274,7 @@ describe('videoEncoderReliabilityPromise', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
case error called,errName is
'
+
err
);
console
.
info
(
'
case error called,errName is
'
+
err
);
});
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
console
.
info
(
'
Output format changed:
'
+
format
);
console
.
info
(
'
Output format changed:
'
+
format
);
});
});
}
}
...
...
multimedia/media/media_js_standard/videoPlayer/BUILD.gn
浏览文件 @
5cf431dd
# Copyright (C) 202
2
Huawei Device Co., Ltd.
# Copyright (C) 202
1
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
@@ -26,7 +26,7 @@ ohos_js_hap_suite("video_player_js_hap") {
...
@@ -26,7 +26,7 @@ ohos_js_hap_suite("video_player_js_hap") {
# "//third_party/libpng:libpng",
# "//third_party/libpng:libpng",
# ]
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoPlayerJsTest"
hap_name = "
Acts
VideoPlayerJsTest"
# part_name = "prebuilt_hap"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
# subsystem_name = "xts"
...
...
multimedia/media/media_js_standard/videoPlayer/Test.json
浏览文件 @
5cf431dd
...
@@ -7,6 +7,13 @@
...
@@ -7,6 +7,13 @@
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"test-file-name"
:
[
"ActsVideoPlayerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
{
"type"
:
"PushKit"
,
"type"
:
"PushKit"
,
"pre-push"
:
[
"pre-push"
:
[
...
@@ -15,19 +22,12 @@
...
@@ -15,19 +22,12 @@
"./resource/audio/H264_AAC.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoplayer/"
"./resource/audio/H264_AAC.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoplayer/"
]
]
},
},
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
],
],
"teardown-command"
:[
"teardown-command"
:[
]
]
},
{
"test-file-name"
:
[
"VideoPlayerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
}
]
]
}
}
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/app.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css
浏览文件 @
5cf431dd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container
{
.container
{
flex-direction
:
column
;
flex-direction
:
column
;
justify-content
:
center
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml
浏览文件 @
5cf431dd
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<div class="container">
<text class="title">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/BUILD.gn
浏览文件 @
5cf431dd
# Copyright (C) 202
2
Huawei Device Co., Ltd.
# Copyright (C) 202
1
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
@@ -24,7 +24,7 @@ ohos_js_hap_suite("video_recorder_js_hap") {
...
@@ -24,7 +24,7 @@ ohos_js_hap_suite("video_recorder_js_hap") {
# "//third_party/libpng:libpng",
# "//third_party/libpng:libpng",
# ]
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoRecorderJsTest"
hap_name = "
Acts
VideoRecorderJsTest"
# part_name = "prebuilt_hap"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
# subsystem_name = "xts"
...
...
multimedia/media/media_js_standard/videoRecorder/Test.json
浏览文件 @
5cf431dd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for videoRecorder Tests"
,
"description"
:
"Configuration for videoRecorder Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
1
000000"
,
"test-timeout"
:
"
2
000000"
,
"package"
:
"ohos.acts.multimedia.video.videorecorder"
,
"package"
:
"ohos.acts.multimedia.video.videorecorder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
},
},
{
{
"test-file-name"
:
[
"test-file-name"
:
[
"VideoRecorderJsTest.hap"
"
Acts
VideoRecorderJsTest.hap"
],
],
"type"
:
"AppInstallKit"
,
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
"cleanup-apps"
:
true
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css
浏览文件 @
5cf431dd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container
{
.container
{
flex-direction
:
column
;
flex-direction
:
column
;
justify-content
:
center
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml
浏览文件 @
5cf431dd
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<div class="container">
<text class="title">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -55,13 +55,13 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -55,13 +55,13 @@ describe('VideoRecorderFuncCallbackTest', function () {
videoFrameHeight
:
480
,
videoFrameHeight
:
480
,
videoFrameRate
:
10
videoFrameRate
:
10
}
}
//
orientationHint
0, 90, 180, 270
//
rotation
0, 90, 180, 270
let
videoConfig
=
{
let
videoConfig
=
{
audioSourceType
:
1
,
audioSourceType
:
1
,
videoSourceType
:
0
,
videoSourceType
:
0
,
profile
:
configFile
,
profile
:
configFile
,
url
:
'
file:///data/media/01.mp4
'
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxSize
:
100
,
maxDuration
:
500
maxDuration
:
500
...
@@ -81,7 +81,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -81,7 +81,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
videoSourceType
:
0
,
videoSourceType
:
0
,
profile
:
onlyVideoProfile
,
profile
:
onlyVideoProfile
,
url
:
'
file:///data/media/01.mp4
'
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxSize
:
100
,
maxDuration
:
500
maxDuration
:
500
...
@@ -728,7 +728,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -728,7 +728,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
* @tc.name : 19.
orientationHint
90 (callback)
* @tc.name : 19.
rotation
90 (callback)
* @tc.desc : Audio recordr control test
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -737,7 +737,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -737,7 +737,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
37.mp4
'
);
await
getFd
(
'
37.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
90
;
videoConfig
.
rotation
=
90
;
let
videoRecorder
=
null
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
...
@@ -746,7 +746,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -746,7 +746,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
* @tc.name : 20.
orientationHint
180 (callback)
* @tc.name : 20.
rotation
180 (callback)
* @tc.desc : Audio recordr control test
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -755,7 +755,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -755,7 +755,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
38.mp4
'
);
await
getFd
(
'
38.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
180
;
videoConfig
.
rotation
=
180
;
let
videoRecorder
=
null
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
...
@@ -763,7 +763,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -763,7 +763,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
* @tc.name : 21.
orientationHint
270 (callback)
* @tc.name : 21.
rotation
270 (callback)
* @tc.desc : Audio recordr control test
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -772,7 +772,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
...
@@ -772,7 +772,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
39.mp4
'
);
await
getFd
(
'
39.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
270
;
videoConfig
.
rotation
=
270
;
let
videoRecorder
=
null
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
浏览文件 @
5cf431dd
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -46,7 +46,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -46,7 +46,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoSourceType
:
0
,
videoSourceType
:
0
,
profile
:
configFile
,
profile
:
configFile
,
url
:
'
file:///data/media/01.mp4
'
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxSize
:
100
,
maxDuration
:
500
maxDuration
:
500
...
@@ -66,7 +66,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -66,7 +66,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoSourceType
:
0
,
videoSourceType
:
0
,
profile
:
onlyVideoProfile
,
profile
:
onlyVideoProfile
,
url
:
'
file:///data/media/01.mp4
'
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxSize
:
100
,
maxDuration
:
500
maxDuration
:
500
...
@@ -1263,7 +1263,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -1263,7 +1263,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900
* @tc.name : 19.
orientationHint
90 (promise)
* @tc.name : 19.
rotation
90 (promise)
* @tc.desc : Audio recordr control test
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -1275,7 +1275,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -1275,7 +1275,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
videoOutput
;
let
videoOutput
;
await
getFd
(
'
40.mp4
'
);
await
getFd
(
'
40.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
90
;
videoConfig
.
rotation
=
90
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
...
@@ -1312,7 +1312,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -1312,7 +1312,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000
* @tc.name : 20.
orientationHint
180 (promise)
* @tc.name : 20.
rotation
180 (promise)
* @tc.desc : Audio recordr control test
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -1324,7 +1324,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -1324,7 +1324,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
videoOutput
;
let
videoOutput
;
await
getFd
(
'
41.mp4
'
);
await
getFd
(
'
41.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
180
;
videoConfig
.
rotation
=
180
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
...
@@ -1361,7 +1361,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -1361,7 +1361,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100
* @tc.name : 21.
orientationHint
270 (promise)
* @tc.name : 21.
rotation
270 (promise)
* @tc.desc : Audio recordr control test
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -1373,7 +1373,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
...
@@ -1373,7 +1373,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
videoOutput
;
let
videoOutput
;
await
getFd
(
'
42.mp4
'
);
await
getFd
(
'
42.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
270
;
videoConfig
.
rotation
=
270
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录