提交 56fbd64d 编写于 作者: O openharmony_ci 提交者: Gitee

!56 去除audio capture sample构建、调整录制文路径

Merge pull request !56 from starfish/cherry-pick-1632747886
......@@ -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",
]
}
......@@ -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;
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册