Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0795dc4a
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看板
提交
0795dc4a
编写于
2月 23, 2022
作者:
L
ling990
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
videoEncoder Signed-off-by: ling990 <liling96@huawei.com>
Signed-off-by:
N
ling990
<
liling96@huawei.com
>
上级
b9f292d2
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
354 addition
and
146 deletion
+354
-146
multimedia/media/media_js_standard/videoEncoder/src/main/js/test.zip
...media/media_js_standard/videoEncoder/src/main/js/test.zip
+3
-0
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
+31
-7
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
.../test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
+97
-2
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
...s/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
+223
-137
未找到文件。
multimedia/media/media_js_standard/videoEncoder/src/main/js/test.zip
0 → 100644
LFS
浏览文件 @
0795dc4a
文件已添加
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
浏览文件 @
0795dc4a
...
...
@@ -18,7 +18,7 @@ import mediademo from '@ohos.multimedia.mediademo'
import
Fileio
from
'
@ohos.fileio
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
describe
(
'
video
EncoderSoftware
FuncPromise
'
,
function
()
{
describe
(
'
video
SoftwareEncoder
FuncPromise
'
,
function
()
{
const
BASIC_PATH
=
'
/data/media/results/videoencode_func_promise_
'
;
let
videoEncodeProcessor
;
let
mediaTest
;
...
...
@@ -192,7 +192,7 @@ describe('videoEncoderSoftwareFuncPromise', function () {
},
failCallback
).
catch
(
failCatch
);
}
function
printVideoCaps
(
videoCaps
,
width
,
height
)
{
async
function
printVideoCaps
(
videoCaps
,
width
,
height
)
{
console
.
info
(
`print videoCaps:
codecInfo.name
${
videoCaps
.
codecInfo
.
name
}
codecInfo.type
${
videoCaps
.
codecInfo
.
type
}
...
...
@@ -212,11 +212,35 @@ describe('videoEncoderSoftwareFuncPromise', function () {
supportedQuality [
${
videoCaps
.
supportedQuality
.
min
}
,
${
videoCaps
.
supportedQuality
.
max
}
]
supportedComplexity [
${
videoCaps
.
supportedComplexity
.
min
}
,
${
videoCaps
.
supportedComplexity
.
max
}
]
`
);
console
.
info
(
"
videoCaps.getPreferredFrameRate.min:
"
+
videoCaps
.
getPreferredFrameRate
(
width
,
height
).
min
);
console
.
info
(
"
videoCaps.getPreferredFrameRate.max:
"
+
videoCaps
.
getPreferredFrameRate
(
width
,
height
).
max
);
console
.
info
(
"
videoCaps.getSupportedFrameRate.min:
"
+
videoCaps
.
getSupportedFrameRate
(
width
,
height
).
min
);
console
.
info
(
"
videoCaps.getSupportedFrameRate.max:
"
+
videoCaps
.
getSupportedFrameRate
(
width
,
height
).
max
);
console
.
info
(
"
videoCaps.isSizeSupported:
"
+
videoCaps
.
isSizeSupported
(
width
,
height
));
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
()
{
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js
浏览文件 @
0795dc4a
...
...
@@ -1432,7 +1432,8 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
})
})
/* *
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CREATE-RELEASE_CALLBACK_0100
* @tc.name : 001. create -> release for 50 times
* @tc.desc : Reliability Test
...
...
@@ -1440,7 +1441,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
* @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_
TOOPLOOP
_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
let
name
=
'
avenc_mpeg4
'
;
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
...
...
@@ -1474,5 +1475,99 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
})
eventEmitter
.
emit
(
'
create
'
,
name
);
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOOPLOOP_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
)
{
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
);
})
})
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js
浏览文件 @
0795dc4a
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录