Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1713feb9
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1713feb9
编写于
3月 09, 2022
作者:
L
ling990
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify testcases Signed-off-by: ling990 <liling96@huawei.com>
Signed-off-by:
N
ling990
<
liling96@huawei.com
>
上级
5199f285
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
303 addition
and
498 deletion
+303
-498
multimedia/media/media_js_standard/audioDecoder/Test.json
multimedia/media/media_js_standard/audioDecoder/Test.json
+2
-3
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
...udioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
+0
-5
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
+3
-3
multimedia/media/media_js_standard/audioEncoder/Test.json
multimedia/media/media_js_standard/audioEncoder/Test.json
+2
-3
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
...r/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
+3
-3
multimedia/media/media_js_standard/videoDecoder/BUILD.gn
multimedia/media/media_js_standard/videoDecoder/BUILD.gn
+1
-1
multimedia/media/media_js_standard/videoDecoder/Test.json
multimedia/media/media_js_standard/videoDecoder/Test.json
+8
-10
multimedia/media/media_js_standard/videoDecoder/src/main/config.json
...media/media_js_standard/videoDecoder/src/main/config.json
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
...ideoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
+36
-137
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
...der/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
+26
-45
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
+27
-49
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
...der/src/main/js/test/VideoDecoderReliCallbackTest.test.js
+22
-14
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
+22
-13
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
+15
-53
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
+15
-52
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
+22
-14
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
+23
-13
multimedia/media/media_js_standard/videoEncoder/Test.json
multimedia/media/media_js_standard/videoEncoder/Test.json
+2
-3
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
...r/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
+3
-3
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
+23
-23
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
+30
-33
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
.../test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
+5
-5
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
...s/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
+9
-9
未找到文件。
multimedia/media/media_js_standard/audioDecoder/Test.json
浏览文件 @
1713feb9
...
...
@@ -22,13 +22,12 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results"
,
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results/"
,
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder"
,
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/*"
,
"setenforce 0"
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/*"
],
"teardown-command"
:[
"setenforce 1"
]
},
{
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
浏览文件 @
1713feb9
...
...
@@ -184,14 +184,9 @@ describe('AudioDecoderEnum', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
CodecMimeType
.
AUDIO_AMR_NB
).
assertEqual
(
'
audio/3gpp
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_AMR_WB
).
assertEqual
(
'
audio/amr-wb
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_MPEG
).
assertEqual
(
'
audio/mpeg
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_AAC
).
assertEqual
(
'
audio/mp4a-latm
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_VORBIS
).
assertEqual
(
'
audio/vorbis
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_OPUS
).
assertEqual
(
'
audio/opus
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_FLAC
).
assertEqual
(
'
audio/flac
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_RAW
).
assertEqual
(
'
audio/raw
'
);
done
();
})
})
\ No newline at end of file
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js
浏览文件 @
1713feb9
...
...
@@ -246,7 +246,7 @@ describe('AudioDecoderMultiInstances', function () {
it
(
'
SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple instances
"
);
let
array
=
new
Array
();
for
(
let
i
=
0
;
i
<
16
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
2
;
i
+=
1
)
{
await
media
.
createAudioDecoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createAudioDecoder success:
"
+
i
);
...
...
@@ -256,9 +256,9 @@ describe('AudioDecoderMultiInstances', function () {
}
},
failCallback
).
catch
(
failCatch
);
}
console
.
info
(
'
case has created
16
decoders
'
);
console
.
info
(
'
case has created
2
decoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
for
(
let
j
=
0
;
j
<
2
;
j
++
)
{
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset decoder
"
+
j
);
...
...
multimedia/media/media_js_standard/audioEncoder/Test.json
浏览文件 @
1713feb9
...
...
@@ -19,13 +19,12 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results"
,
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results/"
,
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder"
,
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/*"
,
"setenforce 0"
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/*"
],
"teardown-command"
:[
"setenforce 1"
]
},
{
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js
浏览文件 @
1713feb9
...
...
@@ -291,7 +291,7 @@ describe('AudioEncoderFuncPromise', function () {
it
(
'
SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test multiple encoder instances
"
);
let
array
=
new
Array
();
for
(
let
i
=
0
;
i
<
16
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
2
;
i
+=
1
)
{
await
media
.
createAudioEncoderByMime
(
'
audio/mp4a-latm
'
).
then
((
processor
)
=>
{
if
(
typeof
(
processor
)
!=
'
undefined
'
)
{
console
.
info
(
"
case create createAudioEncoder success:
"
+
i
);
...
...
@@ -301,9 +301,9 @@ describe('AudioEncoderFuncPromise', function () {
}
},
failCallback
).
catch
(
failCatch
);
}
console
.
info
(
'
case has created
16
encoders
'
);
console
.
info
(
'
case has created
2
encoders
'
);
console
.
info
(
'
case array:
'
+
array
);
for
(
let
j
=
0
;
j
<
16
;
j
++
)
{
for
(
let
j
=
0
;
j
<
2
;
j
++
)
{
resetParam
();
await
array
[
j
].
reset
().
then
(()
=>
{
console
.
info
(
"
reset encoder
"
+
j
);
...
...
multimedia/media/media_js_standard/videoDecoder/BUILD.gn
浏览文件 @
1713feb9
...
...
@@ -20,7 +20,7 @@ ohos_js_hap_suite("video_decoder_js_hap") {
":video_decoder_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoDecoderJsTest"
hap_name = "
Acts
VideoDecoderJsTest"
}
ohos_js_assets("video_decoder_js_assets") {
source_dir = "./src/main/js/default"
...
...
multimedia/media/media_js_standard/videoDecoder/Test.json
浏览文件 @
1713feb9
...
...
@@ -3,7 +3,7 @@
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"2000000"
,
"package"
:
"ohos.acts.multimedia.videodecoder"
,
"package"
:
"ohos.acts.multimedia.video
.video
decoder"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
...
...
@@ -12,26 +12,24 @@
"pre-push"
:
[
],
"push"
:
[
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
,
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
,
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
,
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
,
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/"
,
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/"
,
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/"
,
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/"
,
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
,
"setenforce 0"
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/"
],
"teardown-command"
:[
"setenforce 1"
]
},
{
"test-file-name"
:
[
"
Media
VideoDecoderJsTest.hap"
"
Acts
VideoDecoderJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/config.json
浏览文件 @
1713feb9
...
...
@@ -6,7 +6,7 @@
"target"
:
7
},
"vendor"
:
"acts"
,
"bundleName"
:
"ohos.acts.multimedia.videodecoder"
,
"bundleName"
:
"ohos.acts.multimedia.video
.video
decoder"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
...
...
@@ -35,7 +35,7 @@
"visible"
:
true
,
"labelId"
:
16777216
,
"icon"
:
"$media:icon"
,
"name"
:
"ohos.acts.multimedia.videodecoder.MainAbility"
,
"name"
:
"ohos.acts.multimedia.video
.video
decoder.MainAbility"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
...
...
@@ -49,14 +49,14 @@
"tv"
,
"wearable"
],
"mainAbility"
:
"ohos.acts.multimedia.videodecoder.MainAbility"
,
"mainAbility"
:
"ohos.acts.multimedia.video
.video
decoder.MainAbility"
,
"distro"
:
{
"moduleType"
:
"entry"
,
"installationFree"
:
false
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
},
"package"
:
"ohos.acts.multimedia.videodecoder"
,
"package"
:
"ohos.acts.multimedia.video
.video
decoder"
,
"name"
:
".MyApplication"
,
"js"
:
[
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
浏览文件 @
1713feb9
...
...
@@ -15,6 +15,7 @@
import
media
from
'
@ohos.multimedia.media
'
import
Fileio
from
'
@ohos.fileio
'
import
router
from
'
@system.router
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
...
@@ -32,17 +33,21 @@ describe('VideoDecoderEnum', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/
media
/
'
;
const
BASIC_PATH
=
'
/data/
accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared
/
'
;
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_
30FPS_108
0
=
[
3491
,
115184
];
const
H264_FRAME_SIZE_
60FPS_32
0
=
[
2106
,
11465
];
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
// getSurfaceID();
})
beforeEach
(
function
()
{
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
;
...
...
@@ -50,6 +55,7 @@ describe('VideoDecoderEnum', function () {
outputQueue
=
[];
isCodecData
=
false
;
inputEosFlag
=
false
;
surfaceID
=
globalThis
.
value
;
})
afterEach
(
async
function
()
{
...
...
@@ -60,14 +66,11 @@ describe('VideoDecoderEnum', function () {
},
failCallback
).
catch
(
failCatch
);
videoDecodeProcessor
=
null
;
}
if
(
videoPlayer
!=
null
)
{
await
videoPlayer
.
release
().
then
(()
=>
{
console
.
info
(
'
in case : videoPlayer release success
'
);
},
failCallback
).
catch
(
failCatch
);
videoPlayer
=
null
;
}
await
router
.
clear
().
then
(()
=>
{
},
failCallback
).
catch
(
failCatch
);
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll case
'
);
})
...
...
@@ -90,6 +93,22 @@ describe('VideoDecoderEnum', function () {
}
}
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
getContent
(
buf
,
len
)
{
console
.
info
(
'
start get content, len
'
+
len
+
'
buf.byteLength
'
+
buf
.
byteLength
);
let
lengthReal
=
-
1
;
...
...
@@ -293,52 +312,30 @@ describe('VideoDecoderEnum', function () {
},
failCallback
).
catch
(
failCatch
);
}
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_AVCProfile_0100
* @tc.name : 001.AVCProfile
* @tc.desc : Test Enumerate AVCProfile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_AVCProfile_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AVCProfile
.
AVC_PROFILE_BASELINE
).
assertEqual
(
0
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_CONSTRAINED_BASELINE
).
assertEqual
(
1
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_CONSTRAINED_HIGH
).
assertEqual
(
2
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_EXTENDED
).
assertEqual
(
3
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_HIGH
).
assertEqual
(
4
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_HIGH_10
).
assertEqual
(
5
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_HIGH_422
).
assertEqual
(
6
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_HIGH_444
).
assertEqual
(
7
);
expect
(
media
.
AVCProfile
.
AVC_PROFILE_MAIN
).
assertEqual
(
8
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_CodecBuffer_0100
* @tc.name : 00
2
.CodecBuffer
* @tc.name : 00
1
.CodecBuffer
* @tc.desc : Test Interface CodecBuffer
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_CodecBuffer_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
60FPS_32
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
3
0.00
,
'
frame_rate
'
:
6
0.00
,
'
max_input_size
'
:
150000
,
}
await
toCreateVideoDecoderByMime
(
'
video/avc
'
,
done
);
await
toGetVideoDecoderCaps
();
await
toConfigure
(
mediaDescription
,
srcPath
);
await
setSurfaceID
(
done
);
await
toSetOutputSurface
(
true
);
setCallback
(
function
(){
eventEmitter
.
emit
(
'
nextStep
'
,
done
);}
...
...
@@ -349,7 +346,7 @@ describe('VideoDecoderEnum', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_CodecMimeType_0100
* @tc.name : 00
3
.CodecMimeType
* @tc.name : 00
2
.CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
...
...
@@ -359,107 +356,9 @@ describe('VideoDecoderEnum', function () {
expect
(
media
.
CodecMimeType
.
VIDEO_H263
).
assertEqual
(
'
video/h263
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_AVC
).
assertEqual
(
'
video/avc
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_MPEG2
).
assertEqual
(
'
video/mpeg2
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_HEVC
).
assertEqual
(
'
video/hevc
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_MPEG4
).
assertEqual
(
'
video/mp4v-es
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_VP8
).
assertEqual
(
'
video/x-vnd.on2.vp8
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_VP9
).
assertEqual
(
'
video/x-vnd.on2.vp9
'
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_H263Profile_0100
* @tc.name : 004.H263Profile
* @tc.desc : Test Enumerate H263Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_H263Profile_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
H263Profile
.
H263_PROFILE_BACKWARD_COMPATIBLE
).
assertEqual
(
0
);
expect
(
media
.
H263Profile
.
H263_PROFILE_BASELINE
).
assertEqual
(
1
);
expect
(
media
.
H263Profile
.
H263_PROFILE_H320_CODING
).
assertEqual
(
2
);
expect
(
media
.
H263Profile
.
H263_PROFILE_HIGH_COMPRESSION
).
assertEqual
(
3
);
expect
(
media
.
H263Profile
.
H263_PROFILE_HIGH_LATENCY
).
assertEqual
(
4
);
expect
(
media
.
H263Profile
.
H263_PROFILE_ISW_V2
).
assertEqual
(
5
);
expect
(
media
.
H263Profile
.
H263_PROFILE_ISW_V3
).
assertEqual
(
6
);
expect
(
media
.
H263Profile
.
H263_PROFILE_INTERLACE
).
assertEqual
(
7
);
expect
(
media
.
H263Profile
.
H263_PROFILE_INTERNET
).
assertEqual
(
8
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG2Profile_0100
* @tc.name : 006.MPEG2Profile
* @tc.desc : Test Enumerate MPEG2Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG2Profile_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
MPEG2Profile
.
MPEG2_PROFILE_422
).
assertEqual
(
0
);
expect
(
media
.
MPEG2Profile
.
MPEG2_PROFILE_HIGH
).
assertEqual
(
1
);
expect
(
media
.
MPEG2Profile
.
MPEG2_PROFILE_MAIN
).
assertEqual
(
2
);
expect
(
media
.
MPEG2Profile
.
MPEG2_PROFILE_SNR
).
assertEqual
(
3
);
expect
(
media
.
MPEG2Profile
.
MPEG2_PROFILE_SIMPLE
).
assertEqual
(
4
);
expect
(
media
.
MPEG2Profile
.
MPEG2_PROFILE_SPATIAL
).
assertEqual
(
5
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG4Profile_0100
* @tc.name : 007.MPEG4Profile
* @tc.desc : Test Enumerate MPEG4Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG4Profile_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_ADVANCED_CODING
).
assertEqual
(
0
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_ADVANCED_CORE
).
assertEqual
(
1
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_ADVANCED_REAL_TIME
).
assertEqual
(
2
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_ADVANCED_SCALABLE
).
assertEqual
(
3
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_ADVANCED_SIMPLE
).
assertEqual
(
4
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_BASIC_ANIMATED
).
assertEqual
(
5
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_CORE
).
assertEqual
(
6
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_CORE_SCALABLE
).
assertEqual
(
7
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_HYBRID
).
assertEqual
(
8
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_MAIN
).
assertEqual
(
9
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_NBIT
).
assertEqual
(
10
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_SCALABLE_TEXXTURE
).
assertEqual
(
11
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_SIMPLE
).
assertEqual
(
12
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_SIMPLE_FBA
).
assertEqual
(
13
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_SIMPLE_FACE
).
assertEqual
(
14
);
expect
(
media
.
MPEG4Profile
.
MPEG4_PROFILE_SIMPLE_SCALABLE
).
assertEqual
(
15
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_VideoPixelFormat_0100
* @tc.name : 009.VideoPixelFormat
* @tc.desc : Test Enumerate VideoPixelFormat
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_VideoPixelFormat_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
VideoPixelFormat
.
YUVI420
).
assertEqual
(
1
);
expect
(
media
.
VideoPixelFormat
.
NV12
).
assertEqual
(
2
);
expect
(
media
.
VideoPixelFormat
.
NV21
).
assertEqual
(
3
);
expect
(
media
.
VideoPixelFormat
.
SURFACE_FORMAT
).
assertEqual
(
4
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_VP8Profile_0100
* @tc.name : 010.VP8Profile
* @tc.desc : Test Enumerate VP8Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_ENUM_VP8Profile_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
VP8Profile
.
VP8_PROFILE_MAIN
).
assertEqual
(
0
);
done
();
})
})
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
浏览文件 @
1713feb9
...
...
@@ -31,15 +31,24 @@ describe('VideoDecoderFuncCallbackTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
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
,
...
...
@@ -122,13 +131,16 @@ describe('VideoDecoderFuncCallbackTest', function () {
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
=
{
...
...
@@ -140,6 +152,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
error
(
'
in case toDisplayPage
'
+
e
);
}
}
function
readFile
(
path
){
console
.
info
(
'
in case : read file start execution
'
);
try
{
...
...
@@ -343,51 +356,19 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_H264_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
60FPS_32
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
1920
,
'
height
'
:
1080
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
30.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_MEDIA_VIDEO_DECODER_H263_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_MEDIA_VIDEO_DECODER_H263_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H263_FRAME_SIZE
;
let
srcPath
=
BASIC_PATH
+
'
h263_1408_1152.es
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/h263
'
,
'
width
'
:
1408
,
'
height
'
:
1152
,
'
width
'
:
320
,
'
height
'
:
240
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
60.00
,
'
max_input_size
'
:
150000
,
}
media
.
createVideoDecoderByMime
(
'
video/
h263
'
,
(
err
,
processor
)
=>
{
media
.
createVideoDecoderByMime
(
'
video/
avc
'
,
(
err
,
processor
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
'
in case : createVideoDecoderByMime success
'
);
videoDecodeProcessor
=
processor
;
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
浏览文件 @
1713feb9
...
...
@@ -32,15 +32,24 @@ describe('VideoDecoderFuncPromiseTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
let
ES_FRAME_SIZE
=
[];
const
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
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
,
...
...
@@ -341,50 +350,19 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_H264_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
60FPS_32
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
1920
,
'
height
'
:
1080
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
30.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_MEDIA_VIDEO_DECODER_H263_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_MEDIA_VIDEO_DECODER_H263_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H263_FRAME_SIZE
;
let
srcPath
=
BASIC_PATH
+
'
h263_1408_1152.es
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/h263
'
,
'
width
'
:
1408
,
'
height
'
:
1152
,
'
width
'
:
320
,
'
height
'
:
240
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
60.00
,
'
max_input_size
'
:
150000
,
}
await
toCreateVideoDecoderByMime
(
'
video/
h263
'
,
done
);
await
toCreateVideoDecoderByMime
(
'
video/
avc
'
,
done
);
await
toGetVideoDecoderCaps
();
await
toConfigure
(
mediaDescription
,
srcPath
);
await
toSetOutputSurface
(
true
);
...
...
@@ -466,16 +444,16 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
60FPS_32
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
3
0.00
,
'
frame_rate
'
:
6
0.00
,
'
max_input_size
'
:
150000
,
}
let
array
=
new
Array
();
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
浏览文件 @
1713feb9
...
...
@@ -46,26 +46,34 @@ describe('VideoDecoderReliCallbackTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
3
0
,
'
frame_rate
'
:
6
0
,
'
max_input_size
'
:
150000
,
}
const
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_30FPS_1080
;
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
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
浏览文件 @
1713feb9
...
...
@@ -46,25 +46,34 @@ describe('VideoDecoderReliPromiseTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
4
,
'
frame_rate
'
:
3
0
,
'
frame_rate
'
:
6
0
,
'
max_input_size
'
:
150000
,
}
const
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_30FPS_1080
;
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
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
浏览文件 @
1713feb9
...
...
@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
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
,
...
...
@@ -65,13 +65,6 @@ describe('VideoDecoderFuncCallbackTest', function () {
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
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
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
,
...
...
@@ -336,50 +329,19 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H264_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
24
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
1920
,
'
height
'
:
1080
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
30.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_MEDIA_VIDEO_SOFTWARE_DECODER_H263_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_MEDIA_VIDEO_SOFTWARE_DECODER_H263_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H263_FRAME_SIZE
;
let
srcPath
=
BASIC_PATH
+
'
h263_1408_1152.es
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/h263
'
,
'
width
'
:
1408
,
'
height
'
:
1152
,
'
width
'
:
320
,
'
height
'
:
240
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
60.00
,
'
max_input_size
'
:
150000
,
}
media
.
createVideoDecoderByName
(
'
avdec_h26
3
'
,
(
err
,
processor
)
=>
{
media
.
createVideoDecoderByName
(
'
avdec_h26
4
'
,
(
err
,
processor
)
=>
{
expect
(
err
).
assertUndefined
();
console
.
info
(
'
in case : createVideoDecoderByName success
'
);
videoDecodeProcessor
=
processor
;
...
...
@@ -461,14 +423,14 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_01_0600
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
24
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
60.00
,
'
max_input_size
'
:
150000
,
...
...
@@ -523,16 +485,16 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_01_0700
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
24
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
3
0.00
,
'
frame_rate
'
:
6
0.00
,
'
max_input_size
'
:
150000
,
}
eventEmitter
.
on
(
'
stop_for_callback_01_0700
'
,
(
done
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
浏览文件 @
1713feb9
...
...
@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
let
surfaceID
=
''
;
const
events
=
require
(
'
events
'
);
const
eventEmitter
=
new
events
.
EventEmitter
();
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
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
,
...
...
@@ -66,13 +66,6 @@ describe('VideoDecoderFuncPromiseTest', function () {
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
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
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
,
...
...
@@ -338,49 +331,19 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H264_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
24
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
1920
,
'
height
'
:
1080
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
30.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_MEDIA_VIDEO_SOFTWARE_DECODER_H263_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_MEDIA_VIDEO_SOFTWARE_DECODER_H263_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H263_FRAME_SIZE
;
let
srcPath
=
BASIC_PATH
+
'
h263_1408_1152.es
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/h263
'
,
'
width
'
:
1408
,
'
height
'
:
1152
,
'
width
'
:
320
,
'
height
'
:
240
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
60.00
,
'
max_input_size
'
:
150000
,
}
await
toCreateVideoDecoderByName
(
'
avdec_h26
3
'
,
done
);
await
toCreateVideoDecoderByName
(
'
avdec_h26
4
'
,
done
);
await
toConfigure
(
mediaDescription
,
srcPath
);
await
toSetOutputSurface
(
true
);
setCallback
(
...
...
@@ -459,16 +422,16 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_01_0600
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
24
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
3
0.00
,
'
frame_rate
'
:
6
0.00
,
'
max_input_size
'
:
150000
,
}
await
toCreateVideoDecoderByName
(
'
avdec_h264
'
,
done
);
...
...
@@ -519,14 +482,14 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_01_0700
'
,
0
,
async
function
(
done
)
{
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
30FPS_108
0
;
ES_FRAME_SIZE
=
H264_FRAME_SIZE_
24
0
;
isCodecData
=
true
;
let
srcPath
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
let
srcPath
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
60.00
,
'
max_input_size
'
:
150000
,
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
浏览文件 @
1713feb9
...
...
@@ -46,26 +46,34 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
3
0
,
'
frame_rate
'
:
6
0
,
'
max_input_size
'
:
150000
,
}
const
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_30FPS_1080
;
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
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
浏览文件 @
1713feb9
...
...
@@ -46,25 +46,35 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
let
inputEosFlag
=
false
;
let
workdoneAtEOS
=
false
;
let
surfaceID
=
''
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
1920_1080_30fps_3
s.h264
'
;
const
BASIC_PATH
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video
.video
decoder/shared/
'
;
const
SRCPATH
=
BASIC_PATH
+
'
out_
320_240_10
s.h264
'
;
let
mediaDescription
=
{
'
track_type
'
:
1
,
'
codec_mime
'
:
'
video/avc
'
,
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
3
0
,
'
frame_rate
'
:
6
0
,
'
max_input_size
'
:
150000
,
}
const
H264_FRAME_SIZE_30FPS_1080
=
[
3491
,
115184
,
9423
,
1046
,
19038
,
2059
,
2306
,
28773
,
4815
,
1670
,
31464
,
6322
,
2969
,
3518
,
38279
,
8419
,
4463
,
4554
,
35457
,
7848
,
3870
,
4235
,
32523
,
7606
,
3992
,
4132
,
58148
,
10144
,
7625
,
6051
,
38774
,
8929
,
5309
,
5784
,
45250
,
8696
,
5511
,
5224
,
36732
,
8221
,
4885
,
5103
,
40075
,
9799
,
5259
,
5373
,
39394
,
10406
,
5016
,
5572
,
60935
,
13292
,
6469
,
7040
,
45344
,
12370
,
5825
,
6712
,
47052
,
12502
,
6800
,
7453
,
52653
,
14088
,
7257
,
8931
,
46638
,
13277
,
7612
,
8663
,
44022
,
13672
,
7763
,
7784
,
51638
,
14118
,
8112
,
6458
,
41013
,
12910
,
6759
,
6974
,
38409
,
12813
,
6785
,
6934
,
33390
,
12910
,
6825
,
6954
,
21092
,
13599
,
6968
,
7937
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_30FPS_1080
;
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
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
...
...
multimedia/media/media_js_standard/videoEncoder/Test.json
浏览文件 @
1713feb9
...
...
@@ -17,13 +17,12 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results"
,
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results/"
,
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder"
,
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/*"
,
"setenforce 0"
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/*"
],
"teardown-command"
:[
"setenforce 1"
]
},
{
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
浏览文件 @
1713feb9
...
...
@@ -272,9 +272,9 @@ describe('videoEncoderSoftwareMultiInstances', function () {
console
.
info
(
"
case test multiple encoder instances
"
);
let
savepath
=
BASIC_PATH
+
'
0100.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
浏览文件 @
1713feb9
...
...
@@ -268,10 +268,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
mime
=
'
video/mp4v-es
'
;
let
mediaDescription
=
{
"
codec_mime
"
:
'
video/mp4v-es
'
,
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0
,
'
frame_rate
'
:
3
0
,
}
media
.
getMediaCapability
((
err
,
mediaCaps
)
=>
{
expect
(
err
).
assertUndefined
();
...
...
@@ -329,10 +329,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
decPath
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0100.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0.00
,
'
frame_rate
'
:
3
0.00
,
}
finalFrameId
=
50
;
media
.
createVideoEncoderByName
(
name
,
(
err
,
processor
)
=>
{
...
...
@@ -365,10 +365,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
decPath
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0200.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0.00
,
'
frame_rate
'
:
3
0.00
,
}
reStart
=
true
;
media
.
createVideoEncoderByName
(
name
,
(
err
,
processor
)
=>
{
...
...
@@ -401,10 +401,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
decPath
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0300.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0.00
,
'
frame_rate
'
:
3
0.00
,
}
finalFrameId
=
50
;
reStart
=
true
;
...
...
@@ -438,10 +438,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
decPath
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0400.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0.00
,
'
frame_rate
'
:
3
0.00
,
}
finalFrameId
=
50
;
media
.
createVideoEncoderByName
(
name
,
(
err
,
processor
)
=>
{
...
...
@@ -474,10 +474,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
decPath
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0500.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0.00
,
'
frame_rate
'
:
3
0.00
,
}
media
.
createVideoEncoderByName
(
name
,
(
err
,
processor
)
=>
{
expect
(
err
).
assertUndefined
();
...
...
@@ -509,15 +509,15 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let
decPath
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0600.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0.00
,
'
frame_rate
'
:
3
0.00
,
}
let
decPath2
=
BASIC_PATH
+
'
SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0600_2.es
'
;
let
mediaDescription2
=
{
'
width
'
:
19
20
,
'
height
'
:
108
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
30.00
,
}
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
浏览文件 @
1713feb9
...
...
@@ -331,9 +331,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
case test stop after last frame
"
);
let
savepath
=
BASIC_PATH
+
'
0000.es
'
;
let
name
=
'
avenc_mpeg4
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
codec_mime
"
:
'
video/mp4v-es
'
,
"
width
"
:
width
,
...
...
@@ -396,9 +396,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
case test stop at runnning state and reset
"
);
let
savepath
=
BASIC_PATH
+
'
0100.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -435,9 +435,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
test stop at end of stream and restart
"
);
let
savepath
=
BASIC_PATH
+
'
0200.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -475,9 +475,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
test stop at runnning state and restart
"
);
let
savepath
=
BASIC_PATH
+
'
0300.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -516,16 +516,16 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
case test flush at running state
"
);
let
savepath
=
BASIC_PATH
+
'
0400.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
"
pixel_format
"
:
3
,
"
frame_rate
"
:
framerate
,
}
frameTotal
=
10
00
;
frameTotal
=
5
00
;
await
toCreateByMime
(
mime
,
done
);
await
toGetVideoEncoderCaps
(
width
,
height
);
toCreateStream
();
...
...
@@ -536,7 +536,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
await
toPrepare
();
toStartStream
();
await
toStart
();
await
sleep
(
10
00
);
await
sleep
(
5
00
);
await
toFlush
();
})
...
...
@@ -552,9 +552,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
case test flush at end of stream
"
);
let
savepath
=
BASIC_PATH
+
'
0500.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -574,7 +574,6 @@ describe('videoSoftwareEncoderFuncPromise', function () {
toStartStream
();
await
toStart
();
await
sleep
(
5000
);
toStopStream
();
resetParam
();
toSetStreamParam
(
width
,
height
,
framerate
,
frameTotal
);
toStartStream
();
...
...
@@ -592,9 +591,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
case test reconfigure
"
);
let
savepath
=
BASIC_PATH
+
'
0600.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -614,10 +613,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
toStartStream
();
await
toStart
();
await
sleep
(
5000
);
toStopStream
();
resetParam
();
width
=
7
20
;
height
=
48
0
;
width
=
3
20
;
height
=
24
0
;
framerate
=
30
;
let
mediaDescription2
=
{
"
width
"
:
width
,
...
...
@@ -647,9 +645,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console
.
info
(
"
case test recreate videoencoder
"
);
let
savepath
=
BASIC_PATH
+
'
0700.es
'
;
let
mime
=
'
video/mp4v-es
'
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -669,11 +667,10 @@ describe('videoSoftwareEncoderFuncPromise', function () {
toStartStream
();
await
toStart
();
await
sleep
(
5000
);
toStopStream
();
await
toRelease
();
resetParam
();
width
=
7
20
;
height
=
48
0
;
width
=
3
20
;
height
=
24
0
;
framerate
=
30
;
let
mediaDescription2
=
{
"
width
"
:
width
,
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
浏览文件 @
1713feb9
...
...
@@ -53,10 +53,10 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
const
ROOT
=
'
/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results/
'
;
const
BASIC_PATH
=
ROOT
+
'
video_reliability_callback_
'
;
let
mediaDescription
=
{
'
width
'
:
7
20
,
'
height
'
:
48
0
,
'
width
'
:
3
20
,
'
height
'
:
24
0
,
'
pixel_format
'
:
3
,
'
frame_rate
'
:
6
0
,
'
frame_rate
'
:
3
0
,
}
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -1447,14 +1447,14 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TO
OP
LOOP_CALLBACK_0100
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TO
TAL
LOOP_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_MEDIA_VIDEO_SOFTWARE_ENCODER_API_
CREATE-RELEASE
_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_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
();
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
浏览文件 @
1713feb9
...
...
@@ -49,9 +49,9 @@ describe('videoEncoderReliabilityPromise', function () {
const
WAITFORALLOUTS
=
14
;
const
JUDGE_EOS
=
15
;
const
WAITTIME
=
3000
;
let
width
=
7
20
;
let
height
=
48
0
;
let
framerate
=
6
0
;
let
width
=
3
20
;
let
height
=
24
0
;
let
framerate
=
3
0
;
let
mediaDescription
=
{
"
width
"
:
width
,
"
height
"
:
height
,
...
...
@@ -75,9 +75,9 @@ describe('videoEncoderReliabilityPromise', function () {
sawOutputEOS
=
false
;
needGetMediaDes
=
false
;
workdoneAtEOS
=
false
;
width
=
7
20
;
height
=
48
0
;
framerate
=
6
0
;
width
=
3
20
;
height
=
24
0
;
framerate
=
3
0
;
frameTotal
=
100
;
})
...
...
@@ -459,7 +459,7 @@ describe('videoEncoderReliabilityPromise', function () {
*/
it
(
'
SUB_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
,
STOPSTREAM
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
GETSURFACE
,
SETSTREAMPARAM
,
PREPARE
,
CONFIGURE
,
ERROR
,
END
);
createVideoEncoder
(
savepath
,
mySteps
,
done
);
})
...
...
@@ -590,7 +590,7 @@ describe('videoEncoderReliabilityPromise', function () {
*/
it
(
'
SUB_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
,
STOPSTREAM
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
GETSURFACE
,
SETSTREAMPARAM
,
PREPARE
,
END
);
createVideoEncoder
(
savepath
,
mySteps
,
done
);
})
...
...
@@ -604,7 +604,7 @@ describe('videoEncoderReliabilityPromise', function () {
*/
it
(
'
SUB_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
,
STOPSTREAM
,
END
);
let
mySteps
=
new
Array
(
CONFIGURE
,
GETSURFACE
,
SETSTREAMPARAM
,
PREPARE
,
PREPARE
,
ERROR
,
END
);
createVideoEncoder
(
savepath
,
mySteps
,
done
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录