From 7bf4717def9fbe9183ac38a2315449845d9bc900 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Fri, 2 Aug 2024 14:52:08 +0800 Subject: [PATCH 01/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E8=AF=8D?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghang133 --- .../include/camera_device_ability_items.h | 18 +++++++++--------- .../include/camera_metadata_item_info.h | 12 ++++++------ camera/metadata/src/camera_metadata_info.cpp | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 0ca0aa45..ff2b6998 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -323,37 +323,37 @@ typedef enum camera_device_metadata_tag { */ OHOS_ABILITY_AVAILABLE_EXTENDED_STREAM_INFO_TYPES, /** - * ohos.ability.autoDeferedVideoEnhance [static, enum, public] + * ohos.ability.autoDeferredVideoEnhance [static, enum, public] * - * camera device property, report current camera whether support auto defered video enhance + * camera device property, report current camera whether support auto deferred video enhance * (i.e. enum: OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED ...) */ - OHOS_ABILITY_AOTU_DEFERRED_VIDEO_ENHANCE, + OHOS_ABILITY_AUTO_DEFERRED_VIDEO_ENHANCE, /** - * ohos.control.autoDeferedVideoEnhance [static, enum, public] + * ohos.control.autoDeferredVideoEnhance [static, enum, public] * - * camera device property, set current camera whether support auto defered video enhance + * camera device property, set current camera whether support auto deferred video enhance * (i.e. enum: OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED ...) */ - OHOS_CONTROL_AOTU_DEFERRED_VIDEO_ENHANCE, + OHOS_CONTROL_AUTO_DEFERRED_VIDEO_ENHANCE, /** * ohos.ability.autoCloudImageEnhance [static, int32[], public] * * camera device property, report current camera whether support auto cloud image enhance by mode * (i.e. int32[]: [mode, OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED, mode ...] ...) */ - OHOS_ABILITY_AOTU_CLOUD_IMAGE_ENHANCE, + OHOS_ABILITY_AUTO_CLOUD_IMAGE_ENHANCE, /** * ohos.control.autoCloudImageEnhance [static, enum, public] * * camera device property, set current camera whether support auto cloud image enhance * (i.e. enum: OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED ...) */ - OHOS_CONTROL_AOTU_CLOUD_IMAGE_ENHANCE, + OHOS_CONTROL_AUTO_CLOUD_IMAGE_ENHANCE, /** * ohos.ability.tripodDetection [static, int32[], public] * - * camera device property, report current camera whether supporttripod detection by mode + * camera device property, report current camera whether support tripod detection by mode * (i.e. int32[]: [mode, OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED, mode ...] ...) */ OHOS_ABILITY_TRIPOD_DETECTION, diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 7a2ae0ee..bf547e6e 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -106,13 +106,13 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"statisticsDetectSetting", META_TYPE_BYTE, -1}, [OHOS_ABILITY_AVAILABLE_EXTENDED_STREAM_INFO_TYPES - OHOS_CAMERA_PROPERTIES_START] = {"availableExtendedStreamInfoTypes", META_TYPE_INT32, -1}, - [OHOS_ABILITY_AOTU_DEFERRED_VIDEO_ENHANCE - - OHOS_CAMERA_PROPERTIES_START] = {"autoDeferedVideoEnhance", META_TYPE_BYTE, 1}, - [OHOS_CONTROL_AOTU_DEFERRED_VIDEO_ENHANCE - - OHOS_CAMERA_PROPERTIES_START] = {"controlAutoDeferedVideoEnhance", META_TYPE_BYTE, 1}, - [OHOS_ABILITY_AOTU_CLOUD_IMAGE_ENHANCE - + [OHOS_ABILITY_AUTO_DEFERRED_VIDEO_ENHANCE - + OHOS_CAMERA_PROPERTIES_START] = {"autoDeferredVideoEnhance", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_AUTO_DEFERRED_VIDEO_ENHANCE - + OHOS_CAMERA_PROPERTIES_START] = {"controlAutoDeferredVideoEnhance", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_AUTO_CLOUD_IMAGE_ENHANCE - OHOS_CAMERA_PROPERTIES_START] = {"autoCloudImageEnhance", META_TYPE_INT32, -1}, - [OHOS_CONTROL_AOTU_CLOUD_IMAGE_ENHANCE - + [OHOS_CONTROL_AUTO_CLOUD_IMAGE_ENHANCE - OHOS_CAMERA_PROPERTIES_START] = {"controlAutoCloudImageEnhance", META_TYPE_BYTE, 1}, [OHOS_ABILITY_TRIPOD_DETECTION - OHOS_CAMERA_PROPERTIES_START] = {"tripodDetection", META_TYPE_INT32, -1}, diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index c78abd0a..391b0628 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -63,10 +63,10 @@ const std::vector g_metadataTags = { OHOS_ABILITY_STATISTICS_DETECT_TYPE, OHOS_CONTROL_STATISTICS_DETECT_SETTING, OHOS_ABILITY_AVAILABLE_EXTENDED_STREAM_INFO_TYPES, - OHOS_ABILITY_AOTU_DEFERRED_VIDEO_ENHANCE, - OHOS_CONTROL_AOTU_DEFERRED_VIDEO_ENHANCE, - OHOS_ABILITY_AOTU_CLOUD_IMAGE_ENHANCE, - OHOS_CONTROL_AOTU_CLOUD_IMAGE_ENHANCE, + OHOS_ABILITY_AUTO_DEFERRED_VIDEO_ENHANCE, + OHOS_CONTROL_AUTO_DEFERRED_VIDEO_ENHANCE, + OHOS_ABILITY_AUTO_CLOUD_IMAGE_ENHANCE, + OHOS_CONTROL_AUTO_CLOUD_IMAGE_ENHANCE, OHOS_ABILITY_TRIPOD_DETECTION, OHOS_CONTROL_TRIPOD_DETECTION, OHOS_CONTROL_TRIPOD_STABLITATION, -- Gitee From 261e81002a4bd83a1aeecef9ad58efef56bf7996 Mon Sep 17 00:00:00 2001 From: qinjihong Date: Sat, 27 Jul 2024 14:51:51 +0800 Subject: [PATCH 02/71] add controlTransferRead/WritewithLength Signed-off-by: qinjihong --- usb/v1_0/IUsbInterface.idl | 2 + usb/v1_1/BUILD.gn | 5 ++- usb/v1_1/IUsbInterface.idl | 17 ++++++++ usb/v1_1/UsbTypes.idl | 86 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 usb/v1_1/UsbTypes.idl diff --git a/usb/v1_0/IUsbInterface.idl b/usb/v1_0/IUsbInterface.idl index 7f37f1ee..e3d63786 100644 --- a/usb/v1_0/IUsbInterface.idl +++ b/usb/v1_0/IUsbInterface.idl @@ -245,6 +245,8 @@ interface IUsbInterface { * * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. * @since 3.2 + * @deprecated since 5.0 + * @useinstead ohos.hdi.usb.v1_1.IUsbInterface.ControlTransferReadwithLength */ ControlTransferRead([in] struct UsbDev dev, [in] struct UsbCtrlTransfer ctrl, [out] unsigned char[] data); diff --git a/usb/v1_1/BUILD.gn b/usb/v1_1/BUILD.gn index f3193765..42bfb359 100644 --- a/usb/v1_1/BUILD.gn +++ b/usb/v1_1/BUILD.gn @@ -22,7 +22,10 @@ if (defined(ohos_lite)) { module_name = "usbd" imports = [ "ohos.hdi.usb.v1_0:usb" ] - sources = [ "IUsbInterface.idl" ] + sources = [ + "IUsbInterface.idl", + "UsbTypes.idl", + ] language = "cpp" subsystem_name = "hdf" diff --git a/usb/v1_1/IUsbInterface.idl b/usb/v1_1/IUsbInterface.idl index c68594f3..a046959b 100644 --- a/usb/v1_1/IUsbInterface.idl +++ b/usb/v1_1/IUsbInterface.idl @@ -40,6 +40,7 @@ package ohos.hdi.usb.v1_1; +import ohos.hdi.usb.v1_1.UsbTypes; import ohos.hdi.usb.v1_0.UsbTypes; import ohos.hdi.usb.v1_0.IUsbdSubscriber; import ohos.hdi.usb.v1_0.IUsbdBulkCallback; @@ -104,4 +105,20 @@ interface IUsbInterface extends ohos.hdi.usb.v1_0.IUsbInterface{ * @version 1.0 */ BulkTransferReadwithLength([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] int length, [out] unsigned char[] data); + + /* * + * @brief Performs control transfer for endpoint 0 of the device. The data transfer direction is determined by the + * request type. If the result of requestType& + * USB_ENDPOINT_DIR_MASK is USB_DIR_OUT, the endpoint is in the data writing direction; if the result + * is USB_DIR_IN, the endpoint is in the data reading direction. + * + * @param dev Indicates the USB device address. + * @param ctrl Indicates the control data packet structure. + * @param data Indicates the read data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.0 + * @version 1.0 + */ + ControlTransferReadwithLength([in] struct UsbDev dev, [in] struct UsbCtrlTransferParams ctrl, [out] unsigned char[] data); } \ No newline at end of file diff --git a/usb/v1_1/UsbTypes.idl b/usb/v1_1/UsbTypes.idl new file mode 100644 index 00000000..ea42e245 --- /dev/null +++ b/usb/v1_1/UsbTypes.idl @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 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. + */ + + /** + * @addtogroup HdiUsb + * @ + * + * @brief Provides unified APIs for usb services to access usb drivers. + * + * A usb service can obtain a usb driver object or agent and then call APIs provided by this object or agent to + * access different types of usb devices based on the usb IDs, thereby obtaining usb information, + * subscribing to or unsubscribing from usb data, enabling or disabling a usb, + * setting the usb data reporting mode, and setting usb options such as the accuracy and measurement range. + * + * @since 5.0 + */ + +/** + * @file UsbTypes.idl + * + * @brief Defines the data used by the usb module, including the usb information, + * and reported usb data. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.usb.v1_1; + +import ohos.hdi.usb.v1_0.UsbTypes; + +/** + * @brief Defines the ControlTransfer Params, which is used by {@link IUsbInterface::ControlTransferReadwithLength}. + * @since 5.0 + * @version 1.0 + */ +struct UsbCtrlTransferParams { + /** + * request type + * @since 5.0 + * @version 1.0 + */ + int requestType; + /** + * request cmd + * @since 5.0 + * @version 1.0 + */ + int requestCmd; + /** + * value + * @since 5.0 + * @version 1.0 + */ + int value; + /** + * index + * @since 5.0 + * @version 1.0 + */ + int index; + /** + * length + * @since 5.0 + * @version 1.0 + */ + int length; + /** + * timeout + * @since 5.0 + * @version 1.0 + */ + int timeout; +}; -- Gitee From f1d631f817a5976b06c16b42b4fac69ba2a946c8 Mon Sep 17 00:00:00 2001 From: wangchuanxia Date: Mon, 5 Aug 2024 15:01:05 +0800 Subject: [PATCH 03/71] to new hdi.gni Signed-off-by: wangchuanxia --- nnrt/v1_0/BUILD.gn | 2 +- nnrt/v2_0/BUILD.gn | 2 +- nnrt/v2_1/BUILD.gn | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nnrt/v1_0/BUILD.gn b/nnrt/v1_0/BUILD.gn index e68e1f3a..e125f884 100644 --- a/nnrt/v1_0/BUILD.gn +++ b/nnrt/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("nnrt") { module_name = "nnrt" sources = [ diff --git a/nnrt/v2_0/BUILD.gn b/nnrt/v2_0/BUILD.gn index 140d143d..f0b8408b 100644 --- a/nnrt/v2_0/BUILD.gn +++ b/nnrt/v2_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("nnrt") { module_name = "nnrt" sources = [ diff --git a/nnrt/v2_1/BUILD.gn b/nnrt/v2_1/BUILD.gn index 1cfe5f26..93393a93 100644 --- a/nnrt/v2_1/BUILD.gn +++ b/nnrt/v2_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("nnrt") { module_name = "nnrt" sources = [ -- Gitee From 8d18579bad6a0d89cb599568120bd36359b8e760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 5 Aug 2024 17:22:44 +0800 Subject: [PATCH 04/71] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/bundle.json | 18 ----------------- display/composer/v1_0/BUILD.gn | 35 +-------------------------------- display/composer/v1_1/BUILD.gn | 36 +--------------------------------- 3 files changed, 2 insertions(+), 87 deletions(-) diff --git a/display/bundle.json b/display/bundle.json index fc2d6147..a4153da3 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -48,9 +48,7 @@ "//drivers/interface/display/buffer/v1_2:libdisplay_buffer_hdi_impl_v1_2", "//drivers/interface/display/composer/cache_manager:libcomposer_buffer_cache", "//drivers/interface/display/composer/v1_0:display_composer_idl_target", - "//drivers/interface/display/composer/v1_0:libdisplay_composer_hdi_impl", "//drivers/interface/display/composer/v1_1:display_composer_idl_target", - "//drivers/interface/display/composer/v1_1:libdisplay_composer_hdi_impl_1.1", "//drivers/interface/display/composer/v1_2:display_composer_idl_target", "//drivers/interface/display/composer/v1_2:libdisplay_composer_hdi_impl_1.2", "//drivers/interface/display/graphic/common/v1_0:display_commontype_idl_target", @@ -202,14 +200,6 @@ "header_base": "//drivers/interface/display/composer" } }, - { - "name": "//drivers/interface/display/composer/v1_0:libdisplay_composer_hdi_impl", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/display/composer" - } - }, { "name": "//drivers/interface/display/composer/v1_1:libdisplay_composer_proxy_1.1", "header": { @@ -234,14 +224,6 @@ "header_base": "//drivers/interface/display/composer" } }, - { - "name": "//drivers/interface/display/composer/v1_1:libdisplay_composer_hdi_impl_1.1", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/display/composer" - } - }, { "name": "//drivers/interface/display/composer/v1_2:libdisplay_composer_proxy_1.2", "header": { diff --git a/display/composer/v1_0/BUILD.gn b/display/composer/v1_0/BUILD.gn index 86c0c6f1..f42f058c 100644 --- a/display/composer/v1_0/BUILD.gn +++ b/display/composer/v1_0/BUILD.gn @@ -29,37 +29,4 @@ hdi("display_composer") { language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" -} - -config("libdisplay_composer_hdi_impl_config") { - include_dirs = [ - "../", - "../hdifd_parcelable", - ] -} - -ohos_shared_library("libdisplay_composer_hdi_impl") { - sources = [ "hdi_impl/display_composer_interface.cpp" ] - - public_configs = [ ":libdisplay_composer_hdi_impl_config" ] - - deps = [ - ":libdisplay_composer_proxy_1.0", - "../hdifd_parcelable:libhdifd_parcelable", - ] - - external_deps = [ - "c_utils:utils", - "graphic_surface:buffer_handle", - "hdf_core:libhdi", - "hdf_core:libpub_utils", - "hilog:libhilog", - "hitrace:hitrace_meter", - "init:libbegetutil", - "ipc:ipc_single", - ] - - install_images = [ "system" ] - subsystem_name = "hdf" - part_name = "drivers_interface_display" -} +} \ No newline at end of file diff --git a/display/composer/v1_1/BUILD.gn b/display/composer/v1_1/BUILD.gn index 8c2bc255..eeba1ff2 100644 --- a/display/composer/v1_1/BUILD.gn +++ b/display/composer/v1_1/BUILD.gn @@ -29,38 +29,4 @@ hdi("display_composer") { language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" -} - -config("libdisplay_composer_hdi_impl_config") { - include_dirs = [ - "../", - "../hdifd_parcelable", - ] -} - -ohos_shared_library("libdisplay_composer_hdi_impl_1.1") { - sources = [ "../v1_1/hdi_impl/display_composer_interface.cpp" ] - - public_configs = [ ":libdisplay_composer_hdi_impl_config" ] - - deps = [ - ":libdisplay_composer_proxy_1.1", - "../hdifd_parcelable:libhdifd_parcelable", - "../v1_0:libdisplay_composer_proxy_1.0", - ] - - external_deps = [ - "c_utils:utils", - "graphic_surface:buffer_handle", - "hdf_core:libhdi", - "hdf_core:libpub_utils", - "hilog:libhilog", - "hitrace:hitrace_meter", - "init:libbegetutil", - "ipc:ipc_single", - ] - - install_images = [ "system" ] - subsystem_name = "hdf" - part_name = "drivers_interface_display" -} +} \ No newline at end of file -- Gitee From a5aab26007fa362bc198ef7d4b52dc738a8b8cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 6 Aug 2024 15:38:31 +0800 Subject: [PATCH 05/71] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/BUILD.gn | 2 +- display/composer/v1_1/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/BUILD.gn b/display/composer/v1_0/BUILD.gn index f42f058c..43414a19 100644 --- a/display/composer/v1_0/BUILD.gn +++ b/display/composer/v1_0/BUILD.gn @@ -29,4 +29,4 @@ hdi("display_composer") { language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" -} \ No newline at end of file +} diff --git a/display/composer/v1_1/BUILD.gn b/display/composer/v1_1/BUILD.gn index eeba1ff2..a197229b 100644 --- a/display/composer/v1_1/BUILD.gn +++ b/display/composer/v1_1/BUILD.gn @@ -29,4 +29,4 @@ hdi("display_composer") { language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" -} \ No newline at end of file +} -- Gitee From 3b5d170e9fda3675555bad3b532a34cf13a0c2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=B0?= Date: Wed, 7 Aug 2024 06:16:52 +0000 Subject: [PATCH 06/71] update camera/metadata/src/camera_metadata_info.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘丰 --- camera/metadata/src/camera_metadata_info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 391b0628..d1b98e87 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -491,7 +491,7 @@ common_metadata_header_t *CameraMetadata::FillCameraMetadata(common_metadata_hea metadataHeader->item_capacity) - reinterpret_cast(metadataHeader); metadataHeader->data_start = AlignTo(dataUnaligned, DATA_ALIGNMENT); - METADATA_INFO_LOG("MetadataHeader ItemCapacity Size = %{public}u, DataCapacity Size = %{public}u", + METADATA_DEBUG_LOG("MetadataHeader ItemCapacity Size = %{public}u, DataCapacity Size = %{public}u", metadataHeader->item_capacity, metadataHeader->data_capacity); METADATA_DEBUG_LOG("FillCameraMetadata end"); return metadataHeader; -- Gitee From 58cf7a57fd9b9643223999cfc917d76c1fc6a963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Thu, 8 Aug 2024 02:46:17 +0000 Subject: [PATCH 07/71] update display/composer/cache_manager/device_cache.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- display/composer/cache_manager/device_cache.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/display/composer/cache_manager/device_cache.cpp b/display/composer/cache_manager/device_cache.cpp index b339b946..c4739ccf 100644 --- a/display/composer/cache_manager/device_cache.cpp +++ b/display/composer/cache_manager/device_cache.cpp @@ -86,11 +86,20 @@ int32_t DeviceCache::AddLayerCache(uint32_t id, uint32_t bufferCacheCount) DISPLAY_CHK_RETURN(layer == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: Create cache failed", __func__)); int32_t retResult = layer->SetBufferCacheMaxCount(bufferCacheCount); - DISPLAY_CHK_RETURN(retResult != HDF_SUCCESS, retResult, - HDF_LOGE("%{public}s: set buffer cache max count failed", __func__)); + if (retResult != HDF_SUCCESS) { + delete layer; + layer = nullptr; + HDF_LOGE("%{public}s: set buffer cache max count failed", __func__); + return retResult; + } bool ret = layerCaches_->InsertCache(id, layer); - DISPLAY_CHK_RETURN(ret != true, HDF_FAILURE, HDF_LOGE("%{public}s: insert cache failed", __func__)); + if (ret != true) { + delete layer; + layer = nullptr; + HDF_LOGE("%{public}s: insert cache failed", __func__) + return HDF_FAILURE; + } return HDF_SUCCESS; } -- Gitee From a8f6a663f054c441b7b691d090f52a401ebb6839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Thu, 8 Aug 2024 04:54:25 +0000 Subject: [PATCH 08/71] update display/composer/cache_manager/device_cache.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- display/composer/cache_manager/device_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/device_cache.cpp b/display/composer/cache_manager/device_cache.cpp index c4739ccf..bcd8b945 100644 --- a/display/composer/cache_manager/device_cache.cpp +++ b/display/composer/cache_manager/device_cache.cpp @@ -97,7 +97,7 @@ int32_t DeviceCache::AddLayerCache(uint32_t id, uint32_t bufferCacheCount) if (ret != true) { delete layer; layer = nullptr; - HDF_LOGE("%{public}s: insert cache failed", __func__) + HDF_LOGE("%{public}s: insert cache failed", __func__); return HDF_FAILURE; } return HDF_SUCCESS; -- Gitee From a0b6be60297db22550510d35c14cfb0310c2e10c Mon Sep 17 00:00:00 2001 From: yanguofeng Date: Thu, 8 Aug 2024 14:48:17 +0800 Subject: [PATCH 09/71] feat:hdi.gni path move adapter Signed-off-by: yanguofeng --- activity_recognition/v1_0/BUILD.gn | 2 +- location/lpfence/cellbatching/v1_0/BUILD.gn | 2 +- location/lpfence/cellfence/v1_0/BUILD.gn | 2 +- location/lpfence/geofence/v1_0/BUILD.gn | 2 +- location/lpfence/safe_location/v1_0/BUILD.gn | 2 +- location/lpfence/wififence/v1_0/BUILD.gn | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activity_recognition/v1_0/BUILD.gn b/activity_recognition/v1_0/BUILD.gn index 224e521c..bf076fbf 100644 --- a/activity_recognition/v1_0/BUILD.gn +++ b/activity_recognition/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("ar") { module_name = "ar_service" diff --git a/location/lpfence/cellbatching/v1_0/BUILD.gn b/location/lpfence/cellbatching/v1_0/BUILD.gn index 9c41468a..a7f07b9c 100644 --- a/location/lpfence/cellbatching/v1_0/BUILD.gn +++ b/location/lpfence/cellbatching/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("lpfence_cellbatching") { module_name = "lpfence_cellbatching" diff --git a/location/lpfence/cellfence/v1_0/BUILD.gn b/location/lpfence/cellfence/v1_0/BUILD.gn index 18f0a63b..0dd6f02d 100644 --- a/location/lpfence/cellfence/v1_0/BUILD.gn +++ b/location/lpfence/cellfence/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("lpfence_cellfence") { module_name = "lpfence_cellfence" diff --git a/location/lpfence/geofence/v1_0/BUILD.gn b/location/lpfence/geofence/v1_0/BUILD.gn index 7bbf9e19..ac6147a7 100644 --- a/location/lpfence/geofence/v1_0/BUILD.gn +++ b/location/lpfence/geofence/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("lpfence_geofence") { module_name = "lpfence_geofence" diff --git a/location/lpfence/safe_location/v1_0/BUILD.gn b/location/lpfence/safe_location/v1_0/BUILD.gn index e38dbe2d..48be23f7 100644 --- a/location/lpfence/safe_location/v1_0/BUILD.gn +++ b/location/lpfence/safe_location/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("lpfence_safe_location") { module_name = "lpfence_safe_location" diff --git a/location/lpfence/wififence/v1_0/BUILD.gn b/location/lpfence/wififence/v1_0/BUILD.gn index 45ff950a..ff292d04 100644 --- a/location/lpfence/wififence/v1_0/BUILD.gn +++ b/location/lpfence/wififence/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("lpfence_wififence") { module_name = "lpfence_wififence" -- Gitee From 3c4a1cdb0351ded5f0acf50da94487be1ca80cb5 Mon Sep 17 00:00:00 2001 From: JillFred <14623865@qq.com> Date: Thu, 8 Aug 2024 15:34:24 +0800 Subject: [PATCH 10/71] add interface for heif encode Signed-off-by: JillFred <14623865@qq.com> --- codec/bundle.json | 8 +- codec/image/v2_0/BUILD.gn | 33 +++ codec/image/v2_0/CodecImageType.idl | 385 ++++++++++++++++++++++++++++ codec/image/v2_0/ICodecImage.idl | 184 +++++++++++++ 4 files changed, 606 insertions(+), 4 deletions(-) create mode 100644 codec/image/v2_0/BUILD.gn create mode 100644 codec/image/v2_0/CodecImageType.idl create mode 100644 codec/image/v2_0/ICodecImage.idl diff --git a/codec/bundle.json b/codec/bundle.json index 7590f673..5a09c82a 100644 --- a/codec/bundle.json +++ b/codec/bundle.json @@ -28,7 +28,7 @@ "build": { "sub_component": [ "//drivers/interface/codec/v3_0:codec_idl_target", - "//drivers/interface/codec/image/v1_0:image_idl_target" + "//drivers/interface/codec/image/v2_0:image_idl_target" ], "test": [ ], @@ -58,7 +58,7 @@ } }, { - "name": "//drivers/interface/codec/image/v1_0:libimage_proxy_1.0", + "name": "//drivers/interface/codec/image/v2_0:libimage_proxy_2.0", "header": { "header_files": [ ], @@ -66,7 +66,7 @@ } }, { - "name": "//drivers/interface/codec/image/v1_0:image_idl_headers", + "name": "//drivers/interface/codec/image/v2_0:image_idl_headers", "header": { "header_files": [ ], @@ -74,7 +74,7 @@ } }, { - "name": "//drivers/interface/codec/image/v1_0:libimage_stub_1.0", + "name": "//drivers/interface/codec/image/v2_0:libimage_stub_2.0", "header": { "header_files": [ ], diff --git a/codec/image/v2_0/BUILD.gn b/codec/image/v2_0/BUILD.gn new file mode 100644 index 00000000..322de27b --- /dev/null +++ b/codec/image/v2_0/BUILD.gn @@ -0,0 +1,33 @@ +# Copyright (c) 2024 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("../../../../hdf_core/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libimage_proxy_2.0") { + deps = [] + public_configs = [] + } +} else { + hdi("image") { + module_name = "codec_service" + + sources = [ + "CodecImageType.idl", + "ICodecImage.idl", + ] + language = "cpp" + innerapi_tags = [ "platformsdk" ] + subsystem_name = "hdf" + part_name = "drivers_interface_codec" + } +} diff --git a/codec/image/v2_0/CodecImageType.idl b/codec/image/v2_0/CodecImageType.idl new file mode 100644 index 00000000..7412a3f6 --- /dev/null +++ b/codec/image/v2_0/CodecImageType.idl @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2024 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. + */ + + /** + * @addtogroup Codec + * @{ + * + * @brief Defines APIs of the image Codec module. + * + * The Codec module provides APIs for image codec, setting codec parameters, + * and controlling and transferring image data. + * + * @since 4.0 + * @version 2.0 + */ + +/** + * @file CodecImageTypes.idl + * + * @brief Defines custom data types used in the image Codec module APIs, + * including the codec image parameters, types and buffers. + * + * + * @since 4.0 + * @version 2.0 + */ + +/** + * @brief Defines the path for the package of the image Codec module APIs. + * + * @since 4.0 + * @version 2.0 + */ +package ohos.hdi.codec.image.v2_0; + +/** + * @brief Defines the image region information. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecImageRegion { + unsigned int left; /**< Distance to the left of the image. */ + unsigned int right; /**< Distance to the right of the image. */ + unsigned int top; /**< Distance to the top of the image. */ + unsigned int bottom; /**< Distance to the bottom of the image. */ + unsigned int flag; /**< True is use regionInfo. */ + unsigned int rsv; /**< Reserved for extend. */ +}; + +/** + * @brief Enumerates the types of image that can be encoded or decoded + * + * @since 4.0 + * @version 1.0 + */ +enum CodecImageRole { + CODEC_IMAGE_JPEG = 0, /**< Jpeg image. */ + CODEC_IMAGE_HEIF, /**< Heif image. */ + CODEC_IMAGE_INVALID, /**< Invalid image type. */ +}; + +/** + * @brief Defines the codec image buffer information. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecImageBuffer { + unsigned int id; /**< Buffer ID. */ + unsigned int size; /**< Size of buffer. */ + NativeBuffer buffer; /**< Buffer handle used for encoding or decoding. For details, + see {@link NativeBuffer}. */ + FileDescriptor fenceFd; /**< Fence file descriptor. */ + CodecImageRole bufferRole; /**< Image buffer role, see {@link CodecImageRole}. */ +}; + +/** + * @brief Defines the image codec type. + * + * @since 4.0 + * @version 1.0 + */ +enum CodecImageType { + CODEC_IMAGE_TYPE_DECODER = 0, /**< Image decoder. */ + CODEC_IMAGE_TYPE_ENCODER, /**< Image encoder. */ + CODEC_IMAGE_TYPE_INVALID, /**< Invalid type. */ +}; + +/** + * @brief Defines the image codec capabilities. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecImageCapability { + String name; /**< Name of the image codec. */ + enum CodecImageRole role; /**< Role of the image codec. */ + enum CodecImageType type; /**< Type of the image codec. */ + unsigned int widthAlignment; /**< Alignment value of the width. */ + unsigned int heightAlignment; /**< Alignment value of the height. */ + unsigned int maxSample; /**< Maximum sample. */ + unsigned int maxWidth; /**< Maximum width. */ + unsigned int maxHeight; /**< Maximum height. */ + unsigned int minWidth; /**< Minimum width. */ + unsigned int minHeight; /**< Minimum height. */ + unsigned int maxInst; /**< Maximum instance. */ + unsigned int[] supportPixFmts; /**< Supported PixFormat. For details, see {@link PixFormat}. */ + boolean isSoftwareCodec; /**< Whether it is a software codec. */ +}; + +/** + * @brief Defines the jpeg image quant table information. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecJpegQuantTable { + unsigned short[] quantVal; /**< Quant table value. */ + boolean tableFlag; /**< True when quant has been output. */ +}; + +/** + * @brief Defines the jpeg image huff table information. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecJpegHuffTable { + unsigned char[] bits; /**< Bits value, bits[0] is unused. */ + unsigned char[] huffVal; /**< Huff table value. */ + boolean tableFlag; /**< True when huff table valid. */ +}; + +/** + * @brief Defines the jpeg image huff table information. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecJpegCompInfo { + unsigned int componentId; /**< CompInfo index in JpegDecInfo. */ + unsigned int componentIndex; /**< CompInfo index in JpegDecInfo. */ + unsigned int hSampFactor; /**< Horizontal sample factor. */ + unsigned int vSampFactor; /**< vertical sample factor. */ + unsigned int quantTableNo; /**< Quant table value. */ + unsigned int dcTableNo; /**< Dc table index. */ + unsigned int acTableNo; /**< Ac table index. */ + boolean infoFlag; +}; + +/** + * @brief Defines the jpeg image decode information. + * + * @since 4.0 + * @version 1.0 + */ +struct CodecJpegDecInfo { + unsigned int imageWidth; /**< Image width. */ + unsigned int imageHeight; /**< Image height. */ + unsigned int dataPrecision; /**< Bit height. */ + unsigned int numComponents; /**< Num of color component in jpeg image. */ + unsigned int restartInterval; /**< MCUs per restart. */ + boolean arithCode; /**< False is Huff coding, + true is arithmetic coding. */ + boolean progressiveMode; /**< If SOF specifiy progressive mode. */ + struct CodecJpegCompInfo[] compInfo; /**< Jpeg compress information. */ + struct CodecJpegHuffTable[] dcHuffTbl; /**< Dc huffman table information. */ + struct CodecJpegHuffTable[] acHuffTbl; /**< Ac huffman table information. */ + struct CodecJpegQuantTable[] quantTbl; /**< Quant table information. */ + struct CodecImageRegion region; /**< Image region information. */ + unsigned int sampleSize; /**< Image sample size. */ + unsigned int compressPos; /**< The offset of Jpeg compressed data. */ +}; + +/** + * @brief Defines the supported property type for heif image encode. + * + * @since 5.0 + * @version 2.0 + */ +enum PropertyType { + MIRROR_INFO, /**< True means the image is displayed as a vertical mirror, + false means the image is displayed as a horizontal mirror. */ + ROTATE_INFO, /**< Determines how many degrees the image is rotated to display, + valid value is 0/90/180/270. */ + COLOR_TYPE, /**< Image color type. */ + COLOR_INFO, /**< Detailed color info when color type is set to NCLX. */ + ICC_PROFILE, /**< Detailed color info when color type is set to RICC or PROF. */ + CONTENT_LIGHT_LEVEL, /**< Clli info for HDR. */ + MASTER_DISPLAY_COLOR_VOLUME, /**< Mdcv info for HDR. */ + TONE_MAP_METADATA, /**< Tone map meta data for HDR. */ + USER_DATA_DO_COMPRESS, /**< Determines whether user data is compressed. */ + IT35_INFO, /**< It35 info for HDR. */ +}; + +/** + * @brief Defines the color type of the output heif image. + * + * @since 5.0 + * @version 2.0 + */ +enum ColorType { + NCLX, /**< NCLX color type. */ + RICC, /**< RICC color type. */ + PROF, /**< PROF color type. */ +}; + +/** + * @brief Defines the color info when ColorType is set to NCLX. + * + * @since 5.0 + * @version 2.0 + */ +struct ColourInfo { + unsigned short colourPrimaries; /**< Gamut triangle, and white point coordinates. */ + unsigned short transferCharacteristics; /**< Transfer function/OETF. */ + unsigned short matrixCoefficients; /**< Specifies the matrix coefficient for YUV-RGB conversion. */ + boolean fullRangeFlag; /**< Specifies the YUV value range during the conversion + between YUV and RGB. */ +}; + +/** + * @brief Defines details for Clli info of HDR heif image. + * + * @since 5.0 + * @version 2.0 + */ +struct ContentLightLevel { + unsigned short maxContentLightLevel; /**< Max value of content light level. */ + unsigned short maxPicAverageLightLevel; /**< Max value of average light level. */ +}; + +/** + * @brief Defines details for Mdcv info of HDR heif image. + * + * @since 5.0 + * @version 2.0 + */ +struct MasteringDisplayColourVolume { + unsigned short displayPrimariesRX; /**< Display primaries for X-plane of red. */ + unsigned short displayPrimariesRY; /**< Display primaries for Y-plane of red. */ + unsigned short displayPrimariesGX; /**< Display primaries for X-plane of green. */ + unsigned short displayPrimariesGY; /**< Display primaries for Y-plane of green. */ + unsigned short displayPrimariesBX; /**< Display primaries for X-plane of blue. */ + unsigned short displayPrimariesBY; /**< Display primaries for Y-plane of blue. */ + unsigned short whitePointX; /**< White point for X-plane. */ + unsigned short whitePointY; /**< White point for Y-plane. */ + unsigned int maxDisplayMasteringLuminance; /**< Max display mastering luminance. */ + unsigned int minDisplayMasteringLuminance; /**< Min display mastering luminance. */ +}; + +/** + * @brief Defines a struct to describe a signed rational number. + * + * @since 5.0 + * @version 2.0 + */ +struct SignedRational { + int numerator; /**< Numerator of a signed rational number. */ + unsigned int denominator; /**< Denominator of a signed rational number. */ +}; + +/** + * @brief Defines a struct to describe an unsigned rational number. + * + * @since 5.0 + * @version 2.0 + */ +struct UnsignedRational { + unsigned int numerator; /**< Numerator of an unsigned rational number. */ + unsigned int denominator; /**< Denominator of an unsigned rational number. */ +}; + +/** + * @brief Defines details for gain map channel info of HDR heif image. + * + * @since 5.0 + * @version 2.0 + */ +struct ToneMapChannel { + SignedRational gainMapMin; /**< Per-component min gain map values. */ + SignedRational gainMapMax; /**< Per-component max gain map values. */ + UnsignedRational gamma; /**< Per-component gamma values. */ + SignedRational baseOffset; /**< Baseline image offset. */ + SignedRational alternateOffset; /**< Alternate image offset. */ +}; + +/** + * @brief Defines details for gain map metadata of HDR heif image. + * + * @since 5.0 + * @version 2.0 + */ +struct ToneMapMetadata { + unsigned short channelCnt; /**< The number of channels, it is either 1 or 3. */ + boolean useBaseColorSpace; /**< Determine whether to use base color space. */ + UnsignedRational baseHdrHeadroom; /**< Value of base hdr headroom. */ + UnsignedRational alternateHdrHeadroom; /**< Value of alternate hdr headroom. */ + ToneMapChannel channels1; /**< Detail info of channel 1. */ + ToneMapChannel channels2; /**< Detail info of channel 2. */ + ToneMapChannel channels3; /**< Detail info of channel 3. */ +}; + +/** + * @brief Defines buffer that store non-pixel data for heif encode. + * + * @since 5.0 + * @version 2.0 + */ +struct SharedBuffer { + FileDescriptor fd; /**< Fd related to the buffer. */ + unsigned int filledLen; /**< Used size of the buffer. */ + unsigned int capacity; /**< Total size of the buffer. */ +}; + +/** + * @brief Defines how to store pixel data for heif encode. + * + * @since 5.0 + * @version 2.0 + */ +struct ImageItem { + String itemName; /**< Item name. */ + unsigned int id; /**< Item id. */ + NativeBuffer pixelBuffer; /**< Buffer to store pixel data. */ + boolean isPrimary; /**< Primary image flag. */ + boolean isHidden; /**< Determines whether to display this image. */ + String compressType; /**< Determines how to compress the pixel data. */ + unsigned int quality; /**< Compress quality, value range: [0, 100]. */ + unsigned char[] liteProperties; /**< Store smaller propety data, (enum + struct)... */ + SharedBuffer sharedProperties; /**< Store larger data, (enum + buffersize + buffer)... */ +}; + +/** + * @brief Defines how to store meta data for heif encode. + * + * @since 5.0 + * @version 2.0 + */ +struct MetaItem { + String itemName; /**< Name of the item. */ + unsigned int id; /**< Id of the item. */ + SharedBuffer data; /**< Data of the item. */ + unsigned char[] properties; /**< Extra properties of the item. */ +}; + +/** + * @brief Defines reference type for heif encode. + * + * @since 5.0 + * @version 2.0 + */ +enum ReferenceType { + DIMG, /**< Describe relation between base map and gain map for HDR. */ + THMB, /**< Describe relation between primary image and thumbnail. */ + AUXL, /**< Describe relation between primary image and auxilary image. */ + CDSC, /**< Describe relation between primary image and meta data. */ +}; + +/** + * @brief Defines the relation between different items for heif encode. + * + * @since 5.0 + * @version 2.0 + */ +struct ItemRef { + ReferenceType type; /**< Relation between two items. */ + String auxType; /**< Extra info for auxilary image, only valid when type is set to AUXL. */ + unsigned int from; /**< One party to a relation. */ + unsigned int[] to; /**< The other party to a relation. */ +}; + diff --git a/codec/image/v2_0/ICodecImage.idl b/codec/image/v2_0/ICodecImage.idl new file mode 100644 index 00000000..2a9161f8 --- /dev/null +++ b/codec/image/v2_0/ICodecImage.idl @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2024 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. + */ + + /** + * @addtogroup Codec + * @{ + * + * @brief Defines APIs of the image Codec module. + * + * The Codec module provides APIs for image codec, setting codec parameters, + * and controlling and transferring image data. + * + * @since 4.0 + * @version 2.0 + */ + +/** + * @file ICodecImage.idl + * + * @brief Declares the APIs for image codec. + * + *You can use these APIs to allocate input buffer, and decode image + * + * @since 4.0 + * @version 2.0 + */ + +/** + * @brief Defines the path for the package of the image Codec module APIs. + * + * @since 4.0 + * @version 2.0 + */ +package ohos.hdi.codec.image.v2_0; + +import ohos.hdi.codec.image.v2_0.CodecImageType; + +interface ICodecImage { + + /** + * @brief Obtains image codec capabilities. + * + * You can use this API to obtain the encoding and decoding capabilities provided by the image Codec module. + * For details, see {@link CodecImageCapability}. + * + * @param capList Indicates the image codec capabilities {@link CodecImageCapability} obtained. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_FAILURE if the execution fails. + * + * @since 4.0 + * @version 1.0 + */ + GetImageCapability([out] struct CodecImageCapability[] capList); + + /** + * @brief Image codec module init. + * + * You can use this API to init the Image Codec module. + * + * @param role Indicates the image codec role {@link CodecImageRole} obtained. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_FAILURE if the execution fails. + * @return Returns other values if the underlying layer returns a failure. For details about the error codes, + * see HDF_STATUS defined by HDF. + * + * @since 4.0 + * @version 1.0 + */ + Init([in] enum CodecImageRole role); + + /** + * @brief Image codec module deinit. + * + * You can use this API to deinit the Image Codec module. + * + * @param role Indicates the image codec role {@link CodecImageRole} obtained. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_FAILURE if the execution fails. + * @return Returns other values if the underlying layer returns a failure. For details about the error codes, + * see HDF_STATUS defined by HDF. + * + * @since 4.0 + * @version 1.0 + */ + DeInit([in] enum CodecImageRole role); + + /** + * @brief Start jpeg image decode. + * + * You can use this API to start jpeg image decode. + * + * @param inBuffer Indicates input buffer of the jpeg image decode {@link CodecImageBuffer} obtained. + * @param outBuffer Indicates output buffer of the jpeg image decode {@link CodecImageBuffer} obtained. + * @param decInfo Indicates decode information of the image decode {@link JpegDecInfo} obtained. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_ERR_INVALID_PARAM if the operation fails due to invalid parameters. + * @return Returns HDF_FAILURE if the execution fails. + * @return Returns other values if the underlying layer returns a failure. For details about the error codes, + * see HDF_STATUS defined by HDF. + * + * @since 4.0 + * @version 1.0 + */ + DoJpegDecode([in] struct CodecImageBuffer inBuffer, [in] struct CodecImageBuffer outBuffer, + [in] struct CodecJpegDecInfo decInfo); + + /** + * @brief Allocate input buffer. + * + * You can use this API to allocate input buffer for image codec. + * After input buffer is duplicated to proxy, stub will automatically free its own reference to input buffer. + * + * @param inBuffer Indicates input buffer of the image codec {@link CodecImageBuffer} obtained. + * @param size Indicates size of input buffer {@link CodecImageBuffer} obtained. + * @param role Indicates image codec role of input buffer {@link CodecImageRole} obtained. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_ERR_INVALID_PARAM if the operation fails due to invalid parameters. + * @return Returns HDF_FAILURE if the execution fails. + * @return Returns other values if the underlying layer returns a failure. For details about the error codes, + * see HDF_STATUS defined by HDF. + * + * @since 4.0 + * @version 1.0 + */ + AllocateInBuffer([out] struct CodecImageBuffer inBuffer, [in] unsigned int size, [in] CodecImageRole role); + + /** + * @brief Free input buffer. + * + * You can use this API to free input buffer for image decode. + * + * @param buffer Indicates input buffer of the image codec {@link CodecImageBuffer} obtained. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_FAILURE if the execution fails. + * @return Returns other values if the underlying layer returns a failure. For details about the error codes, + * see HDF_STATUS defined by HDF. + * + * @since 4.0 + * @version 1.0 + * @deprecated + * @stub no longer hold reference to input buffer, no need to free. + */ + FreeInBuffer([in] struct CodecImageBuffer inBuffer); + + /** + * @brief Start heif image encode. + * + * You can use this API to start heif image encode. + * + * @param inputImgs Indicates input images for the heif image encode {@link ImageItem} obtained. + * @param inputMetas Indicates encode parameters of the image encode {@link MetaItem} obtained. + * @param refs Indicates reference relations of the heif image encode {@link ItemRef} obtained. + * @param output Indicates output buffer of the heif image encode {@link SharedBuffer} obtained. + * @param filledLen Indicates filled length of output buffer if heif image encode succeed. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * @return Returns HDF_FAILURE if the execution fails. + * @return Returns other values if the underlying layer returns a failure. For details about the error codes, + * see HDF_STATUS defined by HDF. + * + * @since 5.0 + * @version 2.0 + */ + DoHeifEncode([in] ImageItem[] inputImgs, [in] MetaItem[] inputMetas, + [in] ItemRef[] refs, [in] SharedBuffer output, [out] unsigned int filledLen); +} -- Gitee From aa89ec009a49c2dcaff8b1690571e49a524c8856 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Thu, 8 Aug 2024 20:56:36 +0800 Subject: [PATCH 11/71] fix code Signed-off-by: liuziwei Change-Id: If029d51bbedef4f2e39eff1caa293c7717263e59 --- pin_auth/v2_0/IExecutorCallback.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pin_auth/v2_0/IExecutorCallback.idl b/pin_auth/v2_0/IExecutorCallback.idl index 93a8a21d..6379e813 100644 --- a/pin_auth/v2_0/IExecutorCallback.idl +++ b/pin_auth/v2_0/IExecutorCallback.idl @@ -89,7 +89,7 @@ import ohos.hdi.pin_auth.v2_0.PinAuthTypes; * @return Returns a non-zero value if the operation fails. * * @since 3.2 - * @version 2.0 + * @version 3.0 */ OnGetData([in] unsigned char[] algoParameter, [in] unsigned long authSubType, [in] unsigned int algoVersion, [in] unsigned char[] challenge, [in] String complexityReg); -- Gitee From b17ab26a0939f4933c1c0b8274b1194673c5dd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 9 Aug 2024 16:10:12 +0800 Subject: [PATCH 12/71] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/bundle.json | 9 +++++++++ display/composer/v1_1/BUILD.gn | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/display/bundle.json b/display/bundle.json index a4153da3..50d71368 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -49,6 +49,7 @@ "//drivers/interface/display/composer/cache_manager:libcomposer_buffer_cache", "//drivers/interface/display/composer/v1_0:display_composer_idl_target", "//drivers/interface/display/composer/v1_1:display_composer_idl_target", + "//drivers/interface/display/composer/v1_1:libdisplay_composer_hdi_impl_1.1", "//drivers/interface/display/composer/v1_2:display_composer_idl_target", "//drivers/interface/display/composer/v1_2:libdisplay_composer_hdi_impl_1.2", "//drivers/interface/display/graphic/common/v1_0:display_commontype_idl_target", @@ -224,6 +225,14 @@ "header_base": "//drivers/interface/display/composer" } }, + { + "name": "//drivers/interface/display/composer/v1_1:libdisplay_composer_hdi_impl_1.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/composer" + } + }, { "name": "//drivers/interface/display/composer/v1_2:libdisplay_composer_proxy_1.2", "header": { diff --git a/display/composer/v1_1/BUILD.gn b/display/composer/v1_1/BUILD.gn index a197229b..8c2bc255 100644 --- a/display/composer/v1_1/BUILD.gn +++ b/display/composer/v1_1/BUILD.gn @@ -30,3 +30,37 @@ hdi("display_composer") { subsystem_name = "hdf" part_name = "drivers_interface_display" } + +config("libdisplay_composer_hdi_impl_config") { + include_dirs = [ + "../", + "../hdifd_parcelable", + ] +} + +ohos_shared_library("libdisplay_composer_hdi_impl_1.1") { + sources = [ "../v1_1/hdi_impl/display_composer_interface.cpp" ] + + public_configs = [ ":libdisplay_composer_hdi_impl_config" ] + + deps = [ + ":libdisplay_composer_proxy_1.1", + "../hdifd_parcelable:libhdifd_parcelable", + "../v1_0:libdisplay_composer_proxy_1.0", + ] + + external_deps = [ + "c_utils:utils", + "graphic_surface:buffer_handle", + "hdf_core:libhdi", + "hdf_core:libpub_utils", + "hilog:libhilog", + "hitrace:hitrace_meter", + "init:libbegetutil", + "ipc:ipc_single", + ] + + install_images = [ "system" ] + subsystem_name = "hdf" + part_name = "drivers_interface_display" +} -- Gitee From 39e6ac39ac036ae1e41c52fe26b5c3581772cce7 Mon Sep 17 00:00:00 2001 From: hwyml Date: Wed, 17 Jul 2024 10:58:10 +0800 Subject: [PATCH 13/71] add clear halt Signed-off-by: hwyml Change-Id: I78ce7bdc4443a6c476ef882137eaa487082852d0 --- usb/v1_1/IUsbInterface.idl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/usb/v1_1/IUsbInterface.idl b/usb/v1_1/IUsbInterface.idl index a046959b..3d32cd89 100644 --- a/usb/v1_1/IUsbInterface.idl +++ b/usb/v1_1/IUsbInterface.idl @@ -106,6 +106,18 @@ interface IUsbInterface extends ohos.hdi.usb.v1_0.IUsbInterface{ */ BulkTransferReadwithLength([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] int length, [out] unsigned char[] data); + /* * + * @brief Clear the halt status for an endpoint. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.0 + * @version 1.0 + */ + ClearHalt([in] struct UsbDev dev, [in] struct UsbPipe pipe); + /* * * @brief Performs control transfer for endpoint 0 of the device. The data transfer direction is determined by the * request type. If the result of requestType& -- Gitee From c57af89cd26ecc21dd7b68be6d1927bf2446f17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Fri, 9 Aug 2024 09:36:48 +0000 Subject: [PATCH 14/71] add ResetDevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- usb/v1_1/IUsbInterface.idl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/usb/v1_1/IUsbInterface.idl b/usb/v1_1/IUsbInterface.idl index a046959b..a4fe310d 100644 --- a/usb/v1_1/IUsbInterface.idl +++ b/usb/v1_1/IUsbInterface.idl @@ -121,4 +121,15 @@ interface IUsbInterface extends ohos.hdi.usb.v1_0.IUsbInterface{ * @version 1.0 */ ControlTransferReadwithLength([in] struct UsbDev dev, [in] struct UsbCtrlTransferParams ctrl, [out] unsigned char[] data); + + /* * + * @brief Reset device. + * + * @param dev Indicates the USB device address. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.0 + * @version 1.0 + */ + ResetDevice([in] struct UsbDev dev); } \ No newline at end of file -- Gitee From a47e37888367466142d7a84d0fe99347655c650d Mon Sep 17 00:00:00 2001 From: w30042960 Date: Sat, 10 Aug 2024 10:58:36 +0800 Subject: [PATCH 15/71] modfiy gn Signed-off-by: w30042960 --- distributed_audio/audio/v1_0/BUILD.gn | 2 +- distributed_audio/audioext/v1_0/BUILD.gn | 2 +- distributed_audio/audioext/v2_0/BUILD.gn | 2 +- distributed_camera/v1_0/BUILD.gn | 2 +- distributed_camera/v1_1/BUILD.gn | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/distributed_audio/audio/v1_0/BUILD.gn b/distributed_audio/audio/v1_0/BUILD.gn index aa170b3e..240a73b7 100644 --- a/distributed_audio/audio/v1_0/BUILD.gn +++ b/distributed_audio/audio/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("daudio") { module_name = "daudio" sources = [ diff --git a/distributed_audio/audioext/v1_0/BUILD.gn b/distributed_audio/audioext/v1_0/BUILD.gn index d75300da..d895b5c2 100644 --- a/distributed_audio/audioext/v1_0/BUILD.gn +++ b/distributed_audio/audioext/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("daudioext") { module_name = "daudioext" sources = [ diff --git a/distributed_audio/audioext/v2_0/BUILD.gn b/distributed_audio/audioext/v2_0/BUILD.gn index a5d1b965..b5adde5c 100644 --- a/distributed_audio/audioext/v2_0/BUILD.gn +++ b/distributed_audio/audioext/v2_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("daudioext") { module_name = "daudioext" sources = [ diff --git a/distributed_camera/v1_0/BUILD.gn b/distributed_camera/v1_0/BUILD.gn index feaf504d..f453ba8f 100644 --- a/distributed_camera/v1_0/BUILD.gn +++ b/distributed_camera/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("distributed_camera_provider") { module_name = "distributed_camera_provider_service" sources = [ diff --git a/distributed_camera/v1_1/BUILD.gn b/distributed_camera/v1_1/BUILD.gn index a9989d0b..6d435160 100644 --- a/distributed_camera/v1_1/BUILD.gn +++ b/distributed_camera/v1_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("distributed_camera_provider") { module_name = "distributed_camera_provider_service" sources = [ -- Gitee From aee730ddef775804a3392be4c12f5b2931767229 Mon Sep 17 00:00:00 2001 From: yangkan Date: Mon, 12 Aug 2024 09:49:19 +0800 Subject: [PATCH 16/71] register buffer HDI Signed-off-by: yangkan --- display/composer/cache_manager/BUILD.gn | 1 + .../composer/cache_manager/cache_manager.h | 120 ++++++++++++++++++ .../composer/cache_manager/layer_cache.cpp | 60 +++++---- display/composer/cache_manager/layer_cache.h | 13 +- 4 files changed, 162 insertions(+), 32 deletions(-) diff --git a/display/composer/cache_manager/BUILD.gn b/display/composer/cache_manager/BUILD.gn index 42b6afff..2f9a8663 100644 --- a/display/composer/cache_manager/BUILD.gn +++ b/display/composer/cache_manager/BUILD.gn @@ -27,6 +27,7 @@ ohos_shared_library("libcomposer_buffer_cache") { deps = [ "//drivers/interface/display/buffer/v1_0:libdisplay_buffer_stub_1.0", + "//drivers/interface/display/buffer/v1_1:libdisplay_buffer_stub_1.1", "//drivers/interface/display/buffer/v1_2:libdisplay_buffer_stub_1.2", ] diff --git a/display/composer/cache_manager/cache_manager.h b/display/composer/cache_manager/cache_manager.h index d8b5b002..852ade70 100644 --- a/display/composer/cache_manager/cache_manager.h +++ b/display/composer/cache_manager/cache_manager.h @@ -22,6 +22,9 @@ #include "hdf_log.h" #include "nocopyable.h" #include +#include "hdf_base.h" +#include "hilog/log.h" +#include "base/native_buffer.h" #undef LOG_TAG #define LOG_TAG "DISP_CACHE_MGR" @@ -148,6 +151,123 @@ private: void (*initFunc_)(std::unique_ptr&); std::mutex mutex_; }; + +template +class CacheManager : public NoCopyable { +public: + CacheManager() + : cacheCountMax_ { 0 }, + cleanUpFunc_ { nullptr }, + initFunc_ { nullptr } + {} + + virtual ~CacheManager() + { + std::lock_guard lock(mutex_); + if (cleanUpFunc_) { + for (auto& cache : caches_) { + cleanUpFunc_(cache.second); + } + } + caches_.clear(); + } + + bool SetCacheMaxCount(uint32_t count) + { + bool ret = true; + uint32_t originalMaxCount = cacheCountMax_; + if (count >= cacheCountMax_) { + cacheCountMax_ = count; + } else if (Size() <= count) { + cacheCountMax_ = count; + } else { + HDF_LOGE("%{public}s error: clientCacheCount can't be set, because cacheCountMax_ > count", __func__); + ret = false; + } + HDF_LOGI("%{public}s: set cache max count from %{public}u to %{public}u", + __func__, originalMaxCount, cacheCountMax_); + return ret; + } + + uint32_t Size() + { + std::lock_guard lock(mutex_); + return caches_.size(); + } + + bool InsertCache(IdType id, Base::NativeBuffer* cache) + { + std::lock_guard lock(mutex_); + auto cacheItem = caches_.find(id); + if (cacheItem != caches_.end()) { + HDF_LOGI("%{public}s: intend to insert a existing cache, SeqNo=%{public}d", __func__, id); + cacheItem->second = OHOS::sptr(cache); + } else { + if (cacheCountMax_ != 0 && caches_.size() >= cacheCountMax_) { + HDF_LOGE("%{public}s: Caches is full, new seqNo:%{public}d can't be inserted", __func__, id); + return false; + } + caches_[id] = OHOS::sptr(cache); + } + if (initFunc_) { + initFunc_(caches_[id]); + } + return true; + } + + bool EraseCache(IdType id) + { + std::lock_guard lock(mutex_); + auto cacheItem = caches_.find(id); + if (cacheItem == caches_.end()) { + HDF_LOGE("%{public}s: Cache %{public}d is not existing\n", __func__, id); + return false; + } + + if (cleanUpFunc_ && cacheItem->second != nullptr) { + cleanUpFunc_(cacheItem->second); + } + + caches_.erase(cacheItem); + return true; + } + + Base::NativeBuffer* SearchCache(IdType id) + { + std::lock_guard lock(mutex_); + auto cacheItem = caches_.find(id); + if (cacheItem == caches_.end()) { + return nullptr; + } + + return cacheItem->second.GetRefPtr(); + } + + void TravelCaches(std::function func) + { + std::lock_guard lock(mutex_); + for (auto const& [key, value] : caches_) { + func(key, *value.GetRefPtr()); + } + } + + void SetCleanUpFunc(void (*func)(OHOS::sptr&)) + { + cleanUpFunc_ = func; + } + + void SetInitFunc(void (*func)(OHOS::sptr&)) + { + initFunc_ = func; + } + +private: + uint32_t cacheCountMax_; + std::unordered_map> caches_; + void (*cleanUpFunc_)(OHOS::sptr&); + void (*initFunc_)(OHOS::sptr&); + std::mutex mutex_; +}; } // namespace Composer } // namespace Display } // namespace HDI diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 8ed30178..af8da064 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -92,79 +92,85 @@ int32_t LayerCache::ResetLayerBuffer() return Init(); } -void LayerCache::NativeBufferInit(std::unique_ptr& buffer) +void LayerCache::NativeBufferInit(sptr& buffer) { -#ifdef DISPLAY_COMUNITY if (buffer == nullptr) { HDF_LOGW("NativeBufferInit buffer nullptr!"); return; } - int32_t ret = Mmap(buffer); + int32_t ret = RegisterBuffer(buffer); if (ret != HDF_SUCCESS) { - HDF_LOGE("%{public}s: Mmap failed with %{public}d!", __func__, ret); + HDF_LOGE("%{public}s: RegisterBuffer failed with %{public}d!", __func__, ret); } -#endif } -void LayerCache::NativeBufferCleanUp(std::unique_ptr& buffer) +void LayerCache::NativeBufferCleanUp(sptr& buffer) { -#ifdef DISPLAY_COMUNITY if (buffer == nullptr) { HDF_LOGW("NativeBufferCleanUp buffer nullptr!"); return; } - int32_t ret = Unmap(buffer); + int32_t ret = FreeMem(buffer); if (ret != HDF_SUCCESS) { - HDF_LOGE("%{public}s: Unmap failed with %{public}d!", __func__, ret); + HDF_LOGE("%{public}s: FreeMem failed with %{public}d!", __func__, ret); } -#endif +} + +sptr LayerCache::GetMetaService() +{ + static sptr metaService = nullptr; + if (metaService == nullptr) { + metaService = Buffer::V1_1::IMetadata::Get(true); + } + return metaService; } sptr LayerCache::GetMapperService() { - static sptr mapperService; + static sptr mapperService = nullptr; if (mapperService == nullptr) { mapperService = Buffer::V1_2::IMapper::Get(true); } return mapperService; } -int32_t LayerCache::Mmap(std::unique_ptr& buffer) +int32_t LayerCache::Mmap(sptr& buffer) { auto mapperService = GetMapperService(); if (mapperService == nullptr) { HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } + return mapperService->Mmap(buffer); +} - sptr nativeBuffer(new NativeBuffer); - if (nativeBuffer == nullptr) { - HDF_LOGE("new NativeBuffer failed!"); +int32_t LayerCache::Unmap(sptr& buffer) +{ + auto mapperService = GetMapperService(); + if (mapperService == nullptr) { + HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - - nativeBuffer->SetBufferHandle(buffer->GetBufferHandle(), false); - - return mapperService->Mmap(nativeBuffer); + return mapperService->Unmap(buffer); } -int32_t LayerCache::Unmap(std::unique_ptr& buffer) +int32_t LayerCache::FreeMem(sptr& buffer) { auto mapperService = GetMapperService(); if (mapperService == nullptr) { HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } + return mapperService->FreeMem(buffer); +} - sptr nativeBuffer(new NativeBuffer); - if (nativeBuffer == nullptr) { - HDF_LOGE("new NativeBuffer failed!"); +int32_t LayerCache::RegisterBuffer(sptr& buffer) +{ + auto metaService = GetMetaService(); + if (metaService == nullptr) { return HDF_FAILURE; } - - nativeBuffer->SetBufferHandle(buffer->GetBufferHandle(), false); - - return mapperService->Unmap(nativeBuffer); + return metaService->RegisterBuffer(buffer); } void LayerCache::Dump() const diff --git a/display/composer/cache_manager/layer_cache.h b/display/composer/cache_manager/layer_cache.h index 03b9190e..a81c01a7 100644 --- a/display/composer/cache_manager/layer_cache.h +++ b/display/composer/cache_manager/layer_cache.h @@ -23,6 +23,7 @@ #include "cache_manager.h" #include "nocopyable.h" #include "v1_2/mapper_stub.h" +#include "v1_1/imetadata.h" namespace OHOS { namespace HDI { @@ -38,15 +39,17 @@ public: int32_t SetBufferCacheMaxCount(uint32_t cacheCount); int32_t ResetLayerBuffer(); void Dump() const; - static void NativeBufferInit(std::unique_ptr& buffer); - static void NativeBufferCleanUp(std::unique_ptr& buffer); + static void NativeBufferInit(sptr& buffer); + static void NativeBufferCleanUp(sptr& buffer); private: explicit LayerCache(uint32_t id); int32_t Init(); static sptr GetMapperService(); - static int32_t Mmap(std::unique_ptr& buffer); - static int32_t Unmap(std::unique_ptr& buffer); - + static sptr GetMetaService(); + static int32_t Mmap(sptr& buffer); + static int32_t Unmap(sptr& buffer); + static int32_t FreeMem(sptr& buffer); + static int32_t RegisterBuffer(sptr& buffer); uint32_t layerId_; std::shared_ptr> bufferCaches_; }; -- Gitee From 7997eb6aecce2a47eaaf5dd8357a9228addbaff2 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Mon, 12 Aug 2024 19:20:10 +0800 Subject: [PATCH 17/71] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=A5=E5=8F=82datat?= =?UTF-8?q?ype=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghang133 --- camera/metadata/src/camera_metadata_info.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index d1b98e87..e992924b 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -941,6 +941,9 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it if (item == nullptr) { METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null"); return CAM_META_FAILURE; + } else if (item->data_type < META_TYPE_BYTE || item->data_type >= META_NUM_TYPES) { + METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid datatype:%{public}d", item->data_type); + return CAM_META_FAILURE; } size_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); size_t dataPayloadSize = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]; @@ -955,14 +958,12 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex data_capacity limit reached"); return CAM_META_DATA_CAP_EXCEED; } - if (oldItemSize != 0) { ret = MetadataExpandItemMem(dst, item, oldItemSize); if (ret != CAM_META_SUCCESS) { return ret; } } - if (dataSize != 0) { item->data.offset = dst->data_count; ret = copyMetadataMemory(dst, item, dataPayloadSize, data); @@ -977,7 +978,6 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it return ret; } } - if (dataSize == 0) { ret = memcpy_s(item->data.value, dataPayloadSize, data, dataPayloadSize); if (ret != EOK) { @@ -1470,7 +1470,7 @@ std::string CameraMetadata::FormatCameraMetadataToString(const common_metadata_h for (auto it = g_metadataTags.begin(); it != g_metadataTags.end(); it++) { metaStr += MetadataItemDump(metadataHeader, *it); } - METADATA_INFO_LOG("metadataHeader item = %{public}s", metaStr.c_str()); + METADATA_DEBUG_LOG("metadataHeader item = %{public}s", metaStr.c_str()); return metaStr; } -- Gitee From 8c27a434fd5bf4fa3b458c899e8120597cdae761 Mon Sep 17 00:00:00 2001 From: lvqiang214 Date: Tue, 13 Aug 2024 16:51:52 +0800 Subject: [PATCH 18/71] decouple Signed-off-by: lvqiang214 --- intelligent_voice/engine/v1_0/BUILD.gn | 2 +- intelligent_voice/engine/v1_1/BUILD.gn | 2 +- intelligent_voice/engine/v1_2/BUILD.gn | 2 +- intelligent_voice/trigger/v1_0/BUILD.gn | 2 +- intelligent_voice/trigger/v1_1/BUILD.gn | 2 +- intelligent_voice/trigger/v1_2/BUILD.gn | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/intelligent_voice/engine/v1_0/BUILD.gn b/intelligent_voice/engine/v1_0/BUILD.gn index 411b4e32..73eafc8e 100644 --- a/intelligent_voice/engine/v1_0/BUILD.gn +++ b/intelligent_voice/engine/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../../../hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("intell_voice_engine") { module_name = "intell_voice_engine_service" diff --git a/intelligent_voice/engine/v1_1/BUILD.gn b/intelligent_voice/engine/v1_1/BUILD.gn index 81d02043..1325d3a1 100644 --- a/intelligent_voice/engine/v1_1/BUILD.gn +++ b/intelligent_voice/engine/v1_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../../../hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("intell_voice_engine") { module_name = "intell_voice_engine_service" diff --git a/intelligent_voice/engine/v1_2/BUILD.gn b/intelligent_voice/engine/v1_2/BUILD.gn index 1e19d20e..f03071e3 100644 --- a/intelligent_voice/engine/v1_2/BUILD.gn +++ b/intelligent_voice/engine/v1_2/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("intell_voice_engine") { module_name = "intell_voice_engine_service" diff --git a/intelligent_voice/trigger/v1_0/BUILD.gn b/intelligent_voice/trigger/v1_0/BUILD.gn index 4b120e9a..dd58ff41 100644 --- a/intelligent_voice/trigger/v1_0/BUILD.gn +++ b/intelligent_voice/trigger/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../../../hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("intell_voice_trigger") { module_name = "intell_voice_trigger_service" diff --git a/intelligent_voice/trigger/v1_1/BUILD.gn b/intelligent_voice/trigger/v1_1/BUILD.gn index c102ced3..708956be 100644 --- a/intelligent_voice/trigger/v1_1/BUILD.gn +++ b/intelligent_voice/trigger/v1_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../../../hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("intell_voice_trigger") { module_name = "intell_voice_trigger_service" diff --git a/intelligent_voice/trigger/v1_2/BUILD.gn b/intelligent_voice/trigger/v1_2/BUILD.gn index 3132ecb7..008e36c5 100644 --- a/intelligent_voice/trigger/v1_2/BUILD.gn +++ b/intelligent_voice/trigger/v1_2/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("intell_voice_trigger") { module_name = "intell_voice_trigger_service" -- Gitee From dc86871f0d4333370fb8cd91addeb9af2d13b2ae Mon Sep 17 00:00:00 2001 From: w30052974 Date: Wed, 14 Aug 2024 10:59:14 +0800 Subject: [PATCH 19/71] nnrt drivers_interface build.gn protect added Signed-off-by: w30052974 --- nnrt/v1_0/BUILD.gn | 6 ++++++ nnrt/v2_0/BUILD.gn | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/nnrt/v1_0/BUILD.gn b/nnrt/v1_0/BUILD.gn index e125f884..e61b33fc 100644 --- a/nnrt/v1_0/BUILD.gn +++ b/nnrt/v1_0/BUILD.gn @@ -22,6 +22,12 @@ hdi("nnrt") { "NodeAttrTypes.idl", ] + cflags = [ "-fstack-protector-all" ] + cflags_cc = [ + "-fexceptions", + "-fstack-protector-all", + ] + language = "cpp" innerapi_tags = [ "platformsdk" ] subsystem_name = "hdf" diff --git a/nnrt/v2_0/BUILD.gn b/nnrt/v2_0/BUILD.gn index f0b8408b..8bc42936 100644 --- a/nnrt/v2_0/BUILD.gn +++ b/nnrt/v2_0/BUILD.gn @@ -22,6 +22,12 @@ hdi("nnrt") { "NodeAttrTypes.idl", ] + cflags = [ "-fstack-protector-all" ] + cflags_cc = [ + "-fexceptions", + "-fstack-protector-all", + ] + language = "cpp" innerapi_tags = [ "platformsdk" ] subsystem_name = "hdf" -- Gitee From cf5a78f8d7133acd395372a60925afd7e0b8a93d Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 14 Aug 2024 14:19:27 +0800 Subject: [PATCH 20/71] =?UTF-8?q?interface=20display=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0log=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 6 ++++-- display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 82d1f7cd..ec6b4a1b 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -370,8 +370,10 @@ EXIT: #ifdef DISPLAY_COMSPOER_DEBUG_DUMP DumpLayerBuffer(data.devId, data.seqNo, data.fence, handle, "client_"); #endif - HdfTrace traceVdi("SetDisplayClientBuffer", "HDI:DISP:HARDWARE"); - needMoveFd = true; + HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? "data.buffer is nullptr! " : + ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + + " width:" + std::to_string(data.buffer->width) + " ")); + needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); return HDF_SUCCESS; diff --git a/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h index 6d236e3d..ddfc71c8 100644 --- a/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h @@ -165,6 +165,7 @@ public: virtual int32_t SetDisplayPowerStatus(uint32_t devId, DispPowerStatus status) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_); + HDF_LOGI("devId: %{public}u, status: %{public}u", devId, status); return ToDispErrCode(hdi_->SetDisplayPowerStatus(devId, status)); } -- Gitee From 4265f7a81bf5fd2bac0485f05645fcb6fc16a498 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 14 Aug 2024 06:22:26 +0000 Subject: [PATCH 21/71] update display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h. Signed-off-by: l60050612 --- display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h index ddfc71c8..a0cdbdf1 100644 --- a/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h @@ -165,7 +165,7 @@ public: virtual int32_t SetDisplayPowerStatus(uint32_t devId, DispPowerStatus status) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_); - HDF_LOGI("devId: %{public}u, status: %{public}u", devId, status); + HDF_LOGI("devId: %{public}u, status: %{public}u", devId, status); return ToDispErrCode(hdi_->SetDisplayPowerStatus(devId, status)); } -- Gitee From c6e2941900c82f56de4e50235ab40cba9032b5f7 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 14 Aug 2024 06:23:36 +0000 Subject: [PATCH 22/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index ec6b4a1b..2d1a8799 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -370,9 +370,9 @@ EXIT: #ifdef DISPLAY_COMSPOER_DEBUG_DUMP DumpLayerBuffer(data.devId, data.seqNo, data.fence, handle, "client_"); #endif - HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? "data.buffer is nullptr! " : - ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + - " width:" + std::to_string(data.buffer->width) + " ")); + HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? "data.buffer is nullptr! " : + ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + + " width:" + std::to_string(data.buffer->width) + " ")); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From 7e7b55cd0ee0736a2670f0f445c2bd33bab89bad Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 14 Aug 2024 06:24:27 +0000 Subject: [PATCH 23/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 2d1a8799..198b0921 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -373,7 +373,7 @@ EXIT: HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? "data.buffer is nullptr! " : ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " ")); - needMoveFd = true; + needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); return HDF_SUCCESS; -- Gitee From 9a98c3135f93b1bb77fc7d2aec5298cda02b792a Mon Sep 17 00:00:00 2001 From: w30052974 Date: Thu, 15 Aug 2024 09:09:09 +0800 Subject: [PATCH 24/71] nnrt drivers_interface build.gn protect added return back Signed-off-by: w30052974 --- nnrt/v1_0/BUILD.gn | 6 ------ nnrt/v2_0/BUILD.gn | 6 ------ 2 files changed, 12 deletions(-) diff --git a/nnrt/v1_0/BUILD.gn b/nnrt/v1_0/BUILD.gn index e61b33fc..e125f884 100644 --- a/nnrt/v1_0/BUILD.gn +++ b/nnrt/v1_0/BUILD.gn @@ -22,12 +22,6 @@ hdi("nnrt") { "NodeAttrTypes.idl", ] - cflags = [ "-fstack-protector-all" ] - cflags_cc = [ - "-fexceptions", - "-fstack-protector-all", - ] - language = "cpp" innerapi_tags = [ "platformsdk" ] subsystem_name = "hdf" diff --git a/nnrt/v2_0/BUILD.gn b/nnrt/v2_0/BUILD.gn index 8bc42936..f0b8408b 100644 --- a/nnrt/v2_0/BUILD.gn +++ b/nnrt/v2_0/BUILD.gn @@ -22,12 +22,6 @@ hdi("nnrt") { "NodeAttrTypes.idl", ] - cflags = [ "-fstack-protector-all" ] - cflags_cc = [ - "-fexceptions", - "-fstack-protector-all", - ] - language = "cpp" innerapi_tags = [ "platformsdk" ] subsystem_name = "hdf" -- Gitee From 19a07352422de1446d0759499b6ef6b085bc4545 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Thu, 15 Aug 2024 02:19:50 +0000 Subject: [PATCH 25/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 198b0921..628fb096 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -370,9 +370,9 @@ EXIT: #ifdef DISPLAY_COMSPOER_DEBUG_DUMP DumpLayerBuffer(data.devId, data.seqNo, data.fence, handle, "client_"); #endif - HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? "data.buffer is nullptr! " : + HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? ("data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo)) : ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + - " width:" + std::to_string(data.buffer->width) + " ")); + " width:" + std::to_string(data.buffer->width) + " seqNo:" + std::to_string(data.seqNo))); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From 9a4cfe2c8e10a836b7dd1af9a99951aea684aab8 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Thu, 15 Aug 2024 02:21:12 +0000 Subject: [PATCH 26/71] update display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h. Signed-off-by: l60050612 --- display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h index a0cdbdf1..317bc594 100644 --- a/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h @@ -165,8 +165,9 @@ public: virtual int32_t SetDisplayPowerStatus(uint32_t devId, DispPowerStatus status) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_); + int32_t ret = hdi_->SetDisplayPowerStatus(devId, status); HDF_LOGI("devId: %{public}u, status: %{public}u", devId, status); - return ToDispErrCode(hdi_->SetDisplayPowerStatus(devId, status)); + return ToDispErrCode(ret); } virtual int32_t GetDisplayBacklight(uint32_t devId, uint32_t& level) override -- Gitee From 722169129b8ee09f92e8c41c0cc56483695f0c78 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Thu, 15 Aug 2024 02:38:01 +0000 Subject: [PATCH 27/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 628fb096..aeea58c5 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -370,8 +370,8 @@ EXIT: #ifdef DISPLAY_COMSPOER_DEBUG_DUMP DumpLayerBuffer(data.devId, data.seqNo, data.fence, handle, "client_"); #endif - HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? ("data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo)) : - ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + + HdfTrace traceVdi("SetDisplayClientBuffer", data.buffer == nullptr ? ("data.buffer is nullptr! seqNo:" + + std::to_string(data.seqNo)) : ("HDI:DISP:HARDWARE height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " seqNo:" + std::to_string(data.seqNo))); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); -- Gitee From 822215b6e8d9e9088f46600344cc5543e8b56c96 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Sat, 17 Aug 2024 01:24:44 +0000 Subject: [PATCH 28/71] update drm/v1_0/BUILD.gn. Signed-off-by: baoxy92 --- drm/v1_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drm/v1_0/BUILD.gn b/drm/v1_0/BUILD.gn index 88a1b6f3..e27710e7 100644 --- a/drm/v1_0/BUILD.gn +++ b/drm/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../../hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libdrm_proxy_1.0") { deps = [] -- Gitee From 44cbbb615827641a19d8837a007295116ff0cefb Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 17 Aug 2024 17:00:29 +0800 Subject: [PATCH 29/71] new interface of camera Signed-off-by: huangshengqing --- .../include/camera_device_ability_items.h | 64 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 16 +++++ camera/metadata/src/camera_metadata_info.cpp | 8 +++ 3 files changed, 88 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index ff2b6998..d347360e 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1827,6 +1827,62 @@ typedef enum camera_device_metadata_tag { * (i.e. uint32_t[] ...) */ OHOS_ABILITY_TIME_LAPSE_INTERVAL_RANGE, + /** + * ohos.ability.lcdFlash [static, int32_t[], public] + * + * camera device property, report current camera lcd flash + * (i.e. int32_t[] ...) + */ + OHOS_ABILITY_LCD_FLASH, + /** + * ohos.control.lcdFlashDetection [static, byte[], public] + * + * camera device property, set current camera lcd flash detection + * (i.e. byte[] ...) + */ + OHOS_CONTROL_LCD_FLASH_DETECTION, + /** + * ohos.control.lcdFlash [static, byte[], public] + * + * camera device property, set current camera lcd flash + * (i.e. byte[] ...) + */ + OHOS_CONTROL_LCD_FLASH, + /** + * ohos.status.lcdFlashStatus [static, int32_t[], public] + * + * camera device property, quiry current camera lcd flash status + * (i.e. int32_t[] ...) + */ + OHOS_STATUS_LCD_FLASH_STATUS, + /** + * ohos.ability.depthDataDelivery [static, int32_t[], public] + * + * camera device property, report current camera depth data delivery + * (i.e. int32_t[] ...) + */ + OHOS_ABILITY_DEPTH_DATA_DELIVERY, + /** + * ohos.control.depthDataDeliverySwitch [static, byte[], public] + * + * camera device property, set current camera depth data delivery switch + * (i.e. byte[] ...) + */ + OHOS_CONTROL_DEPTH_DATA_DELIVERY_SWITCH, + /** + * ohos.ability.depthDataProfiles [static, int32_t[], public] + * + * camera device property, report current camera depth data profiles + * (i.e. int32_t[] ...) + */ + OHOS_ABILITY_DEPTH_DATA_PROFILES, + /** + * ohos.control.depthDataAccuracy [static, int32_t[], public] + * + * camera device property, set current camera depth data accuracy + * (i.e. int32_t[] ...) + */ + OHOS_CONTROL_DEPTH_DATA_ACCURACY, /** * ohos.camera.effectEnd * @@ -2077,6 +2133,8 @@ typedef enum camera_format { OHOS_CAMERA_FORMAT_YCRCB_P010, OHOS_CAMERA_FORMAT_DNG, OHOS_CAMERA_FORMAT_422_YUYV, + OHOS_CAMERA_FORMAT_DEPTH_16, + OHOS_CAMERA_FORMAT_DEPTH_32, OHOS_CAMERA_FORMAT_IMPLEMENTATION_DEFINED = 0x1000, } camera_format_t; @@ -2349,4 +2407,10 @@ enum TripodStatus { TRIPOD_STATUS_EXITING = 3, }; +// OHOS_CONTROL_DEPTH_DATA_ACCURACY +enum DepthDataAccuracyType { + OHOS_DEPTH_DATA_ACCURACY_RELATIVE = 1, + OHOS_DEPTH_DATA_ACCURACY_ABSOLUTE, +}; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index bf547e6e..a3103ef1 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -460,6 +460,22 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"controlTimeLapsePreviewType", META_TYPE_BYTE, 1}, [OHOS_ABILITY_TIME_LAPSE_INTERVAL_RANGE - OHOS_CAMERA_EFFECT_START] = {"timeLapseIntervalRange", META_TYPE_UINT32, 1}, + [OHOS_ABILITY_LCD_FLASH - + OHOS_CAMERA_EFFECT_START] = {"lcdFlash", META_TYPE_INT32, -1}, + [OHOS_CONTROL_LCD_FLASH_DETECTION - + OHOS_CAMERA_EFFECT_START] = {"lcdFlashDetection", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_LCD_FLASH - + OHOS_CAMERA_EFFECT_START] = {"controlLcdFlash", META_TYPE_BYTE, 1}, + [OHOS_STATUS_LCD_FLASH_STATUS - + OHOS_CAMERA_EFFECT_START] = {"lcdFlashStatus", META_TYPE_INT32, 1}, + [OHOS_ABILITY_DEPTH_DATA_DELIVERY - + OHOS_CAMERA_EFFECT_START] = {"depthDataDelivery", META_TYPE_INT32, -1}, + [OHOS_CONTROL_DEPTH_DATA_DELIVERY_SWITCH - + OHOS_CAMERA_EFFECT_START] = {"depthDataDeliverySwitch", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_DEPTH_DATA_PROFILES - + OHOS_CAMERA_EFFECT_START] = {"depthDataProfiles", META_TYPE_INT32, -1}, + [OHOS_CONTROL_DEPTH_DATA_ACCURACY - + OHOS_CAMERA_EFFECT_START] = {"depthDataAccuracy", META_TYPE_INT32, -1}, }; static item_info_t g_ohosCameraSecure[OHOS_CAMERA_SECURE_END - OHOS_CAMERA_SECURE_START] = { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index e992924b..6ac4f275 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -279,6 +279,14 @@ const std::vector g_metadataTags = { OHOS_CONTROL_TIME_LAPSE_RECORD_STATE, OHOS_CONTROL_TIME_LAPSE_PREVIEW_TYPE, OHOS_ABILITY_TIME_LAPSE_INTERVAL_RANGE, + OHOS_ABILITY_LCD_FLASH, + OHOS_CONTROL_LCD_FLASH_DETECTION, + OHOS_CONTROL_LCD_FLASH, + OHOS_STATUS_LCD_FLASH_STATUS, + OHOS_ABILITY_DEPTH_DATA_DELIVERY, + OHOS_CONTROL_DEPTH_DATA_DELIVERY_SWITCH, + OHOS_ABILITY_DEPTH_DATA_PROFILES, + OHOS_CONTROL_DEPTH_DATA_ACCURACY, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From ce69949a4506a47b1c824ddd8fdd2c05cd751bb6 Mon Sep 17 00:00:00 2001 From: liufeng Date: Sat, 17 Aug 2024 17:40:39 +0800 Subject: [PATCH 30/71] =?UTF-8?q?=E8=8A=AF=E7=89=87=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E6=9E=84=E5=BB=BA=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufeng --- camera/sequenceable/buffer_handle/BUILD.gn | 1 - camera/sequenceable/buffer_producer/BUILD.gn | 1 - camera/sequenceable/map_data/BUILD.gn | 1 - camera/v1_0/BUILD.gn | 2 +- camera/v1_1/BUILD.gn | 2 +- camera/v1_2/BUILD.gn | 2 +- camera/v1_3/BUILD.gn | 2 +- 7 files changed, 4 insertions(+), 7 deletions(-) diff --git a/camera/sequenceable/buffer_handle/BUILD.gn b/camera/sequenceable/buffer_handle/BUILD.gn index 6f6f4559..327f2006 100644 --- a/camera/sequenceable/buffer_handle/BUILD.gn +++ b/camera/sequenceable/buffer_handle/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("//build/ohos.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("//drivers/interface/camera/camera.gni") config("buffer_handle_sequenceable_config") { diff --git a/camera/sequenceable/buffer_producer/BUILD.gn b/camera/sequenceable/buffer_producer/BUILD.gn index 5225a000..1ef1decd 100644 --- a/camera/sequenceable/buffer_producer/BUILD.gn +++ b/camera/sequenceable/buffer_producer/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("//build/ohos.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("//drivers/interface/camera/camera.gni") config("camera_sequenceable_config") { diff --git a/camera/sequenceable/map_data/BUILD.gn b/camera/sequenceable/map_data/BUILD.gn index 4016d891..0437beef 100644 --- a/camera/sequenceable/map_data/BUILD.gn +++ b/camera/sequenceable/map_data/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("//build/ohos.gni") -import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("//drivers/interface/camera/camera.gni") config("map_data_sequenceable_config") { diff --git a/camera/v1_0/BUILD.gn b/camera/v1_0/BUILD.gn index 043bff29..7e15fc2d 100644 --- a/camera/v1_0/BUILD.gn +++ b/camera/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../../hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libcamera_proxy_1.0") { deps = [] diff --git a/camera/v1_1/BUILD.gn b/camera/v1_1/BUILD.gn index c3c9a2af..0635d066 100644 --- a/camera/v1_1/BUILD.gn +++ b/camera/v1_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libcamera_proxy_1.1") { deps = [] diff --git a/camera/v1_2/BUILD.gn b/camera/v1_2/BUILD.gn index 003c6396..6ebf316c 100644 --- a/camera/v1_2/BUILD.gn +++ b/camera/v1_2/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libcamera_proxy_1.2") { deps = [] diff --git a/camera/v1_3/BUILD.gn b/camera/v1_3/BUILD.gn index 16d70e86..733df42b 100644 --- a/camera/v1_3/BUILD.gn +++ b/camera/v1_3/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libcamera_proxy_1.3") { deps = [] -- Gitee From c3ceb1e78d4e04faab740067a1cbf995bd510d4d Mon Sep 17 00:00:00 2001 From: cwx1272435 Date: Mon, 19 Aug 2024 02:51:47 +0000 Subject: [PATCH 31/71] 0819 Signed-off-by: cwx1272435 --- memorytracker/v1_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memorytracker/v1_0/BUILD.gn b/memorytracker/v1_0/BUILD.gn index cc8817ac..c3b600b2 100644 --- a/memorytracker/v1_0/BUILD.gn +++ b/memorytracker/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("memorytracker") { module_name = "memory_tracker_interface_service" sources = [ -- Gitee From c666585c489b18da41bf2318a02dbcc225069b52 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Wed, 21 Aug 2024 15:26:49 +0800 Subject: [PATCH 32/71] heif interface Signed-off-by: huangshengqing --- camera/v1_3/BUILD.gn | 2 + camera/v1_3/IImageProcessCallback.idl | 41 +++++++++ camera/v1_3/IImageProcessService.idl | 45 ++++++++++ camera/v1_3/Types.idl | 117 +++++++++++++++++++++++++- 4 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 camera/v1_3/IImageProcessCallback.idl create mode 100644 camera/v1_3/IImageProcessService.idl diff --git a/camera/v1_3/BUILD.gn b/camera/v1_3/BUILD.gn index 16d70e86..fdb6fbe3 100644 --- a/camera/v1_3/BUILD.gn +++ b/camera/v1_3/BUILD.gn @@ -25,6 +25,8 @@ if (defined(ohos_lite)) { sources = [ "ICameraDevice.idl", "ICameraHost.idl", + "IImageProcessCallback.idl", + "IImageProcessService.idl", "IStreamOperatorCallback.idl", "IVideoProcessCallback.idl", "IVideoProcessService.idl", diff --git a/camera/v1_3/IImageProcessCallback.idl b/camera/v1_3/IImageProcessCallback.idl new file mode 100644 index 00000000..94f71b8c --- /dev/null +++ b/camera/v1_3/IImageProcessCallback.idl @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file iimage_process_callback.h + * + * @brief Declares callbacks for image process. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.camera.v1_3; +import ohos.hdi.camera.v1_3.Types; +import ohos.hdi.camera.v1_2.IImageProcessCallback; + +[callback] interface IImageProcessCallback extends ohos.hdi.camera.v1_2.IImageProcessCallback { + /** + * @brief Called when the process done. + * For details about the reporting mode, see {@link SetResultMode}. + * + * @param imageId Indicates the image ID. + * @param buffer Indicates buffer. + * + * @since 5.0 + * @version 1.0 + */ + OnProcessDoneExt([in] String imageId, [in] ImageBufferInfoExt buffer); +} \ No newline at end of file diff --git a/camera/v1_3/IImageProcessService.idl b/camera/v1_3/IImageProcessService.idl new file mode 100644 index 00000000..c3e3a8fe --- /dev/null +++ b/camera/v1_3/IImageProcessService.idl @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @file iimage_process_session.h + * + * @brief Declares APIs for image process service. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.camera.v1_3; + +import ohos.hdi.camera.v1_2.IImageProcessSession; +import ohos.hdi.camera.v1_3.IImageProcessSession; +import ohos.hdi.camera.v1_2.IImageProcessCallback; + +interface IImageProcessService extends ohos.hdi.camera.v1_2.IImageProcessService { + /** + * @brief Create image process session. + * + * @param userId Indicates user ID. + * @param imageProcessCallback Indicates the image process callback. For details, see {@link IImageProcessCallback}. + * @param imageProcessSession Indicates the image process session. For details, see {@link IImageProcessSession} + * + * @since 5.0 + * @version 1.0 + */ + CreateImageProcessSessionExt([in] int userId, + [in] IImageProcessCallback imageProcessCallback, + [out] IImageProcessSession imageProcessSession); +} \ No newline at end of file diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 3ea45f91..0174a555 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -160,6 +160,16 @@ enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { * Extended stream information of maker. */ EXTENDED_STREAM_INFO_MAKER_INFO = 6, + + /** + * Extended stream information of exif. + */ + EXTENDED_STREAM_INFO_EXIF = 7, + + /** + * Extended stream information of gainmap. + */ + EXTENDED_STREAM_INFO_GAINMAP = 8, }; /** @@ -346,4 +356,109 @@ struct CaptureEndedInfoExt { * @version 1.0 */ String videoId_; -}; \ No newline at end of file +}; + +/** + * @brief Defines the ImageBufferInfo, which is used by {@link IImageProcessCallback::OnProcessDoneExt}. + * @since 5.0 + * @version 1.0 + */ +struct ImageBufferInfoExt { + /** + * @brief The information of metadata. + * @since 5.0 + * @version 1.0 + */ + MapDataSequenceable metadata; + + /** + * @brief The information of ImageHandle. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable ImageHandle; + + /** + * @brief If the gain map reported. + * @since 5.0 + * @version 1.0 + */ + boolean isGainMapValid; + + /** + * @brief The gain map information. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable gainMapHandle; + + /** + * @brief Is depthMapHandle valid. + * @since 5.0 + * @version 1.0 + */ + boolean isDepthMapValid; + + /** + * @brief Data of metadata. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable depthMapHandle; + + /** + * @brief If the unrefocus image of portrait mode reported. + * @since 5.0 + * @version 1.0 + */ + boolean isUnrefocusImageValid; + + /** + * @brief The unrefocus image of portrait mode. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable unrefocusImageHandle; + + /** + * @brief If the high bit depth linear image reported. + * @since 5.0 + * @version 1.0 + */ + boolean isHighBitDepthLinearImageValid; + + /** + * @brief The high bit depth linear image. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable highBitDepthLinearImageHandle; + + /** + * @brief If the exif information reported. + * @since 5.0 + * @version 1.0 + */ + boolean isExifValid; + + /** + * @brief The exif information. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable exifHandle; + + /** + * @brief If the maker information reported. + * @since 5.0 + * @version 1.0 + */ + boolean isMakerValid; + + /** + * @brief The maker information. + * @since 5.0 + * @version 1.0 + */ + BufferHandleSequenceable makerHandle; +} \ No newline at end of file -- Gitee From 5e5863cbc020e161e7464df0cb52f896b81f6e1f Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Wed, 21 Aug 2024 16:20:34 +0800 Subject: [PATCH 33/71] add new interface Signed-off-by: huangshengqing --- .../metadata/include/camera_device_ability_items.h | 1 + camera/v1_3/Types.idl | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index d347360e..10c29ba7 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -2135,6 +2135,7 @@ typedef enum camera_format { OHOS_CAMERA_FORMAT_422_YUYV, OHOS_CAMERA_FORMAT_DEPTH_16, OHOS_CAMERA_FORMAT_DEPTH_32, + OHOS_CAMERA_FORMAT_HEIC, OHOS_CAMERA_FORMAT_IMPLEMENTATION_DEFINED = 0x1000, } camera_format_t; diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 0174a555..d8e8ebdb 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -461,4 +461,16 @@ struct ImageBufferInfoExt { * @version 1.0 */ BufferHandleSequenceable makerHandle; +} + +/** + * @brief Enumerates encoding types of stream data. + * @since 5.0 + * @version 1.0 + */ +enum EncodeType : ohos.hdi.camera.v1_0.EncodeType { + /** + * HEIC + */ + ENCODE_TYPE_HEIC = 4, } \ No newline at end of file -- Gitee From fe62666925cee223d7ffe408237460fe919e4fdb Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Wed, 21 Aug 2024 08:55:07 +0000 Subject: [PATCH 34/71] update camera/v1_3/IImageProcessService.idl. Signed-off-by: huangshengqing --- camera/v1_3/IImageProcessService.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camera/v1_3/IImageProcessService.idl b/camera/v1_3/IImageProcessService.idl index c3e3a8fe..af3b6514 100644 --- a/camera/v1_3/IImageProcessService.idl +++ b/camera/v1_3/IImageProcessService.idl @@ -25,8 +25,8 @@ package ohos.hdi.camera.v1_3; import ohos.hdi.camera.v1_2.IImageProcessSession; -import ohos.hdi.camera.v1_3.IImageProcessSession; -import ohos.hdi.camera.v1_2.IImageProcessCallback; +import ohos.hdi.camera.v1_3.IImageProcessCallback; +import ohos.hdi.camera.v1_2.IImageProcessService; interface IImageProcessService extends ohos.hdi.camera.v1_2.IImageProcessService { /** -- Gitee From d294ad35370e95f74ba8b63c481b508436e341f3 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Wed, 21 Aug 2024 09:41:18 +0000 Subject: [PATCH 35/71] update camera/v1_3/Types.idl. Signed-off-by: huangshengqing --- camera/v1_3/Types.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index d8e8ebdb..27ac8254 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -461,7 +461,7 @@ struct ImageBufferInfoExt { * @version 1.0 */ BufferHandleSequenceable makerHandle; -} +}; /** * @brief Enumerates encoding types of stream data. @@ -473,4 +473,4 @@ enum EncodeType : ohos.hdi.camera.v1_0.EncodeType { * HEIC */ ENCODE_TYPE_HEIC = 4, -} \ No newline at end of file +}; \ No newline at end of file -- Gitee From bd8215e0668c97810980dd441e7ddf414924d4f1 Mon Sep 17 00:00:00 2001 From: hechaofan Date: Fri, 23 Aug 2024 16:48:10 +0800 Subject: [PATCH 36/71] =?UTF-8?q?=E8=8A=AF=E7=89=87=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=BC=96=E8=AF=91=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hechaofan --- usb/ddk/v1_0/BUILD.gn | 2 +- usb/gadget/mtp/v1_0/BUILD.gn | 2 +- usb/v1_0/BUILD.gn | 2 +- usb/v1_1/BUILD.gn | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usb/ddk/v1_0/BUILD.gn b/usb/ddk/v1_0/BUILD.gn index 94b53ba9..e391f0b1 100644 --- a/usb/ddk/v1_0/BUILD.gn +++ b/usb/ddk/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("usb_ddk") { module_name = "usb_ddk" diff --git a/usb/gadget/mtp/v1_0/BUILD.gn b/usb/gadget/mtp/v1_0/BUILD.gn index b2606307..6712c204 100644 --- a/usb/gadget/mtp/v1_0/BUILD.gn +++ b/usb/gadget/mtp/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("usbfn_mtp") { module_name = "usbfn_mtp" diff --git a/usb/v1_0/BUILD.gn b/usb/v1_0/BUILD.gn index 2a100a0d..30d2ad76 100644 --- a/usb/v1_0/BUILD.gn +++ b/usb/v1_0/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libusb_proxy_1.0") { deps = [] diff --git a/usb/v1_1/BUILD.gn b/usb/v1_1/BUILD.gn index 42bfb359..e7c65b8f 100644 --- a/usb/v1_1/BUILD.gn +++ b/usb/v1_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") if (defined(ohos_lite)) { group("libusb_proxy_1.1") { deps = [] -- Gitee From 17cf2c43f9fdc29f80df9a8826fa3e10d711708d Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Fri, 23 Aug 2024 21:04:07 +0800 Subject: [PATCH 37/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghang133 --- camera/metadata/BUILD.gn | 6 ++++-- camera/metadata/include/camera_device_ability_items.h | 9 ++++++++- camera/metadata/include/camera_metadata_item_info.h | 2 ++ camera/metadata/src/camera_metadata_info.cpp | 1 + camera/sequenceable/buffer_handle/BUILD.gn | 6 ++++-- camera/sequenceable/buffer_producer/BUILD.gn | 6 ++++-- camera/sequenceable/map_data/BUILD.gn | 6 ++++-- 7 files changed, 27 insertions(+), 9 deletions(-) diff --git a/camera/metadata/BUILD.gn b/camera/metadata/BUILD.gn index 0e327f2e..ff9934ab 100644 --- a/camera/metadata/BUILD.gn +++ b/camera/metadata/BUILD.gn @@ -24,10 +24,12 @@ ohos_shared_library("metadata") { "-fPIC", "-Wall", ] + cflags_cc = cflags + cflags_cc += [ "-fstack-protector-strong" ] + ldflags = [ "-s" ] if (drivers_interface_camera_feature_coverage) { cflags += [ "--coverage" ] - ldflags = [ "--coverage" ] - cflags_cc = cflags + ldflags += [ "--coverage" ] } all_dependent_configs = [ ":camera_metadata_config" ] if (defined(ohos_lite)) { diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index d347360e..ff7a668e 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -407,12 +407,19 @@ typedef enum camera_device_metadata_tag { */ OHOS_CONTROL_LOW_LIGHT_BOOST, /** - * ohos.control.lowLightDetection [static, byte, public] + * ohos.status.lowLightDetection [static, byte, public] * * camera device property, query current camera low light detection status * (i.e. byte: 0-false/1-true ...) */ OHOS_STATUS_LOW_LIGHT_DETECTION, + /** + * ohos.status.cameraLensDirtyDetection [static, byte, public] + * + * camera device property, query current camera lens dirty detection + * (i.e. byte: 0-false/1-true ...) + */ + OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION, /** * ohos.camera.propertiesEnd * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index a3103ef1..b94b2162 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -132,6 +132,8 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"lowLightBoost", META_TYPE_BYTE, 1}, [OHOS_STATUS_LOW_LIGHT_DETECTION - OHOS_CAMERA_PROPERTIES_START] = {"lowLightDetection", META_TYPE_BYTE, 1}, + [OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION - + OHOS_CAMERA_PROPERTIES_START] = {"cameraLensDirtyDetection", META_TYPE_BYTE, 1}, }; static item_info_t g_ohosCameraSensor[OHOS_CAMERA_SENSOR_END - OHOS_CAMERA_SENSOR_START] = { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 6ac4f275..7b6556ca 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -76,6 +76,7 @@ const std::vector g_metadataTags = { OHOS_CONTROL_LOW_LIGHT_DETECT, OHOS_CONTROL_LOW_LIGHT_BOOST, OHOS_STATUS_LOW_LIGHT_DETECTION, + OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION, OHOS_SENSOR_EXPOSURE_TIME, OHOS_SENSOR_COLOR_CORRECTION_GAINS, diff --git a/camera/sequenceable/buffer_handle/BUILD.gn b/camera/sequenceable/buffer_handle/BUILD.gn index 6f6f4559..5224af61 100644 --- a/camera/sequenceable/buffer_handle/BUILD.gn +++ b/camera/sequenceable/buffer_handle/BUILD.gn @@ -35,9 +35,11 @@ ohos_shared_library("libbuffer_handle_sequenceable_1.0") { "hilog:libhilog", "ipc:ipc_single", ] + cflags_cc = [ "-fstack-protector-strong" ] + ldflags = [ "-s" ] if (drivers_interface_camera_feature_coverage) { - cflags_cc = [ "--coverage" ] - ldflags = [ "--coverage" ] + cflags_cc += [ "--coverage" ] + ldflags += [ "--coverage" ] } install_images = [ system_base_dir ] relative_install_dir = "chipset-sdk" diff --git a/camera/sequenceable/buffer_producer/BUILD.gn b/camera/sequenceable/buffer_producer/BUILD.gn index 5225a000..96dfd198 100644 --- a/camera/sequenceable/buffer_producer/BUILD.gn +++ b/camera/sequenceable/buffer_producer/BUILD.gn @@ -36,9 +36,11 @@ ohos_shared_library("libbuffer_producer_sequenceable_1.0") { "hilog:libhilog", "ipc:ipc_single", ] + cflags_cc = [ "-fstack-protector-strong" ] + ldflags = [ "-s" ] if (drivers_interface_camera_feature_coverage) { - cflags_cc = [ "--coverage" ] - ldflags = [ "--coverage" ] + cflags_cc += [ "--coverage" ] + ldflags += [ "--coverage" ] } install_images = [ system_base_dir ] relative_install_dir = "chipset-sdk" diff --git a/camera/sequenceable/map_data/BUILD.gn b/camera/sequenceable/map_data/BUILD.gn index 4016d891..0eafed11 100644 --- a/camera/sequenceable/map_data/BUILD.gn +++ b/camera/sequenceable/map_data/BUILD.gn @@ -35,9 +35,11 @@ ohos_shared_library("libmap_data_sequenceable_1.0") { "hilog:libhilog", "ipc:ipc_single", ] + cflags_cc = [ "-fstack-protector-strong" ] + ldflags = [ "-s" ] if (drivers_interface_camera_feature_coverage) { - cflags_cc = [ "--coverage" ] - ldflags = [ "--coverage" ] + cflags_cc += [ "--coverage" ] + ldflags += [ "--coverage" ] } install_images = [ system_base_dir ] relative_install_dir = "chipset-sdk" -- Gitee From ba4f5a8df8810c02cdd8a796c4ed452554a5462d Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 26 Aug 2024 19:05:39 +0800 Subject: [PATCH 38/71] =?UTF-8?q?drivers=5Finterface=20display=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=A2=9E=E5=8A=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- .../v1_0/display_command/display_cmd_responser.h | 14 ++++++++++++-- .../v1_2/display_command/display_cmd_responser.h | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index aeea58c5..2bb76d02 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -74,8 +74,10 @@ public: DisplayCmdResponser(VdiImpl* impl, std::shared_ptr cacheMgr) : impl_(impl), cacheMgr_(cacheMgr), + std::lock_guard lock(request_mutex); request_(nullptr), isReplyUpdated_(false), + std::lock_guard lock(reply_mutex); reply_(nullptr), replyCommandCnt_(0) {} @@ -93,6 +95,7 @@ public: { DISPLAY_CHK_RETURN(request == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: error, request is nullptr", __func__)); + std::lock_guard lock(request_mutex); if (request_ != nullptr) { request_.reset(); } @@ -108,7 +111,8 @@ public: ret = InitReply(CmdUtils::INIT_ELEMENT_COUNT); } if (ret == HDF_SUCCESS) { - if (reply_ != nullptr) { + std::lock_guard lock(reply_mutex); + if (reply_ != nullptr) { reply = reply_; } else { ret = HDF_FAILURE; @@ -161,6 +165,7 @@ public: return HDF_FAILURE; } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); + std::lock_guard lock(request_mutex); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); @@ -200,6 +205,7 @@ public: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; + std::lock_guard lock(reply_mutex); ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { @@ -217,7 +223,7 @@ protected: HDF_LOGE("%{public}s: size:%{public}u is too large", __func__, size); return HDF_FAILURE; } - + std::lock_guard lock(reply_mutex); reply_ = std::make_shared(size, SmqType::SYNCED_SMQ); DISPLAY_CHK_RETURN(reply_ == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: reply_ construct failed", __func__)); @@ -1099,6 +1105,10 @@ protected: std::unordered_map errMaps_; /* fix fd leak */ std::queue delayFreeQueue_; +private: + std::mutex request_mutex; + std::mutex reply_mutex; + }; using HdiDisplayCmdResponser = DisplayCmdResponser, IDisplayComposerVdi>; } // namespace V1_0 diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index c2141f01..2f51d4cd 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -237,6 +237,7 @@ REPLY: std::vector& outFds) { std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); + std::lock_guard lock(request_mutex); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); @@ -276,7 +277,8 @@ REPLY: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, + std::lock_guard lock(reply_mutex); + ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); -- Gitee From 2e4a2c0b8f2901280d6662b70b3cde8f4d1572a8 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 02:17:26 +0000 Subject: [PATCH 39/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 2bb76d02..734926d9 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -111,8 +111,8 @@ public: ret = InitReply(CmdUtils::INIT_ELEMENT_COUNT); } if (ret == HDF_SUCCESS) { - std::lock_guard lock(reply_mutex); - if (reply_ != nullptr) { + std::lock_guard lock(reply_mutex); + if (reply_ != nullptr) { reply = reply_; } else { ret = HDF_FAILURE; @@ -165,7 +165,7 @@ public: return HDF_FAILURE; } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(request_mutex); + std::lock_guard lock(request_mutex); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); -- Gitee From cdae9785185bf4fc0c0f8177b813d4d2cbfa14aa Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 02:18:39 +0000 Subject: [PATCH 40/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 734926d9..7c940248 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -112,7 +112,7 @@ public: } if (ret == HDF_SUCCESS) { std::lock_guard lock(reply_mutex); - if (reply_ != nullptr) { + if (reply_ != nullptr) { reply = reply_; } else { ret = HDF_FAILURE; @@ -205,7 +205,7 @@ public: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(reply_mutex); + std::lock_guard lock(reply_mutex); ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { -- Gitee From fad73c1eea7e78088896dd8f3c72cc3c028a2d58 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 02:19:39 +0000 Subject: [PATCH 41/71] update display/composer/v1_2/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_2/display_command/display_cmd_responser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index 2f51d4cd..6459df20 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -237,7 +237,7 @@ REPLY: std::vector& outFds) { std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(request_mutex); + std::lock_guard lock(request_mutex); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); @@ -277,8 +277,8 @@ REPLY: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(reply_mutex); - ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, + std::lock_guard lock(reply_mutex); + ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); -- Gitee From eda00aff0a57c1603a57e879e05b5fb35506df88 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 02:27:41 +0000 Subject: [PATCH 42/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 7c940248..a535f93c 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -1107,7 +1107,7 @@ protected: std::queue delayFreeQueue_; private: std::mutex request_mutex; - std::mutex reply_mutex; + std::mutex reply_mutex; }; using HdiDisplayCmdResponser = DisplayCmdResponser, IDisplayComposerVdi>; -- Gitee From fec6a42c32fd8c760b9e76846d3bbf1b7c65d58d Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 02:29:15 +0000 Subject: [PATCH 43/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index a535f93c..15f4b50a 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -74,10 +74,8 @@ public: DisplayCmdResponser(VdiImpl* impl, std::shared_ptr cacheMgr) : impl_(impl), cacheMgr_(cacheMgr), - std::lock_guard lock(request_mutex); request_(nullptr), isReplyUpdated_(false), - std::lock_guard lock(reply_mutex); reply_(nullptr), replyCommandCnt_(0) {} -- Gitee From f3b9098adab49fed3cf64290072ad5c2d26ac254 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 03:38:31 +0000 Subject: [PATCH 44/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 1 - 1 file changed, 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 15f4b50a..260d9866 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -1106,7 +1106,6 @@ protected: private: std::mutex request_mutex; std::mutex reply_mutex; - }; using HdiDisplayCmdResponser = DisplayCmdResponser, IDisplayComposerVdi>; } // namespace V1_0 -- Gitee From a13c54a810345a37dc102e38f51f412641767ad3 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Tue, 27 Aug 2024 12:09:02 +0800 Subject: [PATCH 45/71] morify interface Signed-off-by: huangshengqing --- camera/v1_3/Types.idl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 27ac8254..91efc686 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -372,11 +372,11 @@ struct ImageBufferInfoExt { MapDataSequenceable metadata; /** - * @brief The information of ImageHandle. + * @brief The information of imageHandle. * @since 5.0 * @version 1.0 */ - BufferHandleSequenceable ImageHandle; + BufferHandleSequenceable imageHandle; /** * @brief If the gain map reported. @@ -453,14 +453,14 @@ struct ImageBufferInfoExt { * @since 5.0 * @version 1.0 */ - boolean isMakerValid; + boolean isMakerInfoValid; /** * @brief The maker information. * @since 5.0 * @version 1.0 */ - BufferHandleSequenceable makerHandle; + BufferHandleSequenceable makerInfoHandle; }; /** -- Gitee From 2dab435392a1e177a674beeedcf7944afed83259 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 05:44:20 +0000 Subject: [PATCH 46/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 260d9866..fe4bf6c7 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -1104,8 +1104,8 @@ protected: /* fix fd leak */ std::queue delayFreeQueue_; private: - std::mutex request_mutex; - std::mutex reply_mutex; + std::mutex requestMutex_; + std::mutex replyMutex_; }; using HdiDisplayCmdResponser = DisplayCmdResponser, IDisplayComposerVdi>; } // namespace V1_0 -- Gitee From 14ef322ab6658f4061359da1994997c72637a4b7 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 05:50:27 +0000 Subject: [PATCH 47/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../display_command/display_cmd_responser.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index fe4bf6c7..362c87c0 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -93,7 +93,7 @@ public: { DISPLAY_CHK_RETURN(request == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: error, request is nullptr", __func__)); - std::lock_guard lock(request_mutex); + std::lock_guard lock(requestMutex); if (request_ != nullptr) { request_.reset(); } @@ -109,7 +109,7 @@ public: ret = InitReply(CmdUtils::INIT_ELEMENT_COUNT); } if (ret == HDF_SUCCESS) { - std::lock_guard lock(reply_mutex); + std::lock_guard lock(replyMutex); if (reply_ != nullptr) { reply = reply_; } else { @@ -163,10 +163,11 @@ public: return HDF_FAILURE; } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(request_mutex); - int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); - + std::lock_guard lock(requestMutex); + { + int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); + } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); #ifdef DEBUG_DISPLAY_CMD_RAW_DATA @@ -203,7 +204,7 @@ public: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(reply_mutex); + std::lock_guard lock(replyMutex); ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { @@ -221,7 +222,7 @@ protected: HDF_LOGE("%{public}s: size:%{public}u is too large", __func__, size); return HDF_FAILURE; } - std::lock_guard lock(reply_mutex); + std::lock_guard lock(replyMutex); reply_ = std::make_shared(size, SmqType::SYNCED_SMQ); DISPLAY_CHK_RETURN(reply_ == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: reply_ construct failed", __func__)); -- Gitee From 9a1932df491fb799c4cfb7e4842b30c2e5ea74b3 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 05:52:43 +0000 Subject: [PATCH 48/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../v1_0/display_command/display_cmd_responser.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 362c87c0..8adb31aa 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -93,7 +93,7 @@ public: { DISPLAY_CHK_RETURN(request == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: error, request is nullptr", __func__)); - std::lock_guard lock(requestMutex); + std::lock_guard lock(requestMutex_); if (request_ != nullptr) { request_.reset(); } @@ -109,7 +109,7 @@ public: ret = InitReply(CmdUtils::INIT_ELEMENT_COUNT); } if (ret == HDF_SUCCESS) { - std::lock_guard lock(replyMutex); + std::lock_guard lock(replyMutex_); if (reply_ != nullptr) { reply = reply_; } else { @@ -163,7 +163,7 @@ public: return HDF_FAILURE; } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(requestMutex); + std::lock_guard lock(requestMutex_); { int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); @@ -204,7 +204,7 @@ public: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(replyMutex); + std::lock_guard lock(replyMutex_); ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { @@ -222,7 +222,7 @@ protected: HDF_LOGE("%{public}s: size:%{public}u is too large", __func__, size); return HDF_FAILURE; } - std::lock_guard lock(replyMutex); + std::lock_guard lock(replyMutex_); reply_ = std::make_shared(size, SmqType::SYNCED_SMQ); DISPLAY_CHK_RETURN(reply_ == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: reply_ construct failed", __func__)); -- Gitee From bf8a37003423bfa1f672a52ea504b961d628f1e7 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 05:53:49 +0000 Subject: [PATCH 49/71] update display/composer/v1_2/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_2/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index 6459df20..c7494a05 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -237,7 +237,7 @@ REPLY: std::vector& outFds) { std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(request_mutex); + std::lock_guard lock(requestMutex_); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); @@ -277,7 +277,7 @@ REPLY: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(reply_mutex); + std::lock_guard lock(replyMutex_); ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); if (ret != HDF_SUCCESS) { -- Gitee From 01a992f97510bf5fa1b4fb710409f4a7b45b48fa Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 06:25:16 +0000 Subject: [PATCH 50/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 8adb31aa..c8e63c12 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -163,8 +163,8 @@ public: return HDF_FAILURE; } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(requestMutex_); { + std::lock_guard lock(requestMutex_); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } -- Gitee From 9411c14e425c26457e8d10de1ea42b468a9411d4 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 06:26:45 +0000 Subject: [PATCH 51/71] update display/composer/v1_2/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../v1_2/display_command/display_cmd_responser.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index c7494a05..62235f8e 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -237,10 +237,11 @@ REPLY: std::vector& outFds) { std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); - std::lock_guard lock(requestMutex_); - int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); - + { + std::lock_guard lock(requestMutex_); + int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); + } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); #ifdef DEBUG_DISPLAY_CMD_RAW_DATA -- Gitee From f3e9618827d7657f1604834f9373e8952a59acea Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 06:59:18 +0000 Subject: [PATCH 52/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index c8e63c12..f04c777a 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -164,7 +164,7 @@ public: } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); { - std::lock_guard lock(requestMutex_); + std::lock_guard lock(requestMutex_); int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } -- Gitee From 5cba4be6557fa999538cfc3f89a5520857a04273 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 08:01:23 +0000 Subject: [PATCH 53/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index f04c777a..38cbf4e5 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -163,9 +163,10 @@ public: return HDF_FAILURE; } std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); + int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; -- Gitee From 5d1c2e66204b937e6d74946aa5a3a6d27e0f34d1 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 08:31:43 +0000 Subject: [PATCH 54/71] update display/composer/v1_2/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_2/display_command/display_cmd_responser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index 62235f8e..dc27995d 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -237,9 +237,10 @@ REPLY: std::vector& outFds) { std::shared_ptr requestData(new char[inEleCnt * CmdUtils::ELEMENT_SIZE], std::default_delete()); + int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - int32_t ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; -- Gitee From 81927b9a4eeb624a8f4438e247e72b150e02814a Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 09:06:19 +0000 Subject: [PATCH 55/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 1 - 1 file changed, 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 38cbf4e5..f2b27abb 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -1105,7 +1105,6 @@ protected: std::unordered_map errMaps_; /* fix fd leak */ std::queue delayFreeQueue_; -private: std::mutex requestMutex_; std::mutex replyMutex_; }; -- Gitee From 56879d1496aee9d77b6c814a47c3b705b21e67d3 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 09:07:41 +0000 Subject: [PATCH 56/71] update display/composer/v1_2/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_2/display_command/display_cmd_responser.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index dc27995d..02ad4cb9 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -349,6 +349,8 @@ private: using BaseType1_1::OnRequestEnd; using BaseType1_1::OnSetLayerColor; VdiImpl1_1* vdiImpl1_1_ = nullptr; + using BaseType1_1::requestMutex_; + using BaseType1_1::replyMutex_; }; using HdiDisplayCmdResponser = -- Gitee From 850847ba89679f723af60dfe67e16a131b6cdb37 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 12:16:50 +0000 Subject: [PATCH 57/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index f2b27abb..53dd3a7a 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -205,9 +205,11 @@ public: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(replyMutex_); - ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, + { + std::lock_guard lock(replyMutex_); + ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); + } if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); outEleCnt = 0; -- Gitee From debbc3aee247a7fa448038cca9326f3a5701bc00 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 12:19:49 +0000 Subject: [PATCH 58/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 53dd3a7a..a4a3ad0e 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -104,12 +104,12 @@ public: int32_t GetCmdReply(std::shared_ptr& reply) { + std::lock_guard lock(replyMutex_); int32_t ret = HDF_SUCCESS; if (isReplyUpdated_ == false) { ret = InitReply(CmdUtils::INIT_ELEMENT_COUNT); } if (ret == HDF_SUCCESS) { - std::lock_guard lock(replyMutex_); if (reply_ != nullptr) { reply = reply_; } else { @@ -208,7 +208,7 @@ public: { std::lock_guard lock(replyMutex_); ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); + CmdUtils::TRANSFER_WAIT_TIME); } if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); -- Gitee From 817db0c90dc2e704497bfa1f06e9df7116b576bd Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 12:33:37 +0000 Subject: [PATCH 59/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 1 - 1 file changed, 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index a4a3ad0e..d3295138 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -225,7 +225,6 @@ protected: HDF_LOGE("%{public}s: size:%{public}u is too large", __func__, size); return HDF_FAILURE; } - std::lock_guard lock(replyMutex_); reply_ = std::make_shared(size, SmqType::SYNCED_SMQ); DISPLAY_CHK_RETURN(reply_ == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: reply_ construct failed", __func__)); -- Gitee From aa385d9a28db0862cd31bd6eed96ef8ef230a51a Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 12:36:26 +0000 Subject: [PATCH 60/71] update display/composer/v1_2/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_2/display_command/display_cmd_responser.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_2/display_command/display_cmd_responser.h b/display/composer/v1_2/display_command/display_cmd_responser.h index 02ad4cb9..8ee58207 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -279,9 +279,11 @@ REPLY: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - std::lock_guard lock(replyMutex_); - ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); + { + std::lock_guard lock(replyMutex_); + ret = reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); + } if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); outEleCnt = 0; -- Gitee From 4c050538add0bc22047d832b9217490e63cd62a2 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 27 Aug 2024 13:11:48 +0000 Subject: [PATCH 61/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index d3295138..eb597d7c 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -166,8 +166,7 @@ public: int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); + ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt,CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); @@ -185,8 +184,7 @@ public: while (ret == HDF_SUCCESS && unpacker.NextSection()) { if (!unpacker.BeginSection(unpackCmd)) { - HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.", - CmdUtils::CommandToString(unpackCmd)); + HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.",CmdUtils::CommandToString(unpackCmd)); ret = HDF_FAILURE; } ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); -- Gitee From 526c7fe25b57390c5ee5606ea0978f83c6831022 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 28 Aug 2024 01:25:23 +0000 Subject: [PATCH 62/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index eb597d7c..d03e3f62 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -166,7 +166,7 @@ public: int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt,CmdUtils::TRANSFER_WAIT_TIME); + ret = request_->Read(reinterpret_cast(requestData.get()),inEleCnt,CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); @@ -184,7 +184,7 @@ public: while (ret == HDF_SUCCESS && unpacker.NextSection()) { if (!unpacker.BeginSection(unpackCmd)) { - HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.",CmdUtils::CommandToString(unpackCmd)); + HDF_LOGE("error: PackSection failed,unpackCmd=%{public}s.",CmdUtils::CommandToString(unpackCmd)); ret = HDF_FAILURE; } ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); -- Gitee From b7f4c9d516b2fd862f0f4bccf70c19f373c8e42b Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 28 Aug 2024 01:36:30 +0000 Subject: [PATCH 63/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index d03e3f62..edcbddeb 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -166,7 +166,7 @@ public: int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - ret = request_->Read(reinterpret_cast(requestData.get()),inEleCnt,CmdUtils::TRANSFER_WAIT_TIME); + ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt,CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); @@ -184,7 +184,7 @@ public: while (ret == HDF_SUCCESS && unpacker.NextSection()) { if (!unpacker.BeginSection(unpackCmd)) { - HDF_LOGE("error: PackSection failed,unpackCmd=%{public}s.",CmdUtils::CommandToString(unpackCmd)); + HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.", CmdUtils::CommandToString(unpackCmd)); ret = HDF_FAILURE; } ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); -- Gitee From 6726511bef99bbf4ee51bb2f0e07ce3e181af579 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 28 Aug 2024 01:58:19 +0000 Subject: [PATCH 64/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index edcbddeb..2ba33bb2 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -166,7 +166,7 @@ public: int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt,CmdUtils::TRANSFER_WAIT_TIME); + ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); -- Gitee From cda22d4bf09605f05e676459be7f3b08c902af5b Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 28 Aug 2024 02:13:10 +0000 Subject: [PATCH 65/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 2ba33bb2..4f076cad 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -166,7 +166,8 @@ public: int32_t ret = HDF_SUCCESS; { std::lock_guard lock(requestMutex_); - ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); + ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); } CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); @@ -190,8 +191,7 @@ public: ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); } - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: ProcessRequestCmd failed", __func__)); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret,HDF_LOGE("%{public}s: ProcessRequestCmd failed", __func__)); /* pack request end commands */ replyPacker_.PackEnd(CONTROL_CMD_REPLY_END); -- Gitee From 6bf3b39f728ec2624bc0aeda15c6599fd720007d Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 28 Aug 2024 02:28:26 +0000 Subject: [PATCH 66/71] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_responser.h b/display/composer/v1_0/display_command/display_cmd_responser.h index 4f076cad..2b050684 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -191,7 +191,7 @@ public: ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); } - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret,HDF_LOGE("%{public}s: ProcessRequestCmd failed", __func__)); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, HDF_LOGE("%{public}s:ProcessRequestCmd failed", __func__)); /* pack request end commands */ replyPacker_.PackEnd(CONTROL_CMD_REPLY_END); -- Gitee From 3bb6bf4270cbcc5410e260e80e689a204ed8af77 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Wed, 28 Aug 2024 17:56:20 +0800 Subject: [PATCH 67/71] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B8=A9=E6=8E=A7?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E5=92=8C=E7=9B=B8=E6=9C=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BDtag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghang133 --- .../include/camera_device_ability_items.h | 47 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 8 ++++ camera/metadata/src/camera_metadata_info.cpp | 4 ++ camera/v1_3/Types.idl | 15 ++++++ 4 files changed, 74 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 41ceacc3..559a5f51 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -420,6 +420,13 @@ typedef enum camera_device_metadata_tag { * (i.e. byte: 0-false/1-true ...) */ OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION, + /** + * ohos.device.protectionState [static, enum, public] + * + * camera device property, query current camera device protection state + * (i.e. enum: DeviceProtectionStatus ...) + */ + OHOS_DEVICE_PROTECTION_STATE, /** * ohos.camera.propertiesEnd * @@ -952,6 +959,27 @@ typedef enum camera_device_metadata_tag { * (i.e. enum: begin/end ...) */ OHOS_CONTROL_BURST_CAPTURE, + /** + * ohos.control.cameraSessionUsage [static, enum[], public] + * + * camera device property, set current camera session usage type whether enable + * (i.e. enum[]: [CameraSessionUsageType, CameraSessionUsageControlType] ...) + */ + OHOS_CONTROL_CAMERA_SESSION_USAGE, + /** + * ohos.control.ejectRetry [static, byte, public] + * + * camera device property, set current camera lens retry eject + * (i.e. byte: 0-false/1true ...) + */ + OHOS_CONTROL_EJECT_RETRY, + /** + * ohos.control.fallProtection [static, byte, public] + * + * camera device property, set current camera lens fall protection + * (i.e. byte: 0-false/1true ...) + */ + OHOS_CONTROL_FALL_PROTECTION, /** * ohos.device.controlEnd * @@ -2421,4 +2449,23 @@ enum DepthDataAccuracyType { OHOS_DEPTH_DATA_ACCURACY_ABSOLUTE, }; +// OHOS_CONTROL_CAMERA_SESSION_USAGE +enum CameraSessionUsageType { + OHOS_CAMERA_SESSION_USAGE_BOKEH = 0, +}; + +// OHOS_CONTROL_CAMERA_SESSION_USAGE +enum CameraSessionUsageControlType { + OHOS_CAMERA_SESSION_USAGE_DISABLE = 0, + OHOS_CAMERA_SESSION_USAGE_ENABLE = 1, +}; + +// OHOS_DEVICE_PROTECTION_STATE +enum DeviceProtectionStatus { + OHOS_DEVICE_SWITCH_FREQUENT = 0, + OHOS_DEVICE_EXTERNAL_PRESS = 1, + OHOS_DEVICE_EJECT_BLOCK = 2, + OHOS_DEVICE_FALL_PROTECTION = 3, +}; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index b94b2162..58526b4f 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -134,6 +134,8 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"lowLightDetection", META_TYPE_BYTE, 1}, [OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION - OHOS_CAMERA_PROPERTIES_START] = {"cameraLensDirtyDetection", META_TYPE_BYTE, 1}, + [OHOS_DEVICE_PROTECTION_STATE - + OHOS_CAMERA_PROPERTIES_START] = {"protectionState", META_TYPE_BYTE, 1}, }; static item_info_t g_ohosCameraSensor[OHOS_CAMERA_SENSOR_END - OHOS_CAMERA_SENSOR_START] = { @@ -247,6 +249,12 @@ static item_info_t g_ohosCameraControl[OHOS_DEVICE_CONTROL_END - OHOS_DEVICE_CON [OHOS_CONTROL_HIGH_QUALITY_MODE - OHOS_DEVICE_CONTROL_START] = {"highQualityMode", META_TYPE_BYTE, 1}, [OHOS_CONTROL_BURST_CAPTURE - OHOS_DEVICE_CONTROL_START] = {"cameraControlBurstCapture", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_CAMERA_SESSION_USAGE - + OHOS_DEVICE_CONTROL_START] = {"cameraSessionUsage", META_TYPE_INT32, 1}, + [OHOS_CONTROL_EJECT_RETRY - + OHOS_DEVICE_CONTROL_START] = {"ejectRetry", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_FALL_PROTECTION - + OHOS_DEVICE_CONTROL_START] = {"fallProtection", META_TYPE_BYTE, 1}, }; static item_info_t g_ohosDeviceExposure[OHOS_DEVICE_EXPOSURE_END - OHOS_DEVICE_EXPOSURE_START] = { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 7b6556ca..41095acd 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -77,6 +77,7 @@ const std::vector g_metadataTags = { OHOS_CONTROL_LOW_LIGHT_BOOST, OHOS_STATUS_LOW_LIGHT_DETECTION, OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION, + OHOS_DEVICE_PROTECTION_STATE, OHOS_SENSOR_EXPOSURE_TIME, OHOS_SENSOR_COLOR_CORRECTION_GAINS, @@ -153,6 +154,9 @@ const std::vector g_metadataTags = { OHOS_CONTROL_SENSOR_WB_VALUE, OHOS_CONTROL_HIGH_QUALITY_MODE, OHOS_CONTROL_BURST_CAPTURE, + OHOS_CONTROL_CAMERA_SESSION_USAGE, + OHOS_CONTROL_EJECT_RETRY, + OHOS_CONTROL_FALL_PROTECTION, // Camera device image acquisition related OHOS_ABILITY_DEVICE_AVAILABLE_EXPOSUREMODES, diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 91efc686..01c1dc75 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -473,4 +473,19 @@ enum EncodeType : ohos.hdi.camera.v1_0.EncodeType { * HEIC */ ENCODE_TYPE_HEIC = 4, +}; + +/** + * @brief Enumerates stream error types, which are used by {@link CaptureErrorInfo}. + * @since 3.2 + * @version 1.1 + */ +enum StreamError : ohos.hdi.camera.v1_0.StreamError { + /** + * When the sensor temperature is higher than the threshold, the cameraHal will stop the sketch stream + * and report the high temperature error through by {@link OnCaptureError}. + * @since 5.0 + * @version 1.0 + */ + HIGH_TEMPERATURE_ERROR = 2, }; \ No newline at end of file -- Gitee From e091e5539c12d157503986e72824c1066ddc3add Mon Sep 17 00:00:00 2001 From: suxiaosu007 Date: Fri, 30 Aug 2024 09:24:18 +0800 Subject: [PATCH 68/71] image HDI code sync Signed-off-by: suxiaosu007 --- codec/image/v2_0/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/codec/image/v2_0/BUILD.gn b/codec/image/v2_0/BUILD.gn index 322de27b..56234a1b 100644 --- a/codec/image/v2_0/BUILD.gn +++ b/codec/image/v2_0/BUILD.gn @@ -26,7 +26,6 @@ if (defined(ohos_lite)) { "ICodecImage.idl", ] language = "cpp" - innerapi_tags = [ "platformsdk" ] subsystem_name = "hdf" part_name = "drivers_interface_codec" } -- Gitee From 3bef632589f82170e4f5ba0c7894e3e7f699b291 Mon Sep 17 00:00:00 2001 From: xionglei Date: Fri, 30 Aug 2024 15:13:19 +0800 Subject: [PATCH 69/71] =?UTF-8?q?up=20down=20=E7=BD=91=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xionglei --- wlan/chip/v1_0/IChipIface.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/wlan/chip/v1_0/IChipIface.idl b/wlan/chip/v1_0/IChipIface.idl index 678bc36a..22df6ba2 100644 --- a/wlan/chip/v1_0/IChipIface.idl +++ b/wlan/chip/v1_0/IChipIface.idl @@ -13,6 +13,7 @@ * limitations under the License. */ + /** * @addtogroup CHIP * @{ -- Gitee From 5526aaad775dde19d63d375af299702226dbe04f Mon Sep 17 00:00:00 2001 From: xionglei Date: Fri, 30 Aug 2024 07:42:29 +0000 Subject: [PATCH 70/71] update wlan/chip/v1_0/IChipIface.idl. Signed-off-by: xionglei --- wlan/chip/v1_0/IChipIface.idl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wlan/chip/v1_0/IChipIface.idl b/wlan/chip/v1_0/IChipIface.idl index 22df6ba2..4baf0fdd 100644 --- a/wlan/chip/v1_0/IChipIface.idl +++ b/wlan/chip/v1_0/IChipIface.idl @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * @addtogroup CHIP * @{ @@ -283,5 +282,18 @@ interface IChipIface { * @version 1.0 */ SetTxPower([in] int power); + + /** + * @brief Set interface up or down, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @param state Indicates the iface state. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SetIfaceState([in] boolean state); }; /** @} */ \ No newline at end of file -- Gitee From 1c459cfa67df3e5c4e7383b1b682f3ad3860d2eb Mon Sep 17 00:00:00 2001 From: yangjian90 Date: Tue, 3 Sep 2024 10:40:06 +0800 Subject: [PATCH 71/71] =?UTF-8?q?wifi=20hal=20=E6=8E=A5=E5=8F=A3=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjian90 --- wlan/chip/v1_0/IChipIface.idl | 58 +++++++++++++++++++++++++++ wlan/chip/v1_0/IChipIfaceCallback.idl | 11 +++++ wlan/chip/v1_0/IConcreteChip.idl | 44 ++++++++++++++++++++ 3 files changed, 113 insertions(+) diff --git a/wlan/chip/v1_0/IChipIface.idl b/wlan/chip/v1_0/IChipIface.idl index 4baf0fdd..1596635a 100644 --- a/wlan/chip/v1_0/IChipIface.idl +++ b/wlan/chip/v1_0/IChipIface.idl @@ -295,5 +295,63 @@ interface IChipIface { * @version 1.0 */ SetIfaceState([in] boolean state); + + /** + * @brief Send private commond to driver, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @param uid Indicates the current uid. + * @param protocol Indicates the rule. + * @param enable Indicates the mode. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendCmdToDriver([in] String ifName, [in] int cmdId, [in] byte[] paramBuf); + + /** + * @brief send action frame to driver, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @param ifName Indicates the NIC name. + * @param freq Indicates the send channel frequency. + * @param ifName Indicates the action frame data. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendActionFrame([in] String ifName, [in] unsigned int freq, [in] unsigned char[] frameData); + + /** + * @brief register action frame receiver, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @param ifName Indicates the NIC name. + * @param txChannel Indicates the data matching action frame. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + RegisterActionFrameReceiver([in] String ifName, [in] unsigned char[] match); + + /** + * @brief get coex channel list, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @param ifName Indicates the NIC name. + * @param paramBuf coex channel list. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetCoexictenceChannelList([in] String ifName, [out] unsigned char[] paramBuf); }; /** @} */ \ No newline at end of file diff --git a/wlan/chip/v1_0/IChipIfaceCallback.idl b/wlan/chip/v1_0/IChipIfaceCallback.idl index 11237a5e..2afe8d0b 100644 --- a/wlan/chip/v1_0/IChipIfaceCallback.idl +++ b/wlan/chip/v1_0/IChipIfaceCallback.idl @@ -72,5 +72,16 @@ import ohos.hdi.wlan.chip.v1_0.ChipTypes; * @version 1.0 */ [oneway] OnRssiReport([in] int index, [in] int c0Rssi, [in] int c1Rssi); + + /** + * @brief Called to process the Netlink message received, This interface is preferentially used to + * communicate with the Wi-Fi service. + * + * @param recvMsg Indicates the Netlink message received. + * + * @since 5.0 + * @version 1.0 + */ + [oneway] OnWifiNetlinkMessage([in] unsigned char[] recvMsg); }; /** @} */ \ No newline at end of file diff --git a/wlan/chip/v1_0/IConcreteChip.idl b/wlan/chip/v1_0/IConcreteChip.idl index 1ed02e8a..4ce8be97 100644 --- a/wlan/chip/v1_0/IConcreteChip.idl +++ b/wlan/chip/v1_0/IConcreteChip.idl @@ -285,5 +285,49 @@ interface IConcreteChip { * @version 1.0 */ SetChipMode([in] unsigned int modeId); + + /** + * @brief Creates the extend private interface service, This interface is preferentially used to communicate with + * the Wi-Fi service. + * + * @param ifName Indicates extend interface service name. + * @param iface Indicates extend interface service object. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + CreateExtService([in] String ifName, [out] IChipIface iface); + + /** + * @brief Obtains the service of the extend interface, This interface is preferentially used to communicate + * with the Wi-Fi service. + * + * @param ifName Indicates extend interface service name. + * @param iface Indicates the extend interface service object. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExtService([in] String ifName, [out] IChipIface iface); + + /** + * @brief Deletes the service of the extend interface, This interface is preferentially used to + * communicate with the Wi-Fi service. + * + * @param ifName Indicates extend interface service name. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + RemoveExtService([in] String ifName); }; /** @} */ \ No newline at end of file -- Gitee