diff --git a/multimedia/BUILD.gn b/multimedia/BUILD.gn index c811ae7ffda1a3819c516af77e32be61d11e090a..cc494a3ba0aabb80249797008d5eec89edc2ae07 100644 --- a/multimedia/BUILD.gn +++ b/multimedia/BUILD.gn @@ -40,7 +40,6 @@ group("multimedia") { "image/image_js_standard/imageYUV:image_yuv_js_hap", "image/image_js_standard/image_ndk_test:image_pixelmap_ndk_hap", "media/media_cpp_standard:ActsAvcodecNdkTest", - "media/media_cpp_standard:ActsAvcodecNdkTest", "media/media_js_standard/audioPlayer:audio_player_js_hap", "media/media_js_standard/audioRecorder:audio_recorder_js_hap", "media/media_js_standard/recorderFormat:recorder_format_js_hap", diff --git a/multimedia/media/media_js_standard/audioCodecFormat/BUILD.gn b/multimedia/media/media_js_standard/audioCodecFormat/BUILD.gn deleted file mode 100644 index dbf8d937bee7df900617b3120c02f44270415c14..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# 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 -# -# 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. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("audio_codec_format_js_hap") { - hap_profile = "./src/main/config.json" - js2abc = true - deps = [ - ":audio_codec_format_js_assets", - ":audio_codec_format_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAudioCodecFormatJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_player_framework" -} -ohos_js_assets("audio_codec_format_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("audio_codec_format_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/media/media_js_standard/audioCodecFormat/Test.json b/multimedia/media/media_js_standard/audioCodecFormat/Test.json deleted file mode 100644 index 74d3669dea700557b6dc43ac2a318ac9a8e177e2..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/Test.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "description": "Configuration for audio codec format Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "2000000", - "package": "ohos.acts.multimedia.audio.codecformat", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAudioCodecFormatJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "rm -rf /storage/media/100/local/files/*", - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/" - ], - "teardown-command":[ - ] - }, - { - "type": "PushKit", - "pre-push": [ - ], - "push": [ - "./resource/audio/codecFormat/HEv2_AAC_2_96000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_2_96000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_1_96000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_2_8000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_1_8000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_2_11025.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_1_11025.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_2_12000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_1_12000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_2_16000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_1_16000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_2_22050.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/LC_AAC_1_22050.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_1_24000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_2_24000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_1_32000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_2_32000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_1_44100.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_2_44100.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_1_48000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_2_48000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_1_64000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_2_64000.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_1_88200.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/HE_AAC_2_88200.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_96000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_8000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_8000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_11025.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_11025.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_12000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_12000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_16000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_22050.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_16000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_22050.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_24000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_24000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_32000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_32000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_44100.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_44100.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_48000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_48000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_64000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_64000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_88200.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_1_88200.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/FLAC_2_96000.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_96000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_96000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_8000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_12000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_16000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_22050.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_24000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_32000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_44100.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_48000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_64000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_1_88200.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_8000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_12000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_16000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_22050.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_24000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_32000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_44100.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_48000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_64000.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "./resource/audio/codecFormat/S16LE_2_88200.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/", - "chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.audio.codecformat/haps/entry/files/*", - "chmod 777 -R /storage/media/100/local/files/", - "chmod 777 /storage/media/100/local/files/*" - ], - "teardown-command":[ - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/audioCodecFormat/signature/openharmony_sx.p7b deleted file mode 100644 index 9cb0936d4cbbf5dab6e1d2fb4466d1fcb0c83964..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/audioCodecFormat/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/config.json b/multimedia/media/media_js_standard/audioCodecFormat/src/main/config.json deleted file mode 100644 index 751e465b8a6e893a1169853ef6518dbbf3d55912..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/config.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.audio.codecformat", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.audio.codecformat.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "standard" - } - ], - "deviceType": [ - "default", - "default", - "tablet", - "tv", - "wearable" - ], - "reqPermissions": [ - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.MEDIA_LOCATION", - "reason" : "use ohos.permission.MEDIA_LOCATION" - }, - { - "name" : "ohos.permission.READ_MEDIA", - "reason" : "use ohos.permission.READ_MEDIA" - }, - { - "name" : "ohos.permission.WRITE_MEDIA", - "reason" : "use ohos.permission.WRITE_MEDIA" - } - ], - "mainAbility": "ohos.acts.multimedia.audio.codecformat.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.audio.codecformat", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } - } \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/app.js b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/app.js deleted file mode 100644 index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 - * - * 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. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/i18n/en-US.json b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/i18n/zh-CN.json b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.css deleted file mode 100644 index 5bd7567028568bd522193b2519d545ca6dcf397d..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,46 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.js deleted file mode 100644 index 3a52b6658319c1999deb02385173eb5d6acd7008..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 600000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/AudioDecoderFormatCompatibilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/AudioDecoderFormatCompatibilityPromiseTest.test.js deleted file mode 100644 index ddaaa088faff62969d3153a42dd67bb9b5625839..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/AudioDecoderFormatCompatibilityPromiseTest.test.js +++ /dev/null @@ -1,2511 +0,0 @@ -/* - * 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 - * - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderFormatCompatibilityPromise', function () { - let audioDecodeProcessor; - let readStreamSync; - let needGetMediaDes = false; - let frameCnt = 1; - let timestamp = 0; - let codecProfile = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = []; - let NEW_ES_LIST = []; - let configList = []; - let ES_LIST = []; - let channelCountList = []; - let sampleRateList = []; - let ES_LENGTH = 0; - let ES_DICT = {}; - let rate = 44.1; - let isMp3 = false; - let isVorbis = false; - let readPath; - let fdRead; - let fdWrite; - let fileAssetWrite; - const LC_AAC_2_96000 = - [0, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512]; - const LC_AAC_1_96000 = - [0, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512]; - const LC_AAC_2_8000 = - [0, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536]; - const LC_AAC_1_8000 = - [0, 279, 279, 315, 433, 280, 257, 280, 270, 266, 334, 261, 242, 266, 274, 310, 345, 248, 248, 266, 292, 247, - 251, 260, 263, 330, 330, 245, 252, 272, 266, 280, 285, 272, 271, 346, 257, 272, 265, 268, 263, 337, - 255, 265, 276, 266, 272, 307, 271, 363, 251, 347, 232, 266, 250, 266, 254, 302, 285, 356, 264, 262, - 271, 276, 263, 303, 268, 348, 300, 242, 315, 306, 262, 235, 252, 318, 275, 250, 265, 323, 253, 263, - 254, 272, 279, 283, 287, 335, 257, 255, 257, 343, 255, 285, 265, 254, 273, 279, 283, 280, 264, 287, - 271, 256, 337, 270, 295, 261, 313, 273, 352, 252, 264, 253, 263, 260, 260, 269, 265, 312, 303, 312, - 255, 265, 281, 277, 278, 277, 255, 335, 262, 274, 294, 325, 247, 306, 236, 314, 257, 272, 264, 305, - 264, 267, 272, 341, 279, 251, 260, 285, 278, 269, 251, 362, 263, 276, 262, 276, 264, 291, 301, 279, - 267, 260, 292, 275, 258, 368, 245, 257, 264, 269, 277, 291, 282, 269, 274, 269, 263, 284, 302, 295, - 334, 269, 278, 258, 263, 260, 292, 281, 280, 255, 347, 251, 258, 272, 270, 265, 285, 263, 307, 263, - 281, 274, 311, 265, 273, 276, 277, 284, 288, 279, 270, 277, 292, 265, 264, 287, 285, 322, 260, 250, - 269, 352, 258, 267, 275, 263, 270, 273, 284, 279, 279, 285, 291, 337, 265, 305, 309, 291, 251, 241, - 252, 272, 270, 281, 319, 252, 267, 286, 320, 319, 298, 251, 284, 243, 259, 278, 282, 260, 331, 257, - 270, 322, 271, 251, 318, 246, 265, 263, 302, 269, 269, 274, 280, 286, 343, 244, 274, 251, 266, 282, - 268, 278, 277, 272, 323, 265, 287, 261, 270, 263, 301, 269, 276, 276, 283, 296, 292, 293, 298, 291, - 253, 267, 265, 295, 268, 301, 277, 347, 278, 309, 259, 315, 241, 289, 272, 297, 248, 245, 242, 264, - 288, 295, 360, 231, 296, 256, 257, 270, 267, 277, 362, 296, 231, 252, 253, 269, 307, 332, 242, 257, - 267, 271, 327, 359, 275, 269, 308, 291, 265, 259, 358, 239, 222, 246, 249, 260, 275, 267, 312, 269, - 267, 296, 345, 249, 248, 266, 271, 294, 309, 266, 263, 277, 275, 268, 309, 264, 271, 282, 275, 270, - 288, 268, 276, 280, 275, 273, 286, 264, 354, 279, 268, 261, 260, 356, 252, 242, 272, 280, 281, 307, - 252, 256, 279, 302, 275, 334, 255, 266, 285, 288, 278, 268, 266, 268, 271, 273, 274, 283, 275, 291, - 283, 308, 268, 273, 283, 342, 249, 267, 335, 310, 301, 231, 254, 249, 268, 280, 365, 231, 259, 262, - 321, 275, 244, 256, 262, 275, 341, 267, 279, 264, 310, 268, 281, 266, 287, 262, 266, 272, 282, 272, - 276, 350, 256, 332, 251, 253, 256, 294, 261, 293, 255, 322, 255, 258, 260, 351, 258, 267, 259, 259, - 277, 275, 275, 274, 274, 277, 283, 308, 285, 265, 278, 286, 307, 292, 276, 278, 277, 278, 291, 275, - 262, 273, 308, 254, 264, 259, 345, 249, 275, 265, 264, 272, 285, 274, 277, 274, 274, 287, 335, 260, - 269, 329, 324, 374, 278, 223, 238, 272, 245, 258, 317, 261, 265, 344, 308, 262, 273, 279, 268, 262, - 263, 258, 274, 269, 273, 278, 266, 277, 266, 324, 257, 258, 283, 279, 278, 289, 282, 283, 280, 272, - 280, 302, 270, 281, 279, 300, 260, 280, 279, 362, 257, 261, 263, 249, 278, 283, 265, 283, 286, 274, - 284, 274, 274, 277, 270, 257, 288, 273, 272, 286, 295, 278, 309, 284, 285, 336, 395, 229, 254, 258, - 314, 231, 245, 265, 265, 279, 278, 289, 301, 269, 254, 271, 294, 286, 263, 287, 321, 257, 263, 289, - 323, 267, 257, 280, 275, 271, 281, 282, 282, 286, 271, 266, 279, 308, 276, 318, 262, 261, 262, 339, - 260, 265, 285, 268, 263, 263, 271, 268, 281, 293, 279, 292, 266, 273, 281, 303, 289, 282, 285, 278, - 305, 262, 276, 268, 267, 269, 296, 272, 280, 264, 329, 312, 269, 250, 279, 251, 272, 293, 349, 238, - 281, 255, 324, 260, 275, 265, 271, 266, 288, 272, 275, 273, 294, 292, 308, 342, 267, 238, 275, 250, - 243, 356, 262, 260, 267, 274, 279, 261, 280, 289, 288, 342, 250, 256, 270, 267, 299, 323, 268, 289, - 255, 275, 271, 273, 265, 284, 272, 281, 275, 354, 252, 290, 262, 278, 254, 272, 255, 355, 259, 260, - 257, 282, 277, 267, 271, 358, 251, 266, 275, 260, 276, 276, 288, 277, 275, 278, 283, 278, 278, 285, - 273, 288, 283, 264, 306, 271, 291, 283, 317, 270, 270, 273, 279, 266, 269, 297, 310, 290, 279, 264]; - const LC_AAC_1_11025 = - [0, 279, 279, 324, 320, 436, 260, 245, 245, 267, 270, 269, 283, 342, 270, 258, 274, 272, 287, 272, 268, - 362, 255, 258, 251, 276, 281, 286, 261, 273, 275, 282, 286, 260, 299, 332, 261, 272, 260, 271, 353, - 249, 285, 300, 251, 252, 252, 256, 354, 257, 255, 261, 284, 285, 261, 283, 332, 263, 271, 268, 265, - 274, 278, 281, 299, 273, 283, 343, 254, 309, 318, 241, 268, 257, 253, 279, 263, 322, 248, 273, 345, - 251, 278, 273, 282, 275, 297, 272, 312, 260, 286, 325, 318, 292, 263, 231, 318, 296, 252, 233, 265, - 266, 263, 353, 251, 259, 270, 275, 290, 266, 277, 265, 258, 327, 262, 256, 283, 283, 272, 363, 260, - 248, 262, 261, 320, 257, 275, 280, 264, 280, 267, 285, 294, 278, 283, 281, 286, 279, 282, 331, 262, - 264, 342, 244, 262, 285, 271, 260, 302, 271, 275, 310, 267, 268, 288, 266, 263, 270, 258, 267, 275, - 268, 267, 295, 331, 300, 301, 267, 267, 281, 289, 282, 290, 268, 267, 269, 275, 342, 262, 280, 267, - 261, 269, 292, 271, 303, 255, 261, 332, 253, 271, 263, 273, 300, 265, 277, 264, 284, 306, 337, 273, - 257, 258, 272, 274, 339, 259, 257, 249, 256, 356, 267, 265, 291, 265, 312, 251, 271, 290, 270, 299, - 277, 271, 272, 270, 339, 275, 261, 336, 237, 252, 257, 290, 271, 270, 267, 280, 355, 254, 272, 287, - 263, 283, 262, 274, 259, 281, 329, 270, 276, 322, 263, 273, 275, 271, 273, 276, 270, 277, 283, 271, - 269, 267, 268, 357, 258, 258, 268, 278, 277, 267, 275, 296, 270, 289, 278, 272, 270, 283, 284, 338, - 257, 266, 279, 278, 268, 283, 281, 264, 289, 280, 299, 271, 268, 296, 274, 295, 262, 275, 271, 285, - 304, 287, 265, 258, 277, 273, 341, 255, 250, 278, 271, 269, 290, 266, 291, 281, 289, 281, 272, 288, - 300, 289, 321, 251, 274, 311, 297, 315, 277, 255, 248, 255, 253, 275, 258, 263, 281, 302, 315, 264, - 271, 260, 302, 395, 273, 270, 297, 227, 254, 310, 223, 248, 271, 270, 288, 278, 301, 334, 249, 255, - 332, 247, 261, 263, 281, 332, 251, 276, 274, 260, 282, 286, 267, 271, 282, 285, 287, 292, 264, 320, - 250, 283, 248, 259, 280, 291, 265, 328, 257, 274, 280, 277, 332, 262, 266, 272, 282, 279, 275, 277, - 271, 288, 281, 283, 277, 272, 282, 271, 324, 280, 268, 316, 283, 295, 259, 276, 286, 304, 260, 293, - 270, 262, 292, 270, 318, 271, 263, 288, 247, 288, 293, 265, 288, 253, 280, 288, 269, 266, 265, 260, - 277, 266, 280, 298, 280, 367, 245, 320, 247, 257, 268, 270, 269, 275, 282, 281, 331, 288, 254, 264, - 270, 261, 273, 273, 333, 290, 264, 256, 263, 277, 281, 268, 298, 319, 301, 282, 326, 300, 310, 270, - 281, 250, 265, 287, 267, 252, 254, 270, 260, 277, 260, 280, 279, 268, 300, 290, 272, 300, 289, 317, - 317, 231, 247, 273, 278, 279, 263, 298, 300, 260, 253, 273, 298, 282, 279, 280, 334, 252, 286, 264, - 264, 272, 260, 262, 281, 300, 264, 270, 280, 288, 278, 273, 295, 278, 263, 282, 358, 262, 272, 261, - 280, 254, 319, 261, 275, 264, 280, 286, 292, 284, 310, 278, 250, 263, 261, 288, 328, 281, 279, 319, - 250, 247, 257, 261, 294, 276, 300, 278, 272, 265, 266, 264, 323, 274, 271, 320, 273, 261, 304, 293, - 256, 301, 252, 274, 270, 285, 335, 268, 256, 277, 270, 307, 255, 282, 335, 251, 264, 275, 287, 290, - 264, 265, 373, 250, 246, 307, 249, 334, 254, 262, 244, 258, 263, 265, 279, 324, 288, 258, 299, 259, - 264, 295, 271, 315, 266, 265, 319, 259, 271, 308, 259, 303, 291, 278, 278, 245, 333, 259, 264, 306, - 289, 242, 245, 297, 283, 327, 251, 273, 319, 244, 290, 260, 262, 247, 272, 289, 293, 256, 265, 277, - 276, 272, 275, 273, 277, 294, 291, 269, 264, 264, 277, 283, 319, 292, 272, 273, 269, 292, 291, 291, - 282, 271, 278, 284, 273, 294, 265, 281, 258, 272, 279, 275, 276, 298, 282, 273, 276, 266, 302, 316, - 261, 274, 256, 274, 305, 270, 264, 278, 267, 308, 267, 271, 279, 284, 285, 290, 273, 268, 284, 359, - 330, 277, 292, 307, 229, 235, 246, 269, 272, 267, 279, 313, 265, 267, 261, 286, 311, 268, 272, 266, - 280, 278, 298, 261, 267, 289, 283, 282, 279, 271, 278, 282, 276, 278, 274, 272, 273, 277, 307, 274, - 277, 280, 290, 290, 279, 282, 267, 281, 278, 284, 275, 279, 289, 276, 289, 275, 274, 282, 265, 304]; - const LC_AAC_2_11025 = - [0, 372, 372, 418, 415, 558, 380, 385, 386, 401, 388, 381, 382, 453, 357, 350, 352, 377, 355, 361, 378, - 447, 359, 363, 387, 367, 346, 369, 353, 358, 371, 371, 369, 371, 396, 421, 344, 368, 359, 363, 467, - 338, 370, 384, 336, 348, 347, 360, 442, 332, 354, 359, 369, 350, 362, 370, 415, 354, 380, 383, 363, - 352, 354, 367, 380, 363, 384, 428, 365, 396, 427, 343, 359, 344, 346, 371, 367, 407, 366, 364, 445, - 347, 365, 341, 362, 368, 390, 361, 403, 357, 361, 448, 446, 394, 368, 349, 415, 403, 327, 327, 342, - 349, 348, 429, 347, 352, 354, 358, 385, 355, 362, 361, 352, 405, 361, 364, 358, 361, 356, 446, 373, - 350, 362, 351, 423, 356, 376, 376, 350, 364, 355, 364, 371, 361, 360, 365, 368, 381, 386, 421, 361, - 353, 462, 344, 353, 383, 368, 355, 398, 366, 377, 398, 360, 362, 385, 355, 363, 354, 344, 358, 368, - 360, 365, 375, 415, 389, 387, 365, 369, 359, 375, 382, 389, 363, 367, 370, 368, 439, 374, 367, 370, - 362, 361, 387, 358, 394, 353, 370, 420, 357, 364, 377, 362, 381, 366, 369, 357, 367, 384, 440, 376, - 344, 362, 358, 364, 426, 364, 347, 338, 351, 435, 359, 358, 382, 355, 396, 353, 356, 372, 352, 375, - 358, 364, 376, 372, 426, 380, 348, 451, 326, 348, 365, 374, 380, 361, 358, 366, 447, 356, 363, 390, - 352, 366, 374, 364, 346, 368, 407, 357, 374, 429, 358, 358, 368, 367, 366, 366, 354, 361, 373, 372, - 364, 370, 358, 446, 360, 362, 360, 345, 375, 367, 364, 375, 374, 391, 353, 378, 352, 379, 365, 435, - 365, 353, 363, 376, 363, 368, 383, 366, 367, 360, 387, 350, 370, 395, 379, 365, 385, 351, 362, 383, - 394, 398, 360, 353, 383, 354, 443, 357, 362, 367, 380, 370, 385, 365, 376, 383, 376, 375, 377, 383, - 383, 390, 406, 357, 369, 396, 388, 410, 376, 361, 337, 349, 363, 352, 354, 362, 362, 390, 409, 358, - 368, 353, 375, 488, 387, 383, 407, 336, 345, 390, 327, 336, 341, 345, 363, 357, 378, 439, 339, 355, - 430, 355, 340, 363, 357, 424, 341, 342, 377, 350, 366, 389, 356, 362, 374, 355, 374, 378, 362, 411, - 356, 384, 359, 352, 360, 370, 359, 418, 368, 355, 361, 365, 431, 359, 367, 376, 376, 380, 378, 379, - 375, 375, 382, 386, 381, 362, 383, 361, 404, 368, 369, 410, 374, 390, 360, 371, 373, 389, 356, 389, - 354, 365, 379, 365, 407, 342, 340, 377, 345, 383, 392, 361, 370, 355, 363, 387, 380, 348, 358, 360, - 351, 362, 368, 371, 358, 482, 353, 418, 352, 352, 363, 351, 355, 363, 362, 373, 437, 356, 375, 362, - 357, 380, 372, 366, 410, 382, 352, 377, 358, 367, 367, 363, 368, 425, 409, 395, 427, 384, 414, 377, - 389, 338, 347, 385, 366, 347, 337, 354, 366, 374, 359, 364, 362, 364, 376, 379, 354, 389, 370, 406, - 433, 356, 358, 350, 370, 362, 356, 391, 408, 344, 338, 348, 373, 381, 351, 361, 435, 346, 376, 341, - 361, 367, 356, 364, 366, 386, 355, 363, 370, 386, 361, 358, 380, 373, 368, 378, 454, 363, 370, 352, - 369, 346, 407, 359, 347, 364, 374, 367, 387, 377, 418, 391, 353, 363, 362, 365, 430, 378, 378, 413, - 354, 333, 357, 341, 382, 350, 376, 367, 352, 367, 371, 373, 392, 367, 372, 433, 366, 350, 393, 396, - 360, 386, 356, 367, 355, 364, 438, 363, 360, 369, 357, 406, 345, 365, 450, 352, 350, 352, 381, 383, - 335, 357, 488, 358, 354, 403, 338, 413, 343, 348, 360, 346, 369, 364, 371, 392, 377, 364, 376, 354, - 367, 367, 375, 414, 359, 360, 398, 373, 366, 388, 354, 378, 392, 379, 376, 351, 425, 349, 350, 385, - 385, 339, 354, 380, 378, 420, 349, 366, 418, 347, 401, 345, 352, 356, 350, 392, 381, 356, 356, 360, - 363, 360, 354, 358, 370, 363, 374, 364, 368, 362, 370, 366, 390, 378, 376, 374, 367, 380, 379, 385, - 384, 364, 369, 367, 375, 385, 358, 369, 362, 369, 360, 365, 367, 388, 361, 361, 363, 366, 391, 405, - 365, 377, 366, 367, 386, 367, 367, 371, 364, 387, 371, 360, 381, 369, 366, 384, 375, 369, 382, 435, - 436, 378, 408, 415, 338, 347, 347, 358, 361, 358, 346, 382, 352, 344, 361, 361, 394, 354, 350, 351, - 363, 361, 392, 362, 367, 382, 363, 376, 382, 362, 374, 382, 375, 369, 373, 370, 364, 374, 395, 374, - 375, 374, 373, 366, 375, 383, 376, 374, 382, 387, 373, 354, 374, 373, 375, 370, 375, 378, 365, 382]; - const LC_AAC_1_12000 = - [0, 279, 279, 330, 328, 373, 290, 266, 267, 260, 290, 266, 278, 287, 314, 255, 264, 271, 280, 282, 288, - 266, 343, 330, 229, 242, 252, 250, 265, 299, 272, 272, 277, 297, 285, 274, 270, 309, 296, 258, 272, - 282, 268, 329, 252, 269, 327, 244, 271, 266, 271, 264, 358, 258, 257, 260, 276, 274, 286, 272, 279, - 339, 261, 272, 265, 283, 272, 272, 271, 263, 282, 270, 322, 290, 285, 317, 312, 242, 276, 252, 272, - 290, 257, 255, 345, 254, 254, 340, 264, 254, 260, 271, 279, 315, 281, 273, 308, 249, 258, 363, 324, - 295, 261, 239, 303, 303, 234, 254, 242, 276, 274, 266, 349, 252, 263, 271, 266, 278, 339, 262, 254, - 260, 249, 279, 282, 285, 285, 276, 283, 356, 276, 256, 256, 295, 258, 335, 269, 272, 270, 265, 302, - 255, 269, 280, 282, 278, 279, 270, 289, 268, 286, 350, 277, 263, 245, 362, 248, 243, 345, 253, 241, - 299, 276, 257, 337, 257, 272, 271, 277, 283, 269, 258, 272, 269, 267, 255, 266, 266, 365, 273, 282, - 288, 276, 275, 282, 277, 284, 300, 279, 266, 264, 265, 330, 350, 263, 278, 243, 305, 257, 275, 256, - 261, 271, 256, 294, 319, 267, 265, 277, 267, 292, 264, 278, 261, 311, 294, 325, 320, 278, 246, 264, - 272, 296, 317, 258, 288, 233, 257, 328, 255, 255, 261, 276, 297, 289, 265, 272, 266, 280, 273, 263, - 264, 278, 272, 308, 352, 278, 260, 318, 247, 281, 256, 271, 274, 272, 276, 274, 318, 325, 255, 263, - 284, 260, 279, 255, 258, 268, 269, 325, 300, 281, 286, 335, 257, 272, 280, 270, 264, 264, 266, 284, - 275, 277, 278, 282, 252, 270, 343, 269, 255, 278, 277, 266, 278, 267, 297, 276, 279, 257, 300, 278, - 266, 280, 273, 279, 306, 273, 284, 274, 275, 283, 270, 278, 287, 291, 278, 280, 280, 270, 291, 277, - 272, 290, 267, 286, 330, 283, 283, 291, 260, 258, 257, 257, 299, 335, 250, 254, 270, 273, 284, 276, - 288, 285, 275, 287, 279, 275, 292, 289, 297, 286, 332, 267, 270, 312, 300, 291, 308, 279, 279, 249, - 229, 255, 259, 251, 256, 275, 281, 356, 277, 272, 269, 267, 309, 378, 280, 279, 272, 253, 235, 295, - 249, 251, 255, 264, 257, 282, 285, 275, 333, 254, 274, 315, 335, 239, 269, 260, 270, 300, 260, 269, - 274, 278, 311, 318, 305, 238, 293, 261, 261, 292, 295, 275, 332, 227, 251, 266, 260, 263, 263, 289, - 270, 333, 265, 267, 272, 295, 268, 346, 252, 264, 270, 279, 277, 273, 278, 273, 276, 279, 271, 287, - 281, 275, 272, 291, 325, 267, 272, 304, 296, 259, 297, 258, 296, 298, 308, 266, 298, 248, 277, 315, - 275, 241, 303, 265, 278, 261, 255, 329, 266, 263, 276, 273, 277, 280, 278, 267, 274, 260, 264, 269, - 263, 283, 295, 275, 282, 353, 319, 254, 260, 272, 274, 262, 266, 269, 287, 269, 345, 256, 275, 272, - 278, 264, 271, 282, 278, 325, 298, 255, 261, 256, 256, 274, 276, 291, 314, 351, 258, 285, 288, 263, - 327, 293, 274, 271, 264, 268, 297, 257, 247, 256, 268, 278, 284, 270, 271, 276, 269, 272, 314, 266, - 273, 308, 268, 295, 330, 250, 266, 258, 278, 365, 235, 264, 334, 246, 252, 267, 265, 301, 297, 278, - 271, 329, 234, 261, 320, 255, 265, 277, 270, 279, 279, 300, 258, 272, 276, 271, 282, 272, 270, 302, - 276, 269, 278, 340, 262, 278, 254, 265, 271, 263, 349, 265, 288, 262, 284, 265, 306, 283, 289, 294, - 256, 261, 277, 266, 273, 359, 276, 258, 310, 245, 263, 272, 253, 299, 317, 259, 298, 265, 264, 268, - 258, 268, 306, 310, 269, 294, 307, 247, 261, 334, 308, 251, 287, 234, 258, 274, 263, 333, 323, 256, - 253, 293, 264, 303, 255, 254, 300, 300, 257, 268, 279, 311, 283, 263, 258, 362, 248, 243, 271, 254, - 292, 329, 245, 262, 256, 258, 277, 280, 278, 281, 332, 266, 313, 267, 258, 278, 275, 275, 312, 268, - 261, 322, 267, 270, 295, 258, 308, 314, 293, 274, 264, 265, 325, 260, 260, 323, 332, 227, 234, 250, - 322, 306, 308, 269, 242, 314, 237, 271, 270, 276, 268, 259, 264, 314, 283, 250, 250, 262, 265, 270, - 289, 279, 286, 271, 293, 293, 274, 266, 275, 270, 279, 312, 279, 274, 270, 276, 271, 291, 297, 279, - 298, 268, 273, 279, 271, 285, 300, 271, 301, 259, 271, 263, 269, 283, 302, 270, 268, 278, 278, 270, - 320, 285, 265, 262, 279, 273, 300, 271, 282, 271, 269, 274, 304, 267, 283, 282, 266, 273, 315, 270]; - const LC_AAC_2_12000 = - [0, 372, 372, 424, 417, 433, 474, 385, 393, 398, 398, 381, 397, 396, 432, 343, 344, 359, 353, 363, 372, - 374, 422, 431, 342, 374, 359, 360, 332, 374, 347, 366, 366, 387, 374, 360, 384, 394, 380, 363, 359, - 361, 390, 416, 386, 347, 399, 346, 360, 364, 351, 362, 444, 349, 343, 358, 351, 348, 366, 368, 384, - 433, 356, 364, 380, 382, 365, 350, 368, 368, 373, 362, 410, 389, 369, 418, 425, 338, 372, 340, 344, - 405, 347, 357, 456, 359, 373, 429, 342, 348, 322, 358, 379, 390, 357, 360, 396, 349, 367, 442, 442, - 385, 355, 342, 422, 406, 341, 349, 340, 351, 343, 350, 425, 349, 363, 353, 361, 350, 411, 363, 349, - 362, 349, 361, 367, 374, 372, 371, 356, 443, 370, 362, 352, 416, 343, 431, 374, 358, 380, 353, 393, - 348, 355, 352, 360, 359, 362, 359, 366, 374, 382, 445, 395, 353, 360, 472, 333, 348, 436, 351, 369, - 386, 356, 343, 434, 356, 360, 359, 378, 368, 360, 354, 353, 363, 356, 358, 351, 362, 433, 362, 368, - 373, 362, 376, 368, 361, 375, 386, 366, 375, 366, 375, 410, 459, 371, 367, 350, 423, 368, 377, 357, - 341, 363, 353, 371, 394, 368, 374, 369, 373, 387, 357, 361, 348, 390, 405, 412, 415, 376, 353, 357, - 360, 383, 425, 342, 374, 319, 353, 415, 341, 355, 344, 376, 381, 387, 352, 347, 343, 361, 353, 349, - 364, 364, 368, 373, 448, 382, 347, 432, 344, 371, 352, 362, 377, 365, 360, 366, 400, 429, 356, 355, - 381, 360, 374, 372, 358, 359, 377, 410, 388, 360, 377, 429, 358, 357, 368, 355, 365, 358, 357, 365, - 356, 365, 371, 370, 369, 359, 442, 356, 364, 364, 368, 359, 363, 365, 378, 355, 375, 379, 399, 365, - 354, 372, 372, 361, 401, 372, 366, 374, 370, 374, 366, 373, 367, 372, 360, 370, 367, 353, 385, 366, - 384, 370, 388, 365, 425, 393, 371, 415, 348, 356, 353, 357, 378, 446, 369, 356, 376, 364, 372, 377, - 379, 370, 362, 367, 376, 383, 385, 389, 397, 369, 433, 376, 373, 410, 399, 388, 401, 377, 380, 357, - 337, 331, 347, 346, 348, 351, 353, 425, 383, 355, 358, 359, 411, 488, 384, 373, 392, 344, 327, 387, - 341, 338, 339, 331, 342, 357, 352, 354, 437, 346, 355, 398, 434, 358, 354, 374, 350, 391, 343, 359, - 344, 376, 390, 420, 419, 350, 382, 358, 356, 370, 382, 358, 419, 351, 347, 353, 377, 366, 356, 365, - 350, 401, 369, 356, 359, 398, 366, 446, 359, 368, 370, 370, 381, 370, 369, 375, 385, 368, 375, 368, - 383, 363, 361, 369, 406, 374, 367, 393, 388, 352, 394, 348, 386, 383, 392, 365, 397, 353, 357, 421, - 373, 334, 386, 354, 365, 340, 334, 435, 352, 362, 362, 354, 363, 378, 373, 351, 355, 363, 365, 358, - 356, 376, 377, 358, 379, 454, 412, 348, 353, 358, 362, 350, 360, 363, 371, 363, 451, 339, 345, 383, - 352, 392, 383, 395, 371, 415, 399, 349, 353, 363, 354, 381, 386, 360, 388, 451, 369, 372, 391, 349, - 415, 390, 371, 357, 359, 344, 388, 361, 341, 346, 372, 367, 383, 365, 367, 370, 368, 348, 411, 364, - 354, 398, 356, 394, 434, 357, 368, 345, 360, 453, 329, 345, 446, 323, 360, 336, 351, 379, 384, 361, - 364, 440, 342, 355, 421, 329, 351, 359, 376, 373, 362, 379, 356, 368, 353, 360, 375, 352, 364, 381, - 381, 370, 367, 453, 361, 362, 362, 360, 356, 358, 447, 358, 361, 361, 371, 353, 392, 383, 369, 412, - 343, 366, 369, 371, 359, 436, 369, 368, 421, 350, 346, 355, 352, 376, 412, 369, 387, 347, 343, 370, - 355, 363, 397, 410, 357, 384, 426, 354, 357, 425, 386, 366, 379, 345, 344, 377, 346, 419, 421, 339, - 358, 379, 344, 386, 346, 351, 382, 397, 355, 371, 358, 396, 372, 349, 351, 473, 347, 349, 356, 345, - 374, 431, 347, 334, 395, 374, 376, 376, 381, 362, 407, 362, 384, 343, 364, 355, 349, 385, 394, 359, - 374, 394, 356, 394, 379, 360, 394, 387, 391, 378, 371, 352, 419, 351, 350, 421, 445, 328, 338, 343, - 398, 401, 406, 378, 358, 412, 347, 349, 348, 349, 343, 349, 366, 391, 377, 344, 342, 353, 363, 354, - 369, 379, 366, 361, 374, 382, 375, 366, 371, 373, 367, 393, 370, 372, 367, 366, 370, 385, 375, 370, - 381, 367, 365, 363, 369, 374, 381, 372, 396, 365, 374, 366, 363, 364, 393, 369, 369, 369, 358, 378, - 399, 384, 356, 361, 379, 356, 390, 365, 362, 369, 362, 369, 393, 373, 378, 369, 354, 358, 416, 367]; - const LC_AAC_1_16000 = - [0, 279, 279, 343, 338, 311, 320, 291, 242, 270, 273, 257, 279, 301, 274, 303, 290, 299, 309, 238, 249, - 260, 269, 279, 274, 280, 287, 295, 281, 321, 327, 244, 262, 261, 269, 262, 274, 288, 297, 258, 279, - 275, 276, 277, 274, 281, 286, 271, 293, 322, 251, 259, 279, 279, 280, 278, 285, 333, 271, 266, 269, - 325, 261, 268, 261, 263, 265, 269, 308, 336, 266, 257, 263, 276, 276, 276, 260, 269, 280, 279, 328, - 285, 269, 275, 269, 285, 287, 279, 268, 266, 273, 283, 304, 271, 287, 286, 333, 267, 265, 264, 324, - 245, 253, 264, 294, 271, 269, 268, 305, 268, 260, 329, 263, 266, 274, 313, 297, 272, 270, 269, 271, - 271, 287, 294, 273, 266, 272, 310, 267, 272, 262, 347, 335, 330, 279, 283, 231, 238, 317, 305, 243, - 229, 278, 273, 261, 270, 271, 260, 303, 333, 265, 270, 272, 262, 263, 280, 316, 272, 283, 268, 266, - 270, 283, 319, 265, 277, 277, 271, 278, 278, 278, 279, 333, 280, 269, 257, 329, 259, 254, 291, 256, - 285, 276, 279, 282, 262, 292, 259, 261, 280, 282, 276, 275, 275, 276, 267, 274, 289, 281, 285, 349, - 299, 263, 252, 264, 338, 277, 252, 268, 256, 334, 261, 252, 288, 296, 281, 270, 271, 274, 274, 281, - 287, 278, 270, 276, 278, 268, 281, 277, 263, 290, 277, 291, 259, 288, 292, 345, 280, 266, 290, 264, - 285, 268, 276, 265, 281, 275, 271, 291, 277, 278, 284, 286, 268, 269, 271, 333, 258, 278, 276, 271, - 264, 359, 238, 266, 262, 268, 267, 347, 262, 261, 264, 355, 261, 278, 265, 268, 270, 286, 269, 282, - 266, 279, 269, 300, 336, 283, 269, 311, 248, 257, 268, 265, 285, 277, 313, 329, 254, 274, 251, 268, - 261, 269, 347, 253, 266, 271, 254, 275, 281, 275, 293, 264, 250, 280, 271, 275, 291, 283, 282, 280, - 276, 276, 279, 281, 315, 324, 260, 257, 277, 251, 345, 277, 255, 273, 255, 296, 269, 274, 268, 316, - 261, 306, 324, 266, 260, 274, 278, 272, 283, 272, 272, 272, 270, 277, 269, 308, 357, 286, 266, 266, - 260, 320, 257, 255, 266, 265, 281, 274, 274, 274, 283, 264, 273, 285, 291, 282, 275, 301, 262, 266, - 357, 313, 233, 272, 262, 269, 270, 275, 291, 276, 261, 269, 288, 281, 273, 261, 254, 357, 266, 273, - 261, 273, 262, 295, 297, 305, 272, 256, 269, 290, 283, 295, 285, 253, 279, 281, 283, 293, 271, 273, - 291, 270, 281, 265, 311, 264, 276, 259, 355, 256, 266, 256, 284, 307, 259, 285, 294, 268, 268, 268, - 270, 265, 273, 324, 300, 262, 268, 269, 277, 287, 268, 284, 277, 281, 276, 289, 283, 284, 274, 286, - 281, 303, 275, 290, 276, 274, 313, 314, 250, 271, 287, 282, 279, 273, 291, 283, 258, 268, 269, 261, - 275, 265, 267, 280, 273, 280, 288, 277, 287, 300, 276, 275, 274, 283, 288, 328, 243, 270, 321, 250, - 273, 290, 291, 267, 257, 337, 251, 255, 271, 253, 270, 274, 279, 263, 293, 270, 274, 291, 265, 273, - 335, 284, 289, 273, 268, 270, 275, 285, 267, 308, 266, 270, 274, 284, 285, 281, 305, 292, 289, 259, - 278, 285, 266, 270, 262, 295, 303, 281, 265, 330, 260, 261, 292, 262, 281, 262, 275, 273, 281, 312, - 261, 286, 276, 267, 266, 268, 351, 262, 294, 320, 235, 265, 262, 275, 269, 284, 281, 273, 279, 273, - 279, 275, 275, 290, 280, 273, 277, 284, 278, 266, 282, 292, 331, 253, 293, 296, 307, 262, 268, 287, - 282, 273, 285, 286, 328, 286, 247, 300, 250, 278, 257, 270, 327, 269, 233, 297, 271, 274, 267, 287, - 256, 272, 337, 282, 257, 280, 257, 253, 276, 312, 274, 284, 266, 267, 282, 276, 283, 271, 270, 271, - 274, 295, 303, 263, 260, 271, 362, 292, 266, 271, 276, 265, 269, 269, 284, 273, 265, 284, 267, 274, - 275, 353, 263, 261, 279, 284, 280, 275, 280, 268, 277, 279, 320, 314, 282, 317, 253, 252, 253, 254, - 262, 270, 268, 282, 315, 309, 327, 289, 243, 284, 286, 284, 270, 320, 277, 241, 267, 275, 268, 275, - 275, 288, 263, 285, 263, 273, 284, 287, 277, 277, 288, 279, 266, 274, 275, 268, 277, 302, 277, 268, - 275, 331, 284, 253, 293, 317, 245, 261, 272, 258, 272, 285, 290, 262, 274, 285, 330, 259, 265, 261, - 273, 277, 299, 307, 306, 267, 259, 342, 296, 246, 255, 310, 291, 256, 265, 264, 263, 284, 267, 285, - 292, 276, 266, 272, 281, 271, 276, 297, 278, 296, 261, 264, 286, 279, 279, 273, 281, 337, 259, 274]; - const LC_AAC_2_16000 = - [0, 372, 372, 433, 428, 416, 410, 439, 393, 384, 366, 363, 373, 370, 389, 392, 392, 417, 427, 337, 353, - 364, 355, 357, 369, 365, 369, 366, 379, 426, 420, 350, 354, 376, 379, 359, 357, 369, 373, 363, 358, - 379, 373, 370, 357, 373, 379, 367, 381, 421, 344, 361, 363, 382, 369, 368, 372, 419, 370, 367, 385, - 397, 353, 355, 359, 351, 361, 361, 404, 443, 370, 353, 352, 367, 366, 369, 367, 364, 373, 365, 412, - 382, 359, 378, 350, 367, 376, 372, 367, 355, 369, 377, 386, 361, 376, 374, 430, 364, 364, 354, 440, - 345, 337, 350, 386, 358, 361, 371, 386, 347, 366, 403, 368, 380, 371, 387, 374, 362, 346, 369, 340, - 359, 373, 389, 375, 360, 366, 402, 376, 369, 375, 441, 437, 428, 397, 386, 351, 338, 408, 408, 345, - 315, 342, 352, 336, 357, 343, 353, 388, 416, 344, 355, 372, 352, 348, 353, 410, 363, 368, 353, 352, - 369, 398, 413, 371, 362, 360, 370, 370, 362, 373, 375, 417, 372, 360, 349, 441, 362, 342, 392, 345, - 372, 382, 380, 373, 370, 368, 356, 361, 370, 365, 371, 369, 357, 361, 358, 362, 365, 366, 379, 465, - 401, 363, 357, 361, 445, 384, 342, 358, 349, 421, 362, 354, 366, 382, 371, 353, 378, 362, 353, 370, - 363, 359, 352, 354, 353, 361, 363, 384, 374, 389, 385, 375, 361, 388, 388, 440, 378, 358, 411, 349, - 433, 345, 353, 352, 379, 362, 365, 367, 352, 371, 370, 368, 374, 367, 376, 431, 363, 373, 361, 353, - 351, 441, 344, 380, 351, 364, 360, 451, 343, 366, 348, 454, 350, 365, 368, 358, 365, 386, 349, 373, - 371, 366, 346, 395, 445, 386, 360, 421, 338, 350, 379, 369, 357, 362, 390, 444, 347, 368, 354, 360, - 336, 356, 438, 347, 364, 376, 358, 362, 363, 379, 380, 369, 359, 363, 345, 349, 362, 365, 360, 367, - 366, 365, 357, 355, 422, 421, 361, 350, 374, 359, 444, 365, 366, 364, 354, 370, 363, 359, 354, 422, - 370, 397, 424, 358, 352, 356, 360, 357, 362, 370, 371, 375, 378, 364, 360, 403, 458, 403, 374, 360, - 361, 426, 342, 338, 338, 350, 356, 353, 359, 359, 366, 369, 369, 354, 371, 374, 375, 391, 373, 360, - 415, 447, 369, 361, 361, 356, 371, 360, 374, 371, 353, 361, 389, 353, 371, 361, 345, 459, 367, 363, - 342, 377, 379, 370, 383, 416, 382, 347, 345, 369, 368, 372, 393, 370, 379, 366, 390, 370, 372, 357, - 401, 355, 356, 359, 405, 343, 376, 360, 454, 368, 356, 345, 383, 412, 356, 371, 400, 364, 366, 365, - 375, 362, 341, 452, 383, 358, 366, 364, 376, 381, 363, 379, 380, 368, 360, 370, 376, 379, 371, 371, - 378, 384, 371, 392, 367, 368, 407, 409, 373, 380, 363, 366, 361, 355, 370, 360, 359, 361, 342, 362, - 360, 352, 353, 368, 361, 359, 385, 379, 379, 398, 383, 372, 378, 362, 361, 451, 348, 359, 429, 325, - 348, 401, 383, 369, 357, 423, 351, 367, 376, 352, 344, 354, 363, 362, 355, 357, 350, 388, 355, 358, - 416, 372, 392, 370, 362, 358, 375, 380, 366, 416, 343, 372, 362, 357, 372, 370, 404, 407, 397, 359, - 367, 369, 366, 374, 363, 373, 397, 363, 346, 443, 339, 346, 390, 351, 368, 370, 366, 377, 367, 399, - 376, 369, 354, 373, 349, 378, 452, 363, 396, 425, 339, 370, 360, 376, 378, 361, 377, 359, 373, 366, - 369, 378, 376, 375, 372, 364, 375, 366, 371, 374, 372, 381, 409, 361, 379, 379, 400, 368, 350, 377, - 391, 363, 388, 378, 422, 402, 356, 386, 359, 355, 348, 353, 406, 370, 341, 386, 347, 351, 351, 372, - 350, 356, 428, 364, 361, 374, 349, 341, 363, 382, 352, 362, 348, 365, 365, 374, 371, 367, 371, 363, - 369, 381, 387, 360, 363, 354, 464, 388, 356, 356, 343, 366, 361, 354, 355, 350, 365, 373, 366, 367, - 367, 447, 360, 365, 388, 385, 375, 369, 380, 381, 382, 378, 405, 415, 394, 431, 350, 361, 361, 362, - 364, 364, 367, 377, 398, 388, 422, 402, 356, 359, 382, 366, 344, 425, 361, 347, 351, 355, 345, 346, - 345, 379, 372, 374, 362, 356, 384, 388, 372, 387, 377, 373, 367, 366, 380, 369, 373, 405, 366, 370, - 369, 400, 386, 338, 383, 428, 353, 373, 362, 352, 357, 384, 370, 353, 354, 373, 427, 355, 369, 359, - 359, 360, 386, 404, 387, 369, 361, 430, 378, 330, 354, 402, 391, 330, 337, 343, 356, 369, 377, 365, - 383, 361, 362, 376, 375, 356, 371, 382, 357, 382, 352, 358, 382, 373, 372, 369, 375, 449, 366, 365]; - const LC_AAC_1_22050 = - [0, 279, 279, 363, 332, 328, 308, 276, 379, 237, 212, 254, 266, 285, 274, 280, 282, 286, 272, 277, 283, - 267, 271, 307, 324, 239, 249, 284, 277, 271, 281, 283, 284, 278, 275, 278, 281, 275, 271, 290, 336, - 267, 269, 265, 263, 289, 280, 277, 274, 270, 279, 288, 269, 276, 279, 277, 291, 279, 278, 284, 280, - 269, 288, 290, 270, 278, 289, 335, 232, 259, 268, 276, 284, 284, 283, 288, 292, 295, 306, 247, 267, - 260, 274, 338, 241, 264, 274, 281, 274, 274, 271, 288, 271, 302, 343, 258, 260, 271, 261, 270, 269, - 274, 300, 271, 273, 275, 268, 281, 276, 289, 356, 254, 267, 276, 273, 272, 280, 276, 280, 267, 284, - 284, 277, 266, 283, 278, 299, 319, 290, 242, 294, 336, 292, 246, 256, 265, 262, 336, 252, 261, 265, - 276, 275, 265, 276, 272, 280, 274, 309, 275, 273, 271, 276, 356, 263, 265, 268, 278, 305, 264, 274, - 272, 278, 263, 271, 276, 279, 270, 271, 308, 283, 274, 306, 275, 266, 293, 303, 265, 266, 305, 323, - 335, 324, 275, 291, 256, 256, 232, 287, 257, 318, 289, 246, 240, 264, 279, 257, 275, 292, 270, 279, - 285, 273, 287, 333, 260, 273, 275, 282, 272, 275, 278, 269, 281, 310, 308, 275, 281, 275, 261, 266, - 258, 281, 336, 246, 262, 275, 292, 282, 268, 270, 281, 286, 283, 272, 282, 337, 260, 274, 271, 258, - 264, 347, 281, 248, 262, 293, 254, 275, 288, 272, 265, 295, 289, 287, 272, 258, 270, 271, 274, 284, - 282, 282, 269, 290, 290, 279, 274, 266, 276, 268, 272, 272, 299, 306, 342, 291, 254, 262, 262, 263, - 287, 321, 275, 268, 255, 275, 279, 345, 273, 262, 267, 263, 335, 274, 288, 269, 272, 273, 324, 252, - 263, 272, 279, 281, 270, 276, 261, 278, 273, 270, 278, 275, 279, 285, 264, 287, 270, 284, 288, 262, - 272, 279, 293, 334, 329, 237, 261, 274, 300, 276, 278, 273, 277, 271, 274, 285, 278, 271, 286, 288, - 280, 276, 275, 280, 271, 284, 262, 279, 276, 283, 308, 322, 257, 274, 270, 263, 284, 260, 277, 353, - 324, 234, 247, 254, 284, 265, 275, 329, 265, 276, 265, 265, 273, 344, 272, 262, 286, 263, 274, 271, - 281, 278, 289, 260, 321, 261, 276, 277, 278, 288, 301, 316, 281, 254, 262, 323, 257, 264, 266, 260, - 259, 262, 315, 296, 288, 283, 330, 267, 264, 266, 268, 284, 252, 265, 260, 313, 332, 256, 281, 259, - 263, 266, 285, 270, 278, 276, 278, 291, 277, 264, 265, 267, 283, 282, 288, 278, 274, 285, 281, 271, - 278, 279, 268, 279, 266, 283, 312, 337, 300, 256, 268, 260, 259, 338, 284, 268, 264, 279, 270, 273, - 285, 287, 276, 272, 276, 277, 336, 274, 253, 259, 305, 308, 264, 268, 271, 269, 272, 276, 281, 270, - 292, 264, 277, 281, 273, 284, 272, 268, 269, 371, 341, 274, 253, 258, 270, 256, 249, 346, 254, 283, - 265, 278, 271, 269, 273, 284, 277, 270, 275, 300, 277, 280, 267, 286, 283, 271, 282, 277, 270, 318, - 273, 266, 268, 285, 331, 257, 269, 269, 269, 274, 264, 280, 278, 278, 282, 303, 269, 264, 279, 273, - 273, 269, 270, 318, 259, 277, 313, 267, 266, 273, 274, 272, 293, 270, 289, 296, 286, 341, 268, 253, - 272, 286, 276, 256, 269, 281, 291, 308, 289, 281, 280, 263, 282, 267, 288, 284, 280, 250, 293, 287, - 271, 267, 274, 306, 278, 276, 269, 272, 270, 311, 270, 267, 269, 266, 344, 263, 297, 274, 269, 271, - 277, 275, 276, 261, 272, 271, 284, 260, 274, 300, 371, 277, 240, 261, 274, 274, 274, 287, 279, 273, - 280, 283, 276, 278, 268, 275, 280, 289, 286, 289, 272, 289, 284, 271, 282, 294, 289, 280, 278, 285, - 273, 275, 300, 280, 259, 269, 276, 272, 300, 259, 283, 283, 280, 278, 286, 259, 268, 286, 272, 264, - 280, 274, 272, 284, 277, 270, 282, 291, 281, 272, 283, 286, 299, 277, 305, 264, 270, 277, 280, 271, - 279, 341, 319, 253, 246, 332, 299, 243, 253, 278, 265, 298, 273, 277, 268, 275, 331, 274, 264, 247, - 268, 270, 274, 282, 279, 295, 281, 267, 280, 274, 263, 276, 375, 250, 266, 254, 270, 325, 260, 265, - 277, 275, 288, 266, 273, 279, 272, 286, 270, 325, 255, 265, 282, 265, 307, 275, 269, 285, 281, 285, - 305, 276, 264, 274, 280, 277, 283, 264, 292, 262, 278, 305, 295, 271, 272, 247, 341, 264, 258, 263, - 302, 250, 290, 280, 260, 254, 282, 286, 281, 299, 324, 271, 263, 287, 283, 275, 281, 287, 269, 278]; - const LC_AAC_2_22050 = - [0, 372, 372, 373, 372, 372, 373, 372, 526, 359, 358, 308, 320, 364, 373, 372, 372, 373, 372, 372, 373, - 372, 372, 374, 424, 357, 388, 347, 357, 360, 372, 379, 366, 372, 373, 372, 372, 373, 372, 373, 494, - 431, 422, 414, 387, 380, 388, 387, 399, 403, 372, 363, 351, 371, 353, 352, 324, 329, 385, 325, 327, - 295, 335, 349, 373, 372, 372, 386, 359, 372, 373, 372, 372, 373, 372, 373, 372, 411, 504, 379, 444, - 395, 371, 470, 380, 386, 392, 391, 375, 375, 386, 361, 368, 368, 423, 366, 362, 366, 367, 365, 378, - 378, 379, 377, 370, 335, 351, 322, 387, 368, 440, 372, 371, 346, 359, 383, 364, 390, 366, 382, 348, - 367, 396, 371, 351, 302, 403, 406, 363, 348, 323, 446, 361, 367, 368, 315, 395, 452, 395, 370, 387, - 377, 351, 372, 370, 366, 392, 368, 433, 358, 369, 356, 380, 377, 364, 374, 388, 383, 344, 418, 354, - 359, 359, 391, 360, 356, 369, 376, 379, 345, 362, 366, 370, 379, 370, 371, 361, 334, 371, 339, 446, - 454, 364, 356, 360, 436, 423, 324, 328, 337, 333, 434, 399, 382, 345, 355, 402, 354, 355, 374, 353, - 357, 366, 354, 431, 361, 370, 381, 368, 373, 373, 407, 341, 357, 335, 359, 376, 384, 423, 408, 348, - 416, 352, 340, 359, 370, 370, 372, 371, 362, 371, 370, 449, 432, 345, 335, 389, 368, 332, 364, 360, - 423, 342, 352, 337, 429, 326, 431, 383, 369, 389, 354, 335, 352, 365, 349, 379, 376, 370, 380, 382, - 378, 360, 369, 384, 367, 363, 373, 362, 363, 368, 377, 400, 388, 434, 420, 353, 341, 355, 339, 368, - 362, 429, 469, 333, 355, 356, 363, 345, 369, 366, 356, 343, 356, 428, 357, 359, 342, 364, 373, 445, - 367, 343, 368, 435, 433, 338, 361, 347, 360, 359, 359, 361, 363, 356, 367, 374, 448, 371, 366, 362, - 370, 357, 371, 353, 389, 355, 439, 428, 415, 344, 340, 363, 361, 380, 359, 364, 366, 354, 370, 373, - 357, 352, 364, 373, 367, 339, 372, 374, 380, 323, 381, 362, 451, 378, 367, 367, 370, 429, 447, 357, - 328, 350, 425, 411, 346, 345, 328, 350, 383, 432, 380, 358, 364, 425, 361, 354, 372, 373, 367, 361, - 375, 357, 351, 405, 420, 358, 370, 379, 384, 355, 362, 366, 431, 360, 333, 432, 381, 378, 351, 350, - 347, 341, 342, 357, 360, 359, 353, 369, 388, 377, 373, 441, 364, 427, 351, 353, 426, 383, 365, 363, - 368, 370, 333, 351, 360, 368, 363, 364, 361, 371, 366, 369, 369, 361, 392, 360, 367, 362, 367, 429, - 360, 435, 344, 350, 328, 355, 441, 436, 350, 341, 352, 400, 371, 348, 353, 426, 351, 363, 364, 433, - 357, 361, 371, 343, 374, 422, 422, 354, 361, 354, 374, 362, 370, 363, 368, 418, 360, 361, 364, 433, - 334, 370, 356, 356, 357, 374, 358, 371, 361, 448, 364, 364, 348, 362, 425, 343, 346, 438, 368, 349, - 356, 354, 352, 351, 373, 372, 375, 364, 375, 364, 421, 360, 366, 365, 353, 356, 403, 370, 435, 431, - 414, 337, 336, 421, 337, 342, 358, 356, 362, 372, 365, 364, 422, 357, 345, 358, 358, 370, 365, 445, - 438, 429, 339, 407, 345, 347, 336, 348, 374, 372, 354, 349, 388, 426, 431, 429, 330, 344, 351, 376, - 414, 411, 407, 389, 354, 346, 326, 420, 405, 333, 329, 354, 348, 351, 344, 338, 345, 348, 441, 353, - 369, 428, 417, 351, 354, 343, 372, 400, 351, 344, 347, 355, 463, 352, 383, 446, 334, 343, 359, 347, - 354, 361, 378, 391, 426, 423, 352, 389, 350, 349, 510, 315, 403, 347, 359, 359, 369, 361, 355, 358, - 386, 351, 364, 380, 365, 368, 362, 369, 370, 378, 388, 376, 364, 396, 367, 360, 398, 371, 360, 384, - 381, 360, 357, 354, 370, 451, 356, 364, 353, 412, 340, 344, 363, 349, 352, 375, 367, 366, 367, 363, - 370, 391, 397, 369, 366, 399, 436, 395, 351, 349, 350, 356, 352, 356, 342, 367, 374, 326, 381, 383, - 449, 336, 358, 332, 440, 504, 465, 375, 322, 336, 409, 402, 374, 348, 327, 342, 336, 346, 329, 366, - 383, 337, 371, 375, 362, 345, 378, 368, 374, 412, 356, 361, 516, 356, 406, 352, 344, 427, 373, 363, - 352, 349, 364, 347, 355, 379, 384, 360, 401, 334, 357, 372, 368, 420, 343, 382, 397, 355, 369, 354, - 426, 354, 370, 365, 378, 347, 357, 438, 350, 357, 343, 441, 357, 368, 421, 409, 333, 340, 418, 413, - 406, 376, 324, 367, 351, 393, 334, 353, 363, 430, 335, 344, 364, 444, 353, 364, 376, 334, 363, 373]; - const HE_AAC_1_24000 = - [0, 279, 279, 328, 324, 352, 305, 267, 268, 274, 294, 277, 272, 283, 324, 259, 258, 261, 271, 268, 297, - 275, 312, 343, 251, 257, 258, 247, 264, 302, 261, 283, 267, 277, 282, 273, 267, 328, 291, 267, 276, - 267, 277, 319, 264, 269, 335, 244, 264, 268, 272, 257, 339, 255, 260, 261, 275, 276, 277, 271, 287, - 343, 268, 269, 283, 279, 275, 267, 283, 282, 285, 277, 338, 265, 260, 311, 307, 246, 279, 248, 260, - 288, 263, 265, 334, 258, 265, 335, 249, 277, 271, 268, 281, 308, 265, 266, 308, 265, 276, 329, 316, - 304, 264, 246, 313, 306, 257, 250, 241, 273, 265, 268, 330, 265, 273, 261, 272, 272, 313, 272, 275, - 265, 244, 277, 285, 271, 292, 289, 283, 334, 269, 264, 266, 280, 272, 320, 262, 269, 296, 266, 291, - 266, 277, 269, 273, 280, 284, 271, 279, 269, 287, 325, 268, 270, 252, 348, 264, 259, 329, 252, 264, - 302, 270, 272, 327, 268, 263, 270, 270, 266, 282, 261, 273, 262, 283, 257, 270, 275, 353, 292, 293, - 282, 259, 260, 280, 280, 265, 275, 280, 277, 278, 265, 309, 327, 268, 272, 270, 292, 274, 272, 266, - 264, 270, 277, 284, 308, 268, 275, 280, 270, 308, 265, 266, 260, 281, 296, 337, 322, 289, 242, 260, - 267, 302, 323, 256, 296, 247, 246, 324, 265, 255, 278, 278, 272, 291, 256, 275, 276, 277, 273, 271, - 273, 270, 275, 284, 330, 285, 266, 331, 255, 279, 263, 280, 262, 265, 269, 276, 296, 324, 262, 276, - 281, 269, 282, 268, 278, 260, 265, 312, 302, 268, 276, 328, 260, 273, 266, 280, 278, 268, 266, 273, - 280, 279, 272, 278, 264, 268, 344, 266, 276, 272, 270, 271, 279, 276, 281, 279, 276, 259, 320, 273, - 263, 285, 271, 283, 300, 268, 276, 277, 278, 271, 270, 276, 280, 296, 285, 282, 274, 270, 275, 294, - 265, 311, 258, 285, 308, 274, 284, 295, 267, 267, 261, 266, 293, 339, 257, 251, 270, 270, 278, 281, - 275, 283, 267, 285, 279, 280, 286, 275, 294, 289, 338, 269, 284, 316, 299, 284, 304, 267, 265, 249, - 245, 263, 257, 269, 264, 272, 285, 318, 272, 260, 294, 272, 304, 360, 279, 269, 301, 260, 246, 277, - 260, 256, 261, 266, 260, 284, 290, 272, 330, 255, 274, 286, 338, 252, 278, 262, 276, 290, 266, 272, - 269, 277, 278, 304, 302, 263, 269, 270, 262, 284, 296, 283, 336, 252, 255, 270, 266, 280, 264, 277, - 270, 316, 269, 268, 270, 287, 278, 341, 252, 271, 271, 278, 266, 274, 273, 282, 277, 284, 272, 286, - 282, 280, 278, 279, 328, 275, 270, 304, 286, 271, 307, 264, 274, 278, 270, 281, 298, 267, 289, 316, - 266, 276, 284, 263, 275, 269, 246, 341, 272, 257, 280, 275, 272, 289, 288, 260, 261, 266, 274, 278, - 268, 279, 283, 272, 270, 352, 307, 257, 266, 262, 280, 257, 269, 278, 291, 264, 334, 262, 280, 263, - 267, 277, 263, 270, 284, 320, 311, 279, 248, 248, 260, 281, 284, 282, 313, 337, 258, 288, 305, 270, - 291, 269, 264, 267, 260, 272, 308, 271, 266, 260, 275, 277, 279, 279, 272, 267, 271, 280, 317, 274, - 278, 292, 265, 290, 320, 259, 276, 267, 272, 339, 245, 262, 335, 251, 267, 271, 260, 285, 299, 281, - 257, 334, 251, 265, 312, 254, 253, 276, 283, 285, 264, 290, 277, 276, 283, 269, 288, 266, 276, 289, - 281, 263, 286, 326, 266, 282, 263, 265, 268, 269, 350, 264, 288, 250, 269, 279, 299, 274, 294, 313, - 240, 250, 274, 280, 283, 330, 274, 273, 322, 261, 258, 259, 258, 295, 324, 271, 309, 279, 257, 259, - 261, 266, 298, 307, 267, 276, 325, 239, 262, 309, 297, 269, 294, 250, 263, 257, 265, 303, 327, 259, - 270, 289, 266, 306, 256, 266, 302, 320, 250, 261, 277, 306, 275, 267, 265, 360, 252, 237, 280, 255, - 303, 317, 250, 270, 257, 258, 282, 268, 284, 276, 325, 261, 318, 258, 263, 285, 279, 270, 329, 260, - 260, 309, 254, 283, 302, 253, 282, 302, 288, 276, 268, 266, 327, 265, 262, 322, 333, 232, 245, 250, - 299, 293, 328, 249, 260, 301, 243, 277, 272, 261, 265, 260, 268, 315, 283, 259, 269, 266, 271, 270, - 277, 280, 284, 278, 274, 300, 267, 270, 279, 279, 290, 299, 282, 283, 268, 272, 273, 297, 290, 279, - 286, 274, 278, 284, 274, 282, 287, 274, 308, 269, 267, 268, 269, 274, 299, 267, 273, 278, 273, 273, - 326, 292, 261, 265, 270, 269, 295, 268, 284, 276, 269, 284, 287, 279, 275, 284, 252, 286, 316, 268]; - const HE_AAC_2_24000 = - [0, 372, 372, 373, 372, 462, 461, 379, 362, 352, 363, 389, 375, 393, 473, 388, 399, 395, 377, 393, 367, - 383, 404, 437, 384, 389, 381, 376, 338, 365, 349, 367, 380, 376, 382, 380, 364, 381, 369, 369, 376, - 372, 374, 379, 373, 374, 399, 357, 374, 373, 359, 369, 412, 340, 372, 386, 365, 372, 349, 352, 360, - 428, 360, 380, 388, 382, 372, 357, 349, 362, 369, 354, 408, 382, 376, 409, 391, 337, 352, 354, 357, - 374, 353, 384, 422, 381, 387, 399, 347, 365, 350, 362, 368, 390, 363, 350, 378, 354, 365, 416, 402, - 382, 361, 344, 413, 395, 358, 341, 342, 347, 352, 341, 405, 361, 358, 350, 345, 358, 405, 362, 363, - 355, 345, 368, 372, 364, 367, 373, 369, 400, 379, 362, 353, 363, 368, 428, 368, 381, 387, 359, 389, - 357, 358, 365, 360, 365, 370, 364, 376, 366, 362, 402, 361, 358, 366, 503, 346, 354, 407, 357, 350, - 391, 350, 367, 426, 364, 357, 358, 370, 354, 358, 360, 360, 380, 389, 364, 374, 369, 431, 391, 391, - 390, 354, 359, 366, 361, 353, 356, 363, 363, 370, 368, 389, 429, 361, 368, 360, 402, 393, 390, 357, - 355, 376, 381, 361, 381, 369, 374, 375, 359, 387, 380, 369, 350, 360, 372, 419, 431, 395, 373, 346, - 346, 364, 414, 360, 394, 329, 350, 422, 371, 371, 385, 366, 352, 376, 349, 346, 357, 360, 354, 349, - 357, 367, 362, 357, 394, 364, 357, 483, 369, 352, 353, 364, 360, 358, 355, 365, 381, 412, 361, 355, - 373, 364, 391, 384, 376, 371, 383, 380, 379, 365, 386, 421, 352, 351, 357, 356, 355, 364, 357, 360, - 364, 366, 363, 365, 356, 354, 442, 362, 361, 367, 374, 356, 360, 363, 373, 382, 377, 356, 432, 383, - 365, 377, 372, 355, 412, 372, 352, 378, 368, 367, 366, 371, 360, 362, 358, 374, 364, 369, 360, 391, - 389, 408, 387, 360, 391, 367, 362, 439, 361, 354, 362, 370, 372, 488, 354, 365, 371, 369, 364, 382, - 367, 362, 369, 368, 372, 378, 380, 374, 371, 380, 415, 363, 362, 412, 398, 383, 390, 362, 366, 345, - 346, 356, 354, 359, 346, 358, 359, 405, 369, 368, 360, 362, 392, 511, 405, 380, 401, 355, 338, 365, - 341, 358, 347, 351, 346, 351, 343, 350, 433, 354, 353, 364, 437, 355, 373, 371, 355, 415, 350, 350, - 349, 366, 367, 392, 389, 360, 355, 355, 356, 364, 362, 366, 441, 360, 366, 374, 371, 400, 364, 357, - 351, 390, 371, 360, 357, 363, 353, 443, 367, 370, 385, 370, 381, 373, 372, 377, 382, 377, 374, 374, - 372, 368, 377, 377, 400, 366, 366, 378, 372, 362, 385, 357, 364, 360, 358, 374, 378, 360, 380, 414, - 369, 375, 395, 352, 373, 367, 342, 403, 373, 364, 375, 354, 353, 375, 388, 347, 349, 353, 356, 362, - 354, 356, 380, 354, 362, 450, 396, 360, 367, 361, 369, 348, 355, 367, 369, 367, 487, 356, 359, 379, - 359, 380, 380, 383, 373, 400, 426, 391, 372, 362, 368, 380, 389, 352, 382, 421, 343, 356, 387, 350, - 382, 370, 359, 352, 353, 357, 378, 360, 353, 353, 366, 373, 381, 374, 373, 365, 369, 369, 399, 373, - 370, 370, 356, 391, 434, 366, 363, 354, 367, 443, 338, 356, 435, 339, 361, 359, 353, 355, 369, 350, - 364, 427, 362, 364, 396, 347, 345, 373, 361, 372, 363, 389, 363, 375, 360, 365, 381, 361, 363, 379, - 378, 359, 367, 445, 355, 369, 366, 351, 350, 360, 435, 359, 387, 371, 376, 376, 370, 354, 360, 419, - 353, 361, 361, 370, 367, 398, 371, 362, 432, 368, 365, 366, 364, 372, 411, 365, 390, 355, 355, 361, - 365, 365, 359, 386, 368, 361, 461, 352, 356, 365, 389, 372, 392, 359, 359, 374, 351, 373, 422, 360, - 363, 352, 362, 383, 355, 362, 367, 482, 349, 361, 368, 356, 365, 349, 356, 511, 358, 357, 375, 349, - 362, 411, 346, 370, 375, 375, 377, 376, 369, 362, 411, 362, 399, 352, 366, 373, 372, 373, 406, 359, - 365, 408, 354, 369, 403, 348, 349, 361, 356, 365, 362, 350, 422, 381, 358, 383, 473, 347, 349, 358, - 370, 367, 408, 348, 345, 406, 353, 377, 350, 338, 342, 341, 346, 386, 365, 353, 359, 369, 363, 366, - 373, 374, 367, 364, 370, 391, 373, 373, 378, 375, 377, 391, 362, 361, 361, 368, 372, 378, 374, 367, - 384, 365, 371, 364, 366, 375, 370, 379, 409, 380, 378, 370, 370, 373, 394, 362, 355, 364, 361, 367, - 413, 376, 360, 370, 367, 358, 384, 365, 361, 383, 366, 368, 386, 381, 372, 369, 368, 378, 416, 362]; - const HE_AAC_1_32000 = - [0, 279, 279, 340, 324, 311, 349, 297, 244, 271, 275, 272, 274, 289, 278, 298, 274, 302, 318, 251, 253, - 262, 266, 276, 270, 280, 284, 286, 285, 324, 307, 242, 257, 274, 290, 262, 269, 289, 297, 261, 283, - 274, 277, 281, 280, 276, 276, 275, 297, 331, 266, 262, 264, 268, 269, 287, 280, 336, 261, 278, 276, - 301, 254, 261, 257, 268, 282, 282, 308, 326, 256, 265, 261, 271, 277, 285, 276, 282, 279, 282, 317, - 286, 268, 266, 272, 275, 287, 264, 271, 286, 290, 270, 301, 285, 282, 278, 329, 266, 263, 252, 327, - 254, 246, 257, 292, 260, 267, 282, 291, 272, 278, 305, 296, 269, 278, 308, 300, 264, 265, 263, 263, - 272, 278, 311, 279, 271, 273, 306, 262, 267, 280, 325, 333, 305, 281, 280, 245, 244, 308, 305, 256, - 241, 266, 259, 278, 274, 274, 274, 294, 302, 271, 271, 278, 261, 269, 297, 317, 270, 271, 273, 268, - 270, 256, 320, 269, 278, 281, 283, 275, 279, 277, 289, 307, 283, 266, 261, 311, 269, 252, 326, 277, - 271, 275, 292, 279, 273, 294, 253, 253, 272, 269, 271, 280, 275, 290, 277, 268, 278, 280, 284, 330, - 300, 273, 265, 262, 322, 298, 250, 265, 266, 315, 272, 265, 268, 284, 269, 275, 289, 288, 268, 279, - 281, 280, 277, 269, 277, 272, 279, 280, 261, 288, 294, 285, 264, 276, 265, 314, 273, 274, 297, 270, - 277, 271, 279, 267, 286, 289, 283, 288, 263, 284, 283, 270, 287, 283, 276, 332, 261, 271, 278, 279, - 274, 316, 258, 270, 255, 270, 271, 351, 259, 263, 271, 316, 270, 263, 285, 274, 281, 273, 278, 281, - 268, 275, 273, 299, 306, 291, 283, 306, 259, 257, 274, 277, 268, 275, 290, 315, 270, 276, 266, 274, - 254, 278, 326, 287, 265, 271, 266, 281, 287, 268, 298, 269, 254, 268, 270, 283, 282, 278, 277, 272, - 273, 283, 285, 274, 295, 296, 276, 265, 273, 282, 333, 281, 267, 265, 273, 279, 273, 273, 279, 304, - 269, 300, 315, 266, 268, 266, 272, 270, 271, 294, 279, 273, 273, 273, 261, 297, 336, 283, 283, 267, - 264, 315, 267, 262, 256, 278, 274, 278, 272, 266, 272, 273, 275, 277, 278, 288, 284, 297, 267, 269, - 329, 316, 261, 264, 268, 266, 275, 278, 283, 268, 265, 271, 296, 282, 284, 274, 258, 338, 271, 270, - 268, 275, 270, 288, 303, 290, 271, 260, 281, 268, 279, 291, 311, 253, 283, 270, 292, 289, 280, 273, - 287, 257, 272, 273, 315, 256, 269, 279, 330, 261, 272, 257, 286, 314, 267, 294, 308, 262, 261, 254, - 273, 273, 280, 322, 286, 261, 267, 276, 281, 277, 273, 284, 285, 275, 275, 281, 271, 281, 278, 283, - 289, 302, 281, 295, 275, 273, 323, 296, 263, 284, 286, 284, 280, 277, 287, 274, 268, 265, 263, 255, - 274, 265, 268, 275, 271, 271, 289, 275, 274, 312, 292, 268, 278, 280, 275, 334, 274, 291, 336, 254, - 279, 286, 279, 247, 258, 309, 269, 249, 266, 260, 262, 262, 275, 267, 272, 277, 279, 307, 264, 267, - 295, 304, 318, 262, 272, 272, 270, 286, 273, 318, 262, 263, 264, 290, 266, 283, 303, 309, 275, 269, - 271, 294, 264, 277, 269, 286, 275, 266, 278, 326, 261, 269, 291, 260, 285, 265, 272, 276, 281, 298, - 269, 281, 281, 269, 270, 274, 308, 271, 293, 333, 248, 283, 263, 266, 278, 276, 292, 275, 270, 269, - 282, 279, 277, 292, 291, 269, 288, 274, 282, 271, 282, 293, 323, 250, 287, 276, 314, 283, 258, 281, - 283, 276, 289, 297, 306, 287, 254, 286, 268, 271, 271, 271, 282, 275, 259, 308, 273, 266, 265, 269, - 263, 261, 330, 293, 260, 274, 274, 266, 270, 286, 285, 278, 272, 266, 281, 274, 269, 276, 277, 276, - 279, 296, 290, 263, 279, 271, 337, 300, 282, 262, 271, 272, 262, 267, 269, 275, 279, 279, 280, 272, - 283, 383, 254, 256, 275, 275, 270, 275, 269, 283, 281, 281, 310, 300, 301, 304, 259, 257, 260, 258, - 269, 276, 268, 275, 293, 299, 323, 297, 261, 278, 296, 281, 263, 310, 286, 255, 281, 265, 268, 265, - 274, 287, 264, 273, 261, 282, 283, 276, 287, 275, 273, 285, 278, 270, 270, 281, 283, 304, 267, 265, - 280, 303, 289, 267, 304, 312, 263, 269, 268, 258, 257, 300, 279, 257, 269, 297, 329, 258, 261, 270, - 267, 276, 295, 308, 286, 265, 269, 321, 312, 247, 259, 313, 310, 254, 259, 270, 278, 271, 267, 273, - 289, 286, 266, 268, 271, 278, 280, 296, 271, 265, 273, 283, 280, 275, 281, 281, 279, 331, 251, 277]; - const HE_AAC_2_32000 = - [0, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, 1024, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1023, - 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1023, 1024, 1048, 1001, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1071, 977, 1024, 1024, 1024, 1024, 1024, 1024, - 1024, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]; - const HE_AAC_1_44100 = - [0, 279, 279, 356, 328, 314, 313, 292, 375, 243, 248, 252, 268, 270, 283, 276, 286, 288, 274, 274, 283, - 271, 273, 296, 325, 257, 254, 277, 276, 275, 265, 287, 276, 279, 269, 285, 286, 276, 287, 296, 320, - 261, 268, 261, 275, 271, 279, 278, 286, 280, 264, 299, 266, 286, 271, 270, 280, 273, 288, 293, 278, - 287, 280, 284, 269, 271, 290, 326, 251, 268, 276, 277, 284, 272, 265, 288, 284, 286, 312, 273, 281, - 268, 263, 321, 253, 270, 281, 280, 268, 274, 269, 278, 282, 296, 333, 250, 267, 261, 283, 266, 280, - 282, 280, 275, 271, 275, 278, 279, 280, 293, 336, 259, 270, 269, 275, 271, 270, 279, 284, 283, 290, - 286, 272, 280, 286, 277, 294, 288, 292, 249, 285, 313, 288, 259, 264, 269, 263, 317, 267, 272, 266, - 273, 280, 265, 282, 270, 284, 269, 298, 263, 273, 282, 278, 338, 266, 267, 263, 284, 311, 274, 273, - 275, 257, 281, 274, 259, 275, 274, 280, 306, 293, 285, 282, 280, 297, 315, 277, 256, 282, 289, 308, - 313, 305, 277, 275, 257, 259, 251, 266, 274, 316, 291, 247, 254, 267, 279, 267, 272, 273, 279, 277, - 272, 266, 291, 340, 277, 267, 273, 276, 275, 273, 275, 278, 276, 294, 286, 273, 275, 280, 272, 269, - 268, 275, 343, 256, 279, 280, 285, 281, 267, 277, 276, 277, 273, 283, 280, 318, 276, 272, 268, 266, - 264, 323, 276, 256, 273, 298, 258, 273, 272, 291, 272, 300, 279, 273, 282, 278, 269, 272, 280, 271, - 287, 273, 274, 287, 277, 276, 261, 276, 273, 279, 291, 272, 287, 304, 329, 307, 261, 283, 247, 257, - 297, 316, 291, 255, 267, 269, 278, 318, 276, 265, 274, 267, 319, 269, 285, 260, 275, 257, 320, 256, - 273, 271, 271, 282, 275, 275, 273, 271, 284, 268, 274, 268, 278, 276, 273, 297, 284, 285, 287, 272, - 275, 283, 280, 309, 325, 256, 269, 274, 294, 277, 283, 275, 275, 277, 273, 273, 270, 275, 273, 278, - 290, 278, 284, 279, 274, 281, 265, 291, 274, 280, 303, 322, 266, 271, 283, 270, 271, 263, 284, 322, - 326, 249, 255, 263, 279, 275, 284, 315, 262, 254, 271, 271, 274, 321, 279, 265, 273, 276, 272, 277, - 282, 280, 280, 270, 304, 272, 271, 280, 283, 290, 266, 335, 289, 256, 282, 310, 262, 258, 259, 274, - 271, 261, 298, 293, 273, 291, 314, 276, 273, 271, 268, 297, 259, 253, 264, 301, 330, 262, 278, 268, - 262, 269, 283, 277, 272, 284, 285, 284, 273, 260, 271, 278, 276, 272, 275, 282, 281, 285, 271, 275, - 282, 282, 277, 275, 280, 278, 296, 312, 291, 277, 257, 268, 269, 307, 320, 271, 260, 274, 281, 267, - 274, 289, 282, 277, 265, 261, 315, 282, 281, 274, 315, 298, 267, 266, 270, 258, 270, 278, 273, 266, - 286, 264, 283, 287, 273, 284, 271, 267, 280, 333, 329, 295, 282, 276, 264, 261, 256, 320, 255, 271, - 267, 264, 267, 267, 272, 284, 271, 277, 282, 294, 286, 269, 278, 276, 269, 284, 289, 283, 271, 313, - 281, 271, 267, 290, 335, 260, 269, 263, 271, 286, 265, 277, 282, 283, 270, 293, 266, 268, 269, 282, - 286, 277, 272, 288, 274, 281, 322, 278, 274, 274, 266, 270, 291, 266, 280, 292, 289, 331, 269, 267, - 272, 277, 266, 264, 274, 278, 286, 294, 269, 271, 301, 291, 282, 270, 282, 275, 270, 260, 278, 274, - 271, 272, 274, 283, 281, 298, 283, 284, 272, 299, 284, 271, 277, 281, 319, 259, 281, 279, 275, 270, - 274, 268, 280, 267, 266, 273, 288, 271, 274, 290, 348, 275, 269, 269, 278, 266, 284, 281, 289, 268, - 280, 281, 275, 288, 269, 288, 283, 287, 271, 272, 274, 303, 276, 274, 280, 290, 289, 268, 285, 276, - 285, 268, 317, 287, 252, 272, 277, 274, 287, 266, 276, 280, 278, 288, 271, 277, 270, 259, 268, 279, - 278, 274, 276, 266, 281, 282, 280, 286, 275, 282, 279, 289, 283, 289, 302, 274, 291, 271, 271, 270, - 278, 322, 318, 252, 273, 342, 298, 239, 263, 275, 279, 290, 270, 265, 258, 298, 322, 264, 257, 260, - 276, 266, 271, 280, 265, 287, 277, 289, 262, 278, 280, 279, 358, 253, 264, 263, 276, 328, 271, 266, - 276, 264, 287, 260, 269, 271, 279, 280, 265, 329, 272, 279, 273, 273, 300, 262, 280, 288, 292, 299, - 288, 285, 262, 262, 277, 277, 275, 266, 275, 269, 269, 297, 283, 272, 270, 263, 339, 264, 271, 279, - 306, 264, 289, 274, 271, 269, 297, 279, 280, 279, 296, 272, 264, 296, 273, 267, 276, 278, 278, 294]; - const HE_AAC_2_44100 = - [0, 742, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 780, 707, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 742, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 846, 690, 742, 710, 727, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 802, 731, 696, 743, 743, 743, - 743, 743, 743, 743, 743, 760, 726, 743, 743, 743, 743, 743, 743, 895, 685, - 690, 725, 720, 743, 743, 743, 743, 743, 743, 743, 743, 839, 688, 702, 743, - 743, 743, 910, 709, 719, 717, 796, 691, 680, 722, 743, 743, 743, 743, 742, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 833, 751, 728, 706, 697, 743, 743, 825, 786, 660, - 701, 743, 743, 743, 743, 743, 743, 743, 850, 733, 752, 726, 710, 703, 886, - 696, 677, 697, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 824, 666, 739, 743, 754, - 732, 762, 724, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 787, 724, 718, 743, 743, 743, 743, 743, - 800, 994, 626, 666, 684, 688, 743, 743, 852, 695, 682, 743, 743, 743, 830, - 710, 689, 743, 743, 743, 743, 742, 743, 743, 743, 745, 741, 743, 743, 743, - 743, 743, 862, 790, 645, 719, 895, 695, 739, 692, 650, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 967, 646, 690, - 669, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 791, 752]; - const HE_AAC_1_48000 = - [0, 279, 279, 354, 333, 317, 301, 298, 346, 284, 270, 240, 268, 285, 269, 267, 270, 269, 282, 275, 279, - 279, 268, 282, 283, 340, 316, 251, 261, 264, 261, 268, 270, 288, 279, 276, 275, 271, 273, 298, 275, - 281, 283, 317, 268, 269, 267, 264, 298, 280, 269, 277, 278, 279, 285, 282, 270, 290, 282, 271, 290, - 284, 272, 272, 268, 278, 284, 283, 275, 279, 280, 284, 317, 320, 257, 261, 255, 281, 270, 275, 284, - 277, 277, 277, 304, 294, 276, 266, 273, 267, 321, 268, 256, 272, 276, 270, 278, 270, 277, 286, 278, - 282, 339, 257, 262, 279, 271, 268, 268, 271, 275, 277, 285, 280, 277, 288, 271, 285, 303, 305, 322, - 260, 261, 269, 278, 273, 259, 272, 284, 278, 291, 270, 284, 281, 281, 285, 276, 322, 293, 293, 248, - 297, 285, 313, 250, 259, 253, 282, 270, 322, 249, 275, 262, 279, 277, 288, 268, 268, 271, 272, 290, - 290, 279, 265, 274, 274, 313, 262, 275, 278, 279, 268, 318, 273, 274, 291, 272, 278, 257, 268, 272, - 279, 285, 272, 306, 283, 302, 276, 266, 291, 308, 286, 263, 268, 283, 326, 315, 309, 285, 280, 269, - 274, 266, 254, 265, 285, 283, 309, 254, 256, 257, 261, 267, 271, 282, 275, 275, 288, 276, 269, 272, - 295, 309, 273, 270, 277, 280, 275, 273, 282, 271, 270, 281, 333, 279, 269, 270, 290, 263, 270, 275, - 279, 303, 331, 244, 269, 281, 276, 269, 273, 281, 278, 275, 273, 279, 273, 326, 276, 279, 276, 259, - 273, 268, 333, 292, 260, 257, 266, 288, 266, 283, 281, 287, 268, 288, 279, 273, 283, 280, 275, 270, - 269, 278, 280, 281, 278, 283, 286, 272, 270, 274, 273, 263, 279, 277, 285, 272, 277, 308, 341, 297, - 278, 256, 274, 250, 266, 318, 356, 253, 255, 265, 278, 265, 295, 297, 273, 258, 274, 285, 323, 265, - 268, 264, 265, 263, 302, 277, 277, 274, 268, 270, 277, 275, 277, 274, 277, 275, 281, 279, 283, 274, - 274, 283, 286, 280, 282, 278, 282, 280, 279, 278, 292, 283, 326, 291, 320, 249, 258, 284, 272, 278, - 263, 270, 271, 272, 278, 278, 281, 277, 280, 275, 279, 280, 280, 283, 286, 283, 275, 284, 287, 275, - 271, 306, 313, 271, 270, 285, 264, 277, 261, 260, 285, 333, 304, 274, 281, 258, 265, 266, 284, 312, - 288, 258, 263, 280, 270, 264, 334, 266, 269, 280, 283, 270, 268, 273, 276, 295, 272, 270, 299, 280, - 279, 277, 271, 274, 309, 286, 310, 270, 264, 272, 299, 255, 265, 263, 275, 285, 268, 270, 297, 282, - 289, 294, 320, 264, 273, 275, 269, 284, 267, 258, 272, 272, 325, 292, 278, 259, 285, 272, 270, 274, - 295, 290, 274, 272, 281, 267, 286, 252, 264, 272, 273, 276, 273, 280, 281, 281, 280, 271, 274, 280, - 291, 278, 273, 275, 281, 277, 325, 298, 269, 267, 266, 279, 265, 308, 331, 265, 265, 266, 279, 276, - 270, 283, 282, 272, 273, 267, 273, 317, 278, 274, 269, 295, 301, 273, 280, 271, 268, 274, 273, 283, - 271, 272, 270, 300, 270, 283, 279, 275, 285, 269, 270, 271, 331, 321, 303, 287, 269, 260, 260, 258, - 267, 322, 275, 265, 263, 267, 277, 268, 274, 274, 277, 284, 277, 275, 289, 271, 276, 279, 284, 283, - 289, 274, 281, 277, 280, 320, 280, 271, 283, 279, 320, 293, 259, 266, 263, 269, 273, 267, 276, 276, - 283, 271, 293, 276, 268, 272, 275, 291, 291, 290, 273, 294, 260, 274, 356, 263, 274, 269, 268, 253, - 314, 264, 268, 281, 273, 271, 328, 276, 274, 261, 271, 287, 327, 261, 261, 274, 289, 294, 297, 270, - 277, 270, 270, 274, 276, 286, 280, 269, 261, 277, 267, 272, 271, 266, 270, 332, 272, 271, 280, 277, - 278, 306, 275, 277, 284, 278, 289, 284, 300, 284, 269, 275, 279, 297, 262, 271, 277, 265, 279, 290, - 270, 272, 275, 281, 391, 279, 242, 261, 272, 273, 267, 273, 284, 273, 268, 281, 280, 276, 282, 277, - 280, 279, 286, 276, 279, 295, 282, 284, 282, 271, 282, 288, 279, 273, 287, 275, 278, 274, 290, 292, - 276, 265, 256, 276, 268, 287, 286, 280, 275, 282, 280, 278, 273, 270, 266, 279, 277, 270, 275, 273, - 286, 267, 282, 273, 279, 276, 277, 283, 288, 287, 280, 290, 286, 289, 303, 276, 274, 278, 278, 272, - 277, 314, 318, 251, 257, 264, 325, 263, 265, 264, 281, 270, 305, 275, 275, 256, 268, 340, 264, 269, - 279, 270, 272, 279, 279, 276, 276, 279, 279, 281, 284, 268, 281, 265, 287, 355, 254, 260, 255, 267]; - const HE_AAC_2_48000 = - [0, 682, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, - 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, - 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, - 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, - 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, - 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, - 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, - 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, - 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 682, 683, - 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, - 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, - 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, - 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, - 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, - 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, 683, 684, 682, - 683, 683, 682, 683, 682, 683, 683, 682, 685, 681, 682, 683, 682, 683, 683, - 682, 683, 709, 700, 686, 664, 700, 643, 676, 683, 683, 682, 683, 682, 683, - 683, 754, 690, 652, 672, 662, 665, 683, 837, 687, 637, 651, 654, 667, 666, - 662, 683, 682, 685, 738, 698, 679, 695, 690, 661, 661, 665, 665, 700, 673, - 681, 700, 701, 693, 689, 695, 682, 665, 667, 662, 656, 682, 683, 692, 785, - 757, 652, 648, 675, 648, 662, 760, 785, 612, 634, 623, 624, 682, 683, 737, - 661, 672, 660, 683, 735, 671, 692, 673, 685, 672, 732, 667, 658, 646, 678, - 682, 689, 696, 680, 666, 683, 684, 693, 686, 667, 683, 682, 683, 683, 682, - 683, 682, 683, 683, 682, 683, 683, 682, 759, 729, 664, 670, 676, 735, 662, - 738, 632, 665, 635, 635, 674, 683, 683, 682, 683, 682, 685, 681, 682, 683, - 683, 682, 683, 682, 683, 683, 682, 690, 785, 658, 680, 709, 688, 681, 676, - 640, 619, 833, 721, 637, 660, 674, 648, 606, 682, 745, 730, 665, 636, 638, - 682, 683, 798, 686, 682, 659, 657, 639, 659, 681, 682, 683, 683, 682, 745, - 636, 667, 683, 682, 683, 733, 709, 939, 604, 625, 660, 730, 622, 657, 652, - 643, 618, 682, 683, 682, 683, 683, 682, 759, 661, 640, 671, 682, 713, 674, - 664, 680, 683, 748, 771, 633, 642, 619, 682, 683, 683, 695, 672, 680, 683, - 683, 692, 693, 663, 682, 683, 688, 682, 700, 688, 685, 696, 702, 676, 686, - 670, 651, 667, 683, 683, 682, 683, 776, 739, 653, 657, 675, 671, 670, 807, - 673, 636, 675, 657, 678, 686, 669, 693, 682, 681, 658, 631, 679, 769, 705, - 676, 668, 706, 742, 621, 659, 654, 641, 685, 664, 692, 664, 682, 683, 703, - 670, 675, 682, 683, 683, 682, 683, 682, 710, 761, 725, 704, 685, 671, 645, - 659, 653, 785, 643, 663, 674, 667, 684, 664, 681, 696, 670, 686, 675, 679, - 656, 684, 676, 665, 683, 686, 703, 677, 687, 686, 686, 774, 654, 622, 680, - 700, 713, 709, 644, 677, 686, 679, 686, 669, 691, 655, 674, 694, 733, 663, - 674, 674, 677, 729, 668, 770, 643, 674, 677, 660, 776, 621, 648, 643, 630, - 691, 806, 659, 658, 687, 714, 680, 822, 634, 620, 635, 670, 671, 763, 635, - 599, 661, 683, 708, 728, 676, 705, 674, 670, 680, 688, 706, 689, 693, 665, - 719, 668, 657, 666, 667, 676, 863, 624, 634, 630, 637, 659, 721, 654, 673, - 683, 683, 726, 689, 746, 756, 622, 683, 724, 700, 646, 648, 594, 665, 685, - 739, 616, 683, 682, 689, 810, 734, 680, 653, 630, 615, 650, 683, 682, 683, - 683, 682, 683, 683, 682, 683, 682, 683, 683, 682, 683, 683, 682, 683, 682, - 683, 683, 682, 683, 683, 682, 683, 682, 683, 683, 692, 690, 666, 682, 683, - 682, 683, 683, 682, 683, 700, 703, 689, 688, 672, 690, 683, 691, 676, 663]; - const HE_AAC_1_64000 = - [0, 279, 279, 279, 284, 282, 281, 292, 286, 282, 357, 304, 292, 299, 268, 279, 272, 283, 274, 271, 268, - 288, 257, 289, 285, 277, 280, 285, 278, 290, 278, 287, 277, 329, 307, 257, 255, 264, 275, 266, 276, - 271, 272, 269, 270, 280, 286, 274, 284, 277, 286, 274, 280, 287, 278, 284, 285, 330, 283, 283, 283, - 290, 274, 276, 289, 274, 278, 274, 276, 272, 277, 292, 271, 272, 271, 274, 271, 262, 271, 282, 274, - 283, 285, 284, 277, 286, 276, 287, 288, 271, 280, 276, 286, 288, 281, 274, 318, 267, 270, 267, 271, - 275, 267, 269, 276, 279, 278, 272, 291, 262, 278, 291, 324, 284, 289, 281, 283, 273, 282, 305, 301, - 270, 255, 271, 266, 268, 271, 279, 286, 289, 275, 264, 278, 280, 279, 311, 272, 270, 271, 276, 274, - 282, 274, 282, 277, 275, 293, 280, 282, 275, 282, 273, 275, 279, 278, 284, 276, 281, 311, 316, 263, - 258, 263, 262, 275, 273, 276, 271, 306, 278, 283, 281, 282, 286, 289, 283, 273, 277, 278, 275, 283, - 277, 307, 282, 251, 300, 251, 270, 263, 301, 321, 257, 274, 279, 276, 268, 281, 300, 312, 254, 263, - 270, 262, 280, 275, 281, 281, 268, 273, 281, 278, 278, 280, 296, 282, 278, 277, 282, 273, 270, 284, - 333, 281, 276, 273, 276, 290, 289, 269, 317, 260, 280, 283, 276, 262, 289, 275, 269, 269, 275, 274, - 273, 286, 284, 287, 307, 297, 280, 286, 258, 271, 263, 298, 294, 268, 276, 275, 269, 269, 292, 317, - 297, 283, 275, 271, 265, 264, 260, 265, 277, 265, 261, 272, 271, 277, 327, 264, 261, 266, 269, 274, - 278, 276, 282, 279, 279, 275, 275, 276, 278, 274, 277, 280, 274, 304, 303, 278, 273, 278, 273, 284, - 279, 277, 274, 274, 286, 271, 271, 284, 278, 340, 268, 271, 272, 268, 278, 277, 272, 283, 284, 271, - 286, 332, 314, 265, 259, 263, 268, 272, 282, 275, 281, 269, 283, 272, 267, 280, 278, 276, 279, 289, - 338, 278, 271, 265, 266, 269, 278, 274, 270, 330, 322, 268, 262, 259, 269, 288, 267, 263, 287, 289, - 287, 287, 286, 293, 294, 270, 272, 266, 271, 280, 279, 265, 269, 270, 275, 279, 279, 276, 280, 273, - 277, 281, 274, 272, 283, 276, 277, 282, 281, 279, 276, 282, 279, 282, 288, 284, 309, 310, 290, 267, - 270, 261, 271, 273, 270, 272, 287, 327, 314, 255, 258, 265, 284, 277, 273, 279, 307, 269, 272, 270, - 272, 271, 285, 316, 282, 263, 283, 268, 275, 268, 278, 273, 277, 274, 288, 266, 277, 276, 279, 291, - 281, 270, 279, 271, 268, 280, 283, 292, 270, 274, 275, 276, 283, 283, 284, 282, 284, 279, 274, 283, - 277, 277, 277, 285, 275, 270, 280, 288, 279, 315, 334, 332, 253, 258, 266, 257, 279, 274, 280, 274, - 268, 271, 278, 270, 270, 274, 286, 290, 273, 271, 282, 272, 276, 274, 278, 273, 287, 273, 283, 273, - 279, 273, 280, 286, 286, 279, 277, 287, 298, 330, 269, 268, 280, 288, 276, 277, 273, 278, 269, 284, - 279, 294, 337, 266, 261, 270, 262, 264, 276, 281, 280, 275, 332, 259, 268, 263, 277, 279, 277, 285, - 279, 314, 271, 268, 265, 278, 283, 275, 280, 279, 278, 288, 282, 282, 285, 275, 283, 280, 279, 283, - 286, 275, 272, 285, 302, 299, 258, 321, 283, 277, 263, 263, 316, 288, 258, 259, 257, 264, 270, 289, - 293, 281, 277, 297, 287, 276, 273, 278, 276, 314, 259, 271, 264, 274, 276, 271, 285, 268, 260, 272, - 281, 274, 292, 328, 263, 274, 272, 273, 291, 282, 289, 277, 283, 272, 279, 268, 274, 275, 274, 291, - 273, 271, 267, 278, 278, 274, 276, 267, 279, 283, 285, 275, 281, 274, 280, 266, 283, 282, 284, 274, - 273, 282, 285, 280, 276, 277, 277, 303, 296, 271, 272, 266, 270, 278, 271, 283, 271, 310, 338, 265, - 262, 269, 268, 272, 271, 282, 271, 281, 286, 288, 279, 280, 277, 278, 273, 289, 303, 270, 272, 274, - 280, 283, 293, 277, 270, 284, 275, 275, 276, 282, 285, 299, 277, 267, 273, 280, 270, 288, 271, 281, - 286, 281, 290, 281, 284, 280, 281, 283, 287, 306, 311, 287, 289, 284, 273, 266, 269, 263, 262, 267, - 293, 308, 255, 261, 262, 264, 275, 280, 291, 269, 274, 275, 270, 274, 291, 275, 269, 273, 284, 283, - 284, 275, 277, 279, 279, 275, 288, 286, 275, 280, 284, 277, 291, 321, 277, 266, 287, 276, 261, 306, - 325, 289, 257, 258, 264, 267, 273, 276, 268, 277, 277, 289, 273, 280, 276, 284, 292, 283, 273, 265]; - const HE_AAC_2_64000 = - [0, 372, 372, 373, 372, 372, 373, 372, 372, 373, 377, 368, 373, 372, 373, 372, 372, 373, 372, 372, 373, - 372, 372, 373, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 460, 332, 342, 356, 372, 373, 372, - 372, 373, 372, 372, 373, 372, 372, 373, 372, 373, 372, 372, 373, 372, 372, 373, 419, 348, 350, 372, - 372, 373, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 391, 354, 373, 372, 372, 373, 372, 372, - 373, 372, 372, 373, 372, 372, 373, 372, 373, 372, 372, 373, 372, 372, 373, 467, 375, 315, 332, 373, - 372, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 431, 330, 357, 372, 372, 373, 372, 390, 412, - 338, 349, 373, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 373, 413, 370, 351, 356, 372, 372, - 372, 373, 372, 372, 373, 372, 372, 373, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 437, 354, - 331, 368, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 373, 372, 373, 372, 372, 373, 372, 372, - 373, 372, 372, 373, 372, 372, 373, 372, 373, 416, 359, 342, 372, 372, 373, 372, 372, 497, 352, 345, - 348, 362, 337, 366, 372, 373, 372, 372, 373, 372, 372, 373, 375, 373, 369, 372, 373, 372, 372, 373, - 413, 335, 369, 372, 373, 372, 372, 373, 426, 342, 349, 372, 372, 373, 372, 372, 373, 372, 373, 372, - 372, 373, 372, 372, 373, 372, 372, 373, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 373, 395, - 448, 428, 421, 408, 389, 382, 365, 362, 370, 351, 337, 358, 349, 363, 424, 372, 362, 367, 363, 371, - 376, 377, 368, 366, 365, 359, 363, 359, 365, 358, 382, 362, 363, 393, 403, 371, 378, 377, 381, 385, - 378, 377, 372, 368, 371, 351, 359, 367, 356, 415, 378, 379, 381, 375, 382, 375, 369, 368, 376, 360, - 375, 422, 434, 359, 358, 356, 356, 376, 377, 376, 373, 374, 374, 367, 366, 376, 362, 362, 350, 366, - 400, 383, 372, 365, 370, 362, 361, 367, 359, 425, 414, 364, 361, 361, 367, 382, 359, 350, 397, 389, - 387, 369, 380, 400, 394, 374, 362, 351, 366, 374, 361, 353, 361, 363, 366, 371, 369, 373, 371, 366, - 371, 376, 364, 364, 377, 357, 368, 372, 374, 365, 366, 380, 370, 378, 384, 382, 409, 426, 400, 364, - 365, 356, 357, 359, 357, 358, 389, 427, 419, 342, 349, 359, 365, 367, 360, 358, 396, 365, 376, 366, - 367, 357, 377, 422, 382, 349, 380, 358, 367, 361, 356, 455, 350, 363, 376, 362, 368, 366, 365, 367, - 366, 365, 366, 364, 363, 370, 371, 377, 361, 370, 366, 363, 365, 367, 377, 360, 370, 368, 359, 365, - 364, 369, 369, 371, 364, 374, 368, 383, 372, 421, 427, 460, 348, 358, 365, 385, 366, 372, 364, 420, - 357, 358, 368, 359, 361, 367, 371, 380, 367, 360, 371, 360, 362, 362, 370, 365, 376, 370, 366, 367, - 366, 366, 372, 372, 374, 378, 370, 378, 408, 434, 367, 367, 377, 379, 374, 372, 368, 371, 357, 379, - 360, 394, 426, 350, 350, 371, 352, 351, 367, 366, 368, 365, 429, 358, 364, 355, 358, 362, 371, 369, - 370, 417, 371, 366, 371, 370, 377, 366, 378, 367, 380, 379, 368, 382, 378, 381, 373, 377, 381, 387, - 385, 382, 370, 368, 382, 388, 367, 410, 381, 379, 346, 353, 423, 385, 342, 345, 361, 349, 365, 385, - 379, 371, 362, 392, 371, 364, 360, 359, 364, 419, 357, 369, 354, 369, 370, 365, 392, 356, 346, 357, - 360, 358, 382, 433, 349, 366, 376, 366, 362, 368, 369, 397, 384, 382, 372, 358, 360, 368, 368, 379, - 360, 371, 360, 367, 374, 366, 359, 365, 366, 368, 372, 368, 374, 373, 365, 369, 374, 363, 375, 357, - 365, 364, 365, 373, 361, 390, 363, 409, 405, 378, 363, 354, 366, 364, 360, 376, 359, 409, 416, 364, - 361, 368, 361, 373, 375, 380, 369, 363, 378, 378, 373, 378, 379, 370, 361, 385, 398, 364, 360, 361, - 374, 372, 400, 368, 374, 375, 366, 371, 371, 366, 389, 389, 378, 361, 363, 370, 367, 383, 373, 374, - 376, 376, 390, 380, 379, 371, 363, 370, 365, 418, 437, 408, 397, 388, 372, 365, 362, 349, 343, 349, - 393, 428, 342, 341, 342, 345, 361, 357, 370, 349, 362, 361, 361, 363, 381, 361, 360, 362, 377, 373, - 378, 368, 372, 368, 375, 363, 381, 380, 370, 371, 375, 367, 394, 433, 374, 364, 377, 381, 353, 413, - 431, 389, 339, 347, 347, 364, 358, 367, 356, 365, 359, 382, 375, 371, 366, 383, 386, 366, 355, 360]; - const HE_AAC_1_88200 = - [0, 279, 279, 279, 326, 326, 336, 316, 306, 307, 294, 285, 288, 282, 277, 252, 251, 258, 265, 307, 256, - 305, 301, 291, 284, 281, 275, 277, 267, 266, 267, 269, 270, 269, 260, 274, 271, 272, 279, 274, 268, - 275, 281, 270, 281, 328, 316, 246, 262, 283, 257, 287, 277, 273, 276, 262, 270, 275, 268, 287, 270, - 278, 272, 270, 270, 271, 293, 286, 290, 285, 283, 290, 277, 289, 275, 278, 287, 299, 330, 271, 268, - 269, 273, 282, 287, 282, 281, 277, 276, 266, 277, 281, 276, 283, 272, 278, 281, 279, 288, 281, 293, - 261, 278, 285, 281, 274, 275, 272, 270, 279, 274, 283, 282, 279, 280, 281, 285, 275, 277, 282, 274, - 277, 276, 278, 277, 272, 290, 285, 293, 280, 274, 285, 315, 257, 250, 271, 265, 279, 279, 264, 275, - 282, 283, 280, 286, 283, 277, 274, 282, 270, 297, 273, 286, 323, 301, 267, 273, 271, 275, 285, 285, - 281, 291, 279, 325, 275, 265, 264, 276, 274, 279, 277, 276, 278, 277, 279, 284, 285, 280, 270, 280, - 278, 277, 275, 278, 309, 320, 259, 267, 264, 277, 269, 280, 268, 278, 271, 277, 277, 283, 278, 285, - 281, 280, 280, 285, 277, 277, 275, 275, 273, 281, 279, 285, 283, 289, 279, 277, 283, 319, 259, 274, - 269, 261, 261, 272, 270, 284, 272, 280, 278, 266, 279, 280, 293, 282, 287, 284, 281, 287, 285, 278, - 271, 281, 282, 280, 278, 279, 289, 277, 269, 286, 257, 266, 301, 306, 288, 288, 284, 280, 266, 289, - 313, 270, 262, 262, 267, 258, 262, 285, 288, 284, 290, 340, 252, 276, 260, 266, 285, 280, 271, 285, - 268, 297, 299, 273, 281, 268, 276, 285, 272, 266, 278, 282, 298, 278, 271, 278, 273, 268, 275, 275, - 274, 281, 288, 322, 267, 282, 274, 279, 275, 284, 292, 277, 279, 280, 325, 270, 266, 269, 275, 259, - 268, 283, 297, 286, 290, 279, 283, 276, 294, 268, 282, 280, 273, 270, 282, 284, 271, 284, 271, 288, - 276, 267, 272, 274, 283, 279, 294, 271, 275, 291, 289, 270, 271, 280, 280, 285, 296, 321, 311, 285, - 281, 260, 256, 267, 258, 272, 267, 273, 275, 287, 286, 271, 279, 278, 282, 278, 300, 327, 260, 260, - 269, 274, 265, 262, 269, 278, 281, 279, 275, 279, 279, 281, 284, 283, 273, 279, 286, 279, 283, 279, - 281, 282, 281, 278, 318, 291, 267, 267, 271, 282, 276, 279, 272, 280, 283, 279, 285, 276, 269, 282, - 281, 284, 277, 274, 279, 320, 316, 266, 263, 270, 275, 272, 278, 263, 273, 269, 285, 278, 278, 266, - 276, 294, 285, 328, 265, 271, 267, 272, 272, 279, 274, 285, 280, 280, 274, 281, 280, 277, 278, 280, - 281, 275, 277, 280, 275, 274, 273, 293, 354, 275, 273, 266, 265, 274, 267, 271, 283, 266, 280, 279, - 301, 325, 318, 258, 256, 258, 262, 260, 274, 282, 274, 275, 275, 287, 293, 286, 283, 285, 286, 284, - 288, 277, 283, 272, 276, 269, 276, 274, 296, 272, 281, 273, 273, 272, 274, 279, 273, 279, 286, 280, - 277, 288, 281, 277, 283, 274, 280, 274, 275, 284, 277, 276, 274, 277, 276, 274, 271, 277, 281, 282, - 287, 274, 287, 280, 290, 294, 303, 308, 283, 268, 267, 271, 272, 272, 274, 267, 278, 268, 279, 267, - 342, 275, 314, 262, 260, 267, 273, 277, 280, 272, 274, 272, 289, 302, 276, 283, 276, 272, 272, 273, - 275, 277, 287, 333, 256, 263, 268, 275, 271, 268, 272, 273, 273, 272, 293, 282, 283, 277, 296, 281, - 271, 271, 280, 277, 282, 284, 279, 280, 276, 280, 274, 274, 285, 281, 287, 282, 274, 280, 279, 274, - 279, 273, 272, 285, 280, 289, 292, 281, 295, 275, 274, 280, 281, 277, 275, 280, 277, 292, 277, 266, - 277, 278, 274, 304, 271, 279, 293, 274, 268, 300, 271, 273, 276, 279, 271, 277, 280, 280, 277, 287, - 275, 291, 268, 274, 283, 274, 278, 278, 287, 294, 295, 293, 281, 270, 270, 281, 273, 281, 273, 275, - 285, 269, 277, 275, 268, 279, 282, 283, 277, 273, 281, 280, 267, 285, 290, 281, 284, 280, 284, 310, - 278, 294, 276, 264, 271, 271, 277, 277, 269, 276, 273, 271, 273, 270, 275, 291, 292, 274, 345, 299, - 273, 262, 268, 272, 265, 279, 276, 280, 275, 269, 294, 286, 289, 299, 268, 268, 271, 271, 282, 280, - 283, 274, 283, 278, 297, 320, 271, 269, 275, 269, 275, 277, 271, 283, 284, 278, 271, 282, 281, 285, - 283, 284, 295, 275, 283, 266, 297, 287, 271, 282, 276, 266, 281, 272, 281, 280, 271, 305, 326, 271]; - const HE_AAC_2_88200 = - [0, 372, 372, 373, 372, 372, 373, 372, 372, 373, 372, 372, 373, 372, 378, 368, 372, 373, 372, 374, 371, - 380, 386, 381, 379, 371, 372, 379, 371, 350, 359, 368, 372, 372, 373, 372, 372, 373, 372, 373, 372, - 372, 373, 372, 372, 391, 480, 347, 346, 381, 338, 394, 376, 375, 356, 362, 338, 357, 372, 392, 376, - 366, 366, 369, 366, 372, 372, 373, 376, 368, 378, 371, 368, 378, 367, 373, 376, 388, 413, 365, 363, - 379, 361, 371, 382, 369, 380, 357, 361, 348, 372, 372, 373, 387, 392, 372, 365, 350, 368, 386, 413, - 338, 383, 342, 381, 385, 372, 351, 372, 373, 372, 373, 372, 373, 372, 372, 372, 373, 372, 372, 373, - 372, 373, 372, 372, 373, 372, 372, 374, 371, 372, 379, 415, 352, 344, 372, 373, 386, 392, 358, 376, - 377, 375, 366, 379, 366, 369, 367, 368, 370, 364, 372, 372, 430, 414, 331, 321, 374, 365, 381, 373, - 385, 383, 388, 455, 389, 350, 342, 347, 392, 396, 381, 377, 379, 382, 364, 390, 348, 386, 334, 374, - 378, 377, 379, 366, 391, 452, 365, 359, 362, 379, 364, 361, 361, 365, 358, 356, 364, 347, 349, 380, - 369, 371, 358, 378, 368, 359, 360, 359, 359, 372, 373, 372, 372, 373, 372, 372, 373, 396, 356, 365, - 372, 373, 372, 372, 373, 378, 366, 380, 365, 373, 372, 372, 373, 372, 372, 373, 383, 365, 374, 374, - 366, 372, 372, 373, 372, 372, 373, 372, 372, 375, 370, 372, 376, 394, 384, 393, 369, 365, 366, 391, - 462, 330, 360, 369, 350, 372, 366, 362, 384, 364, 385, 428, 361, 378, 341, 349, 384, 388, 380, 352, - 380, 396, 408, 363, 376, 346, 365, 398, 365, 355, 377, 374, 413, 368, 337, 371, 367, 324, 371, 366, - 374, 365, 381, 418, 372, 346, 372, 368, 357, 344, 362, 360, 372, 373, 480, 347, 339, 343, 353, 372, - 372, 373, 372, 372, 373, 373, 372, 372, 379, 366, 389, 355, 373, 372, 372, 385, 376, 361, 368, 396, - 355, 378, 360, 374, 371, 372, 393, 373, 369, 386, 388, 363, 373, 370, 376, 384, 409, 450, 422, 410, - 398, 368, 364, 371, 350, 371, 355, 350, 363, 365, 369, 347, 360, 364, 359, 358, 395, 434, 366, 361, - 369, 369, 367, 357, 364, 374, 374, 384, 373, 370, 369, 361, 371, 377, 370, 377, 368, 368, 375, 368, - 373, 373, 372, 369, 428, 412, 365, 373, 365, 375, 370, 374, 366, 370, 374, 371, 375, 372, 370, 380, - 370, 373, 364, 359, 359, 420, 435, 364, 359, 361, 370, 366, 374, 359, 367, 362, 376, 358, 368, 359, - 367, 381, 370, 445, 355, 364, 358, 365, 365, 376, 372, 371, 366, 372, 361, 362, 368, 371, 378, 381, - 372, 374, 365, 371, 365, 369, 362, 370, 441, 384, 378, 371, 364, 365, 366, 374, 378, 358, 360, 372, - 394, 450, 430, 349, 342, 341, 352, 347, 360, 368, 358, 364, 371, 382, 390, 385, 377, 395, 382, 375, - 387, 376, 369, 366, 372, 360, 364, 361, 389, 368, 364, 368, 366, 369, 358, 368, 366, 369, 369, 374, - 371, 374, 373, 381, 372, 368, 368, 366, 370, 377, 364, 365, 366, 370, 370, 366, 365, 366, 377, 367, - 376, 363, 367, 365, 378, 404, 432, 435, 384, 355, 355, 366, 354, 359, 363, 355, 369, 358, 362, 357, - 454, 362, 414, 355, 348, 361, 361, 365, 371, 366, 364, 364, 401, 412, 374, 374, 360, 366, 365, 373, - 364, 373, 385, 436, 354, 352, 353, 350, 352, 351, 358, 357, 359, 363, 413, 375, 370, 369, 388, 372, - 373, 369, 376, 373, 367, 370, 366, 376, 371, 378, 365, 373, 384, 369, 379, 379, 366, 368, 377, 365, - 370, 366, 365, 372, 365, 377, 387, 367, 368, 373, 368, 371, 375, 365, 368, 366, 367, 381, 368, 361, - 368, 367, 360, 399, 370, 390, 403, 365, 374, 388, 370, 372, 373, 373, 370, 384, 374, 376, 374, 395, - 390, 378, 359, 370, 367, 365, 373, 368, 369, 387, 381, 396, 373, 359, 363, 376, 367, 376, 362, 355, - 380, 364, 368, 360, 367, 360, 372, 372, 370, 368, 372, 367, 360, 366, 374, 372, 377, 369, 366, 425, - 377, 403, 368, 363, 357, 364, 372, 378, 359, 365, 362, 368, 366, 358, 361, 378, 374, 368, 460, 417, - 360, 359, 348, 365, 355, 364, 373, 370, 376, 356, 371, 369, 384, 401, 370, 368, 369, 368, 365, 364, - 374, 359, 375, 367, 396, 447, 363, 365, 366, 365, 371, 372, 369, 380, 381, 373, 367, 371, 374, 379, - 381, 388, 387, 368, 380, 362, 399, 389, 366, 374, 380, 366, 381, 365, 362, 365, 369, 402, 432, 369]; - const FLAC_2_96000 = - [0, 2378, 2361, 3098, 3324, 3297, 3232, 3153, 3038, 2952, 2940, 2893, 3194, 3251, 3248, - 3195, 3127, 3081, 3043, 2966, 2919, 3469, 3281, 3430, 3531, 3393, 3284, 3437, 3336, 3255, - 3158, 3068, 2991, 2972, 2936, 2899, 3375, 3317, 3235, 3162, 3072, 3097, 3449, 3264, 3225, - 3542, 3524, 3450, 3296, 3192, 3266, 3460, 3354, 3298, 3214, 3173, 3057, 2985, 2959, 3247, - 3270, 3221, 3196, 3132, 3070, 2996, 2966, 2939, 3001, 2970, 2950, 3227, 3241, 3105, 3449, - 3442, 3330, 3441, 3367, 3329, 3452, 3413, 3409, 3308, 3424, 3553, 3610, 3355, 3411, 3418, - 3348, 3291, 3281, 3229, 3224, 3242, 3170, 3270, 3578, 3846, 3468, 3430, 3631, 4403, 4812, - 5197, 4682, 4905, 4625, 4198, 4685, 5172, 5677, 5212, 4379, 4147, 5076, 5252, 4862, 4360, - 3782, 4844, 4794, 5256, 5102, 4983, 4087, 4465, 5295, 5334, 4373, 7286, 7334, 5638, 5674, - 5332, 5408, 5799, 5802, 6210, 6712, 6591, 6384, 6272, 5908, 5075, 4279, 3847, 3717, 4810, - 5359, 4261, 4001, 5015, 4784, 4170, 5117, 5327, 4584, 5030, 5798, 5286, 5073, 5127, 5051, - 5029, 5303, 4847, 4483, 4082, 3923, 3700, 3586, 3531, 3531, 3794, 4730, 5454, 5489, 5441, - 5354, 5444, 5321, 5215, 4875, 4811, 4474, 4062, 3880, 3614, 3686, 4225, 4726, 4936, 4300, - 4631, 5367, 4967, 4897, 4355, 5242, 4167, 4161, 5383, 5209, 5018, 4956, 4910, 4800, 5652, - 5497, 4247, 4968, 6998, 4772, 5476, 5481, 5613, 5443, 4302, 4153, 4909, 4943, 4730, 4724, - 3837, 6326, 5144, 5466, 5379, 5596, 5643, 6163, 6367, 6307, 6204, 6401, 5899, 5420, 4690, - 4130, 3773, 3657, 4307, 5038, 4539, 4010, 4787, 5817, 5819, 5183, 5744, 5498, 4156, 4334, - 4426, 5329, 5669, 5197, 5289, 5264, 4960, 4566, 4083, 3885, 3579, 4276, 5233, 5010, 4145, - 5143, 5851, 5760, 5590, 5343, 4989, 4631, 5034, 5067, 5015, 5285, 5916, 6476, 5108, 3982, - 5781, 6108, 5735, 5673, 5533, 5412, 5320, 5748, 6211, 4906, 6768, 5057, 5664, 6232, 5443, - 6207, 5755, 6352, 5950, 6268, 5316, 6028, 5815, 5109, 5800, 5873, 5700, 5078, 4705, 4712, - 5567, 5272, 5079, 5298, 4872, 5052, 6238, 5920, 6476, 7549, 5612, 5536, 5971, 5830, 5259, - 5642, 4587, 5574, 5570, 5372, 5269, 5232, 5244, 5253, 5333, 5588, 5563, 5601, 5653, 5458, - 5563, 5622, 5597, 5610, 5583, 5591, 5601, 5607, 5615, 5492, 5553, 5280, 4797, 4291, 4060, - 4038, 4079, 4093, 4002, 3975, 4050, 4084, 4648, 4949, 4988, 4252, 7063, 6748, 5342, 5169, - 5345, 6145, 5204, 5544, 6257, 6242, 6613, 6573, 5994, 5028, 4413, 4253, 4451, 5408, 4778, - 7215, 5709, 6551, 6398, 7119, 6020, 6179, 6532, 6022, 5538, 5987, 5123, 5045, 6389, 6195, - 6245, 5899, 4987, 4694, 5669, 5015, 5490, 5700, 5453, 5518, 6180, 5730, 6171, 6473, 7301, - 7762, 6693, 6880, 6207, 7498, 6854, 6106, 6137, 6252, 6132, 6172, 6201, 6190, 6165, 6138, - 6068, 6008, 5940, 5874, 5888, 6025, 6072, 5944, 5971, 5776, 5624, 5623, 5911, 5973, 5908, - 5422, 4703, 4417, 6301, 4479, 4932, 5214, 4327, 5650, 7001, 4841, 6015, 6025, 6091, 6162, - 5181, 6707, 6621, 6127, 5988, 5967, 6766, 6866, 5885, 5553, 5349, 5131, 4958, 4239, 3794, - 3653, 3727, 3540, 3353, 4547, 5317, 5915, 5938, 5785, 5448, 4651, 4120, 3823, 3570, 3467, - 3706, 5039, 5658, 5688, 5079, 5270, 5659, 5621, 5327, 6490, 4622, 5635, 5385, 5465, 6520, - 6400, 6210, 6187, 5049, 5931, 7130, 6070, 6382, 6523, 7201, 7497, 7081, 7355, 7359, 8373, - 7500, 7137, 7042, 6360, 7315, 7064, 6700, 7159, 7114, 6948, 7071, 7274, 7081, 6884, 6773, - 7117, 7710, 7418, 7132, 7086, 6933, 7198, 6059, 6458, 6522, 5742, 5960, 6530, 6569, 6457, - 6050, 5662, 6239, 6304, 5267, 7822, 6525, 5423, 6785, 7591, 7738, 7346, 6423, 6323, 5854, - 7415, 6267, 6111, 7685, 7143, 6435, 7789, 7901, 6961, 6038, 5440, 6805, 6172, 5951, 6075, - 6641, 5669, 6449, 4600, 5552, 6554, 6187, 7003, 6660, 6493, 5647, 6441, 6738, 5647, 5846, - 5632, 5360, 5228, 5101, 6010, 6599, 5393, 5707, 7191, 7162, 6409, 7282, 5408, 6865, 6877, - 6891, 7066, 7124, 7330, 7895, 7431, 5878, 6921, 6209, 5669, 7144, 6844, 6266, 5997, 7496, - 6893, 6661, 6648, 6283, 7094, 5930, 6471, 6202, 6908, 6726, 7297, 7026, 6970, 5665, 4910, - 5729, 6413, 6818, 6675, 5992, 5527, 6269, 6402, 5415, 6031, 7321, 7056, 6137, 6490, 5366, - 6542, 6757, 6060, 6777, 7031, 7035, 7005, 7047, 6947, 6547, 7146, 6943, 6876, 6867, 6816, - 6572, 7006, 6897, 6746, 6809, 6659, 6576, 6829, 6770, 5937, 5881, 5929, 5812, 5199, 4901, - 4618, 4920, 6129, 4438, 4865, 5603, 6742, 6510, 6190, 5952, 6843, 5796, 4778, 4330, 4746, - 5440, 5145, 5015, 4887, 4616, 4115, 4082, 4156, 4992, 4252, 4127, 4639, 4166, 4199, 5036, - 4918, 4492, 4707, 4239, 4638, 4823, 4408, 4677, 4445, 4283, 4721, 4301, 4132, 4149, 4027, - 4094, 4525, 4281, 4162, 4477, 4276, 4172, 4708, 4610, 4218, 4751, 4025, 4003, 4513, 4250, - 4164, 4022, 4097, 3991, 3774, 3662, 3765, 3830, 4015, 4226, 4992, 4116, 4216, 4632, 4006, - 4519, 4723, 4470, 4464, 4399, 4055, 4820, 4645, 4243, 4595, 4205, 3992, 4481, 4082, 4171, - 4085, 4109, 4687, 5458, 4118, 4790, 5411, 5486, 5259, 5326, 5359, 5444, 4994, 7688, 6537, - 5700, 4801, 4897, 5190, 5128, 5323, 5358, 4841, 4498, 4460, 4458, 4672, 5522, 4539, 4486, - 4923, 4486, 4833, 5521, 4995, 4571, 4606, 4320, 4964, 5030, 4649, 4755, 4474, 4256, 4800, - 4317, 4309, 4367, 4634, 4800, 5545, 4910, 4867, 5114, 4919, 4869, 5297, 4940, 4865, 5155, - 4632, 4678, 4888, 4778, 4827, 4611, 4764, 4522, 4172, 4086, 4181, 4276, 4420, 4979, 5077, - 4682, 4692, 4899, 4615, 4903, 5179, 4914, 4735, 4562, 4310, 4869, 4376, 4167, 4489, 4027, - 4166, 4624, 4249, 4183, 4074, 4150, 4024, 3937, 3871, 3858, 3730, 3650, 3577, 3572, 3476, - 3481, 3359, 3287, 3405, 3504, 3396, 3405, 3362, 3409, 3403, 3495, 3866, 3967, 3364, 3406]; - const FLAC_1_96000 = - [0, 2096, 2313, 2304, 3104, 3084, 3008, 2956, 2866, 2769, 2720, 2703, 2806, 3075, 3013, - 3004, 2929, 2885, 2836, 2788, 2720, 3291, 3414, 3401, 3322, 3233, 3165, 3194, 3099, 3039, - 3011, 2892, 2844, 2764, 2751, 2698, 3116, 3096, 3043, 2982, 2923, 2817, 3205, 3158, 3034, - 3353, 3332, 3254, 3158, 3044, 3037, 3269, 3158, 3109, 3074, 3011, 2945, 2840, 2752, 2887, - 3084, 3041, 3004, 2956, 2909, 2800, 2769, 2736, 2779, 2768, 2723, 2973, 3046, 2947, 3309, - 3203, 3135, 3128, 3210, 3137, 3165, 3212, 3130, 3358, 3356, 3330, 3386, 3402, 3358, 3195, - 3120, 3093, 3088, 3060, 3008, 3127, 2994, 2963, 3376, 3566, 3494, 3016, 3067, 3938, 4533, - 4686, 4477, 4532, 4548, 4252, 4375, 4807, 4885, 4790, 4300, 4079, 4507, 4747, 4727, 4369, - 3822, 4696, 4405, 4835, 4855, 4719, 4198, 4009, 4874, 4857, 4542, 5183, 6291, 5735, 5096, - 5018, 4900, 4963, 4890, 4985, 5086, 5116, 5145, 5065, 4967, 4772, 4419, 3759, 3445, 4347, - 4859, 4514, 3460, 4617, 4840, 4044, 4490, 4883, 4616, 4581, 4914, 4790, 4775, 4955, 4801, - 4552, 4786, 4612, 4335, 4015, 3589, 3405, 3337, 3355, 3291, 3342, 4395, 4840, 4919, 4968, - 4949, 4873, 4878, 4858, 4689, 4617, 4365, 4135, 3764, 3318, 3414, 3909, 4464, 4816, 4417, - 3709, 5320, 4560, 4811, 3916, 4865, 4261, 4048, 4730, 4696, 4599, 4512, 4592, 4671, 4938, - 5041, 4511, 4752, 5982, 4990, 4959, 5054, 5080, 5138, 4119, 4055, 4492, 4668, 4634, 4519, - 3835, 4911, 4872, 5034, 4958, 4891, 4896, 4992, 5095, 5035, 4963, 5010, 4900, 4865, 4472, - 4132, 3625, 3309, 3853, 4580, 4573, 3624, 4500, 4971, 4981, 4887, 5051, 4933, 4211, 4215, - 4165, 4775, 4934, 4881, 4649, 4846, 4718, 4567, 4091, 3782, 3426, 3873, 4744, 4805, 4100, - 4562, 5165, 5009, 4931, 4810, 4580, 4343, 4663, 4619, 4643, 4721, 4962, 4991, 4870, 3577, - 4867, 5396, 5037, 5064, 5095, 4999, 4850, 4986, 5615, 4574, 5207, 5593, 4727, 5230, 5128, - 5148, 5465, 5094, 5233, 5658, 5309, 5121, 5194, 4823, 5060, 5166, 5038, 4882, 4384, 4248, - 4888, 4904, 4124, 4934, 4814, 4283, 5113, 5072, 5387, 6348, 5799, 4731, 5078, 5110, 4806, - 4968, 4756, 4780, 5173, 4953, 4936, 4893, 4843, 4837, 4850, 4890, 4877, 4893, 4903, 4882, - 4888, 4893, 4871, 4879, 4924, 4946, 4952, 4982, 4935, 4835, 4834, 4785, 4453, 4148, 3850, - 3700, 3598, 3578, 3510, 3476, 3511, 3782, 4152, 4524, 4752, 4148, 6033, 6089, 4825, 4885, - 4850, 5256, 4917, 4706, 5456, 5312, 5525, 5625, 5355, 4794, 4271, 4002, 4071, 4942, 4679, - 5895, 5229, 5845, 5789, 5872, 5600, 5184, 5648, 5360, 4754, 5308, 4830, 4654, 5243, 5281, - 5359, 5265, 4797, 4261, 4885, 4832, 4491, 5344, 4827, 4959, 5343, 5178, 5309, 5630, 6320, - 6455, 5767, 5901, 5380, 5784, 6369, 5427, 5310, 5325, 5323, 5402, 5493, 5355, 5368, 5348, - 5395, 5337, 5190, 5127, 5164, 5164, 5273, 5287, 5258, 5157, 5099, 5009, 5071, 5125, 5087, - 4976, 4557, 4108, 5384, 4875, 4505, 4873, 4431, 4608, 6246, 5188, 5017, 5139, 5078, 4981, - 4854, 5171, 6053, 5268, 5105, 4980, 5156, 5895, 5452, 4918, 4878, 4790, 4592, 4207, 3634, - 3363, 3445, 3349, 3456, 3879, 4717, 4937, 4942, 4879, 4797, 4470, 4070, 3658, 3332, 3381, - 3330, 4737, 5019, 5023, 4823, 4817, 4953, 5007, 4953, 5160, 4776, 4849, 4964, 4953, 5450, - 5630, 5546, 5423, 4848, 4832, 5892, 5467, 5204, 5799, 5818, 6484, 5792, 5945, 5917, 6737, - 6126, 5851, 5871, 5379, 5851, 5849, 5503, 5920, 5833, 5761, 5529, 5855, 5746, 5568, 5252, - 5642, 6357, 6091, 5886, 5908, 5680, 5700, 5025, 5101, 5333, 5014, 4891, 5256, 5531, 5422, - 5332, 4887, 5148, 5389, 4948, 6343, 5755, 5066, 5270, 6237, 6433, 6204, 5326, 5292, 5245, - 6062, 5710, 5130, 5968, 6429, 5520, 6269, 6545, 6387, 5169, 4899, 5039, 5429, 5072, 5094, - 5371, 5124, 5565, 4266, 4506, 5726, 5372, 5739, 5532, 5563, 5085, 5072, 5566, 5223, 4986, - 4917, 4863, 4751, 4728, 4963, 5596, 5135, 4759, 5783, 5810, 5343, 5961, 5349, 5399, 5405, - 5771, 5878, 5862, 5797, 5771, 5915, 5006, 5594, 5681, 4787, 6222, 5670, 5537, 4965, 6272, - 5720, 5471, 5527, 5392, 5516, 5432, 5016, 5611, 5572, 5627, 5904, 6424, 5416, 5003, 4514, - 4771, 5304, 5668, 5574, 5287, 4831, 5169, 5305, 5008, 4978, 5875, 6069, 5120, 5529, 4846, - 5625, 5315, 5379, 5437, 5736, 5812, 5838, 5844, 5808, 5697, 5847, 5804, 5738, 5602, 5592, - 5582, 5879, 5824, 5863, 5761, 5736, 5597, 5820, 5831, 5227, 5124, 5056, 4942, 4745, 4451, - 4288, 4323, 5293, 4583, 4204, 4774, 5611, 5631, 5494, 4871, 6011, 5739, 4947, 4239, 4385, - 4954, 4789, 4727, 4531, 4392, 4121, 3747, 3758, 4493, 4195, 3902, 4231, 4086, 4035, 4452, - 4405, 4160, 4300, 4094, 4107, 4484, 4115, 4152, 4165, 4058, 4283, 4080, 4104, 4107, 3892, - 3993, 4160, 4081, 4122, 4098, 4140, 4108, 4229, 4248, 4102, 4346, 4068, 3851, 4219, 4084, - 4069, 3964, 3903, 3665, 3570, 3449, 3503, 3547, 3618, 3682, 4540, 4087, 3893, 4237, 3960, - 4038, 4349, 4086, 4031, 4108, 3755, 4343, 4444, 4104, 4166, 4176, 3612, 4188, 3911, 4056, - 3850, 3641, 4269, 4906, 4280, 4238, 4908, 4965, 4844, 4894, 4880, 4869, 4699, 5944, 6144, - 5135, 4515, 4319, 4663, 4703, 4608, 4894, 4554, 4191, 4036, 4060, 4031, 4775, 4335, 4064, - 4398, 4162, 4173, 4765, 4596, 4098, 4253, 3975, 4407, 4560, 4334, 4192, 4208, 4053, 4379, - 4122, 4041, 4031, 4202, 4285, 4739, 4686, 4494, 4655, 4649, 4408, 4737, 4609, 4433, 4681, - 4380, 4313, 4445, 4346, 4385, 4301, 4333, 4235, 4032, 4087, 4077, 4009, 4088, 4341, 4733, - 4386, 4297, 4523, 4250, 4296, 4675, 4497, 4244, 4384, 4035, 4346, 4188, 4056, 4153, 4043, - 3878, 4291, 4039, 4063, 4066, 3805, 3735, 3673, 3634, 3554, 3521, 3440, 3401, 3381, 3300, - 3274, 3342, 3480, 3435, 3307, 3233, 3135, 3089, 3068, 3143, 3405, 3407, 3775, 3344, 3182]; - const FLAC_2_8000 = - [0, 742, 743, 742, 1239, 1316, 1315, 1302, 1288, 1274, 1253, 1238, 1226, 1204, 1246, - 1333, 1325, 1310, 1301, 1286, 1283, 1262, 1261, 1237, 1233, 1431, 1423, 1396, 1379, - 1345, 1323, 1309, 1356, 1341, 1323, 1309, 1288, 1278, 1256, 1246, 1224, 1198, 1296, - 1343, 1328, 1310, 1293, 1282, 1272, 1334, 1345, 1326, 1318, 1400, 1390, 1378, 1357, - 1324, 1303, 1318, 1397, 1379, 1362, 1347, 1332, 1314, 1298, 1275, 1255, 1244, 1335, - 1342, 1328, 1328, 1318, 1301, 1282, 1270, 1263, 1250, 1258, 1258, 1243, 1236, 1321, - 1322, 1312, 1361, 1420, 1399, 1376, 1385, 1378, 1372, 1373, 1385, 1367, 1351, 1406, - 1391, 1376, 1424, 1447, 1444, 1392, 1379, 1360, 1346, 1366, 1357, 1341, 1327, 1330, - 1315, 1297, 1284, 1318, 1324, 1311, 1263, 1240, 1257, 1394, 1465, 1458, 1403, 1389, - 1411, 1382, 1352, 1423, 1468, 1471, 1461, 1434, 1363, 1356, 1429, 1500, 1476, 1438, - 1378, 1296, 1384, 1435, 1457, 1453, 1455, 1449, 1356, 1317, 1447, 1479, 1464, 1391, - 1389, 1349, 1355, 1422, 1472, 1456, 1446, 1464, 1454, 1521, 1518, 1507, 1493, 1504, - 1490, 1469, 1478, 1453, 1414, 1392, 1373, 1388, 1413, 1395, 1355, 1331, 1448, 1472, - 1405, 1387, 1452, 1447, 1378, 1392, 1357, 1324, 1333, 1463, 1448, 1424, 1397, 1412, - 1425, 1387, 1388, 1367, 1334, 1383, 1387, 1368, 1376, 1386, 1378, 1373, 1434, 1425, - 1439, 1468, 1484, 1472, 1455, 1447, 1419, 1417, 1403, 1408, 1387, 1363, 1371, 1350, - 1333, 1412, 1439, 1445, 1427, 1391, 1395, 1452, 1418, 1447, 1358, 1368, 1484, 1441, - 1421, 1472, 1502, 1480, 1472, 1463, 1442, 1463, 1494, 1521, 1497, 1443, 1470, 1388, - 1366, 1443, 1490, 1492, 1495, 1467, 1385, 1369, 1332, 1411, 1415, 1440, 1436, 1371, - 1347, 1405, 1466, 1457, 1448, 1455, 1438, 1452, 1485, 1485, 1474, 1479, 1489, 1472, - 1454, 1451, 1413, 1387, 1379, 1337, 1335, 1365, 1388, 1380, 1318, 1393, 1491, 1489, - 1482, 1462, 1495, 1483, 1406, 1358, 1361, 1356, 1438, 1452, 1453, 1420, 1453, 1443, - 1441, 1467, 1452, 1430, 1419, 1407, 1403, 1409, 1423, 1397, 1391, 1457, 1466, 1458, - 1447, 1453, 1440, 1419, 1395, 1418, 1405, 1400, 1410, 1450, 1454, 1397, 1457, 1280, - 1311, 1509, 1558, 1526, 1526, 1525, 1504, 1463, 1395, 1365, 1361, 1471, 1488, 1423, - 1409, 1544, 1579, 1548, 1533, 1606, 1455, 1454, 1566, 1566, 1498, 1481, 1525, 1497, - 1480, 1556, 1545, 1541, 1522, 1470, 1443, 1443, 1460, 1454, 1434, 1458, 1491, 1471, - 1455, 1565, 1549, 1445, 1531, 1400, 1395, 1445, 1512, 1485, 1456, 1502, 1533, 1437, - 1483, 1517, 1499, 1505, 1501, 1510, 1509, 1508, 1517, 1507, 1519, 1524, 1528, 1525, - 1525, 1524, 1525, 1520, 1518, 1520, 1520, 1510, 1516, 1512, 1500, 1510, 1490, 1493, - 1513, 1481, 1464, 1452, 1437, 1423, 1404, 1401, 1394, 1386, 1384, 1374, 1378, 1395, - 1465, 1453, 1444, 1422, 1396, 1403, 1415, 1481, 1472, 1504, 1534, 1524, 1484, 1480, - 1559, 1598, 1585, 1565, 1559, 1507, 1456, 1422, 1420, 1427, 1506, 1506, 1451, 1435, - 1500, 1545, 1533, 1565, 1567, 1518, 1488, 1585, 1561, 1501, 1514, 1554, 1467, 1472, - 1517, 1558, 1538, 1524, 1506, 1465, 1445, 1460, 1455, 1453, 1536, 1554, 1496, 1528, - 1546, 1555, 1537, 1571, 1589, 1490, 1493, 1550, 1584, 1580, 1547, 1516, 1466, 1475, - 1537, 1556, 1545, 1540, 1541, 1537, 1539, 1539, 1534, 1547, 1560, 1549, 1553, 1538, - 1539, 1543, 1542, 1541, 1542, 1534, 1541, 1527, 1528, 1523, 1515, 1537, 1521, 1541, - 1515, 1481, 1450, 1448, 1432, 1417, 1457, 1459, 1441, 1400, 1452, 1401, 1415, 1501, - 1520, 1519, 1508, 1505, 1418, 1383, 1459, 1516, 1510, 1488, 1480, 1416, 1390, 1409, - 1442, 1455, 1443, 1422, 1397, 1342, 1281, 1248, 1255, 1284, 1252, 1199, 1274, 1391, - 1472, 1487, 1491, 1471, 1474, 1438, 1387, 1341, 1305, 1284, 1288, 1287, 1378, 1487, - 1481, 1463, 1442, 1404, 1413, 1420, 1425, 1420, 1377, 1385, 1430, 1485, 1460, 1463, - 1556, 1556, 1558, 1557, 1536, 1422, 1503, 1589, 1555, 1495, 1596, 1587, 1559, 1603, - 1602, 1592, 1606, 1522, 1514, 1554, 1611, 1593, 1539, 1522, 1600, 1591, 1568, 1629, - 1620, 1625, 1581, 1599, 1647, 1614, 1589, 1573, 1573, 1567, 1503, 1501, 1543, 1603, - 1597, 1599, 1567, 1482, 1503, 1535, 1501, 1498, 1518, 1585, 1588, 1587, 1566, 1527, - 1505, 1517, 1521, 1489, 1475, 1578, 1583, 1502, 1508, 1564, 1507, 1518, 1561, 1593, - 1583, 1553, 1491, 1540, 1579, 1550, 1518, 1485, 1514, 1521, 1486, 1477, 1533, 1549, - 1506, 1470, 1456, 1556, 1568, 1583, 1604, 1558, 1536, 1503, 1451, 1504, 1588, 1549]; - const FLAC_1_8000 = - [0, 228, 233, 231, 692, 771, 767, 752, 741, 732, 712, 691, 677, 662, 701, 794, 785, 761, 752, 737, 738, - 723, 720, 688, 685, 883, 878, 854, 829, 802, 783, 762, 812, 799, 782, 762, 741, 735, 716, 703, 675, - 657, 749, 802, 789, 761, 745, 738, 730, 788, 803, 782, 770, 862, 842, 827, 810, 783, 755, 769, 854, - 831, 815, 805, 791, 770, 751, 731, 715, 701, 790, 803, 789, 789, 774, 751, 736, 728, 724, 707, 716, - 716, 698, 687, 776, 781, 766, 817, 877, 857, 826, 839, 825, 822, 825, 837, 816, 806, 867, 849, 825, - 877, 902, 896, 847, 830, 810, 802, 817, 811, 798, 785, 790, 768, 748, 745, 774, 784, 763, 720, 693, - 705, 843, 922, 911, 857, 848, 868, 835, 808, 878, 929, 934, 915, 886, 822, 808, 882, 954, 940, 896, - 830, 749, 839, 888, 909, 903, 907, 895, 813, 770, 902, 938, 919, 845, 846, 803, 813, 879, 930, 912, - 894, 920, 904, 972, 966, 957, 948, 956, 947, 929, 936, 903, 872, 847, 824, 840, 872, 854, 810, 783, - 901, 930, 864, 843, 903, 899, 837, 850, 813, 778, 787, 921, 899, 879, 853, 872, 880, 840, 842, 819, - 795, 839, 840, 821, 825, 838, 833, 823, 888, 880, 891, 920, 942, 932, 907, 898, 876, 873, 860, 867, - 841, 816, 823, 808, 792, 863, 886, 897, 880, 845, 852, 907, 876, 899, 813, 821, 943, 891, 877, 927, - 956, 940, 931, 917, 891, 918, 947, 973, 953, 893, 926, 844, 818, 896, 948, 949, 951, 922, 838, 822, - 790, 871, 873, 898, 886, 819, 805, 859, 925, 911, 897, 907, 891, 905, 944, 943, 933, 940, 946, 930, - 904, 902, 872, 844, 833, 797, 796, 818, 844, 830, 771, 849, 948, 945, 942, 918, 951, 943, 858, 814, - 814, 814, 894, 903, 906, 874, 906, 892, 893, 924, 905, 884, 877, 867, 864, 870, 879, 857, 848, 912, - 925, 913, 897, 905, 890, 875, 850, 873, 861, 859, 869, 902, 905, 848, 912, 737, 768, 965, 1014, 979, - 977, 976, 957, 916, 851, 817, 814, 930, 945, 878, 869, 1001, 1031, 1002, 987, 1063, 907, 906, 1021, - 1020, 955, 938, 981, 957, 938, 1016, 1004, 1002, 974, 928, 893, 899, 915, 908, 886, 913, 949, 931, - 908, 1023, 1004, 900, 990, 860, 849, 896, 961, 947, 913, 957, 992, 893, 934, 967, 954, 957, 954, 961, - 961, 960, 964, 960, 968, 975, 983, 979, 975, 976, 979, 970, 966, 971, 968, 963, 967, 962, 955, 960, - 950, 948, 964, 939, 921, 904, 888, 879, 863, 862, 849, 842, 836, 825, 827, 849, 921, 907, 897, 877, - 854, 863, 870, 939, 930, 954, 989, 978, 936, 934, 1016, 1051, 1037, 1022, 1018, 961, 909, 879, 876, - 881, 962, 960, 905, 886, 952, 1005, 992, 1020, 1023, 970, 944, 1035, 1018, 953, 969, 1006, 923, 932, - 972, 1013, 996, 978, 955, 924, 896, 912, 909, 904, 992, 1013, 954, 980, 1005, 1013, 996, 1026, 1038, - 948, 948, 1002, 1036, 1029, 1003, 974, 926, 935, 992, 1014, 1004, 998, 1000, 993, 999, 998, 991, 1007, - 1017, 1009, 1012, 1000, 999, 1003, 1004, 1000, 1003, 992, 997, 982, 982, 975, 966, 996, 975, 1000, 966, - 939, 902, 899, 886, 873, 909, 913, 894, 862, 907, 862, 873, 959, 969, 969, 958, 956, 870, 838, 914, - 967, 960, 946, 940, 874, 845, 869, 893, 910, 893, 879, 852, 801, 740, 706, 712, 738, 711, 658, 727, - 847, 927, 946, 947, 930, 935, 892, 839, 799, 756, 740, 741, 740, 828, 945, 940, 917, 892, 865, 871, - 877, 879, 877, 831, 837, 886, 943, 912, 920, 1015, 1013, 1014, 1016, 994, 879, 954, 1037, 1009, 952, - 1051, 1040, 1011, 1052, 1057, 1043, 1063, 974, 964, 1006, 1071, 1042, 991, 974, 1051, 1045, 1022, 1084, - 1081, 1084, 1040, 1051, 1101, 1074, 1045, 1026, 1027, 1023, 954, 954, 994, 1058, 1051, 1052, 1022, 941, - 958, 991, 956, 954, 973, 1036, 1035, 1039, 1020, 984, 957, 967, 971, 945, 935, 1027, 1039, 955, 960, - 1017, 960, 972, 1014, 1046, 1035, 1007, 945, 996, 1028, 1011, 975, 944, 970, 977, 946, 938, 989, 1010, - 961, 929, 911, 1011, 1023, 1033, 1060, 1009, 991, 956, 902, 956, 1040, 1007, 1016, 1001, 970, 996, 956, - 909, 892, 895, 967, 988, 983, 963, 947, 952, 947, 961, 969, 966, 1006, 1047, 1068, 1035, 1023, 1074, - 982, 984, 1015, 1082, 1045, 1071, 1044, 1020, 1062, 1069, 1003, 956, 1050, 1059, 950, 970, 1071, 1069, - 1039, 942, 973, 1064, 1063, 1059, 1055, 1031, 1058, 1028, 952, 964, 1020, 1059, 1068, 1035, 949, 929]; - const FLAC_2_11025 = - [0, 396, 411, 1177, 1285, 1193, 1172, 1108, 1081, 1039, 1222, 1284, 1259, 1224, 1196, 1158, 1096, 1370, - 1543, 1486, 1435, 1359, 1396, 1318, 1229, 1184, 1156, 1121, 1040, 1185, 1311, 1281, 1240, 1210, 1375, - 1363, 1343, 1469, 1445, 1358, 1264, 1360, 1433, 1380, 1327, 1286, 1228, 1170, 1215, 1330, 1304, 1284, - 1234, 1182, 1150, 1130, 1135, 1092, 1262, 1287, 1345, 1480, 1382, 1441, 1413, 1405, 1423, 1413, 1543, - 1479, 1624, 1590, 1478, 1425, 1351, 1374, 1325, 1326, 1287, 1228, 1327, 1370, 1242, 1121, 1549, 1758, - 1662, 1520, 1504, 1391, 1629, 1717, 1684, 1525, 1448, 1720, 1730, 1521, 1349, 1597, 1684, 1691, 1683, - 1403, 1566, 1744, 1606, 1605, 1562, 1665, 1753, 1722, 1719, 1760, 1754, 1742, 1735, 1712, 1689, 1576, - 1494, 1464, 1596, 1545, 1343, 1742, 1615, 1547, 1693, 1541, 1576, 1431, 1579, 1696, 1611, 1611, 1655, - 1574, 1490, 1447, 1468, 1429, 1439, 1426, 1612, 1644, 1741, 1736, 1700, 1660, 1612, 1589, 1573, 1481, - 1425, 1368, 1597, 1661, 1643, 1500, 1683, 1638, 1509, 1614, 1658, 1576, 1747, 1726, 1719, 1679, 1699, - 1823, 1717, 1711, 1592, 1601, 1769, 1815, 1723, 1498, 1444, 1625, 1669, 1594, 1411, 1682, 1744, 1719, - 1699, 1667, 1732, 1724, 1724, 1684, 1637, 1564, 1463, 1371, 1411, 1554, 1535, 1381, 1740, 1755, 1698, - 1785, 1660, 1496, 1491, 1655, 1721, 1626, 1707, 1683, 1699, 1605, 1557, 1532, 1605, 1598, 1529, 1791, - 1717, 1707, 1654, 1585, 1663, 1675, 1642, 1736, 1658, 1669, 1301, 1828, 1883, 1850, 1823, 1750, 1609, - 1557, 1699, 1684, 1565, 1899, 1902, 1877, 1753, 1724, 1973, 1792, 1833, 1758, 1784, 1828, 1816, 1714, - 1598, 1673, 1656, 1647, 1742, 1665, 1922, 1812, 1825, 1670, 1618, 1760, 1708, 1751, 1758, 1734, 1809, - 1796, 1802, 1814, 1810, 1827, 1844, 1858, 1856, 1840, 1823, 1807, 1815, 1815, 1814, 1813, 1805, 1770, - 1793, 1726, 1648, 1589, 1550, 1513, 1489, 1476, 1468, 1498, 1669, 1655, 1573, 1594, 1599, 1732, 1753, - 1887, 1754, 1793, 1875, 1943, 1930, 1813, 1642, 1583, 1631, 1784, 1628, 1735, 1879, 1871, 1940, 1717, - 1953, 1900, 1778, 1786, 1671, 1792, 1874, 1847, 1740, 1617, 1688, 1671, 1911, 1782, 1824, 1871, 1858, - 1917, 1738, 1816, 1989, 1954, 1856, 1737, 1861, 1898, 1891, 1897, 1896, 1890, 1877, 1874, 1880, 1869, - 1865, 1873, 1888, 1888, 1874, 1855, 1843, 1835, 1843, 1832, 1719, 1619, 1633, 1590, 1695, 1609, 1633, - 1585, 1665, 1855, 1841, 1763, 1567, 1750, 1806, 1761, 1713, 1577, 1605, 1725, 1702, 1654, 1525, 1339, - 1264, 1311, 1200, 1290, 1647, 1794, 1764, 1736, 1651, 1474, 1339, 1307, 1290, 1697, 1766, 1730, 1621, - 1647, 1700, 1598, 1536, 1691, 1743, 1782, 1914, 1916, 1925, 1638, 1811, 1898, 1834, 2005, 1944, 2009, - 1989, 1944, 1860, 1980, 1967, 1840, 1935, 1926, 1948, 2001, 2009, 1976, 2022, 1924, 1862, 1923, 1791, - 1814, 1995, 1965, 1919, 1712, 1791, 1735, 1764, 1941, 1915, 1866, 1767, 1812, 1780, 1748, 1987, 1768, - 1934, 1931, 1936, 1924, 1918, 1846, 1935, 1907, 1842, 1746, 1848, 1776, 1816, 1836, 1707, 1699, 1903, - 1902, 1902, 1838, 1662, 1713, 1906, 1881, 1849, 1827, 1754, 1670, 1688, 1823, 1803, 1743, 1725, 1751, - 1826, 1774, 1910, 1989, 1839, 2010, 1753, 1854, 1988, 1973, 1895, 1910, 1924, 1789, 1934, 1832, 1815, - 1956, 1916, 1807, 1973, 1917, 1908, 1841, 1972, 1719, 1841, 1993, 1983, 1848, 1778, 1767, 1696, 1748, - 1921, 1900, 1844, 1770, 1816, 1791, 1811, 2007, 1853, 1901, 1776, 1884, 1901, 1878, 1925, 1925, 1943, - 1927, 1931, 1965, 1964, 1909, 1909, 1905, 1928, 1929, 1913, 1898, 1932, 1952, 1913, 1777, 1721, 1652, - 1591, 1586, 1575, 1829, 1602, 1627, 1797, 1910, 1879, 1641, 1629, 1698, 1595, 1646, 1749, 1727, 1650, - 1579, 1520, 1506, 1624, 1639, 1632, 1693, 1654, 1716, 1717, 1687, 1703, 1699, 1795, 1735, 1737, 1721, - 1722, 1650, 1604, 1624, 1618, 1688, 1651, 1689, 1715, 1683, 1699, 1678, 1683, 1667, 1626, 1765, 1722, - 1658, 1623, 1613, 1621, 1583, 1584, 1590, 1637, 1679, 1624, 1724, 1667, 1689, 1657, 1632, 1638, 1615, - 1736, 1704, 1668, 1627, 1604, 1655, 1609, 1588, 1586, 1699, 1640, 1579, 1876, 1888, 1858, 1813, 1794]; - const FLAC_1_11025 = - [0, 448, 465, 1245, 1346, 1272, 1250, 1172, 1153, 1113, 1296, 1339, 1318, 1294, 1275, 1226, 1160, 1444, - 1605, 1566, 1497, 1433, 1460, 1387, 1301, 1265, 1225, 1177, 1111, 1258, 1384, 1339, 1307, 1287, 1439, - 1434, 1404, 1546, 1515, 1433, 1323, 1432, 1497, 1450, 1398, 1343, 1298, 1242, 1276, 1407, 1371, 1343, - 1303, 1259, 1214, 1185, 1196, 1159, 1323, 1346, 1411, 1556, 1446, 1508, 1468, 1470, 1477, 1481, 1604, - 1557, 1693, 1661, 1550, 1488, 1425, 1442, 1400, 1406, 1352, 1295, 1404, 1440, 1313, 1181, 1617, 1829, - 1728, 1589, 1575, 1456, 1698, 1781, 1752, 1597, 1521, 1792, 1797, 1599, 1418, 1673, 1749, 1750, 1742, - 1474, 1635, 1813, 1680, 1683, 1623, 1731, 1830, 1789, 1781, 1835, 1833, 1814, 1802, 1772, 1751, 1638, - 1569, 1536, 1671, 1613, 1421, 1811, 1681, 1614, 1756, 1614, 1648, 1503, 1645, 1765, 1682, 1686, 1725, - 1631, 1558, 1514, 1541, 1489, 1504, 1485, 1681, 1711, 1813, 1808, 1758, 1727, 1689, 1654, 1632, 1559, - 1487, 1440, 1667, 1729, 1717, 1573, 1757, 1711, 1574, 1684, 1729, 1640, 1817, 1791, 1781, 1745, 1770, - 1890, 1788, 1771, 1662, 1673, 1844, 1880, 1791, 1573, 1512, 1704, 1735, 1665, 1472, 1751, 1820, 1783, - 1768, 1733, 1797, 1786, 1789, 1751, 1702, 1634, 1527, 1441, 1483, 1617, 1597, 1449, 1804, 1826, 1769, - 1859, 1733, 1565, 1568, 1720, 1782, 1686, 1768, 1752, 1758, 1677, 1614, 1595, 1682, 1669, 1598, 1864, - 1780, 1761, 1728, 1654, 1728, 1741, 1716, 1804, 1730, 1742, 1366, 1900, 1951, 1905, 1887, 1823, 1670, - 1613, 1766, 1755, 1628, 1973, 1971, 1949, 1824, 1795, 2040, 1862, 1894, 1822, 1853, 1890, 1882, 1782, - 1671, 1739, 1724, 1721, 1818, 1732, 1998, 1884, 1890, 1733, 1684, 1837, 1769, 1820, 1822, 1799, 1881, - 1868, 1871, 1882, 1878, 1890, 1900, 1918, 1912, 1894, 1888, 1877, 1882, 1877, 1880, 1878, 1876, 1848, - 1866, 1791, 1720, 1661, 1609, 1584, 1564, 1557, 1548, 1575, 1735, 1724, 1642, 1666, 1666, 1794, 1819, - 1958, 1826, 1859, 1941, 2014, 2003, 1884, 1715, 1647, 1700, 1855, 1703, 1807, 1949, 1936, 2004, 1779, - 2019, 1970, 1846, 1853, 1737, 1857, 1941, 1910, 1806, 1695, 1748, 1736, 1981, 1851, 1893, 1940, 1926, - 1992, 1802, 1890, 2040, 2018, 1917, 1810, 1931, 1973, 1967, 1971, 1972, 1964, 1948, 1941, 1952, 1935, - 1927, 1940, 1963, 1960, 1941, 1913, 1902, 1895, 1909, 1897, 1787, 1695, 1712, 1654, 1751, 1676, 1700, - 1652, 1735, 1913, 1898, 1835, 1638, 1821, 1875, 1838, 1773, 1642, 1671, 1793, 1761, 1727, 1592, 1405, - 1324, 1385, 1270, 1364, 1712, 1862, 1843, 1803, 1722, 1542, 1416, 1381, 1356, 1764, 1839, 1795, 1698, - 1720, 1760, 1671, 1599, 1755, 1815, 1846, 1992, 1995, 1995, 1709, 1880, 1975, 1905, 2063, 2013, 2074, - 2058, 2010, 1924, 2046, 2029, 1911, 2002, 1995, 2019, 2065, 2072, 2046, 2092, 1994, 1921, 1998, 1863, - 1880, 2053, 2027, 1979, 1772, 1865, 1804, 1832, 2011, 1995, 1930, 1844, 1880, 1850, 1814, 2046, 1841, - 1997, 2004, 2008, 2001, 1998, 1917, 2010, 1979, 1917, 1815, 1914, 1852, 1888, 1899, 1772, 1765, 1980, - 1977, 1974, 1907, 1735, 1781, 1980, 1951, 1913, 1891, 1817, 1737, 1759, 1885, 1874, 1818, 1789, 1817, - 1888, 1850, 1977, 2050, 1910, 2073, 1818, 1919, 2051, 2034, 1966, 1980, 1992, 1859, 2003, 1902, 1888, - 2020, 1979, 1871, 2045, 1994, 1989, 1904, 2034, 1783, 1905, 2049, 2040, 1913, 1846, 1830, 1752, 1822, - 1998, 1974, 1911, 1846, 1880, 1864, 1875, 2067, 1922, 1971, 1841, 1958, 1981, 1944, 1999, 2001, 2013, - 2003, 2004, 2029, 2025, 1987, 1990, 1990, 2004, 2002, 1992, 1976, 2003, 2019, 1980, 1852, 1782, 1723, - 1659, 1654, 1634, 1901, 1675, 1691, 1871, 1994, 1948, 1715, 1708, 1771, 1666, 1708, 1824, 1790, 1724, - 1646, 1588, 1578, 1687, 1714, 1712, 1751, 1725, 1775, 1782, 1747, 1760, 1759, 1866, 1802, 1808, 1788, - 1786, 1722, 1679, 1702, 1697, 1757, 1721, 1752, 1772, 1743, 1755, 1743, 1756, 1734, 1707, 1839, 1786, - 1728, 1700, 1685, 1695, 1643, 1648, 1657, 1702, 1746, 1703, 1789, 1730, 1752, 1725, 1709, 1714, 1696, - 1807, 1764, 1735, 1707, 1676, 1727, 1685, 1654, 1650, 1764, 1707, 1642, 1949, 1961, 1921, 1878, 1866]; - const FLAC_2_12000 = - [0, 398, 412, 1043, 1225, 1156, 1131, 1083, 1038, 1016, 984, 1191, 1204, 1182, 1160, 1143, 1108, 1048, - 1013, 1514, 1468, 1437, 1359, 1291, 1330, 1259, 1174, 1139, 1114, 1061, 1020, 961, 1250, 1226, 1194, - 1164, 1144, 1355, 1336, 1248, 1438, 1426, 1360, 1275, 1201, 1409, 1361, 1311, 1269, 1221, 1171, 1127, - 1097, 1311, 1261, 1231, 1198, 1156, 1120, 1074, 1054, 1061, 1030, 1204, 1251, 1183, 1476, 1384, 1360, - 1374, 1336, 1376, 1361, 1386, 1506, 1458, 1587, 1588, 1471, 1414, 1335, 1316, 1299, 1272, 1278, 1217, - 1173, 1299, 1353, 1253, 1076, 1243, 1723, 1698, 1556, 1505, 1405, 1334, 1630, 1712, 1685, 1543, 1405, - 1618, 1717, 1630, 1431, 1388, 1581, 1675, 1653, 1652, 1394, 1458, 1732, 1662, 1545, 1587, 1639, 1712, - 1735, 1690, 1659, 1732, 1721, 1714, 1699, 1682, 1659, 1584, 1506, 1447, 1489, 1590, 1497, 1319, 1702, - 1616, 1487, 1679, 1607, 1557, 1484, 1408, 1687, 1655, 1583, 1619, 1651, 1569, 1494, 1401, 1454, 1391, - 1395, 1392, 1387, 1625, 1591, 1700, 1688, 1628, 1606, 1575, 1560, 1565, 1503, 1441, 1341, 1341, 1614, - 1654, 1633, 1475, 1691, 1594, 1581, 1432, 1696, 1557, 1633, 1715, 1692, 1694, 1642, 1664, 1805, 1727, - 1661, 1608, 1546, 1736, 1759, 1786, 1609, 1451, 1434, 1599, 1635, 1569, 1392, 1548, 1718, 1703, 1682, - 1604, 1642, 1687, 1677, 1678, 1631, 1569, 1534, 1400, 1363, 1308, 1456, 1560, 1451, 1424, 1724, 1722, - 1659, 1752, 1695, 1451, 1467, 1533, 1695, 1693, 1616, 1688, 1673, 1669, 1584, 1545, 1500, 1578, 1597, - 1517, 1669, 1742, 1703, 1694, 1630, 1570, 1639, 1646, 1619, 1703, 1694, 1624, 1375, 1479, 1873, 1811, - 1803, 1782, 1730, 1616, 1577, 1667, 1696, 1553, 1770, 1898, 1732, 1928, 1604, 1776, 1906, 1733, 1772, - 1732, 1673, 1784, 1783, 1752, 1633, 1585, 1661, 1608, 1683, 1717, 1625, 1866, 1816, 1744, 1741, 1624, - 1694, 1707, 1636, 1737, 1651, 1728, 1763, 1751, 1745, 1765, 1759, 1770, 1781, 1791, 1806, 1808, 1785, - 1768, 1763, 1764, 1777, 1766, 1773, 1764, 1773, 1748, 1750, 1679, 1600, 1557, 1499, 1471, 1455, 1441, - 1440, 1446, 1594, 1621, 1612, 1539, 1605, 1596, 1693, 1712, 1846, 1749, 1711, 1867, 1863, 1896, 1872, - 1711, 1589, 1547, 1603, 1748, 1590, 1678, 1842, 1810, 1865, 1776, 1734, 1885, 1787, 1818, 1688, 1637, - 1732, 1841, 1817, 1757, 1605, 1637, 1657, 1698, 1874, 1739, 1779, 1817, 1798, 1888, 1771, 1749, 1917, - 1938, 1850, 1796, 1771, 1865, 1852, 1855, 1860, 1853, 1850, 1833, 1814, 1823, 1818, 1806, 1812, 1824, - 1838, 1843, 1813, 1791, 1788, 1766, 1801, 1806, 1718, 1611, 1585, 1622, 1585, 1668, 1577, 1598, 1577, - 1548, 1821, 1812, 1757, 1686, 1555, 1819, 1773, 1734, 1692, 1564, 1578, 1719, 1718, 1671, 1607, 1425, - 1269, 1270, 1276, 1161, 1313, 1613, 1773, 1760, 1731, 1687, 1532, 1371, 1297, 1284, 1266, 1760, 1728, - 1695, 1589, 1591, 1660, 1608, 1531, 1491, 1727, 1659, 1826, 1876, 1880, 1880, 1599, 1736, 1882, 1768, - 1961, 1930, 2016, 1993, 1982, 1913, 1863, 1968, 1944, 1830, 1896, 1914, 1875, 1975, 1985, 1924, 2009, - 1964, 1880, 1838, 1905, 1782, 1801, 1943, 1933, 1910, 1710, 1750, 1746, 1718, 1782, 1909, 1883, 1844, - 1749, 1785, 1779, 1701, 1892, 1884, 1778, 1984, 1931, 1944, 1902, 1886, 1801, 1925, 1889, 1878, 1751, - 1818, 1796, 1779, 1850, 1774, 1675, 1678, 1877, 1868, 1884, 1772, 1762, 1582, 1835, 1827, 1844, 1765, - 1767, 1693, 1656, 1656, 1763, 1784, 1727, 1683, 1695, 1784, 1796, 1742, 1900, 1941, 1805, 1983, 1747, - 1797, 1937, 1904, 1911, 1839, 1925, 1842, 1746, 1938, 1793, 1800, 1910, 1909, 1713, 1920, 1889, 1883, - 1864, 1838, 1881, 1692, 1836, 1941, 1929, 1879, 1766, 1822, 1666, 1675, 1820, 1878, 1856, 1790, 1754, - 1799, 1767, 1753, 1953, 1886, 1774, 1856, 1759, 1894, 1826, 1835, 1869, 1866, 1880, 1874, 1879, 1902, - 1906, 1887, 1864, 1860, 1856, 1868, 1884, 1854, 1857, 1867, 1881, 1879, 1753, 1687, 1671, 1593, 1568, - 1558, 1542, 1800, 1573, 1602, 1692, 1865, 1847, 1700, 1615, 1701, 1592, 1557, 1643, 1712, 1689, 1619, - 1564, 1508, 1473, 1516, 1613, 1580, 1627, 1645, 1623, 1679, 1674, 1637, 1655, 1647, 1766, 1740, 1706]; - const FLAC_1_12000 = - [0, 457, 473, 1095, 1294, 1223, 1187, 1151, 1114, 1084, 1044, 1256, 1281, 1261, 1229, 1205, 1170, 1123, - 1075, 1582, 1550, 1499, 1433, 1350, 1409, 1323, 1247, 1197, 1173, 1136, 1088, 1021, 1311, 1298, 1272, - 1235, 1206, 1415, 1412, 1319, 1508, 1488, 1431, 1336, 1277, 1473, 1432, 1384, 1329, 1291, 1246, 1185, - 1167, 1386, 1319, 1299, 1276, 1222, 1177, 1145, 1128, 1135, 1100, 1268, 1315, 1259, 1546, 1448, 1430, - 1445, 1412, 1444, 1430, 1459, 1580, 1531, 1658, 1655, 1542, 1471, 1413, 1387, 1364, 1329, 1335, 1290, - 1246, 1362, 1428, 1328, 1149, 1308, 1794, 1755, 1626, 1577, 1473, 1414, 1696, 1769, 1749, 1615, 1474, - 1689, 1779, 1696, 1499, 1457, 1651, 1737, 1723, 1723, 1466, 1527, 1803, 1730, 1609, 1660, 1704, 1785, - 1805, 1758, 1730, 1798, 1786, 1773, 1755, 1743, 1728, 1650, 1574, 1517, 1554, 1664, 1566, 1388, 1774, - 1687, 1564, 1744, 1682, 1636, 1557, 1466, 1754, 1733, 1653, 1691, 1725, 1629, 1564, 1460, 1524, 1454, - 1457, 1455, 1452, 1693, 1660, 1761, 1746, 1710, 1686, 1639, 1621, 1622, 1574, 1504, 1414, 1411, 1685, - 1725, 1709, 1537, 1761, 1662, 1648, 1503, 1759, 1615, 1700, 1776, 1753, 1754, 1717, 1729, 1874, 1796, - 1732, 1682, 1619, 1807, 1838, 1860, 1679, 1519, 1503, 1677, 1711, 1639, 1453, 1617, 1784, 1760, 1748, - 1677, 1715, 1748, 1741, 1741, 1703, 1633, 1597, 1466, 1437, 1379, 1523, 1616, 1519, 1495, 1792, 1783, - 1730, 1832, 1766, 1518, 1542, 1602, 1753, 1750, 1677, 1747, 1747, 1737, 1650, 1607, 1570, 1649, 1671, - 1585, 1738, 1812, 1764, 1756, 1706, 1630, 1710, 1722, 1694, 1757, 1763, 1691, 1441, 1543, 1938, 1877, - 1871, 1855, 1797, 1687, 1640, 1732, 1766, 1619, 1838, 1973, 1798, 2001, 1675, 1845, 1975, 1799, 1836, - 1795, 1746, 1858, 1859, 1822, 1701, 1647, 1729, 1679, 1747, 1775, 1695, 1929, 1878, 1816, 1808, 1692, - 1766, 1770, 1705, 1806, 1722, 1793, 1828, 1827, 1817, 1849, 1841, 1845, 1854, 1862, 1877, 1874, 1859, - 1849, 1842, 1844, 1852, 1848, 1849, 1846, 1850, 1821, 1825, 1740, 1676, 1613, 1574, 1551, 1528, 1507, - 1506, 1516, 1663, 1698, 1685, 1606, 1679, 1667, 1759, 1781, 1920, 1820, 1788, 1931, 1927, 1972, 1943, - 1779, 1658, 1608, 1669, 1820, 1657, 1752, 1901, 1878, 1943, 1839, 1805, 1959, 1859, 1892, 1760, 1713, - 1797, 1899, 1881, 1828, 1674, 1709, 1724, 1766, 1944, 1802, 1846, 1882, 1871, 1963, 1842, 1822, 1986, - 2010, 1921, 1870, 1835, 1923, 1911, 1913, 1921, 1911, 1907, 1893, 1879, 1885, 1883, 1874, 1879, 1886, - 1898, 1896, 1880, 1865, 1861, 1844, 1872, 1872, 1779, 1678, 1650, 1695, 1652, 1731, 1650, 1665, 1647, - 1609, 1884, 1876, 1825, 1754, 1623, 1891, 1853, 1803, 1754, 1626, 1646, 1782, 1780, 1737, 1673, 1497, - 1331, 1337, 1340, 1229, 1382, 1681, 1851, 1840, 1800, 1751, 1602, 1439, 1366, 1344, 1332, 1837, 1792, - 1751, 1659, 1664, 1729, 1683, 1604, 1557, 1796, 1728, 1899, 1944, 1949, 1945, 1663, 1808, 1955, 1845, - 2032, 2001, 2079, 2051, 2047, 1980, 1926, 2035, 2010, 1900, 1964, 1992, 1944, 2038, 2046, 1992, 2074, - 2025, 1945, 1894, 1986, 1855, 1868, 2012, 2005, 1988, 1772, 1812, 1817, 1781, 1855, 1990, 1955, 1904, - 1822, 1858, 1853, 1758, 1960, 1951, 1851, 2045, 2003, 2013, 1988, 1960, 1864, 1996, 1963, 1950, 1825, - 1886, 1864, 1852, 1914, 1844, 1737, 1748, 1943, 1933, 1956, 1837, 1832, 1648, 1902, 1890, 1901, 1835, - 1842, 1763, 1725, 1722, 1836, 1856, 1798, 1743, 1754, 1855, 1868, 1816, 1976, 2012, 1884, 2042, 1812, - 1861, 2008, 1981, 1983, 1903, 2001, 1906, 1816, 2003, 1852, 1869, 1990, 1985, 1782, 1994, 1962, 1950, - 1930, 1905, 1953, 1751, 1903, 2012, 2004, 1940, 1832, 1888, 1729, 1745, 1893, 1947, 1919, 1858, 1828, - 1870, 1843, 1818, 2020, 1950, 1839, 1925, 1827, 1957, 1891, 1901, 1930, 1932, 1949, 1943, 1950, 1982, - 1984, 1960, 1926, 1923, 1916, 1931, 1954, 1916, 1915, 1933, 1952, 1950, 1823, 1751, 1735, 1665, 1627, - 1619, 1603, 1860, 1630, 1663, 1760, 1928, 1910, 1773, 1692, 1769, 1652, 1614, 1717, 1767, 1747, 1691, - 1621, 1580, 1547, 1590, 1683, 1645, 1696, 1719, 1701, 1739, 1735, 1713, 1728, 1721, 1843, 1808, 1767]; - const FLAC_2_16000 = - [0, 416, 418, 426, 1010, 1021, 1003, 956, 948, 924, 898, 884, 871, 861, 927, 1036, 1010, 995, 993, 975, - 972, 948, 919, 885, 873, 1396, 1356, 1315, 1269, 1221, 1149, 1115, 1114, 1045, 996, 983, 953, 929, 907, - 898, 869, 844, 1001, 1050, 1027, 1004, 990, 980, 974, 1139, 1205, 1108, 1064, 1249, 1234, 1187, 1143, - 1081, 1030, 1055, 1208, 1158, 1114, 1096, 1049, 1017, 1002, 971, 938, 909, 1092, 1129, 1041, 1043, 1039, - 992, 973, 946, 927, 907, 911, 901, 896, 872, 1062, 1089, 1016, 1145, 1266, 1201, 1148, 1183, 1151, 1127, - 1145, 1227, 1170, 1129, 1370, 1301, 1291, 1384, 1478, 1408, 1321, 1256, 1177, 1136, 1133, 1099, 1085, - 1050, 1044, 1022, 994, 1034, 1191, 1280, 1230, 1018, 950, 990, 1470, 1620, 1570, 1427, 1315, 1389, 1291, - 1241, 1336, 1568, 1598, 1593, 1513, 1334, 1296, 1445, 1581, 1584, 1440, 1311, 1147, 1470, 1489, 1543, - 1558, 1539, 1514, 1319, 1192, 1546, 1585, 1550, 1331, 1635, 1640, 1639, 1567, 1657, 1644, 1593, 1608, - 1573, 1620, 1625, 1629, 1620, 1632, 1611, 1579, 1522, 1446, 1383, 1308, 1265, 1398, 1536, 1494, 1305, - 1204, 1521, 1574, 1416, 1378, 1569, 1557, 1410, 1505, 1446, 1392, 1348, 1568, 1515, 1478, 1444, 1505, - 1542, 1463, 1438, 1341, 1259, 1278, 1247, 1199, 1191, 1219, 1212, 1265, 1482, 1487, 1540, 1587, 1579, - 1548, 1530, 1520, 1473, 1468, 1444, 1447, 1380, 1302, 1226, 1174, 1155, 1405, 1521, 1579, 1560, 1383, - 1400, 1689, 1483, 1553, 1323, 1377, 1552, 1429, 1405, 1536, 1604, 1593, 1561, 1540, 1533, 1536, 1569, - 1690, 1617, 1450, 1540, 1635, 1585, 1547, 1639, 1621, 1674, 1634, 1394, 1342, 1275, 1497, 1508, 1513, - 1483, 1299, 1209, 1536, 1639, 1633, 1614, 1596, 1535, 1541, 1573, 1594, 1599, 1576, 1582, 1535, 1493, - 1474, 1381, 1259, 1283, 1153, 1204, 1384, 1460, 1424, 1185, 1365, 1564, 1602, 1599, 1517, 1623, 1623, - 1433, 1362, 1408, 1380, 1522, 1577, 1567, 1445, 1549, 1553, 1526, 1583, 1501, 1436, 1375, 1348, 1397, - 1504, 1532, 1441, 1336, 1557, 1649, 1636, 1609, 1598, 1548, 1468, 1430, 1543, 1516, 1497, 1503, 1585, - 1616, 1490, 1582, 1185, 1281, 1723, 1770, 1711, 1713, 1710, 1669, 1658, 1643, 1625, 1614, 1587, 1614, - 1617, 1432, 1684, 1760, 1720, 1644, 1863, 1532, 1498, 1841, 1828, 1675, 1579, 1767, 1647, 1560, 1704, - 1699, 1701, 1676, 1579, 1498, 1474, 1569, 1581, 1444, 1641, 1613, 1564, 1483, 1784, 1746, 1513, 1758, - 1736, 1588, 1535, 1722, 1699, 1594, 1622, 1688, 1514, 1536, 1701, 1627, 1616, 1617, 1614, 1614, 1617, - 1621, 1614, 1629, 1629, 1641, 1655, 1663, 1654, 1638, 1639, 1651, 1650, 1648, 1638, 1644, 1638, 1634, - 1647, 1634, 1627, 1631, 1585, 1523, 1464, 1420, 1379, 1348, 1333, 1321, 1304, 1299, 1292, 1309, 1397, - 1518, 1524, 1514, 1421, 1600, 1638, 1564, 1602, 1557, 1621, 1722, 1691, 1571, 1759, 1859, 1756, 1805, - 1811, 1798, 1686, 1564, 1462, 1432, 1433, 1575, 1611, 1467, 1653, 1701, 1757, 1752, 1739, 1817, 1648, - 1608, 1837, 1789, 1642, 1673, 1711, 1522, 1579, 1609, 1746, 1743, 1744, 1712, 1563, 1469, 1552, 1579, - 1524, 1689, 1739, 1596, 1655, 1706, 1711, 1677, 1772, 1802, 1719, 1747, 1837, 1843, 1853, 1775, 1809, - 1821, 1747, 1793, 1753, 1739, 1736, 1736, 1723, 1723, 1725, 1737, 1722, 1730, 1729, 1720, 1726, 1705, - 1719, 1718, 1730, 1734, 1726, 1717, 1696, 1701, 1678, 1655, 1706, 1697, 1685, 1608, 1541, 1473, 1506, - 1693, 1473, 1570, 1604, 1518, 1370, 1604, 1627, 1498, 1622, 1702, 1701, 1659, 1633, 1478, 1568, 1823, - 1721, 1683, 1616, 1592, 1546, 1539, 1546, 1569, 1592, 1566, 1550, 1501, 1383, 1242, 1142, 1139, 1197, - 1136, 1038, 1126, 1450, 1579, 1671, 1658, 1646, 1627, 1563, 1451, 1333, 1213, 1157, 1152, 1135, 1326, - 1656, 1623, 1604, 1575, 1505, 1546, 1601, 1600, 1563, 1475, 1457, 1512, 1737, 1697, 1676, 1805, 1775, - 1791, 1790, 1708, 1476, 1591, 1844, 1814, 1717, 1895, 1904, 1932, 2009, 1932, 1910, 1927, 1889, 1893, - 1875, 1905, 1887, 1797, 1775, 1887, 1887, 1858, 1911, 1902, 1917, 1871, 1901, 1922, 1870, 1813, 1774, - 1757, 1860, 1826, 1832, 1781, 1867, 1850, 1839, 1803, 1622, 1656, 1726, 1678, 1647, 1702, 1818, 1825]; - const FLAC_1_16000 = - [0, 489, 491, 494, 1080, 1089, 1055, 1018, 1015, 994, 973, 947, 935, 922, 990, 1109, 1074, 1053, 1046, - 1032, 1029, 1011, 992, 950, 940, 1462, 1432, 1387, 1328, 1293, 1214, 1172, 1176, 1120, 1058, 1036, - 1017, 1001, 986, 976, 931, 893, 1067, 1130, 1095, 1064, 1048, 1038, 1030, 1212, 1276, 1173, 1140, 1314, - 1301, 1266, 1207, 1148, 1103, 1118, 1281, 1224, 1170, 1160, 1124, 1083, 1060, 1026, 1004, 985, 1155, - 1185, 1117, 1120, 1114, 1050, 1031, 1006, 999, 986, 983, 974, 968, 941, 1131, 1158, 1078, 1216, 1334, - 1275, 1209, 1261, 1220, 1183, 1213, 1297, 1238, 1186, 1440, 1367, 1357, 1449, 1554, 1471, 1399, 1318, - 1252, 1195, 1193, 1163, 1154, 1130, 1124, 1090, 1047, 1093, 1262, 1337, 1299, 1076, 1013, 1063, 1538, - 1688, 1630, 1495, 1386, 1450, 1358, 1305, 1400, 1630, 1672, 1666, 1586, 1401, 1366, 1518, 1648, 1654, - 1513, 1383, 1210, 1537, 1558, 1603, 1614, 1598, 1582, 1386, 1266, 1615, 1652, 1614, 1395, 1696, 1713, - 1707, 1635, 1726, 1717, 1664, 1683, 1636, 1699, 1704, 1708, 1699, 1710, 1687, 1643, 1589, 1514, 1445, - 1379, 1322, 1468, 1601, 1563, 1379, 1276, 1590, 1645, 1473, 1445, 1638, 1622, 1484, 1572, 1514, 1453, - 1415, 1642, 1589, 1560, 1514, 1578, 1603, 1538, 1500, 1412, 1322, 1336, 1308, 1278, 1274, 1292, 1285, - 1335, 1548, 1557, 1613, 1653, 1642, 1605, 1597, 1588, 1548, 1540, 1512, 1511, 1448, 1368, 1297, 1246, - 1225, 1474, 1591, 1644, 1623, 1450, 1471, 1760, 1551, 1623, 1388, 1439, 1611, 1489, 1465, 1602, 1677, - 1661, 1618, 1602, 1597, 1601, 1638, 1756, 1692, 1516, 1608, 1713, 1660, 1613, 1710, 1696, 1739, 1700, - 1456, 1412, 1339, 1573, 1579, 1575, 1560, 1362, 1278, 1612, 1707, 1708, 1692, 1672, 1596, 1599, 1634, - 1664, 1671, 1638, 1647, 1598, 1568, 1550, 1449, 1326, 1349, 1216, 1271, 1451, 1540, 1493, 1252, 1439, - 1635, 1679, 1676, 1583, 1700, 1704, 1498, 1425, 1466, 1445, 1591, 1639, 1626, 1509, 1615, 1609, 1598, - 1648, 1575, 1500, 1445, 1425, 1468, 1576, 1596, 1508, 1404, 1628, 1718, 1711, 1682, 1669, 1608, 1543, - 1491, 1607, 1586, 1570, 1575, 1647, 1692, 1555, 1657, 1251, 1351, 1793, 1844, 1770, 1774, 1768, 1734, - 1727, 1716, 1700, 1688, 1656, 1691, 1690, 1494, 1753, 1835, 1782, 1711, 1925, 1602, 1573, 1911, 1892, - 1743, 1644, 1844, 1719, 1625, 1764, 1757, 1755, 1738, 1651, 1572, 1543, 1633, 1645, 1506, 1710, 1684, - 1627, 1561, 1855, 1816, 1579, 1828, 1797, 1658, 1596, 1786, 1764, 1664, 1690, 1746, 1578, 1608, 1766, - 1702, 1691, 1696, 1692, 1691, 1696, 1699, 1694, 1706, 1707, 1716, 1726, 1729, 1726, 1713, 1713, 1724, - 1722, 1722, 1711, 1717, 1714, 1710, 1720, 1711, 1704, 1706, 1654, 1588, 1539, 1477, 1446, 1425, 1409, - 1399, 1377, 1370, 1359, 1381, 1470, 1584, 1588, 1581, 1489, 1670, 1711, 1633, 1668, 1619, 1688, 1784, - 1761, 1646, 1825, 1923, 1833, 1872, 1876, 1868, 1753, 1631, 1536, 1497, 1495, 1647, 1682, 1540, 1721, - 1769, 1835, 1831, 1806, 1882, 1714, 1677, 1900, 1861, 1707, 1738, 1783, 1589, 1647, 1674, 1817, 1817, - 1820, 1774, 1631, 1551, 1617, 1650, 1590, 1758, 1811, 1662, 1725, 1776, 1774, 1744, 1846, 1870, 1781, - 1819, 1906, 1899, 1912, 1845, 1879, 1886, 1813, 1864, 1829, 1812, 1803, 1808, 1791, 1789, 1789, 1809, - 1791, 1796, 1796, 1783, 1791, 1764, 1779, 1780, 1797, 1803, 1784, 1781, 1753, 1757, 1741, 1723, 1766, - 1760, 1746, 1679, 1604, 1553, 1578, 1755, 1540, 1638, 1678, 1582, 1440, 1678, 1705, 1573, 1685, 1759, - 1759, 1727, 1711, 1543, 1636, 1893, 1783, 1741, 1682, 1665, 1611, 1598, 1607, 1630, 1661, 1621, 1607, - 1572, 1451, 1314, 1203, 1201, 1276, 1199, 1113, 1197, 1520, 1650, 1735, 1728, 1719, 1706, 1631, 1519, - 1399, 1288, 1224, 1215, 1194, 1398, 1722, 1695, 1683, 1640, 1575, 1608, 1675, 1670, 1622, 1544, 1527, - 1588, 1812, 1752, 1739, 1872, 1850, 1862, 1861, 1774, 1538, 1660, 1902, 1880, 1778, 1960, 1981, 1996, - 2078, 2003, 1990, 2002, 1962, 1962, 1938, 1986, 1963, 1871, 1853, 1959, 1963, 1918, 1989, 1980, 1994, - 1943, 1975, 1996, 1939, 1880, 1851, 1838, 1924, 1891, 1897, 1856, 1930, 1905, 1897, 1870, 1701, 1729]; - const FLAC_2_22050 = - [0, 860, 869, 1718, 1700, 1624, 1603, 1521, 1503, 1459, 1720, 1702, 1662, 1660, 1646, 1590, 1505, 2001, - 2289, 2135, 2001, 1881, 1873, 1741, 1662, 1604, 1553, 1520, 1464, 1654, 1738, 1704, 1686, 1644, 1905, - 1887, 1828, 2035, 1978, 1855, 1754, 1867, 1919, 1810, 1754, 1702, 1650, 1579, 1659, 1819, 1723, 1728, - 1662, 1620, 1564, 1540, 1536, 1490, 1741, 1761, 1873, 2007, 1884, 1940, 1843, 1896, 1955, 1948, 2287, - 2169, 2518, 2382, 2108, 1956, 1836, 1823, 1772, 1759, 1701, 1712, 2179, 2367, 1933, 1696, 2516, 3071, - 3006, 2669, 2716, 2462, 2866, 3128, 3074, 2698, 2527, 3093, 3099, 2631, 2298, 2948, 3046, 3080, 3007, - 2529, 2784, 3122, 2817, 3315, 3416, 3098, 3272, 3166, 3130, 3165, 3218, 3247, 3215, 3145, 3037, 2802, - 2462, 2412, 3008, 2884, 2262, 3072, 2825, 2705, 3145, 2798, 2927, 2836, 2826, 3088, 2933, 2965, 3058, - 2847, 2626, 2383, 2239, 2134, 2136, 2301, 2930, 3064, 3217, 3178, 3130, 3088, 2983, 2889, 2799, 2535, - 2258, 2141, 2719, 3007, 2977, 2429, 3295, 2947, 2703, 2818, 2782, 2641, 3127, 3036, 2972, 2948, 2999, - 3309, 3031, 3012, 3516, 2991, 3221, 3256, 3217, 2672, 2579, 2970, 2934, 2855, 2289, 3181, 3232, 3193, - 3100, 3104, 3162, 3197, 3144, 3063, 3017, 2799, 2474, 2206, 2339, 2838, 2782, 2426, 3107, 3216, 3055, - 3185, 2912, 2693, 2798, 3022, 3125, 2879, 3083, 3013, 2973, 2720, 2458, 2572, 2971, 2919, 2545, 3257, - 3189, 3130, 3012, 2825, 2967, 2968, 2911, 3134, 3075, 3052, 2264, 3317, 3376, 3294, 3254, 3167, 3283, - 3404, 3099, 3419, 2874, 3355, 3279, 3423, 3219, 3158, 3628, 3306, 3448, 3282, 3219, 3348, 3285, 3068, - 2832, 3041, 3085, 3130, 3166, 2910, 3505, 3261, 3412, 3531, 2963, 3399, 3285, 3236, 3231, 2979, 3218, - 3137, 3136, 3146, 3138, 3142, 3157, 3160, 3202, 3180, 3158, 3159, 3189, 3204, 3243, 3222, 3222, 3115, - 3101, 2973, 2799, 2595, 2472, 2389, 2352, 2315, 2324, 2538, 2885, 2948, 2698, 3480, 3321, 3146, 3115, - 3364, 3091, 3494, 3567, 3626, 3600, 3341, 2935, 2705, 2713, 3144, 2886, 3482, 3551, 3494, 3609, 3178, - 3609, 3463, 3190, 3281, 3102, 3361, 3495, 3457, 3225, 2870, 3138, 3005, 3423, 3199, 3202, 3370, 3244, - 3497, 3616, 3727, 3668, 3611, 3572, 3665, 3479, 3454, 3446, 3429, 3457, 3468, 3455, 3456, 3445, 3431, - 3406, 3423, 3444, 3440, 3406, 3387, 3335, 3343, 3384, 3317, 3080, 2793, 3385, 2824, 3136, 2892, 2980, - 3416, 3018, 3350, 3326, 3190, 2843, 3661, 3366, 3231, 3112, 3148, 3180, 3139, 3110, 3050, 2793, 2329, - 2123, 2251, 2007, 2195, 3005, 3227, 3202, 3147, 2962, 2630, 2280, 2112, 2152, 2952, 3274, 3238, 3061, - 3162, 3240, 3101, 2969, 3049, 3398, 3406, 3560, 3487, 3471, 2994, 3415, 3652, 3433, 3728, 3838, 3808, - 3742, 3793, 3830, 3790, 3713, 3440, 3718, 3719, 3725, 3740, 3751, 3683, 3729, 3618, 3517, 3689, 3781, - 3604, 3650, 3587, 3449, 3110, 3326, 3168, 3201, 3570, 3587, 3512, 3235, 3428, 3332, 3581, 3675, 3239, - 3791, 3979, 3941, 3514, 3476, 3485, 3812, 3496, 3816, 3536, 3574, 3815, 3754, 3360, 3106, 3216, 3401, - 3429, 3500, 3461, 2964, 3057, 3665, 3591, 3563, 3515, 3274, 3286, 3335, 3290, 3262, 3144, 3112, 3190, - 3463, 3270, 3449, 3730, 3464, 3695, 3100, 3492, 3633, 3583, 3668, 3712, 3776, 3400, 3698, 3371, 3635, - 3646, 3486, 3452, 3771, 3632, 3640, 3467, 3715, 3189, 3617, 3624, 3679, 3830, 3485, 3305, 3012, 3221, - 3531, 3497, 3397, 3280, 3429, 3345, 3286, 3692, 3472, 3524, 3194, 3646, 3594, 3524, 3677, 3701, 3718, - 3704, 3690, 3708, 3711, 3689, 3697, 3687, 3703, 3697, 3732, 3723, 3702, 3724, 3653, 3308, 3238, 3142, - 2963, 2874, 2782, 3311, 2787, 2913, 3326, 3637, 3485, 3296, 3505, 3113, 2835, 2914, 3223, 3142, 2963, - 2829, 2575, 2509, 2751, 2723, 2655, 2805, 2726, 2884, 2889, 2836, 2840, 2821, 3010, 2862, 2891, 2828, - 2857, 2737, 2637, 2653, 2673, 2827, 2783, 2810, 2847, 2782, 2850, 2822, 2817, 2781, 2667, 2955, 2844, - 2708, 2652, 2581, 2493, 2444, 2500, 2547, 2680, 2832, 2652, 2850, 2685, 2811, 2781, 2721, 2713, 2613, - 3022, 2883, 2822, 2682, 2636, 2684, 2622, 2543, 2562, 3081, 2845, 2733, 3243, 3237, 3153, 3113, 3066]; - const FLAC_1_22050 = - [0, 986, 985, 1860, 1833, 1740, 1719, 1669, 1661, 1609, 1853, 1837, 1788, 1767, 1750, 1713, 1661, 2132, - 2432, 2273, 2135, 2006, 1999, 1883, 1771, 1726, 1690, 1669, 1619, 1798, 1889, 1834, 1814, 1758, 2043, - 2022, 1977, 2189, 2104, 1987, 1905, 2001, 2037, 1957, 1907, 1838, 1762, 1706, 1798, 1958, 1866, 1870, - 1773, 1737, 1692, 1679, 1676, 1646, 1876, 1904, 2009, 2144, 2011, 2049, 1979, 2038, 2076, 2086, 2420, - 2295, 2665, 2517, 2259, 2074, 1974, 1964, 1928, 1915, 1834, 1849, 2324, 2520, 2077, 1825, 2659, 3212, - 3145, 2813, 2860, 2598, 2997, 3264, 3201, 2833, 2654, 3230, 3225, 2774, 2443, 3097, 3174, 3200, 3148, - 2658, 2926, 3257, 2962, 3450, 3552, 3239, 3417, 3304, 3266, 3315, 3378, 3401, 3373, 3289, 3173, 2935, - 2611, 2564, 3141, 3024, 2395, 3210, 2966, 2853, 3290, 2939, 3063, 2968, 2967, 3232, 3079, 3107, 3191, - 2984, 2759, 2518, 2367, 2276, 2275, 2431, 3066, 3205, 3354, 3321, 3261, 3209, 3128, 3050, 2931, 2665, - 2395, 2278, 2862, 3145, 3118, 2579, 3428, 3088, 2832, 2959, 2927, 2793, 3267, 3163, 3121, 3106, 3129, - 3441, 3178, 3144, 3662, 3128, 3360, 3406, 3355, 2820, 2712, 3118, 3075, 3002, 2425, 3318, 3381, 3352, - 3237, 3223, 3314, 3350, 3283, 3192, 3154, 2939, 2619, 2347, 2475, 2979, 2933, 2567, 3251, 3368, 3196, - 3343, 3051, 2828, 2920, 3166, 3260, 3019, 3208, 3153, 3115, 2864, 2596, 2706, 3111, 3052, 2689, 3396, - 3346, 3268, 3150, 2953, 3108, 3119, 3065, 3273, 3220, 3197, 2393, 3453, 3516, 3430, 3404, 3320, 3424, - 3535, 3235, 3566, 3016, 3483, 3426, 3562, 3368, 3295, 3760, 3439, 3593, 3437, 3350, 3471, 3426, 3210, - 2961, 3178, 3230, 3263, 3311, 3055, 3644, 3404, 3549, 3665, 3110, 3531, 3411, 3358, 3371, 3122, 3356, - 3281, 3273, 3284, 3274, 3286, 3310, 3306, 3369, 3338, 3306, 3307, 3349, 3370, 3393, 3383, 3382, 3242, - 3224, 3121, 2930, 2735, 2598, 2538, 2511, 2467, 2483, 2676, 3039, 3105, 2842, 3628, 3463, 3281, 3257, - 3512, 3237, 3624, 3715, 3752, 3733, 3490, 3072, 2846, 2863, 3282, 3033, 3626, 3696, 3629, 3748, 3331, - 3743, 3610, 3335, 3416, 3225, 3497, 3648, 3607, 3369, 3016, 3281, 3140, 3564, 3322, 3339, 3487, 3384, - 3651, 3760, 3863, 3785, 3742, 3725, 3817, 3614, 3607, 3594, 3568, 3611, 3624, 3605, 3609, 3590, 3570, - 3530, 3561, 3593, 3586, 3539, 3508, 3460, 3477, 3504, 3447, 3224, 2919, 3525, 2960, 3283, 3031, 3129, - 3556, 3163, 3472, 3453, 3345, 2992, 3809, 3486, 3369, 3241, 3290, 3330, 3281, 3235, 3177, 2938, 2459, - 2269, 2380, 2136, 2330, 3150, 3384, 3361, 3290, 3100, 2764, 2418, 2262, 2291, 3092, 3416, 3389, 3188, - 3312, 3394, 3248, 3114, 3195, 3524, 3534, 3707, 3645, 3629, 3126, 3549, 3799, 3561, 3879, 3980, 3949, - 3884, 3936, 3971, 3926, 3852, 3567, 3868, 3862, 3857, 3887, 3907, 3832, 3869, 3748, 3669, 3832, 3945, - 3743, 3779, 3727, 3594, 3238, 3452, 3307, 3341, 3713, 3720, 3666, 3386, 3564, 3480, 3722, 3809, 3386, - 3928, 4115, 4061, 3669, 3638, 3630, 3947, 3650, 3966, 3666, 3709, 3969, 3882, 3489, 3239, 3359, 3531, - 3569, 3656, 3602, 3106, 3195, 3798, 3732, 3710, 3672, 3421, 3424, 3470, 3430, 3408, 3290, 3238, 3321, - 3623, 3418, 3592, 3877, 3606, 3827, 3249, 3637, 3764, 3721, 3787, 3848, 3941, 3538, 3836, 3510, 3779, - 3778, 3628, 3587, 3904, 3760, 3758, 3604, 3858, 3326, 3761, 3757, 3802, 3973, 3630, 3438, 3148, 3356, - 3683, 3659, 3546, 3422, 3572, 3484, 3421, 3831, 3609, 3653, 3338, 3783, 3730, 3668, 3804, 3836, 3859, - 3837, 3820, 3846, 3854, 3815, 3828, 3811, 3834, 3831, 3881, 3864, 3829, 3869, 3796, 3442, 3395, 3281, - 3111, 3025, 2903, 3458, 2924, 3041, 3459, 3756, 3631, 3438, 3645, 3254, 2963, 3049, 3369, 3287, 3106, - 2955, 2714, 2625, 2902, 2875, 2809, 2925, 2862, 3039, 3050, 2966, 2973, 2942, 3152, 3008, 3048, 2958, - 2993, 2865, 2799, 2811, 2823, 2961, 2908, 2926, 2986, 2905, 2987, 2949, 2948, 2927, 2822, 3098, 2980, - 2850, 2807, 2726, 2622, 2582, 2621, 2680, 2818, 2963, 2812, 2990, 2836, 2950, 2902, 2855, 2850, 2772, - 3152, 3029, 2952, 2832, 2785, 2834, 2783, 2670, 2692, 3231, 2991, 2881, 3382, 3376, 3297, 3241, 3188]; - const FLAC_2_24000 = - [0, 886, 878, 1601, 1662, 1573, 1545, 1510, 1467, 1451, 1423, 1675, 1646, 1603, 1582, 1565, 1534, 1475, - 1443, 2271, 2113, 1991, 1894, 1773, 1789, 1686, 1597, 1552, 1522, 1480, 1453, 1410, 1702, 1665, 1649, - 1612, 1573, 1859, 1815, 1709, 1967, 1926, 1821, 1727, 1662, 1883, 1791, 1735, 1684, 1648, 1571, 1524, - 1517, 1760, 1685, 1672, 1633, 1576, 1530, 1497, 1494, 1481, 1445, 1674, 1711, 1634, 1980, 1840, 1797, - 1819, 1741, 1880, 1839, 1913, 2170, 2058, 2365, 2330, 2069, 1928, 1784, 1753, 1725, 1695, 1695, 1645, - 1679, 2146, 2350, 2033, 1684, 2040, 3016, 3010, 2815, 2760, 2637, 2456, 2925, 3114, 3068, 2777, 2546, - 2926, 3114, 2883, 2537, 2579, 2857, 3086, 3076, 3004, 2538, 2638, 3129, 3013, 2709, 3481, 3397, 3212, - 3228, 3182, 3141, 3147, 3219, 3246, 3214, 3179, 3115, 2920, 2637, 2303, 2587, 3076, 2829, 2270, 3046, - 2861, 2615, 3118, 3019, 2930, 2885, 2751, 2997, 3026, 2915, 2984, 3041, 2837, 2641, 2325, 2228, 2102, - 2067, 2063, 2469, 3055, 3103, 3219, 3186, 3125, 3096, 3034, 2907, 2861, 2645, 2417, 2132, 2172, 2800, - 3024, 2945, 2398, 3393, 2874, 2885, 2548, 2970, 2657, 2892, 3106, 2984, 2933, 2961, 2988, 3342, 3125, - 2908, 3486, 3105, 3200, 3217, 3293, 2991, 2635, 2620, 2971, 2947, 2885, 2300, 3077, 3231, 3249, 3172, - 3100, 3127, 3191, 3205, 3149, 3066, 3044, 2870, 2499, 2290, 2138, 2627, 2916, 2586, 2590, 3152, 3214, - 3051, 3198, 3053, 2551, 2810, 2854, 3135, 3126, 2878, 3082, 3030, 2930, 2680, 2415, 2447, 2942, 3033, - 2651, 2978, 3269, 3156, 3124, 2959, 2811, 2987, 2982, 2923, 3114, 3169, 3098, 2440, 2678, 3468, 3278, - 3267, 3244, 3148, 3257, 3404, 3101, 3270, 3184, 3128, 3438, 3038, 3675, 3048, 3261, 3590, 3306, 3400, - 3304, 3121, 3352, 3299, 3184, 2908, 2802, 3139, 3008, 3274, 3170, 2886, 3435, 3379, 3231, 3690, 3054, - 3244, 3395, 3106, 3278, 3029, 3054, 3218, 3145, 3141, 3149, 3132, 3115, 3143, 3125, 3143, 3189, 3153, - 3133, 3140, 3174, 3186, 3227, 3221, 3193, 3159, 3063, 3059, 2889, 2722, 2519, 2399, 2325, 2300, 2268, - 2266, 2392, 2776, 2916, 2932, 2745, 3560, 3206, 3158, 3107, 3363, 3148, 3245, 3575, 3576, 3608, 3538, - 3196, 2821, 2629, 2692, 3145, 2780, 3513, 3554, 3626, 3622, 3377, 3412, 3588, 3285, 3338, 3202, 3085, - 3341, 3484, 3481, 3379, 2930, 3015, 3158, 2949, 3448, 3177, 3175, 3370, 3229, 3494, 3646, 3713, 3643, - 3664, 3479, 3724, 3487, 3484, 3480, 3468, 3439, 3470, 3480, 3492, 3475, 3491, 3458, 3445, 3442, 3458, - 3457, 3439, 3409, 3397, 3316, 3301, 3381, 3382, 3250, 2890, 2773, 3378, 2823, 3144, 2850, 2941, 3490, - 2979, 3325, 3335, 3209, 3099, 3039, 3661, 3368, 3203, 3106, 3203, 3218, 3130, 3131, 3066, 2942, 2561, - 2180, 2149, 2188, 1952, 2274, 3013, 3229, 3219, 3160, 3043, 2755, 2385, 2139, 2042, 2152, 3190, 3267, - 3233, 3085, 3186, 3220, 3232, 3029, 2736, 3368, 3375, 3517, 3549, 3504, 3465, 2963, 3311, 3694, 3309, - 3669, 3573, 3989, 3727, 3697, 3807, 3777, 3774, 3703, 3428, 3649, 3765, 3675, 3792, 3758, 3588, 3815, - 3705, 3561, 3478, 3676, 3797, 3622, 3602, 3603, 3561, 3158, 3250, 3288, 3099, 3252, 3614, 3570, 3515, - 3219, 3398, 3417, 3194, 3776, 3517, 3309, 3888, 3974, 3871, 3482, 3455, 3371, 3835, 3479, 3719, 3714, - 3424, 3793, 3840, 3548, 3312, 3077, 3226, 3369, 3391, 3516, 3287, 3335, 2800, 3516, 3609, 3661, 3582, - 3583, 3223, 3288, 3292, 3267, 3310, 3166, 3111, 3060, 3339, 3433, 3131, 3562, 3727, 3427, 3674, 3145, - 3390, 3633, 3542, 3669, 3670, 3745, 3708, 3345, 3731, 3324, 3579, 3666, 3592, 3187, 3825, 3652, 3620, - 3557, 3442, 3642, 3115, 3584, 3625, 3641, 3843, 3526, 3532, 3064, 3007, 3395, 3540, 3525, 3339, 3264, - 3429, 3363, 3150, 3632, 3698, 3253, 3507, 3279, 3554, 3543, 3516, 3671, 3689, 3690, 3692, 3690, 3690, - 3726, 3703, 3684, 3686, 3637, 3710, 3705, 3724, 3732, 3679, 3711, 3714, 3372, 3213, 3194, 3055, 2898, - 2833, 2763, 3385, 2714, 2873, 3222, 3687, 3596, 3108, 3478, 3454, 2971, 2750, 3006, 3206, 3155, 3008, - 2842, 2628, 2466, 2522, 2781, 2584, 2663, 2713, 2663, 2847, 2845, 2756, 2786, 2714, 2931, 2836, 2807]; - const FLAC_1_24000 = - [0, 950, 940, 1747, 1783, 1703, 1683, 1655, 1618, 1591, 1546, 1797, 1756, 1726, 1711, 1692, 1674, 1622, - 1589, 2407, 2257, 2125, 2018, 1933, 1937, 1810, 1721, 1685, 1665, 1628, 1603, 1532, 1827, 1780, 1757, - 1729, 1702, 1989, 1959, 1835, 2092, 2045, 1968, 1871, 1781, 2009, 1941, 1876, 1805, 1762, 1706, 1668, - 1663, 1916, 1809, 1795, 1750, 1709, 1671, 1648, 1647, 1631, 1589, 1804, 1845, 1746, 2114, 1977, 1946, - 1960, 1896, 2003, 1975, 2062, 2307, 2205, 2511, 2473, 2208, 2049, 1936, 1908, 1863, 1821, 1828, 1756, - 1800, 2289, 2511, 2177, 1817, 2188, 3156, 3149, 2959, 2901, 2772, 2583, 3061, 3248, 3196, 2911, 2675, - 3075, 3242, 3015, 2683, 2725, 3000, 3208, 3198, 3145, 2674, 2783, 3265, 3144, 2843, 3653, 3535, 3350, - 3385, 3328, 3278, 3295, 3374, 3397, 3370, 3338, 3246, 3069, 2776, 2450, 2729, 3198, 2966, 2394, 3183, - 3008, 2772, 3260, 3153, 3069, 3033, 2883, 3139, 3170, 3055, 3130, 3170, 2969, 2777, 2468, 2351, 2249, - 2230, 2221, 2618, 3194, 3243, 3359, 3331, 3257, 3223, 3168, 3069, 3006, 2786, 2559, 2273, 2323, 2946, - 3161, 3090, 2539, 3531, 3017, 3033, 2700, 3102, 2814, 3042, 3222, 3129, 3093, 3110, 3125, 3469, 3276, - 3035, 3615, 3241, 3342, 3359, 3430, 3126, 2786, 2755, 3119, 3082, 3035, 2438, 3222, 3362, 3403, 3322, - 3224, 3260, 3356, 3360, 3292, 3193, 3170, 3005, 2647, 2429, 2277, 2768, 3074, 2725, 2735, 3294, 3364, - 3190, 3358, 3196, 2697, 2926, 2983, 3274, 3256, 3013, 3203, 3168, 3081, 2824, 2557, 2599, 3081, 3165, - 2799, 3119, 3418, 3308, 3257, 3104, 2941, 3126, 3127, 3081, 3249, 3327, 3237, 2574, 2821, 3621, 3418, - 3411, 3393, 3287, 3406, 3540, 3243, 3414, 3331, 3267, 3583, 3183, 3807, 3191, 3401, 3727, 3441, 3546, - 3467, 3263, 3476, 3437, 3326, 3050, 2939, 3274, 3158, 3418, 3318, 3033, 3581, 3513, 3364, 3833, 3195, - 3372, 3522, 3251, 3417, 3170, 3185, 3355, 3286, 3278, 3290, 3268, 3242, 3287, 3255, 3283, 3358, 3299, - 3265, 3281, 3328, 3343, 3385, 3383, 3360, 3301, 3183, 3182, 3043, 2857, 2648, 2546, 2480, 2452, 2404, - 2404, 2534, 2931, 3074, 3077, 2878, 3708, 3344, 3301, 3252, 3504, 3295, 3391, 3726, 3715, 3734, 3681, - 3325, 2963, 2781, 2843, 3280, 2928, 3652, 3685, 3748, 3774, 3520, 3562, 3729, 3432, 3483, 3337, 3202, - 3481, 3630, 3645, 3521, 3073, 3153, 3308, 3089, 3586, 3308, 3320, 3489, 3358, 3633, 3795, 3854, 3765, - 3785, 3621, 3868, 3635, 3624, 3631, 3625, 3582, 3629, 3641, 3647, 3632, 3657, 3609, 3590, 3587, 3603, - 3615, 3584, 3538, 3525, 3449, 3442, 3501, 3497, 3395, 3024, 2914, 3525, 2965, 3284, 2999, 3082, 3632, - 3122, 3453, 3462, 3349, 3239, 3182, 3795, 3484, 3349, 3252, 3361, 3371, 3271, 3265, 3187, 3092, 2700, - 2312, 2294, 2321, 2080, 2410, 3150, 3388, 3379, 3311, 3178, 2892, 2526, 2282, 2212, 2301, 3332, 3413, - 3385, 3211, 3335, 3381, 3385, 3172, 2876, 3496, 3502, 3643, 3700, 3663, 3612, 3099, 3453, 3828, 3444, - 3813, 3724, 4142, 3872, 3833, 3947, 3912, 3922, 3840, 3555, 3795, 3929, 3805, 3943, 3916, 3736, 3966, - 3843, 3709, 3640, 3813, 3953, 3764, 3742, 3732, 3708, 3287, 3389, 3431, 3219, 3394, 3743, 3709, 3673, - 3359, 3526, 3561, 3335, 3912, 3656, 3453, 4020, 4102, 4012, 3635, 3605, 3515, 3978, 3629, 3852, 3862, - 3578, 3942, 3986, 3689, 3453, 3215, 3374, 3508, 3521, 3670, 3431, 3471, 2925, 3652, 3748, 3797, 3718, - 3720, 3374, 3425, 3428, 3418, 3444, 3314, 3237, 3182, 3487, 3577, 3261, 3697, 3874, 3564, 3796, 3297, - 3520, 3759, 3691, 3790, 3809, 3898, 3860, 3491, 3878, 3467, 3713, 3795, 3725, 3327, 3964, 3770, 3743, - 3701, 3586, 3788, 3255, 3725, 3767, 3767, 3985, 3654, 3674, 3193, 3163, 3534, 3693, 3678, 3494, 3401, - 3571, 3496, 3295, 3776, 3842, 3390, 3643, 3414, 3704, 3690, 3649, 3789, 3821, 3821, 3821, 3820, 3820, - 3876, 3835, 3802, 3812, 3765, 3845, 3838, 3865, 3880, 3805, 3856, 3859, 3500, 3376, 3350, 3185, 3056, - 2969, 2892, 3536, 2862, 3001, 3358, 3819, 3730, 3251, 3614, 3592, 3118, 2886, 3146, 3358, 3294, 3146, - 2982, 2768, 2591, 2654, 2918, 2734, 2814, 2856, 2815, 2985, 2982, 2894, 2913, 2855, 3076, 2969, 2936]; - const FLAC_2_32000 = - [0, 964, 969, 975, 1514, 1489, 1455, 1422, 1419, 1400, 1388, 1384, 1375, 1340, 1444, - 1489, 1459, 1440, 1434, 1427, 1433, 1412, 1399, 1382, 1370, 1975, 1871, 1800, 1729, 1685, - 1620, 1586, 1616, 1513, 1456, 1447, 1411, 1407, 1399, 1394, 1370, 1342, 1505, 1525, 1482, - 1465, 1454, 1437, 1425, 1619, 1670, 1559, 1534, 1727, 1707, 1684, 1617, 1555, 1500, 1526, - 1672, 1606, 1567, 1540, 1492, 1470, 1441, 1423, 1408, 1390, 1551, 1539, 1505, 1493, 1488, - 1439, 1428, 1414, 1402, 1400, 1393, 1403, 1389, 1342, 1507, 1547, 1488, 1644, 1692, 1639, - 1574, 1644, 1618, 1566, 1595, 1678, 1609, 1566, 1921, 1808, 1776, 1991, 2048, 1906, 1771, - 1689, 1627, 1559, 1566, 1532, 1522, 1497, 1500, 1468, 1467, 1614, 2011, 2229, 2091, 1649, - 1572, 1719, 2591, 2936, 2909, 2769, 2551, 2762, 2546, 2371, 2557, 2943, 2982, 2957, 2789, - 2448, 2397, 2683, 2977, 2972, 2709, 2526, 2036, 2787, 2659, 2945, 2935, 2899, 2820, 2434, - 2282, 2847, 2966, 2922, 2434, 3185, 3677, 3488, 2997, 3149, 3049, 2971, 3081, 3001, 3108, - 3162, 3199, 3182, 3159, 3149, 3110, 2958, 2807, 2520, 2219, 2086, 2477, 2941, 2893, 2309, - 2102, 2788, 2935, 2475, 2475, 2953, 2944, 2649, 2728, 2896, 2897, 2603, 2968, 2899, 2827, - 2677, 2906, 2922, 2807, 2707, 2498, 2201, 2059, 1981, 1938, 1896, 1918, 1960, 2430, 2907, - 2974, 3049, 3073, 3069, 3014, 3022, 2960, 2934, 2832, 2808, 2722, 2555, 2357, 2063, 1963, - 1949, 2432, 2764, 2896, 2870, 2430, 2372, 3270, 2703, 2946, 2424, 2553, 2924, 2495, 2457, - 2811, 2950, 2871, 2833, 2771, 2799, 2857, 2821, 3151, 3015, 2502, 2888, 3471, 3088, 2853, - 3038, 3011, 3094, 3094, 2535, 2487, 2362, 2840, 2815, 2712, 2781, 2342, 2015, 3114, 2987, - 3091, 3021, 3048, 2960, 3037, 3121, 3153, 3142, 3100, 3134, 3104, 3000, 2921, 2656, 2337, - 2197, 1978, 2066, 2547, 2811, 2738, 2090, 2580, 2914, 3080, 3083, 2883, 3102, 3068, 2618, - 2494, 2618, 2628, 2919, 3061, 3054, 2715, 2963, 2941, 2884, 2852, 2654, 2440, 2198, 2046, - 2465, 2890, 2958, 2678, 2355, 2935, 3197, 3160, 3106, 3073, 2903, 2746, 2668, 2871, 2848, - 2843, 2856, 3021, 3110, 2929, 2992, 2121, 2367, 3235, 3250, 3100, 3104, 3079, 3034, 2947, - 3073, 3224, 3320, 2796, 2979, 3423, 2566, 3087, 3231, 3073, 3015, 3511, 2882, 3025, 3308, - 3445, 3212, 2954, 3260, 3081, 2883, 3173, 3169, 3115, 3052, 2830, 2671, 2643, 2989, 3054, - 2459, 3132, 2988, 2757, 2635, 3312, 3245, 2889, 3349, 3698, 3027, 2894, 3218, 3243, 3037, - 2962, 3132, 2731, 2718, 3121, 2957, 2950, 2939, 2952, 2924, 2903, 2923, 2927, 2967, 2956, - 3005, 3032, 3016, 3005, 2988, 2987, 3015, 3022, 3065, 3107, 3098, 3098, 3079, 3082, 3008, - 2965, 2965, 2861, 2702, 2552, 2339, 2248, 2198, 2160, 2140, 2103, 2087, 2095, 2204, 2454, - 2739, 2830, 2869, 2549, 3227, 3601, 3126, 3039, 2954, 2968, 3155, 3141, 2867, 3116, 3363, - 3399, 3408, 3432, 3438, 3190, 2865, 2599, 2466, 2426, 2766, 2958, 2640, 3481, 3062, 3457, - 3484, 3293, 3563, 3201, 3131, 3493, 3384, 3057, 3090, 3236, 2937, 2879, 3099, 3361, 3280, - 3297, 3251, 2913, 2640, 2904, 3087, 2760, 3017, 3219, 2887, 2954, 3172, 3199, 3059, 3279, - 3375, 3613, 3726, 3560, 3501, 3479, 3328, 3376, 3749, 3186, 3303, 3315, 3311, 3277, 3296, - 3326, 3354, 3321, 3342, 3309, 3329, 3331, 3268, 3266, 3198, 3242, 3258, 3301, 3296, 3268, - 3242, 3194, 3165, 3134, 3123, 3202, 3175, 3165, 3095, 2832, 2586, 2595, 3388, 2496, 2839, - 3001, 2765, 2314, 3369, 3573, 2844, 3091, 3200, 3207, 3135, 3126, 2828, 3053, 3607, 3262, - 3172, 3105, 3086, 3150, 3357, 3265, 3039, 3082, 2970, 2916, 2846, 2622, 2259, 2056, 2004, - 2094, 1965, 1816, 1945, 2761, 3016, 3141, 3135, 3109, 3026, 2902, 2688, 2419, 2151, 1985, - 1946, 1974, 2321, 3017, 3081, 3129, 2982, 2882, 3036, 3135, 3131, 3077, 3020, 2840, 2727, - 3145, 3119, 3134, 3368, 3333, 3330, 3263, 3222, 2666, 3017, 3545, 3436, 3125, 3446, 3455, - 3637, 3765, 3571, 3559, 3539, 3692, 3840, 3589, 3600, 3544, 3298, 3281, 3650, 3577, 3436, - 3600, 3553, 3542, 3451, 3485, 3557, 3467, 3425, 3282, 3326, 3515, 3736, 3626, 3425, 3516, - 3487, 3439, 3414, 3062, 3127, 3276, 3163, 2981, 3101, 3349, 3411, 3375, 3309, 3155, 3066, - 3251, 3321, 3031, 3508, 3523, 3423, 2989, 3386, 3719, 3818, 3766, 3517, 3284, 3260, 3159, - 3454, 3631, 3269, 3258, 3770, 3628, 3371, 3374, 3829, 3810, 3397, 3219, 3018, 2966, 3157]; - const FLAC_1_32000 = - [0, 1002, 1002, 1011, 1652, 1645, 1597, 1551, 1544, 1520, 1488, 1483, 1473, 1452, 1561, 1648, 1609, 1574, - 1576, 1568, 1566, 1545, 1525, 1477, 1470, 2109, 2003, 1951, 1875, 1810, 1740, 1712, 1738, 1670, 1601, - 1584, 1535, 1527, 1505, 1504, 1472, 1451, 1633, 1666, 1639, 1614, 1604, 1578, 1558, 1748, 1786, 1698, - 1679, 1870, 1836, 1804, 1733, 1691, 1652, 1674, 1788, 1727, 1693, 1680, 1649, 1620, 1583, 1555, 1521, - 1496, 1687, 1682, 1656, 1648, 1648, 1576, 1564, 1542, 1526, 1501, 1515, 1491, 1479, 1458, 1653, 1686, - 1645, 1788, 1826, 1754, 1704, 1753, 1734, 1696, 1729, 1797, 1729, 1699, 2039, 1953, 1935, 2128, 2196, - 2040, 1923, 1819, 1743, 1692, 1702, 1675, 1666, 1655, 1656, 1614, 1625, 1757, 2157, 2350, 2225, 1781, - 1706, 1850, 2732, 3079, 3060, 2919, 2678, 2891, 2678, 2527, 2701, 3100, 3125, 3112, 2927, 2600, 2544, - 2819, 3123, 3121, 2851, 2650, 2168, 2925, 2805, 3100, 3096, 3057, 2949, 2588, 2423, 2999, 3116, 3076, - 2582, 3333, 3802, 3631, 3137, 3294, 3176, 3120, 3202, 3143, 3233, 3309, 3363, 3340, 3310, 3290, 3235, - 3106, 2939, 2665, 2346, 2242, 2615, 3090, 3033, 2465, 2248, 2932, 3078, 2600, 2604, 3099, 3097, 2792, - 2861, 3031, 3044, 2741, 3109, 3039, 2955, 2823, 3056, 3078, 2933, 2848, 2640, 2343, 2221, 2119, 2049, - 2024, 2039, 2093, 2564, 3042, 3117, 3189, 3212, 3210, 3161, 3164, 3109, 3080, 2963, 2932, 2863, 2693, - 2510, 2204, 2087, 2079, 2572, 2899, 3050, 3012, 2564, 2512, 3416, 2844, 3087, 2563, 2694, 3080, 2623, - 2590, 2941, 3104, 3021, 2965, 2898, 2929, 3001, 2959, 3299, 3140, 2623, 3038, 3604, 3227, 2996, 3175, - 3156, 3236, 3228, 2660, 2613, 2519, 2978, 2938, 2847, 2902, 2473, 2167, 3261, 3131, 3213, 3158, 3175, - 3114, 3172, 3246, 3296, 3286, 3221, 3267, 3230, 3137, 3067, 2805, 2468, 2332, 2114, 2211, 2690, 2934, - 2879, 2229, 2709, 3055, 3212, 3210, 3032, 3226, 3186, 2754, 2636, 2778, 2791, 3045, 3187, 3181, 2852, - 3100, 3098, 3027, 2997, 2791, 2583, 2333, 2209, 2608, 3041, 3107, 2811, 2486, 3073, 3346, 3312, 3230, - 3197, 3057, 2878, 2821, 3007, 2983, 2980, 2991, 3154, 3235, 3066, 3124, 2273, 2502, 3380, 3401, 3225, - 3230, 3193, 3167, 3100, 3203, 3367, 3456, 2934, 3122, 3572, 2702, 3228, 3385, 3216, 3154, 3667, 3022, - 3165, 3443, 3589, 3362, 3096, 3407, 3217, 3024, 3322, 3329, 3242, 3193, 2966, 2819, 2783, 3129, 3184, - 2610, 3271, 3124, 2888, 2794, 3450, 3397, 3025, 3490, 3829, 3163, 3051, 3373, 3399, 3184, 3101, 3267, - 2868, 2866, 3264, 3115, 3108, 3098, 3106, 3085, 3067, 3085, 3087, 3115, 3111, 3136, 3160, 3145, 3142, - 3128, 3128, 3150, 3155, 3186, 3230, 3218, 3220, 3198, 3196, 3147, 3113, 3113, 3006, 2846, 2685, 2498, - 2371, 2317, 2295, 2277, 2252, 2241, 2244, 2334, 2599, 2870, 2956, 3022, 2691, 3372, 3734, 3268, 3180, - 3102, 3118, 3294, 3268, 3014, 3261, 3500, 3526, 3539, 3575, 3582, 3330, 3000, 2735, 2598, 2565, 2908, - 3089, 2790, 3620, 3203, 3598, 3642, 3430, 3705, 3332, 3268, 3635, 3505, 3185, 3226, 3367, 3099, 3031, - 3242, 3493, 3425, 3433, 3395, 3044, 2791, 3042, 3209, 2886, 3156, 3353, 3027, 3093, 3314, 3360, 3202, - 3420, 3505, 3741, 3879, 3701, 3663, 3638, 3476, 3511, 3904, 3324, 3445, 3445, 3443, 3421, 3435, 3452, - 3475, 3448, 3470, 3442, 3456, 3455, 3415, 3411, 3364, 3393, 3408, 3436, 3434, 3417, 3395, 3358, 3317, - 3270, 3256, 3367, 3334, 3315, 3222, 2983, 2731, 2728, 3524, 2642, 2984, 3139, 2904, 2459, 3509, 3707, - 2984, 3242, 3355, 3364, 3277, 3260, 2967, 3193, 3744, 3408, 3326, 3235, 3220, 3295, 3477, 3400, 3169, - 3200, 3117, 3071, 2987, 2759, 2392, 2216, 2153, 2247, 2097, 1966, 2095, 2895, 3151, 3281, 3273, 3243, - 3157, 3049, 2833, 2561, 2292, 2122, 2066, 2102, 2451, 3162, 3220, 3270, 3129, 3027, 3166, 3276, 3267, - 3213, 3152, 2982, 2863, 3285, 3252, 3269, 3498, 3468, 3453, 3411, 3372, 2796, 3161, 3696, 3576, 3262, - 3590, 3596, 3772, 3896, 3708, 3705, 3689, 3830, 3972, 3734, 3728, 3692, 3450, 3430, 3774, 3716, 3579, - 3733, 3700, 3690, 3585, 3629, 3702, 3623, 3563, 3425, 3457, 3657, 3888, 3755, 3557, 3656, 3651, 3586]; - const FLAC_2_44100 = - [0, 1859, 1857, 2769, 2742, 2627, 2605, 2527, 2516, 2480, 2742, 2742, 2676, 2657, 2635, - 2606, 2515, 3141, 3291, 3141, 2992, 2885, 2877, 2773, 2736, 2635, 2592, 2529, 2494, 2700, - 2776, 2750, 2723, 2663, 2933, 2885, 2904, 3035, 2974, 2850, 2775, 2899, 2876, 2808, 2777, - 2752, 2684, 2602, 2708, 2780, 2763, 2773, 2680, 2615, 2571, 2550, 2543, 2479, 2767, 2784, - 2958, 2953, 2820, 2887, 2833, 2879, 2899, 2981, 3260, 3143, 3567, 3325, 3082, 2888, 2801, - 2807, 2768, 2749, 2762, 2790, 3462, 3823, 3143, 2887, 4172, 5022, 5229, 4729, 4858, 4358, - 5021, 5443, 5382, 4633, 4306, 5285, 5356, 4618, 3851, 5015, 5192, 5314, 5098, 4249, 4802, - 5440, 4791, 6169, 6876, 5400, 5638, 5372, 5591, 5641, 5905, 6019, 5893, 5771, 5415, 4756, - 3917, 3784, 5277, 5050, 3660, 5099, 4689, 4588, 5469, 4768, 5142, 5562, 4986, 5344, 5082, - 5181, 5224, 4786, 4315, 3823, 3545, 3435, 3429, 3703, 5096, 5486, 5588, 5519, 5535, 5432, - 5238, 5057, 4749, 4206, 3604, 3461, 4372, 5044, 5044, 3989, 5628, 5096, 4643, 4917, 4677, - 4376, 5449, 5195, 5094, 5049, 5046, 5656, 5085, 5027, 6587, 5059, 5577, 5576, 5515, 4503, - 4459, 5114, 4906, 4769, 3710, 5804, 5446, 5459, 5509, 5617, 5863, 5859, 5824, 5830, 5540, - 4909, 4181, 3649, 3790, 5009, 4997, 4059, 5174, 5639, 5336, 5628, 5085, 4465, 4583, 5238, - 5573, 4997, 5385, 5124, 4848, 4260, 3755, 3990, 5314, 5126, 4187, 5707, 5674, 5556, 5232, - 4860, 4992, 5118, 5085, 5468, 5661, 5408, 4016, 5820, 5803, 5618, 5616, 5434, 5516, 6144, - 5102, 6286, 4888, 5791, 5650, 5864, 5748, 5846, 6221, 5736, 5833, 5659, 5429, 5768, 5657, - 5143, 4726, 5331, 5436, 5222, 5267, 4776, 5825, 5656, 6177, 6910, 5188, 5811, 5675, 5457, - 5386, 5042, 5547, 5331, 5241, 5207, 5186, 5279, 5388, 5435, 5406, 5355, 5386, 5408, 5437, - 5549, 5593, 5564, 5574, 5425, 5368, 5145, 4679, 4253, 4021, 3941, 3909, 3867, 3892, 4253, - 4953, 5197, 4543, 6640, 6092, 5428, 5247, 5805, 5220, 5851, 5957, 6193, 6270, 5753, 4910, - 4476, 4536, 5377, 4947, 6218, 6304, 6168, 6454, 5639, 6388, 6011, 5591, 5652, 5125, 5866, - 5985, 5986, 5540, 4764, 5497, 5037, 5706, 5271, 5391, 5854, 5554, 6170, 6878, 7015, 6367, - 6244, 6144, 6844, 5905, 6027, 5905, 5958, 6055, 6037, 6002, 6016, 5929, 5848, 5800, 5811, - 5883, 5874, 5833, 5736, 5630, 5728, 5779, 5701, 5204, 4609, 6035, 4621, 5327, 4850, 5169, - 6683, 5228, 5816, 5859, 5659, 5020, 6666, 5917, 5751, 5603, 6348, 6276, 5462, 5302, 5143, - 4741, 3923, 3624, 3709, 3398, 3750, 5220, 5682, 5649, 5486, 5065, 4355, 3741, 3475, 3501, - 4961, 5583, 5541, 5247, 5560, 5635, 5413, 6030, 5188, 5549, 5671, 6160, 6103, 5981, 5112, - 5912, 6396, 5809, 6249, 6831, 6504, 6575, 6549, 7317, 6651, 6522, 6028, 6518, 6411, 6428, - 6560, 6418, 6437, 6505, 6427, 6172, 6499, 6978, 6565, 6437, 6356, 6293, 5678, 6090, 5713, - 5674, 6169, 6180, 6043, 5537, 6013, 5885, 6527, 6340, 5509, 6437, 6984, 6949, 6015, 5952, - 5911, 6672, 5808, 6952, 6411, 6213, 7302, 6680, 5783, 5358, 6114, 5713, 5794, 6156, 5826, - 4945, 5240, 6276, 6207, 6241, 6176, 5573, 6117, 6086, 5575, 5529, 5370, 5220, 5367, 6235, - 5466, 5876, 6477, 6099, 6597, 5360, 6264, 6361, 6415, 6427, 6610, 6805, 5813, 6273, 5705, - 6333, 6340, 6060, 5977, 6512, 6243, 6218, 5964, 6441, 5486, 6268, 6271, 6327, 7021, 5978, - 5614, 5029, 5531, 6189, 6135, 5857, 5556, 6086, 5841, 5567, 6619, 6261, 6166, 5456, 6139, - 6228, 5990, 6502, 6582, 6609, 6594, 6401, 6542, 6486, 6416, 6383, 6320, 6465, 6464, 6427, - 6409, 6258, 6408, 6214, 5739, 5712, 5575, 5189, 4936, 4695, 5869, 4660, 5062, 5973, 6277, - 6046, 5997, 6570, 5454, 4638, 4853, 5416, 5252, 5077, 4826, 4280, 4045, 4798, 4581, 4265, - 4671, 4326, 4941, 5006, 4675, 4672, 4488, 4948, 4593, 4809, 4489, 4707, 4541, 4362, 4288, - 4237, 4613, 4470, 4460, 4594, 4401, 4765, 4710, 4608, 4507, 4169, 4667, 4485, 4251, 4160, - 3954, 3720, 3702, 3831, 3912, 4365, 4826, 4182, 4741, 4195, 4788, 4650, 4598, 4569, 4051, - 4993, 4657, 4571, 4251, 4196, 4393, 4366, 4117, 4116, 5210, 4746, 4699, 5474, 5478, 5373, - 5337, 5331, 5240, 6873, 5585, 4991, 4979, 5188, 5030, 5520, 4976, 4630, 4585, 4579, 5320, - 4675, 4764, 4814, 4730, 5353, 4907, 4823, 4511, 4966, 5079, 4689, 4827, 4453, 4880, 4531]; - const FLAC_1_44100 = - [0, 2131, 2139, 3015, 2934, 2863, 2836, 2784, 2768, 2753, 2973, 2935, 2893, 2878, 2857, 2845, 2776, 3402, - 3521, 3400, 3296, 3192, 3177, 3028, 2931, 2861, 2840, 2787, 2765, 2967, 3023, 2949, 2921, 2876, 3222, - 3195, 3158, 3321, 3285, 3134, 3030, 3171, 3163, 3076, 3008, 2961, 2895, 2838, 2963, 3040, 2974, 2964, - 2891, 2855, 2818, 2798, 2797, 2765, 3020, 3047, 3192, 3263, 3086, 3184, 3110, 3178, 3210, 3245, 3505, - 3396, 3860, 3582, 3355, 3191, 3068, 3069, 3027, 2989, 2951, 3007, 3726, 4070, 3440, 3202, 4458, 5297, - 5547, 5024, 5134, 4630, 5283, 5712, 5673, 4901, 4565, 5572, 5646, 4895, 4132, 5303, 5494, 5619, 5390, - 4563, 5080, 5705, 5080, 6445, 7184, 5683, 5909, 5669, 5840, 5919, 6196, 6284, 6200, 6083, 5707, 5029, - 4189, 4065, 5545, 5331, 3944, 5386, 4963, 4843, 5730, 5066, 5438, 5832, 5270, 5634, 5390, 5470, 5513, - 5071, 4606, 4076, 3857, 3737, 3729, 3998, 5386, 5777, 5874, 5802, 5821, 5719, 5525, 5334, 5032, 4490, - 3905, 3763, 4683, 5332, 5345, 4258, 5915, 5378, 4940, 5203, 4946, 4631, 5716, 5519, 5373, 5319, 5332, - 5939, 5382, 5337, 6864, 5330, 5867, 5862, 5804, 4773, 4752, 5400, 5194, 5063, 3994, 6086, 5708, 5724, - 5762, 5886, 6180, 6176, 6145, 6135, 5788, 5202, 4455, 3946, 4081, 5299, 5287, 4342, 5462, 5929, 5623, - 5889, 5361, 4767, 4894, 5502, 5847, 5287, 5662, 5414, 5127, 4544, 4017, 4271, 5588, 5401, 4478, 5984, - 5963, 5817, 5524, 5139, 5266, 5408, 5363, 5739, 5944, 5702, 4280, 6093, 6083, 5880, 5872, 5721, 5784, - 6429, 5392, 6570, 5160, 6100, 5931, 6174, 6033, 6117, 6492, 6039, 6102, 5916, 5712, 6083, 5941, 5432, - 5024, 5600, 5705, 5496, 5556, 5066, 6107, 5940, 6453, 7174, 5480, 6112, 5978, 5727, 5682, 5326, 5821, - 5630, 5556, 5533, 5505, 5594, 5670, 5707, 5687, 5649, 5667, 5685, 5701, 5800, 5836, 5808, 5812, 5703, - 5655, 5438, 4979, 4526, 4330, 4228, 4172, 4118, 4152, 4556, 5215, 5511, 4821, 6918, 6389, 5705, 5547, - 6089, 5510, 6142, 6253, 6450, 6564, 6033, 5196, 4744, 4798, 5654, 5218, 6496, 6592, 6473, 6752, 5909, - 6665, 6269, 5876, 5938, 5422, 6153, 6263, 6268, 5827, 5060, 5781, 5326, 5997, 5552, 5683, 6154, 5845, - 6457, 7181, 7301, 6674, 6543, 6441, 7134, 6206, 6309, 6205, 6236, 6318, 6304, 6277, 6292, 6229, 6158, - 6114, 6122, 6189, 6176, 6124, 6038, 5886, 6023, 6088, 5993, 5481, 4921, 6331, 4901, 5615, 5132, 5460, - 6974, 5516, 6147, 6178, 5956, 5325, 6956, 6214, 6060, 5897, 6635, 6574, 5725, 5610, 5442, 5020, 4194, - 3917, 3976, 3682, 4010, 5510, 5961, 5928, 5755, 5342, 4640, 4021, 3795, 3805, 5239, 5868, 5824, 5554, - 5823, 5905, 5699, 6305, 5477, 5799, 5927, 6444, 6382, 6264, 5405, 6206, 6684, 6085, 6549, 7126, 6812, - 6849, 6852, 7608, 6922, 6806, 6320, 6783, 6706, 6687, 6835, 6728, 6723, 6794, 6736, 6422, 6793, 7287, - 6854, 6741, 6675, 6572, 5972, 6347, 5980, 5957, 6423, 6432, 6300, 5810, 6287, 6143, 6795, 6623, 5778, - 6719, 7273, 7257, 6286, 6242, 6185, 6943, 6130, 7226, 6708, 6511, 7547, 6970, 6093, 5654, 6376, 5999, - 6100, 6412, 6114, 5254, 5533, 6556, 6484, 6522, 6428, 5840, 6403, 6372, 5849, 5797, 5661, 5550, 5659, - 6515, 5752, 6175, 6781, 6393, 6856, 5635, 6544, 6664, 6728, 6739, 6894, 7069, 6077, 6571, 6021, 6627, - 6652, 6334, 6269, 6820, 6529, 6494, 6248, 6738, 5776, 6558, 6574, 6626, 7284, 6258, 5893, 5276, 5819, - 6441, 6376, 6135, 5851, 6336, 6111, 5852, 6906, 6546, 6468, 5752, 6417, 6503, 6291, 6799, 6849, 6879, - 6858, 6691, 6824, 6783, 6736, 6709, 6640, 6774, 6775, 6749, 6734, 6548, 6735, 6509, 6057, 6013, 5837, - 5476, 5196, 5000, 6147, 4947, 5350, 6254, 6574, 6309, 6280, 6839, 5726, 4932, 5125, 5707, 5569, 5353, - 5106, 4568, 4374, 5084, 4857, 4536, 4962, 4583, 5244, 5260, 4969, 4949, 4740, 5243, 4902, 5091, 4764, - 4969, 4834, 4605, 4557, 4516, 4880, 4740, 4708, 4886, 4648, 5049, 5018, 4887, 4787, 4470, 4954, 4752, - 4525, 4466, 4237, 3988, 3970, 4064, 4183, 4655, 5105, 4476, 5045, 4489, 5056, 4971, 4913, 4860, 4370, - 5271, 4953, 4841, 4528, 4476, 4685, 4606, 4415, 4409, 5490, 5031, 4978, 5751, 5753, 5659, 5639, 5629]; - const FLAC_2_48000 = - [0, 1848, 1926, 2642, 2628, 2547, 2515, 2484, 2447, 2425, 2400, 2678, 2589, 2559, 2538, - 2529, 2507, 2454, 2424, 3245, 3063, 2952, 2870, 2781, 2796, 2724, 2604, 2544, 2508, 2469, - 2435, 2407, 2745, 2655, 2608, 2580, 2535, 2847, 2805, 2767, 2916, 2890, 2815, 2748, 2689, - 2848, 2768, 2770, 2695, 2633, 2552, 2507, 2472, 2740, 2680, 2647, 2591, 2543, 2489, 2463, - 2462, 2447, 2403, 2677, 2744, 2652, 2926, 2785, 2778, 2784, 2766, 2819, 2803, 2950, 3096, - 2999, 3379, 3245, 2995, 2850, 2765, 2759, 2753, 2683, 2687, 2613, 2693, 3283, 3646, 3185, - 2812, 3332, 4666, 4940, 4810, 4711, 4542, 4128, 4892, 5241, 5255, 4584, 4101, 4800, 5185, - 4809, 4190, 4262, 4504, 5155, 5088, 4954, 4113, 4407, 5205, 5015, 4509, 6837, 6251, 5415, - 5253, 5267, 5392, 5501, 5756, 5884, 5761, 5684, 5478, 4921, 4156, 3521, 3986, 5243, 4611, - 3540, 4880, 4612, 4214, 5225, 5059, 4759, 5431, 5126, 4886, 5065, 4878, 5102, 5036, 4622, - 4231, 3723, 3473, 3355, 3329, 3317, 4076, 5124, 5291, 5362, 5295, 5321, 5235, 5106, 4887, - 4699, 4270, 3772, 3383, 3487, 4358, 4911, 4794, 3823, 5551, 4766, 4848, 4297, 4978, 4118, - 4735, 5192, 5035, 4907, 4863, 4851, 5440, 5095, 4578, 6085, 5207, 5328, 5329, 5453, 4910, - 4369, 4379, 4939, 4768, 4701, 3628, 5616, 5105, 5293, 5290, 5273, 5534, 5726, 5716, 5696, - 5712, 5423, 4866, 4219, 3702, 3422, 4235, 5068, 4227, 4255, 5192, 5446, 5126, 5462, 5220, - 4152, 4415, 4617, 5380, 5339, 4862, 5142, 4913, 4572, 4066, 3624, 3654, 4929, 5171, 4211, - 4831, 5576, 5430, 5309, 5017, 4647, 4848, 4988, 4935, 5170, 5481, 5603, 4164, 4688, 5840, - 5458, 5409, 5366, 5192, 5271, 5945, 4985, 5472, 5594, 5220, 5731, 5054, 6103, 5529, 5540, - 5947, 5478, 5591, 5522, 5080, 5597, 5532, 5248, 4752, 4611, 5360, 4999, 5279, 5165, 4630, - 5550, 5880, 5744, 6988, 5292, 5409, 5623, 5275, 5358, 4991, 4991, 5339, 5138, 5078, 5055, - 5034, 5073, 5198, 5208, 5235, 5253, 5166, 5230, 5254, 5257, 5323, 5387, 5349, 5344, 5320, - 5198, 5176, 4888, 4442, 4062, 3910, 3844, 3830, 3761, 3759, 3940, 4507, 4915, 4962, 4455, - 6673, 5399, 5246, 5104, 5551, 5225, 5170, 5811, 5882, 6070, 6021, 5268, 4597, 4311, 4418, - 5190, 4560, 6268, 5919, 6166, 6032, 5818, 5735, 6024, 5485, 5550, 5337, 4994, 5615, 5775, - 5800, 5566, 4760, 4903, 5384, 4706, 5631, 5129, 5218, 5688, 5344, 5932, 6505, 6865, 6011, - 6200, 5803, 6743, 5811, 5760, 5775, 5737, 5740, 5807, 5788, 5785, 5778, 5739, 5667, 5629, - 5621, 5643, 5695, 5651, 5640, 5543, 5411, 5465, 5626, 5599, 5299, 4680, 4516, 5815, 4535, - 5164, 4590, 4816, 6600, 4875, 5642, 5659, 5559, 5393, 5165, 6299, 5689, 5600, 5427, 6240, - 6170, 5268, 5179, 5027, 4835, 4180, 3581, 3520, 3510, 3268, 3794, 5058, 5513, 5513, 5367, - 5063, 4434, 3847, 3438, 3335, 3482, 5041, 5451, 5347, 5047, 5327, 5461, 5287, 6095, 4551, - 5436, 5283, 5646, 5951, 5843, 5752, 4979, 5593, 6363, 5447, 6095, 6012, 6895, 6263, 6375, - 6583, 6894, 6473, 6326, 5857, 6252, 6350, 6072, 6385, 6348, 6132, 6369, 6370, 6226, 5992, - 6309, 6818, 6450, 6281, 6218, 6387, 5657, 5758, 5875, 5356, 5611, 5975, 5958, 5818, 5344, - 5740, 5855, 5377, 6492, 5870, 5496, 6461, 6863, 6629, 5816, 5762, 5562, 6568, 5682, 6129, - 6798, 5921, 6854, 7100, 5927, 5555, 5272, 5963, 5533, 5610, 5994, 5430, 5539, 4528, 5859, - 5905, 6141, 6044, 5956, 5335, 5983, 5983, 5354, 5477, 5226, 5096, 5019, 5678, 5968, 5100, - 5935, 6349, 5880, 6378, 5308, 5995, 6162, 6180, 6277, 6280, 6599, 6525, 5503, 6152, 5489, - 5980, 6161, 6093, 5355, 6594, 6160, 6002, 6034, 5815, 6188, 5345, 6018, 6087, 6119, 6566, - 6038, 5883, 5075, 4998, 5702, 5994, 5991, 5576, 5395, 5900, 5739, 5207, 6307, 6428, 5644, - 5930, 5445, 5923, 6002, 5853, 6333, 6357, 6357, 6378, 6288, 6207, 6327, 6236, 6222, 6192, - 6132, 6268, 6263, 6216, 6211, 6047, 6207, 6182, 5617, 5553, 5525, 5274, 4954, 4702, 4622, - 5742, 4503, 4848, 5554, 6112, 5936, 5151, 6333, 5808, 4889, 4379, 4903, 5171, 5071, 4918, - 4679, 4258, 3949, 4113, 4812, 4123, 4310, 4389, 4157, 4865, 4834, 4504, 4568, 4275, 4817, - 4518, 4526, 4522, 4323, 4639, 4326, 4165, 4092, 4061, 4356, 4378, 4200, 4488, 4261, 4306, - 4636, 4415, 4614, 4167, 4035, 4491, 4317, 4103, 4006, 3863, 3675, 3500, 3587, 3685, 3828]; - const FLAC_1_48000 = - [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, 2806, 2796, 2786, 2774, 2758, - 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, 2839, 2794, 2770, 2763, 2756, 2722, 2950, 2876, 2842, - 2827, 2792, 3121, 3075, 2969, 3240, 3199, 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, - 2779, 2963, 2893, 2870, 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, 2876, 3223, 3040, 3006, - 3042, 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, 3300, 3140, 3014, 2975, 2952, 2896, 2897, 2842, - 2929, 3567, 3929, 3485, 3082, 3625, 4953, 5239, 5094, 4993, 4821, 4431, 5195, 5542, 5557, 4894, 4414, - 5085, 5496, 5089, 4459, 4532, 4778, 5460, 5372, 5224, 4395, 4701, 5512, 5304, 4798, 7128, 6534, 5704, - 5562, 5539, 5675, 5780, 6058, 6194, 6076, 5971, 5758, 5202, 4438, 3821, 4267, 5550, 4896, 3841, 5166, - 4904, 4504, 5530, 5354, 5047, 5695, 5422, 5168, 5338, 5154, 5385, 5322, 4934, 4512, 4001, 3793, 3624, - 3589, 3562, 4346, 5407, 5582, 5645, 5581, 5605, 5520, 5399, 5164, 4991, 4556, 4058, 3662, 3757, 4627, - 5183, 5061, 4114, 5840, 5051, 5126, 4573, 5269, 4437, 5021, 5508, 5289, 5171, 5153, 5118, 5721, 5375, - 4863, 6353, 5477, 5608, 5614, 5737, 5178, 4614, 4671, 5204, 5027, 4977, 3922, 5904, 5397, 5594, 5600, - 5591, 5796, 6044, 6022, 5994, 6015, 5700, 5163, 4484, 3987, 3725, 4514, 5340, 4509, 4541, 5468, 5727, - 5407, 5727, 5494, 4417, 4656, 4885, 5673, 5632, 5149, 5442, 5176, 4862, 4361, 3908, 3947, 5231, 5472, - 4490, 5130, 5846, 5700, 5619, 5295, 4952, 5129, 5241, 5198, 5455, 5746, 5888, 4432, 4970, 6133, 5731, - 5688, 5656, 5500, 5588, 6209, 5276, 5760, 5864, 5509, 6038, 5326, 6365, 5815, 5825, 6237, 5755, 5891, - 5817, 5365, 5850, 5791, 5522, 5056, 4884, 5659, 5270, 5561, 5436, 4949, 5844, 6162, 6030, 7279, 5559, - 5701, 5883, 5536, 5648, 5264, 5279, 5658, 5433, 5350, 5318, 5282, 5346, 5516, 5539, 5553, 5572, 5485, - 5558, 5580, 5582, 5627, 5670, 5648, 5646, 5622, 5527, 5497, 5161, 4709, 4394, 4175, 4081, 4061, 4011, - 4014, 4223, 4789, 5174, 5239, 4747, 6919, 5692, 5537, 5377, 5835, 5514, 5467, 6099, 6189, 6330, 6292, - 5544, 4863, 4575, 4693, 5478, 4844, 6558, 6200, 6434, 6316, 6088, 6020, 6317, 5786, 5829, 5622, 5229, - 5902, 6078, 6110, 5849, 5050, 5190, 5664, 4980, 5917, 5415, 5501, 5977, 5626, 6218, 6795, 7169, 6290, - 6471, 6082, 7028, 6106, 6046, 6071, 6033, 6025, 6106, 6086, 6080, 6072, 6040, 5948, 5889, 5881, 5915, - 6000, 5932, 5915, 5804, 5686, 5746, 5885, 5856, 5591, 4967, 4784, 6090, 4812, 5471, 4890, 5108, 6862, - 5153, 5918, 5936, 5845, 5674, 5444, 6582, 5977, 5855, 5703, 6552, 6468, 5587, 5490, 5280, 5115, 4460, - 3888, 3833, 3829, 3508, 4062, 5353, 5780, 5774, 5657, 5347, 4709, 4122, 3743, 3603, 3749, 5328, 5729, - 5630, 5315, 5626, 5727, 5574, 6360, 4835, 5701, 5598, 5932, 6239, 6134, 6044, 5270, 5875, 6670, 5712, - 6345, 6295, 7171, 6556, 6709, 6871, 7193, 6783, 6647, 6141, 6535, 6642, 6343, 6702, 6661, 6413, 6689, - 6658, 6501, 6264, 6626, 7097, 6742, 6578, 6492, 6699, 5931, 6014, 6182, 5646, 5876, 6254, 6243, 6145, - 5635, 6055, 6156, 5646, 6776, 6139, 5786, 6750, 7176, 6917, 6147, 6077, 5862, 6855, 5971, 6423, 7094, - 6191, 7137, 7390, 6224, 5825, 5558, 6257, 5805, 5870, 6265, 5719, 5821, 4812, 6136, 6201, 6424, 6299, - 6241, 5628, 6263, 6245, 5650, 5744, 5554, 5384, 5275, 5963, 6251, 5376, 6222, 6661, 6156, 6698, 5580, - 6283, 6429, 6437, 6574, 6574, 6869, 6794, 5774, 6448, 5767, 6261, 6411, 6342, 5652, 6890, 6417, 6274, - 6294, 6105, 6488, 5639, 6309, 6373, 6380, 6846, 6321, 6163, 5348, 5294, 5976, 6265, 6265, 5876, 5693, - 6200, 6020, 5489, 6589, 6710, 5915, 6210, 5728, 6208, 6281, 6125, 6636, 6664, 6661, 6679, 6592, 6493, - 6647, 6510, 6493, 6450, 6378, 6561, 6547, 6491, 6480, 6305, 6474, 6441, 5868, 5801, 5773, 5571, 5206, - 5003, 4905, 6027, 4755, 5163, 5827, 6382, 6230, 5445, 6622, 6095, 5204, 4645, 5178, 5478, 5345, 5174, - 4992, 4560, 4232, 4380, 5098, 4428, 4612, 4683, 4466, 5129, 5110, 4780, 4842, 4545, 5089, 4795, 4796]; - const FLAC_2_64000 = - [0, 1669, 1670, 1670, 2340, 2269, 2317, 2346, 2351, 2271, 2185, 2143, 2103, 2074, 2250, 2279, - 2306, 2310, 2333, 2300, 2281, 2243, 2211, 2139, 2098, 2662, 2524, 2467, 2423, 2363, 2292, 2272, - 2335, 2289, 2298, 2287, 2278, 2272, 2195, 2174, 2110, 2065, 2292, 2288, 2315, 2298, 2301, 2272, - 2232, 2305, 2326, 2288, 2321, 2428, 2393, 2360, 2303, 2266, 2326, 2336, 2392, 2318, 2295, 2310, - 2332, 2309, 2260, 2203, 2172, 2117, 2293, 2298, 2342, 2325, 2308, 2268, 2235, 2211, 2151, 2136, - 2182, 2215, 2204, 2145, 2320, 2299, 2333, 2463, 2411, 2334, 2261, 2319, 2300, 2269, 2297, 2348, - 2302, 2268, 2583, 2477, 2451, 2687, 2782, 2572, 2437, 2370, 2324, 2254, 2303, 2315, 2300, 2292, - 2294, 2329, 2304, 2398, 2756, 2931, 2845, 2394, 2328, 2521, 3519, 3885, 4046, 4025, 3759, 4006, - 3738, 3453, 3632, 4128, 4361, 4430, 4094, 3649, 3491, 3967, 4292, 4193, 3865, 3581, 2831, 3896, - 3704, 4195, 4205, 4125, 4085, 3517, 3352, 4156, 4262, 4226, 3496, 4662, 6024, 5461, 4187, 4517, - 4275, 4238, 4552, 4480, 4659, 4895, 5045, 4980, 4890, 4892, 4759, 4432, 3953, 3432, 2977, 2794, - 3316, 4302, 4165, 3131, 2899, 3817, 4169, 3547, 3573, 4309, 4263, 3964, 3901, 4435, 4507, 3750, - 4152, 4130, 4112, 3865, 4222, 4103, 3849, 3648, 3378, 3049, 2929, 2829, 2789, 2777, 2770, 2832, - 3430, 4126, 4320, 4379, 4339, 4323, 4335, 4379, 4231, 4168, 3996, 3919, 3711, 3449, 3205, 2847, - 2768, 2753, 3247, 3688, 3944, 3891, 3297, 3412, 4535, 3801, 4113, 3614, 3726, 4262, 3536, 3501, - 4110, 4227, 4111, 4017, 3989, 3911, 4060, 3981, 4443, 4252, 3533, 4064, 5218, 4409, 4039, 4357, - 4349, 4430, 4602, 3635, 3668, 3478, 4089, 3986, 3850, 3921, 3299, 2831, 4787, 4104, 4314, 4273, - 4406, 4396, 4502, 4768, 4834, 4835, 4776, 4879, 4804, 4581, 4284, 3830, 3349, 3056, 2792, 2828, - 3502, 4083, 3917, 2887, 3595, 4104, 4527, 4548, 4121, 4553, 4539, 3748, 3457, 3565, 3593, 4088, - 4517, 4487, 3903, 4308, 4197, 3997, 3818, 3499, 3259, 2982, 2798, 3251, 4069, 4283, 3624, 3313, - 4152, 4566, 4527, 4429, 4329, 4107, 3860, 3727, 4010, 4015, 4017, 3998, 4317, 4574, 4637, 4457, - 3082, 3492, 4898, 4738, 4425, 4421, 4359, 4378, 4158, 4189, 4552, 4861, 3852, 4246, 5264, 3549, - 4547, 4746, 4419, 4346, 5080, 4303, 4765, 4673, 4898, 4600, 4238, 4844, 4495, 4113, 4562, 4589, - 4519, 4378, 3979, 3762, 3713, 4377, 4504, 3512, 4297, 4295, 3976, 3874, 4777, 5204, 4368, 4872, - 6048, 4428, 4125, 4656, 4625, 4440, 4274, 4510, 3857, 3854, 4537, 4294, 4190, 4138, 4125, 4071, - 4068, 4113, 4204, 4292, 4284, 4326, 4349, 4309, 4273, 4353, 4353, 4342, 4362, 4366, 4425, 4411, - 4425, 4424, 4409, 4283, 4232, 4304, 4109, 3844, 3538, 3315, 3220, 3128, 3102, 3106, 3046, 3029, - 3059, 3165, 3384, 3817, 3977, 4094, 3551, 4535, 5708, 4500, 4272, 4246, 4224, 4445, 4485, 4064, - 4460, 4852, 4815, 5002, 5055, 5072, 4596, 4056, 3619, 3475, 3408, 3939, 4228, 3907, 5348, 4338, - 5019, 5100, 4821, 5333, 4726, 4440, 5217, 4833, 4415, 4566, 4678, 4172, 4061, 4538, 4907, 4858, - 4800, 4630, 4133, 3734, 4124, 4563, 3882, 4262, 4678, 4105, 4211, 4598, 4708, 4372, 4647, 5019, - 5553, 5935, 5259, 5132, 5211, 4868, 4928, 5996, 4450, 4735, 4762, 4811, 4723, 4714, 4827, 4774, - 4762, 4757, 4740, 4753, 4708, 4622, 4597, 4551, 4575, 4603, 4675, 4670, 4610, 4646, 4551, 4482, - 4415, 4450, 4635, 4625, 4595, 4405, 4039, 3661, 3631, 4942, 3496, 3910, 4211, 3810, 3203, 5047, - 5586, 3868, 4510, 4669, 4681, 4614, 4784, 4069, 4324, 5387, 4820, 4692, 4642, 4607, 4931, 5592, - 5133, 4404, 4368, 4161, 4066, 3975, 3627, 3060, 2832, 2784, 2854, 2775, 2592, 2764, 3951, 4435, - 4563, 4560, 4483, 4336, 4051, 3554, 3233, 2892, 2769, 2734, 2745, 3325, 4188, 4463, 4516, 4185, - 4094, 4352, 4505, 4453, 4274, 5178, 4375, 3927, 4473, 4296, 4400, 4917, 4914, 4841, 4758, 4758, - 3918, 4495, 5413, 5163, 4485, 5071, 4915, 5499, 5666, 5300, 5356, 5395, 5617, 6137, 5582, 5373, - 5380, 4976, 4912, 5553, 5322, 5054, 5356, 5378, 5330, 5175, 5267, 5444, 5278, 5335, 5079, 5130, - 5307, 5849, 5634, 5393, 5338, 5208, 5189, 5296, 4621, 4671, 5039, 4826, 4409, 4602, 4924, 5003, - 4984, 4854, 4552, 4504, 4825, 4958, 4431, 5407, 5202, 4985, 4330, 4957, 5508, 5925, 5814, 5185]; - const FLAC_1_64000 = - [0, 1899, 1923, 1932, 2561, 2511, 2475, 2450, 2428, 2382, 2318, 2271, 2264, 2309, 2485, 2522, 2475, 2457, - 2429, 2414, 2378, 2356, 2324, 2275, 2300, 2861, 2774, 2745, 2715, 2623, 2523, 2481, 2607, 2533, 2449, - 2432, 2389, 2363, 2329, 2312, 2262, 2289, 2478, 2533, 2502, 2449, 2424, 2378, 2346, 2543, 2577, 2441, - 2444, 2716, 2690, 2635, 2531, 2469, 2415, 2469, 2684, 2571, 2506, 2471, 2421, 2387, 2357, 2333, 2285, - 2268, 2511, 2476, 2440, 2422, 2413, 2387, 2352, 2326, 2302, 2268, 2319, 2349, 2343, 2293, 2451, 2492, - 2423, 2597, 2713, 2610, 2498, 2578, 2542, 2501, 2533, 2606, 2567, 2486, 2796, 2749, 2718, 2956, 3005, - 2800, 2721, 2645, 2573, 2488, 2491, 2462, 2444, 2399, 2439, 2403, 2395, 2576, 2989, 3240, 3075, 2656, - 2591, 2763, 3781, 4149, 4328, 4317, 4029, 4306, 4017, 3729, 3892, 4443, 4626, 4681, 4388, 3954, 3822, - 4242, 4560, 4484, 4145, 3879, 3028, 4151, 3986, 4494, 4497, 4424, 4388, 3792, 3621, 4439, 4537, 4506, - 3769, 4946, 6288, 5754, 4473, 4795, 4542, 4526, 4850, 4748, 4968, 5160, 5310, 5234, 5155, 5154, 5058, - 4694, 4213, 3691, 3240, 3020, 3568, 4565, 4430, 3369, 3142, 4081, 4445, 3866, 3879, 4573, 4538, 4245, - 4161, 4732, 4776, 4031, 4425, 4403, 4399, 4137, 4505, 4388, 4093, 3916, 3649, 3315, 3222, 3092, 3028, - 2972, 2973, 3050, 3695, 4403, 4599, 4660, 4611, 4603, 4620, 4663, 4508, 4438, 4274, 4183, 3975, 3717, - 3419, 3093, 2974, 2958, 3522, 3945, 4208, 4165, 3562, 3660, 4806, 4066, 4388, 3887, 3998, 4537, 3850, - 3818, 4365, 4514, 4424, 4313, 4273, 4177, 4339, 4256, 4743, 4522, 3842, 4338, 5504, 4691, 4331, 4640, - 4625, 4718, 4877, 3921, 3945, 3769, 4383, 4278, 4127, 4217, 3559, 3101, 5079, 4379, 4579, 4541, 4660, - 4634, 4774, 5063, 5113, 5108, 5067, 5141, 5091, 4885, 4565, 4074, 3613, 3322, 3024, 3055, 3752, 4380, - 4197, 3078, 3848, 4384, 4812, 4839, 4393, 4840, 4820, 3992, 3727, 3865, 3893, 4346, 4791, 4757, 4183, - 4573, 4473, 4283, 4074, 3774, 3488, 3261, 3030, 3519, 4358, 4552, 3863, 3558, 4419, 4865, 4809, 4684, - 4595, 4392, 4129, 3996, 4288, 4313, 4306, 4296, 4589, 4872, 4926, 4745, 3359, 3758, 5157, 5045, 4677, - 4669, 4615, 4632, 4462, 4483, 4808, 5121, 4110, 4525, 5534, 3844, 4823, 5042, 4707, 4624, 5359, 4581, - 5035, 4945, 5169, 4894, 4542, 5119, 4758, 4397, 4864, 4894, 4801, 4653, 4258, 4003, 4008, 4631, 4778, - 3773, 4587, 4570, 4270, 4128, 5061, 5504, 4649, 5150, 6318, 4709, 4422, 4942, 4943, 4727, 4564, 4783, - 4135, 4121, 4817, 4566, 4487, 4440, 4421, 4384, 4380, 4432, 4494, 4560, 4559, 4588, 4603, 4578, 4545, - 4600, 4602, 4587, 4610, 4620, 4676, 4645, 4675, 4669, 4652, 4564, 4520, 4561, 4418, 4098, 3823, 3547, - 3443, 3375, 3355, 3355, 3319, 3310, 3329, 3399, 3628, 4044, 4256, 4398, 3811, 4814, 6004, 4772, 4557, - 4531, 4518, 4729, 4754, 4341, 4761, 5159, 5100, 5278, 5348, 5348, 4876, 4345, 3907, 3778, 3676, 4212, - 4505, 4182, 5637, 4607, 5304, 5386, 5098, 5626, 4995, 4713, 5497, 5109, 4679, 4842, 4966, 4474, 4378, - 4827, 5176, 5127, 5089, 4938, 4404, 3990, 4404, 4868, 4174, 4542, 4953, 4398, 4486, 4885, 4995, 4659, - 4937, 5302, 5836, 6225, 5538, 5421, 5506, 5154, 5221, 6260, 4731, 5011, 5043, 5089, 5000, 5000, 5115, - 5049, 5035, 5040, 5019, 5036, 5000, 4929, 4900, 4834, 4865, 4895, 4968, 4949, 4908, 4926, 4830, 4741, - 4684, 4698, 4948, 4923, 4905, 4675, 4326, 3940, 3912, 5233, 3761, 4181, 4500, 4092, 3446, 5330, 5879, - 4118, 4814, 4989, 4998, 4901, 5078, 4338, 4608, 5686, 5100, 5014, 4950, 4919, 5205, 5838, 5411, 4660, - 4618, 4464, 4376, 4264, 3890, 3318, 3063, 3000, 3087, 2958, 2805, 3000, 4221, 4724, 4846, 4847, 4754, - 4606, 4341, 3846, 3465, 3158, 2957, 2904, 2934, 3566, 4451, 4747, 4802, 4459, 4391, 4622, 4780, 4725, - 4556, 5458, 4651, 4188, 4741, 4564, 4642, 5201, 5199, 5114, 5037, 5032, 4191, 4773, 5692, 5443, 4755, - 5345, 5189, 5780, 5974, 5610, 5646, 5679, 5915, 6412, 5853, 5656, 5666, 5270, 5203, 5824, 5618, 5314, - 5640, 5665, 5636, 5470, 5578, 5716, 5580, 5633, 5356, 5416, 5617, 6146, 5895, 5687, 5626, 5538, 5508]; - const FLAC_2_88200 = - [0, 2545, 2533, 3406, 3336, 3295, 3414, 3555, 3412, 3349, 3280, 3439, 3314, 3277, 3341, 3406, 3537, 3454, - 3357, 3707, 3747, 3591, 3471, 3398, 3347, 3391, 3313, 3380, 3447, 3527, 3440, 3384, 3319, 3347, 3330, - 3286, 3420, 3375, 3455, 3383, 3277, 3464, 3461, 3429, 3336, 3285, 3394, 3432, 3321, 3307, 3362, 3403, - 3513, 3416, 3476, 3336, 3258, 3423, 3424, 3499, 3433, 3384, 3405, 3439, 3370, 3372, 3294, 3401, 3532, - 3397, 3325, 3400, 3340, 3355, 3401, 3316, 3696, 3574, 3587, 4035, 3753, 3502, 3378, 3311, 3338, 3359, - 3348, 3301, 3368, 3468, 3987, 4078, 3815, 3424, 4028, 5193, 5507, 5562, 5239, 5278, 4821, 5140, 5740, - 6007, 5618, 4979, 5088, 5864, 5697, 5000, 4397, 5443, 5278, 5782, 5658, 5480, 4685, 5392, 5904, 5502, - 5473, 7988, 6833, 6042, 5902, 5911, 6088, 6141, 6502, 6589, 6599, 6414, 6245, 5774, 4898, 4146, 4145, - 5405, 5675, 4336, 4582, 5768, 4858, 5267, 5871, 5481, 5290, 6018, 5646, 5652, 5557, 5360, 5716, 5554, - 5053, 4709, 4168, 4068, 4092, 4035, 3982, 4384, 5517, 5931, 6002, 5875, 5894, 5926, 5710, 5419, 5249, - 4954, 4475, 4116, 4019, 4269, 4965, 5390, 5053, 4387, 6120, 5396, 5392, 5097, 5679, 4807, 5402, 5832, - 5669, 5558, 5339, 5371, 6069, 5944, 4969, 5958, 6859, 5637, 5924, 5917, 6267, 4956, 4879, 5384, 5476, - 5265, 5233, 4025, 6421, 5773, 5902, 5950, 5977, 6245, 6522, 6379, 6353, 6363, 6046, 5505, 4849, 4280, - 4126, 4380, 5430, 5236, 4379, 5353, 6161, 6006, 6003, 6095, 5016, 4890, 4909, 5562, 6038, 5738, 5705, - 5648, 5373, 4944, 4450, 4124, 4302, 5432, 5700, 4709, 5482, 6177, 6009, 5902, 5632, 5198, 5239, 5471, - 5505, 5590, 6083, 6238, 5721, 4344, 6327, 6442, 6125, 6018, 5985, 5769, 5866, 6458, 5309, 6678, 5627, - 6212, 6620, 5702, 6813, 6250, 6299, 6566, 6242, 6204, 6280, 5684, 6304, 6264, 6138, 5428, 4978, 5645, - 5951, 4934, 5746, 5605, 5548, 6576, 6086, 6797, 7853, 5490, 6212, 6236, 5820, 6015, 5387, 5954, 6010, - 5882, 5831, 5818, 5818, 5871, 5986, 6085, 6076, 6094, 5960, 6002, 5971, 5996, 6002, 6066, 5993, 5997, - 5983, 5882, 5890, 5762, 5211, 4809, 4477, 4324, 4271, 4241, 4179, 4219, 4417, 4995, 5321, 5472, 4940, - 7369, 6443, 5925, 5730, 6195, 6092, 5718, 6666, 6546, 6816, 6771, 6200, 5356, 4881, 4768, 5561, 5623, - 6782, 6307, 6805, 6711, 7228, 6270, 6725, 6663, 6053, 6421, 5959, 5561, 6401, 6481, 6532, 6238, 5408, - 5275, 6138, 5307, 6452, 5674, 5878, 6541, 6389, 6445, 6784, 7670, 7494, 6963, 6913, 6455, 7769, 6217, - 6477, 6541, 6473, 6490, 6530, 6517, 6461, 6503, 6374, 6324, 6264, 6259, 6286, 6392, 6344, 6328, 6163, - 6040, 6021, 6317, 6281, 6141, 5558, 4924, 6308, 5505, 5363, 5701, 4609, 6741, 7026, 5597, 6547, 6489, - 6382, 5989, 6403, 6964, 6453, 6320, 6110, 6988, 7032, 5940, 5955, 5672, 5502, 4858, 4127, 4056, 4012, - 3954, 3801, 5292, 6058, 6208, 6071, 5912, 5319, 4662, 4084, 4070, 4014, 4456, 5806, 6174, 5884, 5586, - 5942, 6066, 5870, 6952, 5211, 6035, 5853, 6163, 6750, 6653, 6493, 6105, 5744, 7229, 6576, 6627, 6766, - 7676, 7349, 7219, 7275, 8390, 7334, 7361, 7290, 6504, 7326, 7163, 6987, 7283, 7168, 6958, 7333, 7245, - 7176, 6893, 7116, 7757, 7419, 7249, 7203, 7223, 6579, 6152, 6787, 6219, 6069, 6756, 6937, 6915, 6401, - 6073, 6479, 6264, 7045, 6976, 6291, 6384, 7401, 7932, 7363, 6792, 6694, 6315, 7419, 6595, 6844, 7880, - 6694, 7416, 8329, 7314, 6416, 5968, 6634, 6463, 6347, 6644, 6564, 6725, 5216, 5528, 6857, 6548, 7113, - 6810, 6622, 5988, 6791, 6561, 6144, 6216, 5937, 5810, 5642, 6326, 6675, 5727, 6772, 7316, 7025, 7260, - 6635, 6818, 7053, 7078, 7282, 7263, 7570, 7826, 6818, 6554, 7167, 5751, 7318, 7084, 6727, 6377, 7464, - 7114, 6937, 6940, 6761, 7068, 6074, 6870, 7071, 7040, 7255, 7003, 6867, 5831, 5295, 6233, 7024, 6952, - 6694, 5817, 6375, 6605, 5817, 6521, 7497, 6856, 6782, 6287, 6747, 6794, 6589, 6774, 7212, 7176, 7200, - 7088, 7007, 6905, 7144, 6989, 7017, 7021, 6920, 7102, 7039, 6967, 6939, 6857, 6978, 6985, 6781, 6516, - 6393, 6263, 5740, 5308, 5037, 5538, 6307, 4918, 5531, 6613, 6890, 6676, 5845, 7143, 6493, 5291, 4843]; - const FLAC_1_88200 = - [0, 2788, 2776, 3594, 3609, 3577, 3513, 3458, 3372, 3299, 3297, 3543, 3607, 3537, 3509, 3441, 3419, 3371, - 3321, 3842, 4082, 3955, 3825, 3708, 3603, 3719, 3603, 3546, 3468, 3407, 3378, 3318, 3306, 3640, 3624, - 3547, 3503, 3431, 3639, 3659, 3527, 3789, 3793, 3721, 3588, 3536, 3701, 3748, 3615, 3551, 3520, 3458, - 3400, 3346, 3561, 3573, 3513, 3486, 3468, 3417, 3358, 3334, 3347, 3382, 3334, 3476, 3565, 3485, 3882, - 3723, 3596, 3687, 3606, 3640, 3690, 3610, 4058, 3933, 3919, 4214, 4022, 3830, 3703, 3574, 3574, 3548, - 3492, 3552, 3497, 3607, 4177, 4364, 4122, 3756, 4257, 5591, 5936, 6001, 5656, 5721, 5131, 5493, 6101, - 6406, 6028, 5324, 5455, 6270, 6100, 5365, 4543, 5748, 5630, 6146, 6043, 5880, 5031, 5768, 6296, 5867, - 5843, 8484, 7174, 6420, 6303, 6305, 6573, 6599, 6924, 6954, 6968, 6864, 6670, 6094, 5174, 4465, 4271, - 5690, 5981, 4557, 4909, 6175, 5189, 5659, 6224, 5899, 5663, 6343, 5891, 6026, 5942, 5767, 6067, 5902, - 5418, 4997, 4489, 4293, 4173, 4102, 4077, 4613, 5905, 6272, 6344, 6284, 6296, 6321, 6080, 5810, 5675, - 5227, 4804, 4284, 4100, 4536, 5313, 5800, 5392, 4690, 6503, 5808, 5811, 5466, 6079, 5092, 5783, 6215, - 6066, 5961, 5765, 5723, 6452, 6315, 5280, 6381, 7240, 6001, 6320, 6329, 6722, 5372, 5278, 5749, 5902, - 5646, 5647, 4290, 6810, 6154, 6301, 6366, 6386, 6756, 6931, 6834, 6803, 6769, 6384, 5887, 5205, 4606, - 4150, 4665, 5789, 5566, 4578, 5740, 6567, 6406, 6393, 6525, 5400, 5177, 5201, 5987, 6458, 6129, 6098, - 6004, 5763, 5235, 4802, 4311, 4540, 5806, 6003, 5027, 5856, 6571, 6377, 6182, 5983, 5593, 5611, 5866, - 5873, 5966, 6471, 6597, 6083, 4655, 6682, 6901, 6616, 6462, 6358, 6081, 6134, 6772, 5704, 7033, 5939, - 6584, 7024, 6091, 7162, 6605, 6684, 6988, 6618, 6585, 6705, 6105, 6804, 6787, 6633, 5850, 5348, 5963, - 6310, 5246, 6150, 6057, 6031, 7010, 6439, 7223, 8368, 5858, 6656, 6733, 6234, 6460, 5726, 6339, 6390, - 6242, 6207, 6182, 6189, 6217, 6437, 6571, 6578, 6569, 6412, 6446, 6372, 6397, 6442, 6479, 6384, 6396, - 6381, 6215, 6221, 6084, 5615, 5087, 4866, 4745, 4679, 4608, 4567, 4608, 4783, 5319, 5745, 5844, 5252, - 7821, 6760, 6290, 6165, 6641, 6524, 6144, 7062, 6949, 7225, 7144, 6560, 5734, 5122, 5021, 5935, 6052, - 7104, 6707, 7194, 7067, 7729, 6612, 7122, 7058, 6431, 6796, 6345, 5956, 6799, 6927, 6927, 6685, 5809, - 5623, 6620, 5666, 6870, 6085, 6298, 6982, 6764, 6844, 7212, 8093, 7945, 7394, 7310, 6904, 8266, 6560, - 6882, 6948, 6880, 6922, 6984, 6923, 6838, 6896, 6852, 6780, 6714, 6714, 6756, 6859, 6804, 6781, 6599, - 6469, 6466, 6784, 6758, 6614, 5942, 5238, 6596, 5800, 5738, 5986, 4980, 7069, 7432, 6006, 6990, 6955, - 6774, 6391, 6717, 7355, 6909, 6822, 6546, 7456, 7474, 6317, 6329, 6006, 5874, 5194, 4412, 4186, 4282, - 4097, 4088, 5696, 6462, 6633, 6442, 6222, 5679, 4964, 4373, 4117, 4151, 4628, 6235, 6550, 6267, 5973, - 6315, 6462, 6256, 7396, 5560, 6412, 6192, 6530, 7155, 7054, 6919, 6461, 6143, 7691, 7033, 7089, 7180, - 8099, 7867, 7729, 7763, 8875, 7805, 7891, 7810, 6910, 7784, 7623, 7415, 7803, 7695, 7386, 7860, 7741, - 7692, 7295, 7603, 8204, 7920, 7756, 7722, 7706, 7025, 6521, 7217, 6591, 6464, 7231, 7361, 7350, 6780, - 6473, 6901, 6632, 7408, 7438, 6713, 6739, 7867, 8393, 7780, 7205, 7115, 6708, 7858, 7017, 7236, 8386, - 7120, 7864, 8879, 7711, 6863, 6411, 7012, 6883, 6834, 7060, 6928, 7128, 5646, 5922, 7264, 6966, 7528, - 7191, 7056, 6346, 7169, 6943, 6566, 6665, 6345, 6176, 6015, 6683, 7047, 6102, 7251, 7781, 7476, 7775, - 7010, 7207, 7546, 7608, 7832, 7800, 8046, 8242, 7252, 7042, 7659, 6123, 7736, 7602, 7158, 6792, 7929, - 7632, 7385, 7393, 7217, 7572, 6428, 7277, 7542, 7504, 7685, 7359, 7244, 6192, 5755, 6631, 7504, 7393, - 7121, 6134, 6788, 6996, 6174, 6911, 7966, 7323, 7185, 6719, 7152, 7236, 7025, 7220, 7616, 7632, 7636, - 7563, 7427, 7304, 7620, 7444, 7435, 7475, 7312, 7580, 7515, 7402, 7337, 7250, 7411, 7425, 7260, 6994, - 6901, 6799, 6115, 5761, 5390, 5937, 6698, 5239, 5872, 7000, 7304, 7085, 6242, 7589, 6849, 5669, 5093]; - const HEV2_AAC_2_96000 = - [0, 279, 279, 279, 328, 361, 335, 315, 311, 295, 300, 289, 284, 276, 282, 304, 276, 284, 283, 231, 228, - 311, 307, 300, 294, 294, 285, 268, 271, 265, 275, 260, 244, 282, 279, 279, 271, 249, 270, 262, 266, - 277, 273, 277, 268, 281, 273, 271, 280, 281, 312, 253, 261, 273, 276, 261, 323, 306, 307, 284, 291, - 269, 271, 268, 274, 289, 278, 266, 279, 267, 277, 293, 276, 269, 290, 280, 268, 291, 262, 277, 270, - 274, 271, 284, 276, 280, 314, 271, 273, 278, 278, 281, 277, 279, 283, 275, 288, 282, 273, 272, 283, - 282, 275, 278, 281, 278, 285, 282, 274, 303, 303, 273, 270, 279, 279, 269, 268, 281, 271, 284, 272, - 275, 276, 281, 274, 275, 282, 279, 274, 283, 278, 280, 276, 274, 281, 287, 283, 283, 292, 270, 289, - 272, 291, 271, 310, 312, 247, 254, 308, 250, 261, 314, 293, 276, 274, 288, 263, 291, 280, 266, 280, - 266, 267, 284, 282, 270, 279, 273, 323, 258, 274, 273, 273, 276, 283, 284, 278, 280, 276, 292, 267, - 271, 304, 253, 273, 309, 297, 285, 281, 288, 277, 274, 273, 282, 277, 275, 268, 280, 280, 274, 280, - 276, 273, 330, 253, 262, 284, 285, 264, 279, 283, 282, 275, 276, 267, 277, 276, 280, 277, 292, 275, - 280, 278, 282, 273, 278, 271, 278, 288, 283, 273, 275, 287, 282, 284, 277, 280, 277, 321, 255, 302, - 278, 273, 273, 269, 286, 274, 277, 267, 290, 270, 266, 282, 281, 299, 279, 272, 304, 290, 261, 277, - 302, 284, 261, 271, 270, 266, 280, 267, 284, 281, 273, 284, 311, 302, 263, 247, 304, 305, 249, 306, - 299, 280, 271, 281, 291, 262, 260, 261, 265, 268, 287, 282, 287, 279, 279, 272, 289, 259, 253, 296, - 271, 270, 299, 298, 289, 291, 279, 289, 274, 279, 274, 287, 276, 286, 270, 274, 280, 271, 278, 297, - 276, 267, 273, 276, 283, 276, 273, 275, 275, 273, 311, 291, 273, 265, 286, 275, 286, 276, 275, 279, - 277, 282, 273, 307, 258, 272, 265, 270, 271, 281, 280, 289, 286, 280, 282, 287, 291, 276, 292, 268, - 282, 282, 279, 274, 271, 278, 303, 274, 266, 273, 301, 272, 276, 286, 270, 277, 298, 273, 280, 272, - 280, 273, 309, 266, 268, 273, 278, 288, 282, 308, 318, 288, 292, 282, 266, 261, 258, 256, 267, 275, - 268, 288, 293, 301, 284, 271, 276, 278, 291, 279, 292, 306, 263, 260, 265, 267, 271, 263, 270, 271, - 287, 279, 285, 282, 285, 299, 273, 278, 284, 280, 288, 269, 281, 281, 268, 271, 279, 278, 284, 278, - 315, 269, 260, 279, 272, 281, 276, 286, 279, 273, 275, 278, 284, 279, 278, 298, 287, 290, 287, 271, - 277, 270, 273, 280, 332, 270, 264, 253, 277, 272, 282, 279, 279, 284, 274, 299, 288, 285, 280, 273, - 303, 296, 303, 304, 256, 254, 261, 259, 271, 282, 273, 266, 280, 271, 280, 277, 274, 275, 275, 283, - 280, 280, 282, 279, 282, 288, 273, 280, 279, 283, 332, 270, 263, 273, 273, 270, 274, 272, 273, 272, - 282, 290, 284, 298, 291, 319, 271, 257, 263, 269, 268, 270, 276, 278, 280, 270, 275, 288, 293, 289, - 292, 277, 292, 279, 279, 269, 274, 277, 279, 279, 278, 280, 271, 283, 286, 282, 270, 277, 271, 278, - 280, 281, 280, 276, 287, 284, 281, 276, 281, 280, 285, 273, 282, 271, 278, 276, 272, 279, 287, 270, - 280, 283, 276, 277, 281, 276, 273, 278, 271, 284, 280, 273, 273, 290, 302, 317, 287, 284, 261, 264, - 267, 266, 275, 270, 276, 279, 286, 270, 278, 283, 291, 284, 269, 306, 263, 276, 281, 284, 271, 286, - 282, 276, 285, 277, 315, 307, 264, 268, 267, 273, 276, 277, 280, 295, 279, 315, 266, 259, 255, 310, - 288, 258, 269, 271, 272, 271, 277, 276, 302, 271, 272, 283, 275, 272, 286, 271, 280, 271, 279, 298, - 291, 281, 280, 268, 268, 269, 269, 281, 291, 283, 279, 286, 273, 282, 273, 285, 275, 271, 283, 302, - 286, 285, 304, 284, 280, 276, 282, 276, 274, 272, 274, 283, 278, 271, 267, 288, 282, 271, 267, 272, - 291, 273, 279, 291, 271, 267, 272, 303, 284, 266, 276, 278, 269, 285, 271, 276, 284, 274, 272, 289, - 280, 275, 285, 280, 281, 274, 278, 282, 275, 283, 293, 292, 292, 279, 267, 285, 283, 281, 282, 273, - 281, 278, 271, 273, 268, 278, 270, 288, 300, 284, 278, 277, 276, 279, 282, 284, 280, 282, 290, 274, - 280, 277, 292, 269, 271, 286, 272, 270, 279, 276, 276, 271, 279, 273, 280, 283, 272, 281, 279, 281]; - const AAC_ES_DICT = { - 'LC_AAC_2_96000' : LC_AAC_2_96000, - 'LC_AAC_1_96000' : LC_AAC_1_96000, - 'LC_AAC_2_8000' : LC_AAC_2_8000, - 'LC_AAC_1_8000' : LC_AAC_1_8000, - 'LC_AAC_2_11025' : LC_AAC_2_11025, - 'LC_AAC_1_11025' : LC_AAC_1_11025, - 'LC_AAC_2_12000' : LC_AAC_2_12000, - 'LC_AAC_1_12000' : LC_AAC_1_12000, - 'LC_AAC_2_16000' : LC_AAC_2_16000, - 'LC_AAC_1_16000' : LC_AAC_1_16000, - 'LC_AAC_2_22050' : LC_AAC_2_22050, - 'LC_AAC_1_22050' : LC_AAC_1_22050, - 'HE_AAC_2_24000' : HE_AAC_2_24000, - 'HE_AAC_1_24000' : HE_AAC_1_24000, - 'HE_AAC_2_32000' : HE_AAC_2_32000, - 'HE_AAC_1_32000' : HE_AAC_1_32000, - 'HE_AAC_2_44100' : HE_AAC_2_44100, - 'HE_AAC_1_44100' : HE_AAC_1_44100, - 'HE_AAC_2_48000' : HE_AAC_2_48000, - 'HE_AAC_1_48000' : HE_AAC_1_48000, - 'HE_AAC_2_64000' : HE_AAC_2_64000, - 'HE_AAC_1_64000' : HE_AAC_1_64000, - 'HE_AAC_2_88200' : HE_AAC_2_88200, - 'HE_AAC_1_88200' : HE_AAC_1_88200, - 'HEv2_AAC_2_96000' : HEV2_AAC_2_96000 - }; - const FLAC_ES_DICT = { - 'FLAC_2_96000' : FLAC_2_96000, - 'FLAC_1_96000' : FLAC_1_96000, - 'FLAC_2_8000' : FLAC_2_8000, - // 'FLAC_1_8000' : FLAC_1_8000, - 'FLAC_2_11025' : FLAC_2_11025, - 'FLAC_1_11025' : FLAC_1_11025, - 'FLAC_2_12000' : FLAC_2_12000, - 'FLAC_1_12000' : FLAC_1_12000, - // 'FLAC_2_16000' : FLAC_2_16000, - 'FLAC_1_16000' : FLAC_1_16000, - 'FLAC_2_22050' : FLAC_2_22050, - 'FLAC_1_22050' : FLAC_1_22050, - 'FLAC_2_24000' : FLAC_2_24000, - 'FLAC_1_24000' : FLAC_1_24000, - 'FLAC_2_32000' : FLAC_2_32000, - 'FLAC_1_32000' : FLAC_1_32000, - 'FLAC_2_44100' : FLAC_2_44100, - 'FLAC_1_44100' : FLAC_1_44100, - 'FLAC_2_48000' : FLAC_2_48000, - 'FLAC_1_48000' : FLAC_1_48000, - 'FLAC_2_64000' : FLAC_2_64000, - 'FLAC_1_64000' : FLAC_1_64000, - 'FLAC_2_88200' : FLAC_2_88200, - 'FLAC_1_88200' : FLAC_1_88200, - }; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - needGetMediaDes = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - NEW_ES_LIST = []; - channelCountList = []; - sampleRateList = []; - ES = []; - ES_LENGTH = 0; - rate = 44.1; - isMp3 = false; - isVorbis = false; - ES_DICT = {} - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - console.info('case audioDecodeProcessor is not null'); - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - async function beforeTest() { - console.info('beforeTest case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - needGetMediaDes = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = []; - ES_LENGTH = 0; - rate = 44.1; - isMp3 = false; - isVorbis = false; - } - - async function aferTest() { - console.info('afterTest case'); - if (audioDecodeProcessor != null) { - console.info('case audioDecodeProcessor is not null'); - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - inputCnt = 0; - outputCnt = 0; - await closeFdRead(); - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - async function closeFdRead() { - await fileio.close(fdRead).then(() => { - console.info('[fileio] case close fdRead success, fd is ' + fdRead); - }, failCallback).catch(failCatch); - } - - function writeFile(buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.writeSync buffer success'); - } catch(e) { - console.info('case fileio.writeSync buffer error is ' + e); - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - inputobject.timeMs = timestamp; - inputobject.offset = 0; - if (frameCnt==1 && isVorbis) { - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 8; - } else if (isMp3) { - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } else { - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - } - if (isMp3) { - timestamp += ES[1]/rate; - } else { - timestamp += ES[frameCnt]/rate; - } - frameCnt += 1; - audioDecodeProcessor.pushInputData(inputobject).then(() => { - console.info("pushInputData success"); - inputCnt += 1; - }) - } - } - - async function dequeueAllOutputs(queue, nextStep, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await audioDecodeProcessor.stop().then(() => { - console.log("stop success"); - }, failCallback).catch(failCatch); - inputQueue = []; - outputQueue = []; - await audioDecodeProcessor.reset().then(() => { - console.log("reset success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.release().then(() => { - console.info('release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - if(ES_LIST == false) { - done(); - } else { - await aferTest(); - nextStep(); - } - } - else{ - console.log("write to file success"); - } - audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }) - } - } - - function printfDescription(obj) { - for (let item in obj) { - let property = obj[item]; - console.info("AudioDecoder config is" + item + ":" + property); - } - } - - function setCallback(nextStep, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info("needInputData"); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info("newOutputData"); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.log("get OutputMediaDescription success"); - console.log('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }, failCallback).catch(failCatch);} - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, nextStep, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - eventEmitter.on('nextStep', async (done) => { - console.info('in case : nextStep success'); - await beforeTest(); - let fileName = ES_LIST.shift(); - let configList = fileName.split("_").reverse(); - let sampleRate = Number(configList[0]); - let channelCount = Number(configList[1]); - let mime = 'audio/mp4a-latm'; - let savePath = `${fileName}.pcm`; - let srcPath = `${fileName}.aac`; - rate = (sampleRate / 1000); - let mediaDescription = { - "channel_count": channelCount, - "sample_rate": sampleRate, - "audio_sample_format": 1, - } - needGetMediaDes = true; - ES = ES_DICT[fileName] - ES_LENGTH = ES.length - 1; - if(configList[2] === 'AAC') { - console.info('in case : AAC'); - mime = 'audio/mp4a-latm'; - if(configList[3] === 'LC') { - codecProfile = 0; - }else if(configList[3] === 'HE') { - codecProfile = 3; - }else if(configList[3] === 'HEv2') { - codecProfile = 4; - } - mediaDescription = { - "channel_count": channelCount, - "sample_rate": sampleRate, - "audio_sample_format": 1, - "codec_profile" : codecProfile, - } - }else if(configList[2] === 'FLAC') { - mime = 'audio/flac'; - srcPath = `${fileName}.flac` - } - console.info('ES_LENGTH: ' + ES_LENGTH); - await decoderSource(mediaDescription, savePath, mime, srcPath, done); - - }); - - async function getFormatCaps(decodeMime) { - await media.createAudioDecoderByMime(decodeMime).then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - console.info("print AudioCaps.supportedSampleRates: " + AudioCaps.supportedSampleRates) - console.info("print AudioCaps.supportedChannel.min: " + AudioCaps.supportedChannel.min) - console.info("print AudioCaps.supportedChannel.max: " + AudioCaps.supportedChannel.max) - sampleRateList = AudioCaps.supportedSampleRates; - for (let i = AudioCaps.supportedChannel.min; i <= AudioCaps.supportedChannel.max; i++) { - channelCountList.push(i); - } - }, failCallback).catch(failCatch); - - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - - async function getEsList(format) { - for (let index in configList) { - let fileName = `${format}_${configList[index]}`; - NEW_ES_LIST.push(fileName); - } - } - - async function decoderSource(config, savePath, mime, readPath, done) { - console.info('start test case'); - let mediaDescription = config; - let decodeMime = mime; - await getFdRead(readPath, done); - console.info('case getFdRead success'); - await media.createAudioDecoderByMime(decodeMime).then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback( - function(){eventEmitter.emit('nextStep', done);}, done - ); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getOutputMediaDescription().then((mediaDescription) => { - console.info("getOutputMediaDescription success"); - printfDescription(mediaDescription); - },failCallback).catch(failCatch); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_COMPATIBILITY_AAC_PROMISE_0100 - * @tc.name : 001.test AAC format compatibility - * @tc.desc : audio decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_COMPATIBILITY_AAC_PROMISE_0100', 0, async function (done) { - console.log("case test AAC format compatibility"); - await getFormatCaps('audio/mp4a-latm'); - ES_DICT = AAC_ES_DICT; - let FORMAT_LIST = ["LC_AAC", "HE_AAC", "HEv2_AAC"] - let COMPATIBILITY_LIST = [channelCountList, sampleRateList] - for (let index in COMPATIBILITY_LIST) { - configList = COMPATIBILITY_LIST[index]; - FORMAT_LIST.forEach(getEsList); - FORMAT_LIST = NEW_ES_LIST; - NEW_ES_LIST = []; - } - for (let index in FORMAT_LIST) { - let fileName = FORMAT_LIST[index]; - if (fileName in ES_DICT){ - NEW_ES_LIST.push(fileName); - } - } - ES_LIST = NEW_ES_LIST; - console.log('ES_LIST: ' + ES_LIST); - let nextStep = function(){eventEmitter.emit('nextStep', done);} - nextStep(); - - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_COMPATIBILITY_FLAC_PROMISE_0100 - * @tc.name : 001.test FLAC format compatibility - * @tc.desc : audio decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_COMPATIBILITY_FLAC_PROMISE_0100', 0, async function (done) { - console.log("case test FLAC format compatibility"); - await getFormatCaps('audio/flac'); - ES_DICT = FLAC_ES_DICT; - let FORMAT_LIST = ["FLAC"] - let COMPATIBILITY_LIST = [channelCountList, sampleRateList] - for (let index in COMPATIBILITY_LIST) { - configList = COMPATIBILITY_LIST[index]; - FORMAT_LIST.forEach(getEsList); - FORMAT_LIST = NEW_ES_LIST; - NEW_ES_LIST = []; - } - for (let index in FORMAT_LIST) { - let fileName = FORMAT_LIST[index]; - if (fileName in ES_DICT){ - NEW_ES_LIST.push(fileName); - } - } - ES_LIST = NEW_ES_LIST; - console.log('ES_LIST: ' + ES_LIST); - let nextStep = function(){eventEmitter.emit('nextStep', done);} - nextStep(); - - }) - -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/AudioEncoderFormatCompatibilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/AudioEncoderFormatCompatibilityPromiseTest.test.js deleted file mode 100644 index 07d6febc62e708cf47373b2a814588f84c0ba894..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/AudioEncoderFormatCompatibilityPromiseTest.test.js +++ /dev/null @@ -1,404 +0,0 @@ -/* - * 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 - * - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioEncoderFormatCompatibilityPromise', function () { - let audioEncodeProcessor; - let eosframenum = 0; - let resetAtEOS = false; - let workdoneAtEOS = false; - let needgetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let rate = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = [0, 2048]; - let ES_LENGTH = 1000; - let readPath; - let fdRead; - let fdWrite; - let readStreamSync; - let fileAssetWrite; - let channelCount; - let channelCountList = []; - let sampleRateList = []; - let formatSampleRate = []; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioEncodeProcessor != null) { - console.info('case audioEncodeProcessor is not null'); - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - audioEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - async function resetParam() { - eosframenum = 0; - resetAtEOS = false; - workdoneAtEOS = false; - needgetMediaDes = false; - needrelease = false - frameCnt = 1; - timestamp = 0; - rate = 0; - sawInputEOS = false; - sawOutputEOS = false; - readStreamSync = undefined; - inputQueue = []; - outputQueue = []; - ES = [0, 4096] - ES_LENGTH = 1000; - outputCnt = 0; - inputCnt = 0; - } - - async function beforeTest() { - console.info('beforeTest case'); - audioEncodeProcessor = null; - eosframenum = 0; - resetAtEOS = false; - workdoneAtEOS = false; - needgetMediaDes = false; - needrelease = false - frameCnt = 1; - timestamp = 0; - rate = 0; - sawInputEOS = false; - sawOutputEOS = false; - readStreamSync = undefined; - inputQueue = []; - outputQueue = []; - ES = [0, 4096] - ES_LENGTH = 1000; - } - - async function aferTest() { - console.info('afterTest case'); - if (audioEncodeProcessor != null) { - console.info('case audioEncodeProcessor is not null'); - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - audioEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - await closeFdRead(); - inputCnt = 0; - outputCnt = 0; - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - async function closeFdRead() { - await fileio.close(fdRead).then(() => { - console.info('[fileio] case close fdRead success, fd is ' + fdRead); - }, failCallback).catch(failCatch); - } - - - function writeFile(buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function resetWork() { - resetParam(); - await audioEncodeProcessor.reset().then(async() => { - console.info("case reset success"); - if (needrelease) { - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - }, failCallback).catch(failCatch); - } - - async function doneWork() { - await audioEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - - async function enqueueInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - console.info("case frameCnt:" + frameCnt); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1) { - console.info("case EOS frame seperately") - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } - timestamp += 23; - frameCnt += 1; - audioEncodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - inputCnt += 1; - }); - } - } - - async function dequeueOutputs(queue, nextStep, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputObject = queue.shift(); - if (outputObject.flags == 1) { - sawOutputEOS = true; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await doneWork(); - if(sampleRateList == false && channelCountList[0] != undefined) { - await aferTest(); - channelCount = channelCountList.shift(); - sampleRateList = formatSampleRate.toString().split(','); - console.info('channelCountList[0]: ' + channelCountList[0]); - console.info('formatSampleRate ' + formatSampleRate); - nextStep(); - return; - }else if (channelCountList == false && sampleRateList == false) { - done(); - } else { - await aferTest(); - nextStep(); - return; - } - } else { - console.info("write to file success"); - } - audioEncodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('release output success'); - }); - } - } - - function printfDescription(obj) { - for (let item in obj) { - let property = obj[item]; - console.info("AudioEncoder config is" + item + ":" + property); - } - } - - function setCallback(nextStep, done) { - console.info('case callback'); - audioEncodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueInputs(inputQueue); - }); - audioEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needgetMediaDes) { - audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needgetMediaDes=false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - await dequeueOutputs(outputQueue, nextStep, done); - }); - audioEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - eventEmitter.on('nextStep', async (done) => { - console.info('in case : nextStep success'); - await beforeTest(); - let sampleRate = Number(sampleRateList.shift()); - let savePath = `AAC_LC_${channelCount}_${sampleRate}.aac`; - let srcPath = `S16LE_${channelCount}_${sampleRate}.pcm`; - if (channelCount === 2) { - ES = [0, 4096]; - } else { - ES = [0, 2048]; - } - let mediaDescription = { - "channel_count": channelCount, - "sample_rate": sampleRate, - "audio_sample_format": 1, - "codec_mime": 'audio/mp4a-latm', - } - - await encodeSource(mediaDescription, savePath, srcPath, done); - }); - - async function getFormatCaps() { - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps) - console.info("print AudioCaps.supportedSampleRates: " + AudioCaps.supportedSampleRates) - console.info("print AudioCaps.supportedChannel.min: " + AudioCaps.supportedChannel.min) - console.info("print AudioCaps.supportedChannel.max: " + AudioCaps.supportedChannel.max) - formatSampleRate = AudioCaps.supportedSampleRates; - for (let i = AudioCaps.supportedChannel.min; i <= AudioCaps.supportedChannel.max; i++) { - channelCountList.push(i); - } - }, failCallback).catch(failCatch); - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - audioEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - - async function encodeSource(config, savePath, srcPath, done){ - console.info('start test case'); - let mediaDescription = config; - readPath = srcPath; - needgetMediaDes = true; - workdoneAtEOS = true; - await getFdRead(readPath, done); - console.info('case getFdRead success'); - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps) - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(function(){eventEmitter.emit('nextStep', done);}, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success") - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getOutputMediaDescription().then((mediaDescription) => { - console.info("getOutputMediaDescription success"); - printfDescription(mediaDescription); - },failCallback).catch(failCatch); - audioEncodeProcessor.on('error',(err) => { - console.info(`case error called,errName is ${err.name}`); - console.info(`case error called,errCode is ${err.code}`); - console.info(`case error called,errMessage is ${err.message}`); - expect().assertFail(); - done(); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FORMAT_COMPATIBILITY_AAC_PROMISE_0100 - * @tc.name : 01.test acc format compatibility - * @tc.desc : audio encoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FORMAT_COMPATIBILITY_AAC_PROMISE_0100', 0, async function (done) { - console.info("case test acc format compatibility"); - await getFormatCaps(); - sampleRateList = formatSampleRate.toString().split(','); - channelCount = channelCountList.shift(); - let nextStep = eventEmitter.emit('nextStep', done); - nextStep(); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/List.test.js deleted file mode 100644 index e08357c0077aa8f3431191e43515e65116089833..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/js/test/List.test.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 - * - * 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. - */ - - -require('./AudioEncoderFormatCompatibilityPromiseTest.test.js') -require('./AudioDecoderFormatCompatibilityPromiseTest.test.js') - diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/audioCodecFormat/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40f7360d5d818998221b199d3ec0f69c0..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioCodecFormat/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioCodecFormat/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/audioCodecFormat/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/audioCodecFormat/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/media/media_js_standard/audioDecoder/BUILD.gn b/multimedia/media/media_js_standard/audioDecoder/BUILD.gn deleted file mode 100644 index 446e133f839ab4f1522d7346aa01e073c6470c16..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("audio_decoder_js_hap") { - hap_profile = "./src/main/config.json" - js2abc = true - deps = [ - ":audio_decoder_js_assets", - ":audio_decoder_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAudioDecoderJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_player_framework" -} -ohos_js_assets("audio_decoder_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("audio_decoder_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/media/media_js_standard/audioDecoder/Test.json b/multimedia/media/media_js_standard/audioDecoder/Test.json deleted file mode 100644 index b226d97e5a96de813c1f431d4463e56dd9037c9a..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/Test.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "description": "Configuration for audioDecoder Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "2000000", - "package": "ohos.acts.multimedia.audio.audiodecoder", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAudioDecoderJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "rm -rf /storage/media/100/local/files/*", - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/", - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/" - ], - "teardown-command":[ - ] - }, - { - "type": "PushKit", - "pre-push": [ - ], - "push": [ - "./resource/audio/audioDecode/AAC_48000_32_1.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/", - "./resource/audio/audioDecode/AAC_16000_1.aac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/", - "./resource/audio/audioDecode/FLAC_48000_32_1.flac ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/", - "./resource/audio/audioDecode/mp3.es ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/", - "./resource/audio/audioDecode/vorbis.es ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/", - "chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.audio.audiodecoder/haps/entry/files/*", - "chmod 777 -R /storage/media/100/local/files/", - "chmod 777 /storage/media/100/local/files/*" - ], - "teardown-command":[ - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/audioDecoder/signature/openharmony_sx.p7b deleted file mode 100644 index 02772ce36b607a459e0e124b0240997e7e0c5523..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/audioDecoder/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/config.json b/multimedia/media/media_js_standard/audioDecoder/src/main/config.json deleted file mode 100644 index 8cc8834a54914997f444435118f3928b98f017cd..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/config.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.audio.audiodecoder", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.audio.audiodecoder.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "standard" - } - ], - "deviceType": [ - "default", - "default", - "tablet", - "tv", - "wearable" - ], - "reqPermissions": [ - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.MEDIA_LOCATION", - "reason" : "use ohos.permission.MEDIA_LOCATION" - }, - { - "name" : "ohos.permission.READ_MEDIA", - "reason" : "use ohos.permission.READ_MEDIA" - }, - { - "name" : "ohos.permission.WRITE_MEDIA", - "reason" : "use ohos.permission.WRITE_MEDIA" - } - ], - "mainAbility": "ohos.acts.multimedia.audio.audiodecoder.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.audio.audiodecoder", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/app.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/app.js deleted file mode 100644 index 830070d196d86b127cea947d168bfd116f446205..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/i18n/en-US.json b/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/i18n/zh-CN.json b/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.css deleted file mode 100644 index c9195944a956c0d5628c701b7a3d9d2ed525cd2d..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 8d0e2061b88c99c91488405f0f2ead0c77de1a9e..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.js deleted file mode 100644 index 67f8b8567ccc4932331b7a18a6b947340d84fb40..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 60000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js deleted file mode 100644 index 751206b6761aabf7ae3d61b07c6552806997ca4f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderEnum', function () { - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - }) - - afterEach(function() { - console.info('afterEach case'); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_AACProfile_0100 - * @tc.name : 001.AACProfile - * @tc.desc : Test Enumerate AACProfile - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_AACProfile_0100', 0, async function (done) { - expect(media.AACProfile.AAC_PROFILE_LC).assertEqual(0); - expect(media.AACProfile.AAC_PROFILE_ELD).assertEqual(1); - expect(media.AACProfile.AAC_PROFILE_ERLC).assertEqual(2); - expect(media.AACProfile.AAC_PROFILE_HE).assertEqual(3); - expect(media.AACProfile.AAC_PROFILE_HE_V2).assertEqual(4); - expect(media.AACProfile.AAC_PROFILE_LD).assertEqual(5); - expect(media.AACProfile.AAC_PROFILE_MAIN).assertEqual(6); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_AudioCaps_0100 - * @tc.name : 002.AudioCaps - * @tc.desc : Test Interface AudioCaps - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_AudioCaps_0100', 0, async function (done) { - console.info("case test Test Interface AudioCaps"); - let audioDecodeProcessor; - let audioCaps; - await media.createAudioDecoderByName('avdec_aac').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - audioCaps = AudioCaps; - }, failCallback).catch(failCatch); - // check AudioCaps - expect(audioCaps.codecInfo !== undefined).assertTrue(); - - // check AudioCaps.AVCodecInfo - let avCodecInfo = audioCaps.codecInfo; - expect(avCodecInfo.name !== undefined).assertTrue(); - console.info('avCodecInfo.name: '+ avCodecInfo.name); - expect(avCodecInfo.type !== undefined).assertTrue(); - console.info('avCodecInfo.type: '+ avCodecInfo.type); - expect(avCodecInfo.mimeType !== undefined).assertTrue(); - console.info('avCodecInfo.mimeType: '+ avCodecInfo.mimeType); - expect(avCodecInfo.isHardwareAccelerated !== undefined).assertTrue(); - console.info('avCodecInfo.isHardwareAccelerated: '+ avCodecInfo.isHardwareAccelerated); - expect(avCodecInfo.isSoftwareOnly !== undefined).assertTrue(); - console.info('avCodecInfo.isSoftwareOnly: '+ avCodecInfo.isSoftwareOnly); - expect(avCodecInfo.isVendor !== undefined).assertTrue(); - console.info('avCodecInfo.isVendor: '+ avCodecInfo.isVendor); - - // check AudioCaps.supportedBitrate - expect(audioCaps.supportedBitrate !== undefined).assertTrue(); - console.info('supportedBitrate.min: '+ audioCaps.supportedBitrate.min); - console.info('supportedBitrate.max: '+ audioCaps.supportedBitrate.max); - - // check AudioCaps.supportedChannel - expect(audioCaps.supportedChannel !== undefined).assertTrue(); - console.info('supportedChannel.min: '+ audioCaps.supportedChannel.min); - console.info('supportedChannel.max: '+ audioCaps.supportedChannel.max); - - // check AudioCaps.supportedFormats - expect(audioCaps.supportedFormats !== undefined).assertTrue(); - console.info('audioCaps.supportedFormats: '+ audioCaps.supportedFormats); - - // check AudioCaps.supportedSampleRates - expect(audioCaps.supportedSampleRates !== undefined).assertTrue(); - console.info('audioCaps.supportedSampleRates: '+ audioCaps.supportedSampleRates); - - // check AudioCaps.supportedProfiles - expect(audioCaps.supportedProfiles !== undefined).assertTrue(); - console.info('audioCaps.supportedProfiles: '+ audioCaps.supportedProfiles); - - // check AudioCaps.supportedComplexity - expect(audioCaps.supportedComplexity !== undefined).assertTrue(); - console.info('supportedComplexity.min: '+ audioCaps.supportedComplexity.min); - console.info('supportedComplexity.max: '+ audioCaps.supportedComplexity.max); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100 - * @tc.name : 003.AVCodecType - * @tc.desc : Test Enumerate AVCodecType - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100', 0, async function (done) { - expect(media.AVCodecType.AVCODEC_TYPE_VIDEO_ENCODER).assertEqual(0); - expect(media.AVCodecType.AVCODEC_TYPE_VIDEO_DECODER).assertEqual(1); - expect(media.AVCodecType.AVCODEC_TYPE_AUDIO_ENCODER).assertEqual(2); - expect(media.AVCodecType.AVCODEC_TYPE_AUDIO_DECODER).assertEqual(3); - done(); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js deleted file mode 100644 index fe3178dda6feaa5b5b88b898209efc21e740f10f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js +++ /dev/null @@ -1,943 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderFormatCallback', function () { - const AUDIOPATH1 = 'AAC_48000_32_1.aac'; - const AUDIOPATH2 = 'FLAC_48000_32_1.flac' - const AUDIOPATH3 = 'mp3.es'; - const AUDIOPATH4 = 'vorbis.es'; - const BASIC_PATH = 'results/decode_format_callback_'; - let audioDecodeProcessor; - let readStreamSync; - let needGetMediaDes = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = []; - let ES_LENGTH = 0; - let samplerate = 44.1; - let isMp3 = false; - let isVorbis = false; - let readpath; - let savepath; - let fdRead; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - needGetMediaDes = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = []; - ES_LENGTH = 0; - samplerate = 44.1; - isMp3 = false; - isVorbis = false; - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function writeFile(path, buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.writeSync buffer success'); - } catch(e) { - console.info('case fileio.writeSync buffer error is ' + e); - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - inputobject.timeMs = timestamp; - inputobject.offset = 0; - if (frameCnt==1 && isVorbis) { - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 8; - } else if (isMp3) { - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } else { - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - } - if (isMp3) { - timestamp += ES[1]/samplerate; - } else { - timestamp += ES[frameCnt]/samplerate; - } - frameCnt += 1; - audioDecodeProcessor.pushInputData(inputobject, () => { - console.info('queueInput success'); - inputCnt += 1; - }) - } - } - - async function dequeueAllOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.log("stop success"); - inputQueue = []; - outputQueue = []; - audioDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.log("reset success"); - audioDecodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioDecodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - }) - }) - } else { - console.log("write to file success"); - } - audioDecodeProcessor.freeOutputBuffer(outputobject, () => { - console.info('release output success'); - }) - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info("inputBufferAvailable"); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info("outputBufferAvailable"); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => { - console.log("get OutputMediaDescription success"); - console.log('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }) - } - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_CALLBACK_0100 - * @tc.name : 001.test aac format(createbymime) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_CALLBACK_0100', 0, async function (done) { - console.log("case test aac format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_callback_aac_01.pcm'; - readpath = AUDIOPATH1; - await getFdRead(readpath, done); - needGetMediaDes = true; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338]; - ES_LENGTH = 1000; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_CALLBACK_0200 - * @tc.name : 001.test aac format(createbyname) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_CALLBACK_0200', 0, async function (done) { - console.log("case test aac format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_callback_aac_02.pcm'; - readpath = AUDIOPATH1; - await getFdRead(readpath, done); - needGetMediaDes = true; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338]; - ES_LENGTH = 1000; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByName('avdec_aac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_CALLBACK_0100 - * @tc.name : 002.test flac format(createbymime) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_CALLBACK_0100', 0, async function (done) { - console.log("case test flac format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_callback_flac_01.pcm'; - readpath = AUDIOPATH2; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - ES = [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, 2806, - 2796,2786, 2774, 2758, 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, 2839, 2794, - 2770, 2763,2756, 2722, 2950, 2876, 2842, 2827, 2792, 3121, 3075, 2969, 3240, 3199, - 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, 2779, 2963, 2893, 2870, - 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, 2876, 3223, 3040, 3006, 3042, - 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, 3300, 3140, 3014, 2975, 2952, 2896, - 2897, 2842, 2929, 3567, 3929, 3485, 3082, 3625, 4953, 5239, 5094, 4993, 4821, 4431, - 5195, 5542, 5557, 4894, 4414, 5085, 5496, 5089, 4459, 4532, 4778, 5460, 5372, 5224, - 4395, 4701, 5512, 5304, 4798, 7128, 6534, 5704, 5562, 5539, 5675, 5780, 6058, 6194, - 6076, 5971, 5758, 5202, 4438, 3821, 4267, 5550, 4896, 3841, 5166, 4904, 4504, 5530, - 5354, 5047, 5695, 5422, 5168, 5338, 5154, 5385, 5322, 4934, 4512, 4001, 3793, 3624, - 3589, 3562, 4346, 5407, 5582, 5645, 5581, 5605, 5520, 5399, 5164, 4991, 4556, 4058, - 3662, 3757, 4627, 5183, 5061, 4114, 5840, 5051, 5126, 4573, 5269, 4437, 5021, 5508, - 5289, 5171, 5153, 5118, 5721, 5375, 4863, 6353, 5477, 5608, 5614, 5737, 5178, 4614, - 4671, 5204, 5027, 4977, 3922, 5904]; - ES_LENGTH = 200; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByMime('audio/flac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_CALLBACK_0200 - * @tc.name : 002.test flac format(createbyname) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_CALLBACK_0200', 0, async function (done) { - console.log("case test flac format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_callback_flac_02.pcm'; - readpath = AUDIOPATH2; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - ES = [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, 2806, - 2796,2786, 2774, 2758, 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, 2839, 2794, - 2770, 2763,2756, 2722, 2950, 2876, 2842, 2827, 2792, 3121, 3075, 2969, 3240, 3199, - 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, 2779, 2963, 2893, 2870, - 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, 2876, 3223, 3040, 3006, 3042, - 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, 3300, 3140, 3014, 2975, 2952, 2896, - 2897, 2842, 2929, 3567, 3929, 3485, 3082, 3625, 4953, 5239, 5094, 4993, 4821, 4431, - 5195, 5542, 5557, 4894, 4414, 5085, 5496, 5089, 4459, 4532, 4778, 5460, 5372, 5224, - 4395, 4701, 5512, 5304, 4798, 7128, 6534, 5704, 5562, 5539, 5675, 5780, 6058, 6194, - 6076, 5971, 5758, 5202, 4438, 3821, 4267, 5550, 4896, 3841, 5166, 4904, 4504, 5530, - 5354, 5047, 5695, 5422, 5168, 5338, 5154, 5385, 5322, 4934, 4512, 4001, 3793, 3624, - 3589, 3562, 4346, 5407, 5582, 5645, 5581, 5605, 5520, 5399, 5164, 4991, 4556, 4058, - 3662, 3757, 4627, 5183, 5061, 4114, 5840, 5051, 5126, 4573, 5269, 4437, 5021, 5508, - 5289, 5171, 5153, 5118, 5721, 5375, 4863, 6353, 5477, 5608, 5614, 5737, 5178, 4614, - 4671, 5204, 5027, 4977, 3922, 5904]; - ES_LENGTH = 200; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByName('avdec_flac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_CALLBACK_0100 - * @tc.name : 003.test mp3 format(createbymime) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_CALLBACK_0100', 0, async function (done) { - console.log("test mp3 format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_callback_mp3_01.pcm'; - readpath = AUDIOPATH3; - await getFdRead(readpath, done); - needGetMediaDes = true; - isMp3 = true; - isVorbis = false; - ES = [0, 1044]; - ES_LENGTH = 1000; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByMime('audio/mpeg', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_CALLBACK_0200 - * @tc.name : 003.test mp3 format(createbyname) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_CALLBACK_0200', 0, async function (done) { - console.log("test mp3 format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_callback_mp3_02.pcm'; - readpath = AUDIOPATH3; - await getFdRead(readpath, done); - needGetMediaDes = true; - isMp3 = true; - isVorbis = false; - ES = [0, 1044]; - ES_LENGTH = 1000; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByName('avdec_mp3', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_CALLBACK_0100 - * @tc.name : 004.test vorbis format(createbymime) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_CALLBACK_0100', 0, async function (done) { - console.log("test vorbis format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_callback_vorbis_01.pcm'; - readpath = AUDIOPATH4; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - isVorbis = true; - ES = [0, 3251, 33, 160, 162, 159, 148, 160, 160, 159, 167, 156, 162, 173, 135, 137, 133, - 126, 126, 130, 127, 133, 138, 132, 124, 129, 134, 136, 146, 135, 137, 144, 137, 128, - 124, 127, 129, 127, 130, 127, 134, 130, 135, 146, 142, 140, 134, 134, 128, 119, 122, - 122, 123, 121, 128, 125, 128, 122, 137, 141, 136, 135, 127, 128, 125, 128, 122, 126, - 132, 127, 127, 135, 143, 134, 148, 133, 131, 140, 143, 135, 140, 141, 135, 149, 27, - 30, 36, 32, 157, 155, 158, 154, 136, 150, 149, 142, 150, 142, 149, 139, 142, 146, 138, - 138, 144, 138, 139, 132, 120, 130, 134, 124, 127, 130, 130, 123, 133, 141, 137, 135, - 140, 147, 139, 141, 134, 131, 146, 139, 136, 136, 130, 143, 147, 144, 138, 145, 137, - 137, 138, 142, 148, 149, 138, 141, 148, 139, 139, 139, 134, 135, 131, 124, 131, 131, - 120, 121, 132, 128, 127, 130, 136, 129, 130, 123, 133, 132, 141, 147, 147, 139, 127, - 149, 157, 165, 154, 143, 153, 141, 157, 144, 146, 135, 142, 133, 134, 140, 142, 133, - 136, 133, 141, 143, 128, 127, 136, 144, 138, 141, 133, 127, 123, 138, 131, 126, 130, - 131, 135, 131, 137, 136, 125, 127, 126, 143, 142, 127, 134, 140, 144, 128, 125, 139, - 144, 135, 141, 123, 130, 127, 126, 140, 136, 140, 139, 140, 133, 132, 146, 142, 138, - 134, 130, 125, 130, 130, 129, 137, 133, 128, 130, 130, 132, 135, 126, 129, 142, 129, - 151, 150, 146, 130, 130, 144, 137, 145, 140, 126, 123, 128, 138, 136, 140, 137, 137, - 147, 146, 141, 137, 139, 117, 133, 140, 126, 137, 138, 143, 141, 141, 132, 128, 132, - 145, 148, 151, 160, 162, 154, 140, 147, 30, 28, 28, 26, 27, 27, 31, 33, 32, 145, 132, - 130, 124, 142, 140, 128, 124, 131, 127, 130, 128, 135, 125, 137, 137, 127, 128, 127, - 125, 127, 130, 124, 134, 137, 129, 127, 146, 136, 131, 124, 125, 130, 131, 135, 147, - 148, 151, 147, 143, 148, 145, 158, 142, 137, 129, 127, 156, 147, 143, 137, 135, 142, - 141, 140, 137, 136, 132, 134, 130, 124, 127, 130, 127, 126, 127, 129, 132, 134, 141, - 147, 136, 141, 141, 134, 126, 127, 136, 135, 134, 122, 130, 128, 140, 133, 124, 128, - 137, 128, 141, 135, 141, 147, 153, 151, 151, 154, 150, 147, 157, 153, 153, 153, 151, - 155, 154, 153, 150, 143, 157, 146, 150, 154, 152, 153, 28, 35, 33, 34, 37, 36, 30, 31, - 27, 37, 38, 36, 38, 37, 36, 39, 38, 36, 172, 172, 179, 178, 172, 171, 180, 173, 163, - 164, 159, 159, 155, 163, 184, 187, 176, 176, 184, 179, 174, 167, 165, 166, 160, 166, - 169, 169, 159, 165, 166, 168, 162, 180, 174, 186, 179, 180, 186, 187, 178, 156, 158, - 156, 161, 165, 163, 160, 169, 160, 160, 168, 161, 159, 167, 173, 177, 170, 172, 172, - 169, 157, 161, 155, 165, 164, 154, 161, 160, 31, 30, 28, 31, 31, 29, 38, 36, 40, 31, - 33, 37, 39, 179, 30, 28, 27, 30, 28, 30, 30, 37, 42, 39, 184, 163, 158, 172, 166, 161, - 160, 167, 174, 175, 183, 176, 192, 176, 170, 179, 173, 164, 156, 160, 162, 152, 155, - 157, 174, 176, 184, 173, 180, 177, 182, 190, 170, 167, 154, 156, 171, 169, 172, 177, - 190, 192, 186, 188, 192, 192, 176, 179, 175, 191, 174, 197, 194, 203, 198, 190, 185, - 202, 179, 169, 179, 184, 193, 185, 185, 181, 197, 188, 189, 188, 189, 193, 197, 198, - 203, 188, 189, 198, 190, 196, 191, 191, 197, 202, 182, 178, 186, 194, 192, 186, 187, - 188, 186, 179, 179, 168, 165, 173, 165, 160, 161, 145, 162, 149, 155, 154, 145, 154, - 152, 152, 163, 174, 175, 170, 181, 177, 162, 167, 164, 162, 147, 147, 157, 159, 27, - 28, 28, 36, 36, 37, 35, 35, 35, 35, 37, 37, 35, 35, 36, 171, 40, 40, 176, 178, 171, - 174, 165, 161, 157, 160, 154, 167, 163, 174, 172, 155, 158, 165, 166, 181, 190, 160, - 158, 160, 30, 39, 36, 174, 157, 180, 174, 167, 178, 177, 171, 175, 173, 166, 28, 28, - 28, 29, 30, 34, 35, 36, 29, 36, 37, 38, 32, 29, 41, 38, 38, 35, 34, 34, 36, 34, 35, - 30, 30, 31, 31, 28, 30, 31, 36, 36, 36, 40, 38, 44, 41, 34, 38, 38, 38, 39, 184, 157, - 155, 167, 178]; - ES_LENGTH = 757; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByMime('audio/vorbis', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_CALLBACK_0200 - * @tc.name : 004.test vorbis format(createbyname) - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_CALLBACK_0200', 0, async function (done) { - console.log("test vorbis format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_callback_vorbis_02.pcm'; - readpath = AUDIOPATH4; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - isVorbis = true; - ES = [0, 3251, 33, 160, 162, 159, 148, 160, 160, 159, 167, 156, 162, 173, 135, 137, 133, - 126, 126, 130, 127, 133, 138, 132, 124, 129, 134, 136, 146, 135, 137, 144, 137, 128, - 124, 127, 129, 127, 130, 127, 134, 130, 135, 146, 142, 140, 134, 134, 128, 119, 122, - 122, 123, 121, 128, 125, 128, 122, 137, 141, 136, 135, 127, 128, 125, 128, 122, 126, - 132, 127, 127, 135, 143, 134, 148, 133, 131, 140, 143, 135, 140, 141, 135, 149, 27, - 30, 36, 32, 157, 155, 158, 154, 136, 150, 149, 142, 150, 142, 149, 139, 142, 146, 138, - 138, 144, 138, 139, 132, 120, 130, 134, 124, 127, 130, 130, 123, 133, 141, 137, 135, - 140, 147, 139, 141, 134, 131, 146, 139, 136, 136, 130, 143, 147, 144, 138, 145, 137, - 137, 138, 142, 148, 149, 138, 141, 148, 139, 139, 139, 134, 135, 131, 124, 131, 131, - 120, 121, 132, 128, 127, 130, 136, 129, 130, 123, 133, 132, 141, 147, 147, 139, 127, - 149, 157, 165, 154, 143, 153, 141, 157, 144, 146, 135, 142, 133, 134, 140, 142, 133, - 136, 133, 141, 143, 128, 127, 136, 144, 138, 141, 133, 127, 123, 138, 131, 126, 130, - 131, 135, 131, 137, 136, 125, 127, 126, 143, 142, 127, 134, 140, 144, 128, 125, 139, - 144, 135, 141, 123, 130, 127, 126, 140, 136, 140, 139, 140, 133, 132, 146, 142, 138, - 134, 130, 125, 130, 130, 129, 137, 133, 128, 130, 130, 132, 135, 126, 129, 142, 129, - 151, 150, 146, 130, 130, 144, 137, 145, 140, 126, 123, 128, 138, 136, 140, 137, 137, - 147, 146, 141, 137, 139, 117, 133, 140, 126, 137, 138, 143, 141, 141, 132, 128, 132, - 145, 148, 151, 160, 162, 154, 140, 147, 30, 28, 28, 26, 27, 27, 31, 33, 32, 145, 132, - 130, 124, 142, 140, 128, 124, 131, 127, 130, 128, 135, 125, 137, 137, 127, 128, 127, - 125, 127, 130, 124, 134, 137, 129, 127, 146, 136, 131, 124, 125, 130, 131, 135, 147, - 148, 151, 147, 143, 148, 145, 158, 142, 137, 129, 127, 156, 147, 143, 137, 135, 142, - 141, 140, 137, 136, 132, 134, 130, 124, 127, 130, 127, 126, 127, 129, 132, 134, 141, - 147, 136, 141, 141, 134, 126, 127, 136, 135, 134, 122, 130, 128, 140, 133, 124, 128, - 137, 128, 141, 135, 141, 147, 153, 151, 151, 154, 150, 147, 157, 153, 153, 153, 151, - 155, 154, 153, 150, 143, 157, 146, 150, 154, 152, 153, 28, 35, 33, 34, 37, 36, 30, 31, - 27, 37, 38, 36, 38, 37, 36, 39, 38, 36, 172, 172, 179, 178, 172, 171, 180, 173, 163, - 164, 159, 159, 155, 163, 184, 187, 176, 176, 184, 179, 174, 167, 165, 166, 160, 166, - 169, 169, 159, 165, 166, 168, 162, 180, 174, 186, 179, 180, 186, 187, 178, 156, 158, - 156, 161, 165, 163, 160, 169, 160, 160, 168, 161, 159, 167, 173, 177, 170, 172, 172, - 169, 157, 161, 155, 165, 164, 154, 161, 160, 31, 30, 28, 31, 31, 29, 38, 36, 40, 31, - 33, 37, 39, 179, 30, 28, 27, 30, 28, 30, 30, 37, 42, 39, 184, 163, 158, 172, 166, 161, - 160, 167, 174, 175, 183, 176, 192, 176, 170, 179, 173, 164, 156, 160, 162, 152, 155, - 157, 174, 176, 184, 173, 180, 177, 182, 190, 170, 167, 154, 156, 171, 169, 172, 177, - 190, 192, 186, 188, 192, 192, 176, 179, 175, 191, 174, 197, 194, 203, 198, 190, 185, - 202, 179, 169, 179, 184, 193, 185, 185, 181, 197, 188, 189, 188, 189, 193, 197, 198, - 203, 188, 189, 198, 190, 196, 191, 191, 197, 202, 182, 178, 186, 194, 192, 186, 187, - 188, 186, 179, 179, 168, 165, 173, 165, 160, 161, 145, 162, 149, 155, 154, 145, 154, - 152, 152, 163, 174, 175, 170, 181, 177, 162, 167, 164, 162, 147, 147, 157, 159, 27, - 28, 28, 36, 36, 37, 35, 35, 35, 35, 37, 37, 35, 35, 36, 171, 40, 40, 176, 178, 171, - 174, 165, 161, 157, 160, 154, 167, 163, 174, 172, 155, 158, 165, 166, 181, 190, 160, - 158, 160, 30, 39, 36, 174, 157, 180, 174, 167, 178, 177, 171, 175, 173, 166, 28, 28, - 28, 29, 30, 34, 35, 36, 29, 36, 37, 38, 32, 29, 41, 38, 38, 35, 34, 34, 36, 34, 35, - 30, 30, 31, 31, 28, 30, 31, 36, 36, 36, 40, 38, 44, 41, 34, 38, 38, 38, 39, 184, 157, - 155, 167, 178]; - ES_LENGTH = 757; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.log("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByName('avdec_vorbis', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js deleted file mode 100644 index 29159a021e3f9801b35c27b59dc925c395ac453b..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js +++ /dev/null @@ -1,798 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderFormatPromise', function () { - const AUDIOPATH1 = 'AAC_48000_32_1.aac'; - const AUDIOPATH2 = 'FLAC_48000_32_1.flac' - const AUDIOPATH3 = 'mp3.es'; - const AUDIOPATH4 = 'vorbis.es'; - const BASIC_PATH = 'results/decode_format_promise_'; - let audioDecodeProcessor; - let readStreamSync; - let needGetMediaDes = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = []; - let ES_LENGTH = 0; - let samplerate = 44.1; - let isMp3 = false; - let isVorbis = false; - let readpath; - let savepath; - let fdRead; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - needGetMediaDes = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = []; - ES_LENGTH = 0; - samplerate = 44.1; - isMp3 = false; - isVorbis = false; - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function writeFile(path, buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.writeSync buffer success'); - } catch(e) { - console.info('case fileio.writeSync buffer error is ' + e); - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - inputobject.timeMs = timestamp; - inputobject.offset = 0; - if (frameCnt==1 && isVorbis) { - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 8; - } else if (isMp3) { - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } else { - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - } - if (isMp3) { - timestamp += ES[1]/samplerate; - } else { - timestamp += ES[frameCnt]/samplerate; - } - frameCnt += 1; - audioDecodeProcessor.pushInputData(inputobject).then(() => { - console.info("queueInput success"); - inputCnt += 1; - }) - } - } - - async function dequeueAllOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - await audioDecodeProcessor.stop().then(() => { - console.log("stop success"); - }, failCallback).catch(failCatch); - inputQueue = []; - outputQueue = []; - await audioDecodeProcessor.reset().then(() => { - console.log("reset success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.release().then(() => { - console.info('release success'); - }, failCallback).catch(failCatch); - audioDecodeProcessor = null; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await fileio.close(fdRead); - done(); - } - else{ - console.log("write to file success"); - } - audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }) - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info("inputBufferAvailable"); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info("outputBufferAvailable"); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.log("get OutputMediaDescription success"); - console.log('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }, failCallback).catch(failCatch);} - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_PROMISE_0100 - * @tc.name : 001.test aac format(createbymime) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_PROMISE_0100', 0, async function (done) { - console.log("case test aac format"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_promise_aac_01.pcm'; - readpath = AUDIOPATH1; - await getFdRead(readpath, done); - needGetMediaDes = true; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338]; - ES_LENGTH = 1000; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_PROMISE_0200 - * @tc.name : 001.test aac format(createbyname) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_AAC_PROMISE_0200', 0, async function (done) { - console.log("case test aac format"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_promise_aac_02.pcm'; - readpath = AUDIOPATH1; - await getFdRead(readpath, done); - needGetMediaDes = true; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338]; - ES_LENGTH = 1000; - await media.createAudioDecoderByName('avdec_aac').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_PROMISE_0100 - * @tc.name : 002.test flac format(createbymime) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_PROMISE_0100', 0, async function (done) { - console.log("case test flac format"); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_promise_flac_01.pcm'; - readpath = AUDIOPATH2; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - ES = [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, 2806, - 2796,2786, 2774, 2758, 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, 2839, 2794, - 2770, 2763,2756, 2722, 2950, 2876, 2842, 2827, 2792, 3121, 3075, 2969, 3240, 3199, - 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, 2779, 2963, 2893, 2870, - 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, 2876, 3223, 3040, 3006, 3042, - 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, 3300, 3140, 3014, 2975, 2952, 2896, - 2897, 2842, 2929, 3567, 3929, 3485, 3082, 3625, 4953, 5239, 5094, 4993, 4821, 4431, - 5195, 5542, 5557, 4894, 4414, 5085, 5496, 5089, 4459, 4532, 4778, 5460, 5372, 5224, - 4395, 4701, 5512, 5304, 4798, 7128, 6534, 5704, 5562, 5539, 5675, 5780, 6058, 6194, - 6076, 5971, 5758, 5202, 4438, 3821, 4267, 5550, 4896, 3841, 5166, 4904, 4504, 5530, - 5354, 5047, 5695, 5422, 5168, 5338, 5154, 5385, 5322, 4934, 4512, 4001, 3793, 3624, - 3589, 3562, 4346, 5407, 5582, 5645, 5581, 5605, 5520, 5399, 5164, 4991, 4556, 4058, - 3662, 3757, 4627, 5183, 5061, 4114, 5840, 5051, 5126, 4573, 5269, 4437, 5021, 5508, - 5289, 5171, 5153, 5118, 5721, 5375, 4863, 6353, 5477, 5608, 5614, 5737, 5178, 4614, - 4671, 5204, 5027, 4977, 3922, 5904]; - ES_LENGTH = 200; - await media.createAudioDecoderByMime('audio/flac').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - console.log("start configure"); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_PROMISE_0200 - * @tc.name : 002.test flac format(createbyname) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_FLAC_PROMISE_0200', 0, async function (done) { - console.log("case test flac format"); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_promise_flac_02.pcm'; - readpath = AUDIOPATH2; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - ES = [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, 2806, - 2796,2786, 2774, 2758, 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, 2839, 2794, - 2770, 2763,2756, 2722, 2950, 2876, 2842, 2827, 2792, 3121, 3075, 2969, 3240, 3199, - 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, 2779, 2963, 2893, 2870, - 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, 2876, 3223, 3040, 3006, 3042, - 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, 3300, 3140, 3014, 2975, 2952, 2896, - 2897, 2842, 2929, 3567, 3929, 3485, 3082, 3625, 4953, 5239, 5094, 4993, 4821, 4431, - 5195, 5542, 5557, 4894, 4414, 5085, 5496, 5089, 4459, 4532, 4778, 5460, 5372, 5224, - 4395, 4701, 5512, 5304, 4798, 7128, 6534, 5704, 5562, 5539, 5675, 5780, 6058, 6194, - 6076, 5971, 5758, 5202, 4438, 3821, 4267, 5550, 4896, 3841, 5166, 4904, 4504, 5530, - 5354, 5047, 5695, 5422, 5168, 5338, 5154, 5385, 5322, 4934, 4512, 4001, 3793, 3624, - 3589, 3562, 4346, 5407, 5582, 5645, 5581, 5605, 5520, 5399, 5164, 4991, 4556, 4058, - 3662, 3757, 4627, 5183, 5061, 4114, 5840, 5051, 5126, 4573, 5269, 4437, 5021, 5508, - 5289, 5171, 5153, 5118, 5721, 5375, 4863, 6353, 5477, 5608, 5614, 5737, 5178, 4614, - 4671, 5204, 5027, 4977, 3922, 5904]; - ES_LENGTH = 200; - await media.createAudioDecoderByName('avdec_flac').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - console.log("start configure"); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_PROMISE_0100 - * @tc.name : 003.test mp3 format(createbymime) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_PROMISE_0100', 0, async function (done) { - console.log("case test mp3 format"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_promise_mp3_01.pcm'; - readpath = AUDIOPATH3; - await getFdRead(readpath, done); - needGetMediaDes = true; - isMp3 = true; - ES = [0, 1044]; - ES_LENGTH = 1000; - await media.createAudioDecoderByMime('audio/mpeg').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_PROMISE_0200 - * @tc.name : 003.test mp3 format(createbyname) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_MP3_PROMISE_0200', 0, async function (done) { - console.log("case test mp3 format"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - savepath = 'format_promise_mp3_02.pcm'; - readpath = AUDIOPATH3; - await getFdRead(readpath, done); - needGetMediaDes = true; - isMp3 = true; - ES = [0, 1044]; - ES_LENGTH = 1000; - await media.createAudioDecoderByName('avdec_mp3').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_PROMISE_0100 - * @tc.name : 004.test vorbis format(createbymime) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_PROMISE_0100', 0, async function (done) { - console.log("case test vorbis format"); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_promise_vorbis_01.pcm'; - readpath = AUDIOPATH4; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - isVorbis = true; - ES = [0, 3251, 33, 160, 162, 159, 148, 160, 160, 159, 167, 156, 162, 173, 135, 137, 133, - 126, 126, 130, 127, 133, 138, 132, 124, 129, 134, 136, 146, 135, 137, 144, 137, 128, - 124, 127, 129, 127, 130, 127, 134, 130, 135, 146, 142, 140, 134, 134, 128, 119, 122, - 122, 123, 121, 128, 125, 128, 122, 137, 141, 136, 135, 127, 128, 125, 128, 122, 126, - 132, 127, 127, 135, 143, 134, 148, 133, 131, 140, 143, 135, 140, 141, 135, 149, 27, - 30, 36, 32, 157, 155, 158, 154, 136, 150, 149, 142, 150, 142, 149, 139, 142, 146, 138, - 138, 144, 138, 139, 132, 120, 130, 134, 124, 127, 130, 130, 123, 133, 141, 137, 135, - 140, 147, 139, 141, 134, 131, 146, 139, 136, 136, 130, 143, 147, 144, 138, 145, 137, - 137, 138, 142, 148, 149, 138, 141, 148, 139, 139, 139, 134, 135, 131, 124, 131, 131, - 120, 121, 132, 128, 127, 130, 136, 129, 130, 123, 133, 132, 141, 147, 147, 139, 127, - 149, 157, 165, 154, 143, 153, 141, 157, 144, 146, 135, 142, 133, 134, 140, 142, 133, - 136, 133, 141, 143, 128, 127, 136, 144, 138, 141, 133, 127, 123, 138, 131, 126, 130, - 131, 135, 131, 137, 136, 125, 127, 126, 143, 142, 127, 134, 140, 144, 128, 125, 139, - 144, 135, 141, 123, 130, 127, 126, 140, 136, 140, 139, 140, 133, 132, 146, 142, 138, - 134, 130, 125, 130, 130, 129, 137, 133, 128, 130, 130, 132, 135, 126, 129, 142, 129, - 151, 150, 146, 130, 130, 144, 137, 145, 140, 126, 123, 128, 138, 136, 140, 137, 137, - 147, 146, 141, 137, 139, 117, 133, 140, 126, 137, 138, 143, 141, 141, 132, 128, 132, - 145, 148, 151, 160, 162, 154, 140, 147, 30, 28, 28, 26, 27, 27, 31, 33, 32, 145, 132, - 130, 124, 142, 140, 128, 124, 131, 127, 130, 128, 135, 125, 137, 137, 127, 128, 127, - 125, 127, 130, 124, 134, 137, 129, 127, 146, 136, 131, 124, 125, 130, 131, 135, 147, - 148, 151, 147, 143, 148, 145, 158, 142, 137, 129, 127, 156, 147, 143, 137, 135, 142, - 141, 140, 137, 136, 132, 134, 130, 124, 127, 130, 127, 126, 127, 129, 132, 134, 141, - 147, 136, 141, 141, 134, 126, 127, 136, 135, 134, 122, 130, 128, 140, 133, 124, 128, - 137, 128, 141, 135, 141, 147, 153, 151, 151, 154, 150, 147, 157, 153, 153, 153, 151, - 155, 154, 153, 150, 143, 157, 146, 150, 154, 152, 153, 28, 35, 33, 34, 37, 36, 30, 31, - 27, 37, 38, 36, 38, 37, 36, 39, 38, 36, 172, 172, 179, 178, 172, 171, 180, 173, 163, - 164, 159, 159, 155, 163, 184, 187, 176, 176, 184, 179, 174, 167, 165, 166, 160, 166, - 169, 169, 159, 165, 166, 168, 162, 180, 174, 186, 179, 180, 186, 187, 178, 156, 158, - 156, 161, 165, 163, 160, 169, 160, 160, 168, 161, 159, 167, 173, 177, 170, 172, 172, - 169, 157, 161, 155, 165, 164, 154, 161, 160, 31, 30, 28, 31, 31, 29, 38, 36, 40, 31, - 33, 37, 39, 179, 30, 28, 27, 30, 28, 30, 30, 37, 42, 39, 184, 163, 158, 172, 166, 161, - 160, 167, 174, 175, 183, 176, 192, 176, 170, 179, 173, 164, 156, 160, 162, 152, 155, - 157, 174, 176, 184, 173, 180, 177, 182, 190, 170, 167, 154, 156, 171, 169, 172, 177, - 190, 192, 186, 188, 192, 192, 176, 179, 175, 191, 174, 197, 194, 203, 198, 190, 185, - 202, 179, 169, 179, 184, 193, 185, 185, 181, 197, 188, 189, 188, 189, 193, 197, 198, - 203, 188, 189, 198, 190, 196, 191, 191, 197, 202, 182, 178, 186, 194, 192, 186, 187, - 188, 186, 179, 179, 168, 165, 173, 165, 160, 161, 145, 162, 149, 155, 154, 145, 154, - 152, 152, 163, 174, 175, 170, 181, 177, 162, 167, 164, 162, 147, 147, 157, 159, 27, - 28, 28, 36, 36, 37, 35, 35, 35, 35, 37, 37, 35, 35, 36, 171, 40, 40, 176, 178, 171, - 174, 165, 161, 157, 160, 154, 167, 163, 174, 172, 155, 158, 165, 166, 181, 190, 160, - 158, 160, 30, 39, 36, 174, 157, 180, 174, 167, 178, 177, 171, 175, 173, 166, 28, 28, - 28, 29, 30, 34, 35, 36, 29, 36, 37, 38, 32, 29, 41, 38, 38, 35, 34, 34, 36, 34, 35, - 30, 30, 31, 31, 28, 30, 31, 36, 36, 36, 40, 38, 44, 41, 34, 38, 38, 38, 39, 184, 157, - 155, 167, 178]; - ES_LENGTH = 757; - await media.createAudioDecoderByMime('audio/vorbis').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_PROMISE_0200 - * @tc.name : 004.test vorbis format(createbyname) - * @tc.desc : decode format test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FORMAT_VORBIS_PROMISE_0200', 0, async function (done) { - console.log("case test vorbis format"); - let mediaDescription = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - savepath = 'format_promise_vorbis_02.pcm'; - readpath = AUDIOPATH4; - await getFdRead(readpath, done); - needGetMediaDes = true; - samplerate = 48; - isVorbis = true; - ES = [0, 3251, 33, 160, 162, 159, 148, 160, 160, 159, 167, 156, 162, 173, 135, 137, 133, - 126, 126, 130, 127, 133, 138, 132, 124, 129, 134, 136, 146, 135, 137, 144, 137, 128, - 124, 127, 129, 127, 130, 127, 134, 130, 135, 146, 142, 140, 134, 134, 128, 119, 122, - 122, 123, 121, 128, 125, 128, 122, 137, 141, 136, 135, 127, 128, 125, 128, 122, 126, - 132, 127, 127, 135, 143, 134, 148, 133, 131, 140, 143, 135, 140, 141, 135, 149, 27, - 30, 36, 32, 157, 155, 158, 154, 136, 150, 149, 142, 150, 142, 149, 139, 142, 146, 138, - 138, 144, 138, 139, 132, 120, 130, 134, 124, 127, 130, 130, 123, 133, 141, 137, 135, - 140, 147, 139, 141, 134, 131, 146, 139, 136, 136, 130, 143, 147, 144, 138, 145, 137, - 137, 138, 142, 148, 149, 138, 141, 148, 139, 139, 139, 134, 135, 131, 124, 131, 131, - 120, 121, 132, 128, 127, 130, 136, 129, 130, 123, 133, 132, 141, 147, 147, 139, 127, - 149, 157, 165, 154, 143, 153, 141, 157, 144, 146, 135, 142, 133, 134, 140, 142, 133, - 136, 133, 141, 143, 128, 127, 136, 144, 138, 141, 133, 127, 123, 138, 131, 126, 130, - 131, 135, 131, 137, 136, 125, 127, 126, 143, 142, 127, 134, 140, 144, 128, 125, 139, - 144, 135, 141, 123, 130, 127, 126, 140, 136, 140, 139, 140, 133, 132, 146, 142, 138, - 134, 130, 125, 130, 130, 129, 137, 133, 128, 130, 130, 132, 135, 126, 129, 142, 129, - 151, 150, 146, 130, 130, 144, 137, 145, 140, 126, 123, 128, 138, 136, 140, 137, 137, - 147, 146, 141, 137, 139, 117, 133, 140, 126, 137, 138, 143, 141, 141, 132, 128, 132, - 145, 148, 151, 160, 162, 154, 140, 147, 30, 28, 28, 26, 27, 27, 31, 33, 32, 145, 132, - 130, 124, 142, 140, 128, 124, 131, 127, 130, 128, 135, 125, 137, 137, 127, 128, 127, - 125, 127, 130, 124, 134, 137, 129, 127, 146, 136, 131, 124, 125, 130, 131, 135, 147, - 148, 151, 147, 143, 148, 145, 158, 142, 137, 129, 127, 156, 147, 143, 137, 135, 142, - 141, 140, 137, 136, 132, 134, 130, 124, 127, 130, 127, 126, 127, 129, 132, 134, 141, - 147, 136, 141, 141, 134, 126, 127, 136, 135, 134, 122, 130, 128, 140, 133, 124, 128, - 137, 128, 141, 135, 141, 147, 153, 151, 151, 154, 150, 147, 157, 153, 153, 153, 151, - 155, 154, 153, 150, 143, 157, 146, 150, 154, 152, 153, 28, 35, 33, 34, 37, 36, 30, 31, - 27, 37, 38, 36, 38, 37, 36, 39, 38, 36, 172, 172, 179, 178, 172, 171, 180, 173, 163, - 164, 159, 159, 155, 163, 184, 187, 176, 176, 184, 179, 174, 167, 165, 166, 160, 166, - 169, 169, 159, 165, 166, 168, 162, 180, 174, 186, 179, 180, 186, 187, 178, 156, 158, - 156, 161, 165, 163, 160, 169, 160, 160, 168, 161, 159, 167, 173, 177, 170, 172, 172, - 169, 157, 161, 155, 165, 164, 154, 161, 160, 31, 30, 28, 31, 31, 29, 38, 36, 40, 31, - 33, 37, 39, 179, 30, 28, 27, 30, 28, 30, 30, 37, 42, 39, 184, 163, 158, 172, 166, 161, - 160, 167, 174, 175, 183, 176, 192, 176, 170, 179, 173, 164, 156, 160, 162, 152, 155, - 157, 174, 176, 184, 173, 180, 177, 182, 190, 170, 167, 154, 156, 171, 169, 172, 177, - 190, 192, 186, 188, 192, 192, 176, 179, 175, 191, 174, 197, 194, 203, 198, 190, 185, - 202, 179, 169, 179, 184, 193, 185, 185, 181, 197, 188, 189, 188, 189, 193, 197, 198, - 203, 188, 189, 198, 190, 196, 191, 191, 197, 202, 182, 178, 186, 194, 192, 186, 187, - 188, 186, 179, 179, 168, 165, 173, 165, 160, 161, 145, 162, 149, 155, 154, 145, 154, - 152, 152, 163, 174, 175, 170, 181, 177, 162, 167, 164, 162, 147, 147, 157, 159, 27, - 28, 28, 36, 36, 37, 35, 35, 35, 35, 37, 37, 35, 35, 36, 171, 40, 40, 176, 178, 171, - 174, 165, 161, 157, 160, 154, 167, 163, 174, 172, 155, 158, 165, 166, 181, 190, 160, - 158, 160, 30, 39, 36, 174, 157, 180, 174, 167, 178, 177, 171, 175, 173, 166, 28, 28, - 28, 29, 30, 34, 35, 36, 29, 36, 37, 38, 32, 29, 41, 38, 38, 35, 34, 34, 36, 34, 35, - 30, 30, 31, 31, 28, 30, 31, 36, 36, 36, 40, 38, 44, 41, 34, 38, 38, 38, 39, 184, 157, - 155, 167, 178]; - ES_LENGTH = 757; - await media.createAudioDecoderByName('avdec_vorbis').then((processor) => { - console.log("create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.log("get AudioDecoderCaps success"); - console.log("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.log("configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.log("prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.log("start success"); - }, failCallback).catch(failCatch); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js deleted file mode 100644 index c9dca9a6ead28ae9d5cbe42f1f80bd54b349b313..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js +++ /dev/null @@ -1,1143 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderFuncCallback', function () { - const AUDIOPATH = 'AAC_48000_32_1.aac'; - const AUDIOPATH2 = 'AAC_16000_1.aac'; - const AUDIOPATH3 = 'FLAC_48000_32_1.flac'; - const BASIC_PATH = 'results/decode_func_callback_'; - let audioDecodeProcessor; - let readStreamSync; - let eosframenum = 0; - let samplerate = 44.1; - let workdoneAtEOS = false; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let needGetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - let ES_LENGTH = 1500; - let readpath; - let savepath; - let fdRead; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - let lockFlag = false; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - eosframenum = 0; - samplerate = 44.1; - workdoneAtEOS = false; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - ES_LENGTH = 1500; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - function resetParam(){ - readStreamSync = undefined; - eosframenum = 0; - samplerate = 44.1; - workdoneAtEOS = false; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function writeFile(path, buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.writeSync buffer success'); - } catch(e) { - console.info('case fileio.writeSync buffer error is ' + e); - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function stopWork() { - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info("case stop success") - }) - } - - async function resetWork() { - resetParam(); - audioDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info("case reset success"); - if (needrelease) { - audioDecodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioDecodeProcessor = null; - }) - } - }) - } - - async function flushWork(done) { - lockFlag = true; - inputQueue = []; - outputQueue = []; - await getFdRead(readpath, done); - audioDecodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info("case flush at inputeos success"); - resetParam(); - workdoneAtEOS =true; - lockFlag = false; - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info("case start after flush success"); - }); - }) - } - - async function doneWork(done) { - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info("case stop success"); - resetParam(); - audioDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.log("case reset success"); - audioDecodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioDecodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - }) - }) - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function enqueueAllInputs(queue){ - while (queue.length > 0 && !sawInputEOS){ - let inputobject = queue.shift(); - console.info("frameCnt:" + frameCnt); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1){ - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } - else{ - console.info("read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - timestamp += ES[frameCnt]/samplerate; - frameCnt += 1; - if (!lockFlag) { - audioDecodeProcessor.pushInputData(inputobject, () => { - console.info('queueInput success'); - inputCnt += 1; - }) - } - } - } - - async function dequeueAllOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (stopAtEOS) { - await stopWork(); - } else if (resetAtEOS) { - await resetWork(); - } else if (flushAtEOS) { - await flushWork(done); - } else if (workdoneAtEOS) { - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await doneWork(done); - } else { - console.info("saw output EOS"); - } - } - else{ - console.info("write to file success"); - } - if (!lockFlag) { - audioDecodeProcessor.freeOutputBuffer(outputobject, () => { - console.info('release output success'); - }) - } - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needGetMediaDes){ - audioDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => { - expect(err).assertUndefined(); - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }); - } - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0100 - * @tc.name : 000.test set EOS after last frame and reset - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0100', 0, async function (done) { - console.info("case test set EOS after last frame and reset"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - workdoneAtEOS = true; - needGetMediaDes = true; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_00.pcm'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - eventEmitter.on('createAudioDecoder', () => { - media.createAudioDecoderByName('avdec_aac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }); - media.getMediaCapability((err, mediaCaps) => { - expect(err).assertUndefined(); - console.info('getMediaCapability success'); - if (typeof (mediaCaps) != 'undefined') { - mediaCaps.getAudioDecoderCaps((err, audioCapsArray) => { - expect(err).assertUndefined(); - console.info('getAudioDecoderCaps success'); - if (typeof (audioCapsArray) != 'undefined') { - console.info('get first audioCaps'+ audioCapsArray[0]); - console.info('codecInfo: '+ audioCapsArray[0].codecInfo); - console.info('supportedBitrate: '+ audioCapsArray[0].supportedBitrate); - console.info('supportedBitrate.min: '+ audioCapsArray[0].supportedBitrate.min); - } else { - console.info('audioCaps is not defined'); - } - }) - } else { - console.info('mediaCaps is not defined'); - } - eventEmitter.emit('createAudioDecoder'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0200 - * @tc.name : 001.test set EOS manually before last frame and reset - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0200', 0, async function (done) { - console.info("case test set EOS manually before last frame and reset"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - eosframenum = 500; - workdoneAtEOS = true; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_01.pcm'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.getMediaCapability((err, mediaCaps) => { - expect(err).assertUndefined(); - console.info(`case getMediaCapability 1`); - mediaCaps.getAudioDecoderCaps((err, audioCaps) => { - expect(err).assertUndefined(); - console.info('getAudioDecoderCaps success'); - if (typeof (audioCaps) != 'undefined') { - console.info("case audioCaps " + audioCaps); - } else { - console.info("case audioCaps is not defined"); - } - }) - }) - media.createAudioDecoderByName('avdec_aac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0300 - * @tc.name : 002.test flush at running state - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0300', 0, async function (done) { - console.info("case test flush at running state"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - workdoneAtEOS = true; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_02.pcm'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start(async(err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - await sleep(500); - eventEmitter.emit('flush'); - }) - }); - eventEmitter.on('flush', () => { - lockFlag = true; - inputQueue = []; - outputQueue = []; - audioDecodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info(`case flush after 2s success`); - lockFlag = false; - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start after flush success`); - }); - }); - }); - media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0400 - * @tc.name : 003. test flush at EOS state - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0400', 0, async function (done) { - console.info("case test flush at EOS state"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - eosframenum = 200; - flushAtEOS = true; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_03.pcm'; - await getFdRead(readpath, done); - - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0500 - * @tc.name : 004. test stop at running state and reset - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0500', 0, async function (done) { - console.info("case test stop at running state and reset"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_04.pcm'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - eventEmitter.emit('stop'); - }) - }); - eventEmitter.on('stop', () => { - sleep(5000).then(() => { - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`case stop 1`); - eventEmitter.emit('reset'); - }) - }) - }); - eventEmitter.on('reset', () => { - resetParam(); - audioDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info(`case reset 1`); - eventEmitter.emit('release'); - }) - }); - eventEmitter.on('release', () => { - audioDecodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.info(`case release 1`); - audioDecodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - }); - media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0600 - * @tc.name : 005. test stop and restart - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0600', 0, async function (done) { - console.info("case test start - stop - restart"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - eosframenum = 200; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_05.pcm'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - eventEmitter.emit('stop'); - }) - }); - eventEmitter.on('stop', () => { - sleep(5000).then(() => { - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`stop after 5s`); - resetParam(); - eventEmitter.emit('restart'); - }) - }) - }); - eventEmitter.on('restart', () => { - sleep(2000).then(async() => { - resetParam(); - await getFdRead(readpath, done); - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`restart after 2s`); - workdoneAtEOS=true; - enqueueAllInputs(inputQueue); - }) - }) - }); - media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0700 - * @tc.name : 006. test reconfigure for new file with the same format - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0700', 0, async function (done) { - console.info("case test reconfigure codec for new file with the same format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - eosframenum = 200; - resetAtEOS = true; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_06.pcm'; - await getFdRead(readpath, done); - let mediaDescription2 = { - "channel_count": 1, - "sample_rate": 16000, - "audio_sample_format": 1, - } - let hasreconfigured = false; - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - if (!hasreconfigured){ - eventEmitter.emit('reconfigure', mediaDescription2); - } - }) - }); - eventEmitter.on('reconfigure', (mediaDescription2) => { - sleep(10000).then(async() => { - resetParam(); - await fileio.close(fdRead); - audioDecodeProcessor.configure(mediaDescription2, async(err) => { - expect(err).assertUndefined(); - console.info(`case configure 2`); - resetParam(); - console.info('resetParam success, resetAtEOS IS :' + resetAtEOS) - readpath = AUDIOPATH2; - savepath = 'audioDecode_function_callback_06_2.pcm'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - ES = [0, 239, 302, 309, 330, 474, 684, 699, 683, 674, 647, 649, 638, 644, 640, - 639, 650, 702, 713, 718, 707, 707, 683, 670, 674, 699, 654, 650, 715, 770, - 764, 736, 697, 664, 643, 649, 704, 730, 720, 710, 689, 670, 673, 653, 635, - 643, 638, 653, 658, 683, 683, 705, 690, 681, 648, 659, 743, 681, 706, 707, - 718, 714, 746, 725, 741, 709, 675, 675, 751, 698, 736, 738, 711, 702, 691, - 668, 668, 650, 661, 678, 694, 719, 685, 700, 657, 671, 668, 701, 689, 685, - 682, 668, 696, 690, 683, 739, 704, 667, 694, 716, 757, 714, 701, 664, 619, - 609, 591, 644, 573, 572, 605, 595, 597, 529, 581, 578, 586, 537, 577, 535, - 572, 570, 534, 547, 581, 530, 591, 521, 556, 570, 557, 541, 506, 572, 579, - 502, 516, 582, 540, 584, 548, 555, 539, 578, 588, 541, 539, 526, 575, 535, - 571, 525, 569, 560, 584, 551, 574, 572, 537, 550, 582, 512, 559, 593, 601, - 594, 546, 560, 567, 547, 529, 576, 577, 556, 551, 530, 542, 575, 510, 559, - 613, 628, 511, 566, 515, 539, 594, 536, 565, 551, 533, 613, 557, 523, 574, - 582, 616, 610, 573, 509, 535]; - ES_LENGTH = 200; - samplerate = 16; - hasreconfigured = true; - eventEmitter.emit('prepare'); - }) - }) - }); - media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0800 - * @tc.name : 007. test reconfigure for new file with different formats - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_CALLBACK_0800', 0, async function (done) { - console.info("case test reconfigure codec for new file with different format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - let mediaDescription2 = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - let hasrecreate = false; - eosframenum = 200; - resetAtEOS = true; - needrelease = true; - readpath = AUDIOPATH; - savepath = 'audioDecode_function_callback_07.pcm'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioDecoderCaps', () => { - audioDecodeProcessor.getAudioDecoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioDecoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - if (!hasrecreate){ - eventEmitter.emit('recreate'); - } - }) - }); - eventEmitter.on('recreate', () => { - sleep(10000).then(async() => { - await fileio.close(fdRead); - media.createAudioDecoderByMime('audio/flac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder flac`); - audioDecodeProcessor = processor; - hasrecreate = true; - eventEmitter.emit('reconfigure', mediaDescription2); - }) - }) - }); - eventEmitter.on('reconfigure', (mediaDescription2) => { - audioDecodeProcessor.configure(mediaDescription2, async(err) => { - expect(err).assertUndefined(); - console.info(`case configure 2`); - resetParam(); - readpath = AUDIOPATH3; - savepath = 'audioDecode_function_callback_07_2.pcm'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - ES = [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, - 2806, 2796, 2786, 2774, 2758, 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, - 2839, 2794, 2770, 2763, 2756, 2722, 2950, 2876, 2842, 2827, 2792, 3121, 3075, - 2969, 3240, 3199, 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, - 2779, 2963, 2893, 2870, 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, - 2876, 3223, 3040, 3006, 3042, 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, - 3300, 3140, 3014, 2975, 2952, 2896, 2897, 2842, 2929, 3567, 3929, 3485, 3082, - 3625, 4953, 5239, 5094, 4993, 4821, 4431, 5195, 5542, 5557, 4894, 4414]; - ES_LENGTH = 100; - samplerate = 48; - eventEmitter.emit('prepare'); - }) - }); - media.createAudioDecoderByName('avdec_aac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - eventEmitter.emit('getAudioDecoderCaps'); - }) - }) -}) diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js deleted file mode 100644 index e325067aeb4256856279e0d72f79615f4b99ce95..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js +++ /dev/null @@ -1,942 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderFuncPromise', function () { - const AUDIOPATH = 'AAC_48000_32_1.aac'; - const AUDIOPATH2 = 'AAC_16000_1.aac'; - const AUDIOPATH3 = 'FLAC_48000_32_1.flac'; - let audioDecodeProcessor; - let readStreamSync; - let eosframenum = 0; - let samplerate = 44.1; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needGetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - let ES_LENGTH = 1500; - let readpath; - let savepath; - let fdRead; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - let lockFlag = false; - - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case 3'); - audioDecodeProcessor = undefined; - readStreamSync = undefined; - eosframenum = 0; - samplerate = 44.1; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - ES_LENGTH = 1500; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - readStreamSync = undefined; - eosframenum = 0; - samplerate = 44.1; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function writeFile(path, buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.writeSync buffer success'); - } catch(e) { - console.info('case fileio.writeSync buffer error is ' + e); - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function stopWork() { - await audioDecodeProcessor.stop().then(() => { - console.info("case stop success") - }, failCallback).catch(failCatch); - } - - async function resetWork() { - resetParam(); - await audioDecodeProcessor.reset().then(() => { - console.info("case reset success"); - if (needrelease) { - audioDecodeProcessor = null; - } - }, failCallback).catch(failCatch); - } - - async function flushWork(done) { - lockFlag = true; - inputQueue = []; - outputQueue = []; - await getFdRead(readpath, done); - await audioDecodeProcessor.flush().then(() => { - console.info("case flush at inputeos success"); - resetParam(); - workdoneAtEOS =true; - }, failCallback).catch(failCatch); - lockFlag = false; - await audioDecodeProcessor.start().then(() => { - console.info("case start after flush success"); - resetParam(); - workdoneAtEOS =true; - }, failCallback).catch(failCatch); - } - - async function doneWork() { - await audioDecodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioDecodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioDecodeProcessor = null; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - timestamp += ES[frameCnt]/samplerate; - frameCnt += 1; - if (!lockFlag) { - audioDecodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - inputCnt += 1; - }); - } - } - } - - async function dequeueAllOutputs(queue, savapath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - console.info("sawOutputEOS == true"); - if (stopAtEOS) { - await stopWork(); - } else if (resetAtEOS) { - await resetWork(); - } else if (flushAtEOS) { - await flushWork(done); - } else if (workdoneAtEOS) { - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await doneWork(); - await fileio.close(fdRead); - done(); - } else { - console.info("saw output EOS"); - } - } - else{ - console.info("write to file success"); - } - if (!lockFlag) { - audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }); - } - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - console.info("outputbuffer.flags: " + outBuffer.flags); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }, failCallback).catch(failCatch);} - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0100 - * @tc.name : 000.test set EOS after last frame and reset - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0100', 0, async function (done) { - console.info("case test set EOS after last frame and reset"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_00.pcm'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - needGetMediaDes = true; - await media.getMediaCapability().then((mediaCaps) => { - console.info('getMediaCapability success'); - if (typeof (mediaCaps) != 'undefined') { - mediaCaps.getAudioDecoderCaps().then((audioCapsArray) => { - console.info('getAudioDecoderCaps success'); - if (typeof (audioCapsArray) != 'undefined') { - console.info('audioCapsArray is not null'); - console.info('get first audioCaps'+ audioCapsArray[0]); - console.info('codecInfo: '+ audioCapsArray[0].codecInfo); - console.info('supportedBitrate: '+ audioCapsArray[0].supportedBitrate); - console.info('supportedBitrate.min: '+ audioCapsArray[0].supportedBitrate.min); - } else { - console.info('audioCaps is not defined'); - } - }, failCallback).catch(failCatch); - } else { - console.info('mediaCaps is not defined'); - } - }, failCallback).catch(failCatch); - await media.createAudioDecoderByName('avdec_aac').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0200 - * @tc.name : 001.test set EOS manually before last frame and reset - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0200', 0, async function (done) { - console.info("case test set EOS manually before last frame and reset"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_01.pcm'; - await getFdRead(readpath, done); - eosframenum = 500; - workdoneAtEOS = true; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - console.info("get AudioDecoderCaps:"); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0300 - * @tc.name : 002.test flush at running state - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0300', 0, async function (done) { - console.info("case test flush at running state"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_02.pcm'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(500).then(async() => { - lockFlag = true; - inputQueue = []; - outputQueue = []; - await audioDecodeProcessor.flush().then(() => { - console.info("case flush after 5s"); - }, failCallback).catch(failCatch); - lockFlag = false; - await audioDecodeProcessor.start().then(() => { - console.info("case start after flush success"); - }, failCallback).catch(failCatch); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0400 - * @tc.name : 003. test flush at EOS state - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0400', 0, async function (done) { - console.info("case test flush at EOS state"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_03.pcm'; - await getFdRead(readpath, done); - eosframenum = 200; - flushAtEOS = true; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0500 - * @tc.name : 004. test stop at running state and reset - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0500', 0, async function (done) { - console.info("case test stop at running state and reset"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_04.pcm'; - await getFdRead(readpath, done); - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(5000).then(() => { - audioDecodeProcessor.stop().then(() => { - console.info("case stop after 5s success"); - }, failCallback).catch(failCatch);}); - resetParam(); - await audioDecodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioDecodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0600 - * @tc.name : 005. test stop and restart - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0600', 0, async function (done) { - console.info("case test stop and restart"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_05.pcm'; - await getFdRead(readpath, done); - eosframenum = 200; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(5000).then(() => { - console.info("case stop decoding after 5s"); - }); - await audioDecodeProcessor.stop().then(() => { - console.info("case stop after 5s success"); - }, failCallback).catch(failCatch); - await sleep(2000).then(() => { - console.info("case restart decoding after 2s"); - }); - resetParam(); - await getFdRead(readpath, done); - await audioDecodeProcessor.start().then(() => { - console.info("case restart after 3s success"); - workdoneAtEOS = true; - enqueueAllInputs(inputQueue); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0700 - * @tc.name : 006. test reconfigure for new file with the same format - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0700', 0, async function (done) { - console.info("case test reconfigure codec for new file with the same format"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - let mediaDescription2 = { - "channel_count": 1, - "sample_rate": 16000, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_06.pcm'; - await getFdRead(readpath, done); - eosframenum = 200; - resetAtEOS = true; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(10000).then(() => { - console.info("case start configure 2"); - }); - resetParam(); - await fileio.close(fdRead); - await audioDecodeProcessor.configure(mediaDescription2).then(() => { - console.info("case configure 2 success"); - resetParam(); - }, failCallback).catch(failCatch); - readpath = AUDIOPATH2; - savepath = 'audioDecode_function_promise_06_2.pcm'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - ES = [0, 239, 302, 309, 330, 474, 684, 699, 683, 674, 647, 649, 638, 644, 640, - 639, 650, 702, 713, 718, 707, 707, 683, 670, 674, 699, 654, 650, 715, 770, - 764, 736, 697, 664, 643, 649, 704, 730, 720, 710, 689, 670, 673, 653, 635, - 643, 638, 653, 658, 683, 683, 705, 690, 681, 648, 659, 743, 681, 706, 707, - 718, 714, 746, 725, 741, 709, 675, 675, 751, 698, 736, 738, 711, 702, 691, - 668, 668, 650, 661, 678, 694, 719, 685, 700, 657, 671, 668, 701, 689, 685, - 682, 668, 696, 690, 683, 739, 704, 667, 694, 716, 757, 714, 701, 664, 619, - 609, 591, 644, 573, 572, 605, 595, 597, 529, 581, 578, 586, 537, 577, 535, - 572, 570, 534, 547, 581, 530, 591, 521, 556, 570, 557, 541, 506, 572, 579, - 502, 516, 582, 540, 584, 548, 555, 539, 578, 588, 541, 539, 526, 575, 535, - 571, 525, 569, 560, 584, 551, 574, 572, 537, 550, 582, 512, 559, 593, 601, - 594, 546, 560, 567, 547, 529, 576, 577, 556, 551, 530, 542, 575, 510, 559, - 613, 628, 511, 566, 515, 539, 594, 536, 565, 551, 533, 613, 557, 523, 574, - 582, 616, 610, 573, 509, 535]; - ES_LENGTH = 200; - samplerate = 16; - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare2 success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start2 success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0800 - * @tc.name : 007. test reconfigure for new file with different formats - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_FUNCTION_PROMISE_0800', 0, async function (done) { - console.info("case test reconfigure codec for new file with different formats"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - let mediaDescription2 = { - "channel_count": 1, - "sample_rate": 48000, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioDecode_function_promise_07.pcm'; - await getFdRead(readpath, done); - eosframenum = 200; - resetAtEOS = true; - needrelease = true; - await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioDecoder success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.getAudioDecoderCaps().then((AudioCaps) => { - console.info("case get AudioDecoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(10000).then(() => { - console.info("start createaudiodecoder 2"); - }); - await fileio.close(fdRead); - await media.createAudioDecoderByMime('audio/flac').then((processor) => { - console.info("case create createAudioDecoder flac success"); - audioDecodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioDecodeProcessor.configure(mediaDescription2).then(() => { - console.info("case configure 2 success"); - resetParam(); - }, failCallback).catch(failCatch); - readpath = AUDIOPATH3; - savepath = 'audioDecode_function_promise_07_2.pcm'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - ES = [0, 2116, 2093, 2886, 2859, 2798, 2778, 2752, 2752, 2754, 2720, 2898, 2829, - 2806, 2796, 2786, 2774, 2758, 2741, 3489, 3342, 3272, 3167, 3048, 3060, 2919, - 2839, 2794, 2770, 2763, 2756, 2722, 2950, 2876, 2842, 2827, 2792, 3121, 3075, - 2969, 3240, 3199, 3082, 2975, 2895, 3135, 3024, 2970, 2902, 2860, 2802, 2778, - 2779, 2963, 2893, 2870, 2831, 2800, 2762, 2752, 2760, 2759, 2726, 2889, 2960, - 2876, 3223, 3040, 3006, 3042, 2980, 3097, 3069, 3215, 3365, 3296, 3653, 3480, - 3300, 3140, 3014, 2975, 2952, 2896, 2897, 2842, 2929, 3567, 3929, 3485, 3082, - 3625, 4953, 5239, 5094, 4993, 4821, 4431, 5195, 5542, 5557, 4894, 4414]; - ES_LENGTH = 100; - samplerate = 48; - setCallback(savepath, done); - await audioDecodeProcessor.prepare().then(() => { - console.info("case prepare2 success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.start().then(() => { - console.info("case start2 success"); - }, failCallback).catch(failCatch); - }) -}) diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js deleted file mode 100644 index 8b7cbde45ac4ac265772e843f44e2c60f2ee0d97..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderMultiInstances', function () { - const AUDIOPATH = 'AAC_48000_32_1.aac'; - let readStreamSync; - let eosframenum = 0; - let samplerate = 44.1; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needGetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = []; - let ES_LENGTH = 1500; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - }) - - afterEach(function() { - console.info('afterEach case'); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - readStreamSync = undefined; - eosframenum = 0; - samplerate = 44.1; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - } - - function writeFile(path, buf, len) { - try{ - let writestream = fileio.createStreamSync(path, "ab+"); - let num = writestream.writeSync(buf, {length:len}); - writestream.flushSync(); - writestream.closeSync(); - }catch(e) { - console.info(e) - } - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.createStreamSync(path, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = readStreamSync.readSync(buf,{length:len}); - } - - async function stopWork(audioDecodeProcessor) { - await audioDecodeProcessor.stop().then(() => { - console.info("case stop success") - }, failCallback).catch(failCatch); - } - - async function resetWork(audioDecodeProcessor) { - resetParam(); - await audioDecodeProcessor.reset().then(() => { - console.info("case reset success"); - if (needrelease) { - audioDecodeProcessor = null; - } - }, failCallback).catch(failCatch); - } - - async function flushWork(audioDecodeProcessor) { - inputQueue = []; - outputQueue = []; - await audioDecodeProcessor.flush().then(() => { - console.info("case flush at inputeos success"); - resetParam(); - readFile(AUDIOPATH); - workdoneAtEOS =true; - }, failCallback).catch(failCatch); - } - - async function doneWork(audioDecodeProcessor) { - await audioDecodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioDecodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - audioDecodeProcessor = null; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function enqueueAllInputs(audioDecodeProcessor, queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - timestamp += ES[frameCnt]/samplerate; - frameCnt += 1; - audioDecodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - }); - } - } - - async function dequeueAllOutputs(audioDecodeProcessor, queue, savapath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - console.info("sawOutputEOS == true"); - if (stopAtEOS) { - await stopWork(audioDecodeProcessor); - } else if (resetAtEOS) { - await resetWork(audioDecodeProcessor); - } else if (flushAtEOS) { - await flushWork(audioDecodeProcessor); - } else if (workdoneAtEOS) { - await doneWork(audioDecodeProcessor); - done(); - } else { - console.info("saw output EOS"); - } - } - else{ - writeFile(savapath, outputobject.data, outputobject.length); - console.info("write to file success"); - } - audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }); - } - } - - function setCallback(audioDecodeProcessor, savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(audioDecodeProcessor, inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - console.info("outputbuffer.flags: " + outBuffer.flags); - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }, failCallback).catch(failCatch);} - outputQueue.push(outBuffer); - await dequeueAllOutputs(audioDecodeProcessor, outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100 - * @tc.name : 001.create multiple decoders - * @tc.desc : basic decode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100', 0, async function (done) { - console.info("case test multiple instances"); - let array = new Array(); - 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); - array[i] = processor; - } else { - console.info("case create createAudioDecoder failed: " + i); - } - }, failCallback).catch(failCatch); - } - 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); - }, failCallback).catch(failCatch); - await array[j].release().then(() => { - console.info('release success'); - array[j] = null; - }, failCallback).catch(failCatch); - } - done(); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js deleted file mode 100644 index ea96afdd50e4f8caae1e786c4cca3a7d9d138f3c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js +++ /dev/null @@ -1,1355 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderReliabilityCallback', function () { - const AUDIOPATH = 'AAC_48000_32_1.aac'; - const BASIC_PATH = 'results/decode_reliability_callback'; - const END = 0; - const CONFIGURE = 1; - const PREPARE = 2; - const START = 3; - const FLUSH = 4; - const STOP = 5; - const RESET = 6; - const HOLDON = 7; - const WAITFORALLOUTS = 8; - const CONFIGURE_ERROR = 9; - const PREPARE_ERROR = 10; - const START_ERROR = 11; - const FLUSH_ERROR = 12; - const STOP_ERROR = 13; - const JUDGE_EOS = 14; - const WAITTIME = 3000; - let audioDecodeProcessor; - let readStreamSync; - let EOSFrameNum = 0; - let samplerate = 44.1; - let workdoneAtEOS = false; - let flushAtEOS = false; - let needGetMediaDes = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - let ES_LENGTH = 500; - let mime = 'audio/mp4a-latm'; - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - }; - let fdRead; - let lockFlag = false; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - EOSFrameNum = 0; - samplerate = 44.1; - workdoneAtEOS = false; - flushAtEOS = false; - needGetMediaDes = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - ES_LENGTH = 500; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - function resetParam() { - readStreamSync = undefined; - EOSFrameNum = 0; - samplerate = 44.1; - workdoneAtEOS = false; - flushAtEOS = false; - needGetMediaDes = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - lockFlag = false; - } - - async function createAudioDecoder(savepath, mySteps, done) { - await getFdRead(AUDIOPATH, done); - media.createAudioDecoderByMime(mime, (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - setCallback(savepath, done); - console.info("case start api test"); - nextStep(mySteps, mediaDescription, done); - }) - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function doneWork(done) { - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info("case stop success"); - resetParam(); - audioDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.log("case reset success"); - audioDecodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioDecodeProcessor = null; - done(); - }) - }) - }) - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function nextStep(mySteps, mediaDescription, done) { - console.info("case myStep[0]: " + mySteps[0]); - if (mySteps[0] == END) { - console.info('case to done'); - audioDecodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info(`case release 1`); - audioDecodeProcessor = null; - done(); - }); - } - switch (mySteps[0]) { - case CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - await getFdRead(AUDIOPATH, done); - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - audioDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case START: - mySteps.shift(); - console.info(`case to start`); - if (sawOutputEOS) { - resetParam(); - await getFdRead(AUDIOPATH, done); - workdoneAtEOS = true; - enqueueAllInputs(inputQueue); - } - audioDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case FLUSH: - mySteps.shift(); - console.info(`case to flush`); - lockFlag = true; - inputQueue = []; - outputQueue = []; - audioDecodeProcessor.flush(async(err) => { - expect(err).assertUndefined(); - console.info(`case flush 1`); - if (flushAtEOS) { - resetParam(); - await getFdRead(AUDIOPATH, done); - workdoneAtEOS = true; - flushAtEOS = false; - } - lockFlag = false; - nextStep(mySteps, mediaDescription, done); - }); - break; - case STOP: - mySteps.shift(); - console.info(`case to stop`); - audioDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`case stop 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case RESET: - mySteps.shift(); - console.info(`case to reset`); - resetParam(); - audioDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info(`case reset 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case HOLDON: - mySteps.shift(); - setTimeout(() =>{ - nextStep(mySteps, mediaDescription, done); - }, WAITTIME); - break; - case WAITFORALLOUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - case CONFIGURE_ERROR: - mySteps.shift(); - console.info(`case to configure 2`); - audioDecodeProcessor.configure(mediaDescription, (err) => { - expect(err != undefined).assertTrue(); - console.info(`case configure error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case PREPARE_ERROR: - mySteps.shift(); - console.info(`case to prepare`); - audioDecodeProcessor.prepare((err) => { - expect(err != undefined).assertTrue(); - console.info(`case prepare error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case START_ERROR: - mySteps.shift(); - console.info(`case to start`); - audioDecodeProcessor.start((err) => { - expect(err != undefined).assertTrue(); - console.info(`case start error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case FLUSH_ERROR: - mySteps.shift(); - console.info(`case to flush`); - audioDecodeProcessor.flush((err) => { - expect(err != undefined).assertTrue(); - console.info(`case flush error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case STOP_ERROR: - mySteps.shift(); - console.info(`case to stop`); - audioDecodeProcessor.stop((err) => { - expect(err != undefined).assertTrue(); - console.info(`case stop error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case JUDGE_EOS: - mySteps.shift(); - console.info(`case judge EOS state`); - expect(sawOutputEOS).assertTrue(); - nextStep(mySteps, mediaDescription, done); - break; - default: - break; - } - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - console.info("frameCnt:" + frameCnt); - if (frameCnt == EOSFrameNum || frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } - else{ - console.info("read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - timestamp += ES[frameCnt]/samplerate; - frameCnt += 1; - if (!lockFlag) { - audioDecodeProcessor.pushInputData(inputobject, () => { - console.info('queueInput success'); - }) - } - } - } - - async function dequeueAllOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (workdoneAtEOS) { - await doneWork(done); - } else { - console.info("sawOutputEOS = true"); - } - } - else{ - console.info("not last frame, continue"); - } - if (!lockFlag) { - audioDecodeProcessor.freeOutputBuffer(outputobject, () => { - console.info('release output success'); - }) - } - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => { - expect(err).assertUndefined(); - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }); - } - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0100 - * @tc.name : 001.create -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0100.pcm'; - let mySteps = new Array(CONFIGURE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0200.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0300 - * @tc.name : 003.start -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, CONFIGURE_ERROR, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0700.pcm'; - let mySteps = new Array(RESET, CONFIGURE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0800.pcm'; - let mySteps = new Array(CONFIGURE, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_CALLBACK_0900', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0900.pcm'; - let mySteps = new Array(CONFIGURE, RESET, CONFIGURE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0100.pcm'; - let mySteps = new Array(PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0200.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, PREPARE_ERROR, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0100 - * @tc.name : 001.create -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0100.pcm'; - let mySteps = new Array(START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0200 - * @tc.name : 002.configure -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0200.pcm'; - let mySteps = new Array(CONFIGURE, START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0400 - * @tc.name : 004.start -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0500 - * @tc.name : 005.flush -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0600 - * @tc.name : 006.stop -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, START_ERROR, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0800 - * @tc.name : 008.reset -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0100 - * @tc.name : 001.create -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0100.pcm'; - let mySteps = new Array(FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0200.pcm'; - let mySteps = new Array(CONFIGURE, FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0400 - * @tc.name : 004.start -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, FLUSH, START, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0100 - * @tc.name : 001.create -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0100.pcm'; - let mySteps = new Array(STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0200.pcm'; - let mySteps = new Array(CONFIGURE, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0400 - * @tc.name : 004.start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, STOP, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0100 - * @tc.name : 001.create -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0100.pcm'; - let mySteps = new Array(RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0200.pcm'; - let mySteps = new Array(CONFIGURE, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0400 - * @tc.name : 004.start -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0100.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, STOP, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0200.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, END); - EOSFrameNum = 2; - flushAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, CONFIGURE, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, STOP, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js deleted file mode 100644 index 6ad1811b08ca6e763d820a52f1eadc01a8202816..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js +++ /dev/null @@ -1,1361 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioDecoderReliabilityPromise', function () { - const AUDIOPATH = 'AAC_48000_32_1.aac'; - const BASIC_PATH = 'results/decode_reliability_promise'; - const END = 0; - const CONFIGURE = 1; - const PREPARE = 2; - const START = 3; - const FLUSH = 4; - const STOP = 5; - const RESET = 6; - const HOLDON = 7; - const WAITFORALLOUTS = 8; - const CONFIGURE_ERROR = 9; - const PREPARE_ERROR = 10; - const START_ERROR = 11; - const FLUSH_ERROR = 12; - const STOP_ERROR = 13; - const JUDGE_EOS = 14; - const WAITTIME = 3000; - let audioDecodeProcessor; - let readStreamSync; - let EOSFrameNum = 0; - let samplerate = 44.1; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needGetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - let ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - let ES_LENGTH = 500; - let mime = 'audio/mp4a-latm'; - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - }; - let expectError = false; - let fdRead; - let lockFlag = false; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - audioDecodeProcessor = null; - readStreamSync = undefined; - EOSFrameNum = 0; - samplerate = 44.1; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES = [0, 283, 336, 291, 405, 438, 411, 215, 215, 313, 270, 342, 641, 554, 545, 545, 546, - 541, 540, 542, 552, 537, 533, 498, 472, 445, 430, 445, 427, 414, 386, 413, 370, 380, - 401, 393, 369, 391, 367, 395, 396, 396, 385, 391, 384, 395, 392, 386, 388, 384, 379, - 376, 381, 375, 373, 349, 391, 357, 384, 395, 384, 380, 386, 372, 386, 383, 378, 385, - 385, 384, 342, 390, 379, 387, 386, 393, 397, 362, 393, 394, 391, 383, 385, 377, 379, - 381, 369, 375, 379, 346, 382, 356, 361, 366, 394, 393, 385, 362, 406, 399, 384, 377, - 385, 389, 375, 346, 396, 388, 381, 383, 352, 357, 397, 382, 395, 376, 388, 373, 374, - 353, 383, 384, 393, 379, 348, 364, 389, 380, 381, 388, 423, 392, 381, 368, 351, 391, - 355, 358, 395, 390, 385, 382, 383, 388, 388, 389, 376, 379, 376, 384, 369, 354, 390, - 389, 396, 393, 382, 385, 353, 383, 381, 377, 411, 387, 390, 377, 349, 381, 390, 378, - 373, 375, 381, 351, 392, 381, 380, 381, 378, 387, 379, 383, 348, 386, 364, 386, 371, - 399, 399, 385, 380, 355, 397, 395, 382, 380, 386, 352, 387, 390, 373, 372, 388, 378, - 385, 368, 385, 370, 378, 373, 383, 368, 373, 388, 351, 384, 391, 387, 389, 383, 355, - 361, 392, 386, 354, 394, 392, 397, 392, 352, 381, 395, 349, 383, 390, 392, 350, 393, - 393, 385, 389, 393, 382, 378, 384, 378, 375, 373, 375, 389, 377, 383, 387, 373, 344, - 388, 379, 391, 373, 384, 358, 361, 391, 394, 363, 350, 361, 395, 399, 389, 398, 375, - 398, 400, 381, 354, 363, 366, 400, 400, 356, 370, 400, 394, 398, 385, 378, 372, 354, - 359, 393, 381, 363, 396, 396, 355, 390, 356, 355, 371, 399, 367, 406, 375, 377, 405, - 401, 390, 393, 392, 384, 386, 374, 358, 397, 389, 393, 385, 345, 379, 357, 388, 356, - 381, 389, 367, 358, 391, 360, 394, 396, 357, 395, 388, 394, 383, 357, 383, 392, 394, - 376, 379, 356, 386, 395, 387, 377, 377, 389, 377, 385, 351, 387, 350, 388, 384, 345, - 358, 368, 399, 394, 385, 384, 395, 378, 387, 386, 386, 376, 375, 382, 351, 359, 356, - 401, 388, 363, 406, 363, 374, 435, 366, 400, 393, 392, 371, 391, 359, 359, 397, 388, - 390, 420, 411, 369, 384, 382, 383, 383, 375, 381, 361, 380, 348, 379, 386, 379, 379, - 386, 371, 352, 378, 378, 388, 384, 385, 352, 355, 387, 383, 379, 362, 386, 399, 376, - 390, 350, 387, 357, 403, 398, 397, 360, 351, 394, 400, 399, 393, 388, 395, 370, 377, - 395, 360, 346, 381, 370, 390, 380, 391, 387, 382, 384, 383, 354, 349, 394, 358, 387, - 400, 386, 402, 354, 396, 387, 391, 365, 377, 359, 361, 365, 395, 388, 388, 384, 388, - 378, 374, 382, 376, 377, 389, 378, 341, 390, 376, 381, 375, 414, 368, 369, 387, 411, - 396, 391, 378, 389, 349, 383, 344, 381, 387, 380, 353, 361, 391, 365, 390, 396, 382, - 386, 385, 385, 409, 387, 386, 378, 372, 372, 374, 349, 388, 389, 348, 395, 380, 382, - 388, 375, 347, 383, 359, 389, 368, 361, 405, 398, 393, 395, 359, 360, 395, 395, 362, - 354, 388, 348, 388, 386, 390, 350, 388, 356, 369, 364, 404, 404, 391, 394, 385, 439, - 432, 375, 366, 441, 362, 367, 382, 374, 346, 391, 371, 354, 376, 390, 373, 382, 385, - 389, 378, 377, 347, 414, 338, 348, 385, 352, 385, 386, 381, 388, 387, 364, 465, 405, - 443, 387, 339, 376, 337, 379, 387, 370, 374, 358, 354, 357, 393, 356, 381, 357, 407, - 361, 397, 362, 394, 394, 392, 394, 391, 381, 386, 379, 354, 351, 392, 408, 393, 389, - 388, 385, 375, 388, 375, 388, 375, 354, 384, 379, 386, 394, 383, 359, 405, 395, 352, - 345, 403, 427, 373, 380, 350, 415, 378, 434, 385, 388, 387, 400, 405, 329, 391, 356, - 419, 358, 359, 375, 367, 391, 359, 369, 361, 376, 378, 379, 348, 390, 345, 388, 390, - 406, 349, 368, 364, 391, 384, 401, 384, 391, 361, 399, 359, 386, 392, 382, 386, 380, - 383, 345, 376, 393, 400, 395, 343, 352, 354, 381, 388, 357, 393, 389, 384, 389, 388, - 384, 404, 372, 358, 381, 352, 355, 485, 393, 371, 376, 389, 377, 391, 387, 376, 342, - 390, 375, 379, 396, 376, 402, 353, 392, 382, 383, 387, 386, 372, 377, 382, 388, 381, - 387, 357, 393, 385, 346, 389, 388, 357, 362, 404, 398, 397, 402, 371, 351, 370, 362, - 350, 388, 399, 402, 406, 377, 396, 359, 372, 390, 392, 368, 383, 346, 384, 381, 379, - 367, 384, 389, 381, 371, 358, 422, 372, 382, 374, 444, 412, 369, 362, 373, 389, 401, - 383, 380, 366, 365, 361, 379, 372, 345, 382, 375, 376, 375, 382, 356, 395, 383, 384, - 391, 361, 396, 407, 365, 351, 385, 378, 403, 344, 352, 387, 397, 399, 377, 371, 381, - 415, 382, 388, 368, 383, 405, 390, 386, 384, 374, 375, 381, 371, 372, 374, 377, 346, - 358, 381, 377, 359, 385, 396, 385, 390, 389, 391, 375, 357, 389, 390, 377, 370, 379, - 351, 381, 381, 380, 371, 386, 389, 389, 383, 362, 393, 388, 355, 396, 383, 352, 384, - 352, 383, 362, 396, 385, 396, 357, 388, 382, 377, 373, 379, 383, 386, 350, 393, 355, - 380, 401, 392, 391, 402, 391, 427, 407, 394, 332, 398, 367, 373, 343, 381, 383, 386, - 382, 349, 353, 393, 378, 386, 375, 390, 356, 392, 384, 387, 380, 381, 385, 386, 383, - 378, 379, 359, 381, 382, 388, 357, 357, 397, 358, 424, 382, 352, 409, 374, 368, 365, - 399, 352, 393, 389, 385, 352, 380, 398, 389, 385, 387, 387, 353, 402, 396, 386, 357, - 395, 368, 369, 407, 394, 383, 362, 380, 385, 368, 375, 365, 379, 377, 388, 380, 346, - 383, 381, 399, 359, 386, 455, 368, 406, 377, 339, 381, 377, 373, 371, 338, 371, 387, - 376, 386, 388, 382, 381, 377, 389, 352, 391, 396, 398, 374, 352, 358, 387, 368, 401, - 395, 387, 387, 354, 393, 401, 382, 390, 371, 374, 387, 377, 379, 377, 383, 374, 367, - 372, 393, 365, 392, 350, 378, 385, 377, 382, 388, 353, 389, 359, 366, 404, 390, 381, - 396, 388, 394, 380, 379, 372, 355, 397, 382, 351, 397, 378, 375, 378, 369, 387, 380, - 383, 346, 357, 362, 371, 413, 393, 365, 395, 391, 384, 386, 385, 390, 355, 385, 394, - 384, 383, 431, 369, 373, 392, 397, 396, 353, 391, 352, 375, 382, 397, 393, 371, 403, - 375, 338, 418, 368, 372, 370, 344, 392, 360, 402, 402, 425, 374, 378, 376, 380, 378, - 347, 379, 414, 377, 390, 383, 357, 390, 385, 377, 378, 368, 399, 389, 383, 368, 372, - 358, 386, 355, 380, 386, 349, 381, 379, 380, 351, 389, 380, 353, 359, 365, 370, 407, - 388, 381, 358, 364, 396, 369, 407, 391, 358, 440, 419, 412, 395, 344, 382, 391, 353, - 403, 391, 371, 354, 362, 407, 411, 397, 385, 388, 357, 348, 368, 401, 404, 380, 370, - 369, 365, 349, 373, 346, 351, 394, 399, 387, 393, 363, 402, 394, 375, 389, 386, 395, - 386, 386, 353, 403, 363, 376, 398, 383, 372, 350, 381, 353, 445, 386, 369, 383, 351, - 392, 397, 384, 389, 354, 400, 392, 379, 386, 355, 391, 388, 361, 390, 408, 357, 390, - 387, 352, 393, 357, 358, 401, 383, 391, 384, 388, 377, 380, 354, 393, 387, 357, 396, - 360, 362, 388, 390, 359, 367, 366, 396, 388, 394, 363, 391, 394, 351, 391, 391, 350, - 360, 365, 397, 366, 375, 400, 412, 372, 380, 383, 384, 383, 390, 380, 361, 363, 387, - 358, 385, 359, 385, 399, 351, 392, 388, 385, 384, 350, 379, 385, 383, 375, 389, 381, - 382, 376, 389, 390, 375, 381, 382, 390, 385, 380, 359, 351, 383, 391, 388, 379, 354, - 387, 382, 358, 381, 381, 386, 397, 373, 381, 387, 387, 381, 378, 383, 370, 360, 386, - 362, 402, 357, 398, 398, 397, 378, 394, 381, 375, 380, 390, 373, 369, 388, 347, 356, - 384, 391, 386, 394, 388, 357, 403, 381, 376, 414, 383, 387, 349, 379, 383, 384, 377, - 394, 426, 373, 392, 367, 381, 378, 378, 374, 373, 369, 368, 332, 335, 381, 392, 388, - 381, 424, 367, 398, 399, 392, 379, 391, 379, 370, 343, 405, 378, 367, 345, 379, 347, - 388, 353, 392, 382, 384, 387, 350, 363, 398, 398, 359, 402, 454, 440, 341, 383, 381, - 385, 355, 349, 369, 360, 388, 383, 354, 435, 405, 404, 399, 385, 386, 364, 388, 373, - 376, 384, 395, 400, 408, 390, 375, 341, 372, 371, 407, 345, 378, 345, 407, 365, 398, - 396, 339, 379, 375, 410, 386, 407, 387, 365, 375, 384, 347, 393, 377, 350, 376, 375, - 381, 410, 394, 386, 345, 345, 354, 397, 386, 375, 390, 347, 411, 381, 383, 374, 379, - 380, 378, 391, 380, 339, 390, 383, 375]; - ES_LENGTH = 500; - expectError = false; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioDecodeProcessor != null) { - await audioDecodeProcessor.release().then(() => { - console.info('audioDecodeProcessor release success'); - audioDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCallbackTrue = function(err, mySteps, done) { - console.info('case callback err : ' + err); - expect(err != undefined).assertTrue(); - nextStep(mySteps, done); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - readStreamSync = undefined; - EOSFrameNum = 0; - samplerate = 44.1; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - lockFlag = false; - } - - async function createAudioDecoder(savepath, mySteps, done) { - await getFdRead(AUDIOPATH, done); - media.createAudioDecoderByMime(mime, (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioDecoder 1`); - audioDecodeProcessor = processor; - setCallback(savepath, done); - console.info("case start api test"); - nextStep(mySteps, done); - }) - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - async function closeFdRead() { - await fileio.close(fdRead).then(() => { - console.info('[fileio] case close fdRead success, fd is ' + fdRead); - }, failCallback).catch(failCatch); - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function doneWork() { - await audioDecodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioDecodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await audioDecodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioDecodeProcessor = null; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function nextStep(mySteps, done) { - console.info("case myStep[0]: " + mySteps[0]); - if (mySteps[0] == END) { - audioDecodeProcessor.release().then(() => { - console.info("case release success"); - audioDecodeProcessor = null; - done(); - }, failCallback).catch(failCatch); - } - switch (mySteps[0]) { - case CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - audioDecodeProcessor.prepare().then(() => { - console.info(`case prepare 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case START: - mySteps.shift(); - console.info(`case to start`); - if (sawOutputEOS) { - resetParam(); - await getFdRead(AUDIOPATH, done); - workdoneAtEOS = true; - enqueueAllInputs(inputQueue); - } - audioDecodeProcessor.start().then(() => { - console.info(`case start 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case FLUSH: - mySteps.shift(); - console.info(`case to flush`); - lockFlag = true; - inputQueue = []; - outputQueue = []; - audioDecodeProcessor.flush().then(async() => { - console.info(`case flush 1`); - if (flushAtEOS) { - await getFdRead(AUDIOPATH, done); - resetParam(); - workdoneAtEOS = true; - flushAtEOS = false; - } - lockFlag = false; - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case STOP: - mySteps.shift(); - console.info(`case to stop`); - audioDecodeProcessor.stop().then(() => { - console.info(`case stop 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case RESET: - mySteps.shift(); - console.info(`case to reset`); - resetParam(); - audioDecodeProcessor.reset().then(() => { - console.info(`case reset 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case HOLDON: - mySteps.shift(); - setTimeout(() =>{ - nextStep(mySteps, done); - }, WAITTIME); - break; - case WAITFORALLOUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - case CONFIGURE_ERROR: - mySteps.shift(); - console.info(`case to configure 2`); - audioDecodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case PREPARE_ERROR: - mySteps.shift(); - console.info(`case to prepare 2`); - audioDecodeProcessor.prepare().then(() => { - console.info(`case prepare error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case START_ERROR: - mySteps.shift(); - console.info(`case to start 2`); - audioDecodeProcessor.start().then(() => { - console.info(`case start error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case FLUSH_ERROR: - mySteps.shift(); - console.info(`case to flush 2`); - audioDecodeProcessor.flush().then(() => { - console.info(`case flush error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case STOP_ERROR: - mySteps.shift(); - console.info(`case to stop 2`); - audioDecodeProcessor.stop().then(() => { - console.info(`case stop error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case JUDGE_EOS: - mySteps.shift(); - console.info(`case judge EOS state`); - expect(sawOutputEOS).assertTrue(); - nextStep(mySteps, done); - break; - default: - break; - } - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == EOSFrameNum || frameCnt == ES_LENGTH + 1) { - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[frameCnt]; - getContent(inputobject.data, ES[frameCnt]); - inputobject.flags = 0; - } - timestamp += ES[frameCnt]/samplerate; - frameCnt += 1; - if (!lockFlag) { - audioDecodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - }); - } - } - } - - async function dequeueAllOutputs(queue, savapath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (workdoneAtEOS) { - await doneWork(); - done(); - } else { - console.info("sawOutputEOS = true") - } - } - else{ - console.info("not last frame, continue"); - } - if (!lockFlag) { - audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }); - } - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioDecodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioDecodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - if (needGetMediaDes) { - audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }, failCallback).catch(failCatch);} - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioDecodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioDecodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0100 - * @tc.name : 001.create -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0100.pcm'; - let mySteps = new Array(CONFIGURE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0200.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0300 - * @tc.name : 003.start -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, CONFIGURE_ERROR, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0700.pcm'; - let mySteps = new Array(RESET, CONFIGURE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0800.pcm'; - let mySteps = new Array(CONFIGURE, CONFIGURE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_CONFIGURE_PROMISE_0900', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0900.pcm'; - let mySteps = new Array(CONFIGURE, RESET, CONFIGURE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0100.pcm'; - let mySteps = new Array(PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0200.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, PREPARE_ERROR, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_PREPARE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, PREPARE_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0100 - * @tc.name : 001.create -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0100.pcm'; - let mySteps = new Array(START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0200 - * @tc.name : 002.configure -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0200.pcm'; - let mySteps = new Array(CONFIGURE, START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0400 - * @tc.name : 004.start -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0500 - * @tc.name : 005.flush -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0600 - * @tc.name : 006.stop -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, START_ERROR, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0800 - * @tc.name : 008.reset -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_START_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, START_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0100 - * @tc.name : 001.create -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0100.pcm'; - let mySteps = new Array(FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0200.pcm'; - let mySteps = new Array(CONFIGURE, FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0400 - * @tc.name : 004.start -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, FLUSH, START, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_FLUSH_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, FLUSH_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0100 - * @tc.name : 001.create -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0100.pcm'; - let mySteps = new Array(STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0200.pcm'; - let mySteps = new Array(CONFIGURE, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0400 - * @tc.name : 004.start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, STOP, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_STOP_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, STOP_ERROR, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0100 - * @tc.name : 001.create -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0100.pcm'; - let mySteps = new Array(RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0200.pcm'; - let mySteps = new Array(CONFIGURE, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0400 - * @tc.name : 004.start -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0600.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0700.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_RESET_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0800.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, RESET, END); - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0100.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, STOP, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0200.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, END); - EOSFrameNum = 2; - flushAtEOS = true; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0300.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, CONFIGURE, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0400.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_API_EOS_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0500.pcm'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, STOP, END); - EOSFrameNum = 2; - createAudioDecoder(savepath, mySteps, done); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/List.test.js deleted file mode 100644 index 239657117cec09e76461aa8c231c8ba734a5e8bb..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/List.test.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - - -require('./AudioDecoderFuncPromiseTest.test.js') -require('./AudioDecoderFuncCallbackTest.test.js') -require('./AudioDecoderFormatPromiseTest.test.js') -require('./AudioDecoderFormatCallbackTest.test.js') -require('./AudioDecoderReliabilityPromiseTest.test.js') -require('./AudioDecoderReliabilityCallbackTest.test.js') -require('./AudioDecoderMultiInstancesTest.test.js') -require('./AudioDecoderEnumTest.test.js') - diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/audioDecoder/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40f7360d5d818998221b199d3ec0f69c0..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/audioDecoder/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/audioDecoder/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/media/media_js_standard/audioEncoder/BUILD.gn b/multimedia/media/media_js_standard/audioEncoder/BUILD.gn deleted file mode 100644 index f6fc6bc593390a6cac1f4ea2eee2c237f5b0fd6e..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("audio_encoder_js_hap") { - hap_profile = "./src/main/config.json" - js2abc = true - deps = [ - ":audio_encoder_js_assets", - ":audio_encoder_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAudioEncoderJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_player_framework" -} -ohos_js_assets("audio_encoder_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("audio_encoder_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/media/media_js_standard/audioEncoder/Test.json b/multimedia/media/media_js_standard/audioEncoder/Test.json deleted file mode 100644 index 85cdfb43d82b55323821774548d2848911a59fdf..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/Test.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "description": "Configuration for audioEncoder Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "2000000", - "package": "ohos.acts.multimedia.audio.audioencoder", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAudioEncoderJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "rm -rf /storage/media/100/local/files/*", - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audioencoder/haps/entry/files/", - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audioencoder/haps/entry/files/" - ], - "teardown-command":[ - ] - }, - { - "type": "PushKit", - "pre-push": [ - ], - "push": [ - "./resource/audio/audioEncode/S16LE.pcm ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audioencoder/haps/entry/files/" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audioencoder/haps/entry/files/", - "chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.audio.audioencoder/haps/entry/files/*", - "chmod 777 -R /storage/media/100/local/files/", - "chmod 777 /storage/media/100/local/files/*" - ], - "teardown-command":[ - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/audioEncoder/signature/openharmony_sx.p7b deleted file mode 100644 index 6a18cb457cfc106b6271d29a3b5d031224eeee96..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/audioEncoder/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/config.json b/multimedia/media/media_js_standard/audioEncoder/src/main/config.json deleted file mode 100644 index 89ce75b7d8ce7e64fa1e8961d2c097343842f154..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/config.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.audio.audioencoder", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.audio.audioencoder.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "standard" - } - ], - "deviceType": [ - "default", - "default", - "tablet", - "tv", - "wearable" - ], - "reqPermissions": [ - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.MEDIA_LOCATION", - "reason" : "use ohos.permission.MEDIA_LOCATION" - }, - { - "name" : "ohos.permission.READ_MEDIA", - "reason" : "use ohos.permission.READ_MEDIA" - }, - { - "name" : "ohos.permission.WRITE_MEDIA", - "reason" : "use ohos.permission.WRITE_MEDIA" - } - ], - "mainAbility": "ohos.acts.multimedia.audio.audioencoder.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.audio.audioencoder", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/app.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/app.js deleted file mode 100644 index 830070d196d86b127cea947d168bfd116f446205..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/i18n/en-US.json b/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/i18n/zh-CN.json b/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.css deleted file mode 100644 index 9f1321a1dcd401eb5367f0a0715959581fdaebb4..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 6892123992c660d987c2b58eb133e13504ab2072..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.js deleted file mode 100644 index 67f8b8567ccc4932331b7a18a6b947340d84fb40..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 60000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js deleted file mode 100644 index bfc7580a471990361e60e799a1cf8782601537a5..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js +++ /dev/null @@ -1,826 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioEncoderFuncCallback', function () { - const AUDIOPATH = 'S16LE.pcm'; - let audioEncodeProcessor; - let readStreamSync; - let eosframenum = 0; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needGetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - const ES = [0, 4096]; - let ES_LENGTH = 1500; - let readpath; - let savepath; - let fdRead; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - let lockFlag = false; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - audioEncodeProcessor = null; - readStreamSync = undefined; - eosframenum = 0; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES_LENGTH = 1500; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioEncodeProcessor != null) { - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - audioEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - function resetParam() { - readStreamSync = undefined; - eosframenum = 0; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needrelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - function writeFile(path, buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - async function stopWork() { - audioEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info("case stop success") - }) - } - - async function resetWork() { - resetParam(); - audioEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info("case reset success"); - if (needrelease) { - audioEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info("case release success"); - audioEncodeProcessor = null; - }) - } - }) - } - - async function flushWork(done) { - lockFlag = true; - inputQueue = []; - outputQueue = []; - await getFdRead(readpath, done); - audioEncodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info("case flush at inputeos success"); - resetParam(); - workdoneAtEOS =true; - lockFlag = false; - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info("case start after flush success"); - }) - }) - } - - async function doneWork(done) { - audioEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info("case stop success"); - resetParam(); - audioEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - audioEncodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioEncodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - }) - }) - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1) { - console.info("EOS frame seperately") - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } - timestamp += 23; - frameCnt += 1; - if (!lockFlag) { - audioEncodeProcessor.pushInputData(inputobject, () => { - console.info('queueInput success'); - inputCnt += 1; - }) - } - } - } - - async function dequeueAllOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (stopAtEOS) { - await stopWork(); - } else if (resetAtEOS) { - await resetWork(); - } else if (flushAtEOS) { - await flushWork(done); - } else if (workdoneAtEOS) { - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await doneWork(done); - } else { - console.info("sawOutputEOS = true"); - } - } - else{ - console.info("write to file success"); - } - if (!lockFlag) { - audioEncodeProcessor.freeOutputBuffer(outputobject, () => { - console.info('release output success'); - }) - } - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioEncodeProcessor.on('needInputData', async(inBuffer) => { - console.info('case inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('case outputBufferAvailable'); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needGetMediaDes) { - audioEncodeProcessor.getOutputMediaDescription((err, MediaDescription) => { - expect(err).assertUndefined(); - console.info("case get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }); - } - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioEncodeProcessor.on('streamChanged',(format) => { - console.info('case Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0100 - * @tc.name : 000.test set EOS after last frame and reset - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0100', 0, async function (done) { - console.info("test set EOS after last frame and reset"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - let mediaDescription2 = { - "codec_mime": 'audio/mp4a-latm', - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_00.aac'; - await getFdRead(readpath, done); - needGetMediaDes = true; - workdoneAtEOS = true; - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, AudioCaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info(`AudioCaps: ` + AudioCaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.getMediaCapability((err, mediaCaps) => { - expect(err).assertUndefined(); - console.info(`case getMediaCapability 1`); - mediaCaps.getAudioEncoderCaps((err, audioCaps) => { - expect(err).assertUndefined(); - console.info('getAudioEncoderCaps success'); - if (typeof (audioCaps) != 'undefined') { - console.info("case audioCaps " + audioCaps); - } else { - console.info("case audioCaps is not defined"); - } - }) - mediaCaps.findAudioEncoder(mediaDescription2, (err, codecname) => { - expect(err).assertUndefined(); - console.info('findAudioEncoder success'); - if (typeof (codecname) != 'undefined') { - console.info("case codecname " + codecname); - } else { - console.info("case codecname is not defined"); - } - }) - }) - media.createAudioEncoderByName('avenc_aac', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder by mime 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0200 - * @tc.name : 001.test set EOS manually before last frame and reset - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0200', 0, async function (done) { - console.info("case test set EOS manually before last frame and reset"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_01.aac'; - await getFdRead(readpath, done); - eosframenum = 500; - workdoneAtEOS = true; - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0300 - * @tc.name : 002.test flush at running state - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0300', 0, async function (done) { - console.info("case test flush at running state"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_02.aac'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start(async(err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - await sleep(500); - eventEmitter.emit('flush'); - }) - }); - eventEmitter.on('flush', () => { - lockFlag = true; - inputQueue = []; - outputQueue = []; - audioEncodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info(`case flush after 2s success`); - lockFlag = false; - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start after flush success`); - }) - }) - }); - media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0400 - * @tc.name : 003. test flush at EOS state - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0400', 0, async function (done) { - console.info("case test flush at EOS state"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_03.aac'; - await getFdRead(readpath, done); - eosframenum = 500; - flushAtEOS = true; - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - }) - }); - media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0500 - * @tc.name : 004.test stop at running state and reset - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0500', 0, async function (done) { - console.info("case test stop at running state and reset"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_04.aac'; - await getFdRead(readpath, done); - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - eventEmitter.emit('stop'); - }) - }); - eventEmitter.on('stop', () => { - sleep(5000).then(() => { - audioEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`case stop 1`); - eventEmitter.emit('reset'); - }) - }) - }); - eventEmitter.on('reset', () => { - resetParam(); - audioEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info(`case reset 1`); - eventEmitter.emit('release'); - }) - }); - eventEmitter.on('release', () => { - audioEncodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.info(`case release 1`); - audioEncodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - }); - media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0600 - * @tc.name : 005.test stop and restart - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0600', 0, async function (done) { - console.info("case test stop and restart"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_05.aac'; - await getFdRead(readpath, done); - eosframenum = 100; - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - eventEmitter.emit('stop'); - }) - }); - eventEmitter.on('stop', () => { - sleep(5000).then(() => { - audioEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`stop after 5s`); - resetParam(); - eventEmitter.emit('restart'); - }) - }) - }); - eventEmitter.on('restart', () => { - sleep(2000).then(async() => { - resetParam(); - await getFdRead(readpath, done); - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`restart after 2s`); - workdoneAtEOS = true; - enqueueAllInputs(inputQueue); - }) - }) - }); - media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0700 - * @tc.name : 006.test reconfigure for new file with the same format - * @tc.desc : basic Encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_0700', 0, async function (done) { - console.info("case test reconfigure for new file with the same format"); - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_06.aac'; - await getFdRead(readpath, done); - eosframenum = 100; - resetAtEOS = true; - let mediaDescription2 = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - let hasreconfigured = false; - eventEmitter.on('getAudioEncoderCaps', () => { - audioEncodeProcessor.getAudioEncoderCaps((err, Audiocaps) => { - expect(err).assertUndefined(); - console.info(`case getAudioEncoderCaps 1`); - console.info("AudioCaps: " + Audiocaps); - eventEmitter.emit('configure', mediaDescription); - }) - }); - eventEmitter.on('configure', (mediaDescription) => { - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - setCallback(savepath, done); - eventEmitter.emit('start'); - }) - }); - eventEmitter.on('start', () => { - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - if (!hasreconfigured) { - eventEmitter.emit('reconfigure', mediaDescription2); - } - }) - }); - eventEmitter.on('reconfigure', (mediaDescription2) => { - sleep(10000).then(async() => { - resetParam(); - await fileio.close(fdRead); - audioEncodeProcessor.configure(mediaDescription2, async(err) => { - expect(err).assertUndefined(); - console.info(`case configure 2`); - resetParam(); - readpath = AUDIOPATH; - savepath = 'audioEncode_function_callback_06_2.aac'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - hasreconfigured = true; - eventEmitter.emit('prepare'); - }) - }) - }); - media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - eventEmitter.emit('getAudioEncoderCaps'); - }) - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js deleted file mode 100644 index 95fd3a3abc23b5ebd53dd371be9f36319543be63..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js +++ /dev/null @@ -1,663 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioEncoderFuncPromise', function () { - const AUDIOPATH = 'S16LE.pcm'; - let audioEncodeProcessor; - let readStreamSync; - let eosframenum = 0; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needgetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - const ES = [0, 4096]; - let ES_LENGTH = 1500; - let readpath; - let savepath; - let fdRead; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - let lockFlag = false; - - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - audioEncodeProcessor = null; - readStreamSync = undefined; - eosframenum = 0; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needgetMediaDes = false; - needrelease = false - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES_LENGTH = 1500; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioEncodeProcessor != null) { - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - audioEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - readStreamSync = undefined; - eosframenum = 0; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needgetMediaDes = false; - needrelease = false - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - outputCnt = 0; - inputCnt = 0; - lockFlag = false; - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - function writeFile(path, buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - async function stopWork() { - await audioEncodeProcessor.stop().then(() => { - console.info("case stop success") - }, failCallback).catch(failCatch); - } - - async function resetWork() { - resetParam(); - await audioEncodeProcessor.reset().then(async() => { - console.info("case reset success"); - if (needrelease) { - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - }, failCallback).catch(failCatch); - } - - async function flushWork(done) { - lockFlag = true; - inputQueue = []; - outputQueue = []; - await getFdRead(readpath, done); - await audioEncodeProcessor.flush().then(() => { - console.info("case flush at inputeos success"); - resetParam(); - workdoneAtEOS =true; - lockFlag = false; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start after flush success"); - }, failCallback).catch(failCatch); - } - - async function doneWork() { - await audioEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now();Date.now() - t <= time;); - } - - async function enqueueInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - console.info("case frameCnt:" + frameCnt); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1) { - console.info("case EOS frame seperately") - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } - timestamp += 23; - frameCnt += 1; - if (!lockFlag) { - await audioEncodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - inputCnt += 1; - }); - } - } - } - - async function dequeueOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (stopAtEOS) { - await stopWork(); - } else if (resetAtEOS) { - await resetWork(); - } else if (flushAtEOS) { - await flushWork(done); - } else if (workdoneAtEOS) { - expect(outputCnt).assertClose(inputCnt, frameThreshold); - await doneWork(); - await fileio.close(fdRead); - done(); - } else { - console.info('sawOutputEOS = true'); - } - } - else{ - console.info("write to file success"); - } - if (!lockFlag) { - await audioEncodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }); - } - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioEncodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueInputs(inputQueue); - }); - audioEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - if (needgetMediaDes) { - audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needgetMediaDes=false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - await dequeueOutputs(outputQueue, savepath, done); - }); - audioEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0100 - * @tc.name : 000.test set EOS after last frame and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0100', 0, async function (done) { - console.info("case test set EOS after last frame and reset"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - let mediaDescription2 = { - "codec_mime": 'audio/mp4a-latm', - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_00.aac'; - await getFdRead(readpath, done); - needgetMediaDes = true; - workdoneAtEOS = true; - await media.getMediaCapability().then((mediaCaps) => { - console.info('getMediaCapability success'); - if (typeof (mediaCaps) != 'undefined') { - mediaCaps.getAudioEncoderCaps().then((audioCaps) => { - console.info('getAudioEncoderCaps success'); - if (typeof (audioCaps) != 'undefined') { - console.info("case audioCaps " + audioCaps); - } else { - console.info("case audioCaps is not defined"); - } - }, failCallback).catch(failCatch); - mediaCaps.findAudioEncoder(mediaDescription2).then((codecname) => { - console.info('getAudioEncoderCaps success'); - if (typeof (codecname) != 'undefined') { - console.info("case codecname " + codecname); - } else { - console.info("case codecname is not defined"); - } - }, failCallback).catch(failCatch); - } else { - console.info('mediaCaps is not defined'); - } - }, failCallback).catch(failCatch); - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps) - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success") - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0200 - * @tc.name : 001.test set EOS manually before last frame and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0200', 0, async function (done) { - console.info("case test set EOS manually before last frame and reset"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_01.aac'; - await getFdRead(readpath, done); - eosframenum = 500; - workdoneAtEOS = true; - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0300 - * @tc.name : 002.test flush at running state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0300', 0, async function (done) { - console.info("case test flush at running state"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_02.aac'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps) - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success") - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success") - }, failCallback).catch(failCatch); - await sleep(500).then(async() => { - lockFlag = true; - inputQueue = []; - outputQueue = []; - await audioEncodeProcessor.flush().then(() => { - console.info("case flush after 5s"); - lockFlag = false; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start after flush success"); - }, failCallback).catch(failCatch); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0400 - * @tc.name : 003.test flush at EOS state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0400', 0, async function (done) { - console.info("case test flush at EOS state"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_03.aac'; - await getFdRead(readpath, done); - eosframenum = 500; - flushAtEOS = true; - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0500 - * @tc.name : 004.test stop at running state and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0500', 0, async function (done) { - console.info("case test stop at running state and reset"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_04.aac'; - await getFdRead(readpath, done); - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(5000).then(() => { - audioEncodeProcessor.stop().then(() => { - console.info("stop after 5s success"); - }, failCallback).catch(failCatch);}); - resetParam(); - await audioEncodeProcessor.reset().then(() => { - console.info("reset success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - await fileio.close(fdRead); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0600 - * @tc.name : 005.test stop and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0600', 0, async function (done) { - console.info("case test stop and restart"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_05.aac'; - await getFdRead(readpath, done); - eosframenum = 100; - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await sleep(5000).then(() => { - console.info("stop encoding after 5s"); - }); - await audioEncodeProcessor.stop().then(() => { - console.info("case stop after 5s success"); - }, failCallback).catch(failCatch); - await sleep(2000).then(() => { - console.info("restart encoding after 2s"); - }); - resetParam(); - await getFdRead(readpath, done); - await audioEncodeProcessor.start().then(() => { - console.info("case restart after 3s success"); - workdoneAtEOS = true; - enqueueInputs(inputQueue); - }, failCallback).catch(failCatch); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0700 - * @tc.name : 006.test reconfigure for new file with the same format - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_FUNCTION_PROMISE_0700', 0, async function (done) { - console.info("case test reconfigure for new file with the same format"); - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_06.aac'; - await getFdRead(readpath, done); - eosframenum = 100; - resetAtEOS = true; - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - console.info("case create createAudioEncoder success"); - audioEncodeProcessor = processor; - }, failCallback).catch(failCatch); - await audioEncodeProcessor.getAudioEncoderCaps().then((AudioCaps) => { - console.info("case get AudioEncoderCaps success"); - console.info("print AudioCaps: " + AudioCaps); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - let mediaDescription2 = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - } - await sleep(10000).then(() => { - console.info("start configure 2"); - }); - resetParam(); - await fileio.close(fdRead); - await audioEncodeProcessor.configure(mediaDescription2).then(() => { - console.info("configure 2 success"); - resetParam(); - }, failCallback).catch(failCatch); - readpath = AUDIOPATH; - savepath = 'audioEncode_function_promise_06_2.aac'; - await getFdRead(readpath, done); - workdoneAtEOS = true; - setCallback(savepath, done); - await audioEncodeProcessor.prepare().then(() => { - console.info("prepare2 success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.start().then(() => { - console.info("start2 success"); - }, failCallback).catch(failCatch); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js deleted file mode 100644 index ca290f52766f80f7ffb869d3d7da4be62c8a0554..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js +++ /dev/null @@ -1,321 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import Fileio from '@ohos.fileio' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioEncoderMultiInstances', function () { - const RESOURCEPATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/' - const AUDIOPATH = RESOURCEPATH + 'S16LE.pcm'; - let readStreamSync; - let eosframenum = 0; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needgetMediaDes = false; - let needrelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - const ES = [0, 4096]; - let ES_LENGTH = 1500; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - readStreamSync = undefined; - eosframenum = 0; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needgetMediaDes = false; - needrelease = false - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES_LENGTH = 1500; - }) - - afterEach(function() { - console.info('afterEach case'); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - readStreamSync = undefined; - eosframenum = 0; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - workdoneAtEOS = false; - needgetMediaDes = false; - needrelease = false - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - } - - function writeHead(path, len) { - try{ - let writestream = Fileio.createStreamSync(path, "ab+"); - let head = new ArrayBuffer(7); - addADTStoPacket(head, len); - let num = writestream.writeSync(head, {length:7}); - writestream.flushSync(); - writestream.closeSync(); - } catch(e) { - console.info(e) - } - } - - function writeFile(path, buf, len) { - try{ - let writestream = Fileio.createStreamSync(path, "ab+"); - let num = writestream.writeSync(buf, {length:len}); - writestream.flushSync(); - writestream.closeSync(); - } catch(e) { - console.info(e); - } - } - - function readFile(path) { - try{ - console.info('filepath: ' + path); - readStreamSync = Fileio.createStreamSync(path, 'rb'); - } catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = readStreamSync.readSync(buf,{length:len}); - console.info('lengthreal: ' + lengthreal); - } - - function addADTStoPacket(head, len) { - let view = new Uint8Array(head); - console.info("start add ADTS to Packet"); - let packetLen = len + 7; // 7: head length - let profile = 2; // 2: AAC LC - let freqIdx = 4; // 4: 44100HZ - let chanCfg = 2; // 2: 2 channel - view[0] = 0xFF; - view[1] = 0xF9; - view[2] = ((profile - 1) << 6) + (freqIdx << 2) + (chanCfg >> 2); - view[3] = ((chanCfg & 3) << 6) + (packetLen >> 11); - view[4] = (packetLen & 0x7FF) >> 3; - view[5] = ((packetLen & 7) << 5) + 0x1F; - view[6] = 0xFC; - } - - async function stopWork(audioEncodeProcessor) { - await audioEncodeProcessor.stop().then(() => { - console.info("case stop success") - }, failCallback).catch(failCatch); - } - - async function resetWork(audioEncodeProcessor) { - resetParam(); - await audioEncodeProcessor.reset().then(async() => { - console.info("case reset success"); - if (needrelease) { - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - }, failCallback).catch(failCatch); - } - - async function flushWork(audioEncodeProcessor) { - inputQueue = []; - outputQueue = []; - await audioEncodeProcessor.flush().then(() => { - console.info("case flush at inputeos success"); - resetParam(); - readFile(AUDIOPATH); - workdoneAtEOS =true; - }, failCallback).catch(failCatch); - } - - async function doneWork(audioEncodeProcessor) { - await audioEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now();Date.now() - t <= time;); - } - - async function enqueueInputs(audioEncodeProcessor, queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - console.info("case frameCnt:" + frameCnt); - if (frameCnt == eosframenum || frameCnt == ES_LENGTH + 1) { - console.info("case EOS frame separately") - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES[1]; - getContent(inputobject.data, ES[1]); - inputobject.flags = 0; - } - timestamp += 23; - frameCnt += 1; - audioEncodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - }); - } - } - - async function dequeueOutputs(audioEncodeProcessor, queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (stopAtEOS) { - await stopWork(audioEncodeProcessor); - } else if (resetAtEOS) { - await resetWork(audioEncodeProcessor); - } else if (flushAtEOS) { - await flushWork(audioEncodeProcessor); - } else if (workdoneAtEOS) { - await doneWork(audioEncodeProcessor); - done(); - } else { - console.info('sawOutputEOS = true'); - } - } - else{ - writeFile(savepath, outputobject.data, outputobject.length); - console.info("write to file success"); - } - audioEncodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }); - } - } - - function setCallback(audioEncodeProcessor, savepath, done) { - console.info('case callback'); - audioEncodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueInputs(audioEncodeProcessor, inputQueue); - }); - audioEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - if (needgetMediaDes) { - audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needgetMediaDes=false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - await dequeueOutputs(audioEncodeProcessor, outputQueue, savepath, done); - }); - audioEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100 - * @tc.name : 001.create multiple encoder2 - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_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 < 2; i += 1) { - await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => { - if (typeof(processor) != 'undefined') { - console.info("case create createAudioEncoder success: " + i); - array[i] = processor; - } else { - console.info("case create createAudioEncoder failed: " + i); - } - }, failCallback).catch(failCatch); - } - 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); - }, failCallback).catch(failCatch); - await array[j].release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - array[j] = null; - } - done(); - }) -}) - - \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js deleted file mode 100644 index e3fa8c2d58af1a09d4a747eb0fdf842d817b7e6f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js +++ /dev/null @@ -1,1171 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioEncoderReliabilityCallback', function () { - const AUDIOPATH = 'S16LE.pcm'; - const BASIC_PATH = 'results/encode_reliability_callback_'; - const END = 0; - const CONFIGURE = 1; - const PREPARE = 2; - const START = 3; - const FLUSH = 4; - const STOP = 5; - const RESET = 6; - const HOLDON = 7; - const WAITFORALLOUTS = 8; - const CONFIGURE_ERROR = 9; - const PREPARE_ERROR = 10; - const START_ERROR = 11; - const FLUSH_ERROR = 12; - const STOP_ERROR = 13; - const JUDGE_EOS = 14; - const WAITTIME = 3000; - let audioEncodeProcessor; - let readStreamSync; - let EOSFrameNum = 0; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needGetMediaDes = false; - let needRelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - const ES_SIZE = [0, 4096]; - let ES_LENGTH = 200; - let mime = 'audio/mp4a-latm'; - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - }; - let fdRead; - let lockFlag = false; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - audioEncodeProcessor = null; - readStreamSync = undefined; - EOSFrameNum = 0; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needRelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES_LENGTH = 200; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioEncodeProcessor != null) { - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - function resetParam() { - readStreamSync = undefined; - EOSFrameNum = 0; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needRelease = false; - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - lockFlag = false; - } - - async function createAudioEncoder(savepath, mySteps, done) { - await getFdRead(AUDIOPATH, done); - media.createAudioEncoderByMime(mime, (err, processor) => { - expect(err).assertUndefined(); - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - setCallback(savepath, done); - console.info("case start api test"); - nextStep(mySteps, mediaDescription, done); - }) - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function doneWork(done) { - audioEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info("case stop success"); - resetParam(); - audioEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.log("case reset success"); - audioEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioEncodeProcessor = null; - done(); - }) - }) - }) - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function nextStep(mySteps, mediaDescription, done) { - console.info("case myStep[0]: " + mySteps[0]); - if (mySteps[0] == END) { - audioEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.log("case release success"); - audioEncodeProcessor = null; - done(); - }) - } - switch (mySteps[0]) { - case CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - audioEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info(`case prepare 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case START: - mySteps.shift(); - console.info(`case to start`); - if (sawOutputEOS) { - resetParam(); - await getFdRead(AUDIOPATH, done); - workdoneAtEOS = true; - enqueueAllInputs(inputQueue); - } - audioEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info(`case start 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case FLUSH: - mySteps.shift(); - console.info(`case to flush`); - lockFlag = true; - inputQueue = []; - outputQueue = []; - audioEncodeProcessor.flush(async(err) => { - expect(err).assertUndefined(); - console.info(`case flush 1`); - if (flushAtEOS) { - await getFdRead(AUDIOPATH, done); - resetParam(); - workdoneAtEOS = true; - flushAtEOS = false; - } - lockFlag = false; - nextStep(mySteps, mediaDescription, done); - }); - break; - case STOP: - mySteps.shift(); - console.info(`case to stop`); - audioEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`case stop 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case RESET: - mySteps.shift(); - console.info(`case to reset`); - resetParam(); - audioEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info(`case reset 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case HOLDON: - mySteps.shift(); - setTimeout(() =>{ - nextStep(mySteps, mediaDescription, done); - }, WAITTIME); - break; - case WAITFORALLOUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - case CONFIGURE_ERROR: - mySteps.shift(); - console.info(`case to configure`); - audioEncodeProcessor.configure(mediaDescription, (err) => { - expect(err != undefined).assertTrue(); - console.info(`case configure error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case PREPARE_ERROR: - mySteps.shift(); - console.info(`case to prepare`); - audioEncodeProcessor.prepare((err) => { - expect(err != undefined).assertTrue(); - console.info(`case prepare error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case START_ERROR: - mySteps.shift(); - console.info(`case to start`); - audioEncodeProcessor.start((err) => { - expect(err != undefined).assertTrue(); - console.info(`case start error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case FLUSH_ERROR: - mySteps.shift(); - console.info(`case to flush`); - audioEncodeProcessor.flush((err) => { - expect(err != undefined).assertTrue(); - console.info(`case flush error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case STOP_ERROR: - mySteps.shift(); - console.info(`case to stop`); - audioEncodeProcessor.stop((err) => { - expect(err != undefined).assertTrue(); - console.info(`case stop error 1`); - nextStep(mySteps, mediaDescription, done); - }); - break; - case JUDGE_EOS: - mySteps.shift(); - console.info(`case judge EOS state`); - expect(sawOutputEOS).assertTrue(); - nextStep(mySteps, mediaDescription, done); - break; - default: - break; - } - } - - async function enqueueAllInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - if (frameCnt == EOSFrameNum || frameCnt == ES_LENGTH + 1) { - console.info("EOS frame seperately") - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES_SIZE[1]; - getContent(inputobject.data, ES_SIZE[1]); - inputobject.flags = 0; - } - timestamp += 23; - frameCnt += 1; - audioEncodeProcessor.pushInputData(inputobject, () => { - console.info('queueInput success'); - }) - } - } - - async function dequeueAllOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (workdoneAtEOS) { - await doneWork(done); - } else { - console.info("sawOutputEOS = true"); - } - } - else{ - console.info("not last frame, continue"); - } - audioEncodeProcessor.freeOutputBuffer(outputobject, () => { - console.info('release output success'); - }) - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioEncodeProcessor.on('needInputData', async(inBuffer) => { - console.info('case inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueAllInputs(inputQueue); - }); - audioEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('case outputBufferAvailable'); - if (needGetMediaDes) { - audioEncodeProcessor.getOutputMediaDescription((err, MediaDescription) => { - expect(err).assertUndefined(); - console.info("case get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }); - } - outputQueue.push(outBuffer); - await dequeueAllOutputs(outputQueue, savepath, done); - }); - audioEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioEncodeProcessor.on('streamChanged',(format) => { - console.info('case Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0100 - * @tc.name : 001.create -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0100.es'; - let mySteps = new Array(CONFIGURE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0200.es'; - let mySteps = new Array(CONFIGURE, PREPARE, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0300 - * @tc.name : 003.start -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, CONFIGURE_ERROR, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0700.es'; - let mySteps = new Array(RESET, CONFIGURE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0800.es'; - let mySteps = new Array(CONFIGURE, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_CALLBACK_0900', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0900.es'; - let mySteps = new Array(CONFIGURE, RESET, CONFIGURE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0100.es'; - let mySteps = new Array(PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0200.es'; - let mySteps = new Array(CONFIGURE, PREPARE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, PREPARE_ERROR, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0100 - * @tc.name : 001.create -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0100.es'; - let mySteps = new Array(START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0200 - * @tc.name : 002.configure -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0200.es'; - let mySteps = new Array(CONFIGURE, START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0400 - * @tc.name : 004.start -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0500 - * @tc.name : 005.flush -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0600 - * @tc.name : 006.stop -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, START_ERROR, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0800 - * @tc.name : 008.reset -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0100 - * @tc.name : 001.create -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0100.es'; - let mySteps = new Array(FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0200.es'; - let mySteps = new Array(CONFIGURE, FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0400 - * @tc.name : 004.start -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, FLUSH, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0100 - * @tc.name : 001.create -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0100.es'; - let mySteps = new Array(STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0200.es'; - let mySteps = new Array(CONFIGURE, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0400 - * @tc.name : 004.start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, STOP, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0100 - * @tc.name : 001.create -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0100.es'; - let mySteps = new Array(RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0200.es'; - let mySteps = new Array(CONFIGURE, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0400 - * @tc.name : 004.start -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_CALLBACK_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0100.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, STOP, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0200.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, END); - EOSFrameNum = 2; - flushAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, CONFIGURE, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_CALLBACK_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, STOP, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js deleted file mode 100644 index 3d2f5133f0e6bcef695972b0d3150941f2503d9a..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js +++ /dev/null @@ -1,1173 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('AudioEncoderReliabilityPromise', function () { - const AUDIOPATH = 'S16LE.pcm'; - const BASIC_PATH = 'results/encode_reliability_promise_'; - const END = 0; - const CONFIGURE = 1; - const PREPARE = 2; - const START = 3; - const FLUSH = 4; - const STOP = 5; - const RESET = 6; - const HOLDON = 7; - const WAITFORALLOUTS = 8; - const CONFIGURE_ERROR = 9; - const PREPARE_ERROR = 10; - const START_ERROR = 11; - const FLUSH_ERROR = 12; - const STOP_ERROR = 13; - const JUDGE_EOS = 14; - const WAITTIME = 3000; - let audioEncodeProcessor; - let readStreamSync; - let EOSFrameNum = 0; - let flushAtEOS = false; - let workdoneAtEOS = false; - let needGetMediaDes = false; - let needRelease = false; - let frameCnt = 1; - let timestamp = 0; - let sawInputEOS = false; - let sawOutputEOS = false; - let inputQueue = []; - let outputQueue = []; - const ES_SIZE = [0, 4096]; - let ES_LENGTH = 200; - let mime = 'audio/mp4a-latm'; - let mediaDescription = { - "channel_count": 2, - "sample_rate": 44100, - "audio_sample_format": 1, - }; - let expectError = false; - let fdRead; - let lockFlag = false; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - audioEncodeProcessor = null; - readStreamSync = undefined; - EOSFrameNum = 0; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needRelease = false - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - ES_LENGTH = 200; - expectError = false; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (audioEncodeProcessor != null) { - await audioEncodeProcessor.release().then(() => { - console.info('audioEncodeProcessor release success'); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCallbackTrue = function(err, mySteps, done) { - console.info('case callback err : ' + err); - expect(err != undefined).assertTrue(); - nextStep(mySteps, done); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - readStreamSync = undefined; - EOSFrameNum = 0; - flushAtEOS = false; - workdoneAtEOS = false; - needGetMediaDes = false; - needRelease = false - frameCnt = 1; - timestamp = 0; - sawInputEOS = false; - sawOutputEOS = false; - inputQueue = []; - outputQueue = []; - lockFlag = false; - } - - async function createAudioEncoder(savepath, mySteps, done) { - await getFdRead(AUDIOPATH, done); - media.createAudioEncoderByMime(mime).then((processor) => { - console.info(`case createAudioEncoder 1`); - audioEncodeProcessor = processor; - setCallback(savepath, done); - console.info("case start api test"); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('read file start execution'); - try{ - console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - async function doneWork() { - await audioEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - resetParam(); - await audioEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - audioEncodeProcessor = null; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now();Date.now() - t <= time;); - } - - async function nextStep(mySteps, done) { - console.info("case myStep[0]: " + mySteps[0]); - if (mySteps[0] == END) { - await audioEncodeProcessor.release().then(() => { - console.info("case release success"); - audioEncodeProcessor = null; - done(); - }, failCallback).catch(failCatch); - } - switch (mySteps[0]) { - case CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - await audioEncodeProcessor.prepare().then(() => { - console.info(`case prepare 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case START: - mySteps.shift(); - console.info(`case to start`); - if (sawOutputEOS) { - resetParam(); - await getFdRead(AUDIOPATH, done); - workdoneAtEOS = true; - enqueueInputs(inputQueue); - } - await audioEncodeProcessor.start().then(() => { - console.info(`case start 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case FLUSH: - mySteps.shift(); - console.info(`case to flush`); - lockFlag = true; - inputQueue = []; - outputQueue = []; - await audioEncodeProcessor.flush().then(async() => { - console.info(`case flush 1`); - if (flushAtEOS) { - await getFdRead(AUDIOPATH, done); - resetParam(); - workdoneAtEOS = true; - flushAtEOS = false; - } - lockFlag = false; - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case STOP: - mySteps.shift(); - console.info(`case to stop`); - await audioEncodeProcessor.stop().then(() => { - console.info(`case stop 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case RESET: - mySteps.shift(); - console.info(`case to reset`); - resetParam(); - await audioEncodeProcessor.reset().then(() => { - console.info(`case reset 1`); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - break; - case HOLDON: - mySteps.shift(); - setTimeout(() =>{ - nextStep(mySteps, done); - }, WAITTIME); - break; - case WAITFORALLOUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - case CONFIGURE_ERROR: - mySteps.shift(); - console.info(`case to configure 2`); - await audioEncodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case PREPARE_ERROR: - mySteps.shift(); - console.info(`case to prepare 2`); - await audioEncodeProcessor.prepare().then(() => { - console.info(`case prepare error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case START_ERROR: - mySteps.shift(); - console.info(`case to start 2`); - await audioEncodeProcessor.start().then(() => { - console.info(`case start error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case FLUSH_ERROR: - mySteps.shift(); - console.info(`case to flush 2`); - await audioEncodeProcessor.flush().then(() => { - console.info(`case flush error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case STOP_ERROR: - mySteps.shift(); - console.info(`case to stop 2`); - await audioEncodeProcessor.stop().then(() => { - console.info(`case stop error 1`); - expect(expectError).assertTrue(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - break; - case JUDGE_EOS: - mySteps.shift(); - console.info(`case judge EOS state`); - expect(sawOutputEOS).assertTrue(); - nextStep(mySteps, done); - break; - default: - break; - } - } - - async function enqueueInputs(queue) { - while (queue.length > 0 && !sawInputEOS) { - let inputobject = queue.shift(); - console.info("case frameCnt:" + frameCnt); - if (frameCnt == EOSFrameNum || frameCnt == ES_LENGTH + 1) { - console.info("case EOS frame seperately") - inputobject.flags = 1; - inputobject.timeMs = 0; - inputobject.length = 0; - sawInputEOS = true; - } else { - console.info("case read frame from file"); - inputobject.timeMs = timestamp; - inputobject.offset = 0; - inputobject.length = ES_SIZE[1]; - getContent(inputobject.data, ES_SIZE[1]); - inputobject.flags = 0; - } - timestamp += 23; - frameCnt += 1; - audioEncodeProcessor.pushInputData(inputobject).then(() => { - console.info('case queueInput success'); - }); - } - } - - async function dequeueOutputs(queue, savepath, done) { - while (queue.length > 0 && !sawOutputEOS) { - let outputobject = queue.shift(); - if (outputobject.flags == 1) { - sawOutputEOS = true; - if (workdoneAtEOS) { - await doneWork(); - done(); - } else { - console.info('sawOutputEOS = true'); - } - } - else{ - console.info("not last frame, continue"); - } - audioEncodeProcessor.freeOutputBuffer(outputobject).then(() => { - console.info('release output success'); - }); - } - } - - function setCallback(savepath, done) { - console.info('case callback'); - audioEncodeProcessor.on('needInputData', async(inBuffer) => { - console.info('inputBufferAvailable'); - inputQueue.push(inBuffer); - await enqueueInputs(inputQueue); - }); - audioEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - if (needGetMediaDes) { - audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes=false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - await dequeueOutputs(outputQueue, savepath, done); - }); - audioEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - audioEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0100 - * @tc.name : 001.create -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0100.es'; - let mySteps = new Array(CONFIGURE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0200.es'; - let mySteps = new Array(CONFIGURE, PREPARE, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0300 - * @tc.name : 003.start -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, CONFIGURE_ERROR, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0700.es'; - let mySteps = new Array(RESET, CONFIGURE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0800.es'; - let mySteps = new Array(CONFIGURE, CONFIGURE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_CONFIGURE_PROMISE_0900', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0900.es'; - let mySteps = new Array(CONFIGURE, RESET, CONFIGURE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0100.es'; - let mySteps = new Array(PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0200.es'; - let mySteps = new Array(CONFIGURE, PREPARE, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, PREPARE_ERROR, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_PREPARE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, PREPARE_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0100 - * @tc.name : 001.create -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0100.es'; - let mySteps = new Array(START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0200 - * @tc.name : 002.configure -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0200.es'; - let mySteps = new Array(CONFIGURE, START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0400 - * @tc.name : 004.start -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0500 - * @tc.name : 005.flush -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0600 - * @tc.name : 006.stop -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, START_ERROR, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0800 - * @tc.name : 008.reset -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_START_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, START_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0100 - * @tc.name : 001.create -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0100.es'; - let mySteps = new Array(FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0200.es'; - let mySteps = new Array(CONFIGURE, FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0400 - * @tc.name : 004.start -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, START, FLUSH, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP ,FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, FLUSH, START, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_FLUSH_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, FLUSH_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0100 - * @tc.name : 001.create -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0100.es'; - let mySteps = new Array(STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0200.es'; - let mySteps = new Array(CONFIGURE, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0400 - * @tc.name : 004.start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, STOP, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_STOP_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, STOP_ERROR, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0100 - * @tc.name : 001.create -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0100.es'; - let mySteps = new Array(RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0200.es'; - let mySteps = new Array(CONFIGURE, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0400 - * @tc.name : 004.start -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, FLUSH, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0600.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, STOP, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0700.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_RESET_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0800.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, RESET, RESET, END); - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0100.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, STOP, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0200.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, FLUSH, END); - EOSFrameNum = 2; - flushAtEOS = true; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0300.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, RESET, CONFIGURE, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0400.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_AUDIO_ENCODER_API_EOS_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0500.es'; - let mySteps = new Array(CONFIGURE, PREPARE, START, HOLDON, JUDGE_EOS, STOP, START, STOP, END); - EOSFrameNum = 2; - createAudioEncoder(savepath, mySteps, done); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/List.test.js deleted file mode 100644 index 45c9bbdb7815d5788ba5ae3c4b5496c95148a5cd..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/List.test.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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. - */ - -require('./AudioEncoderFuncCallbackTest.test.js') -require('./AudioEncoderFuncPromiseTest.test.js') -require('./AudioEncoderReliabilityCallbackTest.test.js') -require('./AudioEncoderReliabilityPromiseTest.test.js') -require('./AudioEncoderMultiInstancesTest.test.js') \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/audioEncoder/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40f7360d5d818998221b199d3ec0f69c0..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/audioEncoder/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/audioEncoder/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoCodecFormat/BUILD.gn b/multimedia/media/media_js_standard/videoCodecFormat/BUILD.gn deleted file mode 100644 index 0cf961bd699ffe9ffa960f4d416825f6619975d3..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# 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. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("video_codec_format_js_hap") { - hap_profile = "./src/main/config.json" - js2abc = true - deps = [ - ":video_codec_format_js_assets", - ":video_codec_format_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsVideoCodecFormatJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_player_framework" -} -ohos_js_assets("video_codec_format_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("video_codec_format_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/media/media_js_standard/videoCodecFormat/Test.json b/multimedia/media/media_js_standard/videoCodecFormat/Test.json deleted file mode 100644 index a0f6b4230d26934381e73e691b0248c1c5908a83..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/Test.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "description": "Configuration for video codec format Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "2000000", - "package": "ohos.acts.multimedia.video.codecformat", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsVideoCodecFormatJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "rm -rf /storage/media/100/local/files/*", - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/" - ], - "teardown-command":[ - ] - }, - { - "type": "PushKit", - "pre-push": [ - ], - "push": [ - "./resource/media/es/H264_BP_720_480_10_3000000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_BP_720_480_30_768000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_BP_720_480_30_2000000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_HP_352_288_30_3000000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_HP_640_480_30_3000000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_HP_720_480_25_3000000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_HP_720_480_30_3000000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_MP_720_480_30_64000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_MP_720_480_30_128000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_MP_720_480_30_192000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "./resource/media/es/H264_MP_720_480_30_384000.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/", - "chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.video.codecformat/haps/entry/files/*" - ], - "teardown-command":[ - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/videoCodecFormat/signature/openharmony_sx.p7b deleted file mode 100644 index b4cabd60c32a22e68621381d77cd2a8801120077..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoCodecFormat/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/config.json b/multimedia/media/media_js_standard/videoCodecFormat/src/main/config.json deleted file mode 100644 index ff7acc2a60d98b514b4693de405ebb61cea4f702..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/config.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.video.codecformat", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.video.codecformat.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "singleton" - } - ], - "deviceType": [ - "default", - "default", - "tablet", - "tv", - "wearable" - ], - "reqPermissions": [ - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.MEDIA_LOCATION", - "reason" : "use ohos.permission.MEDIA_LOCATION" - }, - { - "name" : "ohos.permission.READ_MEDIA", - "reason" : "use ohos.permission.READ_MEDIA" - }, - { - "name" : "ohos.permission.WRITE_MEDIA", - "reason" : "use ohos.permission.WRITE_MEDIA" - } - ], - "mainAbility": "ohos.acts.multimedia.video.codecformat.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.video.codecformat", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index", - "pages/display/display" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/app.js deleted file mode 100644 index 830070d196d86b127cea947d168bfd116f446205..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/i18n/en-US.json b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/i18n/zh-CN.json b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.css b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.css deleted file mode 100644 index c9195944a956c0d5628c701b7a3d9d2ed525cd2d..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.hml b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.hml deleted file mode 100644 index 9e58ed9e321b3f22e771122b4783b0f9f60cba2f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.hml +++ /dev/null @@ -1,26 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - - - - -
diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.js b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.js deleted file mode 100644 index 5d5b9ac7ed3e0c336cf20d8b7d2393877c91ebe5..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/display/display.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - console.info('onInit finish') - this.title = this.$t('strings.world'); - }, - onShow() { - }, - onReady() { - }, - LoadXcomponent() { - globalThis.value = this.$element('XcomponentId').getXComponentSurfaceId(); - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.css deleted file mode 100644 index c3517ad1592bddda252d0f8d5a736dd41181a026..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 8d0e2061b88c99c91488405f0f2ead0c77de1a9e..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.js deleted file mode 100644 index cfb5ff123bbbf4f57d7b111779e4b5f176a4bcec..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - console.info('onInit finish') - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 60000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/List.test.js deleted file mode 100644 index 276ecf1005009a4b7f4a171bf087219c42bd4d70..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/List.test.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -require('./VideoDecoderFormatPromiseTest.test.js') -require('./VideoEncoderFormatPromiseTest.test.js') diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/VideoDecoderFormatPromiseTest.test.js b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/VideoDecoderFormatPromiseTest.test.js deleted file mode 100644 index fc823a8c6c4b9bb9ce0f8fe3ee9feaa9e7b0619a..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/VideoDecoderFormatPromiseTest.test.js +++ /dev/null @@ -1,812 +0,0 @@ -/* - * 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 - * - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - - -describe('VideoDecoderFormatPromise', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let inputQueue = []; - let outputQueue = []; - let isCodecData = false; - let inputEosFlag = false; - let surfaceID = ''; - let fdRead; - let readPath; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - let ES_FRAME_SIZE = []; - const H264_HP_720_480_30_3000000 = - [728, 40437, 1906, 332, 1686, 2982, 757, 418, 429, 4448, 843, 502, 589, 8593, 1479, 755, 958, 4426, - 655, 7936, 1266, 871, 699, 9715, 1126, 806, 578, 7895, 1272, 825, 821, 11842, 1417, 801, 685, - 8102, 1147, 673, 517, 8747, 1488, 708, 774, 11322, 1788, 893, 851, 11258, 1920, 804, 893, 10941, - 1932, 1020, 1003, 10665, 2159, 926, 869, 12877, 2336, 956, 1116, 11833, 2313, 1261, 1117, 11244, - 2288, 1330, 1147, 11050, 2409, 1170, 1089, 12664, 2214, 1148, 1021, 10131, 2078, 1165, 1116, 10119, - 2029, 1109, 951, 9146, 2022, 1011, 968, 12018, 2155, 1210, 934, 10460, 1928, 1034, 1024, 9221, 1798, - 1119, 907, 11673, 2070, 996, 918, 8907, 1823, 947, 892, 9064, 1924, 853, 845, 9037, 1939, 962, 947, - 13892, 1813, 1003, 1100, 15610, 2047, 1014, 997, 7361, 1624, 726, 806, 8081, 1849, 879, 889, 11001, - 1805, 1111, 874, 8621, 1997, 817, 837, 10759, 2090, 809, 915, 7513, 1896, 754, 817, 13041, 2318, - 1086, 922, 9502, 1856, 1016, 846, 8742, 1765, 942, 882, 11996, 2094, 992, 1066, 11028, 2131, 892, - 922, 10127, 2008, 820, 775, 10027, 2072, 864, 827, 13105, 2045, 894, 908, 10002, 2012, 999, 947, - 11283, 2198, 1027, 1073, 13148, 2021, 1157, 1045, 14008, 1921, 1265, 892, 11677, 2206, 1059, 910, - 11252, 2166, 959, 987, 10932, 2306, 1000, 1052, 15844, 2812, 1460, 1220, 14077, 2599, 1270, 987, - 13004, 2780, 1028, 1073, 17485, 3059, 1061, 1281, 12442, 2763, 1050, 1066, 13364, 2980, 1040, 1058, - 13577, 3145, 1031, 1207, 20744, 3196, 1181, 1251, 15036, 3198, 1350, 1256, 13803, 3182, 1381, 1328, - 55738, 13170, 3310, 1203, 1416, 18895, 4845, 1459, 1566, 16371, 4074, 1545, 1404, 19016, 3848, 1722, - 1369, 21951, 4223, 1509, 1773, 19066, 4667, 1400, 1488, 17942, 4359, 1391, 1355, 18426, 4791, 1455, - 1532, 20372, 4725, 1585, 1538, 18356, 4784, 1793, 1821, 14652, 4161, 1794, 1705, 9162, 3985, 1780, - 1679, 4662, 1990]; - const H264_HP_640_480_30_3000000 = - [743, 63936, 4460, 396, 10897, 1792, 679, 940, 11454, 1710, 737, 1290, 17241, 3312, 1680, 1693, 11061, - 2780, 1453, 1302, 23837, 2632, 1282, 2176, 35973, 6681, 2633, 3444, 42011, 8777, 3216, 6874, 38772, - 8060, 3365, 4494, 35185, 8901, 3273, 4695, 33756, 8701, 3823, 5087, 38271, 9178, 4816, 6756, 36184, - 9334, 4563, 4805, 36973, 11092, 5606, 6194, 33918, 10006, 4902, 6477, 40721, 13116, 5890, 6768, 36257, - 12561, 5395, 6879, 35119, 11022, 5688, 5774, 34217, 10554, 4757, 6331, 35387, 12323, 5931, 6045, - 32344, 10362, 5022, 5825, 30627, 9493, 4649, 5483, 35773, 11762, 4427, 6933, 27406, 7668, 3767, 4399, - 30636, 9420, 4498, 4063, 29005, 8269, 3835, 4091, 32397, 8079, 4030, 5067, 26621, 4409, 2476, 27101, - 6079, 2597, 2357, 26866, 5981, 2970, 2901, 35881, 5607, 3052, 3172, 38951, 6441, 2768, 3087, 24246, - 5105, 2088, 2370, 25463, 5952, 2535, 2549, 31704, 5851, 3275, 2586, 28264, 6431, 2721, 2539, 32251, - 7212, 2727, 2885, 24577, 6191, 2510, 2781, 38290, 7584, 3358, 2696, 30966, 6312, 3219, 2801, 28991, - 5771, 2989, 2694, 35444, 7185, 3387, 3446, 33693, 7236, 3138, 3150, 32460, 6919, 3148, 2821, 32533, - 7376, 3380, 3241, 38535, 7123, 3545, 3315, 32887, 7049, 3637, 3335, 35576, 7974, 3661, 3797, 38577, - 7304, 3990, 3766, 41779, 7278, 4270, 3254, 37088, 7838, 3935, 3301, 35575, 7863, 3274, 3685, 34905, - 8328, 3706, 3880, 44228, 9725, 4943, 4088, 41434, 8537, 4344, 3415, 38094, 8691, 3707, 3624, 46871, - 9739, 3740, 4382, 36805, 8894, 3364, 3489, 38708, 9526, 3923, 3833, 38738, 10251, 4035, 3970, 52101, - 9865, 4296, 4306, 41157, 10454, 4493, 4141, 37595, 10394, 4305, 4464, 104472, 35250, 8448, 3308, 4712, - 44980, 12853, 4810, 4576, 41299, 10986, 4550, 4010, 45272, 11350, 4848, 3869, 50554, 11692, 4471, 5039, - 46210, 12196, 4929, 4757, 43445, 11696, 4745, 4387, 43209, 12442, 4849, 4662, 46742, 12373, 5002, 4550, - 42787, 12206, 5258, 4955, 35329, 11197, 5068, 4761, 23276, 10832, 4967, 4683, 11847, 5721]; - const H264_HP_352_288_30_3000000 = - [742, 36497, 5278, 212, 6150, 5552, 8919, 12122, 5996, 15180, 2588, 475, 830, 19788, 5367, 931, 2712, - 22962, 5980, 1420, 3952, 28389, 7696, 4122, 5502, 29632, 10135, 6434, 7119, 30403, 12246, 7684, - 6269, 27573, 5078, 26781, 6530, 2991, 2204, 27175, 11539, 6180, 5660, 30117, 9143, 7689, 7241, - 30681, 11321, 6951, 7532, 29027, 11887, 6534, 6894, 28780, 12298, 4863, 6583, 30142, 12234, 6025, - 6773, 29164, 12888, 8220, 6745, 28869, 12614, 8579, 7127, 28191, 11547, 7938, 6810, 29429, 11982, - 5941, 6362, 27297, 10981, 8020, 6912, 26342, 11157, 7225, 5811, 25430, 10934, 5939, 6450, 27865, - 10635, 7425, 5724, 25732, 10184, 6180, 5200, 26895, 9935, 6148, 5004, 27885, 11012, 6118, 5283, - 26388, 9679, 5465, 4702, 25873, 8785, 4146, 3926, 25744, 8620, 4436, 4397, 22665, 4487, 28251, - 12077, 5772, 4643, 30974, 10517, 4675, 3716, 26544, 10492, 4079, 4453, 29068, 12315, 4539, 5448, - 27197, 10351, 4325, 5139, 27197, 11107, 4856, 5021, 27573, 11015, 5506, 3668, 31021, 11234, 4444, - 5128, 27541, 10158, 4461, 4812, 27553, 10129, 4572, 4739, 27503, 10766, 4444, 5549, 29377, 11983, - 6007, 6116, 29258, 11378, 6150, 5993, 29260, 11518, 6179, 5677, 28332, 11544, 6257, 6051, 30606, - 12887, 7401, 6438, 28131, 12275, 6542, 6759, 30492, 13558, 7399, 6868, 32975, 14744, 7528, 8233, - 29525, 12300, 6482, 7367, 29630, 12717, 7198, 6864, 28971, 12234, 7058, 7117, 32200, 13661, 7122, - 7684, 30213, 12982, 7067, 6718, 31374, 13440, 6318, 5720, 30542, 12722, 5390, 5823, 32150, 13747, - 5847, 4949, 30227, 13087, 4889, 6989, 31044, 13790, 6614, 7787, 31120, 14286, 7850, 8052, 34565, - 16446, 9818, 8794, 30881, 14559, 8200, 7963, 16479, 7882, 58919, 28702, 13492, 6564, 7880, 33011, - 14889, 8653, 8195, 32121, 13675, 7376, 6760, 32498, 14412, 7331, 7701, 34309, 14522, 8507, 8905, - 32786, 14655, 9382, 9863, 31939, 14323, 9314, 9444, 31232, 14584, 9551, 9587, 32446, 14877, 9517, - 9745, 31232, 15121, 9074, 8991, 28188, 14357, 8382, 8945, 21889, 14254, 8563, 8656, 14054, 9237]; - const H264_HP_720_480_25_3000000 = - [743, 60211, 13239, 2404, 721, 583, 15194, 3156, 698, 1305, 19512, 4168, 2265, 1964, 5082, 836, 23296, - 2413, 1066, 2395, 45168, 8091, 2133, 3059, 51275, 10454, 1989, 1667, 50231, 11000, 6240, 2852, - 31581, 6058, 5392, 1839, 50092, 8396, 1985, 8991, 33764, 5318, 1928, 26902, 5189, 2134, 47829, - 10578, 2229, 10068, 60009, 23327, 7081, 12297, 45044, 15151, 2740, 3803, 46563, 16209, 9797, 5845, - 44561, 8182, 12401, 2359, 45573, 12349, 2651, 9682, 43127, 15810, 5811, 9279, 43962, 14386, 2270, - 2632, 39471, 11830, 6869, 4661, 30940, 5559, 6094, 1824, 40202, 7871, 2183, 6841, 26306, 4385, 1941, - 32358, 10212, 3832, 5078, 38561, 14111, 4071, 2257, 42239, 16583, 2551, 3728, 49743, 16669, 7062, - 3694, 18227, 4029, 1618, 1600, 25356, 4526, 1801, 40613, 10173, 1883, 7923, 40666, 11985, 4629, 7445, - 46053, 13073, 1829, 2126, 42021, 11787, 8567, 4217, 32222, 6250, 5758, 2011, 48044, 9596, 2247, 10336, - 33612, 4829, 1979, 45756, 15151, 4731, 5700, 42536, 13382, 4085, 2116, 51106, 19127, 1966, 4540, 36989, - 11179, 5329, 4492, 28014, 4266, 2228, 1992, 30706, 4585, 1825, 45353, 9172, 2156, 7298, 32588, 5422, - 2087, 23603, 5832, 2136, 54917, 14394, 3006, 9240, 39316, 6710, 1825, 50371, 16490, 6229, 8822, 59214, - 21224, 6862, 2073, 32776, 1903, 52810, 17090, 6242, 9555, 52896, 21251, 6748, 2295, 62780, 28542, 2313, - 6233, 41294, 16753, 8849, 6811, 81209, 32379, 19115, 11043, 50019, 12939, 4210, 2401, 57348, 21554, - 9758, 9795, 56247, 20227, 7331, 4734, 63172, 28454, 2681, 10578, 51879, 15705, 10655, 8051, 41145, - 12054, 4073, 2301, 56660, 22137, 10170, 9181, 47945, 16788, 7329, 5933, 37066, 19820, 2623, 6587, - 12775, 7829, 74448]; - const H264_BP_720_480_10_3000000 = - [680, 126740, 23028, 17628, 34165, 50078, 53489, 50449, 51692, 51133, 49406, 61788, 57943, 19487, 39050, - 51366, 58590, 46431, 47553, 44008, 40903, 43186, 46840, 41363, 38577, 36246, 47333, 37886, 36028, - 32547, 34046, 42447, 29904, 31922, 32428, 33792, 35887, 29424, 29191, 32212, 28429, 39255, 26639, - 46125, 29321, 25941, 36184, 29629, 31368, 32575, 27336, 42706, 33502, 29499, 31225, 30249, 40616, - 34124, 35283, 33528, 36250, 38209, 35903, 34273, 38720, 39956, 47535, 38312, 38075, 34822, 38343, - 51007, 38141, 40807, 41597, 42305, 48904, 38583, 42058, 41818, 43584, 53600, 45287, 41925, 84667, - 43272, 50947, 51329, 42615, 55263, 44633, 59839, 48709, 52740, 44754, 51337, 47877, 49915, 40111, - 37680, 25386]; - const H264_BP_720_480_30_2000000 = - [680, 49724, 1285, 1261, 1708, 1747, 2620, 2662, 1490, 1779, 2361, 3189, 4068, 2004, 906, 3253, 5253, - 4275, 5281, 6861, 8592, 7656, 10797, 9571, 11650, 15580, 7380, 12554, 7993, 8004, 12172, 17409, - 8588, 7552, 12740, 9769, 9501, 5744, 6334, 8456, 7815, 9238, 9193, 7411, 9530, 8489, 13051, 8510, - 9198, 11093, 10317, 6356, 12730, 9230, 11289, 8106, 10540, 8782, 10877, 7584, 10706, 13111, 10250, - 10543, 13859, 6702, 9674, 9418, 11851, 7675, 10324, 8274, 10460, 6414, 11198, 7486, 14728, 7472, - 8481, 8262, 9580, 7510, 9418, 8441, 9051, 8178, 8906, 7224, 9435, 7386, 8289, 14392, 8568, 5416, - 7530, 6513, 10988, 7935, 6047, 6952, 9597, 7051, 6756, 6254, 9586, 6145, 12074, 6462, 7193, 5281, - 9665, 6277, 8296, 5740, 8345, 5904, 9326, 6029, 7547, 5725, 8113, 16515, 6141, 4945, 7807, 4278, - 20449, 5011, 5539, 6759, 6707, 6500, 6322, 6935, 7172, 6970, 11064, 6268, 6409, 7461, 6162, 7159, - 7184, 7211, 6803, 8987, 9551, 7912, 5032, 8016, 5218, 16041, 7563, 8061, 6689, 8839, 7014, 8217, - 6664, 8307, 6154, 8126, 5474, 6795, 6740, 8027, 11368, 8868, 6207, 8343, 9793, 9689, 5711, 9753, - 6156, 9720, 6010, 9767, 6680, 8312, 6426, 15208, 6078, 8184, 7522, 9259, 6684, 8617, 7536, 9989, - 8981, 7948, 10001, 12890, 7360, 6745, 15933, 7280, 7910, 9347, 7600, 9639, 9134, 6721, 9088, 8114, - 9831, 7774, 8513, 8648, 9059, 15029, 10979, 8706, 10016, 7460, 10915, 12219, 9660, 7793, 11334, 8018, - 11665, 7278, 11586, 9058, 16880, 7223, 9440, 9107, 11077, 9344, 9383, 8555, 11157, 8415, 9976, 9098, - 11488, 9006, 10534, 22505, 8890, 9126, 11692, 9655, 11609, 8359, 10764, 9269, 10429, 72196, 5123, 7357, - 12030, 9882, 17039, 7044, 13383, 9575, 12643, 8266, 12365, 8596, 11837, 14485, 10228, 9531, 11412, - 8195, 11795, 17081, 13839, 8466, 14967, 11254, 12838, 8544, 14473, 9963, 13612, 8580, 14640, 10393, - 12139, 8665, 18055, 8449, 11454, 7941, 13955, 10724, 10074, 8741, 9950, 9508, 7961, 6732, 6925, 6344, - 4010, 4664]; - const H264_BP_720_480_30_768000 = - [679, 24012, 438, 391, 520, 539, 689, 718, 475, 533, 657, 898, 1072, 668, 423, 514, 712, 879, 1250, 1706, - 2620, 2480, 3922, 3336, 4092, 5666, 2934, 4643, 3587, 3285, 5005, 5732, 3112, 2701, 4596, 3333, 3211, - 2030, 2159, 2591, 2459, 2981, 3000, 2343, 2940, 2811, 4875, 2882, 3460, 4231, 3988, 2636, 4753, 3482, - 4578, 3051, 4091, 3497, 4109, 2987, 4145, 4737, 4048, 3943, 5325, 2591, 3631, 3377, 4414, 3076, 4151, - 3234, 3676, 2499, 4222, 2547, 5258, 2929, 3159, 3028, 3700, 2979, 3456, 3219, 3348, 3151, 3539, 2753, - 3511, 3010, 3211, 5316, 3637, 2234, 2955, 2566, 4239, 3261, 2364, 2795, 3936, 2919, 2699, 2625, 3824, - 2281, 4868, 2599, 2993, 2087, 4001, 2523, 3360, 2197, 3408, 2272, 3739, 2423, 2871, 2269, 3023, 6413, - 2863, 1839, 2812, 1853, 8341, 2240, 2453, 2606, 2736, 2536, 2576, 2686, 2664, 2588, 3946, 2681, 2467, - 2654, 2463, 2734, 2822, 2656, 2618, 3509, 3668, 2991, 1972, 3093, 1996, 5495, 3447, 3320, 2681, 3466, - 2565, 3449, 2516, 3108, 2191, 3335, 2203, 2608, 2370, 2967, 4195, 3429, 2405, 3295, 3669, 3909, 2189, - 3790, 2563, 3711, 2355, 3885, 2493, 3004, 2375, 5746, 2367, 3156, 2912, 3823, 2519, 3251, 2768, 4080, - 3354, 2974, 3500, 5067, 2947, 2663, 5328, 3321, 3001, 3663, 2865, 3783, 3525, 2530, 3536, 3129, 4080, - 2906, 3327, 3325, 3463, 5093, 4389, 3257, 3975, 2801, 4020, 4622, 3750, 2885, 4318, 2920, 4509, 2675, - 4512, 3333, 6607, 2841, 3760, 3454, 4273, 3588, 3777, 3264, 4352, 3100, 3978, 3449, 4367, 3266, 3707, - 8386, 3680, 3443, 4691, 3708, 4481, 2777, 3951, 3540, 3899, 42203, 1407, 3017, 4043, 2997, 5491, 2550, - 4857, 3142, 4463, 3081, 4083, 2731, 3937, 4763, 3590, 3293, 3972, 2917, 3971, 5633, 4970, 3350, 5260, - 3999, 4581, 3386, 4779, 3462, 4743, 3379, 5042, 3641, 4177, 3326, 6202, 3249, 4218, 2917, 4868, 3915, - 3813, 3443, 3700, 3353, 3119, 2587, 2638, 2157, 1606, 1572]; - const H264_MP_720_480_30_384000 = - [739, 13489, 299, 105, 269, 439, 288, 164, 157, 579, 305, 190, 212, 393, 311, 239, 213, 322, 147, 689, - 308, 186, 185, 2657, 331, 294, 260, 4683, 342, 257, 339, 5843, 412, 351, 327, 3954, 480, 427, 321, - 3595, 662, 445, 432, 3926, 653, 520, 416, 2951, 461, 5036, 850, 503, 523, 4673, 903, 559, 501, 4882, - 977, 522, 581, 6158, 1129, 634, 617, 4693, 933, 598, 617, 4478, 944, 571, 609, 5104, 926, 520, 546, - 3934, 941, 533, 559, 4243, 905, 575, 580, 4085, 916, 518, 508, 5300, 908, 513, 563, 4076, 874, 484, - 469, 4152, 890, 467, 494, 3842, 861, 465, 504, 3748, 776, 469, 455, 2958, 432, 4066, 770, 454, 422, - 4137, 816, 495, 446, 5667, 814, 525, 506, 6038, 888, 532, 448, 3501, 782, 472, 438, 3709, 901, 484, - 470, 4257, 849, 552, 450, 3888, 928, 499, 457, 4742, 899, 506, 433, 3498, 876, 441, 422, 5571, 963, - 541, 453, 4315, 831, 547, 426, 4093, 773, 525, 470, 4960, 852, 515, 446, 4933, 940, 511, 476, 4483, - 890, 474, 478, 4539, 900, 507, 488, 5386, 878, 498, 483, 4650, 879, 531, 467, 5244, 961, 520, 508, - 5511, 882, 611, 541, 5619, 829, 624, 528, 5490, 949, 553, 503, 5009, 954, 545, 541, 4856, 978, 568, - 553, 6329, 1067, 663, 577, 5621, 969, 621, 503, 5643, 1093, 576, 547, 7022, 1170, 589, 578, 5031, - 1084, 599, 541, 5343, 1149, 624, 606, 5230, 1209, 597, 604, 3500, 621, 6934, 1569, 650, 641, 5236, - 1282, 656, 622, 3793, 602, 32774, 3475, 1077, 577, 696, 5238, 1493, 680, 658, 4734, 1343, 738, 638, - 4983, 1273, 680, 621, 5450, 1210, 658, 642, 5555, 1345, 669, 658, 4918, 1322, 692, 632, 5199, 1396, - 686, 600, 5294, 1266, 701, 621, 5074, 1477, 728, 656, 4218, 1260, 720, 641, 2575, 1265, 652, 650, - 1203, 719]; - const H264_MP_720_480_30_192000 = - [739, 6283, 234, 71, 152, 264, 151, 111, 110, 301, 173, 121, 116, 208, 152, 111, 142, 183, 100, 348, 170, - 89, 88, 868, 203, 169, 189, 1798, 203, 183, 179, 2721, 251, 183, 218, 2212, 307, 297, 250, 1943, 371, - 335, 291, 1670, 421, 354, 282, 1345, 304, 2140, 458, 364, 300, 1976, 494, 400, 292, 2106, 542, 381, - 375, 2702, 553, 459, 370, 2166, 518, 404, 412, 2091, 530, 391, 371, 2260, 537, 335, 319, 1798, 537, - 357, 348, 1907, 521, 439, 350, 1892, 555, 407, 338, 2320, 489, 364, 351, 1880, 488, 350, 320, 1905, - 520, 306, 300, 1740, 501, 326, 317, 1583, 462, 340, 282, 1318, 308, 1920, 443, 310, 273, 1914, 467, - 306, 291, 2271, 430, 312, 282, 2332, 467, 314, 255, 1634, 499, 287, 247, 1802, 491, 304, 281, 1856, - 506, 327, 282, 1855, 523, 341, 279, 2064, 481, 345, 293, 1590, 499, 287, 279, 2466, 542, 346, 274, - 1990, 487, 345, 239, 1739, 471, 308, 272, 2023, 480, 322, 262, 2145, 480, 327, 304, 2069, 505, 333, - 308, 2114, 598, 336, 288, 2224, 506, 370, 313, 2117, 487, 360, 296, 2271, 503, 362, 333, 2393, 569, - 359, 316, 2509, 470, 384, 315, 2321, 541, 379, 337, 2269, 514, 376, 319, 2170, 573, 373, 361, 2700, - 632, 456, 369, 2516, 527, 398, 325, 2546, 551, 392, 351, 2956, 614, 383, 345, 2256, 582, 365, 327, - 2359, 597, 408, 368, 2327, 632, 394, 339, 1651, 343, 2955, 651, 462, 391, 2324, 646, 450, 360, 1619, - 392, 18036, 1446, 540, 366, 434, 2109, 757, 454, 421, 2099, 773, 429, 362, 1903, 659, 437, 368, 2238, - 682, 395, 385, 2287, 698, 430, 376, 2023, 696, 405, 365, 2033, 686, 441, 363, 2042, 670, 431, 373, - 2239, 731, 404, 392, 1888, 682, 417, 395, 1345, 644, 409, 392, 648, 398]; - const H264_MP_720_480_30_128000 = - [739, 3759, 141, 53, 88, 193, 97, 97, 42, 217, 120, 53, 85, 156, 159, 103, 62, 137, 48, 274, 143, 81, 103, - 541, 144, 141, 132, 1026, 160, 110, 134, 1746, 170, 164, 172, 1435, 221, 244, 181, 1335, 273, 267, - 186, 1060, 315, 312, 221, 897, 263, 1298, 379, 280, 219, 1171, 356, 302, 200, 1365, 404, 309, 258, - 1666, 442, 343, 276, 1393, 418, 274, 256, 1342, 424, 278, 267, 1291, 383, 288, 225, 1197, 408, 262, - 270, 1205, 413, 309, 275, 1269, 417, 286, 263, 1378, 359, 291, 243, 1224, 350, 253, 208, 1243, 354, - 244, 226, 1263, 402, 233, 223, 988, 318, 232, 169, 893, 216, 1158, 324, 221, 172, 1255, 303, 219, 192, - 1415, 285, 232, 194, 1363, 312, 241, 162, 1066, 345, 211, 182, 1094, 373, 215, 198, 1231, 353, 238, - 206, 1286, 363, 227, 221, 1322, 335, 265, 209, 944, 309, 200, 199, 1369, 318, 278, 191, 1210, 297, 234, - 161, 1202, 298, 201, 184, 1255, 334, 251, 223, 1444, 371, 235, 249, 1261, 359, 256, 233, 1399, 384, - 241, 237, 1287, 371, 260, 261, 1302, 346, 261, 232, 1366, 406, 274, 231, 1487, 396, 287, 235, 1387, - 331, 277, 224, 1460, 353, 283, 221, 1298, 365, 262, 257, 1342, 408, 289, 247, 1510, 440, 331, 258, - 1493, 371, 296, 256, 1517, 390, 286, 252, 1758, 393, 297, 230, 1411, 412, 264, 224, 1453, 437, 313, - 299, 1524, 430, 287, 269, 1064, 261, 1805, 455, 325, 296, 1403, 451, 312, 269, 1026, 284, 11888, 975, - 392, 270, 325, 1332, 482, 328, 301, 1248, 506, 298, 259, 1227, 445, 292, 264, 1289, 466, 330, 278, - 1391, 419, 322, 289, 1275, 468, 321, 320, 1283, 505, 335, 300, 1281, 452, 336, 296, 1335, 517, 350, - 314, 1139, 480, 317, 287, 882, 495, 316, 307, 495, 340]; - const H264_MP_720_480_30_64000 = - [738, 1462, 127, 49, 40, 128, 71, 40, 27, 138, 46, 25, 30, 166, 67, 38, 30, 130, 30, 166, 61, 31, 36, 201, - 100, 35, 38, 308, 113, 76, 58, 456, 150, 107, 117, 606, 190, 138, 123, 724, 222, 180, 121, 637, 273, - 168, 159, 493, 138, 585, 215, 190, 151, 567, 168, 202, 156, 586, 259, 186, 171, 645, 283, 202, 181, - 660, 279, 196, 148, 646, 290, 165, 161, 621, 251, 177, 151, 563, 254, 171, 128, 579, 246, 150, 123, - 543, 207, 144, 132, 599, 226, 130, 106, 534, 183, 118, 103, 604, 198, 109, 81, 664, 185, 117, 74, 480, - 179, 118, 43, 407, 114, 535, 171, 95, 61, 565, 155, 80, 54, 620, 152, 88, 71, 651, 151, 124, 62, 585, - 162, 74, 50, 561, 161, 107, 73, 625, 185, 131, 74, 633, 151, 117, 45, 594, 178, 135, 60, 525, 158, 108, - 65, 716, 184, 118, 49, 630, 147, 103, 50, 531, 146, 82, 63, 588, 207, 132, 59, 660, 201, 104, 79, 617, - 226, 130, 126, 614, 215, 97, 102, 656, 184, 131, 105, 646, 233, 133, 110, 633, 209, 141, 95, 684, 196, - 152, 100, 683, 180, 118, 107, 655, 201, 137, 69, 546, 204, 135, 83, 687, 183, 146, 75, 692, 225, 179, - 84, 686, 216, 133, 123, 651, 224, 161, 121, 791, 203, 149, 113, 618, 202, 136, 121, 608, 231, 153, 127, - 656, 264, 161, 120, 528, 159, 763, 275, 173, 110, 686, 257, 180, 123, 486, 158, 5082, 460, 219, 173, - 160, 626, 252, 169, 153, 624, 220, 174, 135, 636, 243, 153, 151, 659, 288, 168, 147, 657, 293, 179, 152, - 650, 270, 174, 134, 649, 286, 178, 173, 609, 269, 192, 149, 635, 274, 177, 146, 570, 293, 173, 132, 513, - 259, 172, 131, 306, 167]; - - beforeAll(async function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = false; - inputEosFlag = false; - surfaceID = globalThis.value; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear(); - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - console.info("case start get content length is: " + len); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf,{length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(){ - console.info('in case: enqueueInputs in'); - while (inputQueue.length > 0 && !inputEosFlag) { - let inputObject = inputQueue.shift(); - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case: pushInputData success '); - }, failCallback).catch(failCatch); - } - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep){ - console.log('outputQueue.length:' + outputQueue.length); - while (outputQueue.length > 0){ - let outputObject = outputQueue.shift(); - if (outputObject.flags == 1) { - nextStep(); - return; - } - frameCountOut++; - await videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.log('in case: release output count:' + frameCountOut); - }, failCallback).catch(failCatch); - } - } - - async function toGetVideoDecoderCaps() { - await videoDecodeProcessor.getVideoDecoderCaps().then((videoCaps) => { - console.info("case get getVideoDecoderCaps success"); - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - }, failCallback).catch(failCatch); - } - - function setCallback(nextStep){ - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: needInputData inBuffer.index: '+ inBuffer.index); - inputQueue.push(inBuffer); - await enqueueInputs(); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: newOutputData outBuffer.index: '+ outBuffer.index); - outputQueue.push(outBuffer); - await dequeueOutputs(nextStep); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - console.info('in case: setCallback out'); - } - - eventEmitter.on('nextStep', async (done) => { - console.info('in case : nextStep success'); - await videoDecodeProcessor.stop().then(() => { - console.info('in case : stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('in case : reset success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.release().then(() => { - console.info('in case : release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - console.info('in case : done'); - done(); - }); - - function printfDescription(obj) { - for (let item in obj) { - let property = obj[item]; - console.info("AudioEncoder config is " + item + ":" + property); - } - } - - async function decoderSource(config, name, srcPath, done){ - let mediaDescription = config; - console.info('start test case'); - readPath = srcPath; - await getFdRead(readPath, done); - await media.createVideoDecoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByName success'); - } else { - console.info('in case : createVideoDecoderByName fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - - await toGetVideoDecoderCaps(); - - await videoDecodeProcessor.configure(mediaDescription).then(() =>{ - console.info('in case : configure success'); - }, failCallback).catch(failCatch); - - await videoDecodeProcessor.setOutputSurface(surfaceID, true).then(() => { - console.info('in case : setOutputSurface success. surfaceID ' + surfaceID); - }, failCallback).catch(failCatch); - - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - - await videoDecodeProcessor.prepare().then(() => { - console.info('in case : prepare success'); - }, failCallback).catch(failCatch); - - await videoDecodeProcessor.start().then(() => { - console.info('in case : start success'); - }, failCallback).catch(failCatch); - - await videoDecodeProcessor.getOutputMediaDescription().then((mediaDescription) => { - console.info("getOutputMediaDescription success"); - printfDescription(mediaDescription); - },failCallback).catch(failCatch); - - videoDecodeProcessor.on('error',(err) => { - console.info(`case error called,errName is ${err.name}`); - console.info(`case error called,errCode is ${err.code}`); - console.info(`case error called,errMessage is ${err.message}`); - expect().assertFail(); - done(); - }); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0100 - * @tc.name : 001.test h264 format-HP-resolution 720*480-frame rate 30FPS-bitrate 3000000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0100', 0, async function (done) { - console.info("case test h264 format-HP-resolution 720*480-frame rate 30FPS-bitrate 3000000bps"); - ES_FRAME_SIZE = H264_HP_720_480_30_3000000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_HP_720_480_30_3000000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 4, - "bitrate" : 3000000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0200 - * @tc.name : 001.test h264 format-HP-resolution 640*480-frame rate 30FPS-bitrate 3000000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0200', 0, async function (done) { - console.info("case test h264 format-HP-resolution 640*480-frame rate 30FPS-bitrate 3000000bps"); - ES_FRAME_SIZE = H264_HP_640_480_30_3000000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_HP_640_480_30_3000000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 640, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 4, - "bitrate" : 3000000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0300 - * @tc.name : 001.test h264 format-HP-resolution 352*288-frame rate 30FPS-bitrate 3000000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0300', 0, async function (done) { - console.info("case test h264 format-HP-resolution 352*288-frame rate 30FPS-bitrate 3000000bps"); - ES_FRAME_SIZE = H264_HP_352_288_30_3000000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_HP_352_288_30_3000000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 352, - "height": 288, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 4, - "bitrate" : 3000000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0400 - * @tc.name : 001.test h264 format-HP-resolution 720*480-frame rate 25FPS-bitrate 3000000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0400', 0, async function (done) { - console.info("case test h264 format-HP-resolution 720*480-frame rate 25FPS-bitrate 3000000bps"); - ES_FRAME_SIZE = H264_HP_720_480_25_3000000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_HP_720_480_25_3000000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 25.00, - "max_input_size": 150000, - "codec_profile" : 4, - "bitrate" : 3000000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0500 - * @tc.name : 001.test h264 format-BP-resolution 720*480-frame rate 10FPS-bitrate 3000000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0500', 0, async function (done) { - console.info("case test h264 format-BP-resolution 720*480-frame rate 10FPS-bitrate 3000000bps"); - ES_FRAME_SIZE = H264_BP_720_480_10_3000000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_BP_720_480_10_3000000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 10.00, - "max_input_size": 150000, - "codec_profile" : 0, - "bitrate" : 3000000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0600 - * @tc.name : 001.test h264 format-BP-resolution 720*480-frame rate 30FPS-bitrate 2000000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0600', 0, async function (done) { - console.info("case test h264 format-BP-resolution 720*480-frame rate 30FPS-bitrate 2000000bps"); - ES_FRAME_SIZE = H264_BP_720_480_30_2000000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_BP_720_480_30_2000000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 0, - "bitrate" : 2000000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0700 - * @tc.name : 001.test h264 format-BP-resolution 720*480-frame rate 30FPS-bitrate 768000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0700', 0, async function (done) { - console.info("case test h264 format-BP-resolution 720*480-frame rate 30FPS-bitrate 768000bps"); - ES_FRAME_SIZE = H264_BP_720_480_30_768000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_BP_720_480_30_768000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 0, - "bitrate" : 768000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0800 - * @tc.name : 001.test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 384000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0800', 0, async function (done) { - console.info("case test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 384000bps"); - ES_FRAME_SIZE = H264_MP_720_480_30_384000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_MP_720_480_30_384000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 8, - "bitrate" : 384000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0900 - * @tc.name : 001.test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 192000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_0900', 0, async function (done) { - console.info("case test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 192000bps"); - ES_FRAME_SIZE = H264_MP_720_480_30_192000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_MP_720_480_30_192000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 8, - "bitrate" : 192000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_1000 - * @tc.name : 001.test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 128000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_1000', 0, async function (done) { - console.info("case test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 128000bps"); - ES_FRAME_SIZE = H264_MP_720_480_30_128000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_MP_720_480_30_128000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 8, - "bitrate" : 128000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_1100 - * @tc.name : 001.test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 64000bps - * @tc.desc : video decoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_SOFTWARE_FORMAT_H264_PROMISE_1100', 0, async function (done) { - console.info("case test h264 format-MP-resolution 720*480-frame rate 30FPS-bitrate 64000bps"); - ES_FRAME_SIZE = H264_MP_720_480_30_64000; - let name = "avdec_h264"; - isCodecData = true; - let srcPath = 'H264_MP_720_480_30_64000.h264'; - let mediaDescription = { - "track_type": 1, - "codec_mime": 'video/avc', - "width": 720, - "height": 480, - "pixel_format": 3, - "frame_rate": 30.00, - "max_input_size": 150000, - "codec_profile" : 8, - "bitrate" : 64000, - } - - await decoderSource(mediaDescription, name, srcPath, done); - }) - -}) - diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/VideoEncoderFormatPromiseTest.test.js b/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/VideoEncoderFormatPromiseTest.test.js deleted file mode 100644 index 5cb9c658a037c64fd5aa926f925e3ae6370093bc..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/js/test/VideoEncoderFormatPromiseTest.test.js +++ /dev/null @@ -1,447 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import mediademo from '@ohos.multimedia.mediademo' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import * as mediaTestBase from '../../../../../MediaTestBase.js' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('VideoEncoderFormatPromise', function () { - let videoEncodeProcessor; - let mediaTest; - let surfaceID = ''; - let outputQueue = []; - let outputCnt = 0; - let frameTotal = 100; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let sawOutputEOS = false; - let needGetMediaDes = false; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); - let fileKeyObj = mediaLibrary.FileKey; - - beforeAll(async function() { - console.info('beforeAll case 1'); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - let permissionNameList = [permissionName1, permissionName2, permissionName3]; - let appName = 'ohos.acts.multimedia.video.codecformat'; - await mediaTestBase.applyPermission(appName, permissionNameList); - console.info('beforeAll case after get permission'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - videoEncodeProcessor = null; - mediaTest = null; - surfaceID = ''; - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null){ - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - await closeFdWrite(); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - } - - async function getFdWrite(pathName) { - console.info('[mediaLibrary] case start getFdWrite'); - console.info('[mediaLibrary] case getFdWrite pathName is ' + pathName); - let mediaType = mediaLibrary.MediaType.VIDEO; - console.info('[mediaLibrary] case mediaType is ' + mediaType); - let publicPath = await mediaLibraryTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); - console.info('[mediaLibrary] case getFdWrite publicPath is ' + publicPath); - let dataUri = await mediaLibraryTest.createAsset(mediaType, pathName, publicPath); - if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections : fileKeyObj.ID + "=?", - selectionArgs : [args], - } - let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); - console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset = await fetchWriteFileResult.getAllObject(); - console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fdWrite = await fileAsset[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); - } - } - - async function closeFdWrite() { - if (fileAsset != null) { - await fileAsset[0].close(fdWrite).then(() => { - console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); - }).catch((err) => { - console.info('[mediaLibrary] case close fdWrite failed'); - }); - } else { - console.info('[mediaLibrary] case fileAsset is null'); - } - } - - function writeFile(buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - async function dequeueOutputs(done) { - while (outputQueue.length > 0) { - let outputObject = outputQueue.shift(); - outputCnt += 1; - if (outputObject.flags == 1) { - console.info("last frame, make choice"); - mediaTest.closeStream(surfaceID); - sawOutputEOS = true; - if (stopAtEOS) { - await toStop(); - } else if (resetAtEOS) { - await toReset(); - } else if (flushAtEOS) { - await toFlush(); - } else { - await toReset(); - await toRelease(); - done(); - } - } else { - console.info('not last frame, write data to file'); - writeFile(outputObject.data, outputObject.length); - console.info("write to file success"); - videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('release output success'); - }); - } - } - } - - function setCallback(done) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('newOutputData'); - console.info('outBuffer.flags: ' + outBuffer.flags); - if (needGetMediaDes) { - videoEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes = false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - dequeueOutputs(done); - }); - - videoEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - async function printVideoCaps(videoCaps, width, height) { - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - await videoCaps.getPreferredFrameRate(width, height).then((valueRange) => { - console.info("case getPreferredFrameRate valueRange success"); - if (typeof (valueRange) != 'undefined') { - console.info('getPreferredFrameRate.min: ' + valueRange.min); - console.info('getPreferredFrameRate.max: ' + valueRange.max); - } else { - console.info('case getPreferredFrameRate valueRange is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - await videoCaps.getSupportedFrameRate(width, height).then((valueRange) => { - console.info("case getSupportedFrameRate valueRange success"); - if (typeof (valueRange) != 'undefined') { - console.info('getSupportedFrameRate.min: ' + valueRange.min); - console.info('getSupportedFrameRate.max: ' + valueRange.max); - } else { - console.info('case getSupportedFrameRate valueRange is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - await videoCaps.isSizeSupported(width, height).then((trueORfalse) => { - console.info("case isSizeSupported valueRange for width:" + width + ", height: " + height); - if (typeof (trueORfalse) != 'undefined') { - console.info('videoCaps.isSizeSupported: ' + trueORfalse); - } else { - console.info('case isSizeSupported is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - } - - function printfDescription(obj) { - for (let item in obj) { - let property = obj[item]; - console.info("AudioEncoder config is " + item + ":" + property); - } - } - - function toCreateStream() { - mediaTest = mediademo.createMediaTest(); - } - - function toSetStreamParam(width, height, framerate, frameTotal) { - console.info('case set stream parameter'); - mediaTest.setResolution(width, height); - mediaTest.setFrameRate(framerate); - mediaTest.setFrameCount(frameTotal); - } - - function toStartStream() { - console.info('case start stream'); - mediaTest.startStream(surfaceID); - } - - async function toFlush() { - outputQueue = []; - await videoEncodeProcessor.flush().then(() => { - console.info("case flush success"); - }, failCallback).catch(failCatch); - } - - async function toStop() { - await videoEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - } - - async function toReset() { - resetParam(); - await videoEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - } - - async function toRelease() { - resetParam(); - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - videoEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - - async function encodeSource(config, path, name, done){ - let mediaDescription = config; - await getFdWrite(path) - console.info('case getFdWrite success'); - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - },failCallback).catch(failCatch); - await videoEncodeProcessor.getVideoEncoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - printVideoCaps(videoCaps, mediaDescription.width, mediaDescription.height); - },failCallback).catch(failCatch); - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, mediaDescription.frame_rate, frameTotal); - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - setCallback(done); - await videoEncodeProcessor.getInputSurface().then((inputSurface) => { - expect(inputSurface != undefined).assertTrue(); - console.info('case getInputSurface success'); - surfaceID = inputSurface; - }, failCallback).catch(failCatch); - await videoEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - toStartStream(); - await videoEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.getOutputMediaDescription().then((mediaDescription) => { - console.info("getOutputMediaDescription success"); - printfDescription(mediaDescription); - },failCallback).catch(failCatch); - videoEncodeProcessor.on('error',(err) => { - console.info(`case error called,errName is ${err.name}`); - console.info(`case error called,errCode is ${err.code}`); - console.info(`case error called,errMessage is ${err.message}`); - expect().assertFail(); - done(); - }); - - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0100 - * @tc.name : 000.test MPEG4 format-resolution 640*480-frame rate 30 FPS - * @tc.desc : video encoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0100', 0, async function (done) { - console.info("case test MPEG4 format-resolution 640*480-frame rate 30 FPS"); - let savePath = 'rk_mpeg4_video_software_640_480_30.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - "codec_mime": 'video/mp4v-es', - "width": 640, - "height": 480, - "pixel_format": 3, - "frame_rate" : 30 - } - - await encodeSource(mediaDescription, savePath, name, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0200 - * @tc.name : 000.test MPEG4 format-resolution 352*288-frame rate 30 FPS - * @tc.desc : video encoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0200', 0, async function (done) { - console.info("case test MPEG4 format-resolution 352*288-frame rate 30 FPS"); - let savePath = 'rk_mpeg4_video_software_352_288_30.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - "codec_mime": 'video/mp4v-es', - "width": 352, - "height": 288, - "pixel_format": 3, - "frame_rate" : 30, - } - - await encodeSource(mediaDescription, savePath, name, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0300 - * @tc.name : 000.test MPEG4 format-resolution 640*480-frame rate 25 FPS - * @tc.desc : video encoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0300', 0, async function (done) { - console.info("case test MPEG4 format-resolution 640*480-frame rate 25 FPS"); - let savePath = 'rk_mpeg4_video_software_640_480_25.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - "codec_mime": 'video/mp4v-es', - "width": 640, - "height": 480, - "pixel_format": 3, - "frame_rate" : 25, - } - - await encodeSource(mediaDescription, savePath, name, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0400 - * @tc.name : 000.test MPEG4 format-resolution 640*480-frame rate 10 FPS - * @tc.desc : video encoder format compatibility test - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_ENCODER_SOFTWARE_FORMAT_MPEG4_PROMISE_0400', 0, async function (done) { - console.info("case test MPEG4 format-resolution 640*480-frame rate 10 FPS"); - let savePath = 'rk_mpeg4_video_software_640_480_10.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - "codec_mime": 'video/mp4v-es', - "width": 640, - "height": 480, - "pixel_format": 3, - "frame_rate" : 10, - } - - await encodeSource(mediaDescription, savePath, name, done); - }) - -}) - diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40f7360d5d818998221b199d3ec0f69c0..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/info.txt b/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/info.txt deleted file mode 100644 index 9632a32a7e0b92c0b921db34929e0f03c26a84df..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/info.txt +++ /dev/null @@ -1 +0,0 @@ -streamId:0 pts:0 pts_time:0.000000 size:197165 flag:1 \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/mp3_MP3.mp3 b/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/mp3_MP3.mp3 deleted file mode 100644 index 2ac11d0b213c4686d6138e4234054ca13a15c63d..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoCodecFormat/src/main/resources/base/media/mp3_MP3.mp3 and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoDecoder/BUILD.gn b/multimedia/media/media_js_standard/videoDecoder/BUILD.gn deleted file mode 100644 index cddb7a4fae764b0a2c9be2a3c3767c3b0c23e209..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# 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. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("video_decoder_js_hap") { - hap_profile = "./src/main/config.json" - js2abc = true - deps = [ - ":video_decoder_js_assets", - ":video_decoder_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsVideoDecoderJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_player_framework" -} -ohos_js_assets("video_decoder_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("video_decoder_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/media/media_js_standard/videoDecoder/Test.json b/multimedia/media/media_js_standard/videoDecoder/Test.json deleted file mode 100644 index 995cbe799876067fc2e8c9329a19cd2177d02f8b..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/Test.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "description": "Configuration for video decoder Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "2000000", - "package": "ohos.acts.multimedia.video.videodecoder", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsVideoDecoderJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "rm -rf /storage/media/100/local/files/*", - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/", - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/" - ], - "teardown-command":[ - ] - }, - { - "type": "PushKit", - "pre-push": [ - ], - "push": [ - "./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/", - "./resource/media/es/h263_1408_1152.es ->/data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/", - "./resource/media/es/MPEG2_720_480.es ->/data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/", - "./resource/media/es/mpeg4_320_240.es ->/data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/", - "./resource/media/es/out_320_240_10s.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/", - "chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.video.videodecoder/haps/entry/files/*" - ], - "teardown-command":[ - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/videoDecoder/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoDecoder/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/config.json b/multimedia/media/media_js_standard/videoDecoder/src/main/config.json deleted file mode 100644 index bd20539f5af03bd1460b0f67a67dac5da0b9174c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/config.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.video.videodecoder", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.video.videodecoder.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "singleton" - } - ], - "deviceType": [ - "default", - "default", - "tablet", - "tv", - "wearable" - ], - "mainAbility": "ohos.acts.multimedia.video.videodecoder.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.video.videodecoder", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index", - "pages/display/display" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js deleted file mode 100644 index 830070d196d86b127cea947d168bfd116f446205..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/i18n/en-US.json b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/i18n/zh-CN.json b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css deleted file mode 100644 index c9195944a956c0d5628c701b7a3d9d2ed525cd2d..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml deleted file mode 100644 index 9e58ed9e321b3f22e771122b4783b0f9f60cba2f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml +++ /dev/null @@ -1,26 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - - - - -
diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js deleted file mode 100644 index 5d5b9ac7ed3e0c336cf20d8b7d2393877c91ebe5..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - console.info('onInit finish') - this.title = this.$t('strings.world'); - }, - onShow() { - }, - onReady() { - }, - LoadXcomponent() { - globalThis.value = this.$element('XcomponentId').getXComponentSurfaceId(); - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css deleted file mode 100644 index c3517ad1592bddda252d0f8d5a736dd41181a026..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 8d0e2061b88c99c91488405f0f2ead0c77de1a9e..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js deleted file mode 100644 index cfb5ff123bbbf4f57d7b111779e4b5f176a4bcec..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - console.info('onInit finish') - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 60000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js deleted file mode 100644 index 41e919840738e68bb94baa10caf8e106c3b56abe..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -require('./VideoDecoderFuncCallbackTest.test.js') -require('./VideoDecoderFuncPromiseTest.test.js') -require('./VideoDecoderReliCallbackTest.test.js') -require('./VideoDecoderReliPromiseTest.test.js') -require('./VideoDecoderSoftwareFuncCallbackTest.test.js') -require('./VideoDecoderSoftwareFuncPromiseTest.test.js') -require('./VideoDecoderEnumTest.test.js') \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js deleted file mode 100644 index 335638a5e8e485a51a326d544f27a45e48788d06..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js +++ /dev/null @@ -1,338 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - - -describe('VideoDecoderEnum', function () { - let videoDecodeProcessor = null; - let videoPlayer = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let inputQueue = []; - let outputQueue = []; - let isCodecData = false; - let inputEosFlag = false; - let surfaceID = ''; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - let ES_FRAME_SIZE = []; - const H264_FRAME_SIZE_60FPS_320 = - [ 2106, 11465]; - let readpath; - let fdRead; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = false; - inputEosFlag = false; - surfaceID = globalThis.value; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - }) - - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.error('in case readFile' + e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - function getSurfaceID() { - let surfaceIDTest = new ArrayBuffer(20); - let readSurfaceID = fileio.createStreamSync('/data/media/surfaceID.txt', 'rb'); - readSurfaceID.readSync(surfaceIDTest, {length: 13}); - let view2 = new Uint8Array(surfaceIDTest); - for (let i = 0; i < 13; i++) { - let value = view2[i] - 48; - surfaceID = surfaceID + '' + value; - } - console.info('in case surfaceID ' + surfaceID); - readSurfaceID.closeSync(); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.info('in case: enqueueInputs in'); - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - if (frameCountIn == ES_FRAME_SIZE.length / 2) { - videoDecodeProcessor.setParameter({ - 'bitrate': 6400, - }).then(() => { - console.info('in case: setParameter success '); - }, failCallback).catch(failCatch); - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case: queueInput success '); - }, failCallback).catch(failCatch); - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject){ - if (outputObject.flags == 1) { - nextStep(); - return; - } - frameCountOut++; - await videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.log('in case: release output count:' + frameCountOut); - }, failCallback).catch(failCatch); - } - - function setCallback(nextStep){ - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - expect(inBuffer.index !== undefined).assertTrue(); - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - expect(inBuffer.data !== undefined).assertTrue(); - console.info('in case: inputBufferAvailable inBuffer.data: '+ inBuffer.data); - expect(inBuffer.offset !== undefined).assertTrue(); - console.info('in case: inputBufferAvailable inBuffer.offset: '+ inBuffer.offset); - expect(inBuffer.length !== undefined).assertTrue(); - console.info('in case: inputBufferAvailable inBuffer.length: '+ inBuffer.length); - expect(inBuffer.flags !== undefined).assertTrue(); - console.info('in case: inputBufferAvailable inBuffer.flags: '+ inBuffer.flags); - expect(inBuffer.timeMs !== undefined).assertTrue(); - console.info('in case: inputBufferAvailable inBuffer.timeMs: '+ inBuffer.timeMs); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - videoDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info('get outputMediaDescription : ' + MediaDescription); - }, failCallback).catch(failCatch); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - expect(err.code !== undefined).assertTrue(); - console.info('in case: err.code is ' + err.code); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - console.info('in case: setCallback out'); - } - - async function toCreateVideoDecoderByMime(mime, done) { - await media.createVideoDecoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByMime success'); - } else { - console.info('in case : createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - async function toGetVideoDecoderCaps() { - await videoDecodeProcessor.getVideoDecoderCaps().then((videoCaps) => { - console.info("case get getVideoDecoderCaps success"); - console.info("print videoCaps: " + videoCaps) - }, failCallback).catch(failCatch); - } - async function toCreateVideoDecoderByName(name, done) { - await media.createVideoDecoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByName success'); - } else { - console.info('in case : createVideoDecoderByName fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - async function toConfigure(mediaDescription, srcPath) { - await videoDecodeProcessor.configure(mediaDescription).then(() =>{ - console.info('in case : configure success'); - }, failCallback).catch(failCatch); - } - async function setSurfaceID(done) { - await media.createVideoPlayer().then((video) => { - if (typeof (video) != 'undefined') { - videoPlayer = video; - console.info('in case : createVideoPlayer success'); - } else { - expect().assertFail(); - console.info('in case error: createVideoPlayer fail'); - done(); - } - }, failCallback).catch(failCatch); - await videoPlayer.getDisplaySurface().then((surface) => { - console.info('in case : getDisplaySurface success and surfaceID is ' + surface); - surfaceID = surface; - }, failCallback).catch(failCatch); - } - async function toSetOutputSurface(isDisplay) { - await videoDecodeProcessor.setOutputSurface(surfaceID, isDisplay).then(() => { - console.info('in case : setOutputSurface success. surfaceID ' + surfaceID); - }, failCallback).catch(failCatch); - } - eventEmitter.on('nextStep', async (done) => { - console.info('in case : nextStep success'); - await videoDecodeProcessor.stop().then(() => { - console.info('in case : stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('in case : reset success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.release().then(() => { - console.info('in case : release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - console.info('in case : done'); - done(); - }); - async function toPrepare() { - await videoDecodeProcessor.prepare().then(() => { - console.info('in case : prepare success'); - }, failCallback).catch(failCatch); - } - async function toStart() { - await videoDecodeProcessor.start().then(() => { - console.info('in case : start success'); - }, failCallback).catch(failCatch); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CodecBuffer_0100 - * @tc.name : 001.CodecBuffer - * @tc.desc : Test Interface CodecBuffer - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CodecBuffer_0100', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await mediaTestBase.getFdRead(readpath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByMime('video/avc', done); - await toGetVideoDecoderCaps(); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js deleted file mode 100644 index 86d93447c517a7b335f71b8e9843d828a7c25be5..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js +++ /dev/null @@ -1,460 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('VideoDecoderFuncCallbackTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let inputQueue = []; - let outputQueue = []; - let isCodecData = false; - let inputEosFlag = false; - let surfaceID = ''; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; - const H263_FRAME_SIZE = - [ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244, - 5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165, - 24267, 36171, 18330, 53228, 7893, 13088, 9502, 8485, 9207, 8681, 9202, 8537, 7603, 9726, 8191, 51872, - 5535, 6146, 6341, 6933, 9365, 7828, 6547, 7638, 7009, 7025, 8873, 51045, 5056, 4858, 4887, 9614, 5953, - 5972, 6116, 6060, 6296, 6239, 6400, 50928, 4937, 5054, 5371, 6728, 6286, 6524, 6646, 6549, 6036, 6214, - 5866, 51109, 4778, 5273, 6327]; - const MPEG2_FRAME_SIZE = - [ 38462, 55096, 8660, 3417, 1197, 2209, 984, 718, 783, 623, 659, 694, 14174, 580, 421, 495, 480, 476, 534, - 660, 699, 601, 603, 720, 12585, 555, 532, 776, 789, 762, 766, 732, 671, 735, 777, 948, 12650, 827, 766, - 835, 747, 847, 940, 1121, 1092, 1001, 980, 989, 12746, 945, 912, 1046, 1118, 1134, 1050, 1073, 1051, 1195, - 1085, 1182, 12874, 992, 1007, 985, 1040, 1143, 1157, 1150, 1247, 1149, 1246, 1145, 12870, 1041, 1066, 1314, - 1239, 1283, 1223, 1224, 1270, 1427, 1406, 1516, 12949, 1228, 1299, 1439, 1358, 1455, 1311, 1396, 1416, 1470, - 1393, 1502, 12999, 1232, 1400, 1348, 1335, 1461, 1404, 1412, 1426, 1548, 1481, 1488, 12840, 1229, 1342, 1323, - 1353, 1524, 1363, 1475, 1540, 1495, 1489, 1438, 12762, 1291, 1303, 1470, 1494, 1488, 1474, 1453, 1607, 1485, - 1589, 1762, 12548, 1363, 1317, 1435, 1411, 1338, 1373, 1605, 1639, 1429, 1392, 1543, 12332, 1255, 1200, 1291, - 1337, 1341, 1356, 1214, 1456, 1353, 1314, 1502, 12151, 1192, 1290, 1203, 1284, 1154, 1264, 1358, 1390, 1433, - 1194, 1325, 11904, 993, 1007, 1149, 1099, 1182, 1076, 1074, 1092, 1030, 1272, 1178, 11710, 966, 879, 860, 955, - 898, 967, 927, 1066, 997, 1083, 940, 11717, 648, 705, 901, 925, 930, 868, 798, 846, 781, 825, 1027, 11587, 785, - 733, 731, 848, 753, 806, 699, 837, 750, 762, 748, 11541, 678, 742, 667, 735, 702, 837, 695, 773, 849, 869, 769, - 11381, 664, 705, 714, 698, 814, 846, 757, 802, 857, 905, 772, 11265, 718, 643, 597, 687, 774, 843, 747, 785, - 683, 1135, 676, 11259, 616, 595, 773, 746, 798, 722, 798, 790, 959, 771, 907, 11234, 705, 675, 773, 764, 846, - 789, 840, 853, 828, 774, 842, 11263, 758, 758, 757, 820, 847, 834, 884, 842, 988, 750, 952, 11236, 776, 640, 727, - 832, 855, 733, 822, 827, 862, 697, 924, 11176, 675, 615, 688, 818, 783, 746, 901, 834, 892, 759, 923, 11181, 661, - 578, 720, 697]; - const MPEG4_FRAME_SIZE = - [ 11895, 8109, 1578, 1616, 1313, 572, 805, 837, 755, 706, 952, 879, 13193, 422, 389, 509, 725, 465, 479, 959, - 677, 364, 541, 696, 9306, 322, 318, 767, 590, 422, 530, 403, 505, 566, 445, 508, 7783, 460, 405, 343, 451, - 608, 431, 411, 543, 487, 527, 400, 6287, 385, 418, 391, 592, 434, 412, 398, 504, 492, 479, 561, 5413, 317, - 355, 422, 467, 452, 476, 460, 490, 492, 485, 451, 5036, 312, 408, 460, 432, 502, 388, 475, 407, 544, 401, - 487, 4404, 362, 378, 427, 416, 426, 456, 414, 438, 424, 442, 444, 4310, 362, 388, 393, 390, 441, 398, 423, - 369, 443, 406, 392, 4231, 343, 363, 355, 390, 459, 371, 378, 381, 405, 392, 426, 3975, 387, 337, 393, 439, - 378, 355, 374, 484, 381, 373, 423, 3869, 312, 350, 400, 345, 356, 320, 473, 431, 386, 338, 431, 3426, 268, - 315, 416, 383, 373, 381, 354, 383, 328, 348, 418, 3715, 324, 361, 331, 350, 302, 409, 377, 359, 384, 334, - 326, 3439, 266, 324, 329, 353, 405, 303, 357, 332, 292, 361, 333, 3542, 294, 284, 247, 331, 306, 322, 287, - 367, 341, 276, 258, 3980, 246, 245, 259, 309, 333, 250, 275, 334, 281, 253, 371, 3640, 213, 231, 301, 302, - 228, 289, 290, 281, 201, 284, 277, 4242, 205, 328, 237, 283, 295, 266, 230, 321, 348, 212, 308, 4103, 259, - 238, 245, 298, 330, 265, 271, 287, 267, 286, 290, 3856, 269, 242, 209, 314, 267, 278, 280, 314, 250, 433, - 238, 3654, 195, 246, 301, 298, 250, 270, 320, 269, 305, 258, 368, 3810, 231, 212, 279, 289, 252, 303, 287, - 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, - 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, - 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fdRead; - let readpath; - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = false; - inputEosFlag = false; - surfaceID = globalThis.value; - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - console.info("case getcontent length is: "+ len); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - if (frameCountIn == ES_FRAME_SIZE.length / 2) { - videoDecodeProcessor.setParameter({ - 'bitrate': 6400, - }, (err) => { - expect(err).assertUndefined(); - console.info('in case: setParameter success '); - }); - } - videoDecodeProcessor.pushInputData(inputObject, (err) => { - if (typeof (err) == 'undefined') { - console.info('in case: queueInput success '); - inputCnt += 1; - } else { - console.info(`in case queueInput err called,errMessage is ${error.message}`); - } - }) - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject){ - if (outputObject.flags == 1 ) { - nextStep(); - return; - } - frameCountOut++; - videoDecodeProcessor.freeOutputBuffer(outputObject, (err) => { - if (typeof (err) == 'undefined') { - console.log('in case: release output count:' + frameCountOut); - } else { - console.info(`in case releaseOutput error called,errMessage is ${error.message}`); - } - }) - } - - function setCallback(nextStep){ - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - videoDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => { - expect(err).assertUndefined(); - console.info('get outputMediaDescription : ' + MediaDescription); - }); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - console.info('in case: setCallback out'); - } - eventEmitter.on('configure', (mediaDescription, srcPath, nextStep, done) => { - console.info('in case : configure in'); - videoDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info('in case : configure success'); - setCallback(nextStep); - eventEmitter.emit('getVideoDecoderCaps', done); - // eventEmitter.emit('setOutputSurface', done); - }); - }); - eventEmitter.on('getVideoDecoderCaps', (done) => { - videoDecodeProcessor.getVideoDecoderCaps((err, videoCaps) => { - expect(err).assertUndefined(); - console.info('case get getVideoDecoderCaps success'); - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - eventEmitter.emit('setOutputSurface', done); - }); - }); - - eventEmitter.on('setOutputSurface', (done) => { - videoDecodeProcessor.setOutputSurface(surfaceID, true, (err) => { - expect(err).assertUndefined(); - console.info('in case : setOutputSurface success, surfaceID ' + surfaceID); - eventEmitter.emit('prepare', done); - }) - }); - eventEmitter.on('prepare', (done) => { - videoDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case : prepare success'); - eventEmitter.emit('start', done); - }); - }); - eventEmitter.on('start', (done) => { - videoDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case : start success'); - }); - }); - eventEmitter.on('stop', (done) => { - videoDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info('in case : stop success'); - eventEmitter.emit('reset', done); - }); - }); - eventEmitter.on('reset', (done) => { - videoDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info('in case : reset success'); - eventEmitter.emit('release', done); - }); - }); - eventEmitter.on('release', (done) => { - videoDecodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.info('in case : release success'); - videoDecodeProcessor = null; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - done(); - }); - }); - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_H264_CALLBACK_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0s - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_H264_CALLBACK_0100', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - media.createVideoDecoderByMime('video/avc', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByMime success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, - done); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG2_CALLBACK_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG2_CALLBACK_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG2_FRAME_SIZE; - let srcPath = 'MPEG2_720_480.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mpeg2', - 'width': 720, - 'height': 480, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - media.createVideoDecoderByMime('video/mpeg2', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByMime success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, - done); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG4_CALLBACK_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG4_CALLBACK_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG4_FRAME_SIZE; - let srcPath = 'mpeg4_320_240.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mp4v-es', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - media.createVideoDecoderByMime('video/mp4v-es', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByMime success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, - done); - }); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js deleted file mode 100644 index 4cc7d507d9fb1af07998fc00a42fe3a39200e4e8..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js +++ /dev/null @@ -1,498 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - - -describe('VideoDecoderFuncPromiseTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let inputQueue = []; - let outputQueue = []; - let isCodecData = false; - let inputEosFlag = false; - let surfaceID = ''; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; - const H263_FRAME_SIZE = - [ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244, - 5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165, - 24267, 36171, 18330, 53228, 7893, 13088, 9502, 8485, 9207, 8681, 9202, 8537, 7603, 9726, 8191, 51872, - 5535, 6146, 6341, 6933, 9365, 7828, 6547, 7638, 7009, 7025, 8873, 51045, 5056, 4858, 4887, 9614, 5953, - 5972, 6116, 6060, 6296, 6239, 6400, 50928, 4937, 5054, 5371, 6728, 6286, 6524, 6646, 6549, 6036, 6214, - 5866, 51109, 4778, 5273, 6327]; - const MPEG2_FRAME_SIZE = - [ 38462, 55096, 8660, 3417, 1197, 2209, 984, 718, 783, 623, 659, 694, 14174, 580, 421, 495, 480, 476, 534, - 660, 699, 601, 603, 720, 12585, 555, 532, 776, 789, 762, 766, 732, 671, 735, 777, 948, 12650, 827, 766, - 835, 747, 847, 940, 1121, 1092, 1001, 980, 989, 12746, 945, 912, 1046, 1118, 1134, 1050, 1073, 1051, 1195, - 1085, 1182, 12874, 992, 1007, 985, 1040, 1143, 1157, 1150, 1247, 1149, 1246, 1145, 12870, 1041, 1066, 1314, - 1239, 1283, 1223, 1224, 1270, 1427, 1406, 1516, 12949, 1228, 1299, 1439, 1358, 1455, 1311, 1396, 1416, 1470, - 1393, 1502, 12999, 1232, 1400, 1348, 1335, 1461, 1404, 1412, 1426, 1548, 1481, 1488, 12840, 1229, 1342, 1323, - 1353, 1524, 1363, 1475, 1540, 1495, 1489, 1438, 12762, 1291, 1303, 1470, 1494, 1488, 1474, 1453, 1607, 1485, - 1589, 1762, 12548, 1363, 1317, 1435, 1411, 1338, 1373, 1605, 1639, 1429, 1392, 1543, 12332, 1255, 1200, 1291, - 1337, 1341, 1356, 1214, 1456, 1353, 1314, 1502, 12151, 1192, 1290, 1203, 1284, 1154, 1264, 1358, 1390, 1433, - 1194, 1325, 11904, 993, 1007, 1149, 1099, 1182, 1076, 1074, 1092, 1030, 1272, 1178, 11710, 966, 879, 860, 955, - 898, 967, 927, 1066, 997, 1083, 940, 11717, 648, 705, 901, 925, 930, 868, 798, 846, 781, 825, 1027, 11587, 785, - 733, 731, 848, 753, 806, 699, 837, 750, 762, 748, 11541, 678, 742, 667, 735, 702, 837, 695, 773, 849, 869, 769, - 11381, 664, 705, 714, 698, 814, 846, 757, 802, 857, 905, 772, 11265, 718, 643, 597, 687, 774, 843, 747, 785, - 683, 1135, 676, 11259, 616, 595, 773, 746, 798, 722, 798, 790, 959, 771, 907, 11234, 705, 675, 773, 764, 846, - 789, 840, 853, 828, 774, 842, 11263, 758, 758, 757, 820, 847, 834, 884, 842, 988, 750, 952, 11236, 776, 640, 727, - 832, 855, 733, 822, 827, 862, 697, 924, 11176, 675, 615, 688, 818, 783, 746, 901, 834, 892, 759, 923, 11181, 661, - 578, 720, 697]; - const MPEG4_FRAME_SIZE = - [ 11895, 8109, 1578, 1616, 1313, 572, 805, 837, 755, 706, 952, 879, 13193, 422, 389, 509, 725, 465, 479, 959, - 677, 364, 541, 696, 9306, 322, 318, 767, 590, 422, 530, 403, 505, 566, 445, 508, 7783, 460, 405, 343, 451, - 608, 431, 411, 543, 487, 527, 400, 6287, 385, 418, 391, 592, 434, 412, 398, 504, 492, 479, 561, 5413, 317, - 355, 422, 467, 452, 476, 460, 490, 492, 485, 451, 5036, 312, 408, 460, 432, 502, 388, 475, 407, 544, 401, - 487, 4404, 362, 378, 427, 416, 426, 456, 414, 438, 424, 442, 444, 4310, 362, 388, 393, 390, 441, 398, 423, - 369, 443, 406, 392, 4231, 343, 363, 355, 390, 459, 371, 378, 381, 405, 392, 426, 3975, 387, 337, 393, 439, - 378, 355, 374, 484, 381, 373, 423, 3869, 312, 350, 400, 345, 356, 320, 473, 431, 386, 338, 431, 3426, 268, - 315, 416, 383, 373, 381, 354, 383, 328, 348, 418, 3715, 324, 361, 331, 350, 302, 409, 377, 359, 384, 334, - 326, 3439, 266, 324, 329, 353, 405, 303, 357, 332, 292, 361, 333, 3542, 294, 284, 247, 331, 306, 322, 287, - 367, 341, 276, 258, 3980, 246, 245, 259, 309, 333, 250, 275, 334, 281, 253, 371, 3640, 213, 231, 301, 302, - 228, 289, 290, 281, 201, 284, 277, 4242, 205, 328, 237, 283, 295, 266, 230, 321, 348, 212, 308, 4103, 259, - 238, 245, 298, 330, 265, 271, 287, 267, 286, 290, 3856, 269, 242, 209, 314, 267, 278, 280, 314, 250, 433, - 238, 3654, 195, 246, 301, 298, 250, 270, 320, 269, 305, 258, 368, 3810, 231, 212, 279, 289, 252, 303, 287, - 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, - 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, - 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fdRead; - let readpath; - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = false; - inputEosFlag = false; - surfaceID = globalThis.value; - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - console.info("case start get content length is: " + len); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - if (frameCountIn == ES_FRAME_SIZE.length / 2) { - videoDecodeProcessor.setParameter({ - 'bitrate': 6400, - }).then(() => { - console.info('in case: setParameter success '); - }, failCallback).catch(failCatch); - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case: queueInput success '); - inputCnt += 1; - }, failCallback).catch(failCatch); - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1) { - nextStep(); - return; - } - frameCountOut++; - await videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.log('in case: release output count:' + frameCountOut); - }, failCallback).catch(failCatch); - } - - function setCallback(nextStep){ - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - videoDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info('get outputMediaDescription : ' + MediaDescription); - }, failCallback).catch(failCatch); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - console.info('in case: setCallback out'); - } - - async function toCreateVideoDecoderByMime(mime, done) { - await media.createVideoDecoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByMime success'); - } else { - console.info('in case : createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - async function toGetVideoDecoderCaps() { - await videoDecodeProcessor.getVideoDecoderCaps().then((videoCaps) => { - console.info("case get getVideoDecoderCaps success"); - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - }, failCallback).catch(failCatch); - } - async function toConfigure(mediaDescription, srcPath) { - await videoDecodeProcessor.configure(mediaDescription).then(() =>{ - console.info('in case : configure success'); - }, failCallback).catch(failCatch); - } - async function toSetOutputSurface(isDisplay) { - await videoDecodeProcessor.setOutputSurface(surfaceID, isDisplay).then(() => { - console.info('in case : setOutputSurface success. surfaceID ' + surfaceID); - }, failCallback).catch(failCatch); - } - eventEmitter.on('nextStep', async (done) => { - console.info('in case : nextStep success'); - await videoDecodeProcessor.stop().then(() => { - console.info('in case : stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('in case : reset success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.release().then(() => { - console.info('in case : release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - console.info('in case : done'); - done(); - }); - async function toPrepare() { - await videoDecodeProcessor.prepare().then(() => { - console.info('in case : prepare success'); - }, failCallback).catch(failCatch); - } - async function toStart() { - await videoDecodeProcessor.start().then(() => { - console.info('in case : start success'); - }, failCallback).catch(failCatch); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_H264_PROMISE_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_H264_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByMime('video/avc', done); - await toGetVideoDecoderCaps(); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG2_PROMISE_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG2_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG2_FRAME_SIZE; - let srcPath = 'MPEG2_720_480.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mpeg2', - 'width': 720, - 'height': 480, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByMime('video/mpeg2', done); - await toGetVideoDecoderCaps(); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG4_PROMISE_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MPEG4_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG4_FRAME_SIZE; - let srcPath = 'mpeg4_320_240.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mp4v-es', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByMime('video/mp4v-es', done); - await toGetVideoDecoderCaps(); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100 - * @tc.name : 001.creat multiple video decoders - * @tc.desc : creat multiple video decoders - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - let array = new Array(); - eventEmitter.on('releaseAllDecoder', async () => { - for (let j = 0; j < 2; j++) { - await array[j].release().then(() => { - array[j] = null; - }, failCallback).catch(failCatch); - } - await videoDecodeProcessor.release().then(() => { - console.info('in case : release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - done(); - }) - 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 == 2) { - videoDecodeProcessor = processor; - } else { - array[i] = processor; - } - } else { - console.info('in case : createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('releaseAllDecoder', done);} - ); - await toPrepare(); - await toStart(); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js deleted file mode 100644 index 349fe720a251871362baa65ada270a0bdac3c0f5..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js +++ /dev/null @@ -1,1287 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const DECODE_STEP = { - WAIT_FOR_EOS : 'waitForEOS', - CONFIGURE : 'configure', - SETSURFACE : 'setSurface', - PREPARE : 'prepare', - START : 'start', - FLUSH : 'flush', - STOP : 'stop', - RESET : 'reset', - WAIT_FOR_ALL_OUTS : 'waitForAllOuts', - ERROR : 'error', - RELEASE : 'release', -} - -describe('VideoDecoderReliCallbackTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let position = 0; - let eosFrameId = -1; - let inputQueue = []; - let outputQueue = []; - let isCodecData = true; - let inputEosFlag = false; - let workdoneAtEOS = false; - let surfaceID = ''; - const SRCPATH = 'out_320_240_10s.h264'; - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60, - 'max_input_size': 150000, - } - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; - let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fdRead; - let lockFlag = false; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - workdoneAtEOS = false; - eosFrameId = -1; - inputEosFlag = false; - position = 0; - surfaceID = globalThis.value; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - function printError(err, expectFail) { - expect((err != undefined) == expectFail).assertTrue(); - if (expectFail == false && err != undefined) { - console.info('in case error failCatch called,err is ' + err); - console.info(`in case error failCatch called,errMessage is ${err.message}`); - } - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, pos, len) { - console.info('case start get content, len ' + len + ' buf.byteLength ' + buf.byteLength); - let lengthReal = -1; - try { - if (pos == -1) { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - }); - } else { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - position: pos, - }); - } - console.info('in case: lengthReal: ' + lengthReal); - } catch(e) { - console.error('in case error getContent err ' + err); - } - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, position, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - position = position + ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 1000 / mediaDescription.frame_rate; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length || frameCountIn == eosFrameId) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject, (err) => { - console.info('in case: queueInput success '); - }) - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1 ) { - if (workdoneAtEOS) { - doneWork(nextStep); - } - return; - } - frameCountOut++; - videoDecodeProcessor.freeOutputBuffer(outputObject, () => { - console.log('in case: release output count:' + frameCountOut); - }) - } - - function toConfigure(mySteps, done, expectFail) { - videoDecodeProcessor.configure(mediaDescription, (err) => { - console.info(`case configure callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }) - } - function toPrepare(mySteps, done, expectFail) { - videoDecodeProcessor.prepare((err) => { - console.info(`case prepare callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toStart(mySteps, done, expectFail) { - let timeDelay = 0; - videoDecodeProcessor.start((err) => { - console.info(`case start callback`); - printError(err, expectFail); - if (mySteps[0] == DECODE_STEP.FLUSH) { - timeDelay = 50; - } - setTimeout(() => { - toNextStep(mySteps, done); - }, timeDelay); - }); - } - function toFlush(mySteps, done, expectFail) { - lockFlag = true; - videoDecodeProcessor.flush((err) => { - console.info(`case flush callback`); - printError(err, expectFail); - if (expectFail == false) { - inputEosFlag = false; - position = ES_FRAME_SIZE[0]; - inputQueue = []; - timestamp = 0; - frameCountIn = 1; - } - lockFlag = false; - toNextStep(mySteps, done); - }); - } - function toStop(mySteps, done, expectFail) { - videoDecodeProcessor.stop((err) => { - console.info(`case stop callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toReset(mySteps, done, expectFail) { - videoDecodeProcessor.reset((err) => { - console.info(`case reset callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toSetOutputSurface(mySteps, done, expectFail) { - videoDecodeProcessor.setOutputSurface(surfaceID, true, (err) => { - console.info('case setOutputSurface callback, surfaceID ' + surfaceID); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toNextStep(mySteps, done) { - console.info('case myStep[0]: ' + mySteps[0]); - if (mySteps[0] == DECODE_STEP.RELEASE) { - if (videoDecodeProcessor != null){ - videoDecodeProcessor.release(async(err) => { - printError(err, false); - console.info('in case : videoDecodeProcessor release callback'); - videoDecodeProcessor = null; - console.info('case to done'); - done(); - }); - } - return; - } - switch (mySteps[0]) { - case DECODE_STEP.CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toConfigure(mySteps, done, true); - } else { - toConfigure(mySteps, done, false); - } - break; - case DECODE_STEP.SETSURFACE: - mySteps.shift(); - console.info(`case to setOutputSurface`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toSetOutputSurface(mySteps, done, true); - } else { - toSetOutputSurface(mySteps, done, false); - } - break; - case DECODE_STEP.PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toPrepare(mySteps, done, true); - } else { - toPrepare(mySteps, done, false); - } - break; - case DECODE_STEP.START: - mySteps.shift(); - console.info(`case to start`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toStart(mySteps, done, true); - } else { - readStreamSync = undefined; - frameCountIn = 0; - frameCountOut = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - position = 0; - toStart(mySteps, done, false); - } - break; - case DECODE_STEP.FLUSH: - mySteps.shift(); - console.info(`case to flush`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toFlush(mySteps, done, true); - } else { - toFlush(mySteps, done, false); - } - break; - case DECODE_STEP.STOP: - mySteps.shift(); - console.info(`case to stop`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toStop(mySteps, done, true); - } else { - toStop(mySteps, done, false); - } - break; - case DECODE_STEP.RESET: - mySteps.shift(); - console.info(`case to reset`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toReset(mySteps, done, true); - } else { - toReset(mySteps, done, false); - } - break; - case DECODE_STEP.WAIT_FOR_EOS: - mySteps.shift(); - setTimeout(() =>{ - expect(inputEosFlag).assertTrue(); - if (inputEosFlag == false) { - console.info(`in case error wait for eos: inputEosFlag = false`); - } - toNextStep(mySteps, done); - }, 7000); // wait 7000 ms for eos - break; - case DECODE_STEP.WAIT_FOR_ALL_OUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - default: - break; - } - } - - function setCallback(nextStep){ - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - } - - async function toCreateVideoDecoderByMime(mime, mySteps, done) { - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - await media.createVideoDecoderByMime(mime, (err, processor) => { - console.info(`case createVideoDecoderByMime callback`); - printError(err, false); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }) - } - function toCreateVideoDecoderByName(name, mySteps, done) { - media.createVideoDecoderByName(name, (err, processor) => { - printError(err, false); - console.info(`case createVideoDecoderByName callback`); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }) - } - async function doneWork(nextStep) { - videoDecodeProcessor.stop((err) => { - printError(err, false); - console.info('case stop callback'); - videoDecodeProcessor.reset((err) => { - printError(err, false); - console.info('case reset callback'); - videoDecodeProcessor.release((err) => { - printError(err, false); - console.info('case release callback'); - videoDecodeProcessor = null; - nextStep(); - }) - }) - }) - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0100 - * @tc.name : test set EOS manually before last frame and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0200 - * @tc.name : test flush at running state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0300 - * @tc.name : test flush at EOS state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - eosFrameId = 10; - workdoneAtEOS = true; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0400 - * @tc.name : test stop at running state and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0500 - * @tc.name : test stop and restart - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0100 - * @tc.name : 001.create -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0300 - * @tc.name : 003.start -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_CALLBACK_0900', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS , - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0100 - * @tc.name : 001.create -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0200 - * @tc.name : 002.configure -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0400 - * @tc.name : 004.start -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0500 - * @tc.name : 005.flush -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0600 - * @tc.name : 006.stop -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.START, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0800 - * @tc.name : 008.reset -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0100 - * @tc.name : 001.create -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.FLUSH, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0400 - * @tc.name : 004.start -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP , DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0100 - * @tc.name : 001.create -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.STOP, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0400 - * @tc.name : 004.start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0100 - * @tc.name : 001.create -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.RESET, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0400 - * @tc.name : 004.start -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByMime('video/avc', mySteps, done); - }) -}) diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js deleted file mode 100644 index 6a88d5b013533be67b771745ec1033b2943db4e5..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js +++ /dev/null @@ -1,1284 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const DECODE_STEP = { - WAIT_FOR_EOS : 'waitForEOS', - CONFIGURE : 'configure', - SETSURFACE : 'setSurface', - PREPARE : 'prepare', - START : 'start', - FLUSH : 'flush', - STOP : 'stop', - RESET : 'reset', - WAIT_FOR_ALL_OUTS : 'waitForAllOuts', - ERROR : 'error', - RELEASE : 'release', -} - -describe('VideoDecoderReliPromiseTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let position = 0; - let eosFrameId = -1; - let inputQueue = []; - let outputQueue = []; - let isCodecData = true; - let inputEosFlag = false; - let workdoneAtEOS = false; - let surfaceID = ''; - const SRCPATH = 'out_320_240_10s.h264'; - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 4, - 'frame_rate': 60, - 'max_input_size': 150000, - } - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; - let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fdRead; - let lockFlag = false; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - workdoneAtEOS = false; - eosFrameId = -1; - inputEosFlag = false; - position = 0; - surfaceID = globalThis.value; - lockFlag = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - let caseCallback = function(err) { - console.info(`in case caseCallback called, caseMessage is ${err.message}`); - } - let failCallback = function(err) { - console.error(`in case error failCallback called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let failCatch = function(err) { - console.error(`in case error failCatch called,errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let callbackExpectOK = function(err, mySteps, done) { - console.error(`in case error callbackExpectOK called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - toNextStep(mySteps, done); - } - let callbackExpectFail = function(err, mySteps, done) { - console.info(`in case callbackExpectFail called, errMessage is ${err.message}`); - expect(err != undefined).assertTrue(); - toNextStep(mySteps, done); - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, pos, len) { - console.info('start get content, len ' + len + ' buf.byteLength ' + buf.byteLength); - let lengthReal = -1; - try { - if (pos == -1) { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - }); - } else { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - position: pos, - }); - } - console.info('in case: lengthReal: ' + lengthReal); - } catch(e) { - console.error('in case error getContent err ' + err); - } - } - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, position, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - position = position + ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 1000 / mediaDescription.frame_rate; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length || frameCountIn == eosFrameId) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case: queueInput success '); - }, caseCallback).catch(failCatch); - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1 ) { - if (workdoneAtEOS) { - await doneWork(); - nextStep(); - } - return; - } - frameCountOut++; - videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('in case: release output success'); - console.log('in case: release output count:' + frameCountOut); - }, caseCallback).catch(failCatch); - } - - async function toConfigure(mySteps, done, failureCallback, catchCallback) { - await videoDecodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toPrepare(mySteps, done, failureCallback, catchCallback) { - await videoDecodeProcessor.prepare().then(() => { - console.info(`case prepare success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toStart(mySteps, done, failureCallback, catchCallback) { - let timeDelay = 0; - await videoDecodeProcessor.start().then(() => { - console.info(`case start success`); - if (mySteps[0] == DECODE_STEP.FLUSH) { - timeDelay = 50; - } - setTimeout(() => { - toNextStep(mySteps, done); - }, timeDelay); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toFlush(mySteps, done, failureCallback, catchCallback) { - lockFlag = true; - await videoDecodeProcessor.flush().then(() => { - console.info(`case flush success`); - position = ES_FRAME_SIZE[0]; - inputQueue = []; - timestamp = 0; - inputEosFlag = false; - frameCountIn = 1; - lockFlag = false; - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toStop(mySteps, done, failureCallback, catchCallback) { - await videoDecodeProcessor.stop().then(() => { - console.info(`case stop success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toReset(mySteps, done, failureCallback, catchCallback) { - await videoDecodeProcessor.reset().then(() => { - console.info(`case reset success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toSetOutputSurface(mySteps, done, failureCallback, catchCallback) { - await videoDecodeProcessor.setOutputSurface(surfaceID, true).then(() => { - console.info('in case : setOutputSurface success, surfaceID ' + surfaceID); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - async function toNextStep(mySteps, done) { - console.info('case myStep[0]: ' + mySteps[0]); - if (mySteps[0] == DECODE_STEP.RELEASE) { - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(async() => { - console.info('in case : videoDecodeProcessor release success'); - videoDecodeProcessor = null; - console.info('case to done'); - done(); - }, failCallback).catch(failCatch); - } - return; - } - switch (mySteps[0]) { - case DECODE_STEP.CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toConfigure(mySteps, done, callbackExpectFail, failCatch); - } else { - await toConfigure(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.SETSURFACE: - mySteps.shift(); - console.info(`case to setOutputSurface`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toSetOutputSurface(mySteps, done, callbackExpectFail, failCatch); - } else { - await toSetOutputSurface(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toPrepare(mySteps, done, callbackExpectFail, failCatch); - } else { - await toPrepare(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.START: - mySteps.shift(); - console.info(`case to start`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toStart(mySteps, done, callbackExpectFail, failCatch); - } else { - readStreamSync = undefined; - frameCountIn = 0; - frameCountOut = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - position = 0; - await toStart(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.FLUSH: - mySteps.shift(); - console.info(`case to flush`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toFlush(mySteps, done, callbackExpectFail, failCatch); - } else { - await toFlush(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.STOP: - mySteps.shift(); - console.info(`case to stop`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toStop(mySteps, done, callbackExpectFail, failCatch); - } else { - await toStop(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.RESET: - mySteps.shift(); - console.info(`case to reset`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - await toReset(mySteps, done, callbackExpectFail, failCatch); - } else { - await toReset(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.WAIT_FOR_EOS: - mySteps.shift(); - setTimeout(async() =>{ - expect(inputEosFlag).assertTrue(); - if (inputEosFlag == false) { - console.info(`in case error inputEosFlag == false`); - } - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - toNextStep(mySteps, done); - }, 7000); // wait 7000 ms for eos - break; - case DECODE_STEP.WAIT_FOR_ALL_OUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - default: - break; - } - } - - function setCallback(nextStep){ - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged', (format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - } - - async function toCreateVideoDecoderByMime(mime, mySteps, done) { - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - await media.createVideoDecoderByMime(mime).then((processor) => { - console.info(`case createVideoDecoderByMime success`); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }, failCallback).catch(failCatch); - } - async function toCreateVideoDecoderByName(name, mySteps, done) { - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - media.createVideoDecoderByName(name).then((processor) => { - console.info(`case createVideoDecoderByName success`); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }, failCallback).catch(failCatch); - } - async function doneWork() { - await videoDecodeProcessor.stop().then(() => { - console.info('case stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('case reset success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.release().then(() => { - console.info('case release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0100 - * @tc.name : test set EOS manually before last frame and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0200 - * @tc.name : test flush at running state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0300 - * @tc.name : test flush at EOS state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - eosFrameId = 10; - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0400 - * @tc.name : test stop at running state and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0500 - * @tc.name : test stop and restart - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_FUNCTION_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0100 - * @tc.name : 001.create -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0300 - * @tc.name : 003.start -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_CONFIGURE_PROMISE_0900', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS , - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_PREPARE_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0100 - * @tc.name : 001.create -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0200 - * @tc.name : 002.configure -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0400 - * @tc.name : 004.start -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0500 - * @tc.name : 005.flush -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0600 - * @tc.name : 006.stop -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.START, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0800 - * @tc.name : 008.reset -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_START_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0100 - * @tc.name : 001.create -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.FLUSH, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0400 - * @tc.name : 004.start -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP , DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_FLUSH_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0100 - * @tc.name : 001.create -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.STOP, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0400 - * @tc.name : 004.start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_STOP_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0100 - * @tc.name : 001.create -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.RESET, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0400 - * @tc.name : 004.start -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_RESET_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_API_EOS_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) -}) diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js deleted file mode 100644 index f6608e20d811b27ec08c721769ff3e531ad17851..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js +++ /dev/null @@ -1,571 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('VideoSoftwareDecoderFuncCallbackTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let inputQueue = []; - let outputQueue = []; - let isCodecData = false; - let inputEosFlag = false; - let surfaceID = ''; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124, - 2049, 180, 122, 128, 1334, 143, 128, 1379, 116, 1884, 149, 122, 150, 1962, 176, 122, 122, 1197, 139, - 1853, 184, 151, 148, 1692, 209, 129, 126, 1736, 149, 135, 104, 1775, 165, 160, 121, 1653, 163, 123, - 112, 1907, 181, 129, 107, 1808, 177, 125, 111, 2405, 166, 144, 114, 1833, 198, 136, 113, 1960, 206, - 139, 116, 1791, 175, 130, 129, 1909, 194, 138, 119, 1807, 160, 156, 124, 1998, 184, 173, 114, 2069, 181, - 127, 139, 2212, 182, 138, 146, 1993, 214, 135, 139, 2286, 194, 137, 120, 2090, 196, 159, 132, 2294, 194, - 148, 137, 2312, 183, 163, 106, 2118, 201, 158, 127, 2291, 187, 144, 116, 2413, 139, 115, 2148, 178, 122, - 103, 2370, 207, 161, 117, 2291, 213, 159, 129, 2244, 243, 157, 133, 2418, 255, 171, 127, 2316, 185, 160, - 132, 2405, 220, 165, 155, 2539, 219, 172, 128, 2433, 199, 154, 119, 1681, 140, 1960, 143, 2682, 202, 153, - 127, 2794, 239, 158, 155, 2643, 229, 172, 125, 2526, 201, 181, 159, 2554, 233, 167, 125, 2809, 205, 164, - 117, 2707, 221, 156, 138, 2922, 240, 160, 146, 2952, 267, 177, 149, 3339, 271, 175, 136, 3006, 242, 168, - 141, 3068, 232, 194, 149, 2760, 214, 208, 143, 2811, 218, 184, 149, 137, 15486, 2116, 235, 167, 157, 2894, - 305, 184, 139, 3090, 345, 179, 155, 3226, 347, 160, 164, 3275, 321, 184, 174, 3240, 269, 166, 170, 3773, - 265, 169, 155, 3023, 301, 188, 161, 3343, 275, 174, 155, 3526, 309, 177, 173, 3546, 307, 183, 149, 3648, - 295, 213, 170, 3568, 305, 198, 166, 3641, 297, 172, 148, 3608, 301, 200, 159, 3693, 322, 209, 166, 3453, - 318, 206, 162, 3696, 341, 200, 176, 3386, 320, 192, 176, 3903, 373, 207, 187, 3305, 361, 200, 202, 3110, - 367, 220, 197, 2357, 332, 196, 201, 1827, 377, 187, 199, 860, 472, 173, 223, 238]; - const H263_FRAME_SIZE = - [ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244, - 5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165, - 24267, 36171, 18330, 53228, 7893, 13088, 9502, 8485, 9207, 8681, 9202, 8537, 7603, 9726, 8191, 51872, - 5535, 6146, 6341, 6933, 9365, 7828, 6547, 7638, 7009, 7025, 8873, 51045, 5056, 4858, 4887, 9614, 5953, - 5972, 6116, 6060, 6296, 6239, 6400, 50928, 4937, 5054, 5371, 6728, 6286, 6524, 6646, 6549, 6036, 6214, - 5866, 51109, 4778, 5273, 6327]; - const MPEG2_FRAME_SIZE = - [ 38462, 55096, 8660, 3417, 1197, 2209, 984, 718, 783, 623, 659, 694, 14174, 580, 421, 495, 480, 476, 534, - 660, 699, 601, 603, 720, 12585, 555, 532, 776, 789, 762, 766, 732, 671, 735, 777, 948, 12650, 827, 766, - 835, 747, 847, 940, 1121, 1092, 1001, 980, 989, 12746, 945, 912, 1046, 1118, 1134, 1050, 1073, 1051, 1195, - 1085, 1182, 12874, 992, 1007, 985, 1040, 1143, 1157, 1150, 1247, 1149, 1246, 1145, 12870, 1041, 1066, 1314, - 1239, 1283, 1223, 1224, 1270, 1427, 1406, 1516, 12949, 1228, 1299, 1439, 1358, 1455, 1311, 1396, 1416, 1470, - 1393, 1502, 12999, 1232, 1400, 1348, 1335, 1461, 1404, 1412, 1426, 1548, 1481, 1488, 12840, 1229, 1342, 1323, - 1353, 1524, 1363, 1475, 1540, 1495, 1489, 1438, 12762, 1291, 1303, 1470, 1494, 1488, 1474, 1453, 1607, 1485, - 1589, 1762, 12548, 1363, 1317, 1435, 1411, 1338, 1373, 1605, 1639, 1429, 1392, 1543, 12332, 1255, 1200, 1291, - 1337, 1341, 1356, 1214, 1456, 1353, 1314, 1502, 12151, 1192, 1290, 1203, 1284, 1154, 1264, 1358, 1390, 1433, - 1194, 1325, 11904, 993, 1007, 1149, 1099, 1182, 1076, 1074, 1092, 1030, 1272, 1178, 11710, 966, 879, 860, 955, - 898, 967, 927, 1066, 997, 1083, 940, 11717, 648, 705, 901, 925, 930, 868, 798, 846, 781, 825, 1027, 11587, 785, - 733, 731, 848, 753, 806, 699, 837, 750, 762, 748, 11541, 678, 742, 667, 735, 702, 837, 695, 773, 849, 869, 769, - 11381, 664, 705, 714, 698, 814, 846, 757, 802, 857, 905, 772, 11265, 718, 643, 597, 687, 774, 843, 747, 785, - 683, 1135, 676, 11259, 616, 595, 773, 746, 798, 722, 798, 790, 959, 771, 907, 11234, 705, 675, 773, 764, 846, - 789, 840, 853, 828, 774, 842, 11263, 758, 758, 757, 820, 847, 834, 884, 842, 988, 750, 952, 11236, 776, 640, 727, - 832, 855, 733, 822, 827, 862, 697, 924, 11176, 675, 615, 688, 818, 783, 746, 901, 834, 892, 759, 923, 11181, 661, - 578, 720, 697]; - const MPEG4_FRAME_SIZE = - [ 11895, 8109, 1578, 1616, 1313, 572, 805, 837, 755, 706, 952, 879, 13193, 422, 389, 509, 725, 465, 479, 959, - 677, 364, 541, 696, 9306, 322, 318, 767, 590, 422, 530, 403, 505, 566, 445, 508, 7783, 460, 405, 343, 451, - 608, 431, 411, 543, 487, 527, 400, 6287, 385, 418, 391, 592, 434, 412, 398, 504, 492, 479, 561, 5413, 317, - 355, 422, 467, 452, 476, 460, 490, 492, 485, 451, 5036, 312, 408, 460, 432, 502, 388, 475, 407, 544, 401, - 487, 4404, 362, 378, 427, 416, 426, 456, 414, 438, 424, 442, 444, 4310, 362, 388, 393, 390, 441, 398, 423, - 369, 443, 406, 392, 4231, 343, 363, 355, 390, 459, 371, 378, 381, 405, 392, 426, 3975, 387, 337, 393, 439, - 378, 355, 374, 484, 381, 373, 423, 3869, 312, 350, 400, 345, 356, 320, 473, 431, 386, 338, 431, 3426, 268, - 315, 416, 383, 373, 381, 354, 383, 328, 348, 418, 3715, 324, 361, 331, 350, 302, 409, 377, 359, 384, 334, - 326, 3439, 266, 324, 329, 353, 405, 303, 357, 332, 292, 361, 333, 3542, 294, 284, 247, 331, 306, 322, 287, - 367, 341, 276, 258, 3980, 246, 245, 259, 309, 333, 250, 275, 334, 281, 253, 371, 3640, 213, 231, 301, 302, - 228, 289, 290, 281, 201, 284, 277, 4242, 205, 328, 237, 283, 295, 266, 230, 321, 348, 212, 308, 4103, 259, - 238, 245, 298, 330, 265, 271, 287, 267, 286, 290, 3856, 269, 242, 209, 314, 267, 278, 280, 314, 250, 433, - 238, 3654, 195, 246, 301, 298, 250, 270, 320, 269, 305, 258, 368, 3810, 231, 212, 279, 289, 252, 303, 287, - 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, - 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, - 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fdRead; - let readpath; - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = false; - inputEosFlag = false; - surfaceID = globalThis.value; - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - console.info("case start get content length is: " + len); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject, (err) => { - if (typeof (err) == 'undefined') { - console.info('in case: queueInput success '); - inputCnt += 1; - } else { - console.info(`in case queueInput err called,errMessage is ${error.message}`); - } - }) - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1 ) { - nextStep(); - return; - } - frameCountOut++; - videoDecodeProcessor.freeOutputBuffer(outputObject, (err) => { - if (typeof (err) == 'undefined') { - console.log('in case: release output count:' + frameCountOut); - } else { - console.info(`in case releaseOutput error called,errMessage is ${error.message}`); - } - }) - } - - function setCallback(nextStep){ - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - console.info('in case: setCallback out'); - } - eventEmitter.on('configure', (mediaDescription, srcPath, nextStep, done) => { - console.info('in case : configure in'); - videoDecodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info('in case : configure success'); - setCallback(nextStep); - eventEmitter.emit('setOutputSurface', done); - }); - }); - eventEmitter.on('setOutputSurface', (done) => { - videoDecodeProcessor.setOutputSurface(surfaceID, true, (err) => { - expect(err).assertUndefined(); - console.info('in case : setOutputSurface success, surfaceID ' + surfaceID); - eventEmitter.emit('prepare', done); - }) - }); - eventEmitter.on('prepare', (done) => { - videoDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case : prepare success'); - eventEmitter.emit('start', done); - }); - }); - eventEmitter.on('start', (done) => { - videoDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case : start success'); - }); - }); - eventEmitter.on('stop', (done) => { - videoDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info('in case : stop success'); - eventEmitter.emit('reset', done); - }); - }); - eventEmitter.on('reset', (done) => { - videoDecodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info('in case : reset success'); - eventEmitter.emit('release', done); - }); - }); - eventEmitter.on('release', (done) => { - videoDecodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.info('in case : release success'); - videoDecodeProcessor = null; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - done(); - }); - }); - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_H264_CALLBACK_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_H264_CALLBACK_0100', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - media.createVideoDecoderByName('avdec_h264', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByName success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, done); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG2_CALLBACK_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG2_CALLBACK_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG2_FRAME_SIZE; - let srcPath = 'MPEG2_720_480.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mpeg2', - 'width': 720, - 'height': 480, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - media.createVideoDecoderByName('avdec_mpeg2video', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByName success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, done); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG4_CALLBACK_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG4_CALLBACK_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG4_FRAME_SIZE; - let srcPath = 'mpeg4_320_240.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mp4v-es', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - media.createVideoDecoderByName('avdec_mpeg4', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByName success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, done); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0600 - * @tc.name : test reconfigure for new file with the same format - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0600', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - eventEmitter.on('stop_for_callback_01_0600', (done) => { - videoDecodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info('in case : stop_for_callback_01_0600 success'); - eventEmitter.emit('reset_for_callback_01_0600', done); - }); - }); - eventEmitter.on('reset_for_callback_01_0600', (done) => { - videoDecodeProcessor.reset(async (err) => { - expect(err).assertUndefined(); - console.info('in case : reset_for_callback_01_0600 success'); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - readStreamSync = null; - await getFdRead(readpath, done); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - surfaceID = globalThis.value; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, done); - }); - }); - media.createVideoDecoderByName('avdec_h264', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByName success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop_for_callback_01_0600', done); - }, done); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0700 - * @tc.name : test reconfigure for new file with the different format - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0700', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - eventEmitter.on('stop_for_callback_01_0700', (done) => { - videoDecodeProcessor.stop(async(err) => { - expect(err).assertUndefined(); - console.info('in case : stop_for_callback_01_0700 success'); - eventEmitter.emit('reset_for_callback_01_0700', done); - }); - }); - eventEmitter.on('reset_for_callback_01_0700', (done) => { - videoDecodeProcessor.reset(async (err) => { - expect(err).assertUndefined(); - console.info('in case : reset_for_callback_01_0700 success'); - srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - readStreamSync = null; - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - surfaceID = globalThis.value; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop', done); - }, done); - }); - }); - media.createVideoDecoderByName('avdec_h264', (err, processor) => { - expect(err).assertUndefined(); - console.info('in case : createVideoDecoderByName success'); - videoDecodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription, srcPath, - function() { - eventEmitter.emit('stop_for_callback_01_0700', done); - }, done); - }); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js deleted file mode 100644 index 00f9aaa10d8defb4ad90984df5daa789f9be9ea4..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js +++ /dev/null @@ -1,566 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - - -describe('VideoSoftwareDecoderFuncPromiseTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let inputQueue = []; - let outputQueue = []; - let isCodecData = false; - let inputEosFlag = false; - let surfaceID = ''; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124, - 2049, 180, 122, 128, 1334, 143, 128, 1379, 116, 1884, 149, 122, 150, 1962, 176, 122, 122, 1197, 139, - 1853, 184, 151, 148, 1692, 209, 129, 126, 1736, 149, 135, 104, 1775, 165, 160, 121, 1653, 163, 123, - 112, 1907, 181, 129, 107, 1808, 177, 125, 111, 2405, 166, 144, 114, 1833, 198, 136, 113, 1960, 206, - 139, 116, 1791, 175, 130, 129, 1909, 194, 138, 119, 1807, 160, 156, 124, 1998, 184, 173, 114, 2069, 181, - 127, 139, 2212, 182, 138, 146, 1993, 214, 135, 139, 2286, 194, 137, 120, 2090, 196, 159, 132, 2294, 194, - 148, 137, 2312, 183, 163, 106, 2118, 201, 158, 127, 2291, 187, 144, 116, 2413, 139, 115, 2148, 178, 122, - 103, 2370, 207, 161, 117, 2291, 213, 159, 129, 2244, 243, 157, 133, 2418, 255, 171, 127, 2316, 185, 160, - 132, 2405, 220, 165, 155, 2539, 219, 172, 128, 2433, 199, 154, 119, 1681, 140, 1960, 143, 2682, 202, 153, - 127, 2794, 239, 158, 155, 2643, 229, 172, 125, 2526, 201, 181, 159, 2554, 233, 167, 125, 2809, 205, 164, - 117, 2707, 221, 156, 138, 2922, 240, 160, 146, 2952, 267, 177, 149, 3339, 271, 175, 136, 3006, 242, 168, - 141, 3068, 232, 194, 149, 2760, 214, 208, 143, 2811, 218, 184, 149, 137, 15486, 2116, 235, 167, 157, 2894, - 305, 184, 139, 3090, 345, 179, 155, 3226, 347, 160, 164, 3275, 321, 184, 174, 3240, 269, 166, 170, 3773, - 265, 169, 155, 3023, 301, 188, 161, 3343, 275, 174, 155, 3526, 309, 177, 173, 3546, 307, 183, 149, 3648, - 295, 213, 170, 3568, 305, 198, 166, 3641, 297, 172, 148, 3608, 301, 200, 159, 3693, 322, 209, 166, 3453, - 318, 206, 162, 3696, 341, 200, 176, 3386, 320, 192, 176, 3903, 373, 207, 187, 3305, 361, 200, 202, 3110, - 367, 220, 197, 2357, 332, 196, 201, 1827, 377, 187, 199, 860, 472, 173, 223, 238]; - const H263_FRAME_SIZE = - [ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244, - 5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165, - 24267, 36171, 18330, 53228, 7893, 13088, 9502, 8485, 9207, 8681, 9202, 8537, 7603, 9726, 8191, 51872, - 5535, 6146, 6341, 6933, 9365, 7828, 6547, 7638, 7009, 7025, 8873, 51045, 5056, 4858, 4887, 9614, 5953, - 5972, 6116, 6060, 6296, 6239, 6400, 50928, 4937, 5054, 5371, 6728, 6286, 6524, 6646, 6549, 6036, 6214, - 5866, 51109, 4778, 5273, 6327]; - const MPEG2_FRAME_SIZE = - [ 38462, 55096, 8660, 3417, 1197, 2209, 984, 718, 783, 623, 659, 694, 14174, 580, 421, 495, 480, 476, 534, - 660, 699, 601, 603, 720, 12585, 555, 532, 776, 789, 762, 766, 732, 671, 735, 777, 948, 12650, 827, 766, - 835, 747, 847, 940, 1121, 1092, 1001, 980, 989, 12746, 945, 912, 1046, 1118, 1134, 1050, 1073, 1051, 1195, - 1085, 1182, 12874, 992, 1007, 985, 1040, 1143, 1157, 1150, 1247, 1149, 1246, 1145, 12870, 1041, 1066, 1314, - 1239, 1283, 1223, 1224, 1270, 1427, 1406, 1516, 12949, 1228, 1299, 1439, 1358, 1455, 1311, 1396, 1416, 1470, - 1393, 1502, 12999, 1232, 1400, 1348, 1335, 1461, 1404, 1412, 1426, 1548, 1481, 1488, 12840, 1229, 1342, 1323, - 1353, 1524, 1363, 1475, 1540, 1495, 1489, 1438, 12762, 1291, 1303, 1470, 1494, 1488, 1474, 1453, 1607, 1485, - 1589, 1762, 12548, 1363, 1317, 1435, 1411, 1338, 1373, 1605, 1639, 1429, 1392, 1543, 12332, 1255, 1200, 1291, - 1337, 1341, 1356, 1214, 1456, 1353, 1314, 1502, 12151, 1192, 1290, 1203, 1284, 1154, 1264, 1358, 1390, 1433, - 1194, 1325, 11904, 993, 1007, 1149, 1099, 1182, 1076, 1074, 1092, 1030, 1272, 1178, 11710, 966, 879, 860, 955, - 898, 967, 927, 1066, 997, 1083, 940, 11717, 648, 705, 901, 925, 930, 868, 798, 846, 781, 825, 1027, 11587, 785, - 733, 731, 848, 753, 806, 699, 837, 750, 762, 748, 11541, 678, 742, 667, 735, 702, 837, 695, 773, 849, 869, 769, - 11381, 664, 705, 714, 698, 814, 846, 757, 802, 857, 905, 772, 11265, 718, 643, 597, 687, 774, 843, 747, 785, - 683, 1135, 676, 11259, 616, 595, 773, 746, 798, 722, 798, 790, 959, 771, 907, 11234, 705, 675, 773, 764, 846, - 789, 840, 853, 828, 774, 842, 11263, 758, 758, 757, 820, 847, 834, 884, 842, 988, 750, 952, 11236, 776, 640, 727, - 832, 855, 733, 822, 827, 862, 697, 924, 11176, 675, 615, 688, 818, 783, 746, 901, 834, 892, 759, 923, 11181, 661, - 578, 720, 697]; - const MPEG4_FRAME_SIZE = - [ 11895, 8109, 1578, 1616, 1313, 572, 805, 837, 755, 706, 952, 879, 13193, 422, 389, 509, 725, 465, 479, 959, - 677, 364, 541, 696, 9306, 322, 318, 767, 590, 422, 530, 403, 505, 566, 445, 508, 7783, 460, 405, 343, 451, - 608, 431, 411, 543, 487, 527, 400, 6287, 385, 418, 391, 592, 434, 412, 398, 504, 492, 479, 561, 5413, 317, - 355, 422, 467, 452, 476, 460, 490, 492, 485, 451, 5036, 312, 408, 460, 432, 502, 388, 475, 407, 544, 401, - 487, 4404, 362, 378, 427, 416, 426, 456, 414, 438, 424, 442, 444, 4310, 362, 388, 393, 390, 441, 398, 423, - 369, 443, 406, 392, 4231, 343, 363, 355, 390, 459, 371, 378, 381, 405, 392, 426, 3975, 387, 337, 393, 439, - 378, 355, 374, 484, 381, 373, 423, 3869, 312, 350, 400, 345, 356, 320, 473, 431, 386, 338, 431, 3426, 268, - 315, 416, 383, 373, 381, 354, 383, 328, 348, 418, 3715, 324, 361, 331, 350, 302, 409, 377, 359, 384, 334, - 326, 3439, 266, 324, 329, 353, 405, 303, 357, 332, 292, 361, 333, 3542, 294, 284, 247, 331, 306, 322, 287, - 367, 341, 276, 258, 3980, 246, 245, 259, 309, 333, 250, 275, 334, 281, 253, 371, 3640, 213, 231, 301, 302, - 228, 289, 290, 281, 201, 284, 277, 4242, 205, 328, 237, 283, 295, 266, 230, 321, 348, 212, 308, 4103, 259, - 238, 245, 298, 330, 265, 271, 287, 267, 286, 290, 3856, 269, 242, 209, 314, 267, 278, 280, 314, 250, 433, - 238, 3654, 195, 246, 301, 298, 250, 270, 320, 269, 305, 258, 368, 3810, 231, 212, 279, 289, 252, 303, 287, - 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, - 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, - 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fdRead; - let readpath; - let outputCnt = 0; - let inputCnt = 0; - let frameThreshold = 10; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = false; - inputEosFlag = false; - surfaceID = globalThis.value; - outputCnt = 0; - inputCnt = 0; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${error.message}`); - expect(err).assertUndefined(); - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - async function getFdRead(readPath, done) { - await mediaTestBase.getFdRead(readPath, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, len) { - console.info("case start get content"); - console.info("case start get content length is: " + len); - let lengthreal = -1; - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - console.info('case lengthreal is :' + lengthreal); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case: queueInput success '); - inputCnt += 1; - }, failCallback).catch(failCatch); - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1) { - nextStep(); - return; - } - frameCountOut++; - await videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.log('in case: release output count:' + frameCountOut); - }, failCallback).catch(failCatch); - } - - function setCallback(nextStep){ - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - outputCnt += 1; - if (outputCnt == 1 && outBuffer.flags == 1) { - console.info("case error occurs! first output is EOS"); - expect().assertFail(); - } - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - console.info('in case: setCallback out'); - } - - async function toCreateVideoDecoderByMime(mime, done) { - await media.createVideoDecoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByMime success'); - } else { - console.info('in case : createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - async function toCreateVideoDecoderByName(name, done) { - await media.createVideoDecoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByName success'); - } else { - console.info('in case : createVideoDecoderByName fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - async function toConfigure(mediaDescription, srcPath) { - await videoDecodeProcessor.configure(mediaDescription).then(() =>{ - console.info('in case : configure success'); - }, failCallback).catch(failCatch); - } - async function toSetOutputSurface(isDisplay) { - await videoDecodeProcessor.setOutputSurface(surfaceID, isDisplay).then(() => { - console.info('in case : setOutputSurface success. surfaceID ' + surfaceID); - }, failCallback).catch(failCatch); - } - eventEmitter.on('nextStep', async (done) => { - console.info('in case : nextStep success'); - await videoDecodeProcessor.stop().then(() => { - console.info('in case : stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('in case : reset success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.release().then(() => { - console.info('in case : release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - expect(outputCnt).assertClose(inputCnt, frameThreshold); - console.info('in case : done'); - done(); - }); - async function toPrepare() { - await videoDecodeProcessor.prepare().then(() => { - console.info('in case : prepare success'); - }, failCallback).catch(failCatch); - } - async function toStart() { - await videoDecodeProcessor.start().then(() => { - console.info('in case : start success'); - }, failCallback).catch(failCatch); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_H264_PROMISE_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_H264_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByName('avdec_h264', done); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG2_PROMISE_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG2_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG2_FRAME_SIZE; - let srcPath = 'MPEG2_720_480.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mpeg2', - 'width': 720, - 'height': 480, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByName('avdec_mpeg2video', done); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG4_PROMISE_0100 - * @tc.name : 001.basic Video decode function - * @tc.desc : start-> EOS -> stop -> reset - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_MPEG4_PROMISE_0100', 0, async function (done) { - ES_FRAME_SIZE = MPEG4_FRAME_SIZE; - let srcPath = 'mpeg4_320_240.es'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/mp4v-es', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByName('avdec_mpeg4', done); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0600 - * @tc.name : test reconfigure for new file with the same format - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0600', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByName('avdec_h264', done); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - eventEmitter.once('reConfigure_for_promise_01_0600', async (done) => { - console.info('in case : reConfigure_for_promise_01_0600 success'); - await videoDecodeProcessor.stop().then(() => { - console.info('in case : stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('in case : reset success'); - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - readStreamSync = null; - await getFdRead(readpath, done); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - surfaceID = globalThis.value; - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }); - setCallback( - function(){eventEmitter.emit('reConfigure_for_promise_01_0600', done);} - ); - await toPrepare(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0700 - * @tc.name : test reconfigure for new file with the different format - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0700', 0, async function (done) { - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - isCodecData = true; - let srcPath = 'out_320_240_10s.h264'; - readpath = srcPath; - await getFdRead(readpath, done); - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - await toCreateVideoDecoderByName('avdec_h264', done); - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - srcPath = 'out_320_240_10s.h264'; - mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60.00, - 'max_input_size': 150000, - } - eventEmitter.on('reConfigure_for_promise_01_0700', async (done) => { - console.info('in case : reConfigure_for_promise_01_0700 success'); - await videoDecodeProcessor.stop().then(() => { - console.info('in case : stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('in case : reset success'); - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - readStreamSync = null; - ES_FRAME_SIZE = H264_FRAME_SIZE_240; - readpath = srcPath; - await getFdRead(readpath, done); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - surfaceID = globalThis.value; - await toConfigure(mediaDescription, srcPath); - await toSetOutputSurface(true); - setCallback( - function(){eventEmitter.emit('nextStep', done);} - ); - await toPrepare(); - await toStart(); - }); - setCallback( - function(){eventEmitter.emit('reConfigure_for_promise_01_0700', done);} - ); - await toPrepare(); - await toStart(); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js deleted file mode 100644 index 84bac542324d1308ec307668735f35de0410ba85..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js +++ /dev/null @@ -1,1284 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const DECODE_STEP = { - WAIT_FOR_EOS : 'waitForEOS', - CONFIGURE : 'configure', - SETSURFACE : 'setSurface', - PREPARE : 'prepare', - START : 'start', - FLUSH : 'flush', - STOP : 'stop', - RESET : 'reset', - WAIT_FOR_ALL_OUTS : 'waitForAllOuts', - ERROR : 'error', - RELEASE : 'release', -} - -describe('VideoDecoderSoftwareReliCallbackTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let position = 0; - let eosFrameId = -1; - let inputQueue = []; - let outputQueue = []; - let isCodecData = true; - let inputEosFlag = false; - let workdoneAtEOS = false; - let surfaceID = ''; - const SRCPATH = 'out_320_240_10s.h264'; - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60, - 'max_input_size': 150000, - } - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; - let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fdRead; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - workdoneAtEOS = false; - eosFrameId = -1; - inputEosFlag = false; - position = 0; - surfaceID = globalThis.value; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - let failCallback = function(err) { - console.info(`in case error failCallback called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let failCatch = function(err) { - console.info(`in case error failCatch called,errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - function printError(err, expectFail) { - expect((err != undefined) == expectFail).assertTrue(); - if (expectFail == false && err != undefined) { - console.info('in case error failCatch called,err is ' + err); - console.info(`in case error failCatch called,errMessage is ${err.message}`); - } - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, pos, len) { - console.info('start get content, len ' + len + ' buf.byteLength ' + buf.byteLength); - let lengthReal = -1; - try { - if (pos == -1) { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - }); - } else { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - position: pos, - }); - } - console.info('in case: lengthReal: ' + lengthReal); - } catch(e) { - console.error('in case error getContent err ' + err); - } - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, position, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - position = position + ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 1000 / mediaDescription.frame_rate; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length || frameCountIn == eosFrameId) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject, (err) => { - console.info('in case: queueInput success '); - }) - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1 ) { - if (workdoneAtEOS) { - doneWork(nextStep); - } - return; - } - frameCountOut++; - videoDecodeProcessor.freeOutputBuffer(outputObject, () => { - console.log('in case: release output count:' + frameCountOut); - }) - } - - function toConfigure(mySteps, done, expectFail) { - videoDecodeProcessor.configure(mediaDescription, (err) => { - console.info(`case configure callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }) - } - function toPrepare(mySteps, done, expectFail) { - videoDecodeProcessor.prepare((err) => { - console.info(`case prepare callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toStart(mySteps, done, expectFail) { - let timeDelay = 0; - videoDecodeProcessor.start((err) => { - console.info(`case start callback`); - printError(err, expectFail); - if (mySteps[0] == DECODE_STEP.FLUSH) { - timeDelay = 50; - } - setTimeout(() => { - toNextStep(mySteps, done); - }, timeDelay); - }); - } - function toFlush(mySteps, done, expectFail) { - videoDecodeProcessor.flush((err) => { - console.info(`case flush callback`); - printError(err, expectFail); - if (expectFail == false) { - inputEosFlag = false; - position = ES_FRAME_SIZE[0]; - inputQueue = []; - timestamp = 0; - frameCountIn = 1; - } - toNextStep(mySteps, done); - }); - } - function toStop(mySteps, done, expectFail) { - videoDecodeProcessor.stop((err) => { - console.info(`case stop callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toReset(mySteps, done, expectFail) { - videoDecodeProcessor.reset((err) => { - console.info(`case reset callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toSetOutputSurface(mySteps, done, expectFail) { - videoDecodeProcessor.setOutputSurface(surfaceID, true, (err) => { - console.info('case setOutputSurface callback, surfaceID ' + surfaceID); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - - function toNextStep(mySteps, done) { - console.info('case myStep[0]: ' + mySteps[0]); - if (mySteps[0] == DECODE_STEP.RELEASE) { - if (videoDecodeProcessor != null){ - videoDecodeProcessor.release((err) => { - printError(err, false); - console.info('in case : videoDecodeProcessor release callback'); - videoDecodeProcessor = null; - console.info('case to done'); - done(); - }); - } - return; - } - switch (mySteps[0]) { - case DECODE_STEP.CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toConfigure(mySteps, done, true); - } else { - toConfigure(mySteps, done, false); - } - break; - case DECODE_STEP.SETSURFACE: - mySteps.shift(); - console.info(`case to setOutputSurface`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toSetOutputSurface(mySteps, done, true); - } else { - toSetOutputSurface(mySteps, done, false); - } - break; - case DECODE_STEP.PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toPrepare(mySteps, done, true); - } else { - toPrepare(mySteps, done, false); - } - break; - case DECODE_STEP.START: - mySteps.shift(); - console.info(`case to start`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toStart(mySteps, done, true); - } else { - readStreamSync = undefined; - frameCountIn = 0; - frameCountOut = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - position = 0; - toStart(mySteps, done, false); - } - break; - case DECODE_STEP.FLUSH: - mySteps.shift(); - console.info(`case to flush`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toFlush(mySteps, done, true); - } else { - toFlush(mySteps, done, false); - } - break; - case DECODE_STEP.STOP: - mySteps.shift(); - console.info(`case to stop`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toStop(mySteps, done, true); - } else { - toStop(mySteps, done, false); - } - break; - case DECODE_STEP.RESET: - mySteps.shift(); - console.info(`case to reset`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toReset(mySteps, done, true); - } else { - toReset(mySteps, done, false); - } - break; - case DECODE_STEP.WAIT_FOR_EOS: - mySteps.shift(); - setTimeout(() =>{ - expect(inputEosFlag).assertTrue(); - if (inputEosFlag == false) { - console.info(`in case error wait for eos: inputEosFlag = false`); - } - toNextStep(mySteps, done); - }, 7000); // wait 7000 ms for eos - break; - case DECODE_STEP.WAIT_FOR_ALL_OUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - default: - break; - } - } - - function setCallback(nextStep){ - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - } - - function toCreateVideoDecoderByMime(mime, mySteps, done) { - media.createVideoDecoderByMime(mime, (err, processor) => { - console.info(`case createVideoDecoderByMime callback`); - printError(err, false); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }) - } - async function toCreateVideoDecoderByName(name, mySteps, done) { - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - await media.createVideoDecoderByName(name, (err, processor) => { - printError(err, false); - console.info(`case createVideoDecoderByName callback`); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }) - } - async function doneWork(nextStep) { - videoDecodeProcessor.stop((err) => { - printError(err, false); - console.info('case stop callback'); - videoDecodeProcessor.reset((err) => { - printError(err, false); - console.info('case reset callback'); - videoDecodeProcessor.release((err) => { - printError(err, false); - console.info('case release callback'); - videoDecodeProcessor = null; - nextStep(); - }) - }) - }) - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0100 - * @tc.name : test set EOS manually before last frame and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0200 - * @tc.name : test flush at running state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0300 - * @tc.name : test flush at EOS state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - eosFrameId = 10; - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0400 - * @tc.name : test stop at running state and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0500 - * @tc.name : test stop and restart - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0100 - * @tc.name : 001.create -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0300 - * @tc.name : 003.start -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_CALLBACK_0900', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS , - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0100 - * @tc.name : 001.create -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0200 - * @tc.name : 002.configure -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0400 - * @tc.name : 004.start -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0500 - * @tc.name : 005.flush -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0600 - * @tc.name : 006.stop -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.START, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0800 - * @tc.name : 008.reset -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0100 - * @tc.name : 001.create -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.FLUSH, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0400 - * @tc.name : 004.start -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP , DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0100 - * @tc.name : 001.create -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.STOP, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0400 - * @tc.name : 004.start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0100 - * @tc.name : 001.create -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.RESET, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0400 - * @tc.name : 004.start -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_CALLBACK_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_CALLBACK_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) -}) diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js deleted file mode 100644 index 3f483dcbec46c741663d91b131b489ec4bf21c82..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js +++ /dev/null @@ -1,1279 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import router from '@system.router' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const DECODE_STEP = { - WAIT_FOR_EOS : 'waitForEOS', - CONFIGURE : 'configure', - SETSURFACE : 'setSurface', - PREPARE : 'prepare', - START : 'start', - FLUSH : 'flush', - STOP : 'stop', - RESET : 'reset', - WAIT_FOR_ALL_OUTS : 'waitForAllOuts', - ERROR : 'error', - RELEASE : 'release', -} - -describe('VideoDecoderSoftwareReliPromiseTest', function () { - let videoDecodeProcessor = null; - let readStreamSync = undefined; - let frameCountIn = 0; - let frameCountOut = 0; - let timestamp = 0; - let position = 0; - let eosFrameId = -1; - let inputQueue = []; - let outputQueue = []; - let isCodecData = true; - let inputEosFlag = false; - let workdoneAtEOS = false; - let surfaceID = ''; - const SRCPATH = 'out_320_240_10s.h264'; - let mediaDescription = { - 'track_type': 1, - 'codec_mime': 'video/avc', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 60, - 'max_input_size': 150000, - } - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122, - 2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162, - 122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149, - 2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162, - 140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147, - 130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144, - 122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613, - 187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049, - 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, - 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; - let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fdRead; - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await toDisplayPage().then(() => { - }, failCallback).catch(failCatch); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - frameCountIn = 0; - frameCountOut = 0; - timestamp = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - workdoneAtEOS = false; - eosFrameId = -1; - inputEosFlag = false; - position = 0; - surfaceID = globalThis.value; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoDecodeProcessor != null) { - await videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await router.clear().then(() => { - }, failCallback).catch(failCatch); - await fileio.close(fdRead); - }) - - afterAll(async function() { - console.info('afterAll case'); - }) - let caseCallback = function(err) { - console.info(`in case caseCallback called, caseMessage is ${err.message}`); - } - let failCallback = function(err) { - console.error(`in case error failCallback called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let failCatch = function(err) { - console.error(`in case error failCatch called,errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let callbackExpectOK = function(err, mySteps, done) { - console.error(`in case error callbackExpectOK called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - toNextStep(mySteps, done); - } - let callbackExpectFail = function(err, mySteps, done) { - console.info(`in case callbackExpectFail called, errMessage is ${err.message}`); - expect(err != undefined).assertTrue(); - toNextStep(mySteps, done); - } - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - async function toDisplayPage() { - let path = 'pages/display/display'; - let options = { - uri: path, - } - try { - await router.push(options); - } catch (e) { - console.error('in case toDisplayPage' + e); - } - } - - function readFile(path) { - console.info('case read file start execution'); - try{ - console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); - }catch(e) { - console.info(e); - } - } - - function getContent(buf, pos, len) { - console.info('start get content, len ' + len + ' buf.byteLength ' + buf.byteLength); - let lengthReal = -1; - try { - if (pos == -1) { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - }); - } else { - lengthReal = fileio.readSync(fdRead, buf, { - length: len, - position: pos, - }); - } - console.info('in case: lengthReal: ' + lengthReal); - } catch(e) { - console.error('in case error getContent err ' + err); - } - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - console.log('in case: inputObject.index: ' + inputObject.index); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, position, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - position = position + ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 1000 / mediaDescription.frame_rate; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length || frameCountIn == eosFrameId) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case: queueInput success '); - }, caseCallback).catch(failCatch); - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(nextStep, outputObject) { - if (outputObject.flags == 1 ) { - if (workdoneAtEOS) { - await doneWork(); - nextStep(); - } - return; - } - frameCountOut++; - videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('in case: release output success'); - console.log('in case: release output count:' + frameCountOut); - }, caseCallback).catch(failCatch); - } - - function toConfigure(mySteps, done, failureCallback, catchCallback) { - videoDecodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - function toPrepare(mySteps, done, failureCallback, catchCallback) { - videoDecodeProcessor.prepare().then(() => { - console.info(`case prepare success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - function toStart(mySteps, done, failureCallback, catchCallback) { - let timeDelay = 0; - videoDecodeProcessor.start().then(() => { - console.info(`case start success`); - if (mySteps[0] == DECODE_STEP.FLUSH) { - timeDelay = 50; - } - setTimeout(() => { - toNextStep(mySteps, done); - }, timeDelay); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - function toFlush(mySteps, done, failureCallback, catchCallback) { - videoDecodeProcessor.flush().then(() => { - console.info(`case flush success`); - position = ES_FRAME_SIZE[0]; - inputQueue = []; - timestamp = 0; - inputEosFlag = false; - frameCountIn = 1; - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - function toStop(mySteps, done, failureCallback, catchCallback) { - videoDecodeProcessor.stop().then(() => { - console.info(`case stop success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - function toReset(mySteps, done, failureCallback, catchCallback) { - videoDecodeProcessor.reset().then(() => { - console.info(`case reset success`); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - function toSetOutputSurface(mySteps, done, failureCallback, catchCallback) { - videoDecodeProcessor.setOutputSurface(surfaceID, true).then(() => { - console.info('in case : setOutputSurface success, surfaceID ' + surfaceID); - toNextStep(mySteps, done); - }, (err) => {failureCallback(err, mySteps, done)}).catch(catchCallback); - } - - function toNextStep(mySteps, done) { - console.info('case myStep[0]: ' + mySteps[0]); - if (mySteps[0] == DECODE_STEP.RELEASE) { - if (videoDecodeProcessor != null) { - videoDecodeProcessor.release().then(() => { - console.info('in case : videoDecodeProcessor release success'); - videoDecodeProcessor = null; - console.info('case to done'); - done(); - }, failCallback).catch(failCatch); - } - return; - } - switch (mySteps[0]) { - case DECODE_STEP.CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toConfigure(mySteps, done, callbackExpectFail, failCatch); - } else { - toConfigure(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.SETSURFACE: - mySteps.shift(); - console.info(`case to setOutputSurface`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toSetOutputSurface(mySteps, done, callbackExpectFail, failCatch); - } else { - toSetOutputSurface(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toPrepare(mySteps, done, callbackExpectFail, failCatch); - } else { - toPrepare(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.START: - mySteps.shift(); - console.info(`case to start`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toStart(mySteps, done, callbackExpectFail, failCatch); - } else { - readStreamSync = undefined; - frameCountIn = 0; - frameCountOut = 0; - inputQueue = []; - outputQueue = []; - isCodecData = true; - inputEosFlag = false; - position = 0; - toStart(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.FLUSH: - mySteps.shift(); - console.info(`case to flush`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toFlush(mySteps, done, callbackExpectFail, failCatch); - } else { - toFlush(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.STOP: - mySteps.shift(); - console.info(`case to stop`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toStop(mySteps, done, callbackExpectFail, failCatch); - } else { - toStop(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.RESET: - mySteps.shift(); - console.info(`case to reset`); - if (mySteps[0] == DECODE_STEP.ERROR) { - mySteps.shift(); - toReset(mySteps, done, callbackExpectFail, failCatch); - } else { - toReset(mySteps, done, callbackExpectOK, failCatch); - } - break; - case DECODE_STEP.WAIT_FOR_EOS: - mySteps.shift(); - setTimeout(async() =>{ - expect(inputEosFlag).assertTrue(); - if (inputEosFlag == false) { - console.info(`in case error inputEosFlag == false`); - } - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - toNextStep(mySteps, done); - }, 7000); // wait 7000 ms for eos - break; - case DECODE_STEP.WAIT_FOR_ALL_OUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - default: - break; - } - } - - function setCallback(nextStep){ - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - dequeueOutputs(nextStep, outBuffer); - }); - - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoDecodeProcessor.on('streamChanged', (format) => { - console.info('in case: Output format changed: ' + format.toString()); - }); - } - - function toCreateVideoDecoderByMime(mime, mySteps, done) { - media.createVideoDecoderByMime(mime).then((processor) => { - console.info(`case createVideoDecoderByMime success`); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }, failCallback).catch(failCatch); - } - async function toCreateVideoDecoderByName(name, mySteps, done) { - await mediaTestBase.getFdRead(SRCPATH, done).then((fdNumber) => { - fdRead = fdNumber; - }) - await media.createVideoDecoderByName(name).then((processor) => { - console.info(`case createVideoDecoderByName success`); - videoDecodeProcessor = processor; - setCallback(done); - toNextStep(mySteps, done); - }, failCallback).catch(failCatch); - } - async function doneWork() { - await videoDecodeProcessor.stop().then(() => { - console.info('case stop success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.reset().then(() => { - console.info('case reset success'); - }, failCallback).catch(failCatch); - await videoDecodeProcessor.release().then(() => { - console.info('case release success'); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0100 - * @tc.name : test set EOS manually before last frame and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0200 - * @tc.name : test flush at running state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.WAIT_FOR_ALL_OUTS); - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0300 - * @tc.name : test flush at EOS state - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_ALL_OUTS); - eosFrameId = 10; - workdoneAtEOS = true; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0400 - * @tc.name : test stop at running state and reset - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0500 - * @tc.name : test stop and restart - * @tc.desc : test basic function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0100 - * @tc.name : 001.create -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0300 - * @tc.name : 003.start -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.CONFIGURE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_CONFIGURE_PROMISE_0900', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS , - DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_PREPARE_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.PREPARE, DECODE_STEP.ERROR, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0100 - * @tc.name : 001.create -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0200 - * @tc.name : 002.configure -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0400 - * @tc.name : 004.start -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0500 - * @tc.name : 005.flush -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0600 - * @tc.name : 006.stop -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.START, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0800 - * @tc.name : 008.reset -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_START_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.START, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0100 - * @tc.name : 001.create -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.FLUSH, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0400 - * @tc.name : 004.start -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP , DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_FLUSH_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.FLUSH, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0100 - * @tc.name : 001.create -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.STOP, - DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0400 - * @tc.name : 004.start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_STOP_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.STOP, DECODE_STEP.ERROR, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0100 - * @tc.name : 001.create -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.RESET, - DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0400 - * @tc.name : 004.start -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.FLUSH, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0600', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.STOP, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0700', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_RESET_PROMISE_0800', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.RESET, DECODE_STEP.RESET, DECODE_STEP.RELEASE); - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0100', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0200', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.FLUSH, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0300', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.RESET, DECODE_STEP.CONFIGURE, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0400', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_DECODER_API_EOS_PROMISE_0500', 0, async function (done) { - let mySteps = new Array(DECODE_STEP.CONFIGURE, DECODE_STEP.SETSURFACE, DECODE_STEP.PREPARE, DECODE_STEP.START, - DECODE_STEP.WAIT_FOR_EOS, DECODE_STEP.STOP, DECODE_STEP.START, DECODE_STEP.STOP, DECODE_STEP.RELEASE); - eosFrameId = 10; - toCreateVideoDecoderByName('avdec_h264', mySteps, done); - }) -}) diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40f7360d5d818998221b199d3ec0f69c0..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/info.txt b/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/info.txt deleted file mode 100644 index 9632a32a7e0b92c0b921db34929e0f03c26a84df..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/info.txt +++ /dev/null @@ -1 +0,0 @@ -streamId:0 pts:0 pts_time:0.000000 size:197165 flag:1 \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/mp3_MP3.mp3 b/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/mp3_MP3.mp3 deleted file mode 100644 index 2ac11d0b213c4686d6138e4234054ca13a15c63d..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoDecoder/src/main/resources/base/media/mp3_MP3.mp3 and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoEncoder/BUILD.gn b/multimedia/media/media_js_standard/videoEncoder/BUILD.gn deleted file mode 100644 index b9f66aae08635cceffb949cab1dbb3f296fe89f3..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("video_encoder_js_hap") { - hap_profile = "./src/main/config.json" - js2abc = true - deps = [ - ":video_encoder_js_assets", - ":video_encoder_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsVideoEncoderJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_player_framework" -} -ohos_js_assets("video_encoder_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("video_encoder_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/media/media_js_standard/videoEncoder/Test.json b/multimedia/media/media_js_standard/videoEncoder/Test.json deleted file mode 100644 index 8e438a0239b5cddfa0a4b1549aa6dc1895391377..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/Test.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Configuration for videoEncoder Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "2000000", - "package": "ohos.acts.multimedia.video.videoencoder", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsVideoEncoderJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "rm -rf /storage/media/100/local/files/*", - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/", - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/" - ], - "teardown-command":[ - ] - }, - { - "type": "PushKit", - "pre-push": [ - ], - "push": [ - "./resource/media/es/mpeg4_320_240.es ->/data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/", - "./resource/media/es/out_320_240_10s.h264 ->/data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/", - "chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.video.videoencoder/haps/entry/files/*" - ], - "teardown-command":[ - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/videoEncoder/signature/openharmony_sx.p7b deleted file mode 100644 index 7c21783c7ef7f146001fff5e15f554dd869f0208..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoEncoder/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/config.json b/multimedia/media/media_js_standard/videoEncoder/src/main/config.json deleted file mode 100644 index f0db2a1501a0b67ab03feeb448b682ae95fd6d5b..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/config.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.video.videoencoder", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.video.videoencoder.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "standard" - } - ], - "deviceType": [ - "default", - "default", - "tablet", - "tv", - "wearable" - ], - "reqPermissions": [ - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.MEDIA_LOCATION", - "reason" : "use ohos.permission.MEDIA_LOCATION" - }, - { - "name" : "ohos.permission.READ_MEDIA", - "reason" : "use ohos.permission.READ_MEDIA" - }, - { - "name" : "ohos.permission.WRITE_MEDIA", - "reason" : "use ohos.permission.WRITE_MEDIA" - } - ], - "mainAbility": "ohos.acts.multimedia.video.videoencoder.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.video.videoencoder", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js deleted file mode 100644 index 830070d196d86b127cea947d168bfd116f446205..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/i18n/en-US.json b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/i18n/zh-CN.json b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css deleted file mode 100644 index c9195944a956c0d5628c701b7a3d9d2ed525cd2d..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 8d0e2061b88c99c91488405f0f2ead0c77de1a9e..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js deleted file mode 100644 index 67f8b8567ccc4932331b7a18a6b947340d84fb40..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 60000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/List.test.js deleted file mode 100644 index f0fd606b94b310ee0319113e1c8adaa450c00335..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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. - */ - -require('./VideoEncoderHardwareFuncPromiseTest.test.js') diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js deleted file mode 100644 index 92ba892ac25d6b58aa9c2e825c317d1be4a16118..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('VideoEncoderEnum', function () { - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - }) - - afterEach(function() { - console.info('afterEach case'); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - - /* * - * @tc.number : SUB_MEDIA_VIDEO_ENCODER_ENUM_VideoEncodeBitrateMode_0100 - * @tc.name : 001.VideoEncodeBitrateMode - * @tc.desc : Test Enumerate VideoEncodeBitrateMode - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_VideoEncodeBitrateMode_0100', 0, async function (done) { - expect(media.VideoEncodeBitrateMode.CBR).assertEqual(0); - expect(media.VideoEncodeBitrateMode.VBR).assertEqual(1); - expect(media.VideoEncodeBitrateMode.CQ).assertEqual(2); - done(); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncCallbackTest.test.js deleted file mode 100644 index 709959b5a7ec6bbc00b34f3bc8043c98669a29c3..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncCallbackTest.test.js +++ /dev/null @@ -1,801 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; - -describe('videoHardwareEncoderFuncCallback', function () { - let videoEncodeProcessor; - let surfaceID = ''; - let outputQueue = []; - let videoDecodeProcessor = null; - let frameCountIn = 0; - let timestamp = 0; - let isCodecData = true; - let inputEosFlag = false; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - let ES_FRAME_SIZE = []; - let fdRead; - let position = 0; - let DECinputCnt = 0; - let DECoutputCnt = 0; - let ENCoutputCnt = 0; - let outputCntDec = 0; - let outputCntEnc = 0; - let frameThreshold = 0.1; - let needSetEos = true; - let isInputEnd = false; - let outputEncEos = false; - let isFormatSame = true; - let pixelFormat = 0; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 2, - 'frame_rate': 60, - } - let mediaDescription2 = { - 'width': 320, - 'height': 240, - 'pixel_format': 2, - 'frame_rate': 60, - 'max_input_size': 150000, - } - let mime = 'video/avc'; - let srcPath = 'out_320_240_10s.h264' - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122]; - let lockFlag = false; - let needRelease = false; - let needStop = false; - let needFlush = false; - let needReset = false; - let needGetMediaDes = true; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - DECinputCnt = 0; - DECoutputCnt = 0; - ENCoutputCnt = 0; - frameCountIn = 0; - timestamp = 0; - isCodecData = true; - inputEosFlag = false; - position = 0; - outputCntDec = 0; - outputCntEnc = 0; - needSetEos = true; - isInputEnd = false; - outputEncEos = false; - lockFlag = false; - needRelease = false; - needStop = false; - needFlush = false; - needReset = false; - needGetMediaDes = true; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null){ - await videoEncodeProcessor.release().then(() => { - console.info("case release videoDecodeProcessor success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - if (videoDecodeProcessor != null){ - await videoDecodeProcessor.release().then(() => { - console.info("case release videoDecodeProcessor success"); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function getContent(buf, poi, len) { - console.info("case start get content"); - console.info("case start get content length is: " + len); - let lengthreal = -1; - try { - if (poi == -1) { - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - } else { - lengthreal = fileio.readSync(fdRead, buf, {length:len, position: poi}); - } - console.info('case lengthreal is :' + lengthreal); - } catch(e) { - console.info('case getContent error :' + e); - } - } - - async function getFdRead(pathName, done) { - await mediaTestBase.getFdRead(pathName, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - async function dequeueOutputs(done) { - while (outputQueue.length > 0 && !outputEncEos) { - let outputObject = outputQueue.shift(); - outputCntEnc += 1; - if (outputObject.flags == 1) { - if (outputCntEnc == 1) { - console.info('in case ENC ERROR, first output is EOS'); - expect().assertFail(); - } - outputEncEos = true; - console.info('in case ENC: output EOS'); - eventEmitter.emit('endOfEos', done); - } else { - console.info('in case ENC not last frame, continue'); - if (!lockFlag) { - videoEncodeProcessor.freeOutputBuffer(outputObject, (err) => { - if (typeof(err) == 'undefined') { - console.info('in case ENC release output success'); - ENCoutputCnt += 1; - console.info('in case ENC: ENCoutputCnt is ' + ENCoutputCnt); - } else { - console.info(`in case release output called,errMessage is ${err.message}`); - } - }); - } - } - } - } - - function setCallbackEnc(done) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('in case ENC outputBufferAvailable'); - if (needGetMediaDes) { - videoEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes = false; - }, failCallback).catch(failCatch); - } - console.info('in case ENC outBuffer.flags: ' + outBuffer.flags); - outputQueue.push(outBuffer); - dequeueOutputs(done); - }); - videoEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - function setCallbackDec() { - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case DEC: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case DEC: outputBufferAvailable outBuffer.flags: '+ outBuffer.flags); - outputCntDec += 1; - if (outBuffer.flags == 1) { - if (outputCntDec == 1) { - console.info('in case DEC ERROR, first output is EOS'); - expect().assertFail(); - } else { - await videoEncodeProcessor.notifyEndOfStream(); - } - } - if (outBuffer.flags == 0 && !lockFlag) { - await videoDecodeProcessor.renderOutputData(outBuffer).then(() => { - DECoutputCnt += 1; - console.info('in case DEC: DECoutputCnt is ' + DECoutputCnt); - }, failCallback).catch(failCatch); - } - }); - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case DEC: Output format changed: ' + format.toString()); v - }); - console.info('in case DEC: setCallback out'); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - if (inputEosFlag == false && isInputEnd == false) { - console.log('in case DEC: not see input EOS'); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, position, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - position = position + ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - if (needSetEos) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - isInputEnd = true; - } - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case DEC: queueInput success '); - DECinputCnt += 1; - console.info('in case DEC: DECinputCnt is ' + DECinputCnt); - }, failCallback).catch(failCatch); - } - } - - function resetReadParam() { - console.info('case read from start'); - position = 0; - inputEosFlag = false; - frameCountIn = 0; - isCodecData = true; - } - - function resetStateParam() { - console.info('case init state parameter'); - outputCntEnc = 0; - DECinputCnt = 0; - DECoutputCnt = 0; - ENCoutputCnt = 0; - outputEncEos = false; - needSetEos = true; - isInputEnd = false; - needRelease = false; - needStop = false; - needFlush = false; - needReset = false; - } - - eventEmitter.on('toCreateVideoEnc', (encFormat, decFormat, mediaDescriptionEnc, mediaDescriptionDec, done) => { - media.createVideoEncoderByMime(encFormat, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('in case ENC : create createVideoEncoderByMime success'); - videoEncodeProcessor = processor; - eventEmitter.emit('toCreateVideoDec', decFormat, mediaDescriptionEnc, mediaDescriptionDec, done); - } else { - console.info('case create createVideoEncoderByMime fail'); - expect().assertFail(); - done(); - } - }); - }); - eventEmitter.on('toConfigureEnc', (mediaDescriptionEnc, mediaDescriptionDec, done) => { - console.info('in case ENC: configure in'); - videoEncodeProcessor.configure(mediaDescriptionEnc, async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: configure success'); - setCallbackEnc(done); - eventEmitter.emit('toConfigureDec', mediaDescriptionDec, done); - }); - }); - eventEmitter.on('toGetInputSurface', (done) => { - videoEncodeProcessor.getInputSurface((err, inputSurface) => { - expect(err).assertUndefined(); - if (inputSurface != undefined) { - surfaceID = inputSurface; - console.info('in case ENC: getInputSurface success, surfaceID ' + surfaceID); - eventEmitter.emit('toSetOutputSurface'); - } else { - console.info('in case ENC: inputSurface is undefined'); - expect(inputSurface != undefined).assertTrue(); - done(); - } - }) - }); - eventEmitter.on('toPrepareEnc', () => { - videoEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case ENC: prepare success'); - eventEmitter.emit('toStartEnc'); - }); - }); - eventEmitter.on('toStartEnc', () => { - videoEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case ENC: start success'); - eventEmitter.emit('toPrepareDec'); - }); - }); - eventEmitter.on('toFlushEnc', () => { - lockFlag = true; - videoEncodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info('in case ENC: flush success'); - lockFlag = false; - }); - }); - eventEmitter.on('toStopEnc', () => { - videoEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info('in case ENC: stop success'); - }); - }); - eventEmitter.on('toResetEnc', () => { - videoEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info('in case ENC: reset success'); - }); - }); - eventEmitter.on('toReleaseEnc', () => { - videoEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info('in case ENC: release success'); - videoEncodeProcessor = null; - }); - }); - - eventEmitter.on('toCreateVideoDec', (decFormat, mediaDescriptionEnc, mediaDescriptionDec, done) => { - media.createVideoDecoderByMime(decFormat, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('in case DEC: create createVideoDecoderByMime success'); - videoDecodeProcessor = processor; - eventEmitter.emit('toConfigureEnc', mediaDescriptionEnc, mediaDescriptionDec, done); - } else { - console.info('case create createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }); - }) - eventEmitter.on('toConfigureDec', (mediaDescriptionDec, done) => { - console.info('in case DEC: configure in'); - videoDecodeProcessor.configure(mediaDescriptionDec, async(err) => { - expect(err).assertUndefined(); - console.info('in case DEC: configure success'); - setCallbackDec(done); - eventEmitter.emit('toGetInputSurface', done); - }); - }); - eventEmitter.on('toSetOutputSurface', () => { - videoDecodeProcessor.setOutputSurface(surfaceID, false, (err) => { - expect(err).assertUndefined(); - console.info('in case DEC: setOutputSurface success. surfaceID ' + surfaceID); - eventEmitter.emit('toPrepareEnc'); - }) - }); - eventEmitter.on('toPrepareDec', () => { - videoDecodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case DEC: prepare success'); - eventEmitter.emit('toStartDec'); - }); - }); - eventEmitter.on('toStartDec', () => { - videoDecodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case DEC: start success'); - }); - }); - async function toStartDec() { - await videoDecodeProcessor.start().then(() => { - console.info("in case DEC: start success"); - }, failCallback).catch(failCatch); - } - async function toStartEnc() { - await videoEncodeProcessor.start().then(() => { - console.info("in case ENC: start success"); - }, failCallback).catch(failCatch); - } - async function toFlushDec() { - lockFlag = true; - await videoDecodeProcessor.flush().then(() => { - console.info("in case DEC: flush success"); - lockFlag = false; - }, failCallback).catch(failCatch); - } - - async function toStopDec() { - lockFlag = true; - await videoDecodeProcessor.stop().then(() => { - console.info("in case DEC: stop success"); - lockFlag = false; - }, failCallback).catch(failCatch); - } - - async function toResetDec() { - await videoDecodeProcessor.reset().then(() => { - console.info("in case DEC: reset success"); - }, failCallback).catch(failCatch); - } - - async function toReleaseDec() { - await videoDecodeProcessor.release().then(() => { - console.info("case release videoDecodeProcessor success"); - videoDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - - function checkFormat(done) { - if (!isFormatSame) { - console.info('case decoder and encoder pixelformat is not the same'); - expect().assertFail(); - done(); - } - } - - eventEmitter.on('endOfEos', async(done) => { - expect(outputEncEos).assertTrue(); - expect(DECoutputCnt).assertClose(ES_FRAME_SIZE.length, frameThreshold); - expect(ENCoutputCnt).assertClose(ES_FRAME_SIZE.length, frameThreshold); - if (needRelease) { - videoEncodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: release success'); - videoEncodeProcessor = null; - await toReleaseDec(); - done(); - }); - } else if (needStop) { - eventEmitter.emit('stopAtEos'); - } else if (needFlush) { - eventEmitter.emit('flushAtEos'); - } else if (needReset) { - eventEmitter.emit('resetAtEos'); - } else { - eventEmitter.emit('releaseAtEos'); - } - }); - - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0100 - * @tc.name : 000.test video software encoder capbility - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0100', 0, async function (done) { - console.info("test video encoder capbility"); - let supportedEncForm = []; - let supportedDecForm = []; - await media.createVideoEncoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case ENC: createVideoEncoderByMime success'); - } else { - console.info('in case ENC: createVideoEncoderByMime fail'); - expect().assertFail(); - done(); - } - }) - await videoEncodeProcessor.getVideoEncoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - supportedEncForm = videoCaps.supportedFormats; - console.info('case supportedEncForm is ' + supportedEncForm); - console.info('case supportedEncForm.length is ' + supportedEncForm.length); - if (supportedEncForm.length == 0) { - isFormatSame = false; - } - }, failCallback).catch(failCatch); - await media.createVideoDecoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByMime success'); - } else { - console.info('in case : createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - await videoDecodeProcessor.getVideoDecoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - supportedDecForm = videoCaps.supportedFormats; - console.info('case supportedDecForm is ' + supportedDecForm); - console.info('case supportedDecForm.length is ' + supportedDecForm.length); - if (supportedDecForm.length == 0) { - isFormatSame = false; - } - }, failCallback).catch(failCatch); - let formatPoi = -1; - if (isFormatSame) { - for(var item of supportedEncForm) { - formatPoi = supportedDecForm.indexOf(item); - if (formatPoi != -1) { - pixelFormat = item; - console.info("case pixelFormat is " + pixelFormat); - break; - } - } - if (formatPoi == -1) { - isFormatSame = false; - } else { - mediaDescription.pixel_format = pixelFormat; - mediaDescription2.pixel_format = pixelFormat; - console.info("case mediaDescription is " + JSON.stringify(mediaDescription)); - console.info("case mediaDescription2 is " + JSON.stringify(mediaDescription2)); - } - } - await videoEncodeProcessor.release().then(() => { - console.info("case release videoEncodeProcessor success"); - videoEncodeProcessor = null; - }, failCallback).catch(failCatch); - await toReleaseDec(); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0200 - * @tc.name : 001.test release after last frame - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0200', 0, async function (done) { - checkFormat(done); - console.info("case test release after last frame"); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needRelease = true; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - }) - - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0300 - * @tc.name : 002.test stop at running state and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0300', 0, async function (done) { - checkFormat(done); - console.info("test stop at runnning state and restart"); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = false; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - await sleep(5000); - await toStopDec(); - await sleep(2000); - expect(outputEncEos).assertFalse(); - videoEncodeProcessor.stop(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: stop success'); - expect(DECoutputCnt).assertClose(ENCoutputCnt, frameThreshold); - await sleep(2000); - eventEmitter.emit('startEncAfterStopAtRunning'); - }); - eventEmitter.on('startEncAfterStopAtRunning', () => { - videoEncodeProcessor.start(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: start again after stop at running state success'); - resetReadParam(); - resetStateParam(); - needRelease = true; - eventEmitter.emit('toStartDec'); - }); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0400 - * @tc.name : 003.test stop at EOS and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0400', 0, async function (done) { - checkFormat(done); - console.info('case test stop at EOS and restart'); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needStop = true; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - eventEmitter.on('stopAtEos', () => { - videoEncodeProcessor.stop(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: stop success'); - await sleep(2000); - eventEmitter.emit('startEncAfterStopAtEos'); - }); - }); - eventEmitter.on('startEncAfterStopAtEos', () => { - videoEncodeProcessor.start(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: start again after stop at running state success'); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toFlushDec(); - await toStartDec(); - }); - }); - }) - - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0500 - * @tc.name : 004.test flush at running state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0500', 0, async function (done) { - checkFormat(done); - console.info('case test flush at running state'); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = false; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - await sleep(5000); - expect(outputEncEos).assertFalse(); - lockFlag = true; - videoEncodeProcessor.flush(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: flush at running success'); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toStartEnc(); - await toFlushDec(); - await toStartDec(); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0600 - * @tc.name : 005.test flush at eos state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0600', 0, async function (done) { - checkFormat(done); - console.info("case test flush at eos state"); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needFlush = true; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - eventEmitter.once('flushAtEos', async() => { - lockFlag = true; - videoEncodeProcessor.flush(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: flush at EOS success'); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toStartEnc(); - await toFlushDec(); - await toStartDec(); - }); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0700 - * @tc.name : 006.test reconfigure - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0700', 0, async function (done) { - checkFormat(done); - console.info("case test reconfigure"); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needReset = true; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - eventEmitter.once('resetAtEos', async() => { - videoEncodeProcessor.reset(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: reset success'); - await toResetDec(); - resetReadParam(); - resetStateParam(); - needRelease = true; - eventEmitter.emit('toConfigureEnc', mediaDescription, mediaDescription2, done); - }); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0800 - * @tc.name : 007.test recreate videoencoder - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_CALLBACK_0800', 0, async function (done) { - checkFormat(done); - console.info('case test recreate videoencoder'); - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - eventEmitter.once('releaseAtEos', async() => { - videoEncodeProcessor.release(async(err) => { - expect(err).assertUndefined(); - console.info('in case ENC: release success'); - videoEncodeProcessor = null; - await toReleaseDec(); - resetReadParam(); - resetStateParam(); - needRelease = true; - await fileio.close(fdRead); - await getFdRead(srcPath); - eventEmitter.emit('toCreateVideoEnc', mime, mime, mediaDescription, mediaDescription2, done); - }); - }); - }) -}) diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncPromiseTest.test.js deleted file mode 100644 index 480601a84f13ea83e7828b5385f03d328c98b08d..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderHardwareFuncPromiseTest.test.js +++ /dev/null @@ -1,811 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import fileio from '@ohos.fileio' -import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -import * as mediaTestBase from '../../../../../MediaTestBase.js'; - -describe('videoHardwareEncoderFuncPromise', function () { - let videoEncodeProcessor; - let surfaceID = ''; - let outputQueue = []; - let videoDecodeProcessor = null; - let frameCountIn = 0; - let timestamp = 0; - let isCodecData = true; - let inputEosFlag = false; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - let ES_FRAME_SIZE = []; - let fdRead; - let position = 0; - let DECinputCnt = 0; - let DECoutputCnt = 0; - let ENCoutputCnt = 0; - let outputCntDec = 0; - let outputCntEnc = 0; - let frameThreshold = 0.1; - let needSetEos = true; - let isInputEnd = false; - let outputEncEos = false; - let pixelFormat = 0; - let isFormatSame = true; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 2, - 'frame_rate': 60, - } - let mediaDescription2 = { - 'track_type': 1, - 'width': 320, - 'height': 240, - 'pixel_format': 2, - 'frame_rate': 60, - 'max_input_size': 150000, - } - let mime = 'video/avc'; - let srcPath = 'out_320_240_10s.h264' - 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, - 998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132, - 128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230, - 177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140, - 118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179, - 160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122]; - let lockFlag = false; - let needRelease = false; - let needStop = false; - let needFlush = false; - let needReset = false; - - beforeAll(async function() { - console.info('beforeAll case 1'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - DECinputCnt = 0; - DECoutputCnt = 0; - ENCoutputCnt = 0; - frameCountIn = 0; - timestamp = 0; - isCodecData = true; - inputEosFlag = false; - position = 0; - outputCntDec = 0; - outputCntEnc = 0; - needSetEos = true; - isInputEnd = false; - outputEncEos = false; - needRelease = false; - needStop = false; - needFlush = false; - needReset = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null){ - await videoEncodeProcessor.release().then(() => { - console.info("case release videoDecodeProcessor success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - if (videoDecodeProcessor != null){ - await videoDecodeProcessor.release().then(() => { - console.info("case release videoDecodeProcessor success"); - }, failCallback).catch(failCatch); - videoDecodeProcessor = null; - } - await fileio.close(fdRead); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function getContent(buf, poi, len) { - console.info("case start get content"); - console.info("case start get content length is: " + len); - let lengthreal = -1; - try { - if (poi == -1) { - lengthreal = fileio.readSync(fdRead, buf, {length:len}); - } else { - lengthreal = fileio.readSync(fdRead, buf, {length:len, position: poi}); - } - console.info('case lengthreal is :' + lengthreal); - } catch(e) { - console.info('case getContent error :' + e); - } - } - - async function getFdRead(pathName, done) { - await mediaTestBase.getFdRead(pathName, done).then((fdNumber) => { - fdRead = fdNumber; - }) - } - - async function toCreateVideoEncoderByName(name, done) { - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case ENC: createVideoEncoderByName success'); - } else { - console.info('in case ENC: createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - } - - async function toCreateVideoEncoderByMime(mime, done) { - await media.createVideoEncoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case ENC: createVideoEncoderByMime success'); - } else { - console.info('in case ENC: createVideoEncoderByMime fail'); - expect().assertFail(); - done(); - } - }) - } - - async function toGetInputSurface() { - await videoEncodeProcessor.getInputSurface().then((inputSurface) => { - expect(inputSurface != undefined).assertTrue(); - console.info('in case ENC: getInputSurface success'); - surfaceID = inputSurface; - console.info('in case ENC: videoEncoder surfaceID is ' + surfaceID); - }, failCallback).catch(failCatch); - } - - async function toGetVideoEncoderCaps(width, height) { - await videoEncodeProcessor.getVideoEncoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - printVideoCaps(videoCaps, width, height); - }, failCallback).catch(failCatch); - } - - async function toConfigureEnc(mediaDescription, savepath) { - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("in case ENC: configure success"); - }, failCallback).catch(failCatch); - } - - async function toPrepareEnc() { - await videoEncodeProcessor.prepare().then(() => { - console.info("in case ENC: prepare success"); - }, failCallback).catch(failCatch); - } - - async function toStartEnc() { - await videoEncodeProcessor.start().then(() => { - console.info("in case ENC: start success"); - }, failCallback).catch(failCatch); - } - - async function toStopEnc() { - await videoEncodeProcessor.stop().then(() => { - console.info("in case ENC: stop success"); - }, failCallback).catch(failCatch); - } - - async function toFlushEnc() { - lockFlag = true; - await videoEncodeProcessor.flush().then(() => { - console.info("in case ENC: flush success"); - lockFlag = false; - }, failCallback).catch(failCatch); - } - - async function toResetEnc() { - await videoEncodeProcessor.reset().then(() => { - console.info("in case ENC: reset success"); - }, failCallback).catch(failCatch); - } - - async function toReleaseEnc() { - await videoEncodeProcessor.release().then(() => { - console.info("case release videoEncodeProcessor success"); - videoEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - - async function dequeueOutputs(done) { - while (outputQueue.length > 0) { - let outputObject = outputQueue.shift(); - outputCntEnc += 1; - if (outputObject.flags == 1) { - if (outputCntEnc == 1) { - console.info('in case ENC ERROR, first output is EOS'); - expect().assertFail(); - } - outputEncEos = true; - console.info('in case ENC: output EOS'); - eventEmitter.emit('endOfEos', done); - } else { - console.info('in case ENC not last frame, continue'); - if (!lockFlag) { - videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('in case ENC release output success'); - ENCoutputCnt += 1; - console.info('in case ENC: ENCoutputCnt is ' + ENCoutputCnt); - }); - } - } - } - } - - function setCallbackEnc(done) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('in case ENC outputBufferAvailable'); - console.info('in case ENC outBuffer.flags: ' + outBuffer.flags); - outputQueue.push(outBuffer); - dequeueOutputs(done); - }); - videoEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - async function toCreateVideoDecoderByName(name, done) { - await media.createVideoDecoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByName success'); - } else { - console.info('in case : createVideoDecoderByName fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - - async function toCreateVideoDecoderByMime(mime, done) { - await media.createVideoDecoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoDecodeProcessor = processor; - console.info('in case : createVideoDecoderByMime success'); - } else { - console.info('in case : createVideoDecoderByMime fail'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - - async function toConfigureDec(mediaDescription) { - await videoDecodeProcessor.configure(mediaDescription).then(() =>{ - console.info('in case DEC: configure success'); - }, failCallback).catch(failCatch); - } - - async function toSetOutputSurface(isDisplay) { - await videoDecodeProcessor.setOutputSurface(surfaceID, isDisplay).then(() => { - console.info('in case DEC: setOutputSurface success. surfaceID ' + surfaceID); - }, failCallback).catch(failCatch); - } - - async function toPrepareDec() { - await videoDecodeProcessor.prepare().then(() => { - console.info('in case DEC: prepare success'); - }, failCallback).catch(failCatch); - } - - async function toStartDec() { - await videoDecodeProcessor.start().then(() => { - console.info('in case DEC: start success'); - }, failCallback).catch(failCatch); - } - - async function toFlushDec() { - lockFlag = true; - await videoDecodeProcessor.flush().then(() => { - console.info("in case DEC: flush success"); - lockFlag = false; - }, failCallback).catch(failCatch); - } - - async function toStopDec() { - await videoDecodeProcessor.stop().then(() => { - console.info("in case DEC: stop success"); - }, failCallback).catch(failCatch); - } - - async function toResetDec() { - await videoDecodeProcessor.reset().then(() => { - console.info("in case DEC: reset success"); - }, failCallback).catch(failCatch); - } - - async function toReleaseDec() { - await videoDecodeProcessor.release().then(() => { - console.info("case release videoDecodeProcessor success"); - videoDecodeProcessor = null; - }, failCallback).catch(failCatch); - } - - function setCallbackDec() { - console.info('in case: setCallback in'); - videoDecodeProcessor.on('needInputData', async (inBuffer) => { - console.info('in case DEC: inputBufferAvailable inBuffer.index: '+ inBuffer.index); - enqueueInputs(inBuffer); - }); - videoDecodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case DEC: outputBufferAvailable outBuffer.flags: '+ outBuffer.flags); - outputCntDec += 1; - if (outBuffer.flags == 1) { - if (outputCntDec == 1) { - console.info('in case DEC ERROR, first output is EOS'); - expect().assertFail(); - } else { - await videoEncodeProcessor.notifyEndOfStream(); - } - } - if (outBuffer.flags == 0 && !lockFlag) { - await videoDecodeProcessor.renderOutputData(outBuffer).then(() => { - DECoutputCnt += 1; - console.info('in case DEC: DECoutputCnt is ' + DECoutputCnt); - }, failCallback).catch(failCatch); - } - }); - videoDecodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - videoDecodeProcessor.on('streamChanged',(format) => { - console.info('in case DEC: Output format changed: ' + format.toString()); v - }); - console.info('in case DEC: setCallback out'); - } - - /* push inputbuffers into codec */ - async function enqueueInputs(inputObject) { - if (inputEosFlag == false && isInputEnd == false) { - console.log('in case DEC: not see input EOS'); - if (frameCountIn < ES_FRAME_SIZE.length) { - getContent(inputObject.data, position, ES_FRAME_SIZE[frameCountIn]); - inputObject.timeMs = timestamp; - inputObject.offset = 0; - inputObject.length = ES_FRAME_SIZE[frameCountIn]; - position = position + ES_FRAME_SIZE[frameCountIn]; - console.info('in case: frameCountIn ' + frameCountIn); - frameCountIn++; - timestamp += 16.67; - } - if (isCodecData) { - inputObject.flags = 8; - isCodecData = false; - timestamp = 0; - } else if (frameCountIn >= ES_FRAME_SIZE.length - 1) { - if (needSetEos) { - inputObject.flags = 1; - inputEosFlag = true; - } else { - isInputEnd = true; - } - } else { - inputObject.flags = 4; - } - videoDecodeProcessor.pushInputData(inputObject).then(() => { - console.info('in case DEC: queueInput success '); - DECinputCnt += 1; - console.info('in case DEC: DECinputCnt is ' + DECinputCnt); - }, failCallback).catch(failCatch); - } - } - - function resetReadParam() { - console.info('case read from start'); - position = 0; - inputEosFlag = false; - frameCountIn = 0; - isCodecData = true; - } - - function resetStateParam() { - console.info('case init state parameter'); - outputCntEnc = 0; - DECinputCnt = 0; - DECoutputCnt = 0; - ENCoutputCnt = 0; - outputEncEos = false; - needSetEos = true; - isInputEnd = false; - needRelease = false; - needStop = false; - needFlush = false; - needReset = false; - } - - async function printVideoCaps(videoCaps, width, height) { - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - await videoCaps.getPreferredFrameRate(width, height).then((valueRange) => { - console.info("case getPreferredFrameRate valueRange success"); - if (typeof (valueRange) != 'undefined') { - console.info('getPreferredFrameRate.min: ' + valueRange.min); - console.info('getPreferredFrameRate.max: ' + valueRange.max); - } else { - console.info('case getPreferredFrameRate valueRange is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - await videoCaps.getSupportedFrameRate(width, height).then((valueRange) => { - console.info("case getSupportedFrameRate valueRange success"); - if (typeof (valueRange) != 'undefined') { - console.info('getSupportedFrameRate.min: ' + valueRange.min); - console.info('getSupportedFrameRate.max: ' + valueRange.max); - } else { - console.info('case getSupportedFrameRate valueRange is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - await videoCaps.isSizeSupported(width, height).then((trueORfalse) => { - console.info("case isSizeSupported valueRange for width:" + width + ", height: " + height); - if (typeof (trueORfalse) != 'undefined') { - console.info('videoCaps.isSizeSupported: ' + trueORfalse); - } else { - console.info('case isSizeSupported is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - } - - async function startEncProcess(codecFormat, savePath, mediaDescriptionEnc, done) { - await toCreateVideoEncoderByMime(codecFormat, done); - await toConfigureEnc(mediaDescriptionEnc, savePath); - setCallbackEnc(done); - await toGetInputSurface(); - await toPrepareEnc(); - await toStartEnc(); - } - - async function startDecProcess(codecFormat, readpath, mediaDescriptionDec, done) { - await toCreateVideoDecoderByMime(codecFormat, done); - await getFdRead(readpath, done); - await toConfigureDec(mediaDescriptionDec); - await toSetOutputSurface(false); - setCallbackDec(); - await toPrepareDec(); - await toStartDec(); - } - - function checkFormat(done) { - if (!isFormatSame) { - console.info('case decoder and encoder pixelformat is not the same'); - expect().assertFail(); - done(); - } - } - - eventEmitter.on('endOfEos', async(done) => { - expect(outputEncEos).assertTrue(); - expect(DECoutputCnt).assertClose(ES_FRAME_SIZE.length, frameThreshold); - expect(ENCoutputCnt).assertClose(ES_FRAME_SIZE.length, frameThreshold); - if (needRelease) { - await toReleaseEnc(); - await toReleaseDec(); - done(); - } else if (needStop) { - eventEmitter.emit('stopAtEos'); - } else if (needFlush) { - eventEmitter.emit('flushAtEos'); - } else if (needReset) { - eventEmitter.emit('resetAtEos'); - } else { - eventEmitter.emit('releaseAtEos'); - } - }); - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0100 - * @tc.name : 000.test video software encoder capbility - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0100', 0, async function (done) { - console.info("test video software encoder capbility"); - let supportedEncForm = []; - let supportedDecForm = []; - await toCreateVideoEncoderByMime(mime, done); - await videoEncodeProcessor.getVideoEncoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - supportedEncForm = videoCaps.supportedFormats; - if (supportedEncForm.length == 0) { - isFormatSame = false; - } - }, failCallback).catch(failCatch); - await toCreateVideoDecoderByMime(mime, done); - await videoDecodeProcessor.getVideoDecoderCaps().then((videoCaps) => { - console.info("case get getVideoDecoderCaps success"); - supportedDecForm = videoCaps.supportedFormats; - if (supportedDecForm.length == 0) { - isFormatSame = false; - } - }, failCallback).catch(failCatch); - let formatPoi = -1; - if(isFormatSame) { - for (var item of supportedEncForm) { - formatPoi = supportedDecForm.indexOf(item); - if(formatPoi != -1) { - pixelFormat = item; - console.info('case pixelFormat is ' + pixelFormat); - break; - } - } - if(formatPoi == -1) { - isFormatSame = false; - } else { - mediaDescription.pixel_format = pixelFormat; - mediaDescription2.pixel_format = pixelFormat; - } - } - await toReleaseEnc(); - await toReleaseDec(); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0200 - * @tc.name : 001.test release after last frame - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0200', 0, async function (done) { - checkFormat(done); - console.info("case test release after last frame"); - let savePath = 'video_hardware_encoder_function_0100.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needRelease = true; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0300 - * @tc.name : 002.test stop at running state and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0300', 0, async function (done) { - checkFormat(done); - console.info("test stop at runnning state and restart"); - let savePath = 'video_hardware_encoder_function_0200.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = false; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - await sleep(3000); - expect(outputEncEos).assertFalse(); - await toStopDec(); - await sleep(2000); - await toStopEnc(); - expect(DECoutputCnt).assertClose(ENCoutputCnt, frameThreshold); - await sleep(1000); - await toStartEnc(); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toStartDec(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0400 - * @tc.name : 003.test stop at EOS and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0400', 0, async function (done) { - checkFormat(done); - console.info('case test stop at EOS and restart'); - let savePath = 'video_hardware_encoder_function_0300.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needStop = true; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - eventEmitter.on('stopAtEos', async() => { - await toStopEnc(); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toStartEnc(); - await toFlushDec(); - await toStartDec(); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0500 - * @tc.name : 004.test flush at running state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0500', 0, async function (done) { - checkFormat(done); - console.info('case test flush at running state'); - let savePath = 'video_hardware_encoder_function_0400.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = false; - - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - await sleep(5000); - expect(outputEncEos).assertFalse(); - await toFlushEnc(); - await toStartEnc(); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toFlushDec(); - await toStartDec(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0600 - * @tc.name : 005.test flush at eos state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0600', 0, async function (done) { - checkFormat(done); - console.info("case test flush at eos state"); - let savePath = 'video_hardware_encoder_function_0500.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needFlush = true; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - eventEmitter.on('flushAtEos', async() => { - await toFlushEnc(); - await toStartEnc(); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toFlushDec(); - await toStartDec(); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0700 - * @tc.name : 006.test reconfigure - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0700', 0, async function (done) { - checkFormat(done); - console.info("case test reconfigure"); - let savePath = 'video_hardware_encoder_function_0600.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - needReset = true; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - eventEmitter.once('resetAtEos', async() => { - await toResetEnc(); - await toResetDec(); - await toConfigureEnc(mediaDescription, savePath); - setCallbackEnc(done); - await toGetInputSurface(); - await toPrepareEnc(); - await toStartEnc(); - resetReadParam(); - resetStateParam(); - needRelease = true; - await toConfigureDec(mediaDescription); - await toSetOutputSurface(false); - setCallbackDec(); - await toPrepareDec(); - await toStartDec(); - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0800 - * @tc.name : 007.test recreate videoencoder - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_FUNCTION_PROMISE_0800', 0, async function (done) { - checkFormat(done); - console.info('case test recreate videoencoder'); - let savePath = 'video_hardware_encoder_function_0700.es'; - ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - isCodecData = true; - needSetEos = true; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - eventEmitter.once('releaseAtEos', async() => { - await toReleaseEnc(); - await toReleaseDec(); - await fileio.close(fdRead); - resetReadParam(); - resetStateParam(); - needRelease = true; - await startEncProcess(mime, savePath, mediaDescription, done); - await startDecProcess(mime, srcPath, mediaDescription2, done); - }); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js deleted file mode 100644 index 42d93672950bd16474a4039dafc90cbdce5e35dc..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js +++ /dev/null @@ -1,394 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import mediademo from '@ohos.multimedia.mediademo' -import fileio from '@ohos.fileio' -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import featureAbility from '@ohos.ability.featureAbility' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('videoEncoderSoftwareMultiInstances', function () { - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - const ROOT = '/data/app/el1/bundle/results/'; - const BASIC_PATH = 'video_multiinstances_'; - let videoEncodeProcessor; - let mediaTest; - let surfaceID = ''; - let outputQueue = []; - let outputCnt = 0; - let frameTotal = 100; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let sawOutputEOS = false; - let needGetMediaDes = false; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); - let fileKeyObj = mediaLibrary.FileKey; - - beforeAll(async function() { - console.info('beforeAll case 1'); - await applyPermission(); - console.info('beforeAll case after get permission'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - videoEncodeProcessor = null; - mediaTest = null; - surfaceID = ''; - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - await closeFdWrite(); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function resetParam() { - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.video.videoencoder', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - } else { - console.info('[permission] case apply permission failed, createAtManager failed'); - } - } - - async function getFdWrite(pathName) { - console.info('[mediaLibrary] case start getFdWrite'); - console.info('[mediaLibrary] case getFdWrite pathName is ' + pathName); - let mediaType = mediaLibrary.MediaType.VIDEO; - console.info('[mediaLibrary] case mediaType is ' + mediaType); - let publicPath = await mediaLibraryTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); - console.info('[mediaLibrary] case getFdWrite publicPath is ' + publicPath); - let dataUri = await mediaLibraryTest.createAsset(mediaType, pathName, publicPath); - if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections : fileKeyObj.ID + "=?", - selectionArgs : [args], - } - let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); - console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset = await fetchWriteFileResult.getAllObject(); - console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fdWrite = await fileAsset[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); - } - } - - async function closeFdWrite() { - if (fileAsset != null) { - await fileAsset[0].close(fdWrite).then(() => { - console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); - }).catch((err) => { - console.info('[mediaLibrary] case close fdWrite failed'); - }); - } else { - console.info('[mediaLibrary] case fileAsset is null'); - } - } - - function writeFile(buf, len) { - try{ - let res = fileio.write(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - async function dequeueOutputs(nextStep) { - while (outputQueue.length > 0) { - let outputObject = outputQueue.shift(); - outputCnt += 1; - if (outputObject.flags == 1) { - console.info("case last frame"); - mediaTest.closeStream(surfaceID); - await toRelease(); - nextStep(); - return; - } else { - console.info('not last frame, write data to file'); - writeFile(outputObject.data, outputObject.length); - console.info("write to file success"); - videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('release output success'); - }); - } - } - } - - function setCallback(path, nextStep) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - console.info('outBuffer.flags: ' + outBuffer.flags); - if (needGetMediaDes) { - videoEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes = false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - dequeueOutputs(nextStep); - }); - - videoEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - async function toCreateByMime(mime, done) { - await media.createVideoEncoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByMime success'); - } else { - console.info('in case : createVideoEncoderByMime fail'); - expect().assertFail(); - done(); - } - }) - } - - async function toCreateByName(name, done) { - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - } - - async function toGetVideoEncoderCaps() { - await videoEncodeProcessor.getVideoEncoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - console.info("print videoCaps: " + videoCaps) - }, failCallback).catch(failCatch); - } - - function toCreateStream() { - mediaTest = mediademo.createMediaTest(); - } - - function toSetStreamParam(width, height, framerate, frameTotal) { - console.info('case set stream parameter'); - mediaTest.setResolution(width, height); - mediaTest.setFrameRate(framerate); - mediaTest.setFrameCount(frameTotal); - } - - async function toGetInputSurface() { - await videoEncodeProcessor.getInputSurface().then((inputSurface) => { - expect(inputSurface != undefined).assertTrue(); - console.info('case getInputSurface success'); - surfaceID = inputSurface; - }, failCallback).catch(failCatch); - } - - function toStartStream() { - console.info('case start stream'); - mediaTest.startStream(surfaceID); - } - - function toStopStream() { - console.info('case stop stream'); - mediaTest.closeStream(surfaceID); - } - - async function toConfigure(mediaDescription) { - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - } - - async function toPrepare() { - await videoEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - } - - async function toStart() { - await videoEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - } - - async function toFlush() { - outputQueue = []; - await videoEncodeProcessor.flush().then(() => { - console.info("case flush success"); - }, failCallback).catch(failCatch); - } - - async function toStop() { - await videoEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - } - - async function toReset() { - await videoEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - } - - async function toRelease() { - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - } - - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_MULTIINSTANCE_0100 - * @tc.name : 001.create multiple encoders - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_MULTIINSTANCE_0100', 0, async function (done) { - console.info("case test multiple encoder instances"); - let savepath = BASIC_PATH + '0100.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - let array = new Array(); - - eventEmitter.once('nextStep', async () => { - for (let j = 1; j < 3; j++) { - await array[j].release().then(() => { - console.info("case release encoder " + j); - }, failCallback).catch(failCatch); - array[j] = null; - } - console.info('release encoders success'); - done(); - }); - async function runCase() { - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription); - await getFdWrite(savepath); - setCallback(savepath, function(){eventEmitter.emit('nextStep')}); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - } - 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 == 3) { - videoEncodeProcessor = processor; - runCase(); - } else { - array[i] = processor; - } - } else { - console.info("case create createVideoEncoder failed: " + i); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } - }) -}) - - \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js deleted file mode 100644 index bbc2d4e6133a245f85f3fe4c4f14f08188ed1627..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js +++ /dev/null @@ -1,638 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import mediademo from '@ohos.multimedia.mediademo' -import fileio from '@ohos.fileio' -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import featureAbility from '@ohos.ability.featureAbility' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('VideoEncoderSoftwareFuncCallbackTest', function () { - let videoEncodeProcessor = null; - let mediaTest; - let surfaceID = ''; - let frameCountOut = 0; - let outputQueue = []; - let frameTotal = 100; - let finalFrameId = 100; - let reStart = false; - let isStreamRunning = false; - let stopBuffer = false; - const events = require('events'); - const eventEmitter = new events.EventEmitter(); - const ROOT = '/data/app/el1/bundle/results/'; - const BASIC_PATH = ROOT + 'video_func_callback_'; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); - let fileKeyObj = mediaLibrary.FileKey; - - beforeAll(async function() { - console.info('beforeAll case 1'); - await applyPermission(); - console.info('beforeAll case after get permission'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - mediaTest = null; - surfaceID = ''; - frameCountOut = 0; - outputQueue = []; - frameTotal = 100; - finalFrameId = 100; - reStart = false; - isStreamRunning = false; - stopBuffer = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null) { - await videoEncodeProcessor.release().then(() => { - console.info('case videoEncodeProcessor release'); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - await closeFdWrite(); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - let failCallback = function(err) { - console.error(`in case error failCallback called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let failCatch = function(err) { - console.error(`in case error failCatch called,errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.video.videoencoder', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - } else { - console.info('[permission] case apply permission failed, createAtManager failed'); - } - } - - async function getFdWrite(pathName) { - console.info('[mediaLibrary] case start getFdWrite'); - console.info('[mediaLibrary] case getFdWrite pathName is ' + pathName); - let mediaType = mediaLibrary.MediaType.VIDEO; - console.info('[mediaLibrary] case mediaType is ' + mediaType); - let publicPath = await mediaLibraryTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); - console.info('[mediaLibrary] case getFdWrite publicPath is ' + publicPath); - let dataUri = await mediaLibraryTest.createAsset(mediaType, pathName, publicPath); - if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections : fileKeyObj.ID + "=?", - selectionArgs : [args], - } - let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); - console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset = await fetchWriteFileResult.getAllObject(); - console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fdWrite = await fileAsset[0].open('rw'); - console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); - } - } - - async function closeFdWrite() { - if (fileAsset != null) { - await fileAsset[0].close(fdWrite).then(() => { - console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); - }).catch((err) => { - console.info('[mediaLibrary] case close fdWrite failed'); - }); - } else { - console.info('[mediaLibrary] case fileAsset is null'); - } - } - - function writeFile(buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - async function dequeueOutputs(nextStep) { - while (outputQueue.length > 0) { - let outputObject = outputQueue.shift(); - if (outputObject.flags == 1 || frameCountOut == frameTotal || frameCountOut == finalFrameId) { - nextStep(); - return; - } - frameCountOut++; - writeFile(outputObject.data, outputObject.length); - videoEncodeProcessor.freeOutputBuffer(outputObject, (err) => { - if (typeof(err) == 'undefined') { - console.log('in case release output count:' + frameCountOut); - } else { - console.info(`in case release output called,errMessage is ${err.message}`); - } - }); - } - } - function printDescription(obj) { - for (let item in obj) { - let property = obj[item]; - console.info('video encoder key is ' + item); - console.info('video encoder value is ' + property); - } - } - function setCallback(nextStep) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - if (stopBuffer == false) { - outputQueue.push(outBuffer); - dequeueOutputs(nextStep); - } - }); - videoEncodeProcessor.on('error',(err) => { - console.info('in case error called, errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - if (typeof(format) != undefined) { - printDescription(format); - } - }); - } - function toCreateStream() { - mediaTest = mediademo.createMediaTest(); - } - function toSetStreamParam(width, height, framerate, frameTotal) { - mediaTest.setResolution(width, height); - mediaTest.setFrameRate(framerate); - mediaTest.setFrameCount(frameTotal); - } - - function toStartStream() { - if (isStreamRunning == false) { - console.info('in case : toStartStream'); - mediaTest.startStream(surfaceID); - isStreamRunning = true; - } - } - - function toStopStream() { - if (isStreamRunning == true) { - console.info('in case : toStopStream'); - mediaTest.closeStream(surfaceID); - isStreamRunning = false; - } - } - - eventEmitter.on('configure', (mediaDescription, decPath, nextStep, done) => { - console.info('in case : configure in'); - videoEncodeProcessor.configure(mediaDescription, async(err) => { - expect(err).assertUndefined(); - console.info('in case : configure success'); - await getFdWrite(decPath); - console.info('case getFdWrite success'); - setCallback(nextStep); - eventEmitter.emit('getVideoEncoderCaps', done); - }); - }); - eventEmitter.on('getVideoEncoderCaps', (done) => { - videoEncodeProcessor.getVideoEncoderCaps((err, videoCaps) => { - expect(err).assertUndefined(); - console.info("case get getVideoEncoderCaps success"); - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - eventEmitter.emit('getInputSurface', done); - }); - }); - eventEmitter.on('getInputSurface', (done) => { - videoEncodeProcessor.getInputSurface((err, inputSurface) => { - expect(err).assertUndefined(); - expect(inputSurface != undefined).assertTrue(); - surfaceID = inputSurface; - console.info('in case : getInputSurface success, surfaceID ' + surfaceID); - eventEmitter.emit('prepare', done); - }) - }); - eventEmitter.on('prepare', (done) => { - videoEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case : prepare success'); - toStartStream(); - eventEmitter.emit('start', done); - }); - }); - eventEmitter.on('start', (done) => { - toStartStream(); - videoEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case : start success'); - }); - stopBuffer = false; - }); - eventEmitter.on('stop', (done) => { - videoEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - toStopStream(); - console.info('in case : stop success'); - if (reStart == true) { - frameCountOut = 0; - outputQueue = []; - reStart = false; - eventEmitter.emit('start', done); - } else { - eventEmitter.emit('reset', done); - } - }); - stopBuffer = true; - }); - eventEmitter.on('flush', (done) => { - videoEncodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info('in case : flush success'); - eventEmitter.emit('reset', done); - }); - }); - eventEmitter.on('reset', (done) => { - videoEncodeProcessor.reset((err) => { - toStopStream(); - expect(err).assertUndefined(); - console.info('in case : reset success'); - eventEmitter.emit('release', done); - }); - }); - eventEmitter.on('release', (done) => { - videoEncodeProcessor.release((err) => { - toStopStream(); - expect(err).assertUndefined(); - console.info('in case : release success'); - videoEncodeProcessor = null; - done(); - }); - }); - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0100 - * @tc.name : 000.test stop after last frame and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0100', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_00_0100.es'; - let mime = 'video/mp4v-es'; - let mediaDescription = { - "codec_mime": 'video/mp4v-es', - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30, - } - media.getMediaCapability((err, mediaCaps) => { - expect(err).assertUndefined(); - console.info(`case getMediaCapability 1`); - mediaCaps.getVideoEncoderCaps((err, videoCapsArray) => { - expect(err).assertUndefined(); - console.info('getVideoEncoderCaps success'); - if (typeof (videoCapsArray) != 'undefined') { - console.info("case videoCapsArray" + videoCapsArray); - } else { - console.info("case videoCapsArray is not defined"); - expect().assertFail(); - done(); - } - }) - mediaCaps.findVideoEncoder(mediaDescription, (err, codecname) => { - expect(err).assertUndefined(); - console.info('findVideoEncoder success'); - if (typeof (codecname) != 'undefined') { - console.info("case codecname " + codecname); - } else { - console.info("case codecname is not defined"); - expect().assertFail(); - done(); - } - }) - }) - media.createVideoEncoderByMime(mime, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('stop', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0200 - * @tc.name : 000.test stop at running state and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0200', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0100.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - finalFrameId = 50; - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('stop', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0300 - * @tc.name : 000.test stop at end of stream and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0300', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0200.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - reStart = true; - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('stop', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0400 - * @tc.name : 000.test stop at running state and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0400', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0300.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - finalFrameId = 50; - reStart = true; - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('stop', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0500 - * @tc.name : 000.test flush at running state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0500', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0400.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - finalFrameId = 50; - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('flush', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0600 - * @tc.name : 000.test flush at end of stream - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0600', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0500.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('flush', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0700 - * @tc.name : 000.test reconfigure - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0700', 0, async function (done) { - let decPath = 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0600.es'; - let name= 'avenc_mpeg4'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - let decPath2 = 'SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_0700_2.es'; - let mediaDescription2 = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30.00, - } - eventEmitter.on('reset_for_callback_01_0600', async(done) => { - videoEncodeProcessor.reset(async(err) => { - expect(err).assertUndefined(); - console.info('in case : reset_for_callback_01_0600 success'); - toStopStream(); - await closeFdWrite(); - surfaceID = ''; - frameCountOut = 0; - outputQueue = []; - isStreamRunning = false; - toSetStreamParam(mediaDescription2.width, mediaDescription2.height, - mediaDescription2.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription2, decPath2, - function(){eventEmitter.emit('stop', done);}, done); - }) - }) - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - console.info('case create createVideoEncoderByName success'); - videoEncodeProcessor = processor; - toCreateStream(); - toSetStreamParam(mediaDescription.width, mediaDescription.height, - mediaDescription.frame_rate, frameTotal); - eventEmitter.emit('configure', mediaDescription, decPath, - function(){eventEmitter.emit('reset_for_callback_01_0600', done);}, done); - } else { - console.info('case create createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }); - }) -}) diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js deleted file mode 100644 index 0957324535b28991f780e0715b6768a036fc8b0b..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js +++ /dev/null @@ -1,774 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import mediademo from '@ohos.multimedia.mediademo' -import fileio from '@ohos.fileio' -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import featureAbility from '@ohos.ability.featureAbility' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('videoSoftwareEncoderFuncPromise', function () { - const BASIC_PATH = 'videoencode_func_promise_'; - let videoEncodeProcessor; - let mediaTest; - let surfaceID = ''; - let outputQueue = []; - let outputCnt = 0; - let frameTotal = 100; - let stopAtEOS = false; - let resetAtEOS = false; - let flushAtEOS = false; - let sawOutputEOS = false; - let needGetMediaDes = false; - let fdWrite; - let fileAsset; - const context = featureAbility.getContext(); - const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); - let fileKeyObj = mediaLibrary.FileKey; - - beforeAll(async function() { - console.info('beforeAll case 1'); - await applyPermission(); - console.info('beforeAll case after get permission'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - mediaTest = null; - surfaceID = ''; - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null){ - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - await closeFdWrite(); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - function resetParam() { - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - stopAtEOS = false; - resetAtEOS = false; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.video.videoencoder', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - } else { - console.info('[permission] case apply permission failed, createAtManager failed'); - } - } - - async function getFdWrite(pathName) { - console.info('[mediaLibrary] case start getFdWrite'); - console.info('[mediaLibrary] case getFdWrite pathName is ' + pathName); - let mediaType = mediaLibrary.MediaType.VIDEO; - console.info('[mediaLibrary] case mediaType is ' + mediaType); - let publicPath = await mediaLibraryTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); - console.info('[mediaLibrary] case getFdWrite publicPath is ' + publicPath); - let dataUri = await mediaLibraryTest.createAsset(mediaType, pathName, publicPath); - if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections : fileKeyObj.ID + "=?", - selectionArgs : [args], - } - let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); - console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset = await fetchWriteFileResult.getAllObject(); - console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fdWrite = await fileAsset[0].open('rw'); - console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); - } - } - - async function closeFdWrite() { - if (fileAsset != null) { - await fileAsset[0].close(fdWrite).then(() => { - console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); - }).catch((err) => { - console.info('[mediaLibrary] case close fdWrite failed'); - }); - } else { - console.info('[mediaLibrary] case fileAsset is null'); - } - } - - function writeFile(buf, len) { - try{ - let res = fileio.writeSync(fdWrite, buf, {length: len}); - console.info('case fileio.write buffer success'); - } catch(e) { - console.info('case fileio.write buffer error is ' + e); - } - } - - async function dequeueOutputs(done) { - while (outputQueue.length > 0) { - let outputObject = outputQueue.shift(); - outputCnt += 1; - if (outputObject.flags == 1) { - console.info("last frame, make choice"); - mediaTest.closeStream(surfaceID); - sawOutputEOS = true; - if (stopAtEOS) { - await toStop(); - } else if (resetAtEOS) { - await toReset(); - } else if (flushAtEOS) { - await toFlush(); - } else { - await toReset(); - await toRelease(); - done(); - } - } else { - console.info('not last frame, continue'); - writeFile(outputObject.data, outputObject.length); - videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('release output success'); - }); - } - } - } - - function setCallback(done) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - console.info('outBuffer.flags: ' + outBuffer.flags); - if (needGetMediaDes) { - videoEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes = false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - dequeueOutputs(done); - }); - - videoEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - async function toCreateByMime(mime, done) { - await media.createVideoEncoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByMime success'); - } else { - console.info('in case : createVideoEncoderByMime fail'); - expect().assertFail(); - done(); - } - }) - } - - async function toCreateByName(name, done) { - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - } - - async function toGetVideoEncoderCaps(width, height) { - await videoEncodeProcessor.getVideoEncoderCaps().then((videoCaps) => { - console.info("case get getVideoEncoderCaps success"); - printVideoCaps(videoCaps, width, height); - }, failCallback).catch(failCatch); - } - - async function printVideoCaps(videoCaps, width, height) { - console.info(`print videoCaps: - codecInfo.name ${videoCaps.codecInfo.name} - codecInfo.type ${videoCaps.codecInfo.type} - codecInfo.mimeType ${videoCaps.codecInfo.mimeType} - codecInfo.isHardwareAccelerated ${videoCaps.codecInfo.isHardwareAccelerated} - codecInfo.isSoftwareOnly ${videoCaps.codecInfo.isSoftwareOnly} - codecInfo.isVendor ${videoCaps.codecInfo.isVendor} - supportedBitrate [${videoCaps.supportedBitrate.min}, ${videoCaps.supportedBitrate.max}] - supportedFormats ${videoCaps.supportedFormats} - supportedHeightAlignment ${videoCaps.supportedHeightAlignment} - supportedWidthAlignment ${videoCaps.supportedWidthAlignment} - supportedWidth [${videoCaps.supportedWidth.min}, ${videoCaps.supportedWidth.max}] - supportedHeight [${videoCaps.supportedHeight.min}, ${videoCaps.supportedHeight.max}] - supportedProfiles ${videoCaps.supportedProfiles} - supportedLevels ${videoCaps.supportedLevels} - supportedBitrateMode ${videoCaps.supportedBitrateMode} - supportedQuality [${videoCaps.supportedQuality.min}, ${videoCaps.supportedQuality.max}] - supportedComplexity [${videoCaps.supportedComplexity.min}, ${videoCaps.supportedComplexity.max}] - `); - await videoCaps.getPreferredFrameRate(width, height).then((valueRange) => { - console.info("case getPreferredFrameRate valueRange success"); - if (typeof (valueRange) != 'undefined') { - console.info('getPreferredFrameRate.min: ' + valueRange.min); - console.info('getPreferredFrameRate.max: ' + valueRange.max); - } else { - console.info('case getPreferredFrameRate valueRange is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - await videoCaps.getSupportedFrameRate(width, height).then((valueRange) => { - console.info("case getSupportedFrameRate valueRange success"); - if (typeof (valueRange) != 'undefined') { - console.info('getSupportedFrameRate.min: ' + valueRange.min); - console.info('getSupportedFrameRate.max: ' + valueRange.max); - } else { - console.info('case getSupportedFrameRate valueRange is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - await videoCaps.isSizeSupported(width, height).then((trueORfalse) => { - console.info("case isSizeSupported valueRange for width:" + width + ", height: " + height); - if (typeof (trueORfalse) != 'undefined') { - console.info('videoCaps.isSizeSupported: ' + trueORfalse); - } else { - console.info('case isSizeSupported is not defined'); - expect().assertFail(); - } - }, failCallback).catch(failCatch); - } - - function toCreateStream() { - mediaTest = mediademo.createMediaTest(); - } - - function toSetStreamParam(width, height, framerate, frameTotal) { - console.info('case set stream parameter'); - mediaTest.setResolution(width, height); - mediaTest.setFrameRate(framerate); - mediaTest.setFrameCount(frameTotal); - } - - async function toGetInputSurface() { - await videoEncodeProcessor.getInputSurface().then((inputSurface) => { - expect(inputSurface != undefined).assertTrue(); - console.info('case getInputSurface success'); - surfaceID = inputSurface; - }, failCallback).catch(failCatch); - } - - function toStartStream() { - console.info('case start stream'); - mediaTest.startStream(surfaceID); - } - - function toStopStream() { - console.info('case stop stream'); - mediaTest.closeStream(surfaceID); - } - - async function toConfigure(mediaDescription, savepath) { - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - await getFdWrite(savepath); - console.info('case getFdWrite success'); - } - - async function toPrepare() { - await videoEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - } - - async function toStart() { - await videoEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - } - - async function toFlush() { - outputQueue = []; - await videoEncodeProcessor.flush().then(() => { - console.info("case flush success"); - }, failCallback).catch(failCatch); - } - - async function toStop() { - await videoEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - } - - async function toReset() { - resetParam(); - await videoEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - } - - async function toRelease() { - resetParam(); - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - videoEncodeProcessor = null; - }, failCallback).catch(failCatch); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0100 - * @tc.name : 000.test stop after last frame and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0100', 0, async function (done) { - console.info("case test stop after last frame"); - let savepath = BASIC_PATH + '0000.es'; - let name= 'avenc_mpeg4'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "codec_mime": 'video/mp4v-es', - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - await media.getMediaCapability().then((mediaCaps) => { - console.info('getMediaCapability success'); - if (typeof (mediaCaps) != 'undefined') { - mediaCaps.getVideoEncoderCaps().then((videoCapsArray) => { - console.info('getVideoEncoderCaps from media success'); - if (typeof (videoCapsArray) != 'undefined') { - let videoCaps = videoCapsArray[0]; - console.info('print first videoCaps from videoCapsArray'); - printVideoCaps(videoCaps, width, height); - } else { - console.info("case videoCapsArray is not defined"); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - mediaCaps.findVideoEncoder(mediaDescription).then((codecname) => { - console.info('findVideoEncoder success'); - if (typeof (codecname) != 'undefined') { - console.info("case codecname " + codecname); - } else { - console.info("case codecname is not defined"); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - } else { - console.info('mediaCaps is not defined'); - expect().assertFail(); - done(); - } - }, failCallback).catch(failCatch); - await toCreateByName(name, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0200 - * @tc.name : 001.test stop at runnning state and reset - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0200', 0, async function (done) { - console.info("case test stop at runnning state and reset"); - let savepath = BASIC_PATH + '0100.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(1000); - await toStop(); - toStopStream(); - await toReset(); - await toRelease(); - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0300 - * @tc.name : 002.test stop at end of stream and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0300', 0, async function (done) { - console.info("test stop at end of stream and restart"); - let savepath = BASIC_PATH + '0200.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - frameTotal = 10; - stopAtEOS = true; - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(5000); - resetParam(); - toSetStreamParam(width, height, framerate, frameTotal); - await toStart(); - toStartStream(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0400 - * @tc.name : 003.test stop at running state and restart - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0400', 0, async function (done) { - console.info("test stop at runnning state and restart"); - let savepath = BASIC_PATH + '0300.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - frameTotal = 1000; - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(500); - toStopStream(); - await toStop(); - resetParam(); - toSetStreamParam(width, height, framerate, frameTotal); - await toStart(); - toStartStream(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0500 - * @tc.name : 004.test flush at running state - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0500', 0, async function (done) { - console.info("case test flush at running state"); - let savepath = BASIC_PATH + '0400.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - frameTotal = 500; - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(500); - await toFlush(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0600 - * @tc.name : 005.test flush at end of stream - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level1 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0600', 0, async function (done) { - console.info("case test flush at end of stream"); - let savepath = BASIC_PATH + '0500.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - flushAtEOS = true; - frameTotal = 10; - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(5000); - resetParam(); - toSetStreamParam(width, height, framerate, frameTotal); - toStartStream(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0700 - * @tc.name : 006.test reconfigure - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0700', 0, async function (done) { - console.info("case test reconfigure"); - let savepath = BASIC_PATH + '0600.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - resetAtEOS = true; - frameTotal = 10; - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(5000); - resetParam(); - await closeFdWrite(); - width = 320; - height = 240; - framerate = 30; - let mediaDescription2 = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - let savepath2 = BASIC_PATH + '0601.es'; - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription2, savepath2); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0800 - * @tc.name : 007.test recreate videoencoder - * @tc.desc : basic encode function - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_PROMISE_0800', 0, async function (done) { - console.info("case test recreate videoencoder"); - let savepath = BASIC_PATH + '0700.es'; - let mime = 'video/mp4v-es'; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - resetAtEOS = true; - frameTotal = 10; - await toCreateByMime(mime, done); - await toGetVideoEncoderCaps(width, height); - toCreateStream(); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription, savepath); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - await sleep(5000); - await toRelease(); - resetParam(); - await closeFdWrite(); - width = 320; - height = 240; - framerate = 30; - let mediaDescription2 = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - let savepath2 = BASIC_PATH + '0701.es'; - await toCreateByMime(mime, done); - toSetStreamParam(width, height, framerate, frameTotal); - await toConfigure(mediaDescription2, savepath2); - setCallback(done); - await toGetInputSurface(); - await toPrepare(); - toStartStream(); - await toStart(); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js deleted file mode 100644 index b9bb1df4e5423503ec333c45d6ca19a793e8e5c8..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js +++ /dev/null @@ -1,1551 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import mediademo from '@ohos.multimedia.mediademo' -import Fileio from '@ohos.fileio' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const ENCODE_STEP = { - WAIT_FOR_EOS : 'encode:waitForEOS', - CONFIGURE : 'encode:configure', - GET_INPUTSURFACE : 'encode:getSurface', - PREPARE : 'encode:prepare', - START : 'encode:start', - FLUSH : 'encode:flush', - STOP : 'encode:stop', - RESET : 'encode:reset', - WAIT_FOR_ALL_OUTS : 'encode:waitForAllOuts', - ERROR : 'encode:error', - RELEASE : 'encode:release', -} -const STREAM_STEP = { - CREATE : 'stream:create', - PREPARE : 'stream:prepare', - SET_PARAM: 'stream:setParam', - SET_EOS_FRAME: 'stream:setEOSFrame', - START : 'stream:start', - STOP : 'stream:stop', -} -describe('VideoEncoderSoftwareReliCallbackTest', function () { - let videoEncodeProcessor = null; - let mediaTest = null; - let surfaceID = ''; - let frameCountOut = 0; - let outputQueue = []; - let frameTotal = 100; - let finalFrameId = 100; - let isStreamRunning = false; - let workdoneAtEOS = false; - let stopBuffer = false; - const ROOT = '/data/app/el1/bundle/results/'; - const BASIC_PATH = ROOT + 'video_reliability_callback_'; - let mediaDescription = { - 'width': 320, - 'height': 240, - 'pixel_format': 3, - 'frame_rate': 30, - } - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - mediaTest = null; - surfaceID = ''; - frameCountOut = 0; - outputQueue = []; - workdoneAtEOS = false; - frameTotal = 100; - finalFrameId = 100; - isStreamRunning = false; - stopBuffer = false; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null) { - await videoEncodeProcessor.release().then(() => { - console.info('in case : videoEncodeProcessor release success'); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - toStopStream(); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - let failCallback = function(err) { - console.error(`in case error failCallback called, errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - let failCatch = function(err) { - console.error(`in case error failCatch called,errMessage is ${err.message}`); - expect(err == undefined).assertTrue(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - function printError(err, expectFail) { - expect((err != undefined) == expectFail).assertTrue(); - if (expectFail == false && err != undefined) { - console.error('in case error failCatch called,err is ' + err); - console.error(`in case error failCatch called,errMessage is ${err.message}`); - } - } - - function writeFile(path, buf, len){ - try { - let writestream = Fileio.createStreamSync(path, 'ab+'); - let num = writestream.writeSync(buf, {length:len}); - writestream.flushSync(); - writestream.closeSync(); - } catch(e) { - console.error('in case error writeFile: ' + e); - } - } - - /* get outputbuffers from codec */ - async function dequeueOutputs(path, nextStep) { - console.log('outputQueue.length:' + outputQueue.length); - while (outputQueue.length > 0){ - let outputObject = outputQueue.shift(); - if (outputObject.flags == 1 || frameCountOut == frameTotal) { - if (workdoneAtEOS) { - doneWork(nextStep); - } - return; - } - frameCountOut++; - console.info('not last frame, continue'); - videoEncodeProcessor.freeOutputBuffer(outputObject, (err) => { - if (typeof(err) == 'undefined') { - console.debug('in case release output count:' + frameCountOut); - } else { - console.info(`in case release output called,errMessage is ${err.message}`); - } - }) - } - } - function printDescription(obj) { - for (let item in obj) { - let property = obj[item]; - console.info('video encoder key is ' + item); - console.info('video encoder value is ' + property); - } - } - function setCallback(path, nextStep) { - videoEncodeProcessor.on('newOutputData', async (outBuffer) => { - console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index); - if (stopBuffer == false) { - outputQueue.push(outBuffer); - dequeueOutputs(path, nextStep); - } - }); - - videoEncodeProcessor.on('error',(err) => { - console.info('in case: error called,errName is' + err); - }); - - videoEncodeProcessor.on('streamChanged', (format) => { - if (typeof(format) != undefined) { - printDescription(format); - } - }); - } - function toCreateStream(mySteps, done) { - mediaTest = mediademo.createMediaTest(); - toNextStep(mySteps, done); - } - function toSetStreamParam(mySteps, done) { - mediaTest.setResolution(mediaDescription.width, mediaDescription.height); - mediaTest.setFrameRate(mediaDescription.frame_rate); - toNextStep(mySteps, done); - } - function toSetEOSFrame(mySteps, done) { - mediaTest.setFrameCount(frameTotal); - toNextStep(mySteps, done); - } - function toStartStream(mySteps, done) { - if (isStreamRunning == false) { - console.info('in case : toStartStream'); - mediaTest.startStream(surfaceID); - isStreamRunning = true; - } - toNextStep(mySteps, done); - } - - function toStopStream(mySteps, done) { - if (isStreamRunning == true) { - console.info('in case : toStopStream'); - mediaTest.closeStream(surfaceID); - isStreamRunning = false; - } - toNextStep(mySteps, done); - } - function toConfigure(mySteps, done, expectFail) { - videoEncodeProcessor.configure(mediaDescription, (err) => { - console.info(`case configure callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }) - } - function toGetInputSurface(mySteps, done, expectFail) { - videoEncodeProcessor.getInputSurface((err, inputSurface) => { - expect(err).assertUndefined(); - expect(inputSurface != undefined).assertTrue(); - printError(err, expectFail); - surfaceID = inputSurface; - console.info('in case : getInputSurface success, surfaceID ' + surfaceID); - toNextStep(mySteps, done); - }) - } - function toPrepare(mySteps, done, expectFail) { - videoEncodeProcessor.prepare((err) => { - console.info(`case prepare callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toStart(mySteps, done, expectFail) { - videoEncodeProcessor.start((err) => { - console.info(`case start callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - stopBuffer = false; - } - function toStop(mySteps, done, expectFail) { - videoEncodeProcessor.stop((err) => { - console.info(`case stop callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - stopBuffer = true; - } - function toFlush(mySteps, done, expectFail) { - videoEncodeProcessor.flush((err) => { - console.info(`case flush callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function toReset(mySteps, done, expectFail) { - videoEncodeProcessor.reset((err) => { - console.info(`case reset callback`); - printError(err, expectFail); - toNextStep(mySteps, done); - }); - } - function runCase(mySteps, nextCase, done) { - if (mySteps[0] == ENCODE_STEP.ERROR) { - mySteps.shift(); - nextCase(mySteps, done, true); - } else { - nextCase(mySteps, done, false); - } - } - function toNextStep(mySteps, done) { - console.info('case myStep[0]: ' + mySteps[0]); - if (mySteps[0] == ENCODE_STEP.RELEASE) { - if (videoEncodeProcessor != null){ - videoEncodeProcessor.release((err) => { - printError(err, false); - console.info('in case : videoEncodeProcessor release callback'); - videoEncodeProcessor = null; - console.info('case to done'); - done(); - }); - } - return; - } - switch (mySteps[0]) { - case ENCODE_STEP.CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - runCase(mySteps, toConfigure, done); - break; - case STREAM_STEP.CREATE: - mySteps.shift(); - console.info(`case to createStream`); - toCreateStream(mySteps, done); - break; - case STREAM_STEP.SET_PARAM: - mySteps.shift(); - console.info(`case to SetStreamParam`); - toSetStreamParam(mySteps, done); - break; - case STREAM_STEP.SET_EOS_FRAME: - mySteps.shift(); - console.info(`case to SetEOSFrame`); - toSetEOSFrame(mySteps, done); - break; - case STREAM_STEP.START: - mySteps.shift(); - console.info(`case to StartStream`); - toStartStream(mySteps, done); - break; - case STREAM_STEP.STOP: - mySteps.shift(); - console.info(`case to StoptStream`); - toStopStream(mySteps, done); - break; - case ENCODE_STEP.GET_INPUTSURFACE: - mySteps.shift(); - console.info(`case to setOutputSurface`); - runCase(mySteps, toGetInputSurface, done); - break; - case ENCODE_STEP.PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - runCase(mySteps, toPrepare, done); - break; - case ENCODE_STEP.START: - mySteps.shift(); - console.info(`case to start`); - runCase(mySteps, toStart, done); - break; - case ENCODE_STEP.FLUSH: - mySteps.shift(); - console.info(`case to flush`); - runCase(mySteps, toFlush, done); - break; - case ENCODE_STEP.STOP: - mySteps.shift(); - console.info(`case to stop`); - runCase(mySteps, toStop, done); - break; - case ENCODE_STEP.RESET: - mySteps.shift(); - console.info(`case to reset`); - runCase(mySteps, toReset, done); - break; - case ENCODE_STEP.WAIT_FOR_EOS: - mySteps.shift(); - setTimeout(() =>{ - toNextStep(mySteps, done); - }, 5000); // wait 5000 ms for eos - break; - case ENCODE_STEP.WAIT_FOR_ALL_OUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - default: - break; - } - } - - function toCreateVideoEncoderByMime(mime, path, mySteps, done) { - media.createVideoEncoderByMime(mime, (err, processor) => { - console.info(`case createVideoEncoderByMime callback`); - printError(err, false); - if (typeof(processor) != 'undefined') { - videoEncodeProcessor = processor; - setCallback(path, done); - toNextStep(mySteps, done); - } else { - done(); - } - }) - } - function toCreateVideoEncoderByName(name, path, mySteps, done) { - media.createVideoEncoderByName(name, (err, processor) => { - printError(err, false); - if (typeof(processor) != 'undefined') { - videoEncodeProcessor = processor; - setCallback(path, done); - toNextStep(mySteps, done); - } else { - done(); - } - }) - } - async function doneWork(nextStep) { - videoEncodeProcessor.stop((err) => { - printError(err, false); - console.info('case stop callback'); - mediaTest.closeStream(surfaceID); - videoEncodeProcessor.reset((err) => { - printError(err, false); - console.info('case reset callback'); - videoEncodeProcessor.release((err) => { - printError(err, false); - console.info('case release callback'); - videoEncodeProcessor = null; - nextStep(); - }) - }) - }) - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0100 - * @tc.name : 001.create -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.CONFIGURE, ENCODE_STEP.ERROR, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0300 - * @tc.name : 003.start -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.CONFIGURE, ENCODE_STEP.ERROR, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.CONFIGURE, ENCODE_STEP.ERROR, STREAM_STEP.STOP, - ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.CONFIGURE, ENCODE_STEP.ERROR, STREAM_STEP.STOP, - ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0600', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0600.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.CONFIGURE, ENCODE_STEP.ERROR, - STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0700', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0700.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.RESET, STREAM_STEP.STOP, ENCODE_STEP.CONFIGURE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0800', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0800.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.CONFIGURE, - ENCODE_STEP.ERROR, ENCODE_STEP.PREPARE, ENCODE_STEP.START, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability test - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0900', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_CALLBACK_0900.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.RESET, STREAM_STEP.STOP, ENCODE_STEP.CONFIGURE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.PREPARE, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.PREPARE, ENCODE_STEP.ERROR, ENCODE_STEP.START, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.PREPARE, ENCODE_STEP.ERROR, - ENCODE_STEP.RESET, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.PREPARE, - ENCODE_STEP.ERROR, ENCODE_STEP.RESET, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0600', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0600.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.PREPARE, - ENCODE_STEP.ERROR, ENCODE_STEP.RESET, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0700', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0700.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.PREPARE, - ENCODE_STEP.ERROR, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0800', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_CALLBACK_0800.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.PREPARE, - ENCODE_STEP.ERROR, ENCODE_STEP.RESET, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0100 - * @tc.name : 001.create -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.START, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0200 - * @tc.name : 002.configure -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.START, - ENCODE_STEP.ERROR, STREAM_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0400 - * @tc.name : 004.start -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.START, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0500 - * @tc.name : 005.flush -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, ENCODE_STEP.PREPARE, - ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.START, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0600 - * @tc.name : 006.stop -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0600', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0600.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.START, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0700', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0700.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.START, - ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0800 - * @tc.name : 008.reset -> start - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0800', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_CALLBACK_0800.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.START, - ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0100 - * @tc.name : 001.create -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.FLUSH, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, - STREAM_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.FLUSH, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0400 - * @tc.name : 004.start -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.FLUSH, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0600', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0600.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.STOP , ENCODE_STEP.FLUSH, - ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0700', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0700.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.FLUSH, - ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0800', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_CALLBACK_0800.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.FLUSH, - ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0100 - * @tc.name : 001.create -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.STOP, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, STREAM_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.STOP, ENCODE_STEP.ERROR, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0400 - * @tc.name : 004.start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.STOP, - ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0600', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0600.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.STOP, ENCODE_STEP.ERROR, - ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0700', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0700.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.STOP, - ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0800', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_CALLBACK_0800.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.STOP, ENCODE_STEP.ERROR, - ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0100 - * @tc.name : 001.create -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, - STREAM_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0400 - * @tc.name : 004.start -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.FLUSH, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0600', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0600.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0700', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0700.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0800', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_CALLBACK_0800.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.RESET, ENCODE_STEP.RESET, ENCODE_STEP.RELEASE); - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0100', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0100.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.FLUSH, - ENCODE_STEP.STOP, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0200', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0200.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.FLUSH, - ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0300', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0300.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.RESET, - ENCODE_STEP.CONFIGURE, STREAM_STEP.STOP, STREAM_STEP.SET_PARAM, STREAM_STEP.SET_EOS_FRAME, - STREAM_STEP.START, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0400', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0400.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.STOP, - ENCODE_STEP.START, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : test for state transition - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0500', 0, async function (done) { - let path = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_CALLBACK_0500.es'; - let mySteps = new Array(ENCODE_STEP.CONFIGURE, STREAM_STEP.CREATE, STREAM_STEP.SET_PARAM, - STREAM_STEP.SET_EOS_FRAME, ENCODE_STEP.GET_INPUTSURFACE, STREAM_STEP.START, - ENCODE_STEP.PREPARE, ENCODE_STEP.START, ENCODE_STEP.WAIT_FOR_EOS, ENCODE_STEP.STOP, - ENCODE_STEP.START, ENCODE_STEP.STOP, ENCODE_STEP.RELEASE); - frameTotal = 50; - toCreateVideoEncoderByName('avenc_mpeg4', path, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_RESET_CALLBACK_0100 - * @tc.name : 001. configure -> reset for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_RESET_CALLBACK_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let loopCnt = 0; - eventEmitter.on('configure', (mediaDescription) => { - videoEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('reset'); - }) - }); - eventEmitter.on('reset', () => { - videoEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info(`case reset 1`); - loopCnt += 1; - if (loopCnt < 50) { - console.info('case configure-reset current loop: ' + loopCnt); - eventEmitter.emit('configure', mediaDescription); - } else { - videoEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info('case release callback'); - videoEncodeProcessor = null; - done(); - }) - } - }) - }); - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - videoEncodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_STOP_CALLBACK_0100 - * @tc.name : 001. start -> stop for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_STOP_CALLBACK_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let loopCnt = 0; - eventEmitter.on('configure', (mediaDescription) => { - videoEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('getInputSurface'); - }) - }); - eventEmitter.on('getInputSurface', () => { - videoEncodeProcessor.getInputSurface((err, inputSurface) => { - expect(err).assertUndefined(); - expect(inputSurface != undefined).assertTrue(); - surfaceID = inputSurface; - console.info('in case : getInputSurface success, surfaceID ' + surfaceID); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - videoEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case : prepare success'); - eventEmitter.emit('start'); - }); - }); - eventEmitter.on('start', () => { - videoEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case : start success'); - eventEmitter.emit('stop'); - }); - }); - eventEmitter.on('stop', () => { - videoEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info(`case stop 1`); - loopCnt += 1; - if (loopCnt < 50) { - console.info('case start-stop current loop: ' + loopCnt); - eventEmitter.emit('start'); - } else { - videoEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info('case release callback'); - videoEncodeProcessor = null; - done(); - }) - } - }) - }); - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - videoEncodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CREATE_RELEASE_CALLBACK_0100 - * @tc.name : 001. create -> release for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CREATE_RELEASE_CALLBACK_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let loopCnt = 0; - eventEmitter.on('create', (name) => { - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - videoEncodeProcessor = processor; - eventEmitter.emit('release'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - }) - eventEmitter.on('release', () => { - videoEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info(`case release 1`); - videoEncodeProcessor = null; - loopCnt += 1; - if (loopCnt < 50) { - console.info('case create-release current loop: ' + loopCnt); - eventEmitter.emit('create', name); - } else { - done(); - } - }) - }) - eventEmitter.emit('create', name); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOTALLOOP_CALLBACK_0100 - * @tc.name : 001. total loop for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOTALLOOP_CALLBACK_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - let events = require('events'); - let eventEmitter = new events.EventEmitter(); - let loopCnt = 0; - eventEmitter.on('create', (name) => { - media.createVideoEncoderByName(name, (err, processor) => { - expect(err).assertUndefined(); - if (typeof(processor) != 'undefined') { - videoEncodeProcessor = processor; - eventEmitter.emit('configure', mediaDescription); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - }) - eventEmitter.on('configure', (mediaDescription) => { - videoEncodeProcessor.configure(mediaDescription, (err) => { - expect(err).assertUndefined(); - console.info(`case configure 1`); - eventEmitter.emit('getInputSurface'); - }) - }); - eventEmitter.on('getInputSurface', () => { - videoEncodeProcessor.getInputSurface((err, inputSurface) => { - expect(err).assertUndefined(); - expect(inputSurface != undefined).assertTrue(); - surfaceID = inputSurface; - console.info('in case : getInputSurface success, surfaceID ' + surfaceID); - eventEmitter.emit('prepare'); - }) - }); - eventEmitter.on('prepare', () => { - videoEncodeProcessor.prepare((err) => { - expect(err).assertUndefined(); - console.info('in case : prepare success'); - eventEmitter.emit('start'); - }); - }); - eventEmitter.on('start', () => { - videoEncodeProcessor.start((err) => { - expect(err).assertUndefined(); - console.info('in case : start success'); - eventEmitter.emit('flush'); - }); - }); - eventEmitter.on('flush', () => { - videoEncodeProcessor.flush((err) => { - expect(err).assertUndefined(); - console.info('in case : flush success'); - eventEmitter.emit('stop'); - }); - }); - eventEmitter.on('stop', () => { - videoEncodeProcessor.stop((err) => { - expect(err).assertUndefined(); - console.info('in case : stop success'); - eventEmitter.emit('reset'); - }); - }); - eventEmitter.on('reset', () => { - videoEncodeProcessor.reset((err) => { - expect(err).assertUndefined(); - console.info('in case : reset success'); - eventEmitter.emit('release'); - }); - }); - eventEmitter.on('release', () => { - videoEncodeProcessor.release((err) => { - expect(err).assertUndefined(); - console.info(`case release 1`); - videoEncodeProcessor = null; - loopCnt += 1; - if (loopCnt < 50) { - console.info('case create-release current loop: ' + loopCnt); - eventEmitter.emit('create', name); - } else { - done(); - } - }) - }) - eventEmitter.emit('create', name); - }) -}) - diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js deleted file mode 100644 index 5b046fd9fe686eb1bf56169b8ca145ad44094b84..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js +++ /dev/null @@ -1,1523 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import mediademo from '@ohos.multimedia.mediademo' -import Fileio from '@ohos.fileio' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('videoEncoderReliabilityPromise', function () { - const ROOT = '/data/app/el1/bundle/results/'; - const BASIC_PATH = ROOT + 'video_reliability_promise_'; - let videoEncodeProcessor; - let mediaTest = mediademo.createMediaTest(); - let surfaceID = ''; - let outputQueue = []; - let outputCnt = 0; - let frameTotal = 100; - let frameCountOut = 0; - let flushAtEOS = false; - let sawOutputEOS = false; - let needGetMediaDes = false; - let workdoneAtEOS = false; - const END = 0; - const CONFIGURE = 1; - const GETSURFACE = 2; - const SETSTREAMPARAM = 3; - const PREPARE = 4; - const STARTSTREAM = 5; - const STOPSTREAM = 6; - const START = 7; - const FLUSH = 8; - const STOP = 9; - const RESET = 10; - const RELEASE = 11; - const HOLDON = 12; - const ERROR = 13; - const WAITFORALLOUTS = 14; - const JUDGE_EOS = 15; - const WAITTIME = 3000; - let width = 320; - let height = 240; - let framerate = 30; - let mediaDescription = { - "width": width, - "height": height, - "pixel_format": 3, - "frame_rate" : framerate, - } - let mime = 'video/mp4v-es'; - - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(async function() { - console.info('beforeEach case'); - await msleep(1000).then(() => { - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - surfaceID = ''; - outputQueue = []; - outputCnt = 0; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - workdoneAtEOS = false; - width = 320; - height = 240; - framerate = 30; - frameTotal = 100; - }) - - afterEach(async function() { - console.info('afterEach case'); - if (videoEncodeProcessor != null) { - await videoEncodeProcessor.release().then(() => { - console.info(`case release 1`); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - let failCallback = function(err) { - console.info('case callback err : ' + err); - expect(err).assertUndefined(); - } - - let failCallbackTrue = function(err, mySteps, done) { - console.info('case callback err : ' + err); - expect(err != undefined).assertTrue(); - nextStep(mySteps, done); - } - - let failCatch = function(err) { - console.info('case catch err : ' + err); - expect(err).assertUndefined(); - } - - function msleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - function resetParam() { - outputQueue = []; - outputCnt = 0; - frameTotal = 100; - flushAtEOS = false; - sawOutputEOS = false; - needGetMediaDes = false; - workdoneAtEOS = false; - } - - function writeFile(path, buf, len){ - try{ - let writestream = Fileio.createStreamSync(path, "ab+"); - let num = writestream.writeSync(buf, {length:len}); - writestream.flushSync(); - writestream.closeSync(); - } catch(e) { - console.info(e) - } - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)); - } - - function wait(time) { - for(let t = Date.now(); Date.now() - t <= time;); - } - - async function nextStep(mySteps, done) { - console.info("case myStep[0]: " + mySteps[0]); - if (mySteps[0] == END) { - done(); - } - switch (mySteps[0]) { - case CONFIGURE: - mySteps.shift(); - console.info(`case to configure`); - await toConfigure(mySteps, done); - break; - case GETSURFACE: - mySteps.shift(); - console.info(`case to getInputSurface`); - await toGetInputSurface(); - nextStep(mySteps, done); - break; - case SETSTREAMPARAM: - mySteps.shift(); - toSetStreamParam(); - nextStep(mySteps, done); - break; - case PREPARE: - mySteps.shift(); - console.info(`case to prepare`); - await toPrepare(mySteps, done); - break; - case STARTSTREAM: - mySteps.shift(); - console.info(`case to start stream`); - toStartStream(); - nextStep(mySteps, done); - break; - case STOPSTREAM: - mySteps.shift(); - console.info(`case to stop stream`); - mediaTest.closeStream(surfaceID); - nextStep(mySteps, done); - break; - case START: - mySteps.shift(); - console.info(`case to start`); - await toStart(mySteps, done); - break; - case FLUSH: - mySteps.shift(); - console.info(`case to flush`); - await toFlush(mySteps, done); - break; - case STOP: - mySteps.shift(); - console.info(`case to stop`); - await toStop(mySteps, done); - break; - case RESET: - mySteps.shift(); - console.info(`case to reset`); - await toReset(); - nextStep(mySteps, done); - break; - case RELEASE: - mySteps.shift(); - console.info(`case to release`); - await toRelease(mySteps, done); - break; - case HOLDON: - mySteps.shift(); - setTimeout(() => { - nextStep(mySteps, done); - }, WAITTIME); - break; - case WAITFORALLOUTS: - mySteps.shift(); - console.info(`case wait for all outputs`); - break; - case JUDGE_EOS: - mySteps.shift(); - console.info(`case judge EOS state`); - expect(sawOutputEOS).assertTrue(); - nextStep(mySteps, done); - break; - default: - break; - } - } - async function dequeueOutputs(path, done) { - while (outputQueue.length > 0) { - let outputObject = outputQueue.shift(); - outputCnt += 1; - if (outputObject.flags == 1) { - console.info("saw output EOS"); - sawOutputEOS = true; - if (workdoneAtEOS) { - mediaTest.closeStream(surfaceID); - await toReset(); - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - done(); - } else { - console.info("sawOutputEOS = true;"); - } - } else { - console.info('not last frame, continue'); - videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => { - console.info('release output success'); - frameCountOut++; - console.log('release output count:' + frameCountOut); - }) - } - } - } - - function setCallback(path, done) { - console.info('case callback'); - videoEncodeProcessor.on('newOutputData', async(outBuffer) => { - console.info('outputBufferAvailable'); - console.info('outBuffer.flags :' + outBuffer.flags); - if (needGetMediaDes) { - videoEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => { - console.info("get OutputMediaDescription success"); - console.info('get outputMediaDescription : ' + MediaDescription); - needGetMediaDes = false; - }, failCallback).catch(failCatch); - } - outputQueue.push(outBuffer); - await dequeueOutputs(path, done); - }); - - videoEncodeProcessor.on('error',(err) => { - console.info('case error called,errName is' + err); - }); - videoEncodeProcessor.on('streamChanged',(format) => { - console.info('Output format changed: ' + format); - }); - } - - async function createVideoEncoder(savepath, mySteps, done) { - await media.createVideoEncoderByMime(mime).then((processor) => { - console.info(`case createVideoEncoder 1`); - videoEncodeProcessor = processor; - setCallback(savepath, done); - console.info("case start api test"); - nextStep(mySteps, done); - }, failCallback).catch(failCatch); - } - - async function toCreateByMime(mime, done) { - await media.createVideoEncoderByMime(mime).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByMime success'); - } else { - console.info('in case : createVideoEncoderByMime fail'); - expect().assertFail(); - done(); - } - }) - } - - function toSetStreamParam() { - mediaTest.setResolution(width, height); - mediaTest.setFrameRate(framerate); - mediaTest.setFrameCount(frameTotal); - } - - async function toGetInputSurface() { - await videoEncodeProcessor.getInputSurface().then((inputSurface) => { - expect(inputSurface != undefined).assertTrue(); - surfaceID = inputSurface; - }, failCallback).catch(failCatch); - } - - function toStartStream() { - mediaTest.isStart = 1; - mediaTest.startStream(surfaceID); - } - - async function toConfigure(mySteps, done) { - if (mySteps[0] == ERROR) { - mySteps.shift(); - console.info(`case to configure 2`); - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info(`case configure error 1`); - expect().assertFail(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - } else { - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - } - nextStep(mySteps, done); - } - - async function toPrepare(mySteps, done) { - if (mySteps[0] == ERROR) { - mySteps.shift(); - console.info(`case to prepare 2`); - await videoEncodeProcessor.prepare().then(() => { - console.info(`case prepare error 1`); - expect().assertFail(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - } else { - await videoEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - } - nextStep(mySteps, done); - } - - async function toStart(mySteps, done) { - if (mySteps[0] == ERROR) { - mySteps.shift(); - console.info(`case to start 2`); - await videoEncodeProcessor.start().then(() => { - console.info(`case start error 1`); - expect().assertFail(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - } else { - if (sawOutputEOS) { - resetParam(); - workdoneAtEOS = true; - } - await videoEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - } - nextStep(mySteps, done); - } - - async function toFlush(mySteps, done) { - if (mySteps[0] == ERROR) { - mySteps.shift(); - console.info(`case to flush 2`); - await videoEncodeProcessor.flush().then(() => { - console.info(`case flush error 1`); - expect().assertFail(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - } else { - await videoEncodeProcessor.flush().then(() => { - console.info("case flush success"); - }, failCallback).catch(failCatch); - if (flushAtEOS) { - mediaTest.closeStream(surfaceID); - resetParam(); - workdoneAtEOS = true; - } - } - nextStep(mySteps, done); - } - - async function toStop(mySteps, done) { - if (mySteps[0] == ERROR) { - mySteps.shift(); - console.info(`case to stop 2`); - await videoEncodeProcessor.stop().then(() => { - console.info(`case stop error 1`); - expect().assertFail(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - } else { - await videoEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - } - nextStep(mySteps, done); - } - - async function toReset() { - await videoEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - } - - async function toRelease(mySteps, done) { - if (mySteps[0] == ERROR) { - mySteps.shift(); - console.info(`case to relase 2`); - await videoEncodeProcessor.release().then(() => { - console.info(`case release error 1`); - expect().assertFail(); - }, (err) => {failCallbackTrue(err, mySteps, done)}).catch(failCatch); - videoEncodeProcessor = null; - } else { - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - if (mySteps[0] != RELEASE) { - videoEncodeProcessor = null; - } - } - nextStep(mySteps, done); - } - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0100 - * @tc.name : 001.create -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0100.es'; - let mySteps = new Array(CONFIGURE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0200 - * @tc.name : 002.prepare -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0200.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, CONFIGURE, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0300 - * @tc.name : 003.start -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, - CONFIGURE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0400 - * @tc.name : 004.flush -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, - CONFIGURE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0500 - * @tc.name : 005.stop -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP , - CONFIGURE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0600 - * @tc.name : 006.EOS -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, CONFIGURE, ERROR, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0700 - * @tc.name : 007.reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0700.es'; - let mySteps = new Array(RESET, CONFIGURE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0800 - * @tc.name : 008.configure -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0800.es'; - let mySteps = new Array(CONFIGURE, CONFIGURE, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0900 - * @tc.name : 009.configure -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0900', 0, async function (done) { - let savepath = BASIC_PATH + 'configure_0900.es'; - let mySteps = new Array(CONFIGURE, RESET, CONFIGURE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0100 - * @tc.name : 001.create -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0100.es'; - let mySteps = new Array(PREPARE, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0200 - * @tc.name : 002.configure -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0200.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0300 - * @tc.name : 003.prepare -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, PREPARE, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0400 - * @tc.name : 004.start -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, PREPARE, ERROR, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0500 - * @tc.name : 005.flush -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, - PREPARE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0600 - * @tc.name : 006.stop -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, - PREPARE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0700 - * @tc.name : 007.EOS -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0700.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, PREPARE, ERROR, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0800 - * @tc.name : 008.reset -> prepare - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'prepare_0800.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RESET, - PREPARE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0100 - * @tc.name : 001.create -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0100.es'; - let mySteps = new Array(START, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0200 - * @tc.name : 002.configure -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0200.es'; - let mySteps = new Array(CONFIGURE, START, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0300 - * @tc.name : 003.prepare -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, WAITFORALLOUTS); - workdoneAtEOS = true; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0400 - * @tc.name : 004.start -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, START, ERROR, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0500 - * @tc.name : 005.flush -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, - START, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0600 - * @tc.name : 006.stop -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, - START, WAITFORALLOUTS); - workdoneAtEOS = true; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0700 - * @tc.name : 007.EOS -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0700.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, START, ERROR, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0800 - * @tc.name : 008.reset -> start - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'start_0800.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RESET, - START, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0100 - * @tc.name : 001.create -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0100.es'; - let mySteps = new Array(FLUSH, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0200 - * @tc.name : 002.configure -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0200.es'; - let mySteps = new Array(CONFIGURE, FLUSH, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0300 - * @tc.name : 003.prepare -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, FLUSH, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0400 - * @tc.name : 004.start -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, FLUSH, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0500 - * @tc.name : 005.flush -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, FLUSH, - WAITFORALLOUTS); - workdoneAtEOS = true; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0600 - * @tc.name : 006.stop -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, - FLUSH, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0700 - * @tc.name : 007.EOS -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0700.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, FLUSH, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0800 - * @tc.name : 008.reset -> flush - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_FLUSH_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'flush_0800.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RESET, - FLUSH, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0100 - * @tc.name : 001.create -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0100.es'; - let mySteps = new Array(STOP, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0200 - * @tc.name : 002.configure -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0200.es'; - let mySteps = new Array(CONFIGURE, STOP, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0300 - * @tc.name : 003.prepare -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STOP, ERROR, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0400 - * @tc.name : 004.start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0500 - * @tc.name : 005.flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, STOP, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0600 - * @tc.name : 006.stop -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, STOP, ERROR, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0700 - * @tc.name : 007.EOS -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0700.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, JUDGE_EOS, - STOP, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0800 - * @tc.name : 008.reset -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_STOP_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'stop_0800.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RESET, - STOP, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0100 - * @tc.name : 001.create -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0100.es'; - let mySteps = new Array(RESET, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0200 - * @tc.name : 002.configure -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0200.es'; - let mySteps = new Array(CONFIGURE, RESET, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0300 - * @tc.name : 003.prepare -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, RESET, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0400 - * @tc.name : 004.start -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RESET, - STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0500 - * @tc.name : 005.flush -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, - RESET, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0600 - * @tc.name : 006.stop -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, - RESET, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0700 - * @tc.name : 007.EOS -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0700.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, RESET, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0800 - * @tc.name : 008.reset -> reset - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RESET_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'reset_0800.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RESET, - RESET, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0100 - * @tc.name : 001.create -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0100.es'; - let mySteps = new Array(RELEASE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0200 - * @tc.name : 002.configure -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0200.es'; - let mySteps = new Array(CONFIGURE, RELEASE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0300 - * @tc.name : 003.prepare -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, RELEASE, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0400 - * @tc.name : 004.start -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, - RELEASE, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0500 - * @tc.name : 005.flush -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, FLUSH, - RELEASE, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0600 - * @tc.name : 006.stop -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0600', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0600.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, STOP, - RELEASE, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0700 - * @tc.name : 007.EOS -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0700', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0700.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, RELEASE, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0800 - * @tc.name : 008.release -> release - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_RELEASE_PROMISE_0800', 0, async function (done) { - let savepath = BASIC_PATH + 'release_0800.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STARTSTREAM, START, RELEASE, - RELEASE, ERROR, STOPSTREAM, END); - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0100 - * @tc.name : 001.EOS -> flush -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0100', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0100.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, FLUSH, STOP, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0200 - * @tc.name : 002.EOS -> flush -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0200', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0200.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, FLUSH, STARTSTREAM, WAITFORALLOUTS); - frameTotal = 2; - flushAtEOS = true; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0300 - * @tc.name : 003.EOS -> reset -> configure - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0300', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0300.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, RESET, CONFIGURE, STOPSTREAM, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0400 - * @tc.name : 004.EOS -> stop -> start -> EOS - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0400', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0400.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, STOPSTREAM, STOP, START, SETSTREAMPARAM, STARTSTREAM, WAITFORALLOUTS); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0500 - * @tc.name : 005.EOS -> stop -> start -> stop - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_EOS_PROMISE_0500', 0, async function (done) { - let savepath = BASIC_PATH + 'eos_0500.es'; - let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, START, STARTSTREAM, HOLDON, - JUDGE_EOS, STOP, START, STOP, STOPSTREAM, RELEASE, END); - frameTotal = 2; - createVideoEncoder(savepath, mySteps, done); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_RESET_PROMISE_0100 - * @tc.name : 001. configure -> reset for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_RESET_PROMISE_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - for (let j = 1; j < 51; j++) { - console.info('case configure-reset current loop: ' + j); - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - } - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_STOP_PROMISE_0100 - * @tc.name : 001. start -> stop for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_START_STOP_PROMISE_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - await toGetInputSurface(); - await videoEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - for (let j = 1; j < 51; j++) { - console.info('case start-stop current loop: ' + j); - await videoEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - } - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CREATE_RELEASE_PROMISE_0100 - * @tc.name : 001. create -> release for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CREATE_RELEASE_PROMISE_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - for (let j = 1; j < 51; j++) { - console.info('case create-release current loop: ' + j); - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - done(); - }) - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOTALLOOP_PROMISE_0100 - * @tc.name : 001. total loop for 50 times - * @tc.desc : Reliability Test - * @tc.size : MediumTest - * @tc.type : Reliability - * @tc.level : Level2 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOTALLOOP_PROMISE_0100', 0, async function (done) { - let name = 'avenc_mpeg4'; - for (let j = 1; j < 51; j++) { - console.info('case create-release current loop: ' + j); - await media.createVideoEncoderByName(name).then((processor) => { - if (typeof (processor) != 'undefined') { - videoEncodeProcessor = processor; - console.info('in case : createVideoEncoderByName success'); - } else { - console.info('in case : createVideoEncoderByName fail'); - expect().assertFail(); - done(); - } - }) - await videoEncodeProcessor.configure(mediaDescription).then(() => { - console.info("case configure success"); - }, failCallback).catch(failCatch); - await toGetInputSurface(); - await videoEncodeProcessor.prepare().then(() => { - console.info("case prepare success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.start().then(() => { - console.info("case start success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.flush().then(() => { - console.info("case flush success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.stop().then(() => { - console.info("case stop success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.reset().then(() => { - console.info("case reset success"); - }, failCallback).catch(failCatch); - await videoEncodeProcessor.release().then(() => { - console.info("case release success"); - }, failCallback).catch(failCatch); - videoEncodeProcessor = null; - } - done(); - }) -}) diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js deleted file mode 100644 index b4033e53e398e104a94a731d8ea5cdcb120089a9..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -import media from '@ohos.multimedia.media' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('VideoHardwareEncoderEnum', function () { - - beforeAll(function() { - console.info('beforeAll case'); - }) - - beforeEach(function() { - console.info('beforeEach case'); - }) - - afterEach(function() { - console.info('afterEach case'); - }) - - afterAll(function() { - console.info('afterAll case'); - }) - - - /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_ENUM_MediaDescriptionKey_0100 - * @tc.name : 001.MediaDescriptionKey - * @tc.desc : Test Enumerate MediaDescriptionKey - * @tc.size : MediumTest - * @tc.type : Function test - * @tc.level : Level0 - */ - it('SUB_MULTIMEDIA_MEDIA_VIDEO_HARDWARE_ENCODER_ENUM_MediaDescriptionKey_0100', 0, async function (done) { - expect(media.MediaDescriptionKey.MD_KEY_SUSPEND_INPUT_SURFACE).assertEqual("suspend_input_surface"); - expect(media.MediaDescriptionKey.MD_KEY_VIDEO_ENCODE_BITRATE_MODE).assertEqual("video_encode_bitrate_mode"); - expect(media.MediaDescriptionKey.MD_KEY_PROFILE).assertEqual("codec_profile"); - expect(media.MediaDescriptionKey.MD_KEY_QUALITY).assertEqual("codec_quality"); - expect(media.MediaDescriptionKey.MD_KEY_CUSTOM).assertEqual("vendor.custom"); - expect(media.MediaDescriptionKey.MD_KEY_MAX_INPUT_SIZE).assertEqual("max_input_size"); - expect(media.MediaDescriptionKey.MD_KEY_MAX_ENCODER_FPS).assertEqual("max_encoder_fps"); - expect(media.MediaDescriptionKey.MD_KEY_WIDTH).assertEqual("width"); - expect(media.MediaDescriptionKey.MD_KEY_HEIGHT).assertEqual("height"); - expect(media.MediaDescriptionKey.MD_KEY_PIXEL_FORMAT).assertEqual("pixel_format"); - expect(media.MediaDescriptionKey.MD_KEY_FRAME_RATE).assertEqual("frame_rate"); - expect(media.MediaDescriptionKey.MD_KEY_CAPTURE_RATE).assertEqual("capture_rate"); - expect(media.MediaDescriptionKey.MD_KEY_I_FRAME_INTERVAL).assertEqual("i_frame_interval"); - expect(media.MediaDescriptionKey.MD_KEY_REQUEST_I_FRAME).assertEqual("req_i_frame"); - expect(media.MediaDescriptionKey.MD_KEY_REPEAT_FRAME_AFTER).assertEqual("repeat_frame_after"); - done(); - }) -}) \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/videoEncoder/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40f7360d5d818998221b199d3ec0f69c0..0000000000000000000000000000000000000000 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/videoEncoder/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/media/media_js_standard/videoEncoder/src/main/resources/base/media/icon.png and /dev/null differ