diff --git a/cameraApp/BUILD.gn b/cameraApp/BUILD.gn index 6447fd78b0437f675b553e1b7e06c32f57a3f643..d1bef2dd32b26b7d61e3666d6b5a5ec821757868 100755 --- a/cameraApp/BUILD.gn +++ b/cameraApp/BUILD.gn @@ -19,7 +19,8 @@ shared_library("cameraApp") { "cameraApp/src/main/cpp/camera_ability_slice.cpp", "cameraApp/src/main/cpp/camera_manager.cpp", ] - + cflags = [ "-Werror" ] + cflags_cc = cflags deps = [ "${aafwk_lite_path}/frameworks/ability_lite:aafwk_abilitykit_lite", "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", diff --git a/cameraApp/cameraApp/src/main/cpp/camera_manager.cpp b/cameraApp/cameraApp/src/main/cpp/camera_manager.cpp index c3c63e251f270f02c998835cddea8c272da6655c..9b98ff46bb625511ace221b393e5a30e3d9faf7a 100755 --- a/cameraApp/cameraApp/src/main/cpp/camera_manager.cpp +++ b/cameraApp/cameraApp/src/main/cpp/camera_manager.cpp @@ -30,8 +30,6 @@ static constexpr int TEMP_BUF_LEN = 8; static constexpr int MAX_THM_SIZE = (64 * PAGE_SIZE); static constexpr int FILE_NAME_LEN = 128; static constexpr int MILLI_SECONDS = 1000; -static constexpr int PIC_WIDTH = 1920; -static constexpr int PIC_HEIGHT = 1080; char* g_dstBuf = nullptr; @@ -221,7 +219,9 @@ static void SampleSaveCapture(const char* p, uint32_t size, int type, const char fwrite(p, 1, size, fp); fflush(fp); fsync(fileno(fp)); - fclose(fp); + if (fclose(fp) == -1) { + printf("stream closed failed!! \n"); + } if (type == 0) { if (sprintf_s(acFileDcf, sizeof(acFileDcf), "%s/photo%s.jpg", THUMB_PATH, timeStamp) < 0) { diff --git a/media/BUILD.gn b/media/BUILD.gn index 01f99e1ac2988557b7e3dbc8de795ce0996aca54..15a1f56af78c95ef11af804fdf40896297aec02a 100755 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -14,7 +14,10 @@ import("//build/lite/config/component/lite_component.gni") executable("camera_sample") { sources = [ "camera_sample.cpp" ] - cflags = [ "-Wall" ] + cflags = [ + "-Wall", + "-Werror", + ] cflags_cc = cflags include_dirs = [] @@ -31,7 +34,10 @@ executable("camera_sample") { executable("player_sample") { sources = [ "player_sample.cpp" ] - cflags = [ "-Wall" ] + cflags = [ + "-Wall", + "-Werror", + ] cflags_cc = cflags include_dirs = [] ldflags = [ "-lstdc++" ] diff --git a/media/player_sample.cpp b/media/player_sample.cpp index b6b8675482622c01aef446723678113c413fcffd..8188ba502d9d8567615f699214c7d9fcab46feba 100755 --- a/media/player_sample.cpp +++ b/media/player_sample.cpp @@ -420,23 +420,6 @@ static int PlayProcess(TestSample &sample) return 0; } -static int ReleaseProcess(TestSample &sample) -{ - int32_t ret; - int64_t begin = GetCurTimeMs(); - - if (sample.pauseAfterPlay != 0) { - ret = sample.adapter->Pause(); - } else { - ret = sample.adapter->Play(); - } - sample.playCost = GetCurTimeMs() - begin; - if (ret != 0) { - printf("[%s: %d] ret:%d\n", __func__, __LINE__, ret); - } - return 0; -} - static void EndStreamSourceThread(TestSample &sample) { if (sample.sourceType == 0x2 && sample.process != -1) {