From fb8420524d4743fa1a6365dc2a3fd19ea3f5bb06 Mon Sep 17 00:00:00 2001 From: wangchaole Date: Thu, 22 Sep 2022 15:43:17 +0800 Subject: [PATCH] fix: modify tdd test Signed-off-by: wangchaole --- common/include/utils/dcamera_hisysevent_adapter.h | 14 +++++++------- common/src/utils/dcamera_hisysevent_adapter.cpp | 14 +++++++------- .../dcamera_video_surface_listener_common.cpp | 3 ++- .../distributedcamera/dcamera_source_hidumper.cpp | 4 ++-- .../dcamera_stream_data_process_producer.cpp | 2 -- .../fpscontroller/fps_controller_process.h | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/common/include/utils/dcamera_hisysevent_adapter.h b/common/include/utils/dcamera_hisysevent_adapter.h index fec74743..a0bf1704 100644 --- a/common/include/utils/dcamera_hisysevent_adapter.h +++ b/common/include/utils/dcamera_hisysevent_adapter.h @@ -51,17 +51,17 @@ using EventCaptureInfo = struct _EventCaptureInfo { int32_t type_; }; -void ReportDcamerInitFail(const std::string eventName, int32_t errCode, const std::string& errMsg); -void ReportRegisterCameraFail(const std::string eventName, const std::string& devId, const std::string& dhId, +void ReportDcamerInitFail(const std::string& eventName, int32_t errCode, const std::string& errMsg); +void ReportRegisterCameraFail(const std::string& eventName, const std::string& devId, const std::string& dhId, std::string version, const std::string& errMsg); -void ReportDcamerOptFail(const std::string eventName, int32_t errCode, const std::string& errMsg); +void ReportDcamerOptFail(const std::string& eventName, int32_t errCode, const std::string& errMsg); -void ReportSaEvent(const std::string eventName, int32_t saId, const std::string& errMsg); -void ReportRegisterCameraEvent(const std::string eventName, const std::string& devId, const std::string& dhId, +void ReportSaEvent(const std::string& eventName, int32_t saId, const std::string& errMsg); +void ReportRegisterCameraEvent(const std::string& eventName, const std::string& devId, const std::string& dhId, std::string version, const std::string& errMsg); -void ReportCameraOperaterEvent(const std::string eventName, const std::string& devId, const std::string& dhId, +void ReportCameraOperaterEvent(const std::string& eventName, const std::string& devId, const std::string& dhId, const std::string& errMsg); -void ReportStartCaptureEvent(const std::string eventName, EventCaptureInfo& capture, const std::string& errMsg); +void ReportStartCaptureEvent(const std::string& eventName, EventCaptureInfo& capture, const std::string& errMsg); std::string CreateMsg(const char *format, ...); } // namespace DistributedHardware diff --git a/common/src/utils/dcamera_hisysevent_adapter.cpp b/common/src/utils/dcamera_hisysevent_adapter.cpp index 411e1d4c..2b9a6d63 100644 --- a/common/src/utils/dcamera_hisysevent_adapter.cpp +++ b/common/src/utils/dcamera_hisysevent_adapter.cpp @@ -35,7 +35,7 @@ const std::string ENUM_ENCODETYPE_STRINGS[] = { }; } -void ReportDcamerInitFail(const std::string eventName, int32_t errCode, const std::string& errMsg) +void ReportDcamerInitFail(const std::string& eventName, int32_t errCode, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, eventName, @@ -47,7 +47,7 @@ void ReportDcamerInitFail(const std::string eventName, int32_t errCode, const st } } -void ReportRegisterCameraFail(const std::string eventName, const std::string& devId, const std::string& dhId, +void ReportRegisterCameraFail(const std::string& eventName, const std::string& devId, const std::string& dhId, std::string version, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, @@ -63,7 +63,7 @@ void ReportRegisterCameraFail(const std::string eventName, const std::string& de } } -void ReportDcamerOptFail(const std::string eventName, int32_t errCode, const std::string& errMsg) +void ReportDcamerOptFail(const std::string& eventName, int32_t errCode, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, eventName, @@ -75,7 +75,7 @@ void ReportDcamerOptFail(const std::string eventName, int32_t errCode, const std } } -void ReportSaEvent(const std::string eventName, int32_t saId, const std::string& errMsg) +void ReportSaEvent(const std::string& eventName, int32_t saId, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, eventName, @@ -87,7 +87,7 @@ void ReportSaEvent(const std::string eventName, int32_t saId, const std::string& } } -void ReportRegisterCameraEvent(const std::string eventName, const std::string& devId, const std::string& dhId, +void ReportRegisterCameraEvent(const std::string& eventName, const std::string& devId, const std::string& dhId, std::string version, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, @@ -102,7 +102,7 @@ void ReportRegisterCameraEvent(const std::string eventName, const std::string& d } } -void ReportCameraOperaterEvent(const std::string eventName, const std::string& devId, const std::string& dhId, +void ReportCameraOperaterEvent(const std::string& eventName, const std::string& devId, const std::string& dhId, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, @@ -116,7 +116,7 @@ void ReportCameraOperaterEvent(const std::string eventName, const std::string& d } } -void ReportStartCaptureEvent(const std::string eventName, EventCaptureInfo& capture, const std::string& errMsg) +void ReportStartCaptureEvent(const std::string& eventName, EventCaptureInfo& capture, const std::string& errMsg) { int32_t ret = HiSysEventNameSpace::Write(DOMAIN_STR, eventName, diff --git a/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener_common.cpp b/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener_common.cpp index c18db05f..d54fd0ae 100644 --- a/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener_common.cpp +++ b/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener_common.cpp @@ -51,7 +51,8 @@ void DCameraVideoSurfaceListener::OnBufferAvailable() int32_t size = width * height * 4; char *address = static_cast(buffer->GetVirAddr()); if ((address == nullptr) || (size <= 0) || (size > SURFACE_BUFFER_MAX_SIZE)) { - DHLOGE("DCameraVideoSurfaceListenerCommon invalid params, width: %d, height: %d, size: %d", width, height, size); + DHLOGE("DCameraVideoSurfaceListenerCommon invalid params, width: %d, height: %d, size: %d", + width, height, size); break; } diff --git a/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp b/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp index 3db25a3a..680e2356 100644 --- a/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp +++ b/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp @@ -128,10 +128,10 @@ int32_t DcameraSourceHidumper::GetCurrentStateInfo(std::string& result) { DHLOGI("GetCurrentStateInfo Dump."); std::map devState = camDumpInfo_.curState; - std::string deviceId(""); - int32_t camState = 0; result.append("CameraId\tState\n"); for (auto it = devState.begin(); it != devState.end(); it++) { + std::string deviceId(""); + int32_t camState = 0; deviceId = it->first; camState = it->second; DHLOGI("GetCurrentStateInfo camState is %d.", camState); diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp index 0e13b19d..163be8df 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp @@ -225,7 +225,6 @@ int32_t DCameraStreamDataProcessProducer::FeedStreamToDriver(const DHBase& dhBas DCameraMemoryMap(sharedMemory.bufferHandle_->GetBufferHandle()); if (sharedMemory.bufferHandle_->GetBufferHandle()->virAddr == nullptr) { DHLOGE("mmap failed devId: %s dhId: %s", GetAnonyString(devId_).c_str(), GetAnonyString(dhId_).c_str()); - ret = DCAMERA_MEMORY_OPT_ERROR; break; } ret = memcpy_s(sharedMemory.bufferHandle_->GetBufferHandle()->virAddr, sharedMemory.size_, buffer->Data(), @@ -234,7 +233,6 @@ int32_t DCameraStreamDataProcessProducer::FeedStreamToDriver(const DHBase& dhBas DHLOGE("memcpy_s devId: %s dhId: %s streamId: %d bufSize: %d, addressSize: %d", GetAnonyString(devId_).c_str(), GetAnonyString(dhId_).c_str(), streamId_, buffer->Size(), sharedMemory.size_); - ret = DCAMERA_MEMORY_OPT_ERROR; break; } sharedMemory.size_ = buffer->Size(); diff --git a/services/data_process/include/pipeline_node/fpscontroller/fps_controller_process.h b/services/data_process/include/pipeline_node/fpscontroller/fps_controller_process.h index f56a90a2..44e939a5 100644 --- a/services/data_process/include/pipeline_node/fpscontroller/fps_controller_process.h +++ b/services/data_process/include/pipeline_node/fpscontroller/fps_controller_process.h @@ -73,7 +73,7 @@ private: float frameRateCorrectionFactor_ = 0.0; /* modify the frame rate controller argument */ int32_t frameRateOvershootMdf_ = 0; - int64_t incomingFrameTimesMs_[INCOME_FRAME_TIME_HISTORY_WINDOWS_SIZE]; + int64_t incomingFrameTimesMs_[INCOME_FRAME_TIME_HISTORY_WINDOWS_SIZE] = { 0 }; }; } // namespace DistributedHardware } // namespace OHOS -- Gitee