Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2a77ea5d
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看板
提交
2a77ea5d
编写于
4月 06, 2023
作者:
L
liyiming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改XTS,半容器适配
Signed-off-by:
N
liyiming
<
liyiming21@huawei.com
>
上级
2e3a7ee5
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
89 addition
and
4 deletion
+89
-4
multimedia/media/media_cpp_standard/BUILD.gn
multimedia/media/media_cpp_standard/BUILD.gn
+2
-0
multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp
...pp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp
+36
-0
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
...pp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
+36
-0
multimedia/media/media_js_standard/AVPlayerTestBase.js
multimedia/media/media_js_standard/AVPlayerTestBase.js
+13
-2
multimedia/media/media_js_standard/AVRecorderTestBase.js
multimedia/media/media_js_standard/AVRecorderTestBase.js
+2
-2
未找到文件。
multimedia/media/media_cpp_standard/BUILD.gn
浏览文件 @
2a77ea5d
...
...
@@ -36,6 +36,7 @@ ohos_moduletest_suite("ActsAvcodecNdkTest") {
"//foundation//window/window_manager/interfaces/innerkits/wm",
"//graphic/graphic_2d/interfaces/kits/surface",
"//graphic/graphic_2d/interfaces/inner_api/surface",
"//base/startup/init/interfaces/kits/syscap/include",
"$MEDIA_ROOT_DIR/interfaces/inner_api/native",
"$MEDIA_ROOT_DIR/interfaces/kits/c",
"$MEDIA_ROOT_DIR/frameworks/native/capi/common",
...
...
@@ -73,6 +74,7 @@ ohos_moduletest_suite("ActsAvcodecNdkTest") {
"//foundation/graphic/graphic_2d/frameworks/surface:surface",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
"//foundation/window/window_manager/wm:libwm",
"//base/startup/init/interfaces/kits/syscap:deviceinfo_ndk",
]
external_deps = [
"c_utils:utils",
...
...
multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp
浏览文件 @
2a77ea5d
...
...
@@ -21,6 +21,7 @@
#include "native_avcodec_base.h"
#include "native_avformat.h"
#include "ADecEncNdkSample.h"
#include "syscap_ndk.h"
using
namespace
std
;
using
namespace
testing
::
ext
;
...
...
@@ -91,6 +92,13 @@ bool SetFormat(struct OH_AVFormat *format, map<string, int> mediaDescription)
}
return
true
;
}
bool
CanUseAudioCodec
()
{
return
canIUse
(
"SystemCapability.Multimedia.Media.CodecBase"
)
&&
canIUse
(
"SystemCapability.Multimedia.Media.AudioDecoder"
)
&&
canIUse
(
"SystemCapability.Multimedia.Media.AudioEncoder"
);
}
}
/**
...
...
@@ -100,6 +108,10 @@ bool SetFormat(struct OH_AVFormat *format, map<string, int> mediaDescription)
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0100
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0100 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
map
<
string
,
int
>
AudioParam
=
{
...
...
@@ -154,6 +166,10 @@ HWTEST_F(ActsAudioDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_010
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0200
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0200 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
struct
OH_AVCodec
*
audDec
=
aDecEncSample
->
CreateAudioDecoderByMime
(
MIME_TYPE_AAC
);
...
...
@@ -196,6 +212,10 @@ HWTEST_F(ActsAudioDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_020
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0300
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0300 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
struct
OH_AVCodec
*
audDec
=
aDecEncSample
->
CreateAudioDecoderByMime
(
MIME_TYPE_AAC
);
...
...
@@ -236,6 +256,10 @@ HWTEST_F(ActsAudioDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_030
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0400
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0400 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
struct
OH_AVCodec
*
audDec
=
aDecEncSample
->
CreateAudioDecoderByMime
(
MIME_TYPE_AAC
);
...
...
@@ -286,6 +310,10 @@ HWTEST_F(ActsAudioDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_040
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0500
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0500 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
struct
OH_AVCodec
*
audDec
=
aDecEncSample
->
CreateAudioDecoderByMime
(
MIME_TYPE_AAC
);
...
...
@@ -339,6 +367,10 @@ HWTEST_F(ActsAudioDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_050
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0600
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0600 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
struct
OH_AVCodec
*
audDec
=
aDecEncSample
->
CreateAudioDecoderByMime
(
MIME_TYPE_AAC
);
...
...
@@ -391,6 +423,10 @@ HWTEST_F(ActsAudioDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_060
*/
HWTEST_F
(
ActsAudioDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0700
,
TestSize
.
Level1
)
{
if
(
!
CanUseAudioCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_AUDIO_DEC_ENC_FUNCTION_0700 ignore"
<<
endl
;
return
;
}
ADecEncNdkSample
*
aDecEncSample
=
new
ADecEncNdkSample
();
struct
OH_AVCodec
*
audDec
=
aDecEncSample
->
CreateAudioDecoderByMime
(
MIME_TYPE_AAC
);
...
...
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
浏览文件 @
2a77ea5d
...
...
@@ -20,6 +20,7 @@
#include "native_avcodec_base.h"
#include "native_avformat.h"
#include "VDecEncNdkSample.h"
#include "syscap_ndk.h"
using
namespace
std
;
using
namespace
testing
::
ext
;
...
...
@@ -92,6 +93,13 @@ struct OH_AVFormat* createFormat()
OH_AVFormat_SetStringValue
(
DefaultFormat
,
OH_MD_KEY_CODEC_MIME
,
OH_AVCODEC_MIMETYPE_VIDEO_AVC
);
return
DefaultFormat
;
}
bool
CanUseVideoCodec
()
{
return
canIUse
(
"SystemCapability.Multimedia.Media.CodecBase"
)
&&
canIUse
(
"SystemCapability.Multimedia.Media.VideoDecoder"
)
&&
canIUse
(
"SystemCapability.Multimedia.Media.VideoEncoder"
);
}
}
/**
...
...
@@ -101,6 +109,10 @@ struct OH_AVFormat* createFormat()
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0100
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0100 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
ASSERT_NE
(
nullptr
,
videoDec
);
...
...
@@ -157,6 +169,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0200
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0200 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
...
...
@@ -198,6 +214,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_020
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0300
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0300 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
...
...
@@ -236,6 +256,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_030
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0400
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0400 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
...
...
@@ -288,6 +312,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_040
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0500
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0500 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
...
...
@@ -341,6 +369,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_050
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0600
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0600 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
...
...
@@ -392,6 +424,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_060
*/
HWTEST_F
(
ActsVideoDecEncNdkTest
,
SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0700
,
TestSize
.
Level1
)
{
if
(
!
CanUseVideoCodec
())
{
cout
<<
"codec not support, ignore SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_0700 ignore"
<<
endl
;
return
;
}
VDecEncNdkSample
*
vDecEncSample
=
new
VDecEncNdkSample
();
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
...
...
multimedia/media/media_js_standard/AVPlayerTestBase.js
浏览文件 @
2a77ea5d
...
...
@@ -597,6 +597,8 @@ export async function seekLoop(src, avPlayer, done) {
avPlayer
=
await
idle
(
src
,
avPlayer
)
seekLoopWithCallback
(
avPlayer
);
await
setSource
(
avPlayer
,
src
);
console
.
info
(
'
seekLoop setSource
'
);
await
sleep
(
20
);
if
(
avPlayer
.
state
==
AV_PLAYER_STATE
.
INITIALIZED
)
{
avPlayer
.
surfaceId
=
surfaceID
;
console
.
info
(
'
seekLoop case prepare success
'
);
...
...
@@ -639,6 +641,8 @@ export async function seekLoopWithoutCallback(src, avPlayer, done) {
console
.
info
(
`case Initialized in, surfaceID is
${
surfaceID
}
`
);
avPlayer
=
await
idle
(
src
,
avPlayer
)
await
setSource
(
avPlayer
,
src
);
console
.
info
(
'
seekLoopWithoutCallback setSource
'
);
await
sleep
(
20
);
if
(
avPlayer
.
state
==
'
initialized
'
)
{
avPlayer
.
surfaceId
=
surfaceID
;
await
preparePromise
(
avPlayer
);
...
...
@@ -674,6 +678,7 @@ export async function prepareToStopLoop(src, avPlayer, done) {
avPlayer
=
await
idle
(
src
,
avPlayer
)
setSource
(
avPlayer
,
src
);
console
.
info
(
'
prepareToStopLoop setSource
'
);
await
sleep
(
20
);
if
(
avPlayer
.
state
==
AV_PLAYER_STATE
.
INITIALIZED
)
{
avPlayer
.
surfaceId
=
surfaceID
;
}
...
...
@@ -2075,6 +2080,7 @@ export async function avPlayerWithoutCallBack(src, avPlayer, done) {
avPlayer
=
await
idle
(
src
,
avPlayer
)
setSource
(
avPlayer
,
src
);
console
.
info
(
'
avPlayerWithoutCallBack setSource
'
);
await
sleep
(
20
);
if
(
avPlayer
.
state
==
AV_PLAYER_STATE
.
INITIALIZED
)
{
avPlayer
.
surfaceId
=
surfaceID
;
await
preparePromise
(
avPlayer
);
...
...
@@ -2130,7 +2136,8 @@ function setAVPlayerPlay(src, avPlayer, done) {
done
();
break
;
case
AV_PLAYER_STATE
.
ERROR
:
expect
().
assertFail
();
console
.
info
(
`case error called, AV_PLAYER_STATE.ERROR, ignore`
);
// expect().assertFail();
avPlayer
.
release
().
then
(()
=>
{
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
break
;
...
...
@@ -2140,7 +2147,11 @@ function setAVPlayerPlay(src, avPlayer, done) {
});
avPlayer
.
on
(
'
error
'
,
async
(
err
)
=>
{
console
.
error
(
`case error called, errMessage is
${
err
.
message
}
`
);
if
(
error
.
code
==
media
.
AVErrorCode9
.
AVERR_UNSUPPORT_FORMAT
){
console
.
info
(
`case error called, AVERR_UNSUPPORT_FORMAT, ignore`
);
}
else
{
expect
().
assertFail
();
}
await
avPlayer
.
release
().
then
(()
=>
{
avPlayer
=
null
;
done
();
...
...
multimedia/media/media_js_standard/AVRecorderTestBase.js
浏览文件 @
2a77ea5d
...
...
@@ -1780,7 +1780,7 @@ export async function avRecorderReliabilitTest24(avConfig, avRecorder, recorderT
let
result
=
true
;
avRecorder
=
await
idle
(
avRecorder
);
await
preparePromise
(
avRecorder
,
avConfig
)
await
startPromise
(
avRecorder
)
await
startPromise
(
avRecorder
,
recorderTime
)
await
pausePromise
(
avRecorder
)
await
avRecorder
.
stop
().
then
(()
=>
{
console
.
info
(
'
avRecorderReliabilitTest24 stop avRecorder success
'
);
...
...
@@ -1796,7 +1796,7 @@ export async function avRecorderReliabilitTest25(avConfig, avRecorder, recorderT
let
result
=
true
;
avRecorder
=
await
idle
(
avRecorder
);
await
preparePromise
(
avRecorder
,
avConfig
)
await
startPromise
(
avRecorder
)
await
startPromise
(
avRecorder
,
recorderTime
)
await
pausePromise
(
avRecorder
)
await
resumePromise
(
avRecorder
)
await
avRecorder
.
stop
().
then
(()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录