From a0281949dfb04850758cacd8db6df2e123b8b6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=B8=85?= Date: Mon, 16 Aug 2021 04:21:13 +0000 Subject: [PATCH] Signed-off-by: mamingshuai --- frameworks/camera_ability_impl.cpp | 15 ++++--- frameworks/camera_device_client.cpp | 4 +- frameworks/camera_impl.cpp | 2 +- frameworks/camera_impl.h | 2 +- frameworks/camera_info_impl.cpp | 2 - frameworks/camera_service_client.cpp | 3 +- frameworks/frame_config.cpp | 12 +++++- interfaces/kits/camera_info.h | 10 ++++- interfaces/kits/frame_config.h | 5 +-- interfaces/kits/meta_data.h | 6 +-- services/include/camera_device.h | 3 +- services/include/camera_server.h | 12 +++++- services/include/camera_service.h | 18 ++++++--- services/src/camera_device.cpp | 34 +++++++--------- services/src/camera_server.cpp | 60 ++++++++++++++-------------- 15 files changed, 106 insertions(+), 82 deletions(-) diff --git a/frameworks/camera_ability_impl.cpp b/frameworks/camera_ability_impl.cpp index 9cbaaed..b3851a7 100755 --- a/frameworks/camera_ability_impl.cpp +++ b/frameworks/camera_ability_impl.cpp @@ -1,3 +1,11 @@ +/* + * @Author: your name + * @Date: 2021-08-16 11:33:16 + * @LastEditTime: 2021-08-16 11:49:35 + * @LastEditors: Please set LastEditors + * @Description: In User Settings Edit + * @FilePath: \multimedia_camera_lite\frameworks\camera_ability_impl.cpp + */ /* * Copyright (c) 2020-2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,11 +27,8 @@ using namespace std; namespace OHOS { namespace Media { - list CameraAbilityImpl::GetSupportedFormats() const { -// auto target = SizeMap_.find(PARAM_KEY_SIZE); -// return target->second; list test; return test; } @@ -67,7 +72,5 @@ bool CameraAbilityImpl::IsParameterSupport(uint32_t key) const } return true; } - - } // namespace Media -} // namespace OHOS +} // namespace OHOS \ No newline at end of file diff --git a/frameworks/camera_device_client.cpp b/frameworks/camera_device_client.cpp index 9895cc2..728e060 100755 --- a/frameworks/camera_device_client.cpp +++ b/frameworks/camera_device_client.cpp @@ -121,7 +121,7 @@ int32_t SerilizeFrameConfig(IpcIo &io, FrameConfig &fc, uint32_t maxSurfaceNum) int32_t qfactor = -1; fc.GetParameter(PARAM_KEY_IMAGE_ENCODE_QFACTOR, qfactor); IpcIoPushInt32(&io, qfactor); - // FPS, format, private Tag + int32_t frameRate = -1; fc.GetParameter(PARAM_KEY_STREAM_FPS, frameRate); IpcIoPushInt32(&io, frameRate); @@ -305,4 +305,4 @@ int32_t CameraDeviceClient::DeviceClientCallback(const IpcContext* context, void return MEDIA_OK; } } -} +} \ No newline at end of file diff --git a/frameworks/camera_impl.cpp b/frameworks/camera_impl.cpp index 556552b..81894d4 100755 --- a/frameworks/camera_impl.cpp +++ b/frameworks/camera_impl.cpp @@ -85,7 +85,7 @@ void CameraImpl::Release() return; } deviceClient_->Release(); - if (handler_== nullptr) { + if (handler_ == nullptr) { return; } handler_->Post([this] { this->stateCb_->OnReleased(*this); }); diff --git a/frameworks/camera_impl.h b/frameworks/camera_impl.h index f5a80ed..25db7a3 100755 --- a/frameworks/camera_impl.h +++ b/frameworks/camera_impl.h @@ -60,4 +60,4 @@ private: }; } // namespace Media } // namespace OHOS -#endif // OHOS_CAMERA_IMPL_H +#endif // OHOS_CAMERA_IMPL_H \ No newline at end of file diff --git a/frameworks/camera_info_impl.cpp b/frameworks/camera_info_impl.cpp index af24fce..888491a 100755 --- a/frameworks/camera_info_impl.cpp +++ b/frameworks/camera_info_impl.cpp @@ -18,7 +18,6 @@ using namespace std; namespace OHOS { namespace Media { - CameraInfoImpl::CameraInfoImpl(int32_t cameraType, int32_t cameraFacingType) { this->cameraType = cameraType; @@ -45,6 +44,5 @@ void CameraInfoImpl::SetCameraFacingType(int32_t cameraFacingType) this->cameraFacingType = cameraFacingType; return; } - } // namespace Media } // namespace OHOS \ No newline at end of file diff --git a/frameworks/camera_service_client.cpp b/frameworks/camera_service_client.cpp index 0430e64..9a291fa 100755 --- a/frameworks/camera_service_client.cpp +++ b/frameworks/camera_service_client.cpp @@ -97,7 +97,8 @@ int CameraServiceClient::Callback(void* owner, int code, IpcIo *reply) cameraAbility->SetParameterRange(CAM_IMAGE_YUV420, supportSizeList); cameraAbility->SetParameterRange(CAM_AF_MODE, afModeList); cameraAbility->SetParameterRange(CAM_AE_MODE, aeModeList); - client->deviceAbilityMap_.insert(pair(client->cameraIdForAbility, cameraAbility)); + client->deviceAbilityMap_.insert( + pair(client->cameraIdForAbility, cameraAbility)); } else { MEDIA_ERR_LOG("Callback : cameraAbility construct failed."); } diff --git a/frameworks/frame_config.cpp b/frameworks/frame_config.cpp index 22c5442..4aa2817 100755 --- a/frameworks/frame_config.cpp +++ b/frameworks/frame_config.cpp @@ -1,3 +1,11 @@ +/* + * @Author: your name + * @Date: 2021-08-16 11:33:19 + * @LastEditTime: 2021-08-16 12:02:46 + * @LastEditors: Please set LastEditors + * @Description: In User Settings Edit + * @FilePath: \multimedia_camera_lite\frameworks\frame_config.cpp + */ /* * Copyright (c) 2020-2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -69,7 +77,7 @@ void FrameConfig::GetVendorParameter(uint8_t *value, uint32_t len) MEDIA_ERR_LOG("value is a nullptr"); return; } - uint32_t realLength = len > PRIVATE_TAG_LEN ? PRIVATE_TAG_LEN : len; + uint32_t realLength = (len > PRIVATE_TAG_LEN) ? PRIVATE_TAG_LEN : len; errno_t ret = memcpy_s(value, realLength, privateTag_, realLength); if (ret != EOK) { MEDIA_ERR_LOG("memcpy failed when get private tag, ret(%d)", ret); @@ -84,7 +92,7 @@ void FrameConfig::SetValue(uint32_t key, const void *value) } switch (key) { case PARAM_KEY_IMAGE_ENCODE_QFACTOR: - case PARAM_KEY_STREAM_FPS: + case PARAM_KEY_STREAM_FPS: case CAM_IMAGE_FORMAT: keyMap_[key] = *(static_cast(value)); break; diff --git a/interfaces/kits/camera_info.h b/interfaces/kits/camera_info.h index 419ab42..1f89339 100755 --- a/interfaces/kits/camera_info.h +++ b/interfaces/kits/camera_info.h @@ -1,3 +1,11 @@ +/* + * @Author: your name + * @Date: 2021-08-16 11:33:08 + * @LastEditTime: 2021-08-16 12:08:30 + * @LastEditors: Please set LastEditors + * @Description: In User Settings Edit + * @FilePath: \multimedia_camera_lite\interfaces\kits\camera_info.h + */ /* * Copyright (c) 2020-2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -41,7 +49,6 @@ namespace OHOS { namespace Media { - typedef enum { /* Wide angle camera */ WIDE_ANGLE, @@ -96,7 +103,6 @@ public: return -1; } }; - } } #endif // OHOS_CAMERA_INFO_H \ No newline at end of file diff --git a/interfaces/kits/frame_config.h b/interfaces/kits/frame_config.h index 2c13959..4e34cd1 100755 --- a/interfaces/kits/frame_config.h +++ b/interfaces/kits/frame_config.h @@ -44,7 +44,6 @@ namespace OHOS { namespace Media { - constexpr int32_t FRAME_CONFIG_PREVIEW = 0; constexpr int32_t FRAME_CONFIG_RECORD = 1; constexpr int32_t FRAME_CONFIG_CAPTURE = 2; @@ -153,10 +152,10 @@ private: int32_t type_; std::list surfaceList_; std::map keyMap_; - uint8_t privateTag_[PRIVATE_TAG_LEN]; + uint8_t privateTag_[PRIVATE_TAG_LEN]; void *GetValue(uint32_t key); void SetValue(uint32_t key, const void *value); }; } // namespace Media } // namespace OHOS -#endif // OHOS_FRAME_CONFIG_H +#endif // OHOS_FRAME_CONFIG_H \ No newline at end of file diff --git a/interfaces/kits/meta_data.h b/interfaces/kits/meta_data.h index 78259c2..05a47e5 100755 --- a/interfaces/kits/meta_data.h +++ b/interfaces/kits/meta_data.h @@ -72,7 +72,7 @@ typedef enum { CAM_IMAGE_DENOISE_MODE, /* Image denoising level */ CAM_IMAGE_DENOISE_LEVEL, - /*Only vaild when frameConfigType is callback*/ + /* Only vaild when frameConfigType is callback*/ CAM_IMAGE_FORMAT, /* Auto foucue mode */ CAM_AF_MODE, @@ -93,8 +93,8 @@ typedef enum { CAM_ROTATION_180 = 4, /**< 180-degree rotation */ } CameraInvertMode; -//#define PARAM_KEY_SIZE 0 -//#define PARAM_KEY_IMAGE_ENCODE_QFACTOR 1 +// #define PARAM_KEY_SIZE 0 +// #define PARAM_KEY_IMAGE_ENCODE_QFACTOR 1 #define ENCODER_TYPE 0 typedef enum { diff --git a/services/include/camera_device.h b/services/include/camera_device.h index ac5e89b..83d5b27 100755 --- a/services/include/camera_device.h +++ b/services/include/camera_device.h @@ -78,7 +78,6 @@ public: Surface *capSurface_ = nullptr; private: int32_t sourceIdx = 0; - // uint32_t streamId = 0; pthread_t threadId; static void *YuvCopyProcess(void *arg); }; @@ -120,7 +119,7 @@ private: RecordAssistant recordAssistant_; PreviewAssistant previewAssistant_; CaptureAssistant captureAssistant_; - CallbackAssistant callbackAssistant_; + CallbackAssistant callbackAssistant_; }; } // namespace Media } // namespace OHOS diff --git a/services/include/camera_server.h b/services/include/camera_server.h index 5c32512..4e4b537 100755 --- a/services/include/camera_server.h +++ b/services/include/camera_server.h @@ -1,3 +1,11 @@ +/* + * @Author: your name + * @Date: 2021-08-16 11:33:21 + * @LastEditTime: 2021-08-16 12:06:56 + * @LastEditors: Please set LastEditors + * @Description: In User Settings Edit + * @FilePath: \multimedia_camera_lite\services\include\camera_server.h + */ /* * Copyright(c) 2020 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,7 +43,7 @@ public: void CreateCamera(IpcIo *req, IpcIo *reply); void CloseCamera(IpcIo *req, IpcIo *reply); void SetCameraConfig(IpcIo *req, IpcIo *reply); - void SetFrameConfig(IpcIo *req, IpcIo *reply); + void SetFrameConfig(IpcIo *req, IpcIo *reply); void TriggerLoopingCapture(IpcIo *req, IpcIo *reply); void StopLoopingCapture(IpcIo *req, IpcIo *reply); void TriggerSingleCapture(IpcIo *req, IpcIo *reply); @@ -50,4 +58,4 @@ private: }; } // namespace Media } // namespace OHOS -#endif // CAMERA_SERVER_H +#endif // CAMERA_SERVER_H \ No newline at end of file diff --git a/services/include/camera_service.h b/services/include/camera_service.h index 21281d1..74fdc69 100755 --- a/services/include/camera_service.h +++ b/services/include/camera_service.h @@ -1,3 +1,11 @@ +/* + * @Author: your name + * @Date: 2021-08-16 11:31:39 + * @LastEditTime: 2021-08-16 12:07:26 + * @LastEditors: Please set LastEditors + * @Description: In User Settings Edit + * @FilePath: \multimedia_camera_lite\services\include\camera_service.h + */ /* * Copyright(c) 2020 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,17 +40,17 @@ public: CameraInfo *GetCameraInfo(std::string &cameraId); CameraDevice *GetCameraDevice(std::string &cameraId); int32_t CreateCamera(std::string cameraId); - int32_t CloseCamera(string cameraId); + int32_t CloseCamera(string cameraId); list GetCameraIdList(); private: CameraService(); int32_t InitCameraDevices(); - std::map deviceMap_; // pair(deviceId, device) - std::map deviceAbilityMap_; // pair(deviceId, ability) - std::map deviceInfoMap_; // pair(deviceId, info) + std::map deviceMap_; + std::map deviceAbilityMap_; + std::map deviceInfoMap_; CameraServiceCallback *cameraServiceCb_ = nullptr; }; } // namespace Media } // namespace OHOS -#endif // OHOS_CAMERA_SERVICE_H +#endif // OHOS_CAMERA_SERVICE_H \ No newline at end of file diff --git a/services/src/camera_device.cpp b/services/src/camera_device.cpp index 533ed4a..72f3629 100755 --- a/services/src/camera_device.cpp +++ b/services/src/camera_device.cpp @@ -50,7 +50,6 @@ const int32_t IMAGE_SIZE = 5; // "DATA_PIX_FORMAT" namespace OHOS { namespace Media { - extern Surface *g_surface; inline PicSize Convert2CodecSize(int32_t width, int32_t height) { @@ -126,7 +125,6 @@ static int32_t CameraCreateVideoEnc(FrameConfig &fc, param[paramIndex].size = sizeof(Profile); paramIndex++; - auto surfaceList = fc.GetSurfaces(); #ifdef __LINUX__ Surface *surface = g_surface; @@ -182,10 +180,10 @@ static int32_t CameraCreateJpegEnc(FrameConfig &fc, uint32_t srcDev, CODEC_HANDL param[paramIndex].size = sizeof(AvCodecMime); paramIndex++; - auto surfaceList = fc.GetSurfaces(); - Surface *surface = surfaceList.front(); + auto surfaceList = fc.GetSurfaces(); + Surface *surface = surfaceList.front(); - std::cout<<"------2: CameraCreateJpegEnc: surface width and height: "<GetWidth()<<", "<GetHeight()<GetWidth()<<", "<GetHeight()<GetWidth(), surface->GetHeight()); param[paramIndex].key = KEY_VIDEO_PIC_SIZE; param[paramIndex].val = &picSize; @@ -246,7 +244,8 @@ static void StreamAttrInitialize(StreamAttr *streamAttr, Surface *surface, streamAttr->format = streamFormat; streamAttr->width = surface->GetWidth(); streamAttr->height = surface->GetHeight(); - streamAttr->fps = 30; + int fps = 30; + streamAttr->fps = fps; } static ImageFormat Convert2HalImageFormat(uint32_t format) @@ -356,8 +355,6 @@ int32_t RecordAssistant::SetFrameConfig(FrameConfig &fc, uint32_t *streamId) streamInfo.type = STERAM_INFO_PRIVATE; fc.GetVendorParameter(streamInfo.u.data, PRIVATE_TAG_LEN); HalCameraStreamSetInfo(cameraId_, *streamId, &streamInfo); - MEDIA_INFO_LOG("dataBuff is %d-%d-%d-%d", streamInfo.u.data[0], streamInfo.u.data[1], - streamInfo.u.data[30], streamInfo.u.data[31]); uint32_t deviceId; HalCameraGetDeviceId(cameraId_, *streamId, &deviceId); @@ -389,7 +386,7 @@ int32_t RecordAssistant::Start(uint32_t streamId) if (state_ != LOOP_READY) { return MEDIA_ERR; } - HalCameraStreamOn(cameraId_, streamId); + HalCameraStreamOn(cameraId_, streamId); int32_t ret = MEDIA_OK; int32_t i; for (i = 0; static_cast(i) < vencHdls_.size(); i++) { @@ -453,7 +450,7 @@ int32_t PreviewAssistant::SetFrameConfig(FrameConfig &fc, uint32_t *streamId) Surface *surface = surfaceList.front(); StreamAttr stream; StreamAttrInitialize(&stream, surface, STREAM_PREVIEW, FORMAT_YVU420); - HalCameraStreamCreate(cameraId_, &stream, streamId); + HalCameraStreamCreate(cameraId_, &stream, streamId); StreamInfo streamInfo; streamInfo.type = STREAM_INFO_POS; streamInfo.u.pos.x = std::stoi(surface->GetUserData(string("region_position_x"))); @@ -476,7 +473,7 @@ int32_t PreviewAssistant::Start(uint32_t streamId) MEDIA_ERR_LOG("fork thread YuvCopyProcess failed: %d.", retCode); } - HalCameraStreamOn(cameraId_, streamId); + HalCameraStreamOn(cameraId_, streamId); return MEDIA_OK; } @@ -619,7 +616,7 @@ int32_t CallbackAssistant::SetFrameConfig(FrameConfig &fc, uint32_t *streamId) int32_t CallbackAssistant::Start(uint32_t streamId) { - if (state_ == LOOP_LOOPING) { + if (state_ == LOOP_LOOPING) { return MEDIA_ERR; } state_ = LOOP_LOOPING; @@ -686,7 +683,7 @@ void* CallbackAssistant::StreamCopyProcess(void *arg) int32_t CallbackAssistant::Stop() { - MEDIA_DEBUG_LOG("CallbackAssistant£ºNo support method."); + MEDIA_DEBUG_LOG("CallbackAssistantNo support method."); state_ = LOOP_STOP; pthread_join(threadId, NULL); HalCameraStreamOff(cameraId_, streamId_); @@ -704,9 +701,8 @@ CameraDevice::~CameraDevice() {} int32_t CameraDevice::Initialize() { - /* Need to be Refactored when delete config file */ - int32_t ret; - ret = CodecInit(); + // Need to be Refactored when delete config file + int32_t ret = CodecInit(); if (ret != 0) { MEDIA_ERR_LOG("Codec module init failed.(ret=%d)", ret); return MEDIA_ERR; @@ -715,7 +711,7 @@ int32_t CameraDevice::Initialize() captureAssistant_.state_ = LOOP_READY; previewAssistant_.state_ = LOOP_READY; recordAssistant_.state_ = LOOP_READY; - callbackAssistant_.state_ = LOOP_READY; + callbackAssistant_.state_ = LOOP_READY; captureAssistant_.cameraId_ = cameraId; previewAssistant_.cameraId_ = cameraId; recordAssistant_.cameraId_ = cameraId; @@ -743,7 +739,7 @@ int32_t CameraDevice::TriggerLoopingCapture(FrameConfig &fc, uint32_t *streamId) case FRAME_CONFIG_CAPTURE: assistant = &captureAssistant_; break; - case FRAME_CONFIG_CALLBACK: + case FRAME_CONFIG_CALLBACK: assistant = &callbackAssistant_; break; default: @@ -789,4 +785,4 @@ int32_t CameraDevice::SetCameraConfig() return MEDIA_OK; } } // namespace Media -} // namespace OHOS +} // namespace OHOS \ No newline at end of file diff --git a/services/src/camera_server.cpp b/services/src/camera_server.cpp index 6df4b32..03fed6d 100755 --- a/services/src/camera_server.cpp +++ b/services/src/camera_server.cpp @@ -55,7 +55,7 @@ void CameraServer::CameraServerRequestHandle(int funcId, void *origin, IpcIo *re case CAEMRA_SERVER_SET_CAMERA_CONFIG: CameraServer::GetInstance()->SetCameraConfig(req, reply); break; - case CAEMRA_SERVER_SET_FRAME_CONFIG: + case CAEMRA_SERVER_SET_FRAME_CONFIG: CameraServer::GetInstance()->SetFrameConfig(req, reply); break; case CAMERA_SERVER_TRIGGER_LOOPING_CAPTURE: @@ -86,10 +86,10 @@ void CameraServer::GetCameraAbility(IpcIo *req, IpcIo *reply) size_t sz; string cameraId((const char*)(IpcIoPopString(req, &sz))); CameraAbility *ability = CameraService::GetInstance()->GetCameraAbility(cameraId); - if (ability == nullptr) { - return; - } - list supportSizeList = ability->GetSupportedSizes(PARAM_KEY_SIZE); + if (ability == nullptr) { + return; + } + list supportSizeList = ability->GetSupportedSizes(PARAM_KEY_SIZE); uint32_t supportProperties = 0; IpcIoPushUint32(reply, supportProperties); uint32_t listSize = supportSizeList.size(); @@ -127,11 +127,11 @@ void CameraServer::GetCameraInfo(IpcIo *req, IpcIo *reply) void CameraServer::GetCameraIdList(IpcIo *req, IpcIo *reply) { - list cameraIdList = CameraService::GetInstance()->GetCameraIdList(); - IpcIoPushUint32(reply, cameraIdList.size()); - for (string cameraId : cameraIdList) { - IpcIoPushString(reply, cameraId.c_str()); - } + list cameraIdList = CameraService::GetInstance()->GetCameraIdList(); + IpcIoPushUint32(reply, cameraIdList.size()); + for (string cameraId : cameraIdList) { + IpcIoPushString(reply, cameraId.c_str()); + } } void CameraServer::CreateCamera(IpcIo *req, IpcIo *reply) @@ -218,22 +218,21 @@ FrameConfig *DeserializeFrameConfig(IpcIo &io) } uint8_t *data = (uint8_t *)dataBuff->buff; fc->SetVendorParameter((uint8_t *)dataBuff->buff, dataBuff->buffSz); - MEDIA_INFO_LOG("dataBuff is %d-%d-%d-%d", data[0], data[1], data[30], data[31]); return fc; } void CameraServer::SetFrameConfig(IpcIo *req, IpcIo *reply) { - size_t sz; - string cameraId((const char*)(IpcIoPopString(req, &sz))); - int32_t streamId = IpcIoPopInt32(req); - MEDIA_ERR_LOG("SetFrameConfig streamId(%d).", streamId); - CameraDevice *device_ = CameraService::GetInstance()->GetCameraDevice(cameraId); - FrameConfig *fc = DeserializeFrameConfig(*req); - if (fc == nullptr) { - MEDIA_ERR_LOG("Deserialize frame config failed."); - return; - } + size_t sz; + string cameraId((const char *)(IpcIoPopString(req, &sz))); + int32_t streamId = IpcIoPopInt32(req); + MEDIA_ERR_LOG("SetFrameConfig streamId(%d).", streamId); + CameraDevice *device_ = CameraService::GetInstance()->GetCameraDevice(cameraId); + FrameConfig *fc = DeserializeFrameConfig(*req); + if (fc == nullptr) { + MEDIA_ERR_LOG("Deserialize frame config failed."); + return; + } delete fc; } @@ -250,21 +249,21 @@ void CameraServer::TriggerLoopingCapture(IpcIo *req, IpcIo *reply) } uint32_t streamId = 0; int32_t loopingCaptureStatus = device_->TriggerLoopingCapture(*fc, &streamId); - OnTriggerLoopingCaptureFinished(loopingCaptureStatus, streamId); - delete fc; + OnTriggerLoopingCaptureFinished(loopingCaptureStatus, streamId); + delete fc; } -void CameraServer::TriggerSingleCapture(IpcIo *req, IpcIo *reply) +void CameraServer::TriggerSingleCapture(IpcIo *req, IpcIo *reply) { size_t sz; - string cameraId((const char*)(IpcIoPopString(req, &sz))); + string cameraId((const char *)(IpcIoPopString(req, &sz))); CameraDevice *device_ = CameraService::GetInstance()->GetCameraDevice(cameraId); FrameConfig *fc = DeserializeFrameConfig(*req); if (fc == nullptr) { MEDIA_ERR_LOG("Deserialize frame config failed."); return; } - uint32_t streamId = 0; + uint32_t streamId = 0; int32_t singleCaptureStatus = device_->TriggerSingleCapture(*fc, &streamId); OnTriggerSingleCaptureFinished(singleCaptureStatus); delete fc; @@ -274,11 +273,11 @@ void CameraServer::StopLoopingCapture(IpcIo *req, IpcIo *reply) { MEDIA_INFO_LOG("StopLoopingCapture in camera_server.cpp!"); size_t sz; - string cameraId((const char*)(IpcIoPopString(req, &sz))); + string cameraId((const char *)(IpcIoPopString(req, &sz))); CameraDevice *device_ = CameraService::GetInstance()->GetCameraDevice(cameraId); - if (device_ == nullptr) { + if (device_ == nullptr) { MEDIA_INFO_LOG("device_ is null in camera_server.cpp!"); - } + } device_->StopLoopingCapture(); } @@ -334,5 +333,4 @@ void CameraServer::OnCameraConfigured(int32_t ret) } } } // namespace Media -} // namespace OHOS - +} // namespace OHOS \ No newline at end of file