Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4a1ffb1c
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看板
未验证
提交
4a1ffb1c
编写于
6月 26, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 26, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9069 player_framework相关xts改成avcodec
Merge pull request !9069 from yj/master
上级
5a44a48c
48de65e8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
27 deletion
+14
-27
multimedia/media/media_cpp_standard/BUILD.gn
multimedia/media/media_cpp_standard/BUILD.gn
+2
-6
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
...pp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
+12
-6
multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp
...edia_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp
+0
-15
未找到文件。
multimedia/media/media_cpp_standard/BUILD.gn
浏览文件 @
4a1ffb1c
...
...
@@ -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,6 @@ ohos_moduletest_suite("ActsAvcodecNdkTest") {
]
deps = [
"$MEDIA_ROOT_DIR/interfaces/inner_api/native:media_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 +77,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/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
浏览文件 @
4a1ffb1c
...
...
@@ -45,7 +45,7 @@ const string MIME_TYPE_MPEG4 = "video/mp4v-es";
constexpr
uint32_t
DEFAULT_WIDTH
=
320
;
constexpr
uint32_t
DEFAULT_HEIGHT
=
240
;
constexpr
uint32_t
DEFAULT_PIXELFORMAT
=
2
;
constexpr
uint32_t
DEFAULT_FRAMERATE
=
60
;
constexpr
double
DEFAULT_FRAMERATE
=
60
;
const
char
*
READPATH
=
"/data/media/out_320_240_10s.h264"
;
bool
CheckDecDesc
(
map
<
string
,
int
>
InDesc
,
OH_AVFormat
*
OutDesc
)
...
...
@@ -66,6 +66,12 @@ bool CheckDecDesc(map<string, int> InDesc, OH_AVFormat* OutDesc)
}
out
=
0
;
}
double
dout
;
bool
res
=
OH_AVFormat_GetDoubleValue
(
OutDesc
,
OH_MD_KEY_FRAME_RATE
,
&
dout
);
if
(
!
res
||
abs
(
dout
-
DEFAULT_FRAMERATE
)
>
1e-6
)
{
cout
<<
"OH_AVFormat_GetDoubleValue error. key: "
<<
OH_MD_KEY_FRAME_RATE
<<
endl
;
}
return
true
;
}
...
...
@@ -89,7 +95,7 @@ struct OH_AVFormat* createFormat()
OH_AVFormat_SetIntValue
(
DefaultFormat
,
OH_MD_KEY_WIDTH
,
DEFAULT_WIDTH
);
OH_AVFormat_SetIntValue
(
DefaultFormat
,
OH_MD_KEY_HEIGHT
,
DEFAULT_HEIGHT
);
OH_AVFormat_SetIntValue
(
DefaultFormat
,
OH_MD_KEY_PIXEL_FORMAT
,
DEFAULT_PIXELFORMAT
);
OH_AVFormat_Set
Int
Value
(
DefaultFormat
,
OH_MD_KEY_FRAME_RATE
,
DEFAULT_FRAMERATE
);
OH_AVFormat_Set
Double
Value
(
DefaultFormat
,
OH_MD_KEY_FRAME_RATE
,
DEFAULT_FRAMERATE
);
OH_AVFormat_SetStringValue
(
DefaultFormat
,
OH_MD_KEY_CODEC_MIME
,
OH_AVCODEC_MIMETYPE_VIDEO_AVC
);
return
DefaultFormat
;
}
...
...
@@ -118,6 +124,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
ASSERT_NE
(
nullptr
,
videoDec
);
struct
OH_AVCodec
*
videoEnc
=
vDecEncSample
->
CreateVideoEncoderByMime
(
MIME_TYPE_MPEG4
);
videoEnc
=
vDecEncSample
->
CreateVideoEncoderByMime
(
MIME_TYPE_AVC
);
ASSERT_NE
(
nullptr
,
videoEnc
);
vDecEncSample
->
SetReadPath
(
READPATH
);
vDecEncSample
->
SetSavePath
(
"/data/media/video_001.h264"
);
...
...
@@ -128,10 +135,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
{
OH_MD_KEY_WIDTH
,
DEFAULT_WIDTH
},
{
OH_MD_KEY_HEIGHT
,
DEFAULT_HEIGHT
},
{
OH_MD_KEY_PIXEL_FORMAT
,
DEFAULT_PIXELFORMAT
},
{
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_SetDoubleValue
(
VideoFormat
,
OH_MD_KEY_FRAME_RATE
,
DEFAULT_FRAMERATE
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
OH_AVFormat
*
OutDescDec
=
OH_VideoDecoder_GetOutputDescription
(
videoDec
);
...
...
@@ -141,7 +148,6 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
OH_AVFormat
*
OutDescEnc
=
OH_VideoEncoder_GetOutputDescription
(
videoEnc
);
ASSERT_NE
(
nullptr
,
OutDescEnc
);
ASSERT_EQ
(
true
,
CheckDecDesc
(
VideoParam
,
OutDescEnc
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
GetSurface
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetOutputSurface
());
...
...
@@ -191,9 +197,9 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_020
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
());
...
...
multimedia/media/media_cpp_standard/videoDecEncNdk/src/VDecEncNdkSample.cpp
浏览文件 @
4a1ffb1c
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录