From f016714d7f6421ac6fb7a0bf27e64b78434f41c6 Mon Sep 17 00:00:00 2001 From: t00605578 Date: Tue, 22 Mar 2022 10:15:29 +0800 Subject: [PATCH] Dcamera Fix Codec Signed-off-by: t00605578 --- camera_hdf/hdi_impl/BUILD.gn | 2 +- .../include/dcamera_host/dcamera_host.h | 4 +- .../dcamera_provider/dcamera_provider.h | 4 +- .../dcamera_device/dmetadata_processor.cpp | 6 +- .../src/dcamera_provider/dcamera_provider.cpp | 62 ++++++++++++++++++- .../src/dstream_operator/dcamera_steam.cpp | 2 +- .../src/dstream_operator/dstream_operator.cpp | 8 ++- camera_hdf/hdi_impl/test/BUILD.gn | 2 +- camera_hdf/hdi_impl/test/common.cpp | 21 +++++-- camera_hdf/interfaces/hdi_ipc/client/BUILD.gn | 2 +- .../operator/dstream_operator_proxy.cpp | 2 +- .../provider/dcamera_provider_proxy.cpp | 4 +- .../interfaces/hdi_ipc/config/host/BUILD.gn | 2 +- .../config/host/dcamera_host_config.cpp | 4 ++ .../hdi_ipc/config/provider/BUILD.gn | 2 +- .../interfaces/hdi_ipc/ipc_data_utils.h | 2 +- .../dstream_operator_callback_proxy.cpp | 4 +- .../dcamera_provider_callback_proxy.cpp | 2 +- .../server/provider/dcamera_provider_stub.cpp | 10 +-- camera_hdf/interfaces/include/types.h | 2 +- common/BUILD.gn | 2 +- .../native_cpp/camera_sink/BUILD.gn | 2 +- .../src/dcamera_sink_handler_ipc.cpp | 10 +-- .../native_cpp/camera_source/BUILD.gn | 2 +- .../src/dcamera_source_handler_ipc.cpp | 10 +-- sa_profile/4803.xml | 4 +- sa_profile/4804.xml | 4 +- .../cameraoperator/client/BUILD.gn | 2 +- .../include/callback/dcamera_input_callback.h | 2 +- .../callback/dcamera_manager_callback.h | 2 +- .../include/callback/dcamera_photo_callback.h | 2 +- .../callback/dcamera_preview_callback.h | 2 +- .../callback/dcamera_session_callback.h | 2 +- .../include/callback/dcamera_video_callback.h | 2 +- .../client/include/dcamera_client.h | 2 +- .../client/include/icamera_operator.h | 2 +- .../listener/dcamera_photo_surface_listener.h | 2 +- .../listener/dcamera_video_surface_listener.h | 2 +- .../src/callback/dcamera_input_callback.cpp | 2 +- .../src/callback/dcamera_manager_callback.cpp | 2 +- .../src/callback/dcamera_photo_callback.cpp | 2 +- .../src/callback/dcamera_preview_callback.cpp | 2 +- .../src/callback/dcamera_session_callback.cpp | 2 +- .../src/callback/dcamera_video_callback.cpp | 2 +- .../client/src/dcamera_client.cpp | 2 +- .../client/src/dcamera_client_common.cpp | 2 +- .../dcamera_photo_surface_listener.cpp | 2 +- .../dcamera_photo_surface_listener_common.cpp | 2 +- .../dcamera_video_surface_listener.cpp | 2 +- .../dcamera_video_surface_listener_common.cpp | 2 +- .../cameraoperator/handler/BUILD.gn | 2 +- .../handler/include/dcamera_handler.h | 2 +- .../handler/src/dcamera_handler.cpp | 2 +- .../handler/src/dcamera_handler_common.cpp | 2 +- services/cameraservice/sinkservice/BUILD.gn | 2 +- .../mock_camera_channel.h | 2 +- .../mock_camera_operator.h | 2 +- .../mock_data_process_pipeline.h | 2 +- .../mock_dcamera_sink_controller.h | 2 +- .../mock_dcamera_sink_data_process.h | 2 +- .../mock_dcamera_sink_output.h | 2 +- services/cameraservice/sourceservice/BUILD.gn | 2 +- .../distributed_camera_source_stub.cpp | 2 +- .../dcamera_source_controller.cpp | 4 +- .../mock_dcamera_source_dev.h | 2 +- services/channel/BUILD.gn | 2 +- .../channel/src/dcamera_softbus_adapter.cpp | 12 +++- services/data_process/BUILD.gn | 2 +- .../fpscontroller/fps_controller_process.cpp | 6 +- .../multimedia_codec/decode_data_process.cpp | 36 +++++------ .../decode_video_callback.cpp | 2 +- .../multimedia_codec/encode_data_process.cpp | 18 +++--- .../encode_video_callback.cpp | 2 +- 73 files changed, 214 insertions(+), 125 deletions(-) diff --git a/camera_hdf/hdi_impl/BUILD.gn b/camera_hdf/hdi_impl/BUILD.gn index 0be31806..2307ca1c 100644 --- a/camera_hdf/hdi_impl/BUILD.gn +++ b/camera_hdf/hdi_impl/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/camera_hdf/hdi_impl/include/dcamera_host/dcamera_host.h b/camera_hdf/hdi_impl/include/dcamera_host/dcamera_host.h index b9947727..8988b76f 100644 --- a/camera_hdf/hdi_impl/include/dcamera_host/dcamera_host.h +++ b/camera_hdf/hdi_impl/include/dcamera_host/dcamera_host.h @@ -62,13 +62,13 @@ private: private: class AutoRelease { public: - AutoRelease() {}; + AutoRelease() {} ~AutoRelease() { if (DCameraHost::instance_ != nullptr) { DCameraHost::instance_ = nullptr; } - }; + } }; static AutoRelease autoRelease_; static std::shared_ptr instance_; diff --git a/camera_hdf/hdi_impl/include/dcamera_provider/dcamera_provider.h b/camera_hdf/hdi_impl/include/dcamera_provider/dcamera_provider.h index 24fe1d21..e42d0250 100644 --- a/camera_hdf/hdi_impl/include/dcamera_provider/dcamera_provider.h +++ b/camera_hdf/hdi_impl/include/dcamera_provider/dcamera_provider.h @@ -63,13 +63,13 @@ private: private: class AutoRelease { public: - AutoRelease() {}; + AutoRelease() {} ~AutoRelease() { if (DCameraProvider::instance_ != nullptr) { DCameraProvider::instance_ = nullptr; } - }; + } }; static AutoRelease autoRelease_; static std::shared_ptr instance_; diff --git a/camera_hdf/hdi_impl/src/dcamera_device/dmetadata_processor.cpp b/camera_hdf/hdi_impl/src/dcamera_device/dmetadata_processor.cpp index 44fa7a12..b7bc5e30 100644 --- a/camera_hdf/hdi_impl/src/dcamera_device/dmetadata_processor.cpp +++ b/camera_hdf/hdi_impl/src/dcamera_device/dmetadata_processor.cpp @@ -246,7 +246,7 @@ DCamRetCode DMetadataProcessor::AddAbilityEntry(uint32_t tag, const void *data, int ret = CameraStandard::FindCameraMetadataItem(dCameraAbility_->get(), tag, &item); if (ret) { if (!dCameraAbility_->addEntry(tag, data, size)) { - DHLOGE("Add tag %d failed.", tag); + DHLOGE("Add tag %u failed.", tag); return FAILED; } } @@ -264,12 +264,12 @@ DCamRetCode DMetadataProcessor::UpdateAbilityEntry(uint32_t tag, const void *dat int ret = CameraStandard::FindCameraMetadataItem(dCameraAbility_->get(), tag, &item); if (ret) { if (!dCameraAbility_->addEntry(tag, data, size)) { - DHLOGE("Add tag %d failed.", tag); + DHLOGE("Add tag %u failed.", tag); return FAILED; } } else { if (!dCameraAbility_->updateEntry(tag, data, size)) { - DHLOGE("Update tag %d failed.", tag); + DHLOGE("Update tag %u failed.", tag); return FAILED; } } diff --git a/camera_hdf/hdi_impl/src/dcamera_provider/dcamera_provider.cpp b/camera_hdf/hdi_impl/src/dcamera_provider/dcamera_provider.cpp index 009d6fe8..80c82fe6 100644 --- a/camera_hdf/hdi_impl/src/dcamera_provider/dcamera_provider.cpp +++ b/camera_hdf/hdi_impl/src/dcamera_provider/dcamera_provider.cpp @@ -40,6 +40,10 @@ std::shared_ptr DCameraProvider::GetInstance() DCamRetCode DCameraProvider::EnableDCameraDevice(const std::shared_ptr &dhBase, const std::string &abilityInfo, const sptr &callback) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::EnableDCameraDevice, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::EnableDCameraDevice for {devId: %s, dhId: %s, abilityInfo length: %d}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str(), abilityInfo.length()); @@ -71,6 +75,10 @@ DCamRetCode DCameraProvider::EnableDCameraDevice(const std::shared_ptr & DCamRetCode DCameraProvider::DisableDCameraDevice(const std::shared_ptr &dhBase) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::DisableDCameraDevice, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::DisableDCameraDevice for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -96,6 +104,10 @@ DCamRetCode DCameraProvider::DisableDCameraDevice(const std::shared_ptr DCamRetCode DCameraProvider::AcquireBuffer(const std::shared_ptr &dhBase, int streamId, std::shared_ptr &buffer) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::AcquireBuffer, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::AcquireBuffer for {devId: %s, dhId: %s}, streamId: %d.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str(), streamId); @@ -111,6 +123,10 @@ DCamRetCode DCameraProvider::AcquireBuffer(const std::shared_ptr &dhBase DCamRetCode DCameraProvider::ShutterBuffer(const std::shared_ptr &dhBase, int streamId, const std::shared_ptr &buffer) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::ShutterBuffer, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } if (buffer == nullptr) { DHLOGE("DCameraProvider::ShutterBuffer, input distributed camera buffer is null."); return DCamRetCode::INVALID_ARGUMENT; @@ -130,6 +146,10 @@ DCamRetCode DCameraProvider::ShutterBuffer(const std::shared_ptr &dhBase DCamRetCode DCameraProvider::OnSettingsResult(const std::shared_ptr &dhBase, const std::shared_ptr &result) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::OnSettingsResult, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::OnSettingsResult for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -145,6 +165,10 @@ DCamRetCode DCameraProvider::OnSettingsResult(const std::shared_ptr &dhB DCamRetCode DCameraProvider::Notify(const std::shared_ptr &dhBase, const std::shared_ptr &event) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::Notify, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::Notify for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -159,6 +183,10 @@ DCamRetCode DCameraProvider::Notify(const std::shared_ptr &dhBase, DCamRetCode DCameraProvider::OpenSession(const std::shared_ptr &dhBase) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::OpenSession, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::OpenSession for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -173,6 +201,10 @@ DCamRetCode DCameraProvider::OpenSession(const std::shared_ptr &dhBase) DCamRetCode DCameraProvider::CloseSession(const std::shared_ptr &dhBase) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::CloseSession, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::CloseSession for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -188,6 +220,10 @@ DCamRetCode DCameraProvider::CloseSession(const std::shared_ptr &dhBase) DCamRetCode DCameraProvider::ConfigureStreams(const std::shared_ptr &dhBase, const std::vector> &streamInfos) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::ConfigureStreams, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::ConfigureStreams for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -207,6 +243,10 @@ DCamRetCode DCameraProvider::ConfigureStreams(const std::shared_ptr &dhB DCamRetCode DCameraProvider::ReleaseStreams(const std::shared_ptr &dhBase, const std::vector &streamIds) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::ReleaseStreams, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::ReleaseStreams for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -227,6 +267,10 @@ DCamRetCode DCameraProvider::ReleaseStreams(const std::shared_ptr &dhBas DCamRetCode DCameraProvider::StartCapture(const std::shared_ptr &dhBase, const std::vector> &captureInfos) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::StartCapture, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::StartCapture for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -250,6 +294,10 @@ DCamRetCode DCameraProvider::StartCapture(const std::shared_ptr &dhBase, DCamRetCode DCameraProvider::StopCapture(const std::shared_ptr &dhBase) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::StopCapture, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::StopCapture for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -265,6 +313,10 @@ DCamRetCode DCameraProvider::StopCapture(const std::shared_ptr &dhBase) DCamRetCode DCameraProvider::UpdateSettings(const std::shared_ptr &dhBase, const std::vector> &settings) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::UpdateSettings, dhBase is null."); + return DCamRetCode::INVALID_ARGUMENT; + } DHLOGI("DCameraProvider::UpdateSettings for {devId: %s, dhId: %s}.", GetAnonyString(dhBase->deviceId_).c_str(), dhBase->dhId_.c_str()); @@ -279,12 +331,16 @@ DCamRetCode DCameraProvider::UpdateSettings(const std::shared_ptr &dhBas bool DCameraProvider::IsDhBaseInfoInvalid(const std::shared_ptr &dhBase) { - return dhBase->deviceId_.empty() || (dhBase->deviceId_.size() > DEVID_MAX_LENGTH) || + return dhBase == nullptr || dhBase->deviceId_.empty() || (dhBase->deviceId_.size() > DEVID_MAX_LENGTH) || dhBase->dhId_.empty() || (dhBase->dhId_.size() > DHID_MAX_LENGTH); } sptr DCameraProvider::GetCallbackBydhBase(const std::shared_ptr &dhBase) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::GetCallbackBydhBase, dhBase is null."); + return nullptr; + } OHOS::sptr device = GetDCameraDevice(dhBase); if (device == nullptr) { DHLOGE("DCameraProvider::GetCallbackBydhBase failed, dcamera device not found."); @@ -295,6 +351,10 @@ sptr DCameraProvider::GetCallbackBydhBase(const std::s OHOS::sptr DCameraProvider::GetDCameraDevice(const std::shared_ptr &dhBase) { + if (dhBase == nullptr) { + DHLOGE("DCameraProvider::GetDCameraDevice, dhBase is null."); + return nullptr; + } std::shared_ptr dCameraHost = DCameraHost::GetInstance(); if (dCameraHost == nullptr) { DHLOGE("DCameraProvider::GetDCameraDevice, dcamera host is null."); diff --git a/camera_hdf/hdi_impl/src/dstream_operator/dcamera_steam.cpp b/camera_hdf/hdi_impl/src/dstream_operator/dcamera_steam.cpp index ee3cb82a..2cbc6f4a 100644 --- a/camera_hdf/hdi_impl/src/dstream_operator/dcamera_steam.cpp +++ b/camera_hdf/hdi_impl/src/dstream_operator/dcamera_steam.cpp @@ -187,7 +187,7 @@ DCamRetCode DCameraStream::GetNextRequest() OHOS::SurfaceError surfaceError = dcStreamProducer_->RequestBuffer(surfaceBuffer, fence, config); if (surfaceError == OHOS::SURFACE_ERROR_NO_BUFFER) { - DHLOGE("No availiable buffer to request in surface."); + DHLOGE("No available buffer to request in surface."); return DCamRetCode::EXCEED_MAX_NUMBER; } diff --git a/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp b/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp index 21af8d76..84e3e064 100644 --- a/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp +++ b/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp @@ -480,7 +480,7 @@ DCamRetCode DStreamOperator::ShutterBuffer(int streamId, const std::shared_ptr> &streamInfo, std::shared_ptr &captureInfo) { + if (captureInfo == nullptr) { + DHLOGE("DStreamOperator::ChooseSuitableResolution, captureInfo is null."); + return; + } std::vector supportedResolutionList = dcSupportedResolutionMap_[captureInfo->format_]; DCResolution tempResolution = { 0, 0 }; @@ -704,7 +708,7 @@ void DStreamOperator::ChooseSuitableResolution(std::vectorstreamIds_.push_back(stream->streamId_); - }; + } if ((tempResolution.width_ == 0) || (tempResolution.height_ == 0)) { captureInfo->width_ = MAX_SUPPORT_PREVIEW_WIDTH; diff --git a/camera_hdf/hdi_impl/test/BUILD.gn b/camera_hdf/hdi_impl/test/BUILD.gn index 0a0bf5ee..ceaf635e 100644 --- a/camera_hdf/hdi_impl/test/BUILD.gn +++ b/camera_hdf/hdi_impl/test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/camera_hdf/hdi_impl/test/common.cpp b/camera_hdf/hdi_impl/test/common.cpp index 178d893b..2a5cfa05 100644 --- a/camera_hdf/hdi_impl/test/common.cpp +++ b/camera_hdf/hdi_impl/test/common.cpp @@ -38,12 +38,18 @@ int32_t Test::SaveYUV(const char* type, const void* buffer, int32_t size) char path[PATH_MAX] = {0}; if (strncmp(type, "preview", strlen(type)) == 0) { system("mkdir -p /data/dcamera/preview"); - sprintf_s(path, sizeof(path) / sizeof(path[0]), "/data/dcamera/preview/%s_%lld.yuv", - type, GetCurrentLocalTimeStamp()); + if (sprintf_s(path, sizeof(path) / sizeof(path[0]), "/data/dcamera/preview/%s_%lld.yuv", + type, GetCurrentLocalTimeStamp()) < 0) { + std::cout << "SaveYUV : preview sprintf_s fail." << std::endl; + return -1; + } } else { system("mkdir -p /data/dcamera/capture"); - sprintf_s(path, sizeof(path) / sizeof(path[0]), "/data/dcamera/capture/%s_%lld.jpg", - type, GetCurrentLocalTimeStamp()); + if (sprintf_s(path, sizeof(path) / sizeof(path[0]), "/data/dcamera/capture/%s_%lld.jpg", + type, GetCurrentLocalTimeStamp()) < 0) { + std::cout << "SaveYUV : capture sprintf_s fail." << std::endl; + return -1; + } } std::cout << "save yuv to file:" << path << std::endl; @@ -69,8 +75,11 @@ int32_t Test::SaveVideoFile(const char* type, const void* buffer, int32_t size, if (operationMode == 0) { char path[PATH_MAX] = {0}; system("mkdir -p /data/dcamera/video"); - sprintf_s(path, sizeof(path) / sizeof(path[0]), "/data/dcamera/video/%s_%lld.h265", - type, GetCurrentLocalTimeStamp()); + if (sprintf_s(path, sizeof(path) / sizeof(path[0]), "/data/dcamera/video/%s_%lld.h265", + type, GetCurrentLocalTimeStamp()) < 0) { + std::cout << "SaveVideoFile : video sprintf_s fail." << std::endl; + return -1; + } std::cout << "save yuv to file " << std::string(path) << std::endl; int mode = 00766; videoFd = open(path, O_RDWR | O_CREAT, mode); diff --git a/camera_hdf/interfaces/hdi_ipc/client/BUILD.gn b/camera_hdf/interfaces/hdi_ipc/client/BUILD.gn index 71944d5d..b4db7f13 100644 --- a/camera_hdf/interfaces/hdi_ipc/client/BUILD.gn +++ b/camera_hdf/interfaces/hdi_ipc/client/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/camera_hdf/interfaces/hdi_ipc/client/operator/dstream_operator_proxy.cpp b/camera_hdf/interfaces/hdi_ipc/client/operator/dstream_operator_proxy.cpp index c30915d2..4e338ce5 100644 --- a/camera_hdf/interfaces/hdi_ipc/client/operator/dstream_operator_proxy.cpp +++ b/camera_hdf/interfaces/hdi_ipc/client/operator/dstream_operator_proxy.cpp @@ -112,7 +112,7 @@ CamRetCode DStreamOperatorProxy::CreateStreams(const std::vector streamInfo = streamInfos.at(i); bool bRet = IpcDataUtils::EncodeStreamInfo(streamInfo, data); if (!bRet) { - DHLOGE("Write streamInfo failed. index = %d", i); + DHLOGE("Write streamInfo failed. index = %zu", i); return CamRetCode::INVALID_ARGUMENT; } } diff --git a/camera_hdf/interfaces/hdi_ipc/client/provider/dcamera_provider_proxy.cpp b/camera_hdf/interfaces/hdi_ipc/client/provider/dcamera_provider_proxy.cpp index ec5e2120..2e5cf318 100644 --- a/camera_hdf/interfaces/hdi_ipc/client/provider/dcamera_provider_proxy.cpp +++ b/camera_hdf/interfaces/hdi_ipc/client/provider/dcamera_provider_proxy.cpp @@ -133,7 +133,7 @@ DCamRetCode DCameraProviderProxy::AcquireBuffer(const std::shared_ptr &d } int32_t retCode = reply.ReadInt32(); if (retCode != DCamRetCode::SUCCESS) { - DHLOGE("Acquire avaliable buffer from stub failed."); + DHLOGE("Acquire available buffer from stub failed."); return static_cast(retCode); } @@ -143,7 +143,7 @@ DCamRetCode DCameraProviderProxy::AcquireBuffer(const std::shared_ptr &d BufferHandle* retHandle = ReadBufferHandle(reply); if (retHandle == nullptr) { - DHLOGE("Read retrun buffer handle failed."); + DHLOGE("Read return buffer handle failed."); FreeBufferHandle(buffer->bufferHandle_); return DCamRetCode::INVALID_ARGUMENT; } diff --git a/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn b/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn index d3ec5b0d..7b744eb8 100644 --- a/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn +++ b/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/camera_hdf/interfaces/hdi_ipc/config/host/dcamera_host_config.cpp b/camera_hdf/interfaces/hdi_ipc/config/host/dcamera_host_config.cpp index da30b84d..fd07419d 100644 --- a/camera_hdf/interfaces/hdi_ipc/config/host/dcamera_host_config.cpp +++ b/camera_hdf/interfaces/hdi_ipc/config/host/dcamera_host_config.cpp @@ -28,6 +28,10 @@ static int32_t DCameraServiceDispatch(struct HdfDeviceIoClient *client, int cmdI struct HdfSBuf *data, struct HdfSBuf *reply) { HdfDCameraService *service = CONTAINER_OF(client->device->service, HdfDCameraService, ioservice); + if (service == nullptr) { + HDF_LOGE("HdfDCameraService CONTAINER_OF failed!"); + return HDF_FAILURE; + } return DCHostServiceOnRemoteRequest(service->instance, cmdId, data, reply); } diff --git a/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn b/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn index 053ddc2b..1d80115f 100644 --- a/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn +++ b/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/camera_hdf/interfaces/hdi_ipc/ipc_data_utils.h b/camera_hdf/interfaces/hdi_ipc/ipc_data_utils.h index e657d632..6eb671a0 100644 --- a/camera_hdf/interfaces/hdi_ipc/ipc_data_utils.h +++ b/camera_hdf/interfaces/hdi_ipc/ipc_data_utils.h @@ -43,7 +43,7 @@ public: bRet = (bRet && parcel.WriteInt32(static_cast(pInfo->width_))); bRet = (bRet && parcel.WriteInt32(static_cast(pInfo->height_))); bRet = (bRet && parcel.WriteInt32(static_cast(pInfo->format_))); - bRet = (bRet = (bRet && parcel.WriteInt32(pInfo->intent_))); + bRet = (bRet && parcel.WriteInt32(pInfo->intent_)); bRet = (bRet && parcel.WriteBool(pInfo->tunneledMode_)); bool bufferQueueFlag = (pInfo->bufferQueue_ != nullptr) ? true : false; bRet = (bRet && parcel.WriteBool(bufferQueueFlag)); diff --git a/camera_hdf/interfaces/hdi_ipc/server/operator/dstream_operator_callback_proxy.cpp b/camera_hdf/interfaces/hdi_ipc/server/operator/dstream_operator_callback_proxy.cpp index b971960a..dcba3ac2 100644 --- a/camera_hdf/interfaces/hdi_ipc/server/operator/dstream_operator_callback_proxy.cpp +++ b/camera_hdf/interfaces/hdi_ipc/server/operator/dstream_operator_callback_proxy.cpp @@ -77,7 +77,7 @@ void DStreamOperatorCallbackProxy::OnCaptureEnded(int32_t captureId, auto captureEndInfo = info.at(i); bool bRet = data.WriteBuffer((void *)captureEndInfo.get(), sizeof(CaptureEndedInfo)); if (!bRet) { - DHLOGE("Write info index = %d failed.", i); + DHLOGE("Write info index = %zu failed.", i); return; } } @@ -115,7 +115,7 @@ void DStreamOperatorCallbackProxy::OnCaptureError(int32_t captureId, auto captureErrorInfo = info.at(i); bool bRet = data.WriteBuffer((void *)captureErrorInfo.get(), sizeof(CaptureErrorInfo)); if (!bRet) { - DHLOGE("Write info index = %d failed.", i); + DHLOGE("Write info index = %zu failed.", i); return; } } diff --git a/camera_hdf/interfaces/hdi_ipc/server/provider/dcamera_provider_callback_proxy.cpp b/camera_hdf/interfaces/hdi_ipc/server/provider/dcamera_provider_callback_proxy.cpp index 8a9acc63..c3f57790 100644 --- a/camera_hdf/interfaces/hdi_ipc/server/provider/dcamera_provider_callback_proxy.cpp +++ b/camera_hdf/interfaces/hdi_ipc/server/provider/dcamera_provider_callback_proxy.cpp @@ -250,7 +250,7 @@ DCamRetCode DCameraProviderCallbackProxy::UpdateSettings(const std::shared_ptrindex_) || !reply.WriteInt32(dCamerabuffer->size_)) { @@ -169,11 +169,11 @@ int32_t DCameraProviderStub::DCProviderStubOnSettingsResult(MessageParcel& data, std::shared_ptr dCameraSettings = std::make_shared(); bool flag = data.ReadBool(); if (flag) { - IpcDataUtils::DecodeDCameraSettings(data, dCameraSettings); if (dCameraSettings == nullptr) { - DHLOGE("Read distributed camera settings failed."); + DHLOGE("Read distributed camera settings failed, dCameraSettings is null."); return HDF_FAILURE; } + IpcDataUtils::DecodeDCameraSettings(data, dCameraSettings); } DCamRetCode ret = dcameraProvider_->OnSettingsResult(dhBase, dCameraSettings); if (!reply.WriteInt32(static_cast(ret))) { @@ -195,11 +195,11 @@ int32_t DCameraProviderStub::DCProviderStubNotify(MessageParcel& data, MessagePa std::shared_ptr dCameraEvent = std::make_shared(); bool flag = data.ReadBool(); if (flag) { - IpcDataUtils::DecodeDCameraHDFEvent(data, dCameraEvent); if (dCameraEvent == nullptr) { - DHLOGE("Read distributed camera hdf event failed."); + DHLOGE("Read distributed camera hdf event failed, dCameraEvent is null."); return HDF_FAILURE; } + IpcDataUtils::DecodeDCameraHDFEvent(data, dCameraEvent); } DCamRetCode ret = dcameraProvider_->Notify(dhBase, dCameraEvent); if (!reply.WriteInt32(static_cast(ret))) { diff --git a/camera_hdf/interfaces/include/types.h b/camera_hdf/interfaces/include/types.h index d49e2d95..e77adba9 100644 --- a/camera_hdf/interfaces/include/types.h +++ b/camera_hdf/interfaces/include/types.h @@ -267,7 +267,7 @@ using DCCaptureInfo = struct _DCCaptureInfo { /** * @brief Defines the inner buffer of the distributed camera, - * which is used to acquire buffer during procesing capture requests. + * which is used to acquire buffer during processing capture requests. */ using DCameraBuffer = struct _DCameraBuffer { /** diff --git a/common/BUILD.gn b/common/BUILD.gn index b8bb86a6..d3fa8481 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn b/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn index 8c8d618c..73b77ae4 100644 --- a/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler_ipc.cpp b/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler_ipc.cpp index 77a1888b..d2e5fce5 100644 --- a/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler_ipc.cpp +++ b/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler_ipc.cpp @@ -144,15 +144,17 @@ void DCameraSinkHandlerIpc::OnSinkLocalDmsDied(const wptr& remote void DCameraSinkHandlerIpc::OnSinkLocalDmsDied(const sptr& remote) { std::lock_guard autoLock(sinkLocalDmsLock_); + if (localSink_ == nullptr) { + DHLOGE("DCameraSinkHandlerIpc::OnSinkLocalDmsDied, localSink is null."); + return; + } if (localSink_->AsObject() != remote) { - DHLOGI("OnSinkLocalDmsDied not found remote object"); + DHLOGI("OnSinkLocalDmsDied not found remote object."); return; } DHLOGI("OnSinkLocalDmsDied Clear"); - if (localSink_ != nullptr) { - localSink_->AsObject()->RemoveDeathRecipient(sinkLocalRecipient_); - } + localSink_->AsObject()->RemoveDeathRecipient(sinkLocalRecipient_); localSink_ = nullptr; } } diff --git a/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn b/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn index d7a463a3..43b7dfa4 100644 --- a/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler_ipc.cpp b/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler_ipc.cpp index ccf062d2..089e90d1 100644 --- a/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler_ipc.cpp +++ b/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler_ipc.cpp @@ -144,15 +144,17 @@ void DCameraSourceHandlerIpc::OnSourceLocalDmsDied(const wptr& re void DCameraSourceHandlerIpc::OnSourceLocalDmsDied(const sptr& remote) { std::lock_guard autoLock(sourceLocalDmsLock_); + if (localSource_ == nullptr) { + DHLOGE("DCameraSourceHandlerIpc::OnSourceLocalDmsDied, localSource is null."); + return; + } if (localSource_->AsObject() != remote) { - DHLOGI("OnSourceLocalDmsDied not found remote object"); + DHLOGI("OnSourceLocalDmsDied not found remote object."); return; } DHLOGI("OnSourceLocalDmsDied Clear"); - if (localSource_ != nullptr) { - localSource_->AsObject()->RemoveDeathRecipient(sourceLocalRecipient_); - } + localSource_->AsObject()->RemoveDeathRecipient(sourceLocalRecipient_); localSource_ = nullptr; } } diff --git a/sa_profile/4803.xml b/sa_profile/4803.xml index 32f4655e..d5e5bfaa 100644 --- a/sa_profile/4803.xml +++ b/sa_profile/4803.xml @@ -1,6 +1,6 @@ dhardware - + 4803 libdistributed_camera_source.z.so diff --git a/sa_profile/4804.xml b/sa_profile/4804.xml index d01ba659..f0e70574 100644 --- a/sa_profile/4804.xml +++ b/sa_profile/4804.xml @@ -1,6 +1,6 @@ dhardware - + 4804 libdistributed_camera_sink.z.so diff --git a/services/cameraservice/cameraoperator/client/BUILD.gn b/services/cameraservice/cameraoperator/client/BUILD.gn index 3bd8ed81..ca1797d8 100644 --- a/services/cameraservice/cameraoperator/client/BUILD.gn +++ b/services/cameraservice/cameraoperator/client/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/callback/dcamera_input_callback.h b/services/cameraservice/cameraoperator/client/include/callback/dcamera_input_callback.h index e29fcc70..52c11d3d 100644 --- a/services/cameraservice/cameraoperator/client/include/callback/dcamera_input_callback.h +++ b/services/cameraservice/cameraoperator/client/include/callback/dcamera_input_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/callback/dcamera_manager_callback.h b/services/cameraservice/cameraoperator/client/include/callback/dcamera_manager_callback.h index b6f35f3f..6d2aa46d 100644 --- a/services/cameraservice/cameraoperator/client/include/callback/dcamera_manager_callback.h +++ b/services/cameraservice/cameraoperator/client/include/callback/dcamera_manager_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/callback/dcamera_photo_callback.h b/services/cameraservice/cameraoperator/client/include/callback/dcamera_photo_callback.h index 5cc4804d..9e8bd211 100644 --- a/services/cameraservice/cameraoperator/client/include/callback/dcamera_photo_callback.h +++ b/services/cameraservice/cameraoperator/client/include/callback/dcamera_photo_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/callback/dcamera_preview_callback.h b/services/cameraservice/cameraoperator/client/include/callback/dcamera_preview_callback.h index c38caccf..a215c184 100644 --- a/services/cameraservice/cameraoperator/client/include/callback/dcamera_preview_callback.h +++ b/services/cameraservice/cameraoperator/client/include/callback/dcamera_preview_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/callback/dcamera_session_callback.h b/services/cameraservice/cameraoperator/client/include/callback/dcamera_session_callback.h index 343d1c2a..841a0424 100644 --- a/services/cameraservice/cameraoperator/client/include/callback/dcamera_session_callback.h +++ b/services/cameraservice/cameraoperator/client/include/callback/dcamera_session_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/callback/dcamera_video_callback.h b/services/cameraservice/cameraoperator/client/include/callback/dcamera_video_callback.h index 6f82f159..ff7cdec1 100644 --- a/services/cameraservice/cameraoperator/client/include/callback/dcamera_video_callback.h +++ b/services/cameraservice/cameraoperator/client/include/callback/dcamera_video_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/dcamera_client.h b/services/cameraservice/cameraoperator/client/include/dcamera_client.h index 73591141..f355d2f3 100644 --- a/services/cameraservice/cameraoperator/client/include/dcamera_client.h +++ b/services/cameraservice/cameraoperator/client/include/dcamera_client.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/icamera_operator.h b/services/cameraservice/cameraoperator/client/include/icamera_operator.h index 6f787d36..e349339d 100644 --- a/services/cameraservice/cameraoperator/client/include/icamera_operator.h +++ b/services/cameraservice/cameraoperator/client/include/icamera_operator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/listener/dcamera_photo_surface_listener.h b/services/cameraservice/cameraoperator/client/include/listener/dcamera_photo_surface_listener.h index 54a9e50c..72f77a68 100644 --- a/services/cameraservice/cameraoperator/client/include/listener/dcamera_photo_surface_listener.h +++ b/services/cameraservice/cameraoperator/client/include/listener/dcamera_photo_surface_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/include/listener/dcamera_video_surface_listener.h b/services/cameraservice/cameraoperator/client/include/listener/dcamera_video_surface_listener.h index c1bae897..6e06a7e1 100644 --- a/services/cameraservice/cameraoperator/client/include/listener/dcamera_video_surface_listener.h +++ b/services/cameraservice/cameraoperator/client/include/listener/dcamera_video_surface_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp index e915aac5..8d980fd5 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_manager_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_manager_callback.cpp index 0f3865d7..f65adf08 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_manager_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_manager_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp index 62f283ef..1ad5ca50 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_preview_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_preview_callback.cpp index 1eb36092..06aeef65 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_preview_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_preview_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_session_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_session_callback.cpp index d26fb922..a1b1aee6 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_session_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_session_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_video_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_video_callback.cpp index 8adb9731..2e938fa9 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_video_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_video_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index e52b3966..462b99a7 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client_common.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client_common.cpp index b87edf7d..2a026d4f 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client_common.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client_common.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener.cpp b/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener.cpp index 7a2ea6c4..29cbed9d 100644 --- a/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener.cpp +++ b/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener_common.cpp b/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener_common.cpp index 3c60a198..0fbb10ae 100644 --- a/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener_common.cpp +++ b/services/cameraservice/cameraoperator/client/src/listener/dcamera_photo_surface_listener_common.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener.cpp b/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener.cpp index 8d7865e3..b2c2f811 100644 --- a/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener.cpp +++ b/services/cameraservice/cameraoperator/client/src/listener/dcamera_video_surface_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at 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 19dc37b8..b372140f 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/handler/BUILD.gn b/services/cameraservice/cameraoperator/handler/BUILD.gn index f3f6d813..db4f68da 100644 --- a/services/cameraservice/cameraoperator/handler/BUILD.gn +++ b/services/cameraservice/cameraoperator/handler/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/handler/include/dcamera_handler.h b/services/cameraservice/cameraoperator/handler/include/dcamera_handler.h index 4167d4f3..d92c1e44 100644 --- a/services/cameraservice/cameraoperator/handler/include/dcamera_handler.h +++ b/services/cameraservice/cameraoperator/handler/include/dcamera_handler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp b/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp index 116029db..c9c29b77 100644 --- a/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp +++ b/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp b/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp index 837e62aa..6836404a 100644 --- a/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp +++ b/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/BUILD.gn b/services/cameraservice/sinkservice/BUILD.gn index 5cd3337a..2ce72ccf 100644 --- a/services/cameraservice/sinkservice/BUILD.gn +++ b/services/cameraservice/sinkservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_channel.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_channel.h index 479caf75..8f722eea 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_channel.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_channel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h index 48deca9a..bd182c41 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_data_process_pipeline.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_data_process_pipeline.h index dca14bbf..87a4937a 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_data_process_pipeline.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_data_process_pipeline.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_controller.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_controller.h index abb5601d..92869e5b 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_controller.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_controller.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_data_process.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_data_process.h index 7096cd47..4f88a2f0 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_data_process.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_data_process.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_output.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_output.h index 56ca76b0..ecc5428b 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_output.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_dcamera_sink_output.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/cameraservice/sourceservice/BUILD.gn b/services/cameraservice/sourceservice/BUILD.gn index 54b3d772..1851eead 100644 --- a/services/cameraservice/sourceservice/BUILD.gn +++ b/services/cameraservice/sourceservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_stub.cpp b/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_stub.cpp index dd45a32a..54f0df86 100644 --- a/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_stub.cpp +++ b/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_stub.cpp @@ -36,7 +36,7 @@ DistributedCameraSourceStub::~DistributedCameraSourceStub() int32_t DistributedCameraSourceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - DHLOGI("DistributedCameraSourceStub OnRemoteRequest code: %d", code); + DHLOGI("DistributedCameraSourceStub OnRemoteRequest code: %u", code); std::u16string desc = DistributedCameraSourceStub::GetDescriptor(); std::u16string remoteDesc = data.ReadInterfaceToken(); if (desc != remoteDesc) { diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp index f993f583..3c73c545 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp @@ -71,7 +71,7 @@ int32_t DCameraSourceController::StartCapture(std::vectorbufLen; - if (dataLen <= 0 || dataLen > (int32_t)DCAMERA_MAX_RECV_DATA_LEN || data == nullptr) { + if (dataLen <= 0 || dataLen > (int32_t)DCAMERA_MAX_RECV_DATA_LEN) { DHLOGE("DCameraSoftbusAdapter OnSourceStreamReceived dataLen: %d, sessionId: %d", dataLen, sessionId); return; } @@ -450,8 +454,12 @@ void DCameraSoftbusAdapter::OnSinkMessageReceived(int32_t sessionId, const void void DCameraSoftbusAdapter::OnSinkStreamReceived(int32_t sessionId, const StreamData *data, const StreamData *ext, const StreamFrameInfo *param) { + if (data == nullptr) { + DHLOGE("DCameraSoftbusAdapter::OnSinkStreamReceived, data is null, sessionId: %d.", sessionId); + return; + } int32_t dataLen = data->bufLen; - if (dataLen <= 0 || dataLen > (int32_t)DCAMERA_MAX_RECV_DATA_LEN || data == nullptr) { + if (dataLen <= 0 || dataLen > (int32_t)DCAMERA_MAX_RECV_DATA_LEN) { DHLOGE("DCameraSoftbusAdapter OnSinkStreamReceived dataLen: %d sessionId: %d", dataLen, sessionId); return; } diff --git a/services/data_process/BUILD.gn b/services/data_process/BUILD.gn index bd5419a5..62990b3e 100644 --- a/services/data_process/BUILD.gn +++ b/services/data_process/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp b/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp index 090aa045..0b52c49a 100644 --- a/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp +++ b/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp @@ -75,7 +75,7 @@ int32_t FpsControllerProcess::ProcessData(std::vectorFindInt64("timeUs", timeStampUs)) { - DHLOGE("Find decoder output timestamp fail."); + DHLOGE("Find decoder output timestamp failed."); return DCAMERA_BAD_TYPE; } @@ -270,7 +270,7 @@ bool FpsControllerProcess::ReduceFrameRateByUniformStrategy(int32_t incomingFrmR if (overshoot && DOUBLE_MULTIPLE * overshoot < incomingFrmRate) { /* * When the actual input frame rate is less than or equal to twice the target frame rate, - * one frame is droped every (incomingFrmRate / overshoot) frames. + * one frame is dropped every (incomingFrmRate / overshoot) frames. */ if (keepMoreThanDoubleCount_) { keepMoreThanDoubleCount_ = 0; @@ -314,7 +314,7 @@ int32_t FpsControllerProcess::FpsControllerDone(std::vectorProcessData(outputBuffers); if (err != DCAMERA_OK) { - DHLOGE("Someone node after the FpsController processes fail."); + DHLOGE("Someone node after the FpsController processes failed."); } return err; } diff --git a/services/data_process/src/pipeline_node/multimedia_codec/decode_data_process.cpp b/services/data_process/src/pipeline_node/multimedia_codec/decode_data_process.cpp index 52cb298f..4a43e08a 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/decode_data_process.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/decode_data_process.cpp @@ -53,7 +53,7 @@ int32_t DecodeDataProcess::InitNode() InitCodecEvent(); int32_t err = InitDecoder(); if (err != DCAMERA_OK) { - DHLOGE("Init video decoder fail."); + DHLOGE("Init video decoder failed."); ReleaseProcessNode(); return err; } @@ -101,7 +101,7 @@ int32_t DecodeDataProcess::InitDecoder() DHLOGD("Init video decoder."); int32_t err = InitDecoderMetadataFormat(); if (err != DCAMERA_OK) { - DHLOGE("Init video decoder metadata format fail."); + DHLOGE("Init video decoder metadata format failed."); return err; } @@ -123,7 +123,7 @@ int32_t DecodeDataProcess::InitDecoder() } retVal = SetDecoderOutputSurface(); if (retVal != DCAMERA_OK) { - DHLOGE("Set decoder output surface fail."); + DHLOGE("Set decoder output surface failed."); return retVal; } @@ -174,7 +174,7 @@ int32_t DecodeDataProcess::SetDecoderOutputSurface() decodeConsumerSurface_ = Surface::CreateSurfaceAsConsumer(); if (decodeConsumerSurface_ == nullptr) { - DHLOGE("Creat the decode consumer surface fail."); + DHLOGE("Create the decode consumer surface failed."); return DCAMERA_INIT_ERR; } decodeConsumerSurface_->SetDefaultWidthAndHeight((int32_t)sourceConfig_.GetWidth(), @@ -182,25 +182,25 @@ int32_t DecodeDataProcess::SetDecoderOutputSurface() decodeSurfaceListener_ = new DecodeSurfaceListener(decodeConsumerSurface_, shared_from_this()); if (decodeConsumerSurface_->RegisterConsumerListener(decodeSurfaceListener_) != SURFACE_ERROR_OK) { - DHLOGE("Register consumer listener fail."); + DHLOGE("Register consumer listener failed."); return DCAMERA_INIT_ERR; } sptr surfaceProducer = decodeConsumerSurface_->GetProducer(); if (surfaceProducer == nullptr) { - DHLOGE("Get the surface producer of the decode consumer surface fail."); + DHLOGE("Get the surface producer of the decode consumer surface failed."); return DCAMERA_INIT_ERR; } decodeProducerSurface_ = Surface::CreateSurfaceAsProducer(surfaceProducer); if (decodeProducerSurface_ == nullptr) { - DHLOGE("Creat the decode producer surface of the decode consumer surface fail."); + DHLOGE("Create the decode producer surface of the decode consumer surface failed."); return DCAMERA_INIT_ERR; } DHLOGD("Set the producer surface to video decoder output surface."); int32_t err = videoDecoder_->SetOutputSurface(decodeProducerSurface_); if (err != Media::MediaServiceErrCode::MSERR_OK) { - DHLOGE("Set decoder output surface fail."); + DHLOGE("Set decoder output surface failed."); return DCAMERA_INIT_ERR; } return DCAMERA_OK; @@ -277,7 +277,7 @@ int32_t DecodeDataProcess::ProcessData(std::vector>& return DCAMERA_INDEX_OVERFLOW; } if (inputBuffers[0]->Size() > MAX_YUV420_BUFFER_SIZE) { - DHLOGE("DecodeNode input buffer size %d error.", inputBuffers[0]->Size()); + DHLOGE("DecodeNode input buffer size %zu error.", inputBuffers[0]->Size()); return DCAMERA_MEMORY_OPT_ERROR; } if (!isDecoderProcess_) { @@ -285,12 +285,12 @@ int32_t DecodeDataProcess::ProcessData(std::vector>& return DCAMERA_DISABLE_PROCESS; } inputBuffersQueue_.push(inputBuffers[0]); - DHLOGD("Push inputBuffer sucess. BufSize %d, QueueSize %d.", inputBuffers[0]->Size(), inputBuffersQueue_.size()); + DHLOGD("Push inputBuf sucess. BufSize %zu, QueueSize %zu.", inputBuffers[0]->Size(), inputBuffersQueue_.size()); int32_t err = FeedDecoderInputBuffer(); if (err != DCAMERA_OK) { int32_t sleepTimeUs = 5000; std::this_thread::sleep_for(std::chrono::microseconds(sleepTimeUs)); - DHLOGD("Feed decoder input buffer fail. Try FeedDecoderInputBuffer again."); + DHLOGD("Feed decoder input buffer failed. Try FeedDecoderInputBuffer again."); std::shared_ptr reFeedInputPacket = std::make_shared(); reFeedInputPacket->SetVideoCodecType(sourceConfig_.GetVideoCodecType()); DCameraCodecEvent dCamCodecEv(*this, reFeedInputPacket, VideoCodecAction::ACTION_ONCE_AGAIN); @@ -309,7 +309,7 @@ int32_t DecodeDataProcess::FeedDecoderInputBuffer() while ((!inputBuffersQueue_.empty()) && (isDecoderProcess_)) { std::shared_ptr buffer = inputBuffersQueue_.front(); if (buffer == nullptr || availableInputIndexsQueue_.empty()) { - DHLOGE("inputBuffersQueue size %d, availableInputIndexsQueue size %d.", + DHLOGE("inputBuffersQueue size %zu, availableInputIndexsQueue size %zu.", inputBuffersQueue_.size(), availableInputIndexsQueue_.size()); return DCAMERA_BAD_VALUE; } @@ -323,7 +323,7 @@ int32_t DecodeDataProcess::FeedDecoderInputBuffer() uint32_t index = availableInputIndexsQueue_.front(); std::shared_ptr sharedMemoryInput = videoDecoder_->GetInputBuffer(index); if (sharedMemoryInput == nullptr) { - DHLOGE("Failed to obtain the input shared memory corresponding to the [%d] index.", index); + DHLOGE("Failed to obtain the input shared memory corresponding to the [%u] index.", index); return DCAMERA_BAD_VALUE; } size_t inputMemoDataSize = static_cast(sharedMemoryInput->GetSize()); @@ -333,7 +333,7 @@ int32_t DecodeDataProcess::FeedDecoderInputBuffer() return DCAMERA_MEMORY_OPT_ERROR; } int64_t timeUs = GetDecoderTimeStamp(); - DHLOGD("Decoder input buffer size %d, timeStamp %lld.", buffer->Size(), (long long)timeUs); + DHLOGD("Decoder input buffer size %zu, timeStamp %lld.", buffer->Size(), (long long)timeUs); Media::AVCodecBufferInfo bufferInfo {timeUs, static_cast(buffer->Size()), 0}; int32_t ret = videoDecoder_->QueueInputBuffer(index, bufferInfo, Media::AVCODEC_BUFFER_FLAG_NONE); @@ -420,7 +420,7 @@ void DecodeDataProcess::CopyDecodedImage(const sptr& surBuf, int6 bytesPerPixel / y2UvRatio); size_t surfaceBufSize = static_cast(surBuf->GetSize()); if (validDecodedImageAlignedSize > surfaceBufSize || validDecodedImageAlignedSize < validDecodedImageSize) { - DHLOGE("Buffer size error, validDecodedImageSize %d, validDecodedImageAlignedSize %d, surBufSize %d.", + DHLOGE("Buffer size error, validDecodedImageSize %zu, validDecodedImageAlignedSize %zu, surBufSize %zu.", validDecodedImageSize, validDecodedImageAlignedSize, surBuf->GetSize()); return; } @@ -567,7 +567,7 @@ int32_t DecodeDataProcess::DecodeDone(std::vector> o DHLOGD("Send to the next node of the decoder for processing."); int32_t err = nextDataProcess_->ProcessData(outputBuffers); if (err != DCAMERA_OK) { - DHLOGE("Someone node after the decoder processes fail."); + DHLOGE("Someone node after the decoder processes failed."); } return err; } @@ -636,7 +636,7 @@ void DecodeDataProcess::OnInputBufferAvailable(uint32_t index) DHLOGE("Video decoder available indexs queue overflow."); return; } - DHLOGD("Video decoder available indexs queue push index [%d].", index); + DHLOGD("Video decoder available indexs queue push index [%u].", index); availableInputIndexsQueue_.push(index); } @@ -667,7 +667,7 @@ void DecodeDataProcess::OnOutputBufferAvailable(uint32_t index, const Media::AVC } int32_t errRelease = videoDecoder_->ReleaseOutputBuffer(index, true); if (errRelease != Media::MediaServiceErrCode::MSERR_OK) { - DHLOGE("The video decoder output decoded data to surface fail, index : [%d].", index); + DHLOGE("The video decoder output decoded data to surface failed, index : [%u].", index); } } } diff --git a/services/data_process/src/pipeline_node/multimedia_codec/decode_video_callback.cpp b/services/data_process/src/pipeline_node/multimedia_codec/decode_video_callback.cpp index 401f3672..a4aa6883 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/decode_video_callback.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/decode_video_callback.cpp @@ -21,7 +21,7 @@ namespace OHOS { namespace DistributedHardware { void DecodeVideoCallback::OnError(Media::AVCodecErrorType errorType, int32_t errorCode) { - DHLOGE("DecodeVideoCallback : OnError. Error type: %d . Error code: %d ", errorType, errorCode); + DHLOGE("DecodeVideoCallback : OnError. Error type: %d. Error code: %d ", errorType, errorCode); std::shared_ptr targetDecoderNode = decodeVideoNode_.lock(); if (targetDecoderNode == nullptr) { DHLOGE("decodeVideoNode_ is nullptr."); diff --git a/services/data_process/src/pipeline_node/multimedia_codec/encode_data_process.cpp b/services/data_process/src/pipeline_node/multimedia_codec/encode_data_process.cpp index f5d9c92a..e7d386a7 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/encode_data_process.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/encode_data_process.cpp @@ -71,7 +71,7 @@ int32_t EncodeDataProcess::InitNode() int32_t err = InitEncoder(); if (err != DCAMERA_OK) { - DHLOGE("Init video encoder fail."); + DHLOGE("Init video encoder failed."); ReleaseProcessNode(); return err; } @@ -97,12 +97,12 @@ int32_t EncodeDataProcess::InitEncoder() DHLOGD("Init video encoder."); int32_t err = InitEncoderMetadataFormat(); if (err != DCAMERA_OK) { - DHLOGE("Init video encoder metadata format fail."); + DHLOGE("Init video encoder metadata format failed."); return err; } err = InitEncoderBitrateFormat(); if (err != DCAMERA_OK) { - DHLOGE("Init video encoder bitrate format fail."); + DHLOGE("Init video encoder bitrate format failed."); return err; } @@ -269,7 +269,7 @@ int32_t EncodeDataProcess::ProcessData(std::vector>& } int32_t err = FeedEncoderInputBuffer(inputBuffers[0]); if (err != DCAMERA_OK) { - DHLOGE("Feed encoder input Buffer fail."); + DHLOGE("Feed encoder input Buffer failed."); return err; } { @@ -375,7 +375,7 @@ int32_t EncodeDataProcess::GetEncoderOutputBuffer(uint32_t index, Media::AVCodec } std::shared_ptr sharedMemoryOutput = videoEncoder_->GetOutputBuffer(index); if (sharedMemoryOutput == nullptr) { - DHLOGE("Failed to get the output shared memory, index : %d", index); + DHLOGE("Failed to get the output shared memory, index : %u", index); return DCAMERA_BAD_OPERATE; } @@ -412,7 +412,7 @@ int32_t EncodeDataProcess::EncodeDone(std::vector> o DHLOGD("Send to the next node of the encoder for processing."); int32_t err = nextDataProcess_->ProcessData(outputBuffers); if (err != DCAMERA_OK) { - DHLOGE("Someone node after the encoder processes fail."); + DHLOGE("Someone node after the encoder processes failed."); } return err; } @@ -442,7 +442,7 @@ void EncodeDataProcess::OnError() void EncodeDataProcess::OnInputBufferAvailable(uint32_t index) { - DHLOGD("The available input buffer index : %d. No operation when using surface input.", index); + DHLOGD("The available input buffer index : %u. No operation when using surface input.", index); } void EncodeDataProcess::OnOutputFormatChanged(const Media::Format &format) @@ -465,7 +465,7 @@ void EncodeDataProcess::OnOutputBufferAvailable(uint32_t index, Media::AVCodecBu info.presentationTimeUs, info.size, info.offset, flag); int32_t err = GetEncoderOutputBuffer(index, info); if (err != DCAMERA_OK) { - DHLOGE("Get encode output Buffer fail."); + DHLOGE("Get encode output Buffer failed."); return; } { @@ -482,7 +482,7 @@ void EncodeDataProcess::OnOutputBufferAvailable(uint32_t index, Media::AVCodecBu } int32_t errRelease = videoEncoder_->ReleaseOutputBuffer(index); if (errRelease != Media::MediaServiceErrCode::MSERR_OK) { - DHLOGE("The video encoder release output buffer fail, index : [%d].", index); + DHLOGE("The video encoder release output buffer failed, index : [%u].", index); } } VideoConfigParams EncodeDataProcess::GetSourceConfig() const diff --git a/services/data_process/src/pipeline_node/multimedia_codec/encode_video_callback.cpp b/services/data_process/src/pipeline_node/multimedia_codec/encode_video_callback.cpp index 27b05a22..0c47eaa0 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/encode_video_callback.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/encode_video_callback.cpp @@ -20,7 +20,7 @@ namespace OHOS { namespace DistributedHardware { void EncodeVideoCallback::OnError(Media::AVCodecErrorType errorType, int32_t errorCode) { - DHLOGD("EncodeVideoCallback : OnError. Error type: %d . Error code: %d ", errorType, errorCode); + DHLOGD("EncodeVideoCallback : OnError. Error type: %d. Error code: %d ", errorType, errorCode); std::shared_ptr targetEncoderNode = encodeVideoNode_.lock(); if (targetEncoderNode == nullptr) { DHLOGE("encodeVideoNode_ is nullptr."); -- Gitee