Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fdfc1554
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
fdfc1554
编写于
3月 15, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2369 api modify
Merge pull request !2369 from ling990/ling990
上级
86c66bfb
58c8d301
变更
91
隐藏空白更改
内联
并排
Showing
91 changed file
with
433 addition
and
493 deletion
+433
-493
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/BUILD.gn
multimedia/media/media_js_standard/videoDecoder/BUILD.gn
+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/default/app.js
...media_js_standard/videoDecoder/src/main/js/default/app.js
+1
-1
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css
...ideoDecoder/src/main/js/default/pages/display/display.css
+15
-0
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml
...ideoDecoder/src/main/js/default/pages/display/display.hml
+15
-0
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js
...videoDecoder/src/main/js/default/pages/display/display.js
+1
-1
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css
...rd/videoDecoder/src/main/js/default/pages/index/index.css
+16
-1
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml
...rd/videoDecoder/src/main/js/default/pages/index/index.hml
+15
-0
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js
...ard/videoDecoder/src/main/js/default/pages/index/index.js
+1
-1
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js
...ia_js_standard/videoDecoder/src/main/js/test/List.test.js
+1
-1
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
...ideoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
...der/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
+12
-12
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
...der/src/main/js/test/VideoDecoderReliCallbackTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
+7
-7
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
+7
-7
multimedia/media/media_js_standard/videoEncoder/BUILD.gn
multimedia/media/media_js_standard/videoEncoder/BUILD.gn
+1
-1
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/default/app.js
...media_js_standard/videoEncoder/src/main/js/default/app.js
+1
-1
multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css
...rd/videoEncoder/src/main/js/default/pages/index/index.css
+15
-0
multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml
...rd/videoEncoder/src/main/js/default/pages/index/index.hml
+15
-0
multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js
...ard/videoEncoder/src/main/js/default/pages/index/index.js
+1
-1
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js
...ideoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js
+1
-1
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/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js
...der/src/main/js/test/VideoHardwareEncoderEnumTest.test.js
+1
-1
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
浏览文件 @
fdfc1554
...
...
@@ -4,9 +4,16 @@
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.audio.audiodecoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAudioDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[
...
...
@@ -19,7 +26,7 @@
"./resource/audio/audioDecode/vorbis.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/"
]
},
{
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results"
,
...
...
@@ -29,13 +36,6 @@
],
"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
浏览文件 @
fdfc1554
...
...
@@ -131,37 +131,9 @@ describe('AudioDecoderEnum', function () {
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.name : 00
4
.AVCodecType
* @tc.name : 00
3
.AVCodecType
* @tc.desc : Test Enumerate AVCodecType
* @tc.size : MediumTest
* @tc.type : Function test
...
...
@@ -177,7 +149,7 @@ describe('AudioDecoderEnum', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function test
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -134,7 +134,7 @@ describe('AudioDecoderFormatCallback', function () {
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
}
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
})
}
...
...
@@ -165,7 +165,7 @@ describe('AudioDecoderFormatCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
log
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
})
}
...
...
@@ -173,12 +173,12 @@ describe('AudioDecoderFormatCallback', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
"
inputBufferAvailable
"
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
"
outputBufferAvailable
"
);
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
...
@@ -193,7 +193,7 @@ describe('AudioDecoderFormatCallback', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -213,7 +213,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
aac_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -330,7 +330,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
aac_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -447,7 +447,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
flac_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -521,7 +521,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
flac_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -595,7 +595,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
mp3_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -656,7 +656,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
mp3_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -717,7 +717,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
vorbis_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -821,7 +821,7 @@ describe('AudioDecoderFormatCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
vorbis_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -144,7 +144,7 @@ describe('AudioDecoderFormatPromise', function () {
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
}
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
"
queueInput success
"
)
})
}
...
...
@@ -173,7 +173,7 @@ describe('AudioDecoderFormatPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
log
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
})
}
...
...
@@ -181,12 +181,12 @@ describe('AudioDecoderFormatPromise', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
"
inputBufferAvailable
"
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
"
outputBufferAvailable
"
);
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
...
@@ -200,7 +200,7 @@ describe('AudioDecoderFormatPromise', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -218,7 +218,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
aac_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -316,7 +316,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
aac_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -414,7 +414,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
flac_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -470,7 +470,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
flac_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -526,7 +526,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
mp3_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -567,7 +567,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
mp3_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -608,7 +608,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
vorbis_01.pcm
'
;
needGetMediaDes
=
true
;
...
...
@@ -693,7 +693,7 @@ describe('AudioDecoderFormatPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
vorbis_02.pcm
'
;
needGetMediaDes
=
true
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -384,7 +384,7 @@ describe('AudioDecoderFuncCallback', function () {
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
})
}
...
...
@@ -411,7 +411,7 @@ describe('AudioDecoderFuncCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
})
}
...
...
@@ -419,12 +419,12 @@ describe('AudioDecoderFuncCallback', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
){
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
...
@@ -440,7 +440,7 @@ describe('AudioDecoderFuncCallback', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -460,7 +460,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
workdoneAtEOS
=
true
;
needGetMediaDes
=
true
;
...
...
@@ -541,7 +541,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
eosframenum
=
500
;
workdoneAtEOS
=
true
;
...
...
@@ -612,7 +612,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
workdoneAtEOS
=
true
;
let
savepath
=
BASIC_PATH
+
'
0200.pcm
'
;
...
...
@@ -678,7 +678,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
eosframenum
=
200
;
flushAtEOS
=
true
;
...
...
@@ -737,7 +737,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0400.pcm
'
;
eventEmitter
.
on
(
'
getAudioDecoderCaps
'
,
()
=>
{
...
...
@@ -819,7 +819,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
eosframenum
=
200
;
let
savepath
=
BASIC_PATH
+
'
0500.pcm
'
;
...
...
@@ -898,7 +898,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
eosframenum
=
200
;
resetAtEOS
=
true
;
...
...
@@ -906,7 +906,7 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
16000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
hasreconfigured
=
false
;
eventEmitter
.
on
(
'
getAudioDecoderCaps
'
,
()
=>
{
...
...
@@ -996,12 +996,12 @@ describe('AudioDecoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
hasrecreate
=
false
;
eosframenum
=
200
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -380,7 +380,7 @@ describe('AudioDecoderFuncPromise', function () {
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
});
}
...
...
@@ -409,7 +409,7 @@ describe('AudioDecoderFuncPromise', function () {
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -417,12 +417,12 @@ describe('AudioDecoderFuncPromise', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
"
outputbuffer.flags:
"
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
...
...
@@ -437,7 +437,7 @@ describe('AudioDecoderFuncPromise', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -455,7 +455,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0000.pcm
'
;
workdoneAtEOS
=
true
;
...
...
@@ -513,7 +513,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0100.pcm
'
;
eosframenum
=
500
;
...
...
@@ -553,7 +553,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0200.pcm
'
;
workdoneAtEOS
=
true
;
...
...
@@ -598,7 +598,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0300.pcm
'
;
eosframenum
=
200
;
...
...
@@ -637,7 +637,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0400.pcm
'
;
await
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
...
@@ -687,7 +687,7 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0500.pcm
'
;
eosframenum
=
200
;
...
...
@@ -741,12 +741,12 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
16000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0600.pcm
'
;
eosframenum
=
200
;
...
...
@@ -818,12 +818,12 @@ describe('AudioDecoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
}
let
savepath
=
BASIC_PATH
+
'
0700.pcm
'
;
eosframenum
=
200
;
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -173,7 +173,7 @@ describe('AudioDecoderMultiInstances', function () {
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
});
}
...
...
@@ -202,7 +202,7 @@ describe('AudioDecoderMultiInstances', function () {
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -210,12 +210,12 @@ describe('AudioDecoderMultiInstances', function () {
function
setCallback
(
audioDecodeProcessor
,
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
audioDecodeProcessor
,
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
"
outputbuffer.flags:
"
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
...
...
@@ -230,14 +230,14 @@ describe('AudioDecoderMultiInstances', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
/* *
* @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.size : MediumTest
* @tc.type : Function test
...
...
@@ -246,7 +246,7 @@ describe('AudioDecoderMultiInstances', function () {
it
(
'
SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple instances
"
);
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
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createAudioDecoder success:
"
+
i
);
...
...
@@ -256,9 +256,8 @@ describe('AudioDecoderMultiInstances', function () {
}
},
failCallback
).
catch
(
failCatch
);
}
console
.
info
(
'
case has created 16 decoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
console
.
info
(
'
case has created multiple decoders
'
);
for
(
let
j
=
0
;
j
<
2
;
j
++
)
{
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset decoder
"
+
j
);
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -144,7 +144,7 @@ describe('AudioDecoderReliabilityCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
};
beforeAll
(
function
()
{
...
...
@@ -520,7 +520,7 @@ describe('AudioDecoderReliabilityCallback', function () {
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
})
}
...
...
@@ -541,7 +541,7 @@ describe('AudioDecoderReliabilityCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
})
}
...
...
@@ -549,12 +549,12 @@ describe('AudioDecoderReliabilityCallback', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
...
@@ -570,7 +570,7 @@ describe('AudioDecoderReliabilityCallback', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -145,7 +145,7 @@ describe('AudioDecoderReliabilityPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
2
,
"
sample_rate
"
:
44100
,
"
audio_
raw_format
"
:
4
,
"
audio_
sample_format
"
:
1
,
};
let
expectError
=
false
;
...
...
@@ -522,7 +522,7 @@ describe('AudioDecoderReliabilityPromise', function () {
}
timestamp
+=
ES
[
frameCnt
]
/
samplerate
;
frameCnt
+=
1
;
audioDecodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioDecodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
});
}
...
...
@@ -544,7 +544,7 @@ describe('AudioDecoderReliabilityPromise', function () {
writeFile
(
savapath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioDecodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioDecodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -552,12 +552,12 @@ describe('AudioDecoderReliabilityPromise', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
audioDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
...
@@ -571,7 +571,7 @@ describe('AudioDecoderReliabilityPromise', function () {
audioDecodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
multimedia/media/media_js_standard/audioEncoder/Test.json
浏览文件 @
fdfc1554
...
...
@@ -4,9 +4,16 @@
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.audio.audioencoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAudioEncoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[
...
...
@@ -16,7 +23,7 @@
"./resource/audio/audioEncode/S32LE_2.pcm ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/"
]
},
{
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results"
,
...
...
@@ -26,13 +33,6 @@
],
"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
浏览文件 @
fdfc1554
...
...
@@ -224,7 +224,7 @@ describe('AudioEncoderFuncCallback', function () {
}
timestamp
+=
23
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
})
}
...
...
@@ -252,7 +252,7 @@ describe('AudioEncoderFuncCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
})
}
...
...
@@ -260,12 +260,12 @@ describe('AudioEncoderFuncCallback', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
case inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
case outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
...
@@ -281,7 +281,7 @@ describe('AudioEncoderFuncCallback', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -301,7 +301,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
mediaDescription2
=
{
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
...
...
@@ -384,7 +384,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
callback0100.es
'
;
eosframenum
=
500
;
...
...
@@ -442,7 +442,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
callback0200.es
'
;
workdoneAtEOS
=
true
;
...
...
@@ -508,7 +508,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
callback0300.es
'
;
eosframenum
=
500
;
...
...
@@ -566,7 +566,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
callback0400.es
'
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
@@ -648,7 +648,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
callback0500.es
'
;
eosframenum
=
100
;
...
...
@@ -727,7 +727,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
callback0600.es
'
;
eosframenum
=
100
;
...
...
@@ -735,7 +735,7 @@ describe('AudioEncoderFuncCallback', function () {
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
hasreconfigured
=
false
;
eventEmitter
.
on
(
'
getAudioEncoderCaps
'
,
()
=>
{
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -231,7 +231,7 @@ describe('AudioEncoderFuncPromise', function () {
}
timestamp
+=
23
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
});
}
...
...
@@ -260,7 +260,7 @@ describe('AudioEncoderFuncPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -268,12 +268,12 @@ describe('AudioEncoderFuncPromise', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
(
inputQueue
);
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needgetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
...
@@ -288,7 +288,7 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -306,7 +306,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
mediaDescription2
=
{
"
codec_mime
"
:
'
audio/mp4a-latm
'
,
...
...
@@ -371,7 +371,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
0100.es
'
;
eosframenum
=
500
;
...
...
@@ -410,7 +410,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
0200.es
'
;
workdoneAtEOS
=
true
;
...
...
@@ -455,7 +455,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
0300.es
'
;
eosframenum
=
500
;
...
...
@@ -494,7 +494,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
0400.es
'
;
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
...
...
@@ -544,7 +544,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
0500.es
'
;
eosframenum
=
100
;
...
...
@@ -598,7 +598,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
let
savepath
=
BASIC_PATH
+
'
0600.es
'
;
eosframenum
=
100
;
...
...
@@ -625,7 +625,7 @@ describe('AudioEncoderFuncPromise', function () {
let
mediaDescription2
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
}
await
sleep
(
10000
).
then
(()
=>
{
console
.
info
(
"
start configure 2
"
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -218,7 +218,7 @@ describe('AudioEncoderFuncPromise', function () {
}
timestamp
+=
23
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
});
}
...
...
@@ -247,7 +247,7 @@ describe('AudioEncoderFuncPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -255,12 +255,12 @@ describe('AudioEncoderFuncPromise', function () {
function
setCallback
(
audioEncodeProcessor
,
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
(
audioEncodeProcessor
,
inputQueue
);
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needgetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
...
@@ -275,14 +275,14 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
/* *
* @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.size : MediumTest
* @tc.type : Function test
...
...
@@ -291,7 +291,7 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple encoder instances
"
);
let
array
=
new
Array
();
for
(
let
i
=
0
;
i
<
16
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
2
;
i
+=
1
)
{
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createAudioEncoder success:
"
+
i
);
...
...
@@ -301,9 +301,8 @@ describe('AudioEncoderFuncPromise', function () {
}
},
failCallback
).
catch
(
failCatch
);
}
console
.
info
(
'
case has created 16 encoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
console
.
info
(
'
case has created multiple encoders
'
);
for
(
let
j
=
0
;
j
<
2
;
j
++
)
{
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset encoder
"
+
j
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -56,7 +56,7 @@ describe('AudioEncoderSTTCallback', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
};
beforeAll
(
function
()
{
...
...
@@ -368,7 +368,7 @@ describe('AudioEncoderSTTCallback', function () {
}
timestamp
+=
23
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
,
()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
,
()
=>
{
console
.
info
(
'
queueInput success
'
);
})
}
...
...
@@ -390,7 +390,7 @@ describe('AudioEncoderSTTCallback', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
,
()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
,
()
=>
{
console
.
info
(
'
release output success
'
);
})
}
...
...
@@ -398,12 +398,12 @@ describe('AudioEncoderSTTCallback', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
case inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueAllInputs
(
inputQueue
);
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
case outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
...
...
@@ -419,7 +419,7 @@ describe('AudioEncoderSTTCallback', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -56,7 +56,7 @@ describe('AudioEncoderSTTPromise', function () {
let
mediaDescription
=
{
"
channel_count
"
:
1
,
"
sample_rate
"
:
48000
,
"
audio_
raw_format
"
:
16
,
"
audio_
sample_format
"
:
3
,
};
let
expectError
=
false
;
...
...
@@ -372,7 +372,7 @@ describe('AudioEncoderSTTPromise', function () {
}
timestamp
+=
23
;
frameCnt
+=
1
;
audioEncodeProcessor
.
queueInput
(
inputobject
).
then
(()
=>
{
audioEncodeProcessor
.
pushInputData
(
inputobject
).
then
(()
=>
{
console
.
info
(
'
case queueInput success
'
);
});
}
...
...
@@ -395,7 +395,7 @@ describe('AudioEncoderSTTPromise', function () {
writeFile
(
savepath
,
outputobject
.
data
,
outputobject
.
length
);
console
.
info
(
"
write to file success
"
);
}
audioEncodeProcessor
.
releaseOutput
(
outputobject
).
then
(()
=>
{
audioEncodeProcessor
.
freeOutputBuffer
(
outputobject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -403,12 +403,12 @@ describe('AudioEncoderSTTPromise', function () {
function
setCallback
(
savepath
,
done
)
{
console
.
info
(
'
case callback
'
);
audioEncodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
inputBufferAvailable
'
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
(
inputQueue
);
});
audioEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
audioEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
needGetMediaDes
)
{
audioEncodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
...
...
@@ -423,7 +423,7 @@ describe('AudioEncoderSTTPromise', function () {
audioEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
multimedia/media/media_js_standard/audioPlayer/BUILD.gn
浏览文件 @
fdfc1554
# 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");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/Test.json
浏览文件 @
fdfc1554
...
...
@@ -2,11 +2,18 @@
"description"
:
"Configuration for audioPlayer Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
12
0000"
,
"test-timeout"
:
"
200
0000"
,
"package"
:
"ohos.acts.multimedia.audio.audioplayer"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAudioPlayerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[
...
...
@@ -44,13 +51,6 @@
],
"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
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* 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
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css
浏览文件 @
fdfc1554
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/BUILD.gn
浏览文件 @
fdfc1554
# 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");
# you may not use this file except in compliance with the License.
# 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
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* 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
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css
浏览文件 @
fdfc1554
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -216,9 +216,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.level : Level2
*/
it
(
'
SUB_MEDIA_RECORDER_createAudioRecorder_API_0100
'
,
0
,
async
function
(
done
)
{
audioConfig
.
uri
=
fdPath
;
let
testAudioRecorder
;
expect
(
testAudioRecorder
).
assertNull
();
let
testAudioRecorder
=
undefined
;
testAudioRecorder
=
media
.
createAudioRecorder
();
expect
(
testAudioRecorder
!=
undefined
).
assertTrue
();
done
();
...
...
@@ -233,6 +231,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.level : Level2
*/
it
(
'
SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100
'
,
0
,
async
function
(
done
)
{
audioConfig
.
uri
=
fdPath
;
let
testAudioRecorder
=
media
.
createAudioRecorder
();
expect
(
testAudioRecorder
!=
null
).
assertTrue
();
testAudioRecorder
.
prepare
(
audioConfig
);
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoDecoder/BUILD.gn
浏览文件 @
fdfc1554
# Copyright (C) 202
1
Huawei Device Co., Ltd.
# Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoDecoder/Test.json
浏览文件 @
fdfc1554
...
...
@@ -4,35 +4,36 @@
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.video.videodecoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsVideoDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-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/h263_1408_1152.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/
shared/
"
,
"./resource/media/es/mpeg4_320_240.es ->/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/
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/"
,
"./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/"
,
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
]
},
{
{
"type"
:
"ShellKit"
,
"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"
:[
]
},
{
"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/default/app.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css
浏览文件 @
fdfc1554
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css
浏览文件 @
fdfc1554
.container
{
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -33,7 +33,7 @@ describe('VideoDecoderEnum', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
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
=
[];
const
H264_FRAME_SIZE_60FPS_320
=
[
2106
,
11465
];
...
...
@@ -167,7 +167,7 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
in case: setParameter success
'
);
},
failCallback
).
catch
(
failCatch
);
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
}
...
...
@@ -183,7 +183,7 @@ describe('VideoDecoderEnum', function () {
return
;
}
frameCountOut
++
;
await
videoDecodeProcessor
.
releaseOutput
(
outputObject
,
true
).
then
(()
=>
{
await
videoDecodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
}
...
...
@@ -191,7 +191,7 @@ describe('VideoDecoderEnum', function () {
function
setCallback
(
nextStep
){
console
.
info
(
'
in case: setCallback in
'
);
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
expect
(
inBuffer
.
index
!==
undefined
).
assertTrue
();
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
expect
(
inBuffer
.
data
!==
undefined
).
assertTrue
();
...
...
@@ -208,7 +208,7 @@ describe('VideoDecoderEnum', function () {
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
...
...
@@ -223,7 +223,7 @@ describe('VideoDecoderEnum', function () {
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: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
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
=
[];
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
,
...
...
@@ -209,7 +209,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
in case: setParameter success
'
);
});
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
info
(
'
in case: queueInput success
'
);
}
else
{
...
...
@@ -229,7 +229,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
(
err
)
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
}
else
{
...
...
@@ -241,13 +241,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
function
setCallback
(
nextStep
){
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
);
inputQueue
.
push
(
inBuffer
);
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
videoDecodeProcessor
.
getOutputMediaDescription
((
err
,
MediaDescription
)
=>
{
expect
(
err
).
assertUndefined
();
...
...
@@ -261,7 +261,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
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: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
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
=
[];
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
,
...
...
@@ -219,7 +219,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
in case: setParameter success
'
);
},
failCallback
).
catch
(
failCatch
);
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
}
...
...
@@ -235,7 +235,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
return
;
}
frameCountOut
++
;
await
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
await
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
}
...
...
@@ -243,13 +243,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
function
setCallback
(
nextStep
){
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
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
videoDecodeProcessor
.
getOutputMediaDescription
().
then
((
MediaDescription
)
=>
{
console
.
info
(
'
get outputMediaDescription :
'
+
MediaDescription
);
...
...
@@ -262,7 +262,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
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: setCallback out
'
);
...
...
@@ -437,8 +437,8 @@ describe('VideoDecoderFuncPromiseTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100
* @tc.name : 001.creat
16 video decoder
* @tc.desc : creat
16 video decoder
* @tc.name : 001.creat
multiple video decoders
* @tc.desc : creat
multiple video decoders
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
...
...
@@ -458,7 +458,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
let
array
=
new
Array
();
eventEmitter
.
on
(
'
releaseAllDecoder
'
,
async
()
=>
{
for
(
let
j
=
0
;
j
<
15
;
j
++
)
{
for
(
let
j
=
0
;
j
<
3
;
j
++
)
{
await
array
[
j
].
release
().
then
(()
=>
{
array
[
j
]
=
null
;
},
failCallback
).
catch
(
failCatch
);
...
...
@@ -469,11 +469,11 @@ describe('VideoDecoderFuncPromiseTest', function () {
videoDecodeProcessor
=
null
;
done
();
})
for
(
let
i
=
0
;
i
<
16
;
i
++
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
await
media
.
createVideoDecoderByMime
(
'
video/avc
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
'
in case : createVideoDecoderByMime success
'
);
if
(
i
==
15
)
{
if
(
i
==
2
)
{
videoDecodeProcessor
=
processor
;
}
else
{
array
[
i
]
=
processor
;
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -46,7 +46,7 @@ describe('VideoDecoderReliCallbackTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
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
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
...
...
@@ -197,7 +197,7 @@ describe('VideoDecoderReliCallbackTest', function () {
}
else
{
inputObject
.
flags
=
4
;
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
console
.
info
(
'
in case: queueInput success
'
);
})
}
...
...
@@ -215,7 +215,7 @@ describe('VideoDecoderReliCallbackTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
})
}
...
...
@@ -397,13 +397,13 @@ describe('VideoDecoderReliCallbackTest', function () {
}
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
...
...
@@ -413,7 +413,7 @@ describe('VideoDecoderReliCallbackTest', function () {
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
());
});
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -46,7 +46,7 @@ describe('VideoDecoderReliPromiseTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
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
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
...
...
@@ -202,7 +202,7 @@ describe('VideoDecoderReliPromiseTest', function () {
}
else
{
inputObject
.
flags
=
4
;
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
},
caseCallback
).
catch
(
failCatch
);
}
...
...
@@ -221,7 +221,7 @@ describe('VideoDecoderReliPromiseTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
in case: release output success
'
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
caseCallback
).
catch
(
failCatch
);
...
...
@@ -394,13 +394,13 @@ describe('VideoDecoderReliPromiseTest', function () {
}
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
...
...
@@ -410,7 +410,7 @@ describe('VideoDecoderReliPromiseTest', function () {
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
());
});
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
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
=
[];
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
,
...
...
@@ -213,7 +213,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
}
else
{
inputObject
.
flags
=
4
;
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
info
(
'
in case: queueInput success
'
);
...
...
@@ -234,7 +234,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
(
err
)
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
}
else
{
...
...
@@ -246,13 +246,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
function
setCallback
(
nextStep
){
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
);
inputQueue
.
push
(
inBuffer
);
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
dequeueOutputs
(
nextStep
);
...
...
@@ -262,7 +262,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
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: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
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
=
[];
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
,
...
...
@@ -215,7 +215,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
else
{
inputObject
.
flags
=
4
;
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
},
failCallback
).
catch
(
failCatch
);
}
...
...
@@ -231,7 +231,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
return
;
}
frameCountOut
++
;
await
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
await
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
failCallback
).
catch
(
failCatch
);
}
...
...
@@ -239,13 +239,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
function
setCallback
(
nextStep
){
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
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
...
...
@@ -255,7 +255,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
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: setCallback out
'
);
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
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
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
...
...
@@ -197,7 +197,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
}
else
{
inputObject
.
flags
=
4
;
}
videoDecodeProcessor
.
queueInput
(
inputObject
,
(
err
)
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
,
(
err
)
=>
{
console
.
info
(
'
in case: queueInput success
'
);
})
}
...
...
@@ -215,7 +215,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
,
()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
,
()
=>
{
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
})
}
...
...
@@ -398,13 +398,13 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
}
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
...
...
@@ -414,7 +414,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
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
());
});
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
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
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
...
...
@@ -204,7 +204,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
}
else
{
inputObject
.
flags
=
4
;
}
videoDecodeProcessor
.
queueInput
(
inputObject
).
then
(()
=>
{
videoDecodeProcessor
.
pushInputData
(
inputObject
).
then
(()
=>
{
console
.
info
(
'
in case: queueInput success
'
);
},
caseCallback
).
catch
(
failCatch
);
}
...
...
@@ -223,7 +223,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
return
;
}
frameCountOut
++
;
videoDecodeProcessor
.
re
leaseOutput
(
outputObject
,
true
).
then
(()
=>
{
videoDecodeProcessor
.
re
nderOutputData
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
in case: release output success
'
);
console
.
log
(
'
in case: release output count:
'
+
frameCountOut
);
},
caseCallback
).
catch
(
failCatch
);
...
...
@@ -397,13 +397,13 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
}
function
setCallback
(
nextStep
){
videoDecodeProcessor
.
on
(
'
inputBufferAvailable
'
,
async
(
inBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
needInputData
'
,
async
(
inBuffer
)
=>
{
console
.
info
(
'
in case: inputBufferAvailable inBuffer.index:
'
+
inBuffer
.
index
);
inputQueue
.
push
(
inBuffer
);
await
enqueueInputs
();
});
videoDecodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoDecodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
outputQueue
.
push
(
outBuffer
);
await
dequeueOutputs
(
nextStep
);
...
...
@@ -413,7 +413,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
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
());
});
}
...
...
multimedia/media/media_js_standard/videoEncoder/BUILD.gn
浏览文件 @
fdfc1554
# Copyright (C) 202
1
Huawei Device Co., Ltd.
# Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoEncoder/Test.json
浏览文件 @
fdfc1554
...
...
@@ -4,9 +4,16 @@
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.video.videoencoder"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsVideoEncoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[
...
...
@@ -14,7 +21,7 @@
"push"
:
[
]
},
{
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results"
,
...
...
@@ -24,13 +31,6 @@
],
"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/default/app.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css
浏览文件 @
fdfc1554
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -122,7 +122,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
console
.
info
(
'
not last frame, write data to file
'
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
console
.
info
(
"
write to file success
"
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
).
then
(()
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -131,7 +131,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
function
setCallback
(
path
,
nextStep
)
{
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outBuffer.flags:
'
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
...
...
@@ -148,7 +148,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
@@ -262,7 +262,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function test
...
...
@@ -284,7 +284,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
let
array
=
new
Array
();
eventEmitter
.
once
(
'
nextStep
'
,
async
()
=>
{
for
(
let
j
=
1
;
j
<
16
;
j
++
)
{
for
(
let
j
=
1
;
j
<
3
;
j
++
)
{
await
array
[
j
].
release
().
then
(()
=>
{
console
.
info
(
"
case release encoder
"
+
j
);
array
[
j
]
=
null
;
...
...
@@ -303,11 +303,11 @@ describe('videoEncoderSoftwareMultiInstances', function () {
toStartStream
();
await
toStart
();
}
for
(
let
i
=
1
;
i
<=
16
;
i
+=
1
)
{
for
(
let
i
=
1
;
i
<=
3
;
i
+=
1
)
{
await
media
.
createVideoEncoderByMime
(
mime
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createVideoEncoder success:
"
+
i
);
if
(
i
==
16
)
{
if
(
i
==
3
)
{
videoEncodeProcessor
=
processor
;
runCase
();
}
else
{
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -94,7 +94,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
frameCountOut
++
;
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
,
(
err
)
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
log
(
'
in case release output count:
'
+
frameCountOut
);
}
else
{
...
...
@@ -112,7 +112,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
function
setCallback
(
path
,
nextStep
)
{
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
if
(
stopBuffer
==
false
)
{
outputQueue
.
push
(
outBuffer
);
...
...
@@ -123,7 +123,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
err
)
=>
{
console
.
info
(
'
in case error called, errName is
'
+
err
);
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,(
format
)
=>
{
if
(
typeof
(
format
)
!=
undefined
)
{
printDescription
(
format
);
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -129,7 +129,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
'
not last frame, write data to file
'
);
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
console
.
info
(
"
write to file success
"
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
).
then
(()
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
});
}
...
...
@@ -138,7 +138,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
function
setCallback
(
path
,
done
)
{
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outBuffer.flags:
'
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
...
...
@@ -155,7 +155,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -129,7 +129,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
frameCountOut
++
;
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
,
(
err
)
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
,
(
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
console
.
debug
(
'
in case release output count:
'
+
frameCountOut
);
}
else
{
...
...
@@ -146,7 +146,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
}
function
setCallback
(
path
,
nextStep
)
{
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
in case: outputBufferAvailable outBuffer.index:
'
+
outBuffer
.
index
);
if
(
stopBuffer
==
false
)
{
outputQueue
.
push
(
outBuffer
);
...
...
@@ -158,7 +158,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
console
.
info
(
'
in case: error called,errName is
'
+
err
);
});
videoEncodeProcessor
.
on
(
'
outputFormat
Changed
'
,
(
format
)
=>
{
videoEncodeProcessor
.
on
(
'
stream
Changed
'
,
(
format
)
=>
{
if
(
typeof
(
format
)
!=
undefined
)
{
printDescription
(
format
);
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
浏览文件 @
fdfc1554
...
...
@@ -246,7 +246,7 @@ describe('videoEncoderReliabilityPromise', function () {
}
else
{
writeFile
(
path
,
outputObject
.
data
,
outputObject
.
length
);
console
.
info
(
"
write to file success
"
);
videoEncodeProcessor
.
releaseOutput
(
outputObject
).
then
(()
=>
{
videoEncodeProcessor
.
freeOutputBuffer
(
outputObject
).
then
(()
=>
{
console
.
info
(
'
release output success
'
);
frameCountOut
++
;
console
.
log
(
'
release output count:
'
+
frameCountOut
);
...
...
@@ -257,7 +257,7 @@ describe('videoEncoderReliabilityPromise', function () {
function
setCallback
(
path
,
done
)
{
console
.
info
(
'
case callback
'
);
videoEncodeProcessor
.
on
(
'
outputBufferAvailable
'
,
async
(
outBuffer
)
=>
{
videoEncodeProcessor
.
on
(
'
newOutputData
'
,
async
(
outBuffer
)
=>
{
console
.
info
(
'
outputBufferAvailable
'
);
console
.
info
(
'
outBuffer.flags :
'
+
outBuffer
.
flags
);
if
(
needGetMediaDes
)
{
...
...
@@ -274,7 +274,7 @@ describe('videoEncoderReliabilityPromise', function () {
videoEncodeProcessor
.
on
(
'
error
'
,(
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
);
});
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js
浏览文件 @
fdfc1554
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
2
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
...
...
multimedia/media/media_js_standard/videoPlayer/BUILD.gn
浏览文件 @
fdfc1554
# 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");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -26,7 +26,7 @@ ohos_js_hap_suite("video_player_js_hap") {
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoPlayerJsTest"
hap_name = "
Acts
VideoPlayerJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
...
...
multimedia/media/media_js_standard/videoPlayer/Test.json
浏览文件 @
fdfc1554
...
...
@@ -7,6 +7,13 @@
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsVideoPlayerJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[
...
...
@@ -15,19 +22,12 @@
"./resource/audio/H264_AAC.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoplayer/"
]
},
{
{
"type"
:
"ShellKit"
,
"run-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
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css
浏览文件 @
fdfc1554
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
浏览文件 @
fdfc1554
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
浏览文件 @
fdfc1554
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
浏览文件 @
fdfc1554
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/BUILD.gn
浏览文件 @
fdfc1554
# 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");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -24,7 +24,7 @@ ohos_js_hap_suite("video_recorder_js_hap") {
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoRecorderJsTest"
hap_name = "
Acts
VideoRecorderJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
...
...
multimedia/media/media_js_standard/videoRecorder/Test.json
浏览文件 @
fdfc1554
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for videoRecorder Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
1
000000"
,
"test-timeout"
:
"
2
000000"
,
"package"
:
"ohos.acts.multimedia.video.videorecorder"
,
"shell-timeout"
:
"60000"
},
...
...
@@ -16,7 +16,7 @@
},
{
"test-file-name"
:
[
"VideoRecorderJsTest.hap"
"
Acts
VideoRecorderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css
浏览文件 @
fdfc1554
/*
* 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
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml
浏览文件 @
fdfc1554
<!--
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">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js
浏览文件 @
fdfc1554
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
浏览文件 @
fdfc1554
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
浏览文件 @
fdfc1554
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -55,13 +55,13 @@ describe('VideoRecorderFuncCallbackTest', function () {
videoFrameHeight
:
480
,
videoFrameRate
:
10
}
//
orientationHint
0, 90, 180, 270
//
rotation
0, 90, 180, 270
let
videoConfig
=
{
audioSourceType
:
1
,
videoSourceType
:
0
,
profile
:
configFile
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxDuration
:
500
...
...
@@ -81,7 +81,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
videoSourceType
:
0
,
profile
:
onlyVideoProfile
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxDuration
:
500
...
...
@@ -728,7 +728,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function
...
...
@@ -737,7 +737,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
37.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
90
;
videoConfig
.
rotation
=
90
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
...
...
@@ -746,7 +746,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function
...
...
@@ -755,7 +755,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
38.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
180
;
videoConfig
.
rotation
=
180
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
...
...
@@ -763,7 +763,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function
...
...
@@ -772,7 +772,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
39.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
270
;
videoConfig
.
rotation
=
270
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
浏览文件 @
fdfc1554
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -46,7 +46,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoSourceType
:
0
,
profile
:
configFile
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxDuration
:
500
...
...
@@ -66,7 +66,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoSourceType
:
0
,
profile
:
onlyVideoProfile
,
url
:
'
file:///data/media/01.mp4
'
,
orientationHint
:
0
,
rotation
:
0
,
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxDuration
:
500
...
...
@@ -1263,7 +1263,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function
...
...
@@ -1275,7 +1275,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
videoOutput
;
await
getFd
(
'
40.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
90
;
videoConfig
.
rotation
=
90
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
...
...
@@ -1312,7 +1312,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function
...
...
@@ -1324,7 +1324,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
videoOutput
;
await
getFd
(
'
41.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
180
;
videoConfig
.
rotation
=
180
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
...
...
@@ -1361,7 +1361,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
* @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.size : MediumTest
* @tc.type : Function
...
...
@@ -1373,7 +1373,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
videoOutput
;
await
getFd
(
'
42.mp4
'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
orientationHint
=
270
;
videoConfig
.
rotation
=
270
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录