Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Applications Sample Camera
提交
545cdfce
A
Applications Sample Camera
项目概览
OpenHarmony
/
Applications Sample Camera
8 个月 前同步成功
通知
5
Star
25
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Applications Sample Camera
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
545cdfce
编写于
8月 25, 2021
作者:
S
starfish002
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support pause after first frame play
Signed-off-by:
N
starfish002
<
shaoyuan.zhang@huawei.com
>
上级
7c60488b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
5 deletion
+26
-5
media/player_sample.cpp
media/player_sample.cpp
+26
-5
未找到文件。
media/player_sample.cpp
浏览文件 @
545cdfce
...
...
@@ -88,6 +88,7 @@ typedef struct TagTestSample
int32_t
isThreadRunning
;
int32_t
sourceType
;
char
filePath
[
PATH_MAX
];
int32_t
pauseAfterPlay
;
std
::
shared_ptr
<
StreamSourceSample
>
streamSample
;
}
TestSample
;
...
...
@@ -301,7 +302,8 @@ void SetSchParam(void)
int
main
(
int
argc
,
char
**
argv
)
{
prctl
(
PR_SET_NAME
,
"mainProc"
,
0
,
0
,
0
);
int
sourceType
=
1
;
int32_t
sourceType
=
1
;
int32_t
pauseAfterPlay
=
0
;
SAMPLE_RETURN_VAL_IF_NULL
(
argv
);
if
(
argc
<
2
)
{
/* 2: Minimum number of inputs */
printf
(
"usage: %s filename (or vpss channel index)
\n
"
,
argv
[
0
]);
...
...
@@ -309,12 +311,21 @@ int main(int argc, char** argv)
}
if
(
argc
>=
3
)
{
/* 4: sourceType */
sourceType
=
atoi
(
argv
[
2
]);
/* */
if
((
sourceType
!=
1
)
&&
(
sourceType
!=
2
))
{
if
((
sourceType
!=
1
)
&&
(
sourceType
!=
0x
2
))
{
printf
(
"unsuport sourceType:%d
\n
"
,
sourceType
);
return
-
1
;
}
}
TestSample
sample
;
if
(
argc
>=
4
)
{
pauseAfterPlay
=
atoi
(
argv
[
2
]);
if
(
pauseAfterPlay
!=
1
)
{
printf
(
"unsuport pauseAfterPlay:%d, not enable pause after play mode
\n
"
,
sourceType
);
pauseAfterPlay
=
0
;
}
}
TestSample
sample
=
{
0
};
sample
.
pauseAfterPlay
=
pauseAfterPlay
;
sample
.
sourceType
=
sourceType
;
if
(
realpath
(
argv
[
1
],
sample
.
filePath
)
==
nullptr
)
{
printf
(
"realpath input file failed, errno: %d!
\n
"
,
errno
);
...
...
@@ -329,7 +340,8 @@ int main(int argc, char** argv)
SetSchParam
();
printf
(
"[%s,%d]
\n
"
,
__func__
,
__LINE__
);
printf
(
"[%s,%d] sourceType:%d, path:%s
\n
"
,
__func__
,
__LINE__
,
sourceType
,
sample
.
filePath
);
printf
(
"[%s,%d] sourceType:%d, path:%s, pauseAfterPlay:%d
\n
"
,
__func__
,
__LINE__
,
sourceType
,
sample
.
filePath
,
pauseAfterPlay
);
if
(
sourceType
==
1
)
{
std
::
string
uri
(
sample
.
filePath
);
std
::
map
<
std
::
string
,
std
::
string
>
header
;
...
...
@@ -358,6 +370,11 @@ int main(int argc, char** argv)
}
}
if
(
sample
.
pauseAfterPlay
!=
0
)
{
Format
formatSetPauseAfterPlay
;
formatSetPauseAfterPlay
.
PutIntValue
(
PAUSE_AFTER_PLAY
,
true
);
sample
.
adapter
->
SetParameter
(
formatSetPauseAfterPlay
);
}
sample
.
adapter
->
Prepare
();
sample
.
adapter
->
GetDuration
(
duration
);
...
...
@@ -378,7 +395,11 @@ int main(int argc, char** argv)
surface
->
SetUserData
(
"region_height"
,
"480"
);
sample
.
adapter
->
SetVideoSurface
(
surface
);
sample
.
adapter
->
Play
();
if
(
sample
.
pauseAfterPlay
!=
0
)
{
sample
.
adapter
->
Pause
();
}
else
{
sample
.
adapter
->
Play
();
}
/* ¶¨ÖÆ»¯´¦Àí */
SampleCmd
(
sample
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录