Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0d416587
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看板
提交
0d416587
编写于
6月 25, 2023
作者:
Y
yj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
player_framework相关xts改成avcodec
Signed-off-by:
N
yj
<
yujie57@huawei.com
>
上级
41bf9425
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
16 addition
and
34 deletion
+16
-34
multimedia/media/media_cpp_standard/BUILD.gn
multimedia/media/media_cpp_standard/BUILD.gn
+3
-6
multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h
...ia_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h
+1
-1
multimedia/media/media_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp
...edia_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp
+1
-1
multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp
...pp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp
+1
-1
multimedia/media/media_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h
...ia_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h
+1
-1
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
...pp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
+8
-8
multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp
...edia_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp
+1
-16
未找到文件。
multimedia/media/media_cpp_standard/BUILD.gn
浏览文件 @
0d416587
...
...
@@ -14,7 +14,7 @@
import("//test/xts/tools/build/suite.gni")
module_output_path = "acts/ActsAvcodecNdkTest"
MEDIA_ROOT_DIR = "//foundation/multimedia/
player_framework
/"
MEDIA_ROOT_DIR = "//foundation/multimedia/
av_codec
/"
ohos_moduletest_suite("ActsAvcodecNdkTest") {
module_out_path = module_output_path
...
...
@@ -39,9 +39,6 @@ ohos_moduletest_suite("ActsAvcodecNdkTest") {
"../../../../../../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",
"$MEDIA_ROOT_DIR/interfaces/kits/c",
"$MEDIA_ROOT_DIR/interfaces/inner_api/native",
]
cflags = [
...
...
@@ -63,7 +60,7 @@ ohos_moduletest_suite("ActsAvcodecNdkTest") {
]
deps = [
"$MEDIA_ROOT_DIR/interfaces/inner_api/native:
media
_client",
"$MEDIA_ROOT_DIR/interfaces/inner_api/native:
av_codec
_client",
"$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_adec",
"$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_aenc",
"$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
...
...
@@ -81,6 +78,6 @@ ohos_moduletest_suite("ActsAvcodecNdkTest") {
"hiviewdfx_hilog_native:libhilog",
]
part_name = "
player_framework
"
part_name = "
av_codec
"
subsystem_name = "multimedia"
}
multimedia/media/media_cpp_standard/audioDecEncNdk/include/ADecEncNdkSample.h
浏览文件 @
0d416587
...
...
@@ -33,7 +33,7 @@
#include "ndktest_log.h"
namespace
OHOS
{
namespace
Media
{
namespace
Media
AVCodec
{
class
ADecEncSignal
{
public:
std
::
mutex
inMutexDec_
;
...
...
multimedia/media/media_cpp_standard/audioDecEncNdk/src/ADecEncNdkSample.cpp
浏览文件 @
0d416587
...
...
@@ -19,7 +19,7 @@
#include "native_avcodec_base.h"
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
OHOS
::
Media
AVCodec
;
using
namespace
std
;
namespace
{
...
...
multimedia/media/media_cpp_standard/audioDecEncNdk/src/ActsAudioDecEncNdkTest.cpp
浏览文件 @
0d416587
...
...
@@ -26,7 +26,7 @@
using
namespace
std
;
using
namespace
testing
::
ext
;
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
OHOS
::
Media
AVCodec
;
namespace
{
class
ActsAudioDecEncNdkTest
:
public
testing
::
Test
{
...
...
multimedia/media/media_cpp_standard/videoDecEncNdk/include/VDecEncNdkSample.h
浏览文件 @
0d416587
...
...
@@ -35,7 +35,7 @@
#include "native_avcodec_videoencoder.h"
namespace
OHOS
{
namespace
Media
{
namespace
Media
AVCodec
{
class
VDecEncSignal
{
public:
std
::
mutex
inMutexDec_
;
...
...
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
浏览文件 @
0d416587
...
...
@@ -25,7 +25,7 @@
using
namespace
std
;
using
namespace
testing
::
ext
;
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
OHOS
::
Media
AVCodec
;
namespace
{
class
ActsVideoDecEncNdkTest
:
public
testing
::
Test
{
...
...
@@ -131,7 +131,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
{
OH_MD_KEY_FRAME_RATE
,
DEFAULT_FRAMERATE
},
};
ASSERT_EQ
(
true
,
SetFormat
(
VideoFormat
,
VideoParam
));
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_TRACK_TYPE
,
MEDIA_TYPE_VID
);
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_TRACK_TYPE
,
OH_MediaType
::
MEDIA_TYPE_VID
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
OH_AVFormat
*
OutDescDec
=
OH_VideoDecoder_GetOutputDescription
(
videoDec
);
...
...
@@ -184,16 +184,16 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_020
OH_AVFormat
*
VideoFormat
=
createFormat
();
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
,
CBR
);
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
,
OH_VideoEncodeBitrateMode
::
CBR
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
GetSurface
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetOutputSurface
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
PrepareEnc
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
PrepareDec
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
StartEnc
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetParameterDec
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
StartDec
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetParameterEnc
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
StartDec
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetParameterDec
(
VideoFormat
));
while
(
!
vDecEncSample
->
GetEncEosState
())
{};
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ResetDec
());
...
...
@@ -228,7 +228,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_030
vDecEncSample
->
SetSavePath
(
"/data/media/video_003.h264"
);
OH_AVFormat
*
VideoFormat
=
createFormat
();
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_PROFILE
,
AVC_PROFILE_BASELINE
);
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_PROFILE
,
OH_AVCProfile
::
AVC_PROFILE_BASELINE
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
...
...
@@ -271,7 +271,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_040
vDecEncSample
->
SetSavePath
(
"/data/media/video_004.h264"
);
OH_AVFormat
*
VideoFormat
=
createFormat
();
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_PROFILE
,
AVC_PROFILE_HIGH
);
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_PROFILE
,
OH_AVCProfile
::
AVC_PROFILE_HIGH
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
...
...
@@ -327,7 +327,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_050
vDecEncSample
->
SetSavePath
(
"/data/media/video_005.h264"
);
OH_AVFormat
*
VideoFormat
=
createFormat
();
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_PROFILE
,
AVC_PROFILE_MAIN
);
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_PROFILE
,
OH_AVCProfile
::
AVC_PROFILE_MAIN
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
...
...
multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp
浏览文件 @
0d416587
...
...
@@ -23,7 +23,7 @@
#include "VDecEncNdkSample.h"
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
OHOS
::
Media
AVCodec
;
using
namespace
std
;
namespace
{
...
...
@@ -567,27 +567,12 @@ int32_t VDecEncNdkSample::SetParameterEnc(struct OH_AVFormat *format)
return
OH_VideoEncoder_SetParameter
(
venc_
,
format
);
}
struct
VEncObject
:
public
OH_AVCodec
{
explicit
VEncObject
(
const
std
::
shared_ptr
<
AVCodecVideoEncoder
>
&
encoder
)
:
OH_AVCodec
(
AVMagic
::
MEDIA_MAGIC_VIDEO_ENCODER
),
videoEncoder_
(
encoder
)
{}
~
VEncObject
()
=
default
;
const
std
::
shared_ptr
<
AVCodecVideoEncoder
>
videoEncoder_
;
};
int32_t
VDecEncNdkSample
::
GetSurface
()
{
return
OH_VideoEncoder_GetSurface
(
venc_
,
&
nativeWindow_
);
}
struct
VDecObject
:
public
OH_AVCodec
{
explicit
VDecObject
(
const
std
::
shared_ptr
<
AVCodecVideoDecoder
>
&
decoder
)
:
OH_AVCodec
(
AVMagic
::
MEDIA_MAGIC_VIDEO_DECODER
),
videoDecoder_
(
decoder
)
{}
~
VDecObject
()
=
default
;
const
std
::
shared_ptr
<
AVCodecVideoDecoder
>
videoDecoder_
;
};
int32_t
VDecEncNdkSample
::
SetOutputSurface
()
{
return
OH_VideoDecoder_SetSurface
(
vdec_
,
nativeWindow_
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录