Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Applications Sample Camera
提交
56fbd64d
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 搜索 >>
提交
56fbd64d
编写于
9月 27, 2021
作者:
O
openharmony_ci
提交者:
Gitee
9月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
!56 去除audio capture sample构建、调整录制文路径
Merge pull request !56 from starfish/cherry-pick-1632747886
上级
c29e59cd
a3cd160f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
21 deletion
+4
-21
media/BUILD.gn
media/BUILD.gn
+0
-17
media/audio_capture_sample.cpp
media/audio_capture_sample.cpp
+1
-1
media/camera_sample.cpp
media/camera_sample.cpp
+3
-3
未找到文件。
media/BUILD.gn
浏览文件 @
56fbd64d
...
...
@@ -29,22 +29,6 @@ executable("camera_sample") {
output_dir = "$root_out_dir/dev_tools"
}
executable("audio_capture_sample") {
sources = [
"audio_capture_sample.cpp",
]
cflags = ["-Wall"]
cflags_cc = cflags
ldflags = ["-lstdc++"]
ldflags += ["-lpthread"]
ldflags += ["-Wl,-rpath-link=$ohos_root_path/$root_out_dir"]
deps = [
"//third_party/bounds_checking_function:libsec_shared",
"//foundation/multimedia/audio_lite/frameworks:audio_capturer_lite",
]
output_dir = "$root_out_dir/dev_tools"
}
executable("player_sample") {
sources = [ "player_sample.cpp" ]
cflags = [ "-Wall" ]
...
...
@@ -64,6 +48,5 @@ lite_component("media_sample") {
features = [
":camera_sample",
":player_sample",
":audio_capture_sample",
]
}
media/audio_capture_sample.cpp
浏览文件 @
56fbd64d
...
...
@@ -83,7 +83,7 @@ static char *GernerateFileName(AudioCodecFormat format)
}
(
void
)
memset_s
(
name
,
size
,
0
,
size
);
/* create file for save stream */
if
(
snprintf_s
(
name
,
size
,
size
-
1
,
"/
sdcard
/audio_%s.%s"
,
aszDatetime
,
postfix
.
c_str
())
<
0
)
{
if
(
snprintf_s
(
name
,
size
,
size
-
1
,
"/
userdata
/audio_%s.%s"
,
aszDatetime
,
postfix
.
c_str
())
<
0
)
{
std
::
cout
<<
"snprintf_s failed "
<<
std
::
endl
;
free
(
name
);
return
nullptr
;
...
...
media/camera_sample.cpp
浏览文件 @
56fbd64d
...
...
@@ -40,9 +40,9 @@ static int32_t SampleGetRecordFd()
if
(
ltm
!=
nullptr
)
{
ostringstream
ss
(
"Capture_"
);
ss
<<
"Record"
<<
ltm
->
tm_hour
<<
"-"
<<
ltm
->
tm_min
<<
"-"
<<
ltm
->
tm_sec
<<
".mp4"
;
fd
=
open
((
"/userdata/
video/
"
+
ss
.
str
()).
c_str
(),
O_RDWR
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
);
fd
=
open
((
"/userdata/"
+
ss
.
str
()).
c_str
(),
O_RDWR
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
);
cout
<<
"Open "
<<
"/userdata/
video/
"
<<
ss
.
str
()
<<
endl
;
<<
"/userdata/"
<<
ss
.
str
()
<<
endl
;
if
(
fd
==
-
1
)
{
cout
<<
"Open recorder file failed. strerr="
<<
strerror
(
errno
)
<<
endl
;
...
...
@@ -61,7 +61,7 @@ static void SampleSaveCapture(const char *p, uint32_t size)
ostringstream
ss
(
"Capture_"
);
ss
<<
"Capture"
<<
ltm
->
tm_hour
<<
"-"
<<
ltm
->
tm_min
<<
"-"
<<
ltm
->
tm_sec
<<
".jpg"
;
ofstream
pic
(
"/
sdcard
/"
+
ss
.
str
(),
ofstream
::
out
|
ofstream
::
trunc
);
ofstream
pic
(
"/
userdata
/"
+
ss
.
str
(),
ofstream
::
out
|
ofstream
::
trunc
);
cout
<<
"write "
<<
size
<<
" bytes"
<<
endl
;
pic
.
write
(
p
,
size
);
pic
.
close
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录