Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
794310f3
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看板
提交
794310f3
编写于
6月 25, 2023
作者:
Y
yj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
player_framework相关xts改成avcodec
Signed-off-by:
N
yj
<
yujie57@huawei.com
>
上级
0d416587
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
10 addition
and
6 deletion
+10
-6
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
...pp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
+10
-6
未找到文件。
multimedia/media/media_cpp_standard/videoDecEncNdk/src/ActsVideoDecEncNdkTest.cpp
浏览文件 @
794310f3
...
@@ -41,11 +41,10 @@ void ActsVideoDecEncNdkTest::TearDownTestCase() {}
...
@@ -41,11 +41,10 @@ void ActsVideoDecEncNdkTest::TearDownTestCase() {}
void
ActsVideoDecEncNdkTest
::
SetUp
()
{}
void
ActsVideoDecEncNdkTest
::
SetUp
()
{}
void
ActsVideoDecEncNdkTest
::
TearDown
()
{}
void
ActsVideoDecEncNdkTest
::
TearDown
()
{}
const
string
MIME_TYPE_AVC
=
"video/avc"
;
const
string
MIME_TYPE_AVC
=
"video/avc"
;
const
string
MIME_TYPE_MPEG4
=
"video/mp4v-es"
;
constexpr
uint32_t
DEFAULT_WIDTH
=
320
;
constexpr
uint32_t
DEFAULT_WIDTH
=
320
;
constexpr
uint32_t
DEFAULT_HEIGHT
=
240
;
constexpr
uint32_t
DEFAULT_HEIGHT
=
240
;
constexpr
uint32_t
DEFAULT_PIXELFORMAT
=
2
;
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"
;
const
char
*
READPATH
=
"/data/media/out_320_240_10s.h264"
;
bool
CheckDecDesc
(
map
<
string
,
int
>
InDesc
,
OH_AVFormat
*
OutDesc
)
bool
CheckDecDesc
(
map
<
string
,
int
>
InDesc
,
OH_AVFormat
*
OutDesc
)
...
@@ -66,6 +65,12 @@ bool CheckDecDesc(map<string, int> InDesc, OH_AVFormat* OutDesc)
...
@@ -66,6 +65,12 @@ bool CheckDecDesc(map<string, int> InDesc, OH_AVFormat* OutDesc)
}
}
out
=
0
;
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
;
return
true
;
}
}
...
@@ -89,7 +94,7 @@ struct OH_AVFormat* createFormat()
...
@@ -89,7 +94,7 @@ struct OH_AVFormat* createFormat()
OH_AVFormat_SetIntValue
(
DefaultFormat
,
OH_MD_KEY_WIDTH
,
DEFAULT_WIDTH
);
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_HEIGHT
,
DEFAULT_HEIGHT
);
OH_AVFormat_SetIntValue
(
DefaultFormat
,
OH_MD_KEY_PIXEL_FORMAT
,
DEFAULT_PIXELFORMAT
);
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
);
OH_AVFormat_SetStringValue
(
DefaultFormat
,
OH_MD_KEY_CODEC_MIME
,
OH_AVCODEC_MIMETYPE_VIDEO_AVC
);
return
DefaultFormat
;
return
DefaultFormat
;
}
}
...
@@ -117,7 +122,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
...
@@ -117,7 +122,7 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
struct
OH_AVCodec
*
videoDec
=
vDecEncSample
->
CreateVideoDecoderByMime
(
MIME_TYPE_AVC
);
ASSERT_NE
(
nullptr
,
videoDec
);
ASSERT_NE
(
nullptr
,
videoDec
);
struct
OH_AVCodec
*
videoEnc
=
vDecEncSample
->
CreateVideoEncoderByMime
(
MIME_TYPE_
MPEG4
);
struct
OH_AVCodec
*
videoEnc
=
vDecEncSample
->
CreateVideoEncoderByMime
(
MIME_TYPE_
AVC
);
ASSERT_NE
(
nullptr
,
videoEnc
);
ASSERT_NE
(
nullptr
,
videoEnc
);
vDecEncSample
->
SetReadPath
(
READPATH
);
vDecEncSample
->
SetReadPath
(
READPATH
);
vDecEncSample
->
SetSavePath
(
"/data/media/video_001.h264"
);
vDecEncSample
->
SetSavePath
(
"/data/media/video_001.h264"
);
...
@@ -128,10 +133,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
...
@@ -128,10 +133,10 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
{
OH_MD_KEY_WIDTH
,
DEFAULT_WIDTH
},
{
OH_MD_KEY_WIDTH
,
DEFAULT_WIDTH
},
{
OH_MD_KEY_HEIGHT
,
DEFAULT_HEIGHT
},
{
OH_MD_KEY_HEIGHT
,
DEFAULT_HEIGHT
},
{
OH_MD_KEY_PIXEL_FORMAT
,
DEFAULT_PIXELFORMAT
},
{
OH_MD_KEY_PIXEL_FORMAT
,
DEFAULT_PIXELFORMAT
},
{
OH_MD_KEY_FRAME_RATE
,
DEFAULT_FRAMERATE
},
};
};
ASSERT_EQ
(
true
,
SetFormat
(
VideoFormat
,
VideoParam
));
ASSERT_EQ
(
true
,
SetFormat
(
VideoFormat
,
VideoParam
));
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_TRACK_TYPE
,
OH_MediaType
::
MEDIA_TYPE_VID
);
OH_AVFormat_SetIntValue
(
VideoFormat
,
OH_MD_KEY_TRACK_TYPE
,
OH_MediaType
::
MEDIA_TYPE_VID
);
OH_AVFormat_SetDoubleValue
(
VideoFormat
,
OH_MD_KEY_FRAME_RATE
,
DEFAULT_FRAMERATE
);
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureDec
(
VideoFormat
));
OH_AVFormat
*
OutDescDec
=
OH_VideoDecoder_GetOutputDescription
(
videoDec
);
OH_AVFormat
*
OutDescDec
=
OH_VideoDecoder_GetOutputDescription
(
videoDec
);
...
@@ -141,7 +146,6 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
...
@@ -141,7 +146,6 @@ HWTEST_F(ActsVideoDecEncNdkTest, SUB_MULTIMEDIA_MEDIA_VIDEO_DEC_ENC_FUNCTION_010
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
ConfigureEnc
(
VideoFormat
));
OH_AVFormat
*
OutDescEnc
=
OH_VideoEncoder_GetOutputDescription
(
videoEnc
);
OH_AVFormat
*
OutDescEnc
=
OH_VideoEncoder_GetOutputDescription
(
videoEnc
);
ASSERT_NE
(
nullptr
,
OutDescEnc
);
ASSERT_NE
(
nullptr
,
OutDescEnc
);
ASSERT_EQ
(
true
,
CheckDecDesc
(
VideoParam
,
OutDescEnc
));
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
GetSurface
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
GetSurface
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetOutputSurface
());
ASSERT_EQ
(
AV_ERR_OK
,
vDecEncSample
->
SetOutputSurface
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录