From 3fc1a9cb74fd8b03d654e65d10499a593e533a48 Mon Sep 17 00:00:00 2001 From: chenmenghuan Date: Fri, 15 Apr 2022 10:46:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8B=89=E8=B5=B7HDF?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/hdi_ipc/config/host/BUILD.gn | 1 + .../config/host/dcamera_host_config.cpp | 10 ++ .../hdi_ipc/config/provider/BUILD.gn | 1 + .../provider/dcamera_provider_config.cpp | 9 ++ services/cameraservice/sourceservice/BUILD.gn | 3 + .../dcamerahdf/dcamera_hdf_operate.h | 72 ++++++++++ .../distributed_camera_source_service.cpp | 15 ++ .../dcamerahdf/dcamera_hdf_operate.cpp | 131 ++++++++++++++++++ 8 files changed, 242 insertions(+) create mode 100644 services/cameraservice/sourceservice/include/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.h create mode 100644 services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp diff --git a/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn b/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn index 7b744eb8..184b057a 100644 --- a/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn +++ b/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn @@ -75,6 +75,7 @@ ohos_shared_library("distributed_camera_host_config") { ] external_deps = [ + "device_driver_framework:libhdf_host", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_single", ] 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 61c53aae..841ba727 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 @@ -16,6 +16,7 @@ #include "dcamera_host_stub.h" #include #include +#include #include #include @@ -37,6 +38,15 @@ static int32_t DCameraServiceDispatch(struct HdfDeviceIoClient *client, int cmdI int HdfDCameraHostDriverInit(struct HdfDeviceObject *deviceObject) { + if (deviceObject == nullptr) { + HDF_LOGE("HdfDCameraHostDriverInit:: HdfDeviceObject is NULL !"); + return HDF_FAILURE; + } + + if (!HdfDeviceSetClass(deviceObject, DEVICE_CLASS_CAMERA)) { + HDF_LOGE("HdfDCameraHostDriverInit set camera class failed"); + return HDF_FAILURE; + } return HDF_SUCCESS; } diff --git a/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn b/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn index 1d80115f..b5b48721 100644 --- a/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn +++ b/camera_hdf/interfaces/hdi_ipc/config/provider/BUILD.gn @@ -70,6 +70,7 @@ ohos_shared_library("distributed_camera_provider_config") { ] external_deps = [ + "device_driver_framework:libhdf_host", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_single", ] diff --git a/camera_hdf/interfaces/hdi_ipc/config/provider/dcamera_provider_config.cpp b/camera_hdf/interfaces/hdi_ipc/config/provider/dcamera_provider_config.cpp index acd1cd70..8e49f3f2 100644 --- a/camera_hdf/interfaces/hdi_ipc/config/provider/dcamera_provider_config.cpp +++ b/camera_hdf/interfaces/hdi_ipc/config/provider/dcamera_provider_config.cpp @@ -33,6 +33,15 @@ static int32_t DCameraProviderServiceDispatch(struct HdfDeviceIoClient *client, int HdfDCameraProviderConfigInit(struct HdfDeviceObject *deviceObject) { + if (deviceObject == nullptr) { + HDF_LOGE("HdfDCameraProviderConfigInit: HdfDeviceObject is NULL !"); + return HDF_FAILURE; + } + + if (!HdfDeviceSetClass(deviceObject, DEVICE_CLASS_CAMERA)) { + HDF_LOGE("HdfDCameraProviderConfigInit set camera class failed"); + return HDF_FAILURE; + } return HDF_SUCCESS; } diff --git a/services/cameraservice/sourceservice/BUILD.gn b/services/cameraservice/sourceservice/BUILD.gn index 8f53c80d..911aeb82 100644 --- a/services/cameraservice/sourceservice/BUILD.gn +++ b/services/cameraservice/sourceservice/BUILD.gn @@ -75,6 +75,7 @@ ohos_shared_library("distributed_camera_source") { "src/distributedcameramgr/dcameradata/dcamera_stream_data_process.cpp", "src/distributedcameramgr/dcameradata/dcamera_stream_data_process_pipeline_listener.cpp", "src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp", + "src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp", "src/distributedcameramgr/dcamerahdf/dcamera_provider_callback_impl.cpp", "src/distributedcameramgr/dcamerastate/dcamera_source_capture_state.cpp", "src/distributedcameramgr/dcamerastate/dcamera_source_config_stream_state.cpp", @@ -102,6 +103,8 @@ ohos_shared_library("distributed_camera_source") { ] external_deps = [ + "device_driver_framework:libhdf_utils", + "device_driver_framework:libhdi", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", diff --git a/services/cameraservice/sourceservice/include/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.h b/services/cameraservice/sourceservice/include/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.h new file mode 100644 index 00000000..f8e1ba47 --- /dev/null +++ b/services/cameraservice/sourceservice/include/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DCAMERA_HDF_OPERATE_H +#define OHOS_DCAMERA_HDF_OPERATE_H + +#include +#include + +#include "iservstat_listener_hdi.h" +#include "idevmgr_hdi.h" +#include "iservmgr_hdi.h" +#include "single_instance.h" + +using OHOS::HDI::DeviceManager::V1_0::IDeviceManager; +using OHOS::HDI::ServiceManager::V1_0::IServiceManager; +using OHOS::HDI::ServiceManager::V1_0::IServStatListener; +using OHOS::HDI::ServiceManager::V1_0::ServiceStatus; +using OHOS::HDI::ServiceManager::V1_0::ServStatListenerStub; +const std::string CAMERA_SERVICE_NAME = "distributed_camera_service"; +const std::string PROVIDER_SERVICE_NAME = "distributed_camera_provider_service"; +constexpr uint16_t INVALID_VALUE = 0xffff; +constexpr int32_t WAIT_TIME = 500; + +namespace OHOS { +namespace DistributedHardware { +class DCameraHdfOperate { +DECLARE_SINGLE_INSTANCE(DCameraHdfOperate); + +public: + int32_t LoadDcameraHDFImpl(); + int32_t UnLoadDcameraHDFImpl(); + +private: + int32_t WaitLoadService(const uint16_t& servStatus, const std::string& servName); + +private: + OHOS::sptr devmgr_; + OHOS::sptr servMgr_; + uint16_t cameraServStatus_ = INVALID_VALUE; + uint16_t providerServStatus_ = INVALID_VALUE; + std::condition_variable hdfOperateCon_; + std::mutex hdfOperateMutex_; +}; + +class DCameraHdfServStatListener : public OHOS::HDI::ServiceManager::V1_0::ServStatListenerStub { +public: + using StatusCallback = std::function; + explicit DCameraHdfServStatListener(StatusCallback callback) : callback_(std::move(callback)) + { + } + ~DCameraHdfServStatListener() = default; + void OnReceive(const ServiceStatus& status) override; + +private: + StatusCallback callback_; +}; +} // namespace DistributedHardware +} // namespace OHOS +#endif // OHOS_DCAMERA_HDF_OPERATE_H \ No newline at end of file diff --git a/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_service.cpp b/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_service.cpp index 1119e87b..d749c646 100644 --- a/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_service.cpp +++ b/services/cameraservice/sourceservice/src/distributedcamera/distributed_camera_source_service.cpp @@ -23,6 +23,7 @@ #include "system_ability_definition.h" #include "anonymous_string.h" +#include "dcamera_hdf_operate.h" #include "dcamera_service_state_listener.h" #include "dcamera_source_service_ipc.h" #include "distributed_camera_errno.h" @@ -187,11 +188,25 @@ int32_t DistributedCameraSourceService::DCameraNotify(const std::string& devId, int32_t DistributedCameraSourceService::LoadDCameraHDF() { + DHLOGI("load hdf driver start"); + int32_t ret = DCameraHdfOperate::GetInstance().LoadDcameraHDFImpl(); + if (ret != DCAMERA_OK) { + DHLOGE("load hdf driver failed, ret %d", ret); + return ret; + } + DHLOGI("load hdf driver end"); return DCAMERA_OK; } int32_t DistributedCameraSourceService::UnLoadCameraHDF() { + DHLOGI("unload hdf driver start"); + int32_t ret = DCameraHdfOperate::GetInstance().UnLoadDcameraHDFImpl(); + if (ret != DCAMERA_OK) { + DHLOGE("unload hdf driver failed, ret %d", ret); + return ret; + } + DHLOGI("unload hdf driver end"); return DCAMERA_OK; } } // namespace DistributedHardware diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp new file mode 100644 index 00000000..7428557d --- /dev/null +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "dcamera_hdf_operate.h" + +#include + +#include "anonymous_string.h" +#include "distributed_camera_errno.h" +#include "distributed_hardware_log.h" +#include "types.h" + +namespace OHOS { +namespace DistributedHardware { +IMPLEMENT_SINGLE_INSTANCE(DCameraHdfOperate); + +void DCameraHdfServStatListener::OnReceive(const ServiceStatus& status) +{ + DHLOGI("service status on receive"); + if (status.serviceName == CAMERA_SERVICE_NAME || status.serviceName == PROVIDER_SERVICE_NAME) { + callback_(status); + } +} + +int32_t DCameraHdfOperate::LoadDcameraHDFImpl() +{ + if (cameraServStatus_ == OHOS::HDI::ServiceManager::V1_0::SERVIE_STATUS_START && + providerServStatus_ == OHOS::HDI::ServiceManager::V1_0::SERVIE_STATUS_START) { + DHLOGI("service has already start"); + return DCAMERA_OK; + } + servMgr_ = IServiceManager::Get(); + devmgr_ = IDeviceManager::Get(); + if (servMgr_ == nullptr || devmgr_ == nullptr) { + DHLOGE("get hdi service manager or device manager failed!"); + return DCAMERA_BAD_VALUE; + } + + ::OHOS::sptr listener = + new DCameraHdfServStatListener(DCameraHdfServStatListener::StatusCallback([&](const ServiceStatus& status) { + DHLOGI("LoadCameraService service status callback, serviceName: %s, status: %d", + status.serviceName.c_str(), status.status); + std::unique_lock lock(hdfOperateMutex_); + if (status.serviceName == CAMERA_SERVICE_NAME) { + cameraServStatus_ = status.status; + hdfOperateCon_.notify_one(); + } else if (status.serviceName == PROVIDER_SERVICE_NAME) { + providerServStatus_ = status.status; + hdfOperateCon_.notify_one(); + } + })); + if (servMgr_->RegisterServiceStatusListener(listener, DEVICE_CLASS_CAMERA) != 0) { + DHLOGE("RegisterServiceStatusListener failed!"); + return DCAMERA_BAD_VALUE; + } + + if (devmgr_->LoadDevice(CAMERA_SERVICE_NAME) != 0) { + DHLOGE("Load camera service failed!"); + return DCAMERA_BAD_OPERATE; + } + if (WaitLoadService(cameraServStatus_, CAMERA_SERVICE_NAME) != DCAMERA_OK) { + DHLOGE("Wait load camera service failed!"); + return DCAMERA_BAD_OPERATE; + } + + if (devmgr_->LoadDevice(PROVIDER_SERVICE_NAME) != 0) { + DHLOGE("Load provider service failed!"); + return DCAMERA_BAD_OPERATE; + } + if (WaitLoadService(providerServStatus_, PROVIDER_SERVICE_NAME) != DCAMERA_OK) { + DHLOGE("Wait load provider service failed!"); + return DCAMERA_BAD_OPERATE; + } + + if (servMgr_->UnregisterServiceStatusListener(listener) != 0) { + DHLOGE("UnregisterServiceStatusListener failed!"); + } + return DCAMERA_OK; +} + +int32_t DCameraHdfOperate::WaitLoadService(const uint16_t& servStatus, const std::string& servName) +{ + std::unique_lock lock(hdfOperateMutex_); + hdfOperateCon_.wait_for(lock, std::chrono::milliseconds(WAIT_TIME), [servStatus] { + return (servStatus == OHOS::HDI::ServiceManager::V1_0::SERVIE_STATUS_START); + }); + + if (servStatus != OHOS::HDI::ServiceManager::V1_0::SERVIE_STATUS_START) { + DHLOGE("wait load service %s failed, status %d", servName.c_str(), servStatus); + return DCAMERA_BAD_OPERATE; + } + + return DCAMERA_OK; +} + +int32_t DCameraHdfOperate::UnLoadCameraHDFImpl() +{ + DHLOGI("UnLoadCameraHDFImpl begin!"); + devmgr_ = IDeviceManager::Get(); + if (devmgr_ == nullptr) { + DHLOGE("get hdi device manager failed!"); + return DCAMERA_BAD_VALUE; + } + + int32_t ret = devmgr_->UnloadDevice(CAMERA_SERVICE_NAME); + if (ret != 0) { + DHLOGE("Unload camera service failed, ret: %d", ret); + } + ret = devmgr_->UnloadDevice(PROVIDER_SERVICE_NAME); + if (ret != 0) { + DHLOGE("Unload provider service failed, ret: %d", ret); + } + cameraServStatus_ = INVALID_VALUE; + providerServStatus_ = INVALID_VALUE; + DHLOGI("UnLoadCameraHDFImpl end!"); + return DCAMERA_OK; +} +} // namespace DistributedHardware +} // namespace OHOS \ No newline at end of file -- Gitee From 1ba6b1595639390764ce5ad13be0a8bfb7cca850 Mon Sep 17 00:00:00 2001 From: chenmenghuan Date: Fri, 15 Apr 2022 14:29:08 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8B=89=E8=B5=B7HDF?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp index 7428557d..5d43b97f 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcamerahdf/dcamera_hdf_operate.cpp @@ -105,7 +105,7 @@ int32_t DCameraHdfOperate::WaitLoadService(const uint16_t& servStatus, const std return DCAMERA_OK; } -int32_t DCameraHdfOperate::UnLoadCameraHDFImpl() +int32_t DCameraHdfOperate::UnLoadDcameraHDFImpl() { DHLOGI("UnLoadCameraHDFImpl begin!"); devmgr_ = IDeviceManager::Get(); -- Gitee From 7351997400c84df6358f69380676b61db39670ae Mon Sep 17 00:00:00 2001 From: chen0088 Date: Tue, 26 Apr 2022 19:46:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?YUV=E6=8B=8D=E7=85=A7=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/dstream_operator/dstream_operator.cpp | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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 ff6b8783..8bef3f55 100644 --- a/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp +++ b/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp @@ -601,10 +601,13 @@ void DStreamOperator::ConvertStreamInfo(std::shared_ptr &srcInfo, st dstInfo->dataspace_ = srcInfo->datasapce_; dstInfo->encodeType_ = (DCEncodeType)srcInfo->encodeType_; - if ((srcInfo->intent_ == STILL_CAPTURE) || (srcInfo->intent_ == POST_VIEW) || - (dstInfo->encodeType_ == ENCODE_TYPE_JPEG)) { + if ((srcInfo->intent_ == STILL_CAPTURE) || (srcInfo->intent_ == POST_VIEW)) { dstInfo->type_ = DCStreamType::SNAPSHOT_FRAME; - dstInfo->format_ = OHOS_CAMERA_FORMAT_JPEG; + if (dstInfo->encodeType_ == ENCODE_TYPE_JPEG) { + dstInfo->format_ = OHOS_CAMERA_FORMAT_JPEG; + } else if (dstInfo->encodeType_ == ENCODE_TYPE_NULL){ + dstInfo->format_ = OHOS_CAMERA_FORMAT_YCRCB_420_SP; + } } else { dstInfo->type_ = DCStreamType::CONTINUOUS_FRAME; dstInfo->format_ = @@ -706,7 +709,11 @@ void DStreamOperator::ChooseSuitableFormat(std::vector 0) { captureInfo->format_ = dcSupportedFormatMap_[DCSceneType::PHOTO].at(0); } else { - captureInfo->format_ = OHOS_CAMERA_FORMAT_JPEG; + if ((streamInfo.at(0))->encodeType_ == DCEncodeType::ENCODE_TYPE_JPEG) { + captureInfo->format_ = OHOS_CAMERA_FORMAT_JPEG; + } else { + captureInfo->format_ = OHOS_CAMERA_FORMAT_YCRCB_420_SP; + } } } } @@ -760,7 +767,11 @@ void DStreamOperator::ChooseSuitableEncodeType(std::vectorencodeType_ = DCEncodeType::ENCODE_TYPE_NULL; } } else { - captureInfo->encodeType_ = DCEncodeType::ENCODE_TYPE_JPEG; + if ((streamInfo.at(0))->encodeType_ == DCEncodeType::ENCODE_TYPE_JPEG) { + captureInfo->encodeType_ = DCEncodeType::ENCODE_TYPE_JPEG; + } else { + captureInfo->encodeType_ = DCEncodeType::ENCODE_TYPE_NULL; + } } } -- Gitee From 0a68b7f4b7e93a355689dec6babc874fec5bc4d1 Mon Sep 17 00:00:00 2001 From: chen0088 <10355511+chen0088@user.noreply.gitee.com> Date: Tue, 26 Apr 2022 11:58:47 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20came?= =?UTF-8?q?ra=5Fhdf/interfaces/hdi=5Fipc/config/host/BUILD.gn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/hdi_ipc/config/host/BUILD.gn | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100644 camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn diff --git a/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn b/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn deleted file mode 100644 index 184b057a..00000000 --- a/camera_hdf/interfaces/hdi_ipc/config/host/BUILD.gn +++ /dev/null @@ -1,88 +0,0 @@ -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("//drivers/adapter/uhdf2/uhdf.gni") -import( - "//foundation/distributedhardware/distributedcamera/distributedcamera.gni") - -ohos_shared_library("distributed_camera_host_config") { - include_dirs = [ - "${distributedcamera_hdf_path}/interfaces/include", - "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/host", - "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/device", - "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/operator", - "${distributedcamera_hdf_path}/hdi_impl/include/dcamera_host", - "${distributedcamera_hdf_path}/hdi_impl/include/dcamera_device", - "${distributedcamera_hdf_path}/hdi_impl/include/dstream_operator", - "${distributedcamera_hdf_path}/hdi_impl/include/utils", - "${common_path}/include/constants", - "//utils/native/base/include", - "//utils/system/safwk/native/include", - "${hdf_framework_path}/include/utils", - "${hdf_framework_path}/include/core", - "${hdf_framework_path}/include/osal", - "${hdf_uhdf_path}/include/hdi", - "${hdf_uhdf_path}/osal/include", - "${hdf_uhdf_path}/ipc/include", - "${hdf_uhdf_path}/include/host", - - #producer - "//foundation/graphic/standard/frameworks/surface/include", - "//foundation/graphic/standard/interfaces/kits/surface", - "//foundation/graphic/standard/utils/include", - "//foundation/communication/ipc/ipc/native/src/core/include", - "//foundation/multimedia/camera_standard/frameworks/native/metadata/include", - ] - - cflags = [ - "-fPIC", - "-Wall", - ] - - if (device_name == "baltimore") { - cflags += [ "-DBALTIMORE_CAMERA" ] - include_dirs += [ "${camera_hdf_path_baltimore}/camera/interfaces/include" ] - } else { - include_dirs += [ - "${camera_hdf_path}/camera/interfaces/include", - "${camera_hdf_path}/camera/interfaces/hdi_ipc", - ] - } - - sources = [ "dcamera_host_config.cpp" ] - - deps = [ - "${distributedcamera_hdf_path}/hdi_impl:distributed_camera_hdf", - "//foundation/graphic/standard/frameworks/surface:surface", - "//utils/native/base:utils", - ] - - defines = [ - "HI_LOG_ENABLE", - "DH_LOG_TAG=\"distributedcamerahdf\"", - "LOG_DOMAIN=0xD004100", - ] - - external_deps = [ - "device_driver_framework:libhdf_host", - "hiviewdfx_hilog_native:libhilog", - "ipc:ipc_single", - ] - install_images = [ chipset_base_dir ] - - cflags_cc = cflags - subsystem_name = "distributedhardware" - - part_name = "distributed_camera" -} -- Gitee