From 7bf4717def9fbe9183ac38a2315449845d9bc900 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Fri, 2 Aug 2024 14:52:08 +0800 Subject: [PATCH 001/347] =?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 002/347] 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 003/347] 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 004/347] 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 005/347] 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 006/347] 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 007/347] 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 008/347] 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 009/347] 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 010/347] 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 011/347] 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 012/347] 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 013/347] 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 014/347] 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 015/347] 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 016/347] 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 017/347] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=A5=E5=8F=82dat?= =?UTF-8?q?atype=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 018/347] 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 019/347] 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 020/347] =?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 021/347] 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 022/347] 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 023/347] 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 024/347] 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 025/347] 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 026/347] 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 027/347] 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 028/347] 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 029/347] 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 030/347] =?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 031/347] 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 032/347] 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 033/347] 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 034/347] 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 035/347] 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 036/347] =?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 037/347] =?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 038/347] =?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 039/347] 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 040/347] 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 041/347] 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 042/347] 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 043/347] 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 044/347] 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 045/347] 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 046/347] 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 047/347] 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 048/347] 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 049/347] 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 050/347] 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 051/347] 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 052/347] 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 053/347] 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 054/347] 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 055/347] 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 056/347] 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 057/347] 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 058/347] 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 059/347] 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 060/347] 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 061/347] 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 062/347] 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 063/347] 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 064/347] 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 065/347] 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 066/347] 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 067/347] =?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 068/347] 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 069/347] =?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 070/347] 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 071/347] =?UTF-8?q?wifi=20hal=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=80=82=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 From d48f739ed2e177679acd5efe7b43347117e83fa7 Mon Sep 17 00:00:00 2001 From: Xianru Chen Date: Tue, 3 Sep 2024 22:21:23 +0800 Subject: [PATCH 072/347] nv refresh indication Signed-off-by: Xianru Chen --- ril/v1_3/IRilCallback.idl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ril/v1_3/IRilCallback.idl b/ril/v1_3/IRilCallback.idl index b655ec71..847b0c31 100644 --- a/ril/v1_3/IRilCallback.idl +++ b/ril/v1_3/IRilCallback.idl @@ -79,5 +79,29 @@ import ohos.hdi.ril.v1_3.Types; * @version 1.1 */ [oneway] GetSimCardStatusResponse([in] struct RilRadioResponseInfo responseInfo, [in] struct SimCardStatusInfo result); + + /** + * @brief Reporting NV refresh result. + * + * @param responseInfo Common response information, such as the card slot ID and request sequence ID. For details, + * see {@link RilRadioResponseInfo}. + * @param state NV refresh result. + * + * @since 5.0 + * @version 1.3 + */ + [oneway] NcfgFinishedResult([in] struct RilRadioResponseInfo responseInfo, [in] int state); + + /** + * @brief Reporting restart rild Nv match state. + * + * @param responseInfo Common response information, such as the card slot ID and request sequence ID. For details, + * see {@link RilRadioResponseInfo}. + * @param state restart rild Nv match state. + * + * @since 5.0 + * @version 1.3 + */ + [oneway] RestartRildNvMatch([in] struct RilRadioResponseInfo responseInfo, [in] int state); } /** @} */ -- Gitee From f04bf3d90530aa7a75c113a0451f1d89ad20da57 Mon Sep 17 00:00:00 2001 From: Xianru Chen Date: Wed, 4 Sep 2024 12:42:49 +0000 Subject: [PATCH 073/347] update ril/v1_3/IRilCallback.idl. Signed-off-by: Xianru Chen --- ril/v1_3/IRilCallback.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ril/v1_3/IRilCallback.idl b/ril/v1_3/IRilCallback.idl index 847b0c31..db813dd2 100644 --- a/ril/v1_3/IRilCallback.idl +++ b/ril/v1_3/IRilCallback.idl @@ -88,7 +88,7 @@ import ohos.hdi.ril.v1_3.Types; * @param state NV refresh result. * * @since 5.0 - * @version 1.3 + * @version 1.0 */ [oneway] NcfgFinishedResult([in] struct RilRadioResponseInfo responseInfo, [in] int state); @@ -100,7 +100,7 @@ import ohos.hdi.ril.v1_3.Types; * @param state restart rild Nv match state. * * @since 5.0 - * @version 1.3 + * @version 1.0 */ [oneway] RestartRildNvMatch([in] struct RilRadioResponseInfo responseInfo, [in] int state); } -- Gitee From c837add46806e90dd92095d550c2308afda392c8 Mon Sep 17 00:00:00 2001 From: zhaohui91 Date: Fri, 6 Sep 2024 12:12:24 +0800 Subject: [PATCH 074/347] rli add pac cfi Signed-off-by: zhaohui91 --- ril/v1_2/BUILD.gn | 1 + ril/v1_3/BUILD.gn | 1 + 2 files changed, 2 insertions(+) diff --git a/ril/v1_2/BUILD.gn b/ril/v1_2/BUILD.gn index 776d7b11..5e0ad2e7 100644 --- a/ril/v1_2/BUILD.gn +++ b/ril/v1_2/BUILD.gn @@ -20,6 +20,7 @@ if (defined(ohos_lite)) { } } else { hdi("ril") { + branch_protector_ret = "pac_ret" module_name = "ril_service" imports = [ "ohos.hdi.ril.v1_1:ril" ] sources = [ diff --git a/ril/v1_3/BUILD.gn b/ril/v1_3/BUILD.gn index 6913ad6c..b7364167 100644 --- a/ril/v1_3/BUILD.gn +++ b/ril/v1_3/BUILD.gn @@ -20,6 +20,7 @@ if (defined(ohos_lite)) { } } else { hdi("ril") { + branch_protector_ret = "pac_ret" module_name = "ril_service" imports = [ "ohos.hdi.ril.v1_2:ril" ] sources = [ -- Gitee From ed2482aabccee15096dae3cdd94356ff44143b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sat, 7 Sep 2024 15:00:59 +0800 Subject: [PATCH 075/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- audio/v3_0/BUILD.gn | 2 ++ audio/v4_0/BUILD.gn | 2 ++ display/buffer/v1_0/BUILD.gn | 5 +++++ display/buffer/v1_1/BUILD.gn | 3 +++ display/buffer/v1_2/BUILD.gn | 6 ++++++ 5 files changed, 18 insertions(+) diff --git a/audio/v3_0/BUILD.gn b/audio/v3_0/BUILD.gn index e7f3a018..baaf34b8 100644 --- a/audio/v3_0/BUILD.gn +++ b/audio/v3_0/BUILD.gn @@ -31,6 +31,8 @@ if (defined(ohos_lite)) { "IAudioRender.idl", ] + branch_protector_ret = "pac_ret" + language = "c" subsystem_name = "hdf" part_name = "drivers_interface_audio" diff --git a/audio/v4_0/BUILD.gn b/audio/v4_0/BUILD.gn index a558ef93..a7fc3699 100644 --- a/audio/v4_0/BUILD.gn +++ b/audio/v4_0/BUILD.gn @@ -31,6 +31,8 @@ if (defined(ohos_lite)) { "IAudioRender.idl", ] + branch_protector_ret = "pac_ret" + language = "c" subsystem_name = "hdf" part_name = "drivers_interface_audio" diff --git a/display/buffer/v1_0/BUILD.gn b/display/buffer/v1_0/BUILD.gn index f6cddedd..249dec9c 100644 --- a/display/buffer/v1_0/BUILD.gn +++ b/display/buffer/v1_0/BUILD.gn @@ -27,6 +27,8 @@ hdi("display_buffer") { "platformsdk_indirect", ] + branch_protector_ret = "pac_ret" + language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" @@ -58,5 +60,8 @@ ohos_shared_library("libdisplay_buffer_hdi_impl") { "chipsetsdk_indirect", "platformsdk_indirect", ] + + branch_protector_ret = "pac_ret" + part_name = "drivers_interface_display" } diff --git a/display/buffer/v1_1/BUILD.gn b/display/buffer/v1_1/BUILD.gn index e9dde500..647b046f 100644 --- a/display/buffer/v1_1/BUILD.gn +++ b/display/buffer/v1_1/BUILD.gn @@ -21,6 +21,9 @@ hdi("display_buffer") { "chipsetsdk_indirect", "platformsdk_indirect", ] + + branch_protector_ret = "pac_ret" + language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" diff --git a/display/buffer/v1_2/BUILD.gn b/display/buffer/v1_2/BUILD.gn index 436b6843..f3975441 100644 --- a/display/buffer/v1_2/BUILD.gn +++ b/display/buffer/v1_2/BUILD.gn @@ -25,6 +25,9 @@ hdi("display_buffer") { "chipsetsdk_indirect", "platformsdk_indirect", ] + + branch_protector_ret = "pac_ret" + language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" @@ -64,5 +67,8 @@ ohos_shared_library("libdisplay_buffer_hdi_impl_v1_2") { "chipsetsdk_indirect", "platformsdk_indirect", ] + + branch_protector_ret = "pac_ret" + part_name = "drivers_interface_display" } -- Gitee From 26a06f35b5c16fb600476ea0de9d3cc331cf242b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sat, 7 Sep 2024 15:01:54 +0800 Subject: [PATCH 076/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/buffer/v1_1/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/display/buffer/v1_1/BUILD.gn b/display/buffer/v1_1/BUILD.gn index 647b046f..8dbaae28 100644 --- a/display/buffer/v1_1/BUILD.gn +++ b/display/buffer/v1_1/BUILD.gn @@ -61,5 +61,8 @@ ohos_shared_library("libdisplay_buffer_hdi_impl_v1_1") { "chipsetsdk_indirect", "platformsdk_indirect", ] + + branch_protector_ret = "pac_ret" + part_name = "drivers_interface_display" } -- Gitee From c5bba25a29617647c3dc0cc3178dde163047fc9e Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 14:39:57 +0800 Subject: [PATCH 077/347] =?UTF-8?q?drivers=5Finterface=20display=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E9=94=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- .../display_command/display_cmd_responser.h | 39 +++++++++++++------ .../display_command/display_cmd_responser.h | 17 +++----- 2 files changed, 33 insertions(+), 23 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 2b050684..e46f2cb5 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -163,13 +163,8 @@ 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_); - ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); - } - CommandDataUnpacker unpacker; + int32_t ret = CmdRequestDataRead(requestData, inEleCnt); + CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); #ifdef DEBUG_DISPLAY_CMD_RAW_DATA unpacker.Dump(); @@ -203,11 +198,7 @@ public: /* 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); - } + ret = CmdRequestDataWrite(outEleCnt); if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); outEleCnt = 0; @@ -217,6 +208,30 @@ public: } protected: + int32_t CmdRequestDataRead(std::shared_ptr requestData, uint32_t inEleCnt) + { + std::lock_guard lock(requestMutex_); + if (request_ == nullptr || requestData == nullptr) { + HDF_LOGE("%{public}s: inEleCnt: %{public}u request_ is nullptr", __func__, inEleCnt); + return HDF_FAILURE; + } + return request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); + } + + int32_t CmdRequestDataWrite(uint32_t outEleCnt) + { + std::lock_guard lock(replyMutex_); + if (reply_ == nullptr) { + HDF_LOGE("%{public}s: reply_ is nullptr", __func__); + return HDF_FAILURE; + } + return reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); + } + + + int32_t InitReply(uint32_t size) { if (size > CmdUtils::MAX_MEMORY) { 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 8ee58207..21c0f438 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -237,12 +237,8 @@ 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_); - ret = request_->Read(reinterpret_cast(requestData.get()), inEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); - } + int32_t ret = CmdRequestDataRead(requestData, inEleCnt); + CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); #ifdef DEBUG_DISPLAY_CMD_RAW_DATA @@ -279,11 +275,8 @@ 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); - } + ret = CmdRequestDataWrite(outEleCnt); + if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); outEleCnt = 0; @@ -350,6 +343,8 @@ private: using BaseType1_1::OnSetLayerMaskInfo; using BaseType1_1::OnRequestEnd; using BaseType1_1::OnSetLayerColor; + using BaseType1_1::CmdRequestDataRead; + using BaseType1_1::CmdRequestDataWrite; VdiImpl1_1* vdiImpl1_1_ = nullptr; using BaseType1_1::requestMutex_; using BaseType1_1::replyMutex_; -- Gitee From 83b3ae0298c6016fd7404fd8fa4305233cddb496 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 06:52:40 +0000 Subject: [PATCH 078/347] 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, 1 insertion(+), 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 21c0f438..2fe08a55 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -343,7 +343,7 @@ private: using BaseType1_1::OnSetLayerMaskInfo; using BaseType1_1::OnRequestEnd; using BaseType1_1::OnSetLayerColor; - using BaseType1_1::CmdRequestDataRead; + using BaseType1_1::CmdRequestDataRead; using BaseType1_1::CmdRequestDataWrite; VdiImpl1_1* vdiImpl1_1_ = nullptr; using BaseType1_1::requestMutex_; -- Gitee From 93da3fe134725b113d92c3ab8617c7a9fd921b98 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 06:53:32 +0000 Subject: [PATCH 079/347] 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 e46f2cb5..fff602d8 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()); int32_t ret = CmdRequestDataRead(requestData, inEleCnt); - CommandDataUnpacker unpacker; + CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); #ifdef DEBUG_DISPLAY_CMD_RAW_DATA unpacker.Dump(); -- Gitee From a839eedb916865a59bd1c21c5bea9534e2507b4c Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 06:55:11 +0000 Subject: [PATCH 080/347] 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 2fe08a55..ca2ec2bd 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()); - int32_t ret = CmdRequestDataRead(requestData, inEleCnt); + int32_t ret = CmdRequestDataRead(requestData, inEleCnt); CommandDataUnpacker unpacker; unpacker.Init(requestData.get(), inEleCnt << CmdUtils::MOVE_SIZE); @@ -275,7 +275,7 @@ REPLY: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; - ret = CmdRequestDataWrite(outEleCnt); + ret = CmdRequestDataWrite(outEleCnt); if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); -- Gitee From 7b40905e4e4c7a7411ec40e1ec8fd8df9085420f Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 06:56:47 +0000 Subject: [PATCH 081/347] 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, 4 insertions(+), 6 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 fff602d8..d8d44150 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -209,7 +209,7 @@ public: protected: int32_t CmdRequestDataRead(std::shared_ptr requestData, uint32_t inEleCnt) - { + { std::lock_guard lock(requestMutex_); if (request_ == nullptr || requestData == nullptr) { HDF_LOGE("%{public}s: inEleCnt: %{public}u request_ is nullptr", __func__, inEleCnt); @@ -217,10 +217,10 @@ protected: } return request_->Read(reinterpret_cast(requestData.get()), inEleCnt, CmdUtils::TRANSFER_WAIT_TIME); - } + } int32_t CmdRequestDataWrite(uint32_t outEleCnt) - { + { std::lock_guard lock(replyMutex_); if (reply_ == nullptr) { HDF_LOGE("%{public}s: reply_ is nullptr", __func__); @@ -228,9 +228,7 @@ protected: } return reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); - } - - + } int32_t InitReply(uint32_t size) { -- Gitee From f4e01d5085126144a772695f957508bb50415101 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 07:00:40 +0000 Subject: [PATCH 082/347] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../display_command/display_cmd_responser.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 d8d44150..5336748a 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -210,23 +210,23 @@ public: protected: int32_t CmdRequestDataRead(std::shared_ptr requestData, uint32_t inEleCnt) { - std::lock_guard lock(requestMutex_); - if (request_ == nullptr || requestData == nullptr) { + std::lock_guard lock(requestMutex_); + if (request_ == nullptr || requestData == nullptr) { HDF_LOGE("%{public}s: inEleCnt: %{public}u request_ is nullptr", __func__, inEleCnt); - return HDF_FAILURE; - } - return request_->Read(reinterpret_cast(requestData.get()), inEleCnt, - CmdUtils::TRANSFER_WAIT_TIME); + return HDF_FAILURE; + } + return request_->Read(reinterpret_cast(requestData.get()), inEleCnt, + CmdUtils::TRANSFER_WAIT_TIME); } int32_t CmdRequestDataWrite(uint32_t outEleCnt) { - std::lock_guard lock(replyMutex_); - if (reply_ == nullptr) { + std::lock_guard lock(replyMutex_); + if (reply_ == nullptr) { HDF_LOGE("%{public}s: reply_ is nullptr", __func__); return HDF_FAILURE; } - return reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, + return reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } -- Gitee From b2355b3ffbf1e2ac5beb29e954c767798ecee0bf Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 9 Sep 2024 07:02:30 +0000 Subject: [PATCH 083/347] 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 5336748a..da3d35fe 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,7 @@ protected: if (reply_ == nullptr) { HDF_LOGE("%{public}s: reply_ is nullptr", __func__); return HDF_FAILURE; - } + } return reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); } -- Gitee From 99cd360a564f092e94239b4ef08bc529ed15427e Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 10 Sep 2024 01:55:29 +0000 Subject: [PATCH 084/347] 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 da3d35fe..91e5b28c 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -224,7 +224,7 @@ protected: std::lock_guard lock(replyMutex_); if (reply_ == nullptr) { HDF_LOGE("%{public}s: reply_ is nullptr", __func__); - return HDF_FAILURE; + return HDF_FAILURE; } return reply_->Write(reinterpret_cast(replyPacker_.GetDataPtr()), outEleCnt, CmdUtils::TRANSFER_WAIT_TIME); -- Gitee From 983f4b22967d49913ec7c4b45bcebd0ad8d163e0 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 10 Sep 2024 01:56:02 +0000 Subject: [PATCH 085/347] 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 | 1 - 1 file changed, 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 ca2ec2bd..ea566de2 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -276,7 +276,6 @@ REPLY: /* Write reply pack */ outEleCnt = replyPacker_.ValidSize() >> CmdUtils::MOVE_SIZE; ret = CmdRequestDataWrite(outEleCnt); - if (ret != HDF_SUCCESS) { HDF_LOGE("Reply write failure, ret=%{public}d", ret); outEleCnt = 0; -- Gitee From d081f36760f71671ed04b964e2f8a7df3c88c793 Mon Sep 17 00:00:00 2001 From: cwx1272435 Date: Tue, 10 Sep 2024 02:33:57 +0000 Subject: [PATCH 086/347] Rectification of high-risk processes and increase configuration Signed-off-by: cwx1272435 --- memorytracker/v1_0/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/memorytracker/v1_0/BUILD.gn b/memorytracker/v1_0/BUILD.gn index c3b600b2..88c89ffa 100644 --- a/memorytracker/v1_0/BUILD.gn +++ b/memorytracker/v1_0/BUILD.gn @@ -13,6 +13,7 @@ import("//build/config/components/hdi/hdi.gni") hdi("memorytracker") { + branch_protector_ret = "pac_ret" module_name = "memory_tracker_interface_service" sources = [ "IMemoryTrackerInterface.idl", -- Gitee From e93972bc64e24817557f63f199e4474bdc2d6583 Mon Sep 17 00:00:00 2001 From: byndyx Date: Tue, 10 Sep 2024 14:46:17 +0800 Subject: [PATCH 087/347] open PAC Signed-off-by: byndyx --- distributed_audio/audio/v1_0/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/distributed_audio/audio/v1_0/BUILD.gn b/distributed_audio/audio/v1_0/BUILD.gn index 240a73b7..487b8b88 100644 --- a/distributed_audio/audio/v1_0/BUILD.gn +++ b/distributed_audio/audio/v1_0/BUILD.gn @@ -22,6 +22,7 @@ hdi("daudio") { "IAudioManager.idl", "IAudioRender.idl", ] + branch_protector_ret = "pac_ret" language = "cpp" root = "ohos.hdi://drivers/interface/" subsystem_name = "hdf" -- Gitee From 2b7fe39eff9a1ea9b8a00616b6f87384e3d8d8ea Mon Sep 17 00:00:00 2001 From: w30052974 Date: Tue, 10 Sep 2024 16:20:21 +0800 Subject: [PATCH 088/347] =?UTF-8?q?nnrt=20hdi=20branch=5Fprotector=5Fret?= =?UTF-8?q?=20=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: w30052974 --- nnrt/v1_0/BUILD.gn | 1 + nnrt/v2_0/BUILD.gn | 1 + nnrt/v2_1/BUILD.gn | 1 + 3 files changed, 3 insertions(+) diff --git a/nnrt/v1_0/BUILD.gn b/nnrt/v1_0/BUILD.gn index e125f884..a62afba7 100644 --- a/nnrt/v1_0/BUILD.gn +++ b/nnrt/v1_0/BUILD.gn @@ -14,6 +14,7 @@ import("//build/config/components/hdi/hdi.gni") hdi("nnrt") { module_name = "nnrt" + branch_protector_ret = "pac_ret" sources = [ "INnrtDevice.idl", "IPreparedModel.idl", diff --git a/nnrt/v2_0/BUILD.gn b/nnrt/v2_0/BUILD.gn index f0b8408b..ae6b9d83 100644 --- a/nnrt/v2_0/BUILD.gn +++ b/nnrt/v2_0/BUILD.gn @@ -14,6 +14,7 @@ import("//build/config/components/hdi/hdi.gni") hdi("nnrt") { module_name = "nnrt" + branch_protector_ret = "pac_ret" sources = [ "INnrtDevice.idl", "IPreparedModel.idl", diff --git a/nnrt/v2_1/BUILD.gn b/nnrt/v2_1/BUILD.gn index 93393a93..0557cff9 100644 --- a/nnrt/v2_1/BUILD.gn +++ b/nnrt/v2_1/BUILD.gn @@ -14,6 +14,7 @@ import("//build/config/components/hdi/hdi.gni") hdi("nnrt") { module_name = "nnrt" + branch_protector_ret = "pac_ret" sources = [ "INnrtDevice.idl", "IPreparedModel.idl", -- Gitee From df346d805fab49a5a6da34471005f568fc1951e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Tue, 10 Sep 2024 11:29:12 +0000 Subject: [PATCH 089/347] update audio/v4_0/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/v4_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/v4_0/BUILD.gn b/audio/v4_0/BUILD.gn index a558ef93..bcee3348 100644 --- a/audio/v4_0/BUILD.gn +++ b/audio/v4_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("libaudio_proxy_4.0") { -- Gitee From ac9904c4e77ac3566ae1826b83ff1b856f522b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Tue, 10 Sep 2024 11:30:04 +0000 Subject: [PATCH 090/347] update audio/effect/v1_0/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/effect/v1_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/effect/v1_0/BUILD.gn b/audio/effect/v1_0/BUILD.gn index 7c9f1a81..7e68c1c2 100644 --- a/audio/effect/v1_0/BUILD.gn +++ b/audio/effect/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("libeffect_proxy_1.0") { -- Gitee From 12c2ecb850b9856ed5a0af7226f66ba3e6c7e1c9 Mon Sep 17 00:00:00 2001 From: zhangqin88 Date: Wed, 11 Sep 2024 01:37:11 +0000 Subject: [PATCH 091/347] update wlan/v1_1/BUILD.gn. Signed-off-by: zhangqin88 --- wlan/v1_1/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/wlan/v1_1/BUILD.gn b/wlan/v1_1/BUILD.gn index 58145e5d..698ab2b8 100644 --- a/wlan/v1_1/BUILD.gn +++ b/wlan/v1_1/BUILD.gn @@ -19,6 +19,7 @@ if (defined(ohos_lite)) { } } else { hdi("wlan") { + branch_protector_ret = "pac_ret" module_name = "wlan_service" sources = [ -- Gitee From 3473b10e0e320c6aa61a6cb908680ee7e52b6dea Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Thu, 12 Sep 2024 10:14:44 +0800 Subject: [PATCH 092/347] add new interface Signed-off-by: huangshengqing --- camera/v1_3/Types.idl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 01c1dc75..d59aa0e9 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -170,6 +170,21 @@ enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { * Extended stream information of gainmap. */ EXTENDED_STREAM_INFO_GAINMAP = 8, + + /** + * Extended stream information of unrefocus. + */ + EXTENDED_STREAM_INFO_UNREFOCUS = 9, + + /** + * Extended stream information of linear. + */ + EXTENDED_STREAM_INFO_LINEAR = 10, + + /** + * Extended stream information of fragment. + */ + EXTENDED_STREAM_INFO_FRAGMENT =11, }; /** -- Gitee From 2ae50b402b6ad82b1b684e899eb28f37e0893366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B6=E6=98=A5=E9=BE=99?= Date: Thu, 12 Sep 2024 10:59:55 +0800 Subject: [PATCH 093/347] =?UTF-8?q?GetDisplayProperty=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=94=AF=E6=8C=81Adaptive=20Sync=E7=9A=84=E5=B1=9E=E6=80=A7id?= =?UTF-8?q?=E7=9A=84=E6=9E=9A=E4=B8=BE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陶春龙 --- display/composer/v1_2/DisplayComposerType.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index f1093525..284f3b13 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -92,4 +92,5 @@ enum DispCmd : ohos.hdi.display.composer.v1_0.DispCmd { enum DisplayPropertyID { DISPLAY_PROPERTY_ID_SKIP_VALIDATE = 1, DISPLAY_CAPBILITY_HARDWARE_CURSOR = 2, + DISPLAY_PROPERTY_ID_ADAPTIVE_SYNC = 3, /**< Indicates whether to support adaptive sync(display in advance) */ }; \ No newline at end of file -- Gitee From 2d24f490380be3b9fb09168d03dc6be311c7390e Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Thu, 12 Sep 2024 15:52:05 +0800 Subject: [PATCH 094/347] f Signed-off-by: huangshengqing --- camera/v1_3/Types.idl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index d59aa0e9..d7f908a9 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -132,57 +132,77 @@ enum OperationMode : ohos.hdi.camera.v1_2.OperationMode_V1_2 { /** * @brief Enumerates types of the extended stream information. * @since 4.0 - * @version 1.2 + * @version 1.4 */ enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { /** * Extended stream information of raw. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_RAW = 2, /** * Extended stream information of depth. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_DEPTH = 3, /** * Extended stream information of meta. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_META = 4, /** * Extended stream information of secure. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_SECURE = 5, /** * Extended stream information of maker. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_MAKER_INFO = 6, /** * Extended stream information of exif. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_EXIF = 7, /** * Extended stream information of gainmap. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_GAINMAP = 8, /** * Extended stream information of unrefocus. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_UNREFOCUS = 9, /** * Extended stream information of linear. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_LINEAR = 10, /** * Extended stream information of fragment. + * @since 5.0 + * @version 1.0 */ EXTENDED_STREAM_INFO_FRAGMENT =11, }; -- Gitee From c86a1bb7faf0d15da43554ca20ce2dd0094cb5b0 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Thu, 12 Sep 2024 08:12:42 +0000 Subject: [PATCH 095/347] update camera/v1_3/Types.idl. Signed-off-by: huangshengqing --- camera/v1_3/Types.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index d7f908a9..600793fe 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -132,7 +132,7 @@ enum OperationMode : ohos.hdi.camera.v1_2.OperationMode_V1_2 { /** * @brief Enumerates types of the extended stream information. * @since 4.0 - * @version 1.4 + * @version 1.2 */ enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { -- Gitee From a6a22d48973f2b427486e768cb6667b524cc7638 Mon Sep 17 00:00:00 2001 From: xuxuehai Date: Fri, 13 Sep 2024 16:45:59 +0800 Subject: [PATCH 096/347] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E5=A4=A7=E6=8B=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuxuehai --- audio/v1_0/AudioTypes.idl | 2 +- audio/v1_0/IAudioAdapter.idl | 2 +- audio/v1_0/IAudioCallback.idl | 2 +- audio/v1_0/IAudioCapture.idl | 2 +- audio/v1_0/IAudioManager.idl | 2 +- audio/v1_0/IAudioRender.idl | 2 +- audio/v2_0/AudioTypes.idl | 2 +- audio/v2_0/IAudioAdapter.idl | 2 +- audio/v2_0/IAudioCallback.idl | 2 +- audio/v2_0/IAudioCapture.idl | 2 +- audio/v2_0/IAudioManager.idl | 2 +- audio/v2_0/IAudioRender.idl | 2 +- audio/v3_0/AudioTypes.idl | 2 +- audio/v3_0/IAudioAdapter.idl | 2 +- audio/v3_0/IAudioCallback.idl | 2 +- audio/v3_0/IAudioCapture.idl | 2 +- audio/v3_0/IAudioManager.idl | 2 +- audio/v3_0/IAudioRender.idl | 2 +- audio/v4_0/AudioTypes.idl | 2 +- audio/v4_0/IAudioAdapter.idl | 2 +- audio/v4_0/IAudioCallback.idl | 2 +- audio/v4_0/IAudioCapture.idl | 2 +- audio/v4_0/IAudioManager.idl | 2 +- audio/v4_0/IAudioRender.idl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/audio/v1_0/AudioTypes.idl b/audio/v1_0/AudioTypes.idl index 63667879..30132567 100644 --- a/audio/v1_0/AudioTypes.idl +++ b/audio/v1_0/AudioTypes.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioAdapter.idl b/audio/v1_0/IAudioAdapter.idl index 5ad64a6b..4f21ddf4 100644 --- a/audio/v1_0/IAudioAdapter.idl +++ b/audio/v1_0/IAudioAdapter.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioCallback.idl b/audio/v1_0/IAudioCallback.idl index c9a260f0..65f417d8 100644 --- a/audio/v1_0/IAudioCallback.idl +++ b/audio/v1_0/IAudioCallback.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioCapture.idl b/audio/v1_0/IAudioCapture.idl index 8a0b5c22..1e1882fa 100644 --- a/audio/v1_0/IAudioCapture.idl +++ b/audio/v1_0/IAudioCapture.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioManager.idl b/audio/v1_0/IAudioManager.idl index 069af9f0..cd0478e3 100644 --- a/audio/v1_0/IAudioManager.idl +++ b/audio/v1_0/IAudioManager.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioRender.idl b/audio/v1_0/IAudioRender.idl index 52b1c9ce..2cd3e0bc 100644 --- a/audio/v1_0/IAudioRender.idl +++ b/audio/v1_0/IAudioRender.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/AudioTypes.idl b/audio/v2_0/AudioTypes.idl index 04614cb8..cc69880b 100644 --- a/audio/v2_0/AudioTypes.idl +++ b/audio/v2_0/AudioTypes.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioAdapter.idl b/audio/v2_0/IAudioAdapter.idl index 218e50b4..1f7be416 100644 --- a/audio/v2_0/IAudioAdapter.idl +++ b/audio/v2_0/IAudioAdapter.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioCallback.idl b/audio/v2_0/IAudioCallback.idl index 10e4c400..166f158f 100644 --- a/audio/v2_0/IAudioCallback.idl +++ b/audio/v2_0/IAudioCallback.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioCapture.idl b/audio/v2_0/IAudioCapture.idl index 4e1832e6..b7e0a5a6 100644 --- a/audio/v2_0/IAudioCapture.idl +++ b/audio/v2_0/IAudioCapture.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioManager.idl b/audio/v2_0/IAudioManager.idl index f64bf01a..20949a3d 100644 --- a/audio/v2_0/IAudioManager.idl +++ b/audio/v2_0/IAudioManager.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioRender.idl b/audio/v2_0/IAudioRender.idl index 92ef5f12..a6c7899b 100644 --- a/audio/v2_0/IAudioRender.idl +++ b/audio/v2_0/IAudioRender.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/AudioTypes.idl b/audio/v3_0/AudioTypes.idl index e99b95f2..a66797f0 100644 --- a/audio/v3_0/AudioTypes.idl +++ b/audio/v3_0/AudioTypes.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioAdapter.idl b/audio/v3_0/IAudioAdapter.idl index c37a455b..ef54637b 100644 --- a/audio/v3_0/IAudioAdapter.idl +++ b/audio/v3_0/IAudioAdapter.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioCallback.idl b/audio/v3_0/IAudioCallback.idl index 7d8135c7..256c1e34 100644 --- a/audio/v3_0/IAudioCallback.idl +++ b/audio/v3_0/IAudioCallback.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioCapture.idl b/audio/v3_0/IAudioCapture.idl index 0f6ec51d..2e85f717 100644 --- a/audio/v3_0/IAudioCapture.idl +++ b/audio/v3_0/IAudioCapture.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioManager.idl b/audio/v3_0/IAudioManager.idl index 462a7b65..94af7022 100644 --- a/audio/v3_0/IAudioManager.idl +++ b/audio/v3_0/IAudioManager.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioRender.idl b/audio/v3_0/IAudioRender.idl index 89723db1..691215d5 100644 --- a/audio/v3_0/IAudioRender.idl +++ b/audio/v3_0/IAudioRender.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index 668ecc10..f2ed451b 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioAdapter.idl b/audio/v4_0/IAudioAdapter.idl index 4f762442..f2ff1e07 100644 --- a/audio/v4_0/IAudioAdapter.idl +++ b/audio/v4_0/IAudioAdapter.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioCallback.idl b/audio/v4_0/IAudioCallback.idl index e5ceda85..87ee7d9f 100644 --- a/audio/v4_0/IAudioCallback.idl +++ b/audio/v4_0/IAudioCallback.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioCapture.idl b/audio/v4_0/IAudioCapture.idl index d188b96b..b812a374 100644 --- a/audio/v4_0/IAudioCapture.idl +++ b/audio/v4_0/IAudioCapture.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioManager.idl b/audio/v4_0/IAudioManager.idl index aff6facd..fb5bb894 100644 --- a/audio/v4_0/IAudioManager.idl +++ b/audio/v4_0/IAudioManager.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioRender.idl b/audio/v4_0/IAudioRender.idl index b45eecd5..8a28327f 100644 --- a/audio/v4_0/IAudioRender.idl +++ b/audio/v4_0/IAudioRender.idl @@ -15,7 +15,7 @@ /** * @addtogroup HdiAudio - * @{ + * @ * * @brief Provides unified APIs for audio services to access audio drivers. * -- Gitee From 76b35122c2e30390f18a9d01c61fcb9cd83c167e Mon Sep 17 00:00:00 2001 From: suxiaosu007 Date: Fri, 13 Sep 2024 16:55:48 +0800 Subject: [PATCH 097/347] =?UTF-8?q?=E9=AB=98=E9=A3=8E=E9=99=A9=E8=BF=9B?= =?UTF-8?q?=E7=A8=8Bcodec=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: suxiaosu007 --- codec/v1_0/BUILD.gn | 1 + codec/v2_0/BUILD.gn | 1 + codec/v3_0/BUILD.gn | 1 + 3 files changed, 3 insertions(+) diff --git a/codec/v1_0/BUILD.gn b/codec/v1_0/BUILD.gn index 6de4ce09..bd36cda5 100644 --- a/codec/v1_0/BUILD.gn +++ b/codec/v1_0/BUILD.gn @@ -27,6 +27,7 @@ if (defined(ohos_lite)) { "ICodecComponent.idl", "ICodecComponentManager.idl", ] + branch_protector_ret = "pac_ret" language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_codec" diff --git a/codec/v2_0/BUILD.gn b/codec/v2_0/BUILD.gn index d2112592..32499b36 100644 --- a/codec/v2_0/BUILD.gn +++ b/codec/v2_0/BUILD.gn @@ -28,6 +28,7 @@ if (defined(ohos_lite)) { "ICodecComponent.idl", "ICodecComponentManager.idl", ] + branch_protector_ret = "pac_ret" language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_codec" diff --git a/codec/v3_0/BUILD.gn b/codec/v3_0/BUILD.gn index 239c7676..ab0494da 100644 --- a/codec/v3_0/BUILD.gn +++ b/codec/v3_0/BUILD.gn @@ -28,6 +28,7 @@ if (defined(ohos_lite)) { "ICodecComponent.idl", "ICodecComponentManager.idl", ] + branch_protector_ret = "pac_ret" language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_codec" -- Gitee From 8a5562a235920ec7d801166a69a5d9d634100d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sat, 14 Sep 2024 10:21:16 +0800 Subject: [PATCH 098/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- audio/effect/v1_0/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/effect/v1_0/BUILD.gn b/audio/effect/v1_0/BUILD.gn index 7c9f1a81..fa3bce88 100644 --- a/audio/effect/v1_0/BUILD.gn +++ b/audio/effect/v1_0/BUILD.gn @@ -27,6 +27,8 @@ if (defined(ohos_lite)) { "IEffectModel.idl", ] + branch_protector_ret = "pac_ret" + language = "c" subsystem_name = "hdf" part_name = "drivers_interface_audio" -- Gitee From 809875e07aac0e726a0f4fcae7e18b6a55ee7d4a Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 14 Sep 2024 16:15:32 +0800 Subject: [PATCH 099/347] f Signed-off-by: huangshengqing --- camera/metadata/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/camera/metadata/BUILD.gn b/camera/metadata/BUILD.gn index ff9934ab..312ab70f 100644 --- a/camera/metadata/BUILD.gn +++ b/camera/metadata/BUILD.gn @@ -19,6 +19,8 @@ config("camera_metadata_config") { } ohos_shared_library("metadata") { + branch_protector_ret = "pac_ret" + install_enable = true cflags = [ "-fPIC", -- Gitee From 6fbf4bb68eb76da9f805f0069fa3087707fd6c92 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 14 Sep 2024 16:44:11 +0800 Subject: [PATCH 100/347] f Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 41095acd..2e3fe725 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -1018,6 +1018,9 @@ int CameraMetadata::UpdateCameraMetadataItemByIndex(common_metadata_header_t *ds int32_t ret = CAM_META_SUCCESS; camera_metadata_item_entry_t *item = GetMetadataItems(dst) + index; + if (item->data.offset > dst->item_count * sizeof(OHOS_CAMERA_METADATA_TYPE[item->data_type])) { + return CAM_META_INVALID_PARAM; + } ret = UpdateameraMetadataItemSize(item, dataCount, dst, data); if (ret != CAM_META_SUCCESS) { -- Gitee From ffde88cbe4ccb1e97cd0febd1ba7b54c264ff26f Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 14 Sep 2024 08:59:13 +0000 Subject: [PATCH 101/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 2e3fe725..b4019461 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -1019,7 +1019,8 @@ int CameraMetadata::UpdateCameraMetadataItemByIndex(common_metadata_header_t *ds int32_t ret = CAM_META_SUCCESS; camera_metadata_item_entry_t *item = GetMetadataItems(dst) + index; if (item->data.offset > dst->item_count * sizeof(OHOS_CAMERA_METADATA_TYPE[item->data_type])) { - return CAM_META_INVALID_PARAM; + METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex invalid item"); + return CAM_META_FAILURE; } ret = UpdateameraMetadataItemSize(item, dataCount, dst, data); -- Gitee From 69da843e2a065372b21da1c3be48baac9d25221c Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 14 Sep 2024 09:55:35 +0000 Subject: [PATCH 102/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index b4019461..0f7316c0 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -954,8 +954,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); + } else if (item->data_type < META_TYPE_BYTE || item->data_type >= META_NUM_TYPES || + item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { + METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid datatype:%{public}d", item->data_type); return CAM_META_FAILURE; } size_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); -- Gitee From cd402ecb37b9bf1c9a13dd016fe4ea6634b003d5 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 14 Sep 2024 09:57:19 +0000 Subject: [PATCH 103/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 0f7316c0..531c7091 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -956,7 +956,7 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it return CAM_META_FAILURE; } else if (item->data_type < META_TYPE_BYTE || item->data_type >= META_NUM_TYPES || item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid datatype:%{public}d", item->data_type); + METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid item"); return CAM_META_FAILURE; } size_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); @@ -1019,10 +1019,6 @@ int CameraMetadata::UpdateCameraMetadataItemByIndex(common_metadata_header_t *ds int32_t ret = CAM_META_SUCCESS; camera_metadata_item_entry_t *item = GetMetadataItems(dst) + index; - if (item->data.offset > dst->item_count * sizeof(OHOS_CAMERA_METADATA_TYPE[item->data_type])) { - METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex invalid item"); - return CAM_META_FAILURE; - } ret = UpdateameraMetadataItemSize(item, dataCount, dst, data); if (ret != CAM_META_SUCCESS) { -- Gitee From 8599d3dfbcd41abc3bfda27895c4d807efa42ed8 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sat, 14 Sep 2024 09:59:53 +0000 Subject: [PATCH 104/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 531c7091..8909a339 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -955,8 +955,8 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it 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 || - item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid item"); + item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { + METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid item"); return CAM_META_FAILURE; } size_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); -- Gitee From e266c8d33cfc5a4f070206e5e81ccee065b15cb0 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sun, 15 Sep 2024 03:39:11 +0000 Subject: [PATCH 105/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- 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 8909a339..a57e14e4 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -954,7 +954,7 @@ 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 || + } else if (item->data_type < META_TYPE_BYTE || item->data_type >= META_NUM_TYPES || item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid item"); return CAM_META_FAILURE; -- Gitee From 3152029c1d636b8c42a589bf9823ccbe1535423d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sun, 15 Sep 2024 11:54:00 +0800 Subject: [PATCH 106/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/bundle.json | 3 +++ display/composer/hdifd_parcelable/BUILD.gn | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/display/bundle.json b/display/bundle.json index 50d71368..8d93f156 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -329,6 +329,9 @@ ], "header_base": "//drivers/interface/display/v1_0/stub" } + }, + { + "name": "//drivers/interface/display/composer/hdifd_parcelable:libvdi_config" } ] } diff --git a/display/composer/hdifd_parcelable/BUILD.gn b/display/composer/hdifd_parcelable/BUILD.gn index 91714ec9..8c2bd9d6 100644 --- a/display/composer/hdifd_parcelable/BUILD.gn +++ b/display/composer/hdifd_parcelable/BUILD.gn @@ -35,3 +35,14 @@ ohos_shared_library("libhdifd_parcelable") { subsystem_name = "hdf" part_name = "drivers_interface_display" } + +config("vdi_config") { + include_dirs = [ + ".", + "./composer/common/include", + ] +} + +ohos_static_library("libvdi_config") { + public_configs = [ ":vdi_config" ] +} -- Gitee From 5127b6e5d04406ec053a3c023996d66bdc970f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sun, 15 Sep 2024 15:15:06 +0800 Subject: [PATCH 107/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/bundle.json | 2 +- display/composer/hdifd_parcelable/BUILD.gn | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/display/bundle.json b/display/bundle.json index 8d93f156..4aae0fb3 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -331,7 +331,7 @@ } }, { - "name": "//drivers/interface/display/composer/hdifd_parcelable:libvdi_config" + "name": "//drivers/interface/display/composer/hdifd_parcelable:libdisplay_config_parcelable" } ] } diff --git a/display/composer/hdifd_parcelable/BUILD.gn b/display/composer/hdifd_parcelable/BUILD.gn index 8c2bd9d6..9201277b 100644 --- a/display/composer/hdifd_parcelable/BUILD.gn +++ b/display/composer/hdifd_parcelable/BUILD.gn @@ -36,13 +36,13 @@ ohos_shared_library("libhdifd_parcelable") { part_name = "drivers_interface_display" } -config("vdi_config") { +config("display_config_parcelable") { include_dirs = [ ".", - "./composer/common/include", + "../common/include", ] } -ohos_static_library("libvdi_config") { - public_configs = [ ":vdi_config" ] +ohos_static_library("libdisplay_config_parcelable") { + public_configs = [ ":display_config_parcelable" ] } -- Gitee From 53c2255a2462509545a1a8cc0cbea52f77844f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sun, 15 Sep 2024 16:11:53 +0800 Subject: [PATCH 108/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/bundle.json | 2 +- display/composer/hdifd_parcelable/BUILD.gn | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/display/bundle.json b/display/bundle.json index 4aae0fb3..1649c6c0 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -331,7 +331,7 @@ } }, { - "name": "//drivers/interface/display/composer/hdifd_parcelable:libdisplay_config_parcelable" + "name": "//drivers/interface/display/composer/hdifd_parcelable:display_common_config" } ] } diff --git a/display/composer/hdifd_parcelable/BUILD.gn b/display/composer/hdifd_parcelable/BUILD.gn index 9201277b..4061d991 100644 --- a/display/composer/hdifd_parcelable/BUILD.gn +++ b/display/composer/hdifd_parcelable/BUILD.gn @@ -36,13 +36,13 @@ ohos_shared_library("libhdifd_parcelable") { part_name = "drivers_interface_display" } -config("display_config_parcelable") { +config("common_config") { include_dirs = [ ".", "../common/include", ] } -ohos_static_library("libdisplay_config_parcelable") { - public_configs = [ ":display_config_parcelable" ] +ohos_static_library("display_common_config") { + public_configs = [ ":common_config" ] } -- Gitee From 31b9fd703717d1e316d58a22e2b27cd0db5f7b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sun, 15 Sep 2024 16:20:14 +0800 Subject: [PATCH 109/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/bundle.json | 2 +- display/composer/hdifd_parcelable/BUILD.gn | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/display/bundle.json b/display/bundle.json index 1649c6c0..1113e9cb 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -331,7 +331,7 @@ } }, { - "name": "//drivers/interface/display/composer/hdifd_parcelable:display_common_config" + "name": "//drivers/interface/display/composer/hdifd_parcelable:display_composer_common_config" } ] } diff --git a/display/composer/hdifd_parcelable/BUILD.gn b/display/composer/hdifd_parcelable/BUILD.gn index 4061d991..e6f4d7ef 100644 --- a/display/composer/hdifd_parcelable/BUILD.gn +++ b/display/composer/hdifd_parcelable/BUILD.gn @@ -43,6 +43,6 @@ config("common_config") { ] } -ohos_static_library("display_common_config") { - public_configs = [ ":common_config" ] +ohos_static_library("display_composer_common_config") { + public_configs = [ ":composer_common_config" ] } -- Gitee From f17090676fa23b0b3a68b6a8d61a4f2e755400fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sun, 15 Sep 2024 16:45:17 +0800 Subject: [PATCH 110/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/hdifd_parcelable/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/hdifd_parcelable/BUILD.gn b/display/composer/hdifd_parcelable/BUILD.gn index e6f4d7ef..7890e1a7 100644 --- a/display/composer/hdifd_parcelable/BUILD.gn +++ b/display/composer/hdifd_parcelable/BUILD.gn @@ -36,7 +36,7 @@ ohos_shared_library("libhdifd_parcelable") { part_name = "drivers_interface_display" } -config("common_config") { +config("composer_common_config") { include_dirs = [ ".", "../common/include", -- Gitee From 45c7ab6be887f14312128490a962f426c5306a72 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sun, 15 Sep 2024 10:14:44 +0000 Subject: [PATCH 111/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index a57e14e4..45c0df64 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -951,8 +951,8 @@ int CameraMetadata::copyMetadataMemory(common_metadata_header_t *dst, camera_met int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *item, uint32_t dataCount, common_metadata_header_t *dst, const void *data) { - if (item == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null"); + if (item == nullptr || dst == nullptr) { + METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); return CAM_META_FAILURE; } else if (item->data_type < META_TYPE_BYTE || item->data_type >= META_NUM_TYPES || item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { @@ -963,10 +963,7 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it size_t dataPayloadSize = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]; size_t oldItemSize = CalculateCameraMetadataItemDataSize(item->data_type, item->count); int32_t ret = CAM_META_SUCCESS; - if (item == nullptr || dst == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); - return CAM_META_FAILURE; - } + if (dataSize != oldItemSize) { if (dst->data_capacity < (dst->data_count + dataSize - oldItemSize)) { METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex data_capacity limit reached"); -- Gitee From 99a2ee7f94705860466e85d0826262397c2eebff Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sun, 15 Sep 2024 10:15:33 +0000 Subject: [PATCH 112/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 45c0df64..68903153 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -963,7 +963,6 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it size_t dataPayloadSize = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]; size_t oldItemSize = CalculateCameraMetadataItemDataSize(item->data_type, item->count); int32_t ret = CAM_META_SUCCESS; - if (dataSize != oldItemSize) { if (dst->data_capacity < (dst->data_count + dataSize - oldItemSize)) { METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex data_capacity limit reached"); -- Gitee From fbed3fe7fb6c9b536e79de28a4d2e8430f3869c6 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Thu, 19 Sep 2024 21:46:24 +0800 Subject: [PATCH 113/347] f Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 68903153..abe60b1d 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -954,9 +954,8 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it if (item == nullptr || dst == nullptr) { METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); return CAM_META_FAILURE; - } else if (item->data_type < META_TYPE_BYTE || item->data_type >= META_NUM_TYPES || - item->data.offset > dst->item_count * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid item"); + } 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); @@ -983,6 +982,7 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it dst->data_count += dataSize; } } else if (dataSize != 0) { + item->data.offset = dst->data_count; ret = copyMetadataMemory(dst, item, dataPayloadSize, data); if (ret != CAM_META_SUCCESS) { return ret; -- Gitee From 6188e07098ab23c3a50fdc01331030d67b3a49d1 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Fri, 20 Sep 2024 10:35:49 +0000 Subject: [PATCH 114/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index abe60b1d..77a27b2c 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -987,6 +987,7 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it if (ret != CAM_META_SUCCESS) { return ret; } + dst->data_count += dataSize; } if (dataSize == 0) { ret = memcpy_s(item->data.value, dataPayloadSize, data, dataPayloadSize); -- Gitee From a0ec5dea7ac15299ac94aba06a545d8b2ccf92eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sat, 21 Sep 2024 11:52:55 +0800 Subject: [PATCH 115/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/graphic/common/v1_1/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/display/graphic/common/v1_1/BUILD.gn b/display/graphic/common/v1_1/BUILD.gn index 8e4ea03f..ea781091 100644 --- a/display/graphic/common/v1_1/BUILD.gn +++ b/display/graphic/common/v1_1/BUILD.gn @@ -16,6 +16,8 @@ import("//build/config/components/hdi/hdi.gni") hdi("display_commontype") { module_name = "display_commontype" + imports = [ "ohos.hdi.display.graphic.common.v1_0:display_commontype" ] + sources = [ "BufferHandleMetaKeyType.idl" ] language = "cpp" -- Gitee From 7588f7eeb17410282c92e641c794adff85d68eed Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Wed, 11 Sep 2024 18:57:14 +0800 Subject: [PATCH 116/347] =?UTF-8?q?=E6=94=AF=E6=8C=81metadata=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B5=81=E6=A3=80=E6=B5=8B?= 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 | 21 ++++++- .../include/camera_metadata_item_info.h | 4 +- camera/metadata/src/camera_metadata_info.cpp | 1 + camera/v1_3/BUILD.gn | 1 + camera/v1_3/ICameraDevice.idl | 2 +- camera/v1_3/IStreamOperator.idl | 63 +++++++++++++++++++ camera/v1_3/IStreamOperatorCallback.idl | 14 +++++ 7 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 camera/v1_3/IStreamOperator.idl diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 559a5f51..6a61205b 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -353,8 +353,8 @@ typedef enum camera_device_metadata_tag { /** * ohos.ability.tripodDetection [static, int32[], public] * - * camera device property, report current camera whether support tripod detection by mode - * (i.e. int32[]: [mode, OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED, mode ...] ...) + * camera device property, report current camera what mode support tripod detection + * (i.e. int32[]: [mode, mode ...] ...) */ OHOS_ABILITY_TRIPOD_DETECTION, /** @@ -637,6 +637,13 @@ typedef enum camera_device_metadata_tag { * (i.e. int32[] ...) */ OHOS_STATISTICS_DETECT_BAR_CODE_INFOS, + /** + * ohos.statistics.baseFaceInfo [static, int32[], public] + * + * camera device property, query current camera detect base face information + * (i.e. int32[] ...) + */ + OHOS_STATISTICS_DETECT_BASE_FACE_INFO, /** * ohos.camera.statisticsEnd * @@ -2411,7 +2418,7 @@ enum CameraLightPaintingType { OHOS_CAMERA_LIGHT_PAINTING_LIGHT, }; -//OHOS_CONTRAL_TIME_LAPSE_TRYAE_STATE +//OHOS_CONTROL_TIME_LAPSE_TRYAE_STATE enum TimeLapseRecordState { TIME_LAPSE_IDLE = 0, TIME_LAPSE_RECORDING = 1, @@ -2433,6 +2440,7 @@ enum StatisticsDetectType { OHOS_CAMERA_DOG_BODY_DETECT = 5, OHOS_CAMERA_SALIENT_DETECT = 6, OHOS_CAMERA_BAR_CODE_DETECT = 7, + OHOS_CAMERA_BASE_FACE_DETECT = 8, }; // OHOS_STATUS_TRIPOD_DETECTION_STATUS @@ -2468,4 +2476,11 @@ enum DeviceProtectionStatus { OHOS_DEVICE_FALL_PROTECTION = 3, }; +enum StatisticsDetectEmotion { + OHOS_EMOTION_NEUTRAL = 0, + OHOS_EMOTION_SADNESS = 1, + OHOS_EMOTION_SMILE = 2, + OHOS_EMOTION_SURPRISE = 3, +}; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 58526b4f..c10a2342 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -184,6 +184,8 @@ static item_info_t g_ohosCameraStatistics[OHOS_CAMERA_STATISTICS_END - OHOS_CAME OHOS_CAMERA_STATISTICS_START] = {"detectSalientInfos", META_TYPE_INT32, -1}, [OHOS_STATISTICS_DETECT_BAR_CODE_INFOS - OHOS_CAMERA_STATISTICS_START] = {"detectBarCodeInfos", META_TYPE_INT32, -1}, + [OHOS_STATISTICS_DETECT_BASE_FACE_INFO - + OHOS_CAMERA_STATISTICS_START] = {"baseFaceInfo", META_TYPE_INT32, -1}, }; static item_info_t g_ohosCameraControl[OHOS_DEVICE_CONTROL_END - OHOS_DEVICE_CONTROL_START] = { @@ -250,7 +252,7 @@ static item_info_t g_ohosCameraControl[OHOS_DEVICE_CONTROL_END - OHOS_DEVICE_CON [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_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 - diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 41095acd..94faa1a0 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -108,6 +108,7 @@ const std::vector g_metadataTags = { OHOS_STATISTICS_DETECT_DOG_BODY_INFOS, OHOS_STATISTICS_DETECT_SALIENT_INFOS, OHOS_STATISTICS_DETECT_BAR_CODE_INFOS, + OHOS_STATISTICS_DETECT_BASE_FACE_INFO, OHOS_CONTROL_AE_ANTIBANDING_MODE, OHOS_CONTROL_AE_EXPOSURE_COMPENSATION, diff --git a/camera/v1_3/BUILD.gn b/camera/v1_3/BUILD.gn index fe2f1ad4..2423a4c8 100644 --- a/camera/v1_3/BUILD.gn +++ b/camera/v1_3/BUILD.gn @@ -27,6 +27,7 @@ if (defined(ohos_lite)) { "ICameraHost.idl", "IImageProcessCallback.idl", "IImageProcessService.idl", + "IStreamOperator.idl", "IStreamOperatorCallback.idl", "IVideoProcessCallback.idl", "IVideoProcessService.idl", diff --git a/camera/v1_3/ICameraDevice.idl b/camera/v1_3/ICameraDevice.idl index fe92417d..39ac48e2 100644 --- a/camera/v1_3/ICameraDevice.idl +++ b/camera/v1_3/ICameraDevice.idl @@ -26,7 +26,7 @@ package ohos.hdi.camera.v1_3; import ohos.hdi.camera.v1_2.ICameraDevice; import ohos.hdi.camera.v1_3.IStreamOperatorCallback; -import ohos.hdi.camera.v1_2.IStreamOperator; +import ohos.hdi.camera.v1_3.IStreamOperator; interface ICameraDevice extends ohos.hdi.camera.v1_2.ICameraDevice { /** diff --git a/camera/v1_3/IStreamOperator.idl b/camera/v1_3/IStreamOperator.idl new file mode 100644 index 00000000..17b2e000 --- /dev/null +++ b/camera/v1_3/IStreamOperator.idl @@ -0,0 +1,63 @@ +/* + * 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 istream_operator.h + * + * @brief Declares APIs for stream operations. + * + * @since 5.0 + * @version 1.3 + */ + +package ohos.hdi.camera.v1_3; + +import ohos.hdi.camera.v1_2.IStreamOperator; + +interface IStreamOperator extends ohos.hdi.camera.v1_2.IStreamOperator { + + /** + * @brief Enables metadata reporting and other information. + * + * Only metadata that is enabled can be reported by using {@link OnResult}. + * + * @param results Indicates the metadata and other information for which reporting are to be enabled. + * @param streamId Indicates the ID of the stream to enable metadata reporting. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 5.0 + * @version 1.0 + */ + EnableResult([in] int streamId, [in] unsigned char[] results); + + /** + * @brief Disable metadata reporting and other information. + * + * After metadata reporting is disabled, the metadata is not reported by calling {@link OnResult}. + * To enable metadata reporting, you must call {@link EnableResult}. + * + * @param results Indicates the metadata and other information for which reporting are to be disabled. + * @param streamId Indicates the ID of the stream to disable metadata reporting. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 5.0 + * @version 1.0 + */ + DisableResult([in] int streamId, [in] unsigned char[] results); +} \ No newline at end of file diff --git a/camera/v1_3/IStreamOperatorCallback.idl b/camera/v1_3/IStreamOperatorCallback.idl index 35993c76..0bb3ebdd 100644 --- a/camera/v1_3/IStreamOperatorCallback.idl +++ b/camera/v1_3/IStreamOperatorCallback.idl @@ -61,4 +61,18 @@ import ohos.hdi.camera.v1_3.Types; * @version 1.0 */ OnCaptureEndedExt([in] int captureId, [in] struct CaptureEndedInfoExt[] infos); + + /** + * @brief Called to report metadata and other information related to the stream. + * For details about the reporting mode, see {@link SetResultMode}. + * + * @param streamId Indicates the ID of the stream related to metadata is reported. + * @param result Indicates the metadata and other information reported. + * The reported metadata and other information are specified by {@link EnableResult}. + * You can call {@link DisableResult} to disable metadata and other information reporting. + * + * @since 5.0 + * @version 1.0 + */ + OnResult([in] int streamId, [in] unsigned char[] result); } \ No newline at end of file -- Gitee From a2a5bf3aaad464011079fdefab74fc0440f48878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 23 Sep 2024 06:28:10 +0000 Subject: [PATCH 117/347] add new tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- .../metadata/include/camera_device_ability_items.h | 14 ++++++++++++++ .../metadata/include/camera_metadata_item_info.h | 4 ++++ camera/metadata/src/camera_metadata_info.cpp | 2 ++ 3 files changed, 20 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 559a5f51..438c700f 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1918,6 +1918,20 @@ typedef enum camera_device_metadata_tag { * (i.e. int32_t[] ...) */ OHOS_CONTROL_DEPTH_DATA_ACCURACY, + /** + * ohos.ability.cameraIsRetractable [static, byte, public] + * + * camera device property, report current camera retractable + * (i.e. byte ...) + */ + OHOS_ABILITY_CAMERA_IS_RETRACTABLE, + /** + * ohos.control.closeAfterSeconds [static, uint32, public] + * + * camera device property, set current camera close after seconds + * (i.e. uint32 ...) + */ + OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, /** * ohos.camera.effectEnd * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 58526b4f..64999a49 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -486,6 +486,10 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"depthDataProfiles", META_TYPE_INT32, -1}, [OHOS_CONTROL_DEPTH_DATA_ACCURACY - OHOS_CAMERA_EFFECT_START] = {"depthDataAccuracy", META_TYPE_INT32, -1}, + [OHOS_ABILITY_CAMERA_IS_RETRACTABLE - + OHOS_CAMERA_EFFECT_START] = {"cameraIsRetractable", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_CLOSE_AFTER_SECONDS - + OHOS_CAMERA_EFFECT_START] = {"closeAfterSeconds", META_TYPE_UINT32, 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 68903153..a474a3a2 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -292,6 +292,8 @@ const std::vector g_metadataTags = { OHOS_CONTROL_DEPTH_DATA_DELIVERY_SWITCH, OHOS_ABILITY_DEPTH_DATA_PROFILES, OHOS_CONTROL_DEPTH_DATA_ACCURACY, + OHOS_ABILITY_CAMERA_IS_RETRACTABLE, + OHOS_CONTROL_CLOSE_AFTER_SECONDS, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From acba970496c30268b8b57cfe867ac3b0b508aeb0 Mon Sep 17 00:00:00 2001 From: wenkaisong Date: Mon, 9 Sep 2024 19:29:52 +0800 Subject: [PATCH 118/347] feat: add re-enroll flag to auth result Signed-off-by: wenkaisong --- user_auth/v2_0/UserAuthTypes.idl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_auth/v2_0/UserAuthTypes.idl b/user_auth/v2_0/UserAuthTypes.idl index 4dd0de81..793504a6 100644 --- a/user_auth/v2_0/UserAuthTypes.idl +++ b/user_auth/v2_0/UserAuthTypes.idl @@ -247,6 +247,8 @@ struct AuthResultInfo { long pinExpiredInfo; /**< Remote auth result message. */ unsigned char[] remoteAuthResultMsg; + /**< Re-enroll flag. */ + boolean reEnrollFlag; }; /** -- Gitee From bf8bbf5aeb5f1195d12e70353d98c3a97c66b052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 23 Sep 2024 08:00:08 +0000 Subject: [PATCH 119/347] add new tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/include/camera_metadata_item_info.h | 4 ++-- camera/metadata/src/camera_metadata_info.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 64999a49..a4261cc4 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -488,8 +488,8 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"depthDataAccuracy", META_TYPE_INT32, -1}, [OHOS_ABILITY_CAMERA_IS_RETRACTABLE - OHOS_CAMERA_EFFECT_START] = {"cameraIsRetractable", META_TYPE_BYTE, 1}, - [OHOS_CONTROL_CLOSE_AFTER_SECONDS - - OHOS_CAMERA_EFFECT_START] = {"closeAfterSeconds", META_TYPE_UINT32, 1}, + [OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS - + OHOS_CAMERA_EFFECT_START] = {"cameraCloseAfterSeconds", META_TYPE_UINT32, 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 a474a3a2..cc0efab6 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -293,7 +293,7 @@ const std::vector g_metadataTags = { OHOS_ABILITY_DEPTH_DATA_PROFILES, OHOS_CONTROL_DEPTH_DATA_ACCURACY, OHOS_ABILITY_CAMERA_IS_RETRACTABLE, - OHOS_CONTROL_CLOSE_AFTER_SECONDS, + OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From 2c072d7e9cdaa85bcc76abf5af35cc3d07b08b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 23 Sep 2024 11:12:04 +0000 Subject: [PATCH 120/347] add new tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/include/camera_device_ability_items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 438c700f..5e42a7b2 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1931,7 +1931,7 @@ typedef enum camera_device_metadata_tag { * camera device property, set current camera close after seconds * (i.e. uint32 ...) */ - OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, + OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, /** * ohos.camera.effectEnd * -- Gitee From 0adb2b11c39277c109c0683e035639674d8c1631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Thu, 26 Sep 2024 22:30:27 +0800 Subject: [PATCH 121/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/DisplayComposerType.idl | 5 +++++ .../common/v2_0/BufferHandleMetaKeyType.idl | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index f1093525..aeae693a 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -61,6 +61,11 @@ enum BufferUsage : ohos.hdi.display.composer.v1_0.BufferUsage { HBM_USE_CPU_HW_BOTH = (1ULL << 17), /**< For support cpu and hardware */ HBM_USAGE_GPU_PERFORMANCE = (1ULL << 18), /**< Prefer performance over memory consumption: */ HBM_USE_RGB_TO_YUV_CONVERSION = (1ULL << 19), /**< For identify RGB to YUV conversion */ + HBM_USE_AUXILLARY_BUFFER0 = (1ULL << 20), + HBM_USE_AUXILLARY_BUFFER1 = (1ULL << 21), + HBM_USE_AUXILLARY_BUFFER2 = (1ULL << 22), + HBM_USE_AUXILLARY_BUFFER3 = (1ULL << 23), + HBM_USE_VIDEO_DEC_MV = HBM_USE_VIDEO_DECODER | HBM_USE_AUXILLARY_BUFFER2, }; diff --git a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl index eefca05d..e3349f91 100644 --- a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl +++ b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl @@ -46,6 +46,7 @@ enum BufferHandleAttrKey { ATTRKEY_REQUEST_ACCESS_TYPE = 10, // value: current request frame mode ATTRKEY_ACCESS_TYPE = 11, // value: current data frame mode ATTRKEY_FORCE_GLOBAL_ALPHA = 12, // 0~255, pixel alpha value, default to -1, don't take effect. + ATTRKEY_VIDEO_DECODER_MV = 13, // value BlobDataType /* vendor internal extended meta type */ ATTRKEY_VENDOR_EXT_START = 2048, @@ -64,3 +65,21 @@ enum HebcAccessType { HEBC_ACCESS_CPU_ACCESS, // cpu is accessible; hebc is not accessible HEBC_ACCESS_HW_ONLY, // hardware_only: cpu is not accessible; hebc is accessible }; + +/** + * @brief Enumerates the CacheOption types + * + */ +enum CachheOption { + CACHE_NOOP = 0x0, // Do nothing + CACHE_INVALID, // Hardware writing aux buffer to disable cache + CACHE_FLUSH, // Write aux buffer on CPU and flash cache to DDR +} + +struct BlobDataType { + unsigned long vaddr; // virtual address, diret accessed w/o copy + unsigned int offset; // field offset in dmabuf, support dma access + unsigned int length; // data length set by previous SetMetadata(), default to 0 + unsigned int capacity; // reserved data size + enum CacheOption cacheOp; // effective in setMateData() +} \ No newline at end of file -- Gitee From ac36683bd512cec3d124c3b13120c996c2abfb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Thu, 26 Sep 2024 22:36:48 +0800 Subject: [PATCH 122/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../common/v2_0/BufferHandleMetaKeyType.idl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl index e3349f91..9241ddf0 100644 --- a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl +++ b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl @@ -67,19 +67,19 @@ enum HebcAccessType { }; /** - * @brief Enumerates the CacheOption types + * @brief Enumerates the CacheOption types. * */ -enum CachheOption { +enum CacheOption { CACHE_NOOP = 0x0, // Do nothing - CACHE_INVALID, // Hardware writing aux buffer to disable cache + CACHE_INVALIDATE, // Hardware writing aux buffer to disable cache CACHE_FLUSH, // Write aux buffer on CPU and flash cache to DDR -} +}; struct BlobDataType { - unsigned long vaddr; // virtual address, diret accessed w/o copy + unsigned long vaddr; // virtual address, direct accessed w/o copy unsigned int offset; // field offset in dmabuf, support dma access unsigned int length; // data length set by previous SetMetadata(), default to 0 unsigned int capacity; // reserved data size - enum CacheOption cacheOp; // effective in setMateData() -} \ No newline at end of file + enum CacheOption cacheOp; // effective in SetMetaData() +}; \ No newline at end of file -- Gitee From 3c410e46da87a6f409531f2b37d6e713c590a7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Fri, 27 Sep 2024 02:10:52 +0000 Subject: [PATCH 123/347] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E8=B7=9D?= =?UTF-8?q?=E6=99=AF=E6=B7=B1=E8=9E=8D=E5=90=88tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- .../include/camera_device_ability_items.h | 21 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 6 ++++++ camera/metadata/src/camera_metadata_info.cpp | 3 +++ 3 files changed, 30 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 087479b9..d53ee666 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1939,6 +1939,27 @@ typedef enum camera_device_metadata_tag { * (i.e. uint32 ...) */ OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, + /** + * ohos.ability.captureMacroDepthFusionSupported [static, byte, public] + * + * camera device property, report current capture macro depth fusion supported + * (i.e. byte ...) + */ + OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_SUPPORTED, + /** + * ohos.ability.captureMacroDepthFusionZoomRange [static, float[], public] + * + * camera device property, report current capture macro depth fusion zoom range + * (i.e. float[] ...) + */ + OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_ZOOM_RANGE, + /** + * ohos.control.captureMacroDepthFusion [static, byte, public] + * + * camera device property, set current capture macro depth fusion + * (i.e. byte ...) + */ + OHOS_CONTROL_CAPTURE_MACRO_DEPTH_FUSION, /** * ohos.camera.effectEnd * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index c6cf0d7a..7c8f15c4 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -492,6 +492,12 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"cameraIsRetractable", META_TYPE_BYTE, 1}, [OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS - OHOS_CAMERA_EFFECT_START] = {"cameraCloseAfterSeconds", META_TYPE_UINT32, 1}, + [OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_SUPPORTED - + OHOS_CAMERA_EFFECT_START] = {"captureMacroDepthFusionSupported", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_ZOOM_RANGE - + OHOS_CAMERA_EFFECT_START] = {"captureMacroDepthFussionZoomRange", META_TYPE_FLOAT, -1}, + [OHOS_CONTROL_CAPTURE_MACRO_DEPTH_FUSION - + OHOS_CAMERA_EFFECT_START] = {"captureMacroDepthFusion", META_TYPE_BYTE, 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 1004c1ca..25f457e0 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -295,6 +295,9 @@ const std::vector g_metadataTags = { OHOS_CONTROL_DEPTH_DATA_ACCURACY, OHOS_ABILITY_CAMERA_IS_RETRACTABLE, OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, + OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_SUPPORTED, + OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_ZOOM_RANGE, + OHOS_CONTROL_CAPTURE_MACRO_DEPTH_FUSION, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From 08c99c35d2a679f8da3fb1568004070b396325a4 Mon Sep 17 00:00:00 2001 From: yangjian90 Date: Fri, 27 Sep 2024 10:31:37 +0800 Subject: [PATCH 124/347] adapter wifi netlink callback Signed-off-by: yangjian90 --- wlan/chip/v1_0/IChipIfaceCallback.idl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlan/chip/v1_0/IChipIfaceCallback.idl b/wlan/chip/v1_0/IChipIfaceCallback.idl index 2afe8d0b..3b9f9bed 100644 --- a/wlan/chip/v1_0/IChipIfaceCallback.idl +++ b/wlan/chip/v1_0/IChipIfaceCallback.idl @@ -77,11 +77,12 @@ import ohos.hdi.wlan.chip.v1_0.ChipTypes; * @brief Called to process the Netlink message received, This interface is preferentially used to * communicate with the Wi-Fi service. * + * @param type Indicates the Netlink message type (Action Message, Action Status, Ext Message). * @param recvMsg Indicates the Netlink message received. * * @since 5.0 * @version 1.0 */ - [oneway] OnWifiNetlinkMessage([in] unsigned char[] recvMsg); + [oneway] OnWifiNetlinkMessage([in] unsigned int type, [in] unsigned char[] recvMsg); }; /** @} */ \ No newline at end of file -- Gitee From bf30d2b6a121de8fa76e95393a89772aaf5a3473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 27 Sep 2024 11:27:50 +0800 Subject: [PATCH 125/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/DisplayComposerType.idl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index aeae693a..3088b3aa 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -61,11 +61,11 @@ enum BufferUsage : ohos.hdi.display.composer.v1_0.BufferUsage { HBM_USE_CPU_HW_BOTH = (1ULL << 17), /**< For support cpu and hardware */ HBM_USAGE_GPU_PERFORMANCE = (1ULL << 18), /**< Prefer performance over memory consumption: */ HBM_USE_RGB_TO_YUV_CONVERSION = (1ULL << 19), /**< For identify RGB to YUV conversion */ - HBM_USE_AUXILLARY_BUFFER0 = (1ULL << 20), - HBM_USE_AUXILLARY_BUFFER1 = (1ULL << 21), - HBM_USE_AUXILLARY_BUFFER2 = (1ULL << 22), - HBM_USE_AUXILLARY_BUFFER3 = (1ULL << 23), - HBM_USE_VIDEO_DEC_MV = HBM_USE_VIDEO_DECODER | HBM_USE_AUXILLARY_BUFFER2, + HBM_USE_AUXILLARY_BUFFER0 = (1ULL << 20), /**< reserved for individual meta size */ + HBM_USE_AUXILLARY_BUFFER1 = (1ULL << 21), /**< ref to VIDEO_MV */ + HBM_USE_AUXILLARY_BUFFER2 = (1ULL << 22), /**< combine with main usage for specific meta feature */ + HBM_USE_AUXILLARY_BUFFER3 = (1ULL << 23), /**< combine with main usage for specific meta feature */ + HBM_USE_VIDEO_DEC_MV = HBM_USE_VIDEO_DECODER | HBM_USE_AUXILLARY_BUFFER2, /**< ref to VIDEO_DEC */ }; -- Gitee From 2b27b48d46c51af48dcd406e92bd54a892ef84ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 27 Sep 2024 14:34:58 +0800 Subject: [PATCH 126/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/graphic/common/v2_0/BufferHandleMetaKeyType.idl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl index 9241ddf0..f7b9eb71 100644 --- a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl +++ b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl @@ -76,6 +76,10 @@ enum CacheOption { CACHE_FLUSH, // Write aux buffer on CPU and flash cache to DDR }; +/** + * @brief BlobDataType of [value] in GetMetadata/SetMetaData, to avoid data copy. + * + */ struct BlobDataType { unsigned long vaddr; // virtual address, direct accessed w/o copy unsigned int offset; // field offset in dmabuf, support dma access -- Gitee From 61faf1c65c437dbf89710496924c25ea29baa9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 27 Sep 2024 14:37:26 +0800 Subject: [PATCH 127/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/DisplayComposerType.idl | 2 +- display/graphic/common/v2_0/BufferHandleMetaKeyType.idl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 3088b3aa..4b578a17 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -92,7 +92,7 @@ enum DispCmd : ohos.hdi.display.composer.v1_0.DispCmd { * @brief Enumerates the property id of the display vdi. * * @since 5.0 - * @version 1.1 + * @version 1.2 */ enum DisplayPropertyID { DISPLAY_PROPERTY_ID_SKIP_VALIDATE = 1, diff --git a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl index f7b9eb71..a6b5d282 100644 --- a/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl +++ b/display/graphic/common/v2_0/BufferHandleMetaKeyType.idl @@ -69,6 +69,8 @@ enum HebcAccessType { /** * @brief Enumerates the CacheOption types. * + * @since 5.0 + * @version 2.0 */ enum CacheOption { CACHE_NOOP = 0x0, // Do nothing @@ -79,6 +81,8 @@ enum CacheOption { /** * @brief BlobDataType of [value] in GetMetadata/SetMetaData, to avoid data copy. * + * @since 5.0 + * @version 2.0 */ struct BlobDataType { unsigned long vaddr; // virtual address, direct accessed w/o copy -- Gitee From f4df6a49b5e86dd599e94848e1e705c5ced227b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 27 Sep 2024 14:49:48 +0800 Subject: [PATCH 128/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/DisplayComposerType.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 4b578a17..3088b3aa 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -92,7 +92,7 @@ enum DispCmd : ohos.hdi.display.composer.v1_0.DispCmd { * @brief Enumerates the property id of the display vdi. * * @since 5.0 - * @version 1.2 + * @version 1.1 */ enum DisplayPropertyID { DISPLAY_PROPERTY_ID_SKIP_VALIDATE = 1, -- Gitee From b5c0f02527ec808f256a7df2e2a9e72b71170dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 27 Sep 2024 17:43:19 +0800 Subject: [PATCH 129/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../v1_0/display_command/display_cmd_requester.h | 4 ++++ .../v1_2/display_command/display_cmd_requester.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/display/composer/v1_0/display_command/display_cmd_requester.h b/display/composer/v1_0/display_command/display_cmd_requester.h index b194f3bc..8d586535 100755 --- a/display/composer/v1_0/display_command/display_cmd_requester.h +++ b/display/composer/v1_0/display_command/display_cmd_requester.h @@ -591,6 +591,10 @@ protected: // unpack types vector vectSize = 0; retBool = replyUnpacker.ReadUint32(vectSize); + if (vectSize > CmdUtils::MAX_MEMORY) { + HDF_LOGE("%{public}s: layers vectSize:%{public}u is too large", __func__, vectSize); + return HDF_FAILURE; + } DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, HDF_LOGE("%{public}s: read vect size failed", __func__)); if (vectSize > CmdUtils::MAX_MEMORY) { HDF_LOGE("%{public}s: types vectSize:%{public}u is too large", __func__, vectSize); diff --git a/display/composer/v1_2/display_command/display_cmd_requester.h b/display/composer/v1_2/display_command/display_cmd_requester.h index 775ea7db..1bfe6799 100644 --- a/display/composer/v1_2/display_command/display_cmd_requester.h +++ b/display/composer/v1_2/display_command/display_cmd_requester.h @@ -115,6 +115,10 @@ EXIT: DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, HDF_LOGE("%{public}s: HDI 1.2 read vect size failed", __func__)); + if (vectSize > CmdUtils::MAX_MEMORY) { + HDF_LOGE("%{public}s: layers vectSize:%{public}u is too large", __func__, vectSize); + return HDF_FAILURE; + } compChangeLayers_[devId].resize(vectSize); for (uint32_t i = 0; i < vectSize; i++) { DISPLAY_CHK_RETURN(replyUnpacker.ReadUint32(compChangeLayers_[devId][i]) == false, HDF_FAILURE, @@ -126,6 +130,10 @@ EXIT: DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, HDF_LOGE("%{public}s: HDI 1.2 read vect size failed", __func__)); + if (vectSize > CmdUtils::MAX_MEMORY) { + HDF_LOGE("%{public}s: layers vectSize:%{public}u is too large", __func__, vectSize); + return HDF_FAILURE; + } compChangeTypes_[devId].resize(vectSize); for (uint32_t i = 0; i < vectSize; i++) { DISPLAY_CHK_RETURN(replyUnpacker.ReadInt32(compChangeTypes_[devId][i]) == false, HDF_FAILURE, @@ -154,6 +162,10 @@ EXIT: DISPLAY_CHK_RETURN(true != replyUnpacker.ReadUint32(vectSize), HDF_FAILURE, HDF_LOGE("%{public}s: HDI 1.2 read vect size failed", __func__)); + if (vectSize > CmdUtils::MAX_MEMORY) { + HDF_LOGE("%{public}s: layers vectSize:%{public}u is too large", __func__, vectSize); + return HDF_FAILURE; + } layers.resize(vectSize); for (uint32_t i = 0; i < vectSize; i++) { DISPLAY_CHK_RETURN(replyUnpacker.ReadUint32(layers[i]) == false, HDF_FAILURE, @@ -165,6 +177,10 @@ EXIT: DISPLAY_CHK_RETURN(true != replyUnpacker.ReadUint32(vectSize), HDF_FAILURE, HDF_LOGE("%{public}s: HDI 1.2 read vect size failed", __func__)); + if (vectSize > CmdUtils::MAX_MEMORY) { + HDF_LOGE("%{public}s: layers vectSize:%{public}u is too large", __func__, vectSize); + return HDF_FAILURE; + } fences.resize(vectSize); for (uint32_t i = 0; i < vectSize; i++) { ret = CmdUtils::FileDescriptorUnpack(replyUnpacker, replyFds, fences[i]); -- Gitee From 6ce99452842655360f21011fbc76521bd7a9bf61 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sun, 29 Sep 2024 09:28:25 +0800 Subject: [PATCH 130/347] fff Signed-off-by: huangshengqing --- camera/metadata/include/camera_device_ability_items.h | 8 ++++++++ camera/metadata/include/camera_metadata_item_info.h | 2 ++ camera/metadata/src/camera_metadata_info.cpp | 1 + 3 files changed, 11 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 087479b9..1290de7e 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -966,6 +966,13 @@ typedef enum camera_device_metadata_tag { * (i.e. enum: begin/end ...) */ OHOS_CONTROL_BURST_CAPTURE, + /** + * ohos.control.cameraUsedAsPosition [static, byte, public] + * + * camera device property, set current camera used as position + * (i.e. enum: byte ...) + */ + OHOS_CONTROL_CAMERA_USED_AS_POSITION, /** * ohos.control.cameraSessionUsage [static, enum[], public] * @@ -2025,6 +2032,7 @@ typedef enum camera_switch_enum { OHOS_CAMERA_SWTICH_ON, } camera_switch_enum_t; +// OHOS_ABILITY_CAMERA_USED_AS_POSITION enumeration values // OHOS_ABILITY_CAMERA_POSITION enumeration values typedef enum camera_position_enum { OHOS_CAMERA_POSITION_FRONT = 0, diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index c6cf0d7a..671a9350 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -251,6 +251,8 @@ 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_USED_AS_POSITION - + OHOS_DEVICE_CONTROL_START] = {"cameraUsedAsPosition", META_TYPE_BYTE, 1}, [OHOS_CONTROL_CAMERA_SESSION_USAGE - OHOS_DEVICE_CONTROL_START] = {"cameraSessionUsage", META_TYPE_INT32, -1}, [OHOS_CONTROL_EJECT_RETRY - diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 1004c1ca..a09b16c7 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -155,6 +155,7 @@ const std::vector g_metadataTags = { OHOS_CONTROL_SENSOR_WB_VALUE, OHOS_CONTROL_HIGH_QUALITY_MODE, OHOS_CONTROL_BURST_CAPTURE, + OHOS_CONTROL_CAMERA_USED_AS_POSITION, OHOS_CONTROL_CAMERA_SESSION_USAGE, OHOS_CONTROL_EJECT_RETRY, OHOS_CONTROL_FALL_PROTECTION, -- Gitee From d633fda4f2265a2228bbb991d919d4bf8297205b Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Sun, 29 Sep 2024 01:33:40 +0000 Subject: [PATCH 131/347] update camera/metadata/include/camera_device_ability_items.h. Signed-off-by: huangshengqing --- camera/metadata/include/camera_device_ability_items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 1290de7e..3c038fb5 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -970,7 +970,7 @@ typedef enum camera_device_metadata_tag { * ohos.control.cameraUsedAsPosition [static, byte, public] * * camera device property, set current camera used as position - * (i.e. enum: byte ...) + * (i.e. byte ...) */ OHOS_CONTROL_CAMERA_USED_AS_POSITION, /** -- Gitee From 7abcd1907c60644b810a70f0157865c8196500e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sun, 29 Sep 2024 11:14:05 +0800 Subject: [PATCH 132/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/display_command/display_cmd_requester.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_requester.h b/display/composer/v1_0/display_command/display_cmd_requester.h index 8d586535..b194f3bc 100755 --- a/display/composer/v1_0/display_command/display_cmd_requester.h +++ b/display/composer/v1_0/display_command/display_cmd_requester.h @@ -591,10 +591,6 @@ protected: // unpack types vector vectSize = 0; retBool = replyUnpacker.ReadUint32(vectSize); - if (vectSize > CmdUtils::MAX_MEMORY) { - HDF_LOGE("%{public}s: layers vectSize:%{public}u is too large", __func__, vectSize); - return HDF_FAILURE; - } DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, HDF_LOGE("%{public}s: read vect size failed", __func__)); if (vectSize > CmdUtils::MAX_MEMORY) { HDF_LOGE("%{public}s: types vectSize:%{public}u is too large", __func__, vectSize); -- Gitee From a080f5137fb6da0b3a49e0e9fb296cdd784894ef Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 14:38:31 +0800 Subject: [PATCH 133/347] =?UTF-8?q?=E5=8D=95=E6=A1=86=E6=9E=B6CLD=E7=A1=AC?= =?UTF-8?q?=E5=8C=96=E5=9C=86=E8=A7=92=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index af8da064..7af8ee32 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -161,6 +161,10 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } + int32_t ret = Unmap(buffer); + if( ret != HDF_SUCCESS) { + HDF_LOGE("Unmap failed!"); + } return mapperService->FreeMem(buffer); } @@ -170,7 +174,16 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) if (metaService == nullptr) { return HDF_FAILURE; } - return metaService->RegisterBuffer(buffer); + int32_t ret = metaService->RegisterBuffer(buffer); + if( ret != HDF_SUCCESS) { + HDF_LOGE("Register Buffer failed!"); + return ret; + } + ret = Mmap(buffer); + if( ret != HDF_SUCCESS) { + HDF_LOGE("Mmap failed!"); + } + return HDF_SUCCESS; } void LayerCache::Dump() const -- Gitee From f1349c40e2eb115757c2da91054a094674d89954 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 06:45:12 +0000 Subject: [PATCH 134/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 7af8ee32..594e9b4f 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -161,10 +161,10 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - int32_t ret = Unmap(buffer); - if( ret != HDF_SUCCESS) { + int32_t ret = Unmap(buffer); + if( ret != HDF_SUCCESS) { HDF_LOGE("Unmap failed!"); - } + } return mapperService->FreeMem(buffer); } @@ -175,14 +175,14 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) return HDF_FAILURE; } int32_t ret = metaService->RegisterBuffer(buffer); - if( ret != HDF_SUCCESS) { + if( ret != HDF_SUCCESS) { HDF_LOGE("Register Buffer failed!"); return ret; - } + } ret = Mmap(buffer); - if( ret != HDF_SUCCESS) { + if( ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); - } + } return HDF_SUCCESS; } -- Gitee From 6e6da8bd09f662c85b27422b579ca0c207e79c47 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Sun, 29 Sep 2024 15:05:34 +0800 Subject: [PATCH 135/347] fix code Signed-off-by: liuziwei --- 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 6379e813..93a8a21d 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 3.0 + * @version 2.0 */ OnGetData([in] unsigned char[] algoParameter, [in] unsigned long authSubType, [in] unsigned int algoVersion, [in] unsigned char[] challenge, [in] String complexityReg); -- Gitee From 01127a8f7cecd412d22bad74a4a6cfcaf2740f58 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 07:06:59 +0000 Subject: [PATCH 136/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 594e9b4f..60e104c5 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -163,7 +163,7 @@ int32_t LayerCache::FreeMem(sptr& buffer) } int32_t ret = Unmap(buffer); if( ret != HDF_SUCCESS) { - HDF_LOGE("Unmap failed!"); + HDF_LOGE("Unmap failed!"); } return mapperService->FreeMem(buffer); } -- Gitee From 65eb6336209d4e0ee68c32e2f82937d141231914 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 07:08:45 +0000 Subject: [PATCH 137/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 60e104c5..d5845df4 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -162,7 +162,7 @@ int32_t LayerCache::FreeMem(sptr& buffer) return HDF_FAILURE; } int32_t ret = Unmap(buffer); - if( ret != HDF_SUCCESS) { + if (ret != HDF_SUCCESS) { HDF_LOGE("Unmap failed!"); } return mapperService->FreeMem(buffer); -- Gitee From f0a562f82e5d90c1078e9bf04d4facc22c0b6b4c Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 07:11:07 +0000 Subject: [PATCH 138/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index d5845df4..3fa67c41 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -181,9 +181,9 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) } ret = Mmap(buffer); if( ret != HDF_SUCCESS) { - HDF_LOGE("Mmap failed!"); + HDF_LOGE("Mmap failed!"); } - return HDF_SUCCESS; + return HDF_SUCCESS; } void LayerCache::Dump() const -- Gitee From eba35218eaab4a27361f51e58e882801c5801f57 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 07:36:08 +0000 Subject: [PATCH 139/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 3fa67c41..4133e183 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -180,7 +180,7 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) return ret; } ret = Mmap(buffer); - if( ret != HDF_SUCCESS) { + if (ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); } return HDF_SUCCESS; -- Gitee From e9bfb77c2bbcb25f7cdfa3026a54b94b0224829d Mon Sep 17 00:00:00 2001 From: liufeng Date: Sun, 29 Sep 2024 11:44:41 +0800 Subject: [PATCH 140/347] =?UTF-8?q?cherry=20pick=20607d913=20from=20https:?= =?UTF-8?q?//gitee.com/fengliucs/drivers=5Finterface=5F2/pulls/1261=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9metadata.type=E6=A0=A1=E9=AA=8C=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liufeng --- .../metadata/include/camera_metadata_info.h | 2 +- .../include/camera_metadata_operator.h | 2 +- camera/metadata/src/camera_metadata_info.cpp | 31 ++++++++++++++----- .../metadata/src/camera_metadata_operator.cpp | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/camera/metadata/include/camera_metadata_info.h b/camera/metadata/include/camera_metadata_info.h index dd0e4304..042d020e 100644 --- a/camera/metadata/include/camera_metadata_info.h +++ b/camera/metadata/include/camera_metadata_info.h @@ -109,7 +109,7 @@ public: static uint32_t GetCameraMetadataDataSize(const common_metadata_header_t *metadata_header); static int32_t CopyCameraMetadataItems(common_metadata_header_t *newMetadata, const common_metadata_header_t *oldMetadata); - static size_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t data_count); + static int32_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t data_count); static int32_t GetCameraMetadataItemType(uint32_t item, uint32_t *data_type); static common_metadata_header_t *FillCameraMetadata(common_metadata_header_t *buffer, size_t memoryRequired, uint32_t itemCapacity, uint32_t dataCapacity); diff --git a/camera/metadata/include/camera_metadata_operator.h b/camera/metadata/include/camera_metadata_operator.h index 3b1e4e65..2684822f 100644 --- a/camera/metadata/include/camera_metadata_operator.h +++ b/camera/metadata/include/camera_metadata_operator.h @@ -201,7 +201,7 @@ uint32_t GetCameraMetadataItemCapacity(const common_metadata_header_t *metadata_ uint32_t GetCameraMetadataDataSize(const common_metadata_header_t *metadata_header); int32_t CopyCameraMetadataItems(common_metadata_header_t *newMetadata, const common_metadata_header_t *oldMetadata); -size_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t data_count); +int32_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t data_count); int32_t GetCameraMetadataItemType(uint32_t item, uint32_t *data_type); common_metadata_header_t *FillCameraMetadata(common_metadata_header_t *buffer, size_t memoryRequired, uint32_t itemCapacity, uint32_t dataCapacity); diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 7722c0ad..af234d3f 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -383,7 +383,11 @@ bool CameraMetadata::resize_add_metadata(uint32_t item, const void *data, size_t METADATA_ERR_LOG("GetCameraMetadataItemType invalid item type"); return false; } - size_t size = CalculateCameraMetadataItemDataSize(data_type, data_count); + int32_t size = CalculateCameraMetadataItemDataSize(data_type, data_count); + if (size == CAM_META_FAILURE) { + METADATA_ERR_LOG("CalculateCameraMetadataItemDataSize invalid datatype:%{public}d", data_type); + return false; + } common_metadata_header_t *newMetadata = AllocateCameraMetadataBuffer((itemCapacity + 1) * INDEX_COUNTER, AlignTo((data_capacity + size) * INDEX_COUNTER, DATA_ALIGNMENT)); @@ -689,12 +693,12 @@ const char *CameraMetadata::GetCameraMetadataItemName(uint32_t item) return g_ohosItemInfo[section][itemIndex].item_name; } -size_t CameraMetadata::CalculateCameraMetadataItemDataSize(uint32_t type, size_t dataCount) +int32_t CameraMetadata::CalculateCameraMetadataItemDataSize(uint32_t type, size_t dataCount) { METADATA_DEBUG_LOG("CalculateCameraMetadataItemDataSize start"); if (type < META_TYPE_BYTE || type >= META_NUM_TYPES) { METADATA_ERR_LOG("CalculateCameraMetadataItemDataSize invalid type"); - return 0; + return CAM_META_FAILURE; } size_t dataBytes = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[type]; @@ -736,6 +740,11 @@ int CameraMetadata::AddCameraMetadataItemVerify(common_metadata_header_t *dst, return CAM_META_INVALID_PARAM; } + if (*dataType < META_TYPE_BYTE || *dataType >= META_NUM_TYPES) { + METADATA_ERR_LOG("AddCameraMetadataItemVerify invalid type"); + return CAM_META_INVALID_PARAM; + } + return CAM_META_SUCCESS; } @@ -753,7 +762,7 @@ int CameraMetadata::AddCameraMetadataItem(common_metadata_header_t *dst, uint32_ return CAM_META_INVALID_PARAM; } - size_t dataBytes = CalculateCameraMetadataItemDataSize(dataType, dataCount); + int32_t dataBytes = CalculateCameraMetadataItemDataSize(dataType, dataCount); if (dataBytes + dst->data_count > dst->data_capacity) { METADATA_ERR_LOG("AddCameraMetadataItem data_capacity limit reached"); return CAM_META_DATA_CAP_EXCEED; @@ -823,9 +832,12 @@ int CameraMetadata::GetCameraMetadataItem(const common_metadata_header_t *src, u item->data_type = localItem->data_type; item->count = localItem->count; - size_t dataBytes = CalculateCameraMetadataItemDataSize(localItem->data_type, localItem->count); + int32_t dataBytes = CalculateCameraMetadataItemDataSize(localItem->data_type, localItem->count); if (dataBytes == 0) { item->data.u8 = localItem->data.value; + } else if (dataBytes == CAM_META_FAILURE) { + METADATA_ERR_LOG("GetCameraMetadataItem invalid datatype:%{public}d", localItem->data_type); + return CAM_META_FAILURE; } else { uint8_t *srcMetadataData = GetMetadataData(src); if (srcMetadataData == nullptr) { @@ -965,9 +977,9 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it METADATA_ERR_LOG("UpdateameraMetadataItemSize invalid datatype:%{public}d", item->data_type); return CAM_META_FAILURE; } - size_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); + int32_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); size_t dataPayloadSize = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]; - size_t oldItemSize = CalculateCameraMetadataItemDataSize(item->data_type, item->count); + int32_t oldItemSize = CalculateCameraMetadataItemDataSize(item->data_type, item->count); int32_t ret = CAM_META_SUCCESS; if (dataSize != oldItemSize) { if (dst->data_capacity < (dst->data_count + dataSize - oldItemSize)) { @@ -1103,7 +1115,7 @@ int CameraMetadata::DeleteCameraMetadataItemByIndex(common_metadata_header_t *ds int32_t ret = CAM_META_SUCCESS; camera_metadata_item_entry_t *itemToDelete = GetMetadataItems(dst) + index; - size_t dataBytes = CalculateCameraMetadataItemDataSize(itemToDelete->data_type, itemToDelete->count); + int32_t dataBytes = CalculateCameraMetadataItemDataSize(itemToDelete->data_type, itemToDelete->count); if (dataBytes > 0) { ret = moveMetadataMemery(dst, itemToDelete, dataBytes); if (ret != CAM_META_SUCCESS) { @@ -1119,6 +1131,9 @@ int CameraMetadata::DeleteCameraMetadataItemByIndex(common_metadata_header_t *ds metadataItems->data.offset -= dataBytes; } } + } else if (dataBytes == CAM_META_FAILURE) { + METADATA_ERR_LOG("DeleteCameraMetadataItemByIndex invalid datatype:%{public}d", itemToDelete->data_type); + return CAM_META_FAILURE; } uint64_t length = sizeof(camera_metadata_item_entry_t) * (dst->item_count - index - 1); diff --git a/camera/metadata/src/camera_metadata_operator.cpp b/camera/metadata/src/camera_metadata_operator.cpp index 26dee921..5a7056a0 100644 --- a/camera/metadata/src/camera_metadata_operator.cpp +++ b/camera/metadata/src/camera_metadata_operator.cpp @@ -52,7 +52,7 @@ const char *GetCameraMetadataItemName(uint32_t item) return CameraMetadata::GetCameraMetadataItemName(item); } -size_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t dataCount) +int32_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t dataCount) { return CameraMetadata::CalculateCameraMetadataItemDataSize(type, dataCount); } -- Gitee From ad1a1d82879df1224c04991d694f471d20e661b6 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sun, 29 Sep 2024 07:36:57 +0000 Subject: [PATCH 141/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 4133e183..fba3f084 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -175,7 +175,7 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) return HDF_FAILURE; } int32_t ret = metaService->RegisterBuffer(buffer); - if( ret != HDF_SUCCESS) { + if (ret != HDF_SUCCESS) { HDF_LOGE("Register Buffer failed!"); return ret; } -- Gitee From 94fba0569274c260282f4bd2e121e0e56cb4a401 Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Mon, 30 Sep 2024 17:37:31 +0800 Subject: [PATCH 142/347] fuck Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index af234d3f..6cb1de36 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -970,8 +970,8 @@ int CameraMetadata::copyMetadataMemory(common_metadata_header_t *dst, camera_met int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *item, uint32_t dataCount, common_metadata_header_t *dst, const void *data) { - if (item == nullptr || dst == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); + 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); @@ -981,6 +981,9 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it size_t dataPayloadSize = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[item->data_type]; int32_t oldItemSize = CalculateCameraMetadataItemDataSize(item->data_type, item->count); int32_t ret = CAM_META_SUCCESS; + if (item == nullptr || dst == nullptr) { + METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); + return CAM_META_FAILURE; if (dataSize != oldItemSize) { if (dst->data_capacity < (dst->data_count + dataSize - oldItemSize)) { METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex data_capacity limit reached"); @@ -1001,12 +1004,10 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it dst->data_count += dataSize; } } else if (dataSize != 0) { - item->data.offset = dst->data_count; ret = copyMetadataMemory(dst, item, dataPayloadSize, data); if (ret != CAM_META_SUCCESS) { return ret; } - dst->data_count += dataSize; } if (dataSize == 0) { ret = memcpy_s(item->data.value, dataPayloadSize, data, dataPayloadSize); -- Gitee From 6453de122a301e55870070a43b1f1bf5d5d5e81c Mon Sep 17 00:00:00 2001 From: huangshengqing Date: Mon, 30 Sep 2024 09:42:02 +0000 Subject: [PATCH 143/347] update camera/metadata/src/camera_metadata_info.cpp. Signed-off-by: huangshengqing --- camera/metadata/src/camera_metadata_info.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 6cb1de36..3b99e027 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -984,6 +984,7 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it if (item == nullptr || dst == nullptr) { METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); return CAM_META_FAILURE; + } if (dataSize != oldItemSize) { if (dst->data_capacity < (dst->data_count + dataSize - oldItemSize)) { METADATA_ERR_LOG("UpdateCameraMetadataItemByIndex data_capacity limit reached"); -- Gitee From 9b544eb72469eac69644800a80b33703e03e8eef Mon Sep 17 00:00:00 2001 From: bitbegin Date: Tue, 8 Oct 2024 11:38:42 +0800 Subject: [PATCH 144/347] use new hdi import Signed-off-by: bitbegin --- connected_nfc_tag/v1_0/BUILD.gn | 2 +- connected_nfc_tag/v1_1/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connected_nfc_tag/v1_0/BUILD.gn b/connected_nfc_tag/v1_0/BUILD.gn index a4f5a8c4..aeea1266 100644 --- a/connected_nfc_tag/v1_0/BUILD.gn +++ b/connected_nfc_tag/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("connected_nfc_tag") { module_name = "connected_nfc_tag_service" diff --git a/connected_nfc_tag/v1_1/BUILD.gn b/connected_nfc_tag/v1_1/BUILD.gn index d60f8e6b..557b0e8b 100644 --- a/connected_nfc_tag/v1_1/BUILD.gn +++ b/connected_nfc_tag/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("connected_nfc_tag") { module_name = "connected_nfc_tag_service" imports = [ "ohos.hdi.connected_nfc_tag.v1_0:connected_nfc_tag" ] -- Gitee From abdee76045128f15f1b6ba3041d15e27acac00a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 9 Oct 2024 10:53:19 +0800 Subject: [PATCH 145/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/graphic/common/v1_1/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/graphic/common/v1_1/BUILD.gn b/display/graphic/common/v1_1/BUILD.gn index ea781091..f429729d 100644 --- a/display/graphic/common/v1_1/BUILD.gn +++ b/display/graphic/common/v1_1/BUILD.gn @@ -16,7 +16,7 @@ import("//build/config/components/hdi/hdi.gni") hdi("display_commontype") { module_name = "display_commontype" - imports = [ "ohos.hdi.display.graphic.common.v1_0:display_commontype" ] + sequenceable_pub_deps = [ "ohos.hdi.display.graphic.common.v1_0:display_commontype" ] sources = [ "BufferHandleMetaKeyType.idl" ] -- Gitee From 2d361c162537a5534b88cf66911953a5bc11f537 Mon Sep 17 00:00:00 2001 From: yangkan Date: Wed, 25 Sep 2024 15:57:29 +0800 Subject: [PATCH 146/347] =?UTF-8?q?cmdrequest=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=E5=9B=9E=E6=BB=9Apos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- .../command_pack/command_data_packer.h | 5 + .../common/include/display_interface_utils.h | 8 + .../display_command/display_cmd_requester.h | 726 +++++++++++------- .../display_command/display_cmd_requester.h | 59 +- .../display_command/display_cmd_responser.h | 4 +- 5 files changed, 499 insertions(+), 303 deletions(-) diff --git a/display/composer/command_pack/command_data_packer.h b/display/composer/command_pack/command_data_packer.h index 7dd34fe6..d45eb311 100644 --- a/display/composer/command_pack/command_data_packer.h +++ b/display/composer/command_pack/command_data_packer.h @@ -104,6 +104,11 @@ public: return data_; } + void RollBack(int32_t writePos) + { + writePos_ = writePos; + } + bool PackBegin(int32_t beginCmd) { writePos_ = 0; diff --git a/display/composer/common/include/display_interface_utils.h b/display/composer/common/include/display_interface_utils.h index 6bb3d620..0e6dd1b3 100644 --- a/display/composer/common/include/display_interface_utils.h +++ b/display/composer/common/include/display_interface_utils.h @@ -44,4 +44,12 @@ } \ } while (0) +#define DISPLAY_CHK_BREAK(val, ...) \ + do { \ + if (val) { \ + __VA_ARGS__; \ + break; \ + } \ + } while (0) + #endif // DISPLAY_INTERFACE_UTILS_H diff --git a/display/composer/v1_0/display_command/display_cmd_requester.h b/display/composer/v1_0/display_command/display_cmd_requester.h index b194f3bc..dd073ac5 100755 --- a/display/composer/v1_0/display_command/display_cmd_requester.h +++ b/display/composer/v1_0/display_command/display_cmd_requester.h @@ -126,58 +126,82 @@ EXIT: int32_t SetDisplayClientBuffer(uint32_t devId, const BufferHandle* buffer, uint32_t seqNo, int32_t fence) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CLIENT_BUFFER, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - bool retBool = requestPacker_.WriteUint32(devId); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write devId failed", __func__)); - - ret = CmdUtils::BufferHandlePack(buffer, requestPacker_, requestHdiFds_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: BufferHandlePack failed", __func__)); - - retBool = requestPacker_.WriteUint32(seqNo); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write seqNo failed", __func__)); - - ret = CmdUtils::FileDescriptorPack(fence, requestPacker_, requestHdiFds_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: FileDescriptorPack failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CLIENT_BUFFER, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + retBool = requestPacker_.WriteUint32(devId); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write devId failed", __func__)); + + ret = CmdUtils::BufferHandlePack(buffer, requestPacker_, requestHdiFds_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: BufferHandlePack failed", __func__)); + + retBool = requestPacker_.WriteUint32(seqNo); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write seqNo failed", __func__)); + + ret = CmdUtils::FileDescriptorPack(fence, requestPacker_, requestHdiFds_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: FileDescriptorPack failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetDisplayClientDamage(uint32_t devId, std::vector &rects) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CLIENT_DAMAGE, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = requestPacker_.WriteUint32(devId) ? HDF_SUCCESS : HDF_FAILURE; - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: write devId failed", __func__)); + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CLIENT_DAMAGE, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = requestPacker_.WriteUint32(devId) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: write devId failed", __func__)); + + uint32_t vectSize = static_cast(rects.size()); + retBool = requestPacker_.WriteUint32(vectSize); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write damage vector size failed", __func__)); + + for (uint32_t i = 0; i < vectSize; i++) { + ret = CmdUtils::RectPack(rects[i], requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed", __func__)); + } + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed, break!", __func__)); - uint32_t vectSize = static_cast(rects.size()); - bool retBool = requestPacker_.WriteUint32(vectSize); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write damage vector size failed", __func__)); + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); - for (uint32_t i = 0; i < vectSize; i++) { - ret = CmdUtils::RectPack(rects[i], requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: RectPack failed", __func__)); + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; } - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - return HDF_SUCCESS; } @@ -216,322 +240,470 @@ EXIT: int32_t SetLayerAlpha(uint32_t devId, uint32_t layerId, const LayerAlpha &alpha) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_ALPHA, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: write devId failed", __func__)); - - bool retBool = requestPacker_.WriteBool(alpha.enGlobalAlpha); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write enGlobalAlpha failed", __func__)); - - retBool = requestPacker_.WriteBool(alpha.enPixelAlpha); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write enPixelAlpha failed", __func__)); - - retBool = requestPacker_.WriteUint8(alpha.alpha0); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write alpha0 failed", __func__)); - - retBool = requestPacker_.WriteUint8(alpha.alpha1); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write alpha1 failed", __func__)); - - retBool = requestPacker_.WriteUint8(alpha.gAlpha); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write gAlpha failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_ALPHA, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: write devId failed", __func__)); + + retBool = requestPacker_.WriteBool(alpha.enGlobalAlpha); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write enGlobalAlpha failed", __func__)); + + retBool = requestPacker_.WriteBool(alpha.enPixelAlpha); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write enPixelAlpha failed", __func__)); + + retBool = requestPacker_.WriteUint8(alpha.alpha0); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write alpha0 failed", __func__)); + + retBool = requestPacker_.WriteUint8(alpha.alpha1); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write alpha1 failed", __func__)); + + retBool = requestPacker_.WriteUint8(alpha.gAlpha); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write gAlpha failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerRegion(uint32_t devId, uint32_t layerId, const IRect &rect) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_REGION, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); + int32_t ret = 0; + int32_t writePos = requestPacker_.ValidSize(); - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_REGION, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); - ret = CmdUtils::RectPack(rect, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: RectPack failed", __func__)); + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); + ret = CmdUtils::RectPack(rect, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + if (ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerCrop(uint32_t devId, uint32_t layerId, const IRect &rect) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_CROP, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); + int32_t ret = 0; + int32_t writePos = requestPacker_.ValidSize(); - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_CROP, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); - ret = CmdUtils::RectPack(rect, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: RectPack failed", __func__)); + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); + ret = CmdUtils::RectPack(rect, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + if (ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerZorder(uint32_t devId, uint32_t layerId, uint32_t zorder) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_ZORDER, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - bool retBool = requestPacker_.WriteUint32(zorder); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write zorder failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_ZORDER, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + retBool = requestPacker_.WriteUint32(zorder); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write zorder failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerPreMulti(uint32_t devId, uint32_t layerId, bool preMul) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_PREMULTI, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - bool retBool = requestPacker_.WriteBool(preMul); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write preMul failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_PREMULTI, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + retBool = requestPacker_.WriteBool(preMul); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write preMul failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerTransformMode(uint32_t devId, uint32_t layerId, TransformType type) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_TRANSFORM_MODE, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - bool retBool = requestPacker_.WriteInt32(type); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write transform-type failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_TRANSFORM_MODE, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + retBool = requestPacker_.WriteInt32(type); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write transform-type failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerDirtyRegion(uint32_t devId, uint32_t layerId, const std::vector &rects) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_DIRTY_REGION, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_DIRTY_REGION, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + uint32_t vSize = rects.size(); + retBool = requestPacker_.WriteUint32(vSize); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vSize failed", __func__)); + for (uint32_t i = 0; i < vSize; i++) { + ret = CmdUtils::RectPack(rects[i], requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed", __func__)); + } + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed, break", __func__)); - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); - uint32_t vSize = rects.size(); - bool retBool = requestPacker_.WriteUint32(vSize); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write vSize failed", __func__)); - for (uint32_t i = 0; i < vSize; i++) { - ret = CmdUtils::RectPack(rects[i], requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: RectPack failed", __func__)); + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; } - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - return HDF_SUCCESS; } int32_t SetLayerVisibleRegion(uint32_t devId, uint32_t layerId, std::vector &rects) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_VISIBLE_REGION, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_VISIBLE_REGION, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + uint32_t vSize = rects.size(); + retBool = requestPacker_.WriteUint32(vSize); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vSize failed", __func__)); + for (uint32_t i = 0; i < vSize; i++) { + ret = CmdUtils::RectPack(rects[i], requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed", __func__)); + } + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed, break", __func__)); - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); - uint32_t vSize = rects.size(); - bool retBool = requestPacker_.WriteUint32(vSize); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write vSize failed", __func__)); - for (uint32_t i = 0; i < vSize; i++) { - ret = CmdUtils::RectPack(rects[i], requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: RectPack failed", __func__)); + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; } - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - return HDF_SUCCESS; } int32_t SetLayerBuffer(uint32_t devId, uint32_t layerId, const BufferHandle* buffer, uint32_t seqNo, int32_t fence, const std::vector& deletingList) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_BUFFER, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - ret = CmdUtils::BufferHandlePack(buffer, requestPacker_, requestHdiFds_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: BufferHandlePack failed", __func__)); - - bool result = requestPacker_.WriteUint32(seqNo); - DISPLAY_CHK_RETURN(result == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write seqNo failed", __func__)); + int32_t ret = 0; + bool retBool = false; + bool result = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_BUFFER, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + ret = CmdUtils::BufferHandlePack(buffer, requestPacker_, requestHdiFds_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: BufferHandlePack failed", __func__)); + + result = requestPacker_.WriteUint32(seqNo); + DISPLAY_CHK_BREAK(result == false, + HDF_LOGE("%{public}s: write seqNo failed", __func__)); + + ret = CmdUtils::FileDescriptorPack(fence, requestPacker_, requestHdiFds_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: FileDescriptorPack failed", __func__)); + // write deletingList + uint32_t vectSize = static_cast(deletingList.size()); + retBool = requestPacker_.WriteUint32(vectSize); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vector size failed", __func__)); + + for (uint32_t i = 0; i < vectSize; i++) { + bool result = requestPacker_.WriteUint32(deletingList[i]); + DISPLAY_CHK_BREAK(result == false, + HDF_LOGE("%{public}s: write deletingList failed", __func__)); + } + DISPLAY_CHK_BREAK(result == false, + HDF_LOGE("%{public}s: write deletingList failed, break!", __func__)); - ret = CmdUtils::FileDescriptorPack(fence, requestPacker_, requestHdiFds_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: FileDescriptorPack failed", __func__)); - // write deletingList - uint32_t vectSize = static_cast(deletingList.size()); - bool retBool = requestPacker_.WriteUint32(vectSize); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write vector size failed", __func__)); + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); - for (uint32_t i = 0; i < vectSize; i++) { - bool result = requestPacker_.WriteUint32(deletingList[i]); - DISPLAY_CHK_RETURN(result == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write deletingList failed", __func__)); + if (retBool == false || result == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; } - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - return HDF_SUCCESS; } int32_t SetLayerCompositionType(uint32_t devId, uint32_t layerId, CompositionType type) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_COMPOSITION_TYPE, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - int32_t retBool = requestPacker_.WriteInt32(type); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write composition type failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_COMPOSITION_TYPE, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + retBool = requestPacker_.WriteInt32(type); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write composition type failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerBlendType(uint32_t devId, uint32_t layerId, BlendType type) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_BLEND_TYPE, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - bool retBool = requestPacker_.WriteInt32(type); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write blend type failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_BLEND_TYPE, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + retBool = requestPacker_.WriteInt32(type); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write blend type failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerMaskInfo(uint32_t devId, uint32_t layerId, const MaskInfo maskInfo) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_MASK_INFO, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - - bool retBool = requestPacker_.WriteUint32(maskInfo); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write maskInfo failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_MASK_INFO, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + + retBool = requestPacker_.WriteUint32(maskInfo); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write maskInfo failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } int32_t SetLayerColor(uint32_t devId, uint32_t layerId, const LayerColor& layerColor) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_COLOR, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); + int32_t ret = 0; + int32_t writePos = requestPacker_.ValidSize(); - ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: SetupDevice failed", __func__)); + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_COLOR, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); - ret = CmdUtils::LayerColorPack(layerColor, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: RectPack failed", __func__)); + ret = CmdUtils::SetupDevice(devId, layerId, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: SetupDevice failed", __func__)); - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); + ret = CmdUtils::LayerColorPack(layerColor, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: RectPack failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + if (ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } diff --git a/display/composer/v1_2/display_command/display_cmd_requester.h b/display/composer/v1_2/display_command/display_cmd_requester.h index 775ea7db..d4836ff6 100644 --- a/display/composer/v1_2/display_command/display_cmd_requester.h +++ b/display/composer/v1_2/display_command/display_cmd_requester.h @@ -241,30 +241,41 @@ EXIT: // LTPO新增接口 int32_t SetDisplayConstraint(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type) { - int32_t ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CONSTRAINT, requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: StartSection failed", __func__)); - - bool retBool = requestPacker_.WriteUint32(devId); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write devId failed", __func__)); - - retBool = requestPacker_.WriteUint64(frameID); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write frameID failed", __func__)); - - retBool = requestPacker_.WriteUint64(ns); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write ns failed", __func__)); - - retBool = requestPacker_.WriteUint32(type); - DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, - HDF_LOGE("%{public}s: write type failed", __func__)); - - ret = CmdUtils::EndSection(requestPacker_); - DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, ret, - HDF_LOGE("%{public}s: EndSection failed", __func__)); - + int32_t ret = 0; + bool retBool = false; + int32_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CONSTRAINT, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + retBool = requestPacker_.WriteUint32(devId); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write devId failed", __func__)); + + retBool = requestPacker_.WriteUint64(frameID); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write frameID failed", __func__)); + + retBool = requestPacker_.WriteUint64(ns); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write ns failed", __func__)); + + retBool = requestPacker_.WriteUint32(type); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write type failed", __func__)); + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("%{public}s: writePos_ rollback", __func__); + return HDF_FAILURE; + } return HDF_SUCCESS; } 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 ea566de2..2ee974fd 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -94,7 +94,7 @@ public: DISPLAY_CHECK(replyPacker_.WriteBool(commitInfo.needFlush) == false, HDF_LOGE("%{public}s, write needFlush error", __func__)); - // Write compLayers vector + // Write compLayers vector uint32_t vectSize = static_cast(commitInfo.compLayers.size()); DISPLAY_CHECK(replyPacker_.WriteUint32(vectSize) == false, HDF_LOGE("%{public}s, write compLayers.size error", __func__)); @@ -103,7 +103,7 @@ public: DISPLAY_CHECK(replyPacker_.WriteUint32(commitInfo.compLayers[i]) == false, HDF_LOGE("%{public}s, write compLayers error", __func__)); } - // Write compTypes vector + // Write compTypes vector vectSize = static_cast(commitInfo.compTypes.size()); DISPLAY_CHECK(replyPacker_.WriteUint32(vectSize) == false, HDF_LOGE("%{public}s, write compTypes.size error", __func__)); -- Gitee From 0dfd059067100597eb1852307db168f26c3d2991 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Mon, 14 Oct 2024 20:15:21 +0800 Subject: [PATCH 147/347] =?UTF-8?q?=E4=BF=AE=E6=94=B9offset=E8=BF=87?= =?UTF-8?q?=E5=A4=A7=E5=AF=BC=E8=87=B4=E8=AE=BF=E9=97=AE=E9=9D=9E=E6=B3=95?= =?UTF-8?q?=E5=86=85=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 3b99e027..00963cc0 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -930,6 +930,12 @@ int CameraMetadata::MetadataExpandItemMem(common_metadata_header_t *dst, camera_ METADATA_ERR_LOG("MetadataExpandItemMem GetMetadataData failed"); return CAM_META_FAILURE; } + if (item->data.offset > UINT32_MAX - (uint32_t)oldItemSize || + item->data.offset + (uint32_t)oldItemSize > dst->data_count) { + METADATA_ERR_LOG("MetadataExpandItemMem data.offset:%{public}u, oldItemSize:%{pulic}uz, " + "dst->data_count:%{public}u", item->data.offset, oldItemSize, dst->data_count); + return CAM_META_FAILURE; + } uint8_t *start = dstMetadataData + item->data.offset; uint8_t *end = start + oldItemSize; size_t length = dst->data_count - item->data.offset - oldItemSize; -- Gitee From 6744dc8356bbdc38bb8af013a94cabf6f17c398b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 14 Oct 2024 22:07:34 +0800 Subject: [PATCH 148/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../composer/cache_manager/layer_cache.cpp | 4 +++ .../display_command/display_cmd_responser.h | 28 ++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index fba3f084..3d7f1ba7 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -69,6 +69,10 @@ int32_t LayerCache::SetBufferCacheMaxCount(uint32_t cacheCount) int32_t LayerCache::SetLayerBuffer(BufferHandle*& buffer, uint32_t seqNo, bool &needFreeBuffer, const std::vector& deletingList, std::function realFunc) { + if (buffer != nullptr) { + HDF_LOGI("%{public}s, seqNo %{public}u, fd %{public}d, size %{public}d", __func__, seqNo, buffer->fd, + buffer->size); + } for (auto num : deletingList) { (void)bufferCaches_->EraseCache(num); } 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 91e5b28c..bb1289bc 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -388,9 +388,18 @@ 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) + - " width:" + std::to_string(data.buffer->width) + " seqNo:" + std::to_string(data.seqNo))); + std::string traceMsg = ""; + if (data.buffer == nullptr) { + traceMsg = "data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo); + } else { + traceMsg = "HDI:DISP:HARDWARE " + + "height:" + std::to_string(data.buffer->height) + + " width:" + std::to_string(data.buffer->width) + + " data.buffer->fd:" + std::to_string(data.buffer->fd) + + " seqNo:" + std::to_string(data.seqNo))+ + " fd:" + std::to_string(fd)); + } + HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); @@ -829,7 +838,18 @@ EXIT: #ifdef DISPLAY_COMSPOER_DEBUG_DUMP DumpLayerBuffer(data.devId, data.layerId, data.fence, handle, "layer_"); #endif - HdfTrace traceVdi("SetLayerBuffer", "HDI:DISP:HARDWARE"); + std::string traceMsg = ""; + if (data.buffer == nullptr) { + traceMsg = "data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo); + } else { + traceMsg = "HDI:DISP:HARDWARE " + + "height:" + std::to_string(data.buffer->height) + + " width:" + std::to_string(data.buffer->width) + + " data.buffer->fd:" + std::to_string(data.buffer->fd) + + " seqNo:" + std::to_string(data.seqNo))+ + " fd:" + std::to_string(fd)); + } + HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From 180881ad87fe6d5256a3d2a8e930a6e9c436b99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 14 Oct 2024 22:25:58 +0800 Subject: [PATCH 149/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../composer/v1_0/display_command/display_cmd_responser.h | 8 ++++---- 1 file changed, 4 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 bb1289bc..f73fa384 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -396,9 +396,9 @@ EXIT: "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + - " seqNo:" + std::to_string(data.seqNo))+ - " fd:" + std::to_string(fd)); + " seqNo:" + std::to_string(data.seqNo)); } + traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); @@ -846,9 +846,9 @@ EXIT: "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + - " seqNo:" + std::to_string(data.seqNo))+ - " fd:" + std::to_string(fd)); + " seqNo:" + std::to_string(data.seqNo)); } + traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); -- Gitee From 18068165edd244080833060c54b79e5ac92cd1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 15 Oct 2024 19:05:58 +0800 Subject: [PATCH 150/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- 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 f73fa384..294e6403 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -396,7 +396,7 @@ EXIT: "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + - " seqNo:" + std::to_string(data.seqNo)); + " seqNo:" + std::to_string(data.seqNo); } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); @@ -846,7 +846,7 @@ EXIT: "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + - " seqNo:" + std::to_string(data.seqNo)); + " seqNo:" + std::to_string(data.seqNo); } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetLayerBuffer", traceMsg); -- Gitee From c65bb25d4a5aa16e22b171d48a4a8ff830dc8b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 15 Oct 2024 19:17:32 +0800 Subject: [PATCH 151/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- 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 294e6403..7a17b482 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -392,7 +392,7 @@ EXIT: if (data.buffer == nullptr) { traceMsg = "data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo); } else { - traceMsg = "HDI:DISP:HARDWARE " + + traceMsg = "HDI:DISP:HARDWARE " "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + @@ -842,7 +842,7 @@ EXIT: if (data.buffer == nullptr) { traceMsg = "data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo); } else { - traceMsg = "HDI:DISP:HARDWARE " + + traceMsg = "HDI:DISP:HARDWARE "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + -- Gitee From 1f44bf7f16f8636c5c4bb6bfee7faf635a1a2018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 16 Oct 2024 15:14:12 +0800 Subject: [PATCH 152/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/display_command/display_cmd_responser.h | 2 ++ 1 file changed, 2 insertions(+) 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 7a17b482..93e588d6 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -400,6 +400,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); + HDF_LOGE("%{public}s: %{public}s", __func__, traceMsg); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); @@ -850,6 +851,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetLayerBuffer", traceMsg); + HDF_LOGE("%{public}s: %{public}s", __func__, traceMsg); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From 0981260954e97a805ab5d6897c5ba23c1a4f78d4 Mon Sep 17 00:00:00 2001 From: suxiaosu007 Date: Wed, 16 Oct 2024 15:14:18 +0800 Subject: [PATCH 153/347] image HDI add enum Signed-off-by: suxiaosu007 --- codec/image/v2_0/CodecImageType.idl | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/codec/image/v2_0/CodecImageType.idl b/codec/image/v2_0/CodecImageType.idl index 7412a3f6..405b5b09 100644 --- a/codec/image/v2_0/CodecImageType.idl +++ b/codec/image/v2_0/CodecImageType.idl @@ -204,6 +204,9 @@ enum PropertyType { 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. */ + AUX_TYPE, /**< auxType for auxiliary image. */ + IMG_RESO, /**< Resolution for auxiliary image. */ + RLOC_INFO, /**< rloc info for auxiliary image. */ }; /** @@ -262,6 +265,28 @@ struct MasteringDisplayColourVolume { unsigned int minDisplayMasteringLuminance; /**< Min display mastering luminance. */ }; +/** + * @brief Defines a struct to describe the relative position of the auxiliary image to the associated image. + * + * @since 5.0 + * @version 2.0 + */ +struct RelativeLocation { + unsigned int horizontalOffset; /**< Horizontal offset in pixels of the left-most pixel column. */ + unsigned int verticalOffset; /**< Vertical offset in pixels of the top-most pixel row. */ +}; + +/** + * @brief Defines a struct to describe resolution for image. + * + * @since 5.0 + * @version 2.0 + */ +struct Resolution { + unsigned int width; + unsigned int height; +}; + /** * @brief Defines a struct to describe a signed rational number. * @@ -336,11 +361,12 @@ struct ImageItem { String itemName; /**< Item name. */ unsigned int id; /**< Item id. */ NativeBuffer pixelBuffer; /**< Buffer to store pixel data. */ + SharedBuffer pixelSharedBuffer; /**< Buffer to store pixel data which cannot be stored in NativeBuffer. */ 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)... */ + unsigned char[] liteProperties; /**< Store smaller propety data, (enum + struct)... Exc:(enum + strlen + str)*/ SharedBuffer sharedProperties; /**< Store larger data, (enum + buffersize + buffer)... */ }; -- Gitee From b41f896bdfb7d6ea817eb338893c7e5e0c88eacf Mon Sep 17 00:00:00 2001 From: Sxs Date: Wed, 16 Oct 2024 07:18:49 +0000 Subject: [PATCH 154/347] update codec/image/v2_0/CodecImageType.idl. Signed-off-by: Sxs --- codec/image/v2_0/CodecImageType.idl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/image/v2_0/CodecImageType.idl b/codec/image/v2_0/CodecImageType.idl index 405b5b09..f98cde80 100644 --- a/codec/image/v2_0/CodecImageType.idl +++ b/codec/image/v2_0/CodecImageType.idl @@ -205,7 +205,7 @@ enum PropertyType { USER_DATA_DO_COMPRESS, /**< Determines whether user data is compressed. */ IT35_INFO, /**< It35 info for HDR. */ AUX_TYPE, /**< auxType for auxiliary image. */ - IMG_RESO, /**< Resolution for auxiliary image. */ + IMG_RESOLUTION, /**< Resolution for auxiliary image. */ RLOC_INFO, /**< rloc info for auxiliary image. */ }; @@ -269,7 +269,7 @@ struct MasteringDisplayColourVolume { * @brief Defines a struct to describe the relative position of the auxiliary image to the associated image. * * @since 5.0 - * @version 2.0 + * @version 1.0 */ struct RelativeLocation { unsigned int horizontalOffset; /**< Horizontal offset in pixels of the left-most pixel column. */ @@ -280,7 +280,7 @@ struct RelativeLocation { * @brief Defines a struct to describe resolution for image. * * @since 5.0 - * @version 2.0 + * @version 1.0 */ struct Resolution { unsigned int width; @@ -366,7 +366,7 @@ struct ImageItem { 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)... Exc:(enum + strlen + str)*/ + unsigned char[] liteProperties; /**< Store smaller propety data, (enum + struct)|(enum + strlen + str)...*/ SharedBuffer sharedProperties; /**< Store larger data, (enum + buffersize + buffer)... */ }; -- Gitee From 93a5b46d888ca5bf30453d90bb841aab575df9d3 Mon Sep 17 00:00:00 2001 From: Sxs Date: Wed, 16 Oct 2024 07:23:32 +0000 Subject: [PATCH 155/347] update codec/image/v2_0/CodecImageType.idl. Signed-off-by: Sxs --- codec/image/v2_0/CodecImageType.idl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/image/v2_0/CodecImageType.idl b/codec/image/v2_0/CodecImageType.idl index f98cde80..5ca20e3c 100644 --- a/codec/image/v2_0/CodecImageType.idl +++ b/codec/image/v2_0/CodecImageType.idl @@ -204,9 +204,9 @@ enum PropertyType { 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. */ - AUX_TYPE, /**< auxType for auxiliary image. */ - IMG_RESOLUTION, /**< Resolution for auxiliary image. */ - RLOC_INFO, /**< rloc info for auxiliary image. */ + AUX_TYPE, /**< URN for auxiliary image. */ + IMG_RESOLUTION, /**< Resolution for uncoded auxiliary image. */ + RLOC_INFO, /**< Rloc info for fragmentmap. */ }; /** -- Gitee From c5e520a250b57103971e29dd904a184ee8487957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 16 Oct 2024 15:48:37 +0800 Subject: [PATCH 156/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../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 93e588d6..8c30eda6 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -400,7 +400,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); - HDF_LOGE("%{public}s: %{public}s", __func__, traceMsg); + HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); @@ -843,7 +843,7 @@ EXIT: if (data.buffer == nullptr) { traceMsg = "data.buffer is nullptr! seqNo:" + std::to_string(data.seqNo); } else { - traceMsg = "HDI:DISP:HARDWARE + traceMsg = "HDI:DISP:HARDWARE" "height:" + std::to_string(data.buffer->height) + " width:" + std::to_string(data.buffer->width) + " data.buffer->fd:" + std::to_string(data.buffer->fd) + @@ -851,7 +851,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetLayerBuffer", traceMsg); - HDF_LOGE("%{public}s: %{public}s", __func__, traceMsg); + HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From 8b500ce2f0467ef5264c2f09c41c22cf720ce696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 16 Oct 2024 15:52:30 +0800 Subject: [PATCH 157/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- 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 8c30eda6..033dca0c 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -400,7 +400,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); - HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg); + HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg.c_str()); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); @@ -851,7 +851,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetLayerBuffer", traceMsg); - HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg); + HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg.c_str()); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From d79a20ba1219f98bd6ee5eb4a850db762a42e83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 16 Oct 2024 16:13:44 +0800 Subject: [PATCH 158/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- 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 033dca0c..409be414 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -400,7 +400,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); - HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg.c_str()); + HDF_LOGI("SetDisplayClientBuffer: %{public}s", traceMsg.c_str()); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); @@ -851,7 +851,7 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); HdfTrace traceVdi("SetLayerBuffer", traceMsg); - HDF_LOGI("%{public}s: %{public}s", __func__, traceMsg.c_str()); + HDF_LOGI("SetLayerBuffer: %{public}s", traceMsg.c_str()); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From fcfddded12519d51316a803ab5cb1d96bca40cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 16 Oct 2024 17:14:11 +0800 Subject: [PATCH 159/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../v1_0/display_command/display_cmd_responser.h | 9 +++++++-- 1 file changed, 7 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 409be414..5deab17a 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -55,6 +55,7 @@ using HdifdSet = std::vector>; static constexpr uint32_t TIME_BUFFER_MAX_LEN = 15; static constexpr uint32_t BUFFER_QUEUE_MAX_SIZE = 6; static constexpr unsigned int REDUCE_COUNT = 50; +static constexpr unsigned int ERROR_FENCE_COUNT = 500; static sptr g_bufferServiceImpl = nullptr; static constexpr uint32_t COMMIT_PRINT_INTERVAL = 1200; @@ -399,8 +400,10 @@ EXIT: " seqNo:" + std::to_string(data.seqNo); } traceMsg += " fd:" + std::to_string(fd); + if (data.fence > ERROR_FENCE_COUNT) { + HDF_LOGI("SetDisplayClientBuffer: %{public}s", traceMsg.c_str()); + } HdfTrace traceVdi("SetDisplayClientBuffer", traceMsg); - HDF_LOGI("SetDisplayClientBuffer: %{public}s", traceMsg.c_str()); needMoveFd = true; int rc = impl_->SetDisplayClientBuffer(data.devId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); @@ -850,8 +853,10 @@ EXIT: " seqNo:" + std::to_string(data.seqNo); } traceMsg += " fd:" + std::to_string(fd); + if (data.fence > ERROR_FENCE_COUNT) { + HDF_LOGI("SetLayerBuffer: %{public}s", traceMsg.c_str()); + } HdfTrace traceVdi("SetLayerBuffer", traceMsg); - HDF_LOGI("SetLayerBuffer: %{public}s", traceMsg.c_str()); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); DISPLAY_CHK_RETURN(rc != HDF_SUCCESS, HDF_FAILURE, HDF_LOGE(" fail")); -- Gitee From 3feee222d195b93dab4ae7b799621fc8e8484d41 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Thu, 17 Oct 2024 16:20:06 +0800 Subject: [PATCH 160/347] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8D=B0?= =?UTF-8?q?=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 --- 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 00963cc0..18bafb0d 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -932,7 +932,7 @@ int CameraMetadata::MetadataExpandItemMem(common_metadata_header_t *dst, camera_ } if (item->data.offset > UINT32_MAX - (uint32_t)oldItemSize || item->data.offset + (uint32_t)oldItemSize > dst->data_count) { - METADATA_ERR_LOG("MetadataExpandItemMem data.offset:%{public}u, oldItemSize:%{pulic}uz, " + METADATA_ERR_LOG("MetadataExpandItemMem data.offset:%{public}u, oldItemSize:%{pulic}zu, " "dst->data_count:%{public}u", item->data.offset, oldItemSize, dst->data_count); return CAM_META_FAILURE; } -- Gitee From 5d743570ec5cec4ddcd99feb3f81dfd26dbbe850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Thu, 17 Oct 2024 11:36:00 +0000 Subject: [PATCH 161/347] update codec/image/v2_0/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- codec/image/v2_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/image/v2_0/BUILD.gn b/codec/image/v2_0/BUILD.gn index 56234a1b..a731683b 100644 --- a/codec/image/v2_0/BUILD.gn +++ b/codec/image/v2_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("libimage_proxy_2.0") { deps = [] -- Gitee From c80922e5c0f6565232d05074ce0e5ffe33118e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Thu, 17 Oct 2024 11:36:20 +0000 Subject: [PATCH 162/347] update codec/v3_0/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- codec/v3_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/v3_0/BUILD.gn b/codec/v3_0/BUILD.gn index ab0494da..7be386e9 100644 --- a/codec/v3_0/BUILD.gn +++ b/codec/v3_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("libcodec_proxy_3.0") { deps = [] -- Gitee From b9367da6065ccea12b8855a64a221048408515dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Fri, 18 Oct 2024 18:12:21 +0800 Subject: [PATCH 163/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index b6201f87..e66531d6 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -82,7 +82,7 @@ public: COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); value = 0; int32_t ret = ToDispErrCode(hdi_v1_2_->GetDisplayProperty(devId, id, value)); - if (ret == DISPLAY_SUCCESS) { + if (ret == DISPLAY_SUCCESS && id == V1_2::DisplayPropertyId::DISPLAY_PROPERTY_ID_SKIP_VALIDATE) { isSupportSkipValidate_ = value; } -- Gitee From aa62ec79272ede79e87813ae1530911d7020f979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sat, 19 Oct 2024 20:08:13 +0800 Subject: [PATCH 164/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index e66531d6..8c14a70f 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -82,7 +82,7 @@ public: COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); value = 0; int32_t ret = ToDispErrCode(hdi_v1_2_->GetDisplayProperty(devId, id, value)); - if (ret == DISPLAY_SUCCESS && id == V1_2::DisplayPropertyId::DISPLAY_PROPERTY_ID_SKIP_VALIDATE) { + if (ret == DISPLAY_SUCCESS && id == V1_2::DisplayPropertyID::DISPLAY_PROPERTY_ID_SKIP_VALIDATE) { isSupportSkipValidate_ = value; } -- Gitee From 2f506421a899e78aef0e17bc207adbf3ca21132e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 21 Oct 2024 02:55:53 +0000 Subject: [PATCH 165/347] =?UTF-8?q?=E6=96=B0=E5=A2=9ENova=E5=89=8D?= =?UTF-8?q?=E7=BD=AE=E7=BE=8E=E8=82=A4=E5=92=8C=E4=B8=8D=E6=96=AD=E6=B5=81?= =?UTF-8?q?tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- .../include/camera_device_ability_items.h | 61 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 12 ++++ camera/metadata/src/camera_metadata_info.cpp | 6 ++ 3 files changed, 79 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 4ee4105d..df2cb379 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1967,6 +1967,48 @@ typedef enum camera_device_metadata_tag { * (i.e. byte ...) */ OHOS_CONTROL_CAPTURE_MACRO_DEPTH_FUSION, + /** + * ohos.ability.cameraPortraitThemeSupported [static, byte, public] + * + * camera device property, report current camera portrait theme supported + * (i.e. byte ...) + */ + OHOS_ABILITY_CAMERA_PORTRAIT_THEME_SUPPORTED, + /** + * ohos.ability.cameraPortraitThemeTypes [static, byte[], public] + * + * camera device property, report current camera supported portrait theme types + * (i.e. byte[] ...) + */ + OHOS_ABILITY_CAMERA_PORTRAIT_THEME_TYPES, + /** + * ohos.control.cameraPortraitThemeType [static, byte, public] + * + * camera device property, set current camera portrait theme type + * (i.e. byte ...) + */ + OHOS_CONTROL_CAMERA_PORTRAIT_THEME_TYPE, + /** + * ohos.ability.cameraVideoRotationSupported [static, byte, public] + * + * camera device property, report current camera video rotation supported + * (i.e. byte ...) + */ + OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED, + /** + * ohos.ability.cameraVideoRotation [static, int32[], public] + * + * camera device property, report current camera supported video rotation + * (i.e. int32[] ...) + */ + OHOS_ABILITY_CAMERA_VIDEO_ROTATION, + /** + * ohos.control.cameraVideoRotation [static, int32, public] + * + * camera device property, set current camera video rotation + * (i.e. int32 ...) + */ + OHOS_CONTROL_CAMERA_VIDEO_ROTATION, /** * ohos.camera.effectEnd * @@ -2526,4 +2568,23 @@ enum StatisticsDetectEmotion { OHOS_EMOTION_SURPRISE = 3, }; +// OHOS_ABILITY_CAMERA_PORTRAIT_THEME_SUPPORTED +enum camera_portrait_theme_supportede_type { + OHOS_CAMERA_PORTRAIT_THEME_NOT_SUPPORTED = 0, + OHOS_CAMERA_PORTRAIT_THEME_SUPPORTED, +} + +// OHOS_ABILITY_CAMERA_PORTRAIT_THEME_TYPES +enum cameera_portrait_theme_types { + OHOS_CAMERA_PORTRAIT_THEME_TYPE_NATURAL = 0, + OHOS_CAMERA_PORTRAIT_THEME_TYPE_DELICATE, + OHOS_CAMERA_PORTRAIT_THEME_TYPE_STYLISH, +} + +// OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED +enum camera_video_rotation_supported_type { + OHOS_CAMERA_VIDEO_ROTATION_NOT_SUPPORTED = 0, + OHOS_CAMERA_VIDEO_ROTATION_SUPPORTED, +} + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 2b180ba3..e0b3ed23 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -500,6 +500,18 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"captureMacroDepthFussionZoomRange", META_TYPE_FLOAT, -1}, [OHOS_CONTROL_CAPTURE_MACRO_DEPTH_FUSION - OHOS_CAMERA_EFFECT_START] = {"captureMacroDepthFusion", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CAMERA_PORTRAIT_THEME_SUPPORTED - + OHOS_CAMERA_EFFECT_START] = {"isPortraitThemeTypesSupported", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CAMERA_PORTRAIT_THEME_TYPES - + OHOS_CAMERA_EFFECT_START] = {"supportedPortraitThemeTypes", META_TYPE_BYTE, -1}, + [OHOS_CONTROL_CAMERA_PORTRAIT_THEME_TYPE - + OHOS_CAMERA_EFFECT_START] = {"portraitThemeType", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED - + OHOS_CAMERA_EFFECT_START] = {"isVideoRotationSupported", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CAMERA_VIDEO_ROTATION - + OHOS_CAMERA_EFFECT_START] = {"supportedVideoRotation", META_TYPE_INT32, -1}, + [OHOS_CONTROL_CAMERA_VIDEO_ROTATION - + OHOS_CAMERA_EFFECT_START] = {"videoRotation", META_TYPE_BYTE, 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 18bafb0d..3b560105 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -299,6 +299,12 @@ const std::vector g_metadataTags = { OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_SUPPORTED, OHOS_ABILITY_CAPTURE_MACRO_DEPTH_FUSION_ZOOM_RANGE, OHOS_CONTROL_CAPTURE_MACRO_DEPTH_FUSION, + OHOS_ABILITY_CAMERA_PORTRAIT_THEME_SUPPORTED, + OHOS_ABILITY_CAMERA_PORTRAIT_THEME_TYPES, + OHOS_CONTROL_CAMERA_PORTRAIT_THEME_TYPE, + OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED, + OHOS_ABILITY_CAMERA_VIDEO_ROTATION, + OHOS_CONTROL_CAMERA_VIDEO_ROTATION, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From b8ad7180270eac69ffa70b3fcced648b1e2da113 Mon Sep 17 00:00:00 2001 From: yangkan Date: Mon, 21 Oct 2024 11:06:21 +0800 Subject: [PATCH 166/347] =?UTF-8?q?writePos=E5=8F=82=E6=95=B0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=8D=E8=A7=84=E8=8C=83=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- .../command_pack/command_data_packer.h | 2 +- .../display_command/display_cmd_requester.h | 30 +++++++++---------- .../display_command/display_cmd_requester.h | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/display/composer/command_pack/command_data_packer.h b/display/composer/command_pack/command_data_packer.h index d45eb311..c3c7b36b 100644 --- a/display/composer/command_pack/command_data_packer.h +++ b/display/composer/command_pack/command_data_packer.h @@ -104,7 +104,7 @@ public: return data_; } - void RollBack(int32_t writePos) + void RollBack(size_t writePos) { writePos_ = writePos; } diff --git a/display/composer/v1_0/display_command/display_cmd_requester.h b/display/composer/v1_0/display_command/display_cmd_requester.h index dd073ac5..327b3e53 100755 --- a/display/composer/v1_0/display_command/display_cmd_requester.h +++ b/display/composer/v1_0/display_command/display_cmd_requester.h @@ -128,7 +128,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CLIENT_BUFFER, requestPacker_); @@ -168,7 +168,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CLIENT_DAMAGE, requestPacker_); @@ -242,7 +242,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_ALPHA, requestPacker_); @@ -289,7 +289,7 @@ EXIT: int32_t SetLayerRegion(uint32_t devId, uint32_t layerId, const IRect &rect) { int32_t ret = 0; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_REGION, requestPacker_); @@ -320,7 +320,7 @@ EXIT: int32_t SetLayerCrop(uint32_t devId, uint32_t layerId, const IRect &rect) { int32_t ret = 0; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_CROP, requestPacker_); @@ -352,7 +352,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_ZORDER, requestPacker_); @@ -384,7 +384,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_PREMULTI, requestPacker_); @@ -417,7 +417,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_TRANSFORM_MODE, requestPacker_); @@ -449,7 +449,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_DIRTY_REGION, requestPacker_); @@ -489,7 +489,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_VISIBLE_REGION, requestPacker_); @@ -531,7 +531,7 @@ EXIT: int32_t ret = 0; bool retBool = false; bool result = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_BUFFER, requestPacker_); @@ -584,7 +584,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_COMPOSITION_TYPE, requestPacker_); @@ -616,7 +616,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_BLEND_TYPE, requestPacker_); @@ -648,7 +648,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_MASK_INFO, requestPacker_); @@ -679,7 +679,7 @@ EXIT: int32_t SetLayerColor(uint32_t devId, uint32_t layerId, const LayerColor& layerColor) { int32_t ret = 0; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_COLOR, requestPacker_); diff --git a/display/composer/v1_2/display_command/display_cmd_requester.h b/display/composer/v1_2/display_command/display_cmd_requester.h index a5953cfd..3197e395 100644 --- a/display/composer/v1_2/display_command/display_cmd_requester.h +++ b/display/composer/v1_2/display_command/display_cmd_requester.h @@ -259,7 +259,7 @@ EXIT: { int32_t ret = 0; bool retBool = false; - int32_t writePos = requestPacker_.ValidSize(); + size_t writePos = requestPacker_.ValidSize(); do { ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_CONSTRAINT, requestPacker_); -- Gitee From 772b38aa966c56c51fe9ebf0ba7df98f028b0ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 21 Oct 2024 03:09:47 +0000 Subject: [PATCH 167/347] =?UTF-8?q?=E6=96=B0=E5=A2=9ENova=E5=89=8D?= =?UTF-8?q?=E7=BD=AE=E7=BE=8E=E8=82=A4=E5=92=8C=E4=B8=8D=E6=96=AD=E6=B5=81?= =?UTF-8?q?tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/include/camera_device_ability_items.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index df2cb379..184919f8 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -2569,20 +2569,20 @@ enum StatisticsDetectEmotion { }; // OHOS_ABILITY_CAMERA_PORTRAIT_THEME_SUPPORTED -enum camera_portrait_theme_supportede_type { +enum CameraPortraitThemeSupportedType { OHOS_CAMERA_PORTRAIT_THEME_NOT_SUPPORTED = 0, OHOS_CAMERA_PORTRAIT_THEME_SUPPORTED, } // OHOS_ABILITY_CAMERA_PORTRAIT_THEME_TYPES -enum cameera_portrait_theme_types { +enum CameraPortraitThemeTypes { OHOS_CAMERA_PORTRAIT_THEME_TYPE_NATURAL = 0, OHOS_CAMERA_PORTRAIT_THEME_TYPE_DELICATE, OHOS_CAMERA_PORTRAIT_THEME_TYPE_STYLISH, } // OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED -enum camera_video_rotation_supported_type { +enum CameraVideoRotationSupportedType { OHOS_CAMERA_VIDEO_ROTATION_NOT_SUPPORTED = 0, OHOS_CAMERA_VIDEO_ROTATION_SUPPORTED, } -- Gitee From e88d0553dad694608d0796bc0c961f3e37a8a18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 21 Oct 2024 11:52:50 +0800 Subject: [PATCH 168/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/graphic/common/v1_1/BUILD.gn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/display/graphic/common/v1_1/BUILD.gn b/display/graphic/common/v1_1/BUILD.gn index f429729d..4b4478c8 100644 --- a/display/graphic/common/v1_1/BUILD.gn +++ b/display/graphic/common/v1_1/BUILD.gn @@ -16,7 +16,10 @@ import("//build/config/components/hdi/hdi.gni") hdi("display_commontype") { module_name = "display_commontype" - sequenceable_pub_deps = [ "ohos.hdi.display.graphic.common.v1_0:display_commontype" ] + deps = [ + "//drivers/interface/display/graphic/common/v1_0:libdisplay_commontype_proxy_1.0", + "//drivers/interface/display/graphic/common/v1_0:libdisplay_commontype_stub_1.0", + ] sources = [ "BufferHandleMetaKeyType.idl" ] -- Gitee From e744c49b5e993c7d24ec869eb36a28166691cfd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 21 Oct 2024 05:44:41 +0000 Subject: [PATCH 169/347] =?UTF-8?q?=E6=96=B0=E5=A2=9ENova=E5=89=8D?= =?UTF-8?q?=E7=BD=AE=E7=BE=8E=E8=82=A4=E5=92=8C=E4=B8=8D=E6=96=AD=E6=B5=81?= =?UTF-8?q?tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/include/camera_device_ability_items.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 184919f8..ac503591 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -2572,19 +2572,19 @@ enum StatisticsDetectEmotion { enum CameraPortraitThemeSupportedType { OHOS_CAMERA_PORTRAIT_THEME_NOT_SUPPORTED = 0, OHOS_CAMERA_PORTRAIT_THEME_SUPPORTED, -} +}; // OHOS_ABILITY_CAMERA_PORTRAIT_THEME_TYPES enum CameraPortraitThemeTypes { OHOS_CAMERA_PORTRAIT_THEME_TYPE_NATURAL = 0, OHOS_CAMERA_PORTRAIT_THEME_TYPE_DELICATE, OHOS_CAMERA_PORTRAIT_THEME_TYPE_STYLISH, -} +}; // OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED enum CameraVideoRotationSupportedType { OHOS_CAMERA_VIDEO_ROTATION_NOT_SUPPORTED = 0, OHOS_CAMERA_VIDEO_ROTATION_SUPPORTED, -} +}; #endif -- Gitee From 610ec892aa45038d2834c3b77adf868c7072d61e Mon Sep 17 00:00:00 2001 From: yangkan Date: Mon, 21 Oct 2024 16:12:58 +0800 Subject: [PATCH 170/347] =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=EF=BC=9A=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- 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 5deab17a..7ee4cd77 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -55,7 +55,7 @@ using HdifdSet = std::vector>; static constexpr uint32_t TIME_BUFFER_MAX_LEN = 15; static constexpr uint32_t BUFFER_QUEUE_MAX_SIZE = 6; static constexpr unsigned int REDUCE_COUNT = 50; -static constexpr unsigned int ERROR_FENCE_COUNT = 500; +static constexpr int32_t ERROR_FENCE_COUNT = 500; static sptr g_bufferServiceImpl = nullptr; static constexpr uint32_t COMMIT_PRINT_INTERVAL = 1200; -- Gitee From bc6ee31007b044099c3d65ecfd2c267fa29b6647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Wed, 23 Oct 2024 06:43:37 +0000 Subject: [PATCH 171/347] modify UpdateameraMetadataItemSize name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/include/camera_metadata_info.h | 2 +- camera/metadata/src/camera_metadata_info.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/camera/metadata/include/camera_metadata_info.h b/camera/metadata/include/camera_metadata_info.h index 042d020e..d397577a 100644 --- a/camera/metadata/include/camera_metadata_info.h +++ b/camera/metadata/include/camera_metadata_info.h @@ -49,7 +49,7 @@ private: static uint32_t AlignTo(uint32_t val, uint32_t alignment); static uint32_t MaxAlignment(uint32_t dataAlignment, uint32_t metadataAlignment); static size_t CalculateCameraMetadataMemoryRequired(uint32_t itemCount, uint32_t dataCount); - static int UpdateameraMetadataItemSize(camera_metadata_item_entry_t *item, uint32_t dataCount, + static int UpdateCameraMetadataItemSize(camera_metadata_item_entry_t *item, uint32_t dataCount, common_metadata_header_t *dst, const void *data); static int AddCameraMetadataItemVerify(common_metadata_header_t *dst, uint32_t item, const void *data, size_t dataCount, uint32_t *dataType); diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 3b560105..f889b702 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -968,7 +968,7 @@ int CameraMetadata::copyMetadataMemory(common_metadata_header_t *dst, camera_met uint8_t *dstMetadataData = GetMetadataData(dst); int32_t ret = CAM_META_SUCCESS; if (dstMetadataData == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize GetMetadataData failed"); + METADATA_ERR_LOG("UpdateCameraMetadataItemSize GetMetadataData failed"); return CAM_META_FAILURE; } ret = memcpy_s(dstMetadataData + item->data.offset, dataPayloadSize, data, dataPayloadSize); @@ -979,14 +979,14 @@ int CameraMetadata::copyMetadataMemory(common_metadata_header_t *dst, camera_met return CAM_META_SUCCESS; } -int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *item, uint32_t dataCount, +int CameraMetadata::UpdateCameraMetadataItemSize(camera_metadata_item_entry_t *item, uint32_t dataCount, common_metadata_header_t *dst, const void *data) { if (item == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null"); + METADATA_ERR_LOG("UpdateCameraMetadataItemSize 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); + METADATA_ERR_LOG("UpdateCameraMetadataItemSize invalid datatype:%{public}d", item->data_type); return CAM_META_FAILURE; } int32_t dataSize = CalculateCameraMetadataItemDataSize(item->data_type, dataCount); @@ -994,7 +994,7 @@ int CameraMetadata::UpdateameraMetadataItemSize(camera_metadata_item_entry_t *it int32_t oldItemSize = CalculateCameraMetadataItemDataSize(item->data_type, item->count); int32_t ret = CAM_META_SUCCESS; if (item == nullptr || dst == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize item is null or dst is null"); + METADATA_ERR_LOG("UpdateCameraMetadataItemSize item is null or dst is null"); return CAM_META_FAILURE; } if (dataSize != oldItemSize) { @@ -1050,7 +1050,7 @@ int CameraMetadata::UpdateCameraMetadataItemByIndex(common_metadata_header_t *ds int32_t ret = CAM_META_SUCCESS; camera_metadata_item_entry_t *item = GetMetadataItems(dst) + index; - ret = UpdateameraMetadataItemSize(item, dataCount, dst, data); + ret = UpdateCameraMetadataItemSize(item, dataCount, dst, data); if (ret != CAM_META_SUCCESS) { return ret; } @@ -1097,7 +1097,7 @@ int CameraMetadata::moveMetadataMemery(common_metadata_header_t *dst, camera_met { uint8_t *dstMetadataData = GetMetadataData(dst); if (dstMetadataData == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize GetMetadataData failed"); + METADATA_ERR_LOG("UpdateCameraMetadataItemSize GetMetadataData failed"); return CAM_META_FAILURE; } int32_t ret = CAM_META_SUCCESS; @@ -1231,7 +1231,7 @@ int32_t CameraMetadata::CopyCameraMetadataItems(common_metadata_header_t *newMet uint8_t *newMetadataData = GetMetadataData(newMetadata); uint8_t *oldMetadataData = GetMetadataData(oldMetadata); if (newMetadataData == nullptr || oldMetadataData == nullptr) { - METADATA_ERR_LOG("UpdateameraMetadataItemSize GetMetadataData failed"); + METADATA_ERR_LOG("UpdateCameraMetadataItemSize GetMetadataData failed"); return CAM_META_FAILURE; } ret = memcpy_s(newMetadataData, sizeof(uint8_t[newMetadata->data_capacity]), oldMetadataData, -- Gitee From c62331be4c29663087d1acd910e9f6d5598dcc44 Mon Sep 17 00:00:00 2001 From: xyc Date: Thu, 24 Oct 2024 16:00:24 +0800 Subject: [PATCH 172/347] =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xyc Change-Id: I629e5ad4375b2b7c13f0a40b5d26a31570c2d6fb --- pin_auth/v1_0/BUILD.gn | 2 +- pin_auth/v1_1/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pin_auth/v1_0/BUILD.gn b/pin_auth/v1_0/BUILD.gn index c36d1437..04f0d4e0 100644 --- a/pin_auth/v1_0/BUILD.gn +++ b/pin_auth/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") import("../config.gni") hdi("pin_auth") { diff --git a/pin_auth/v1_1/BUILD.gn b/pin_auth/v1_1/BUILD.gn index 94371fbe..04ad0eff 100644 --- a/pin_auth/v1_1/BUILD.gn +++ b/pin_auth/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") import("../config.gni") hdi("pin_auth") { -- Gitee From 3ef9c94573a2edf0214e647d901bfce6cebb0aa0 Mon Sep 17 00:00:00 2001 From: chaimengtao Date: Wed, 23 Oct 2024 07:08:39 +0000 Subject: [PATCH 173/347] =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chaimengtao --- face_auth/v1_0/BUILD.gn | 2 +- face_auth/v1_1/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/face_auth/v1_0/BUILD.gn b/face_auth/v1_0/BUILD.gn index 576da451..1acd6953 100644 --- a/face_auth/v1_0/BUILD.gn +++ b/face_auth/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") import("../config.gni") hdi("face_auth") { diff --git a/face_auth/v1_1/BUILD.gn b/face_auth/v1_1/BUILD.gn index acdd43e8..cf58c99e 100644 --- a/face_auth/v1_1/BUILD.gn +++ b/face_auth/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") import("../config.gni") hdi("face_auth") { -- Gitee From 5f5c897fcfd4536ef50b1e8ae584e516814cf7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E5=87=AF?= Date: Fri, 25 Oct 2024 09:54:20 +0800 Subject: [PATCH 174/347] =?UTF-8?q?fix:=20import=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E9=9D=9Ebuild=E6=A1=86=E6=9E=B6=E5=A4=96=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84gni=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 居凯 Change-Id: Ic1158710f34d295cad091fd398eb81683b48c183 --- user_auth/v1_0/BUILD.gn | 2 +- user_auth/v1_1/BUILD.gn | 2 +- user_auth/v1_2/BUILD.gn | 2 +- user_auth/v1_3/BUILD.gn | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_auth/v1_0/BUILD.gn b/user_auth/v1_0/BUILD.gn index 3d074099..d069cc08 100644 --- a/user_auth/v1_0/BUILD.gn +++ b/user_auth/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") import("../config.gni") hdi("user_auth") { diff --git a/user_auth/v1_1/BUILD.gn b/user_auth/v1_1/BUILD.gn index bba7ef61..76961d43 100644 --- a/user_auth/v1_1/BUILD.gn +++ b/user_auth/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") import("../config.gni") hdi("user_auth") { diff --git a/user_auth/v1_2/BUILD.gn b/user_auth/v1_2/BUILD.gn index 06eb6782..f5d7ccbc 100644 --- a/user_auth/v1_2/BUILD.gn +++ b/user_auth/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") import("../config.gni") hdi("user_auth") { diff --git a/user_auth/v1_3/BUILD.gn b/user_auth/v1_3/BUILD.gn index 2d2d577a..96112038 100644 --- a/user_auth/v1_3/BUILD.gn +++ b/user_auth/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") import("../config.gni") hdi("user_auth") { -- Gitee From c4550c1a091e3dd4ba30069947a4f3d9126ec974 Mon Sep 17 00:00:00 2001 From: yangkan Date: Fri, 25 Oct 2024 10:36:05 +0800 Subject: [PATCH 175/347] =?UTF-8?q?allocmem=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=A4=84=E5=8A=A0trace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- display/buffer/v1_0/BUILD.gn | 1 + display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h | 3 +++ display/buffer/v1_1/BUILD.gn | 1 + display/buffer/v1_2/BUILD.gn | 1 + 4 files changed, 6 insertions(+) diff --git a/display/buffer/v1_0/BUILD.gn b/display/buffer/v1_0/BUILD.gn index 249dec9c..ff5d1fbe 100644 --- a/display/buffer/v1_0/BUILD.gn +++ b/display/buffer/v1_0/BUILD.gn @@ -51,6 +51,7 @@ ohos_shared_library("libdisplay_buffer_hdi_impl") { "hdf_core:libhdi", "hdf_core:libpub_utils", "hilog:libhilog", + "hitrace:hitrace_meter", "ipc:ipc_single", ] diff --git a/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h index 925dd06f..a7db5c20 100644 --- a/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h @@ -26,11 +26,13 @@ #include "v1_0/iallocator.h" #include "v1_0/imapper.h" #include "v1_0/include/idisplay_buffer.h" +#include "hdf_trace.h" #undef LOG_TAG #define LOG_TAG "DISP_HDI_BUFF" #undef LOG_DOMAIN #define LOG_DOMAIN 0xD002515 +#define DISPLAY_TRACE HdfTrace trace(__func__, "HDI:DISP:IMPL:") #ifndef BUFFER_HDI_IMPL_LOGE #define BUFFER_HDI_IMPL_LOGE(format, ...) \ @@ -123,6 +125,7 @@ public: int32_t AllocMem(const AllocInfo& info, BufferHandle*& handle) const override { + DISPLAY_TRACE; CHECK_NULLPOINTER_RETURN_VALUE(allocator_, HDF_FAILURE); sptr hdiBuffer; int32_t ret = allocator_->AllocMem(info, hdiBuffer); diff --git a/display/buffer/v1_1/BUILD.gn b/display/buffer/v1_1/BUILD.gn index 8dbaae28..ff4b53d7 100644 --- a/display/buffer/v1_1/BUILD.gn +++ b/display/buffer/v1_1/BUILD.gn @@ -52,6 +52,7 @@ ohos_shared_library("libdisplay_buffer_hdi_impl_v1_1") { "hdf_core:libhdi", "hdf_core:libpub_utils", "hilog:libhilog", + "hitrace:hitrace_meter", "ipc:ipc_single", ] diff --git a/display/buffer/v1_2/BUILD.gn b/display/buffer/v1_2/BUILD.gn index f3975441..0e653085 100644 --- a/display/buffer/v1_2/BUILD.gn +++ b/display/buffer/v1_2/BUILD.gn @@ -58,6 +58,7 @@ ohos_shared_library("libdisplay_buffer_hdi_impl_v1_2") { "hdf_core:libhdi", "hdf_core:libpub_utils", "hilog:libhilog", + "hitrace:hitrace_meter", "ipc:ipc_single", ] -- Gitee From 77635f99ed8fba19423f933fe98c8da3dccfb152 Mon Sep 17 00:00:00 2001 From: pxd2022 Date: Sat, 26 Oct 2024 02:45:28 +0000 Subject: [PATCH 176/347] jieou Signed-off-by: pxd2022 --- .../include/display_vdi_adapter_interface.h | 157 ++++++++++++++++++ .../display_command/display_cmd_responser.h | 3 +- .../display_command/display_cmd_responser.h | 2 +- .../display_command/display_cmd_responser.h | 31 +--- 4 files changed, 166 insertions(+), 27 deletions(-) create mode 100644 display/composer/common/include/display_vdi_adapter_interface.h diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h new file mode 100644 index 00000000..d4dd7878 --- /dev/null +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -0,0 +1,157 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_VDI_ADAPTER_INTERFACE_H +#define OHOS_HDI_VDI_ADAPTER_INTERFACE_H + +#include +#include +#include "base/buffer_handle.h" +#include "v1_0/include/idisplay_composer_interface.h" +#include "v1_0/display_composer_type.h" +#include "v1_2/display_composer_type.h" +#include "v1_1/imode_callback.h" +#include "v1_1/iseamless_change_callback.h" + +namespace OHOS { +namespace HDI { +namespace Display { +namespace Composer { +using namespace OHOS::HDI::Display::Composer::V1_0; +using namespace OHOS::HDI::Display::Composer::V1_1; +using namespace OHOS::HDI::Display::Composer::V1_2; +struct DisplayComposerVdiAdapter { + int32_t (*LoadVdiImpl)(); + int32_t (*DestroyVdiImpl)(); + int32_t (*RegHotPlugCallback)(HotPlugCallback cb, void* data); + int32_t (*GetDisplayCapability)(uint32_t devId, DisplayCapability& info); + int32_t (*GetDisplaySupportedModes)(uint32_t devId, std::vector& modes); + int32_t (*GetDisplayMode)(uint32_t devId, uint32_t& modeId); + int32_t (*SetDisplayMode)(uint32_t devId, uint32_t modeId); + int32_t (*GetDisplayPowerStatus)(uint32_t devId, V1_0::DispPowerStatus& status); + int32_t (*SetDisplayPowerStatus)(uint32_t devId, V1_0::DispPowerStatus status); + int32_t (*GetDisplayBacklight)(uint32_t devId, uint32_t& level); + int32_t (*SetDisplayBacklight)(uint32_t devId, uint32_t level); + int32_t (*GetDisplayProperty)(uint32_t devId, uint32_t id, uint64_t& value); + int32_t (*GetDisplayCompChange)(uint32_t devId, std::vector& layers, std::vector& types); + int32_t (*SetDisplayClientCrop)(uint32_t devId, const IRect& rect); + int32_t (*SetDisplayClientBuffer)(uint32_t devId, const BufferHandle& buffer, int32_t fence); + int32_t (*SetDisplayClientDamage)(uint32_t devId, std::vector& rects); + int32_t (*SetDisplayVsyncEnabled)(uint32_t devId, bool enabled); + int32_t (*RegDisplayVBlankCallback)(uint32_t devId, VBlankCallback cb, void* data); + int32_t (*GetDisplayReleaseFence)(uint32_t devId, std::vector& layers, std::vector& fences); + int32_t (*CreateVirtualDisplay)(uint32_t width, uint32_t height, int32_t& format, uint32_t& devId); + int32_t (*DestroyVirtualDisplay)(uint32_t devId); + int32_t (*SetVirtualDisplayBuffer)(uint32_t devId, const BufferHandle& buffer, const int32_t fence); + int32_t (*SetDisplayProperty)(uint32_t devId, uint32_t id, uint64_t value); + int32_t (*Commit)(uint32_t devId, int32_t& fence); + int32_t (*CreateLayer)(uint32_t devId, const LayerInfo& layerInfo, uint32_t& layerId); + int32_t (*DestroyLayer)(uint32_t devId, uint32_t layerId); + int32_t (*PrepareDisplayLayers)(uint32_t devId, bool& needFlushFb); + int32_t (*SetLayerAlpha)(uint32_t devId, uint32_t layerId, const LayerAlpha& alpha); + int32_t (*SetLayerRegion)(uint32_t devId, uint32_t layerId, const IRect& rect); + int32_t (*SetLayerCrop)(uint32_t devId, uint32_t layerId, const IRect& rect); + int32_t (*SetLayerZorder)(uint32_t devId, uint32_t layerId, uint32_t zorder); + int32_t (*SetLayerPreMulti)(uint32_t devId, uint32_t layerId, bool preMul); + int32_t (*SetLayerTransformMode)(uint32_t devId, uint32_t layerId, TransformType type); + int32_t (*SetLayerDirtyRegion)(uint32_t devId, uint32_t layerId, const std::vector& rects); + int32_t (*SetLayerVisibleRegion)(uint32_t devId, uint32_t layerId, std::vector& rects); + int32_t (*SetLayerBuffer)(uint32_t devId, uint32_t layerId, const BufferHandle& buffer, int32_t fence); + int32_t (*SetLayerCompositionType)(uint32_t devId, uint32_t layerId, V1_0::CompositionType type); + int32_t (*SetLayerBlendType)(uint32_t devId, uint32_t layerId, BlendType type); + int32_t (*SetLayerMaskInfo)(uint32_t devId, uint32_t layerId, const MaskInfo maskInfo); + int32_t (*SetLayerColor)(uint32_t devId, uint32_t layerId, const LayerColor& layerColor); + int32_t (*RegSeamlessChangeCallback)(SeamlessChangeCallback cb, void* data); + int32_t (*GetDisplaySupportedModesExt)(uint32_t devId, std::vector& modes); + int32_t (*SetDisplayModeAsync)(uint32_t devId, uint32_t modeId, ModeCallback cb, void *data); + int32_t (*GetDisplayVBlankPeriod)(uint32_t devId, uint64_t& period); + int32_t (*SetLayerPerFrameParameter)( + uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value); + int32_t (*GetSupportedLayerPerFrameParameterKey)(std::vector& keys); + int32_t (*SetDisplayOverlayResolution)(uint32_t devId, uint32_t width, uint32_t height); + int32_t (*RegRefreshCallback)(RefreshCallback cb, void* data); + int32_t (*GetDisplaySupportedColorGamuts)(uint32_t devId, std::vector& gamuts); + int32_t (*GetHDRCapabilityInfos)(uint32_t devId, HDRCapability& info); + int32_t (*RegDisplayVBlankIdleCallback)(VBlankIdleCallback cb, void* data); + int32_t (*SetDisplayConstraint)(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type); + int32_t (*SetHardwareCursorPosition)(uint32_t devId, int32_t x, int32_t y); + int32_t (*EnableHardwareCursorStats)(uint32_t devId, bool enable); + int32_t (*GetHardwareCursorStats)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); +}; + +using LoadVdiImplFunc = int32_t (*)(); +using DestroyVdiImplFunc = int32_t (*)(); +using RegHotPlugCallbackFunc = int32_t (*)(HotPlugCallback cb, void* data); +using GetDisplayCapabilityFunc = int32_t (*)(uint32_t devId, DisplayCapability& info); +using GetDisplaySupportedModesFunc = int32_t (*)(uint32_t devId, std::vector& modes); +using GetDisplayModeFunc = int32_t (*)(uint32_t devId, uint32_t& modeId); +using SetDisplayModeFunc = int32_t (*)(uint32_t devId, uint32_t modeId); +using GetDisplayPowerStatusFunc = int32_t (*)(uint32_t devId, V1_0::DispPowerStatus& status); +using SetDisplayPowerStatusFunc = int32_t (*)(uint32_t devId, V1_0::DispPowerStatus status); +using GetDisplayBacklightFunc = int32_t (*)(uint32_t devId, uint32_t& level); +using SetDisplayBacklightFunc = int32_t (*)(uint32_t devId, uint32_t level); +using GetDisplayPropertyFunc = int32_t (*)(uint32_t devId, uint32_t id, uint64_t& value); +using GetDisplayCompChangeFunc = int32_t (*)( + uint32_t devId, std::vector& layers, std::vector& types); +using SetDisplayClientCropFunc = int32_t (*)(uint32_t devId, const IRect& rect); +using SetDisplayClientBufferFunc = int32_t (*)(uint32_t devId, const BufferHandle& buffer, int32_t fence); +using SetDisplayClientDamageFunc = int32_t (*)(uint32_t devId, std::vector& rects); +using SetDisplayVsyncEnabledFunc = int32_t (*)(uint32_t devId, bool enabled); +using RegDisplayVBlankCallbackFunc = int32_t (*)(uint32_t devId, VBlankCallback cb, void* data); +using GetDisplayReleaseFenceFunc = int32_t (*)( + uint32_t devId, std::vector& layers, std::vector& fences); +using CreateVirtualDisplayFunc = int32_t (*)(uint32_t width, uint32_t height, int32_t& format, uint32_t& devId); +using DestroyVirtualDisplayFunc = int32_t (*)(uint32_t devId); +using SetVirtualDisplayBufferFunc = int32_t (*)(uint32_t devId, const BufferHandle& buffer, const int32_t fence); +using SetDisplayPropertyFunc = int32_t (*)(uint32_t devId, uint32_t id, uint64_t value); +using CommitFunc = int32_t (*)(uint32_t devId, int32_t& fence); +using CreateLayerFunc = int32_t (*)(uint32_t devId, const LayerInfo& layerInfo, uint32_t& layerId); +using DestroyLayerFunc = int32_t (*)(uint32_t devId, uint32_t layerId); +using PrepareDisplayLayersFunc = int32_t (*)(uint32_t devId, bool& needFlushFb); +using SetLayerAlphaFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const LayerAlpha& alpha); +using SetLayerRegionFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const IRect& rect); +using SetLayerCropFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const IRect& rect); +using SetLayerZorderFunc = int32_t (*)(uint32_t devId, uint32_t layerId, uint32_t zorder); +using SetLayerPreMultiFunc = int32_t (*)(uint32_t devId, uint32_t layerId, bool preMul); +using SetLayerTransformModeFunc = int32_t (*)(uint32_t devId, uint32_t layerId, TransformType type); +using SetLayerDirtyRegionFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const std::vector& rects); +using SetLayerVisibleRegionFunc = int32_t (*)(uint32_t devId, uint32_t layerId, std::vector& rects); +using SetLayerBufferFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const BufferHandle& buffer, int32_t fence); +using SetLayerCompositionTypeFunc = int32_t (*)(uint32_t devId, uint32_t layerId, V1_0::CompositionType type); +using SetLayerBlendTypeFunc = int32_t (*)(uint32_t devId, uint32_t layerId, BlendType type); +using SetLayerMaskInfoFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const MaskInfo maskInfo); +using SetLayerColorFunc = int32_t (*)(uint32_t devId, uint32_t layerId, const LayerColor& layerColor); +using RegSeamlessChangeCallbackFunc = int32_t (*)(SeamlessChangeCallback cb, void* data); +using GetDisplaySupportedModesExtFunc = int32_t (*)(uint32_t devId, std::vector& modes); +using SetDisplayModeAsyncFunc = int32_t (*)(uint32_t devId, uint32_t modeId, ModeCallback cb, void *data); +using GetDisplayVBlankPeriodFunc = int32_t (*)(uint32_t devId, uint64_t& period); +using SetLayerPerFrameParameterFunc = int32_t (*)( + uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value); +using GetSupportedLayerPerFrameParameterKeyFunc = int32_t (*)(std::vector& keys); +using SetDisplayOverlayResolutionFunc = int32_t (*)(uint32_t devId, uint32_t width, uint32_t height); +using RegRefreshCallbackFunc = int32_t (*)(RefreshCallback cb, void* data); +using GetDisplaySupportedColorGamutsFunc = int32_t (*)(uint32_t devId, std::vector& gamuts); +using GetHDRCapabilityInfosFunc = int32_t (*)(uint32_t devId, HDRCapability& info); +using RegDisplayVBlankIdleCallbackFunc = int32_t (*)(VBlankIdleCallback cb, void* data); +using SetDisplayConstraintFunc = int32_t (*)(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type); +using SetHardwareCursorPositionFunc = int32_t (*)(uint32_t devId, int32_t x, int32_t y); +using EnableHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, bool enable); +using GetHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); + +} // namespace Composer +} // namespace Display +} // namespace HDI +} // namespace OHOS +#endif // OHOS_HDI_VDI_ADAPTER_INTERFACE_H 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 7ee4cd77..cafc8904 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -39,6 +39,7 @@ #include "parameter.h" #include "v1_0/display_composer_type.h" #include "v1_0/mapper_stub.h" +#include "common/include/display_vdi_adapter_interface.h" #define DISPLAY_TRACE HdfTrace trace(__func__, "HDI:DISP:") @@ -1147,7 +1148,7 @@ protected: std::mutex requestMutex_; std::mutex replyMutex_; }; -using HdiDisplayCmdResponser = DisplayCmdResponser, IDisplayComposerVdi>; +using HdiDisplayCmdResponser = DisplayCmdResponser, DisplayComposerVdiAdapter>; } // namespace V1_0 } // namespace Composer } // namespace Display diff --git a/display/composer/v1_1/display_command/display_cmd_responser.h b/display/composer/v1_1/display_command/display_cmd_responser.h index 63bc8c5b..e8dc17d6 100644 --- a/display/composer/v1_1/display_command/display_cmd_responser.h +++ b/display/composer/v1_1/display_command/display_cmd_responser.h @@ -47,7 +47,7 @@ public: private: using BaseType1_0 = V1_0::DisplayCmdResponser; }; -using HdiDisplayCmdResponser = DisplayCmdResponser, IDisplayComposerVdi>; +using HdiDisplayCmdResponser = DisplayCmdResponser, DisplayComposerVdiAdapter>; } // namespace V1_1 } // namespace Composer } // namespace Display 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 2ee974fd..52f3761e 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -40,7 +40,7 @@ typedef struct CommitInfo { std::vector fences; } CommitInfo; -template +template class DisplayCmdResponser : public V1_1::DisplayCmdResponser { public: static std::unique_ptr Create(VdiImpl* impl, std::shared_ptr cacheMgr) @@ -52,23 +52,8 @@ public: return std::make_unique(impl, cacheMgr); } - static std::unique_ptr CreateV1_1( - VdiImpl1_1* impl, std::shared_ptr cacheMgr) - { - DISPLAY_CHK_RETURN(impl == nullptr, nullptr, - HDF_LOGE("%{public}s: error, VdiImpl is nullptr", __func__)); - DISPLAY_CHK_RETURN(cacheMgr == nullptr, nullptr, - HDF_LOGE("%{public}s: error, VdiImpl is nullptr", __func__)); - return std::make_unique(cacheMgr, impl); - } - DisplayCmdResponser(VdiImpl* impl, std::shared_ptr cacheMgr) : BaseType1_1(impl, cacheMgr) {} - DisplayCmdResponser(std::shared_ptr cacheMgr, VdiImpl1_1* impl) - : BaseType1_1(impl, cacheMgr), - vdiImpl1_1_(impl) - {} - virtual ~DisplayCmdResponser() {} int32_t ProcessRequestCmd(CommandDataUnpacker& unpacker, int32_t cmd, @@ -303,9 +288,10 @@ REPLY: ret = unpacker.ReadUint32(type) ? HDF_SUCCESS : HDF_FAILURE; DISPLAY_CHECK(ret != HDF_SUCCESS, goto EXIT); - if (vdiImpl1_1_ != nullptr) { - ret = vdiImpl1_1_->SetDisplayConstraint(devId, frameID, ns, type); - } + + DISPLAY_CHECK(impl_ == nullptr || impl_->SetDisplayConstraint == nullptr, goto EXIT); + ret = impl_->SetDisplayConstraint(devId, frameID, ns, type); + DISPLAY_CHECK(ret != HDF_SUCCESS && ret != DISPLAY_NOT_SUPPORT && ret != HDF_ERR_NOT_SUPPORT, goto EXIT); EXIT: if (ret != HDF_SUCCESS) { @@ -344,16 +330,11 @@ private: using BaseType1_1::OnSetLayerColor; using BaseType1_1::CmdRequestDataRead; using BaseType1_1::CmdRequestDataWrite; - VdiImpl1_1* vdiImpl1_1_ = nullptr; using BaseType1_1::requestMutex_; using BaseType1_1::replyMutex_; }; -using HdiDisplayCmdResponser = - DisplayCmdResponser, IDisplayComposerVdi, IDisplayComposerVdiV1_1>; - -using HdiDisplayCmdResponser_1_1 = - DisplayCmdResponser, IDisplayComposerVdi, IDisplayComposerVdiV1_1>; +using HdiDisplayCmdResponser = DisplayCmdResponser, DisplayComposerVdiAdapter>; } // namespace V1_2 } // namespace Composer -- Gitee From 9bab597c0b86d4c72a19d1e37e29f40d105e5991 Mon Sep 17 00:00:00 2001 From: liangqi Date: Sat, 26 Oct 2024 17:20:56 +0800 Subject: [PATCH 177/347] add accessory hdi Signed-off-by: liangqi --- usb/v1_1/IUsbInterface.idl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/usb/v1_1/IUsbInterface.idl b/usb/v1_1/IUsbInterface.idl index 9d77f712..268f865d 100644 --- a/usb/v1_1/IUsbInterface.idl +++ b/usb/v1_1/IUsbInterface.idl @@ -144,4 +144,37 @@ interface IUsbInterface extends ohos.hdi.usb.v1_0.IUsbInterface{ * @version 1.0 */ ResetDevice([in] struct UsbDev dev); + + /* * + * @brief Get Accessory Info. + * + * @param accessoryInfo Indicates the accessory information. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.0 + * @version 1.0 + */ + GetAccessoryInfo([out] String[] accessoryInfo); + + /* * + * @brief Open the Accessory descriptor. + * + * @param fd accessory file descriptor. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.0 + * @version 1.0 + */ + OpenAccessory([out] FileDescriptor fd); + + /* * + * @brief Close the Accessory descriptor. + * + * @param fd accessory file descriptor. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.0 + * @version 1.0 + */ + CloseAccessory([in] FileDescriptor fd); } \ No newline at end of file -- Gitee From dcb939d5e65b327d86a99ef9eb63eade03d4b4a9 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 28 Oct 2024 14:59:34 +0800 Subject: [PATCH 178/347] =?UTF-8?q?CLD=E5=9C=86=E8=A7=92=E7=A1=AC=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- .../cache_manager/device_cache_manager.h | 4 ++++ display/composer/cache_manager/layer_cache.cpp | 17 +++++++++++------ display/composer/cache_manager/layer_cache.h | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/display/composer/cache_manager/device_cache_manager.h b/display/composer/cache_manager/device_cache_manager.h index 15452cb9..0ec57bc2 100644 --- a/display/composer/cache_manager/device_cache_manager.h +++ b/display/composer/cache_manager/device_cache_manager.h @@ -38,6 +38,10 @@ public: int32_t CreateVirtualDisplayCache(uint32_t deviceId); int32_t DestroyVirtualDisplayCache(uint32_t deviceId); int32_t DestroyCaches(); + void SetNeedMap(bool needMap) + { + LayerCache::needMap_ = needMap; + } DeviceCache* DeviceCacheInstance(uint32_t deviceId) const; LayerCache* LayerCacheInstance(uint32_t deviceId, uint32_t layerId) const; void Dump() const; diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 3d7f1ba7..3afb8b18 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -25,6 +25,7 @@ namespace HDI { namespace Display { namespace Composer { +bool LayerCache::needMap_ = false; LayerCache* LayerCache::Create(uint32_t id) { LayerCache* layer = new LayerCache(id); @@ -165,9 +166,11 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - int32_t ret = Unmap(buffer); - if (ret != HDF_SUCCESS) { - HDF_LOGE("Unmap failed!"); + if (needMap_) { + int32_t ret = Unmap(buffer); + if (ret != HDF_SUCCESS) { + HDF_LOGE("Unmap failed!"); + } } return mapperService->FreeMem(buffer); } @@ -183,9 +186,11 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) HDF_LOGE("Register Buffer failed!"); return ret; } - ret = Mmap(buffer); - if (ret != HDF_SUCCESS) { - HDF_LOGE("Mmap failed!"); + if (needMap_) { + ret = Mmap(buffer); + if (ret != HDF_SUCCESS) { + HDF_LOGE("Mmap failed!"); + } } return HDF_SUCCESS; } diff --git a/display/composer/cache_manager/layer_cache.h b/display/composer/cache_manager/layer_cache.h index a81c01a7..db5ad0dd 100644 --- a/display/composer/cache_manager/layer_cache.h +++ b/display/composer/cache_manager/layer_cache.h @@ -41,6 +41,7 @@ public: void Dump() const; static void NativeBufferInit(sptr& buffer); static void NativeBufferCleanUp(sptr& buffer); + static bool needMap_; private: explicit LayerCache(uint32_t id); int32_t Init(); -- Gitee From 6a66d8490480b88b00f3a244bc1c7ec86519c030 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 28 Oct 2024 07:20:12 +0000 Subject: [PATCH 179/347] update display/composer/cache_manager/device_cache_manager.h. Signed-off-by: l60050612 --- display/composer/cache_manager/device_cache_manager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/display/composer/cache_manager/device_cache_manager.h b/display/composer/cache_manager/device_cache_manager.h index 0ec57bc2..c7a105ff 100644 --- a/display/composer/cache_manager/device_cache_manager.h +++ b/display/composer/cache_manager/device_cache_manager.h @@ -38,10 +38,10 @@ public: int32_t CreateVirtualDisplayCache(uint32_t deviceId); int32_t DestroyVirtualDisplayCache(uint32_t deviceId); int32_t DestroyCaches(); - void SetNeedMap(bool needMap) - { - LayerCache::needMap_ = needMap; - } + void SetNeedMap(bool needMap) + { + LayerCache::needMap_ = needMap; + } DeviceCache* DeviceCacheInstance(uint32_t deviceId) const; LayerCache* LayerCacheInstance(uint32_t deviceId, uint32_t layerId) const; void Dump() const; -- Gitee From f9b5e5eee861bce30d30160a528857f31a5c2268 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 28 Oct 2024 07:21:54 +0000 Subject: [PATCH 180/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 3afb8b18..452601d9 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -166,7 +166,7 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - if (needMap_) { + if (needMap_) { int32_t ret = Unmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Unmap failed!"); @@ -186,7 +186,7 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) HDF_LOGE("Register Buffer failed!"); return ret; } - if (needMap_) { + if (needMap_) { ret = Mmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); -- Gitee From 5f64f5d22812db75a33b40f6f2f9610c8f13eb77 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 28 Oct 2024 07:22:59 +0000 Subject: [PATCH 181/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 452601d9..a5e78fcc 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -187,10 +187,10 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) return ret; } if (needMap_) { - ret = Mmap(buffer); + ret = Mmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); - } + } } return HDF_SUCCESS; } -- Gitee From 71fb0e5a8bc864f773d44329603e1ffb1e48a5b6 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 28 Oct 2024 07:24:24 +0000 Subject: [PATCH 182/347] update display/composer/cache_manager/layer_cache.h. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.h b/display/composer/cache_manager/layer_cache.h index db5ad0dd..aa171ce7 100644 --- a/display/composer/cache_manager/layer_cache.h +++ b/display/composer/cache_manager/layer_cache.h @@ -41,7 +41,7 @@ public: void Dump() const; static void NativeBufferInit(sptr& buffer); static void NativeBufferCleanUp(sptr& buffer); - static bool needMap_; + static bool needMap_; private: explicit LayerCache(uint32_t id); int32_t Init(); -- Gitee From e6f32749fd98a605b6c834cbf55f1e973ea32b0a Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 28 Oct 2024 07:45:38 +0000 Subject: [PATCH 183/347] update display/composer/cache_manager/device_cache_manager.h. Signed-off-by: l60050612 --- display/composer/cache_manager/device_cache_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/device_cache_manager.h b/display/composer/cache_manager/device_cache_manager.h index c7a105ff..faa70240 100644 --- a/display/composer/cache_manager/device_cache_manager.h +++ b/display/composer/cache_manager/device_cache_manager.h @@ -40,7 +40,7 @@ public: int32_t DestroyCaches(); void SetNeedMap(bool needMap) { - LayerCache::needMap_ = needMap; + LayerCache::needMap_ = needMap; } DeviceCache* DeviceCacheInstance(uint32_t deviceId) const; LayerCache* LayerCacheInstance(uint32_t deviceId, uint32_t layerId) const; -- Gitee From 730eb16be8d8aa03e27c81110ac850fe90e9353d Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Mon, 28 Oct 2024 11:07:06 +0800 Subject: [PATCH 184/347] =?UTF-8?q?=E5=88=A0=E9=99=A4-s=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=80=89=E9=A1=B9=EF=BC=8C=E6=B7=BB=E5=8A=A0vec=E7=9A=84size?= =?UTF-8?q?=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/BUILD.gn | 2 +- camera/metadata/include/camera_metadata_info.h | 1 + camera/metadata/src/metadata_utils.cpp | 4 ++++ camera/sequenceable/buffer_handle/BUILD.gn | 2 +- camera/sequenceable/buffer_producer/BUILD.gn | 2 +- camera/sequenceable/map_data/BUILD.gn | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/camera/metadata/BUILD.gn b/camera/metadata/BUILD.gn index 312ab70f..10fa979e 100644 --- a/camera/metadata/BUILD.gn +++ b/camera/metadata/BUILD.gn @@ -28,7 +28,7 @@ ohos_shared_library("metadata") { ] cflags_cc = cflags cflags_cc += [ "-fstack-protector-strong" ] - ldflags = [ "-s" ] + if (drivers_interface_camera_feature_coverage) { cflags += [ "--coverage" ] ldflags += [ "--coverage" ] diff --git a/camera/metadata/include/camera_metadata_info.h b/camera/metadata/include/camera_metadata_info.h index 042d020e..82644d47 100644 --- a/camera/metadata/include/camera_metadata_info.h +++ b/camera/metadata/include/camera_metadata_info.h @@ -25,6 +25,7 @@ static constexpr uint32_t MAX_SUPPORTED_TAGS = 1000; static constexpr uint32_t MAX_SUPPORTED_ITEMS = (12000 * 2 * 2); static constexpr uint32_t MAX_ITEM_CAPACITY = (1000 * 10); static constexpr uint32_t MAX_DATA_CAPACITY = (1000 * 10 * 10 * 10); +static constexpr uint32_t MIN_VEC_SIZE = 12; #define METADATA_PACKET_ALIGNMENT \ MaxAlignment(MaxAlignment(DATA_ALIGNMENT, METADATA_ALIGNMENT), ITEM_ALIGNMENT) diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index 40cb2157..7bbfb8fb 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -265,6 +265,10 @@ void MetadataUtils::ConvertVecToMetadata(const std::vector& cameraAbili uint32_t itemCapacity = 0; uint32_t dataCapacity = 0; + if (cameraAbility.size() < MIN_VEC_SIZE) { + METADATA_ERR_LOG("ConvertVecToMetadata cameraAbility size:%{public}d", static_cast(cameraAbility.size())); + return; + } ReadData(tagCount, index, cameraAbility); if (tagCount > MAX_SUPPORTED_TAGS) { METADATA_ERR_LOG("ConvertVecToMetadata tagCount out of range:%{public}d", tagCount); diff --git a/camera/sequenceable/buffer_handle/BUILD.gn b/camera/sequenceable/buffer_handle/BUILD.gn index 25e7343f..eb3d1eb0 100644 --- a/camera/sequenceable/buffer_handle/BUILD.gn +++ b/camera/sequenceable/buffer_handle/BUILD.gn @@ -35,7 +35,7 @@ ohos_shared_library("libbuffer_handle_sequenceable_1.0") { "ipc:ipc_single", ] cflags_cc = [ "-fstack-protector-strong" ] - ldflags = [ "-s" ] + if (drivers_interface_camera_feature_coverage) { cflags_cc += [ "--coverage" ] ldflags += [ "--coverage" ] diff --git a/camera/sequenceable/buffer_producer/BUILD.gn b/camera/sequenceable/buffer_producer/BUILD.gn index b4559322..3f5d110d 100644 --- a/camera/sequenceable/buffer_producer/BUILD.gn +++ b/camera/sequenceable/buffer_producer/BUILD.gn @@ -36,7 +36,7 @@ ohos_shared_library("libbuffer_producer_sequenceable_1.0") { "ipc:ipc_single", ] cflags_cc = [ "-fstack-protector-strong" ] - ldflags = [ "-s" ] + if (drivers_interface_camera_feature_coverage) { cflags_cc += [ "--coverage" ] ldflags += [ "--coverage" ] diff --git a/camera/sequenceable/map_data/BUILD.gn b/camera/sequenceable/map_data/BUILD.gn index a1e920de..03245741 100644 --- a/camera/sequenceable/map_data/BUILD.gn +++ b/camera/sequenceable/map_data/BUILD.gn @@ -35,7 +35,7 @@ ohos_shared_library("libmap_data_sequenceable_1.0") { "ipc:ipc_single", ] cflags_cc = [ "-fstack-protector-strong" ] - ldflags = [ "-s" ] + if (drivers_interface_camera_feature_coverage) { cflags_cc += [ "--coverage" ] ldflags += [ "--coverage" ] -- Gitee From 1d85475b65a8c29356decc138852e4569040648d Mon Sep 17 00:00:00 2001 From: yangkan Date: Mon, 28 Oct 2024 14:07:12 +0000 Subject: [PATCH 185/347] update display/composer/common/include/display_interface_utils.h. Signed-off-by: yangkan --- .../common/include/display_interface_utils.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/display/composer/common/include/display_interface_utils.h b/display/composer/common/include/display_interface_utils.h index 0e6dd1b3..f9ebf441 100644 --- a/display/composer/common/include/display_interface_utils.h +++ b/display/composer/common/include/display_interface_utils.h @@ -44,12 +44,10 @@ } \ } while (0) -#define DISPLAY_CHK_BREAK(val, ...) \ - do { \ - if (val) { \ - __VA_ARGS__; \ - break; \ - } \ - } while (0) +#define DISPLAY_CHK_BREAK(val, ...) \ + if (val) { \ + __VA_ARGS__; \ + break; \ + } \ #endif // DISPLAY_INTERFACE_UTILS_H -- Gitee From 43434b2c708a4c128f2e237ddfa36d1428367152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Tue, 29 Oct 2024 01:32:29 +0000 Subject: [PATCH 186/347] update audio/v4_0/AudioTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/v4_0/AudioTypes.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index f2ed451b..20795f39 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -90,6 +90,7 @@ enum AudioCategory { AUDIO_MMAP_VOIP = 8, /**< Audio voip */ AUDIO_IN_NAVIGATION = 9, /**< Audio navigation */ AUDIO_DIRECT = 10,/**< Audio direct */ + AUDIO_RAW = 11,/**< Audio raw */ }; /** -- Gitee From c92b2be977bbbef170405c8c79612d7de01e99cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 29 Oct 2024 11:33:00 +0800 Subject: [PATCH 187/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/display_command/display_cmd_responser.h | 1 + display/composer/v1_2/display_command/display_cmd_responser.h | 1 + 2 files changed, 2 insertions(+) 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 7ee4cd77..31a03a45 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -183,6 +183,7 @@ public: if (!unpacker.BeginSection(unpackCmd)) { HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.", CmdUtils::CommandToString(unpackCmd)); ret = HDF_FAILURE; + break; } ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); } 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 2ee974fd..15f69150 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -258,6 +258,7 @@ REPLY: HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.", CmdUtils::CommandToString(unpackCmd)); ret = HDF_FAILURE; + break; } ret = ProcessRequestCmd(unpacker, unpackCmd, inFds, outFds); } -- Gitee From dc406417343981130418ae6f4dc7d965289c20a2 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Tue, 29 Oct 2024 16:35:11 +0800 Subject: [PATCH 188/347] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghang133 --- camera/bundle.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/camera/bundle.json b/camera/bundle.json index 6e96ddaf..069728d6 100644 --- a/camera/bundle.json +++ b/camera/bundle.json @@ -48,6 +48,8 @@ "//drivers/interface/camera/v1_0:libcamera_stub_1.0" ], "test": [ + "//drivers/peripheral/camera/test/hdi/metadata_test:camera_metadata_operator_ut", + "//drivers/peripheral/camera/test/hdi/sequenceable_test:camera_hdi_sequenceable_ut" ], "inner_kits": [ { -- Gitee From 357a3c517733613231e3ba6de4320948908e583d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=B0?= Date: Tue, 29 Oct 2024 10:56:31 +0000 Subject: [PATCH 189/347] update camera/bundle.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘丰 --- camera/bundle.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/camera/bundle.json b/camera/bundle.json index 6e96ddaf..069728d6 100644 --- a/camera/bundle.json +++ b/camera/bundle.json @@ -48,6 +48,8 @@ "//drivers/interface/camera/v1_0:libcamera_stub_1.0" ], "test": [ + "//drivers/peripheral/camera/test/hdi/metadata_test:camera_metadata_operator_ut", + "//drivers/peripheral/camera/test/hdi/sequenceable_test:camera_hdi_sequenceable_ut" ], "inner_kits": [ { -- Gitee From 1b3dd113ab654787eab75f8548feec0911b005a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Wed, 30 Oct 2024 06:09:10 +0000 Subject: [PATCH 190/347] update audio/v4_0/AudioTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/v4_0/AudioTypes.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index 20795f39..6f52bbcd 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -76,7 +76,7 @@ enum AudioPortPin { * @brief Enumerates the audio category. * * @since 4.1 - * @version 3.0 + * @version 4.0 */ enum AudioCategory { AUDIO_IN_MEDIA = 0, /**< Media */ -- Gitee From d4182e17087e387b4228af9f73e54f6556e4794b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 30 Oct 2024 20:30:48 +0800 Subject: [PATCH 191/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 8c14a70f..9c23e52a 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -116,13 +116,13 @@ public: } virtual int32_t ClearClientBuffer(uint32_t devId) override { - COMPOSER_CHECK_NULLPTR_RETURN(req_v1_2_); + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); return ToDispErrCode(hdi_v1_2_->ClearClientBuffer(devId)); } virtual int32_t ClearLayerBuffer(uint32_t devId, uint32_t layerId) override { - COMPOSER_CHECK_NULLPTR_RETURN(req_v1_2_); + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); return ToDispErrCode(hdi_v1_2_->ClearLayerBuffer(devId, layerId)); } -- Gitee From 66e438915cfc74f36606b27e4434c76e79299878 Mon Sep 17 00:00:00 2001 From: sqwlly Date: Sat, 2 Nov 2024 07:05:21 +0000 Subject: [PATCH 192/347] buffer handle chipsetsdk Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: I0dcc4ef5bfe804e5358e1d8e3db6dfe0f7b2b558 --- camera/sequenceable/buffer_producer/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/camera/sequenceable/buffer_producer/BUILD.gn b/camera/sequenceable/buffer_producer/BUILD.gn index b4559322..1a85c750 100644 --- a/camera/sequenceable/buffer_producer/BUILD.gn +++ b/camera/sequenceable/buffer_producer/BUILD.gn @@ -30,6 +30,7 @@ ohos_shared_library("libbuffer_producer_sequenceable_1.0") { external_deps = [ "c_utils:utils", + "graphic_surface:buffer_handle", "graphic_surface:surface", "hdf_core:libpub_utils", "hilog:libhilog", -- Gitee From 629aba84fc9773aa9465d60574265caa41135042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 4 Nov 2024 15:42:06 +0800 Subject: [PATCH 193/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/display_command/display_cmd_utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_utils.h b/display/composer/v1_0/display_command/display_cmd_utils.h index db512bbb..b194a7ff 100644 --- a/display/composer/v1_0/display_command/display_cmd_utils.h +++ b/display/composer/v1_0/display_command/display_cmd_utils.h @@ -272,7 +272,9 @@ public: HDF_LOGE("%{public}s, read fdId failed", __func__)); if (fdId < 0 || MatchHdiFd(fdId, hdiFds, fd) == false) { // If matching failure, the illegal fd is transfered by smq directly, not by binder IPC. - fd = fdId; + HDF_LOGE("%{public}s, matching failure, fd %{public}d, fdId %{public}d, hdiFds.size %{public}zu", + __func__, fd, fdId, hdiFds.size()); + fd = -1; } return HDF_SUCCESS; } -- Gitee From c64968dfc26fb9f24a3dd5e2e8749a72d6a27f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 4 Nov 2024 16:47:12 +0800 Subject: [PATCH 194/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/display_command/display_cmd_utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_utils.h b/display/composer/v1_0/display_command/display_cmd_utils.h index b194a7ff..111832e1 100644 --- a/display/composer/v1_0/display_command/display_cmd_utils.h +++ b/display/composer/v1_0/display_command/display_cmd_utils.h @@ -27,6 +27,8 @@ #undef LOG_DOMAIN #define LOG_DOMAIN 0xD002515 +#define INVALID_FD -1 + namespace OHOS { namespace HDI { namespace Display { @@ -274,7 +276,7 @@ public: // If matching failure, the illegal fd is transfered by smq directly, not by binder IPC. HDF_LOGE("%{public}s, matching failure, fd %{public}d, fdId %{public}d, hdiFds.size %{public}zu", __func__, fd, fdId, hdiFds.size()); - fd = -1; + fd = INVALID_FD; } return HDF_SUCCESS; } -- Gitee From 7e4ed089e95a127c23f681ab7454382f80a90780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Mon, 4 Nov 2024 09:04:24 +0000 Subject: [PATCH 195/347] delete all_dependent_configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/BUILD.gn | 1 - camera/metadata/include/camera_metadata_item_info.h | 2 +- camera/sequenceable/buffer_handle/BUILD.gn | 2 -- camera/sequenceable/buffer_producer/BUILD.gn | 1 - camera/sequenceable/map_data/BUILD.gn | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/camera/metadata/BUILD.gn b/camera/metadata/BUILD.gn index 10fa979e..a2e2bf70 100644 --- a/camera/metadata/BUILD.gn +++ b/camera/metadata/BUILD.gn @@ -33,7 +33,6 @@ ohos_shared_library("metadata") { cflags += [ "--coverage" ] ldflags += [ "--coverage" ] } - all_dependent_configs = [ ":camera_metadata_config" ] if (defined(ohos_lite)) { sources = [ "src/camera_metadata_info.cpp", diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index e0b3ed23..fc27914a 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -511,7 +511,7 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT [OHOS_ABILITY_CAMERA_VIDEO_ROTATION - OHOS_CAMERA_EFFECT_START] = {"supportedVideoRotation", META_TYPE_INT32, -1}, [OHOS_CONTROL_CAMERA_VIDEO_ROTATION - - OHOS_CAMERA_EFFECT_START] = {"videoRotation", META_TYPE_BYTE, 1}, + OHOS_CAMERA_EFFECT_START] = {"videoRotation", META_TYPE_INT32, 1}, }; static item_info_t g_ohosCameraSecure[OHOS_CAMERA_SECURE_END - OHOS_CAMERA_SECURE_START] = { diff --git a/camera/sequenceable/buffer_handle/BUILD.gn b/camera/sequenceable/buffer_handle/BUILD.gn index eb3d1eb0..bdd62f10 100644 --- a/camera/sequenceable/buffer_handle/BUILD.gn +++ b/camera/sequenceable/buffer_handle/BUILD.gn @@ -24,8 +24,6 @@ config("buffer_handle_sequenceable_config") { ohos_shared_library("libbuffer_handle_sequenceable_1.0") { sources = [ "buffer_handle_sequenceable.cpp" ] - all_dependent_configs = [ ":buffer_handle_sequenceable_config" ] - external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", diff --git a/camera/sequenceable/buffer_producer/BUILD.gn b/camera/sequenceable/buffer_producer/BUILD.gn index 1b2220f7..f354c0ad 100644 --- a/camera/sequenceable/buffer_producer/BUILD.gn +++ b/camera/sequenceable/buffer_producer/BUILD.gn @@ -25,7 +25,6 @@ config("camera_sequenceable_config") { ohos_shared_library("libbuffer_producer_sequenceable_1.0") { sources = [ "buffer_producer_sequenceable.cpp" ] - all_dependent_configs = [ ":camera_sequenceable_config" ] public_configs = [ ":camera_sequenceable_config" ] external_deps = [ diff --git a/camera/sequenceable/map_data/BUILD.gn b/camera/sequenceable/map_data/BUILD.gn index 03245741..06e9f68b 100644 --- a/camera/sequenceable/map_data/BUILD.gn +++ b/camera/sequenceable/map_data/BUILD.gn @@ -24,7 +24,6 @@ config("map_data_sequenceable_config") { ohos_shared_library("libmap_data_sequenceable_1.0") { sources = [ "map_data_sequenceable.cpp" ] - all_dependent_configs = [ ":map_data_sequenceable_config" ] public_configs = [ ":map_data_sequenceable_config" ] external_deps = [ -- Gitee From c0aba4b08e3f99610d075028c432a619587c7c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Mon, 4 Nov 2024 12:37:35 +0000 Subject: [PATCH 196/347] update audio/v4_0/AudioTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/v4_0/AudioTypes.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index 6f52bbcd..3c28e830 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -76,7 +76,7 @@ enum AudioPortPin { * @brief Enumerates the audio category. * * @since 4.1 - * @version 4.0 + * @version 3.1 */ enum AudioCategory { AUDIO_IN_MEDIA = 0, /**< Media */ -- Gitee From b47cb9972f54c7f5209a6a7a10d11eb1f55d84ae Mon Sep 17 00:00:00 2001 From: xiongyangyang Date: Tue, 5 Nov 2024 10:33:58 +0800 Subject: [PATCH 197/347] add moving photo deblur tag Signed-off-by: xiongyangyang --- .../include/camera_device_ability_items.h | 21 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 6 ++++++ camera/metadata/src/camera_metadata_info.cpp | 3 +++ 3 files changed, 30 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index ac503591..c8d5880c 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1946,6 +1946,27 @@ typedef enum camera_device_metadata_tag { * (i.e. uint32 ...) */ OHOS_CONTROL_CAMERA_CLOSE_AFTER_SECONDS, + /** + * ohos.status.movingPhotoBufferDuration [static, uint32[], public] + * + * camera device property, report current moving photo buffer duration + * (i.e. uint32[] ...) + */ + OHOS_MOVING_PHOTO_BUFFER_DURATION, + /** + * ohos.movingPhotoStart [static, uint32[], public] + * + * camera device property, report current moving photo start time + * (i.e. uint32[] ...) + */ + OHOS_MOVING_PHOTO_START, + /** + * ohos.movingPhotoEnd [static, int64[], public] + * + * camera device property, report current moving photo end time + * (i.e. int64[] ...) + */ + OHOS_MOVING_PHOTO_END, /** * ohos.ability.captureMacroDepthFusionSupported [static, byte, public] * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index e0b3ed23..c37dac48 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -512,6 +512,12 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"supportedVideoRotation", META_TYPE_INT32, -1}, [OHOS_CONTROL_CAMERA_VIDEO_ROTATION - OHOS_CAMERA_EFFECT_START] = {"videoRotation", META_TYPE_BYTE, 1}, + [OHOS_MOVING_PHOTO_BUFFER_DURATION - + OHOS_CAMERA_EFFECT_START] = {"movingPhotoBufferDuration", META_TYPE_UINT32, 1}, + [OHOS_MOVING_PHOTO_START - + OHOS_CAMERA_EFFECT_START] = {"movingPhotoStart", META_TYPE_INT64, 1}, + [OHOS_MOVING_PHOTO_END - + OHOS_CAMERA_EFFECT_START] = {"movingPhotoEnd", META_TYPE_INT64, 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 f889b702..411fa8b4 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -305,6 +305,9 @@ const std::vector g_metadataTags = { OHOS_ABILITY_CAMERA_VIDEO_ROTATION_SUPPORTED, OHOS_ABILITY_CAMERA_VIDEO_ROTATION, OHOS_CONTROL_CAMERA_VIDEO_ROTATION, + OHOS_MOVING_PHOTO_BUFFER_DURATION, + OHOS_MOVING_PHOTO_START, + OHOS_MOVING_PHOTO_END, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From 1cf4aaae868202a2fdffce09fbcadfa78d6c7a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 5 Nov 2024 16:04:56 +0800 Subject: [PATCH 198/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../composer/v1_2/display_command/display_cmd_responser.h | 5 +++-- 1 file changed, 3 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 16b91e17..86638472 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -230,6 +230,8 @@ REPLY: unpacker.Dump(); #endif // DEBUG_DISPLAY_CMD_RAW_DATA + int32_t ec = PeriodDataReset(); + int32_t unpackCmd = -1; bool retBool = unpacker.PackBegin(unpackCmd); DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, @@ -266,8 +268,7 @@ REPLY: HDF_LOGE("Reply write failure, ret=%{public}d", ret); outEleCnt = 0; } - int32_t ec = PeriodDataReset(); - return (ret == HDF_SUCCESS ? ec : ret); + return ret; } int32_t OnSetDisplayConstraint(CommandDataUnpacker& unpacker) -- Gitee From d5589e97183b7fa1f487980267dc8eb3fb83c5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 5 Nov 2024 19:01:09 +0800 Subject: [PATCH 199/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- 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 86638472..203940a9 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -230,8 +230,6 @@ REPLY: unpacker.Dump(); #endif // DEBUG_DISPLAY_CMD_RAW_DATA - int32_t ec = PeriodDataReset(); - int32_t unpackCmd = -1; bool retBool = unpacker.PackBegin(unpackCmd); DISPLAY_CHK_RETURN(retBool == false, HDF_FAILURE, @@ -240,6 +238,8 @@ REPLY: HDF_LOGI("error: unpacker PackBegin cmd not match, cmd(%{public}d)=%{public}s.", unpackCmd, CmdUtils::CommandToString(unpackCmd))); + DISPLAY_CHK_RETURN(PeriodDataReset() == HDF_FAILURE, HDF_FAILURE, + HDF_LOGE("%{public}s: error: Check RequestBegin failed", __func__)); while (ret == HDF_SUCCESS && unpacker.NextSection()) { if (!unpacker.BeginSection(unpackCmd)) { HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.", -- Gitee From e44b0fe3fee41aab82a5e32fb45c3e41f6ff2d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 5 Nov 2024 19:42:13 +0800 Subject: [PATCH 200/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 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 203940a9..3cc4cdf6 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -239,7 +239,7 @@ REPLY: CmdUtils::CommandToString(unpackCmd))); DISPLAY_CHK_RETURN(PeriodDataReset() == HDF_FAILURE, HDF_FAILURE, - HDF_LOGE("%{public}s: error: Check RequestBegin failed", __func__)); + HDF_LOGE("%{public}s: error: PeriodDataReset failed", __func__)); while (ret == HDF_SUCCESS && unpacker.NextSection()) { if (!unpacker.BeginSection(unpackCmd)) { HDF_LOGE("error: PackSection failed, unpackCmd=%{public}s.", -- Gitee From 7e053841a0756c139cbe4202fe51945873f9e38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 5 Nov 2024 20:28:52 +0800 Subject: [PATCH 201/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_0/display_command/display_cmd_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_utils.h b/display/composer/v1_0/display_command/display_cmd_utils.h index 111832e1..37da5ebc 100644 --- a/display/composer/v1_0/display_command/display_cmd_utils.h +++ b/display/composer/v1_0/display_command/display_cmd_utils.h @@ -27,7 +27,7 @@ #undef LOG_DOMAIN #define LOG_DOMAIN 0xD002515 -#define INVALID_FD -1 +#define INVALID_FD (-1) namespace OHOS { namespace HDI { -- Gitee From 8f52a3bc27e5676a7e06629a907396277aee7ab2 Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Tue, 5 Nov 2024 21:10:38 +0800 Subject: [PATCH 202/347] =?UTF-8?q?=E5=85=A5=E5=8F=82=E5=90=88=E6=B3=95?= =?UTF-8?q?=E6=80=A7=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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 411fa8b4..0e515e62 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -498,6 +498,10 @@ uint8_t *CameraMetadata::GetMetadataData(const common_metadata_header_t *metadat camera_metadata_item_entry_t *CameraMetadata::GetMetadataItems(const common_metadata_header_t *metadataHeader) { + if (metadataHeader == nullptr) { + METADATA_ERR_LOG("GetMetadataItems metadataHeader is null"); + return nullptr; + } return reinterpret_cast( (reinterpret_cast(const_cast(metadataHeader)) + metadataHeader->items_start)); @@ -617,6 +621,11 @@ int32_t CameraMetadata::GetMetadataSection(uint32_t itemSection, uint32_t *secti return CAM_META_FAILURE; } + if (section == nullptr) { + METADATA_ERR_LOG("GetMetadataSection section is nullptr"); + return CAM_META_FAILURE; + } + int32_t ret = CAM_META_SUCCESS; auto iter = g_metadataSectionMap.find(itemSection); if (iter != g_metadataSectionMap.end()) { -- Gitee From c5d34798a672f13d10e4dcd800c07397a68b41fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Wed, 6 Nov 2024 07:10:31 +0000 Subject: [PATCH 203/347] add tof tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- camera/metadata/include/camera_device_ability_items.h | 7 +++++++ camera/metadata/include/camera_metadata_item_info.h | 2 ++ camera/metadata/src/camera_metadata_info.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index c8d5880c..a8e4489c 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -427,6 +427,13 @@ typedef enum camera_device_metadata_tag { * (i.e. enum: DeviceProtectionStatus ...) */ OHOS_DEVICE_PROTECTION_STATE, + /** + * ohos.device.tofsensorabnormal [static, int32, public] + * + * camera device property, query current camera tof sensor abnormal state + * (i.e. int32 ...) + */ + OHOS_STATUS_TOF_SENSOR_ABNORMAL, /** * ohos.camera.propertiesEnd * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index ac0c141e..8eded723 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -136,6 +136,8 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"cameraLensDirtyDetection", META_TYPE_BYTE, 1}, [OHOS_DEVICE_PROTECTION_STATE - OHOS_CAMERA_PROPERTIES_START] = {"protectionState", META_TYPE_BYTE, 1}, + [OHOS_STATUS_TOF_SENSOR_ABNORMAL - + OHOS_CAMERA_PROPERTIES_START] = {"tofSensorAbnormal", META_TYPE_INT32, 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 411fa8b4..2f4ef02a 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -78,6 +78,7 @@ const std::vector g_metadataTags = { OHOS_STATUS_LOW_LIGHT_DETECTION, OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION, OHOS_DEVICE_PROTECTION_STATE, + OHOS_STATUS_TOF_SENSOR_ABNORMAL, OHOS_SENSOR_EXPOSURE_TIME, OHOS_SENSOR_COLOR_CORRECTION_GAINS, -- Gitee From 99b78a824de94842e70e53ffd0f62c18d99f83c1 Mon Sep 17 00:00:00 2001 From: zhjs Date: Thu, 7 Nov 2024 15:19:05 +0800 Subject: [PATCH 204/347] Add metadata type for video aihdr Signed-off-by: zhjs --- display/bundle.json | 11 ++++- display/graphic/common/v2_1/BUILD.gn | 24 +++++++++++ display/graphic/common/v2_1/CMColorSpace.idl | 43 ++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 display/graphic/common/v2_1/BUILD.gn create mode 100644 display/graphic/common/v2_1/CMColorSpace.idl diff --git a/display/bundle.json b/display/bundle.json index 1113e9cb..84f242ba 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -54,7 +54,8 @@ "//drivers/interface/display/composer/v1_2:libdisplay_composer_hdi_impl_1.2", "//drivers/interface/display/graphic/common/v1_0:display_commontype_idl_target", "//drivers/interface/display/graphic/common/v1_1:display_commontype_idl_target", - "//drivers/interface/display/graphic/common/v2_0:display_commontype_idl_target" + "//drivers/interface/display/graphic/common/v2_0:display_commontype_idl_target", + "//drivers/interface/display/graphic/common/v2_1:display_commontype_idl_target" ], "inner_kits": [ { @@ -321,6 +322,14 @@ "header_base": "//drivers/interface/display/graphic/common" } }, + { + "name": "//drivers/interface/display/graphic/common/v2_1:display_commontype_idl_headers_2.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/graphic/common" + } + }, { "name": "//drivers/interface/display/v1_0:libdisplay_gralloc", "header": { diff --git a/display/graphic/common/v2_1/BUILD.gn b/display/graphic/common/v2_1/BUILD.gn new file mode 100644 index 00000000..74212741 --- /dev/null +++ b/display/graphic/common/v2_1/BUILD.gn @@ -0,0 +1,24 @@ +# 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("//build/config/components/hdi/hdi.gni") + +hdi("display_commontype") { + module_name = "display_commontype" + + sources = [ "CMColorSpace.idl" ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_display" +} \ No newline at end of file diff --git a/display/graphic/common/v2_1/CMColorSpace.idl b/display/graphic/common/v2_1/CMColorSpace.idl new file mode 100644 index 00000000..7692c2ca --- /dev/null +++ b/display/graphic/common/v2_1/CMColorSpace.idl @@ -0,0 +1,43 @@ +/* + * 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 HdiDisplay + * + * @brief Define the clolor space Key interface of the display module. + * + * This module provides the clolor space types used by the driver interface for the upper-level graphics service. + * + * @since 5.1 + * @version 2.1 + */ + +/** + * @file CMColorSpace.idl + * @brief Declares the clolor space types used by the interfaces related to clolor space Meta Key operations. + * + */ + +package ohos.hdi.display.graphic.common.v2_1; +import ohos.hdi.display.graphic.common.v2_0.CMColorSpace; + +/** + * @brief Enumerates the HDR metadata Attr Key types. + * + */ +enum CM_HDR_Metadata_Type : ohos.hdi.display.graphic.common.v2_0.CM_HDR_Metadata_Type { + /* Video AIHDR metadata type */ + CM_VIDEO_AI_HDR = 60, // video AIHDR +}; \ No newline at end of file -- Gitee From a0d32d5fa3aa046de09c53e05f8ec2984a7f1c23 Mon Sep 17 00:00:00 2001 From: guochengying <346447065@qq.com> Date: Thu, 7 Nov 2024 17:31:29 +0800 Subject: [PATCH 205/347] add SetPowerConfig GetPowerConfig Signed-off-by: guochengying <346447065@qq.com> --- power/v1_2/IPowerInterface.idl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/power/v1_2/IPowerInterface.idl b/power/v1_2/IPowerInterface.idl index cd773c06..41d99470 100755 --- a/power/v1_2/IPowerInterface.idl +++ b/power/v1_2/IPowerInterface.idl @@ -235,5 +235,35 @@ interface IPowerInterface { * @version 1.0 */ SetSuspendTag([in] String tag); + + /** + * @brief Set the set-path file value related to the scene name. + * + * @param scene The scene name defined in power config json file. + * + * @param value Value of the set-path file. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 5.0 + * + * @version 1.0 + */ + SetPowerConfig([in] String scene, [in] String value); + + /** + * @brief Get the get-path file value related to the scene name. + * + * @param scene The scene name defined in power config json file. + * + * @param value Value of the get-path file. + * + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 5.0 + * + * @version 1.0 + */ + GetPowerConfig([in] String scene, [out] String value); } /** @} */ -- Gitee From f8fb75f8e8ebdd623eaa1957b0ecb77821a03cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Fri, 8 Nov 2024 07:03:20 +0000 Subject: [PATCH 206/347] add lock for FreeCameraMetadataBuffer 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index ab3f18eb..4a118c60 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -20,10 +20,12 @@ #include #include #include +#include #include "camera_metadata_item_info.h" #include "camera_vendor_tag.h" namespace OHOS::Camera { +static std::mutex mtx_; static CameraVendorTag* g_vendorTagImpl = nullptr; const char* g_exampleVendorTagLib = "libcamera_example_vendor_tag_impl.z.so"; const char* g_vendorTagLib = "libcamera_vendor_tag_impl.z.so"; @@ -349,6 +351,7 @@ CameraMetadata::CameraMetadata(size_t itemCapacity, size_t dataCapacity) CameraMetadata::~CameraMetadata() { + std::lock_guard lockGuard(mtx_); if (metadata_) { FreeCameraMetadataBuffer(metadata_); metadata_ = nullptr; @@ -411,6 +414,7 @@ bool CameraMetadata::resize_add_metadata(uint32_t item, const void *data, size_t if (result != CAM_META_SUCCESS) { METADATA_ERR_LOG("Failed to copy the old metadata to new metadata"); FreeCameraMetadataBuffer(newMetadata); + newMetadata = nullptr; return false; } @@ -418,6 +422,7 @@ bool CameraMetadata::resize_add_metadata(uint32_t item, const void *data, size_t if (result != CAM_META_SUCCESS) { METADATA_ERR_LOG("Failed to add new entry"); FreeCameraMetadataBuffer(newMetadata); + newMetadata = nullptr; return false; } replace_metadata(newMetadata); @@ -431,7 +436,11 @@ void CameraMetadata::replace_metadata(common_metadata_header_t *newMetadata) return; } - FreeCameraMetadataBuffer(metadata_); + std::lock_guard lockGuard(mtx_); + if (metadata_ != nullptr) { + FreeCameraMetadataBuffer(metadata_); + metadata_ = newMetadata; + } metadata_ = newMetadata; } -- Gitee From 8f1ce49885e64577ad03e7262e27c83af32b0722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Sat, 9 Nov 2024 03:28:30 +0000 Subject: [PATCH 207/347] add lock for FreeCameraMetadataBuffer 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 | 1 - 1 file changed, 1 deletion(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 4a118c60..23f8f36a 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -439,7 +439,6 @@ void CameraMetadata::replace_metadata(common_metadata_header_t *newMetadata) std::lock_guard lockGuard(mtx_); if (metadata_ != nullptr) { FreeCameraMetadataBuffer(metadata_); - metadata_ = newMetadata; } metadata_ = newMetadata; } -- Gitee From bba6b2dfdb8997afd71a587504d165b0a3cd73bd Mon Sep 17 00:00:00 2001 From: zhjs Date: Thu, 7 Nov 2024 15:40:31 +0800 Subject: [PATCH 208/347] Add metadata type for video aihdr Signed-off-by: zhjs --- display/graphic/common/v2_1/BUILD.gn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/display/graphic/common/v2_1/BUILD.gn b/display/graphic/common/v2_1/BUILD.gn index 74212741..ed24c812 100644 --- a/display/graphic/common/v2_1/BUILD.gn +++ b/display/graphic/common/v2_1/BUILD.gn @@ -10,15 +10,15 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - + import("//build/config/components/hdi/hdi.gni") - + hdi("display_commontype") { module_name = "display_commontype" - + sources = [ "CMColorSpace.idl" ] - + language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_display" -} \ No newline at end of file +} -- Gitee From 4fb46d35fa6ffc6e46eab8b06b77b2be7a0f199f Mon Sep 17 00:00:00 2001 From: yangkan Date: Mon, 11 Nov 2024 21:20:49 +0800 Subject: [PATCH 209/347] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E6=80=A7=E6=8E=92=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- display/composer/cache_manager/cache_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/cache_manager.h b/display/composer/cache_manager/cache_manager.h index 852ade70..239b144d 100644 --- a/display/composer/cache_manager/cache_manager.h +++ b/display/composer/cache_manager/cache_manager.h @@ -220,7 +220,7 @@ public: 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); + HDF_LOGE("%{public}s: Cache %{public}d is not existing", __func__, id); return false; } -- Gitee From 03689d688d80986cda6c44cf863c85712ceecfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 13 Nov 2024 11:41:18 +0800 Subject: [PATCH 210/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/IDisplayComposer.idl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 7a86fe6f..b15f3f19 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -94,4 +94,17 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @version 1.0 */ GetHardwareCursorStats([in] unsigned int devId, [out] unsigned int frameCount, [out] unsigned int vsyncCount); + + /** + * @brief Set Display Active Region. + * + * @param devId Indicates the ID of the display device. + * @param rect Indicates the pointer to the cropped region of the client buffer. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.2 + */ + SetDisplayActiveRegion([in] unsigned int devId, [out] struct IRect rect); } -- Gitee From 6c26aea5f9931a44cfde5411ffc64ddf1af86ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 13 Nov 2024 14:58:22 +0800 Subject: [PATCH 211/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- .../common/include/display_vdi_adapter_interface.h | 2 ++ display/composer/v1_2/IDisplayComposer.idl | 1 + display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 7 +++++++ .../composer/v1_2/include/idisplay_composer_interface.h | 2 ++ 4 files changed, 12 insertions(+) diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index d4dd7878..705e8056 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -89,6 +89,7 @@ struct DisplayComposerVdiAdapter { int32_t (*SetHardwareCursorPosition)(uint32_t devId, int32_t x, int32_t y); int32_t (*EnableHardwareCursorStats)(uint32_t devId, bool enable); int32_t (*GetHardwareCursorStats)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); + int32_t (*SetDisplayActiveRegion)(uint32_t devId, const IRect& rect); }; using LoadVdiImplFunc = int32_t (*)(); @@ -149,6 +150,7 @@ using SetDisplayConstraintFunc = int32_t (*)(uint32_t devId, uint64_t frameID, u using SetHardwareCursorPositionFunc = int32_t (*)(uint32_t devId, int32_t x, int32_t y); using EnableHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, bool enable); using GetHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); +using SetDisplayActiveRegionFunc = int32_t (*)(uint32_t devId, const IRect& rect); } // namespace Composer } // namespace Display diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index b15f3f19..b962c52a 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -16,6 +16,7 @@ package ohos.hdi.display.composer.v1_2; import ohos.hdi.display.composer.v1_1.IDisplayComposer; +import ohos.hdi.display.composer.v1_0.DisplayComposerType; import ohos.hdi.display.composer.v1_2.DisplayComposerType; import ohos.hdi.display.composer.v1_2.IVBlankIdleCallback; diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 9c23e52a..218bcacc 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -147,6 +147,13 @@ public: return ret; } + virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) override + { + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); + int32_t ret = ToDispErrCode(hdi_v1_2_->SetDisplayActiveRegion(devId, rect)); + return ret; + } + protected: using BaseType1_1 = V1_1::DisplayComposerHdiImpl; using BaseType1_1::WAIT_TIME_INTERVAL; diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 5a6252b1..b97b9845 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -71,6 +71,8 @@ public: virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) = 0; virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0; + + virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) = 0; }; } // V1_2 } // Composer -- Gitee From eacc9ed0de1c3ab14236bb0dbe7c73150db4357f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 13 Nov 2024 15:39:30 +0800 Subject: [PATCH 212/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 3 ++- display/composer/v1_2/include/idisplay_composer_interface.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 218bcacc..26df672f 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -147,7 +147,8 @@ public: return ret; } - virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) override + virtual int32_t SetDisplayActiveRegion(uint32_t devId, + const OHOS::HDI::Display::Composer::V1_0::IRect& rect) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); int32_t ret = ToDispErrCode(hdi_v1_2_->SetDisplayActiveRegion(devId, rect)); diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index b97b9845..82c3fe52 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -72,7 +72,7 @@ public: virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0; - virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) = 0; + virtual int32_t SetDisplayActiveRegion(uint32_t devId, const OHOS::HDI::Display::Composer::V1_0::IRect& rect) = 0; }; } // V1_2 } // Composer -- Gitee From 3aa30464c781c39725c12270c0b7abdf08e371ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 13 Nov 2024 16:12:01 +0800 Subject: [PATCH 213/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/IDisplayComposer.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index b962c52a..cfdcf8f0 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -107,5 +107,5 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @since 5.0 * @version 1.2 */ - SetDisplayActiveRegion([in] unsigned int devId, [out] struct IRect rect); + SetDisplayActiveRegion([in] unsigned int devId, [in] struct IRect rect); } -- Gitee From adc501743903618ae7b422bcc758730890597195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 13 Nov 2024 17:34:16 +0800 Subject: [PATCH 214/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 3 +-- display/composer/v1_2/include/idisplay_composer_interface.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 26df672f..218bcacc 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -147,8 +147,7 @@ public: return ret; } - virtual int32_t SetDisplayActiveRegion(uint32_t devId, - const OHOS::HDI::Display::Composer::V1_0::IRect& rect) override + virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); int32_t ret = ToDispErrCode(hdi_v1_2_->SetDisplayActiveRegion(devId, rect)); diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 82c3fe52..b97b9845 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -72,7 +72,7 @@ public: virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0; - virtual int32_t SetDisplayActiveRegion(uint32_t devId, const OHOS::HDI::Display::Composer::V1_0::IRect& rect) = 0; + virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) = 0; }; } // V1_2 } // Composer -- Gitee From cb3485b6f9ab12a41d1c0947448628de9f43355d Mon Sep 17 00:00:00 2001 From: Sxs Date: Thu, 14 Nov 2024 06:02:27 +0000 Subject: [PATCH 215/347] update codec/v3_0/CodecTypes.idl. Signed-off-by: Sxs --- codec/v3_0/CodecTypes.idl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codec/v3_0/CodecTypes.idl b/codec/v3_0/CodecTypes.idl index dd558abc..8c3fe41f 100644 --- a/codec/v3_0/CodecTypes.idl +++ b/codec/v3_0/CodecTypes.idl @@ -324,7 +324,7 @@ struct RangeValue { * @brief Defines the video encoding and decoding capabilities. * @since 4.1 - * @version 4.0 + * @version 5.0 */ struct CodecVideoPortCap { struct Rect minSize; /**< Minimum resolution supported. */ @@ -345,6 +345,7 @@ struct CodecVideoPortCap { boolean isSupportLTR; /**< Whether supports long-term reference feature */ int maxLTRFrameNum; /**< Maximum long-term reference frame numbers supported */ boolean isSupportWaterMark; /**< Whether supports WaterMark feature */ + boolean isSupportQPMap; /**< Whether supports frame qp map feature */ }; /** -- Gitee From c8845876e8c1e47e4249d29610f096a2729de43a Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Thu, 14 Nov 2024 14:53:16 +0800 Subject: [PATCH 216/347] =?UTF-8?q?=E9=98=B2=E6=99=92=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3?= 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 | 49 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 14 ++++++ camera/metadata/src/camera_metadata_info.cpp | 7 +++ camera/metadata/src/metadata_utils.cpp | 6 --- camera/v1_3/Types.idl | 14 ++++++ 5 files changed, 84 insertions(+), 6 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index a8e4489c..c1049edc 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -434,6 +434,41 @@ typedef enum camera_device_metadata_tag { * (i.e. int32 ...) */ OHOS_STATUS_TOF_SENSOR_ABNORMAL, + /** + * ohos.ability.sunBlockPreviewTypes [static, byte[], public] + * + * camera device property, report current camera sun block types supported in proview + * (i.e. byte[]: [0-notSupport|1-RGB|2-UV|...]) + */ + OHOS_ABILITY_SUN_BLOCK_PREVIEW_TYPES, + /** + * ohos.ability.sunBlockBlendColors [static, byte[], public] + * + * camera device property, report current camera sun block supports blend colors + * (i.e. byte[]: [0-notSupport|1-purple|2-silver|3-gold|...]) + */ + OHOS_ABILITY_SUN_BLOCK_BLEND_COLORS, + /** + * ohos.ability.sunBlockRgbCropRegion [static, float[], public] + * + * camera device property, report current camera RGB image cropping coefficient, which is the normalized coordinate + * (i.e. float[] ...) + */ + OHOS_ABILITY_SUN_BLOCK_RGB_CROP_REGION, + /** + * ohos.ability.sunBlockRgbUvRegion [static, float[], public] + * + * camera device property, report current camera UV image cropping coefficient, which is the normalized coordinate + * (i.e. float[] ...) + */ + OHOS_ABILITY_SUN_BLOCK_RGB_UV_REGION, + /** + * ohos.status.sunBlockHint [static, byte, public] + * + * camera device property, queries the status returned by the current camera running the sun protection detection + * (i.e. byte ...) + */ + OHOS_STATUS_SUN_BLOCK_HINT, /** * ohos.camera.propertiesEnd * @@ -1001,6 +1036,20 @@ typedef enum camera_device_metadata_tag { * (i.e. byte: 0-false/1true ...) */ OHOS_CONTROL_FALL_PROTECTION, + /** + * ohos.control.sunBlockPreviewType [static, byte, public] + * + * camera device property, sets the sun protection detection type under the current camera preview + * (i.e. byte: 0-RGB/1-UV/2-RGB+UV) + */ + OHOS_CONTROL_SUN_BLOCK_PREVIEW_TYPE, + /** + * ohos.control.sunBlockBlendColor [static, byte, public] + * + * camera device property, sets the sun protection detection blend color for the current camera + * (i.e. byte: 0-none/1-purple/2-silver/3-gold) + */ + OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR, /** * ohos.device.controlEnd * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 8eded723..92ed1c93 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -138,6 +138,16 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"protectionState", META_TYPE_BYTE, 1}, [OHOS_STATUS_TOF_SENSOR_ABNORMAL - OHOS_CAMERA_PROPERTIES_START] = {"tofSensorAbnormal", META_TYPE_INT32, 1}, + [OHOS_ABILITY_SUN_BLOCK_PREVIEW_TYPES - + OHOS_CAMERA_PROPERTIES_START] = {"sunBlockPreviewTypes", META_TYPE_BYTE, -1}, + [OHOS_ABILITY_SUN_BLOCK_BLEND_COLORS - + OHOS_CAMERA_PROPERTIES_START] = {"sunBlockBlendColors", META_TYPE_BYTE, -1}, + [OHOS_ABILITY_SUN_BLOCK_RGB_CROP_REGION - + OHOS_CAMERA_PROPERTIES_START] = {"sunBlockRgbCropRegion", META_TYPE_FLOAT, -1}, + [OHOS_ABILITY_SUN_BLOCK_RGB_UV_REGION - + OHOS_CAMERA_PROPERTIES_START] = {"sunBlockRgbUvRegion", META_TYPE_FLOAT, -1}, + [OHOS_STATUS_SUN_BLOCK_HINT - + OHOS_CAMERA_PROPERTIES_START] = {"sunBlockHint", META_TYPE_BYTE, -1}, }; static item_info_t g_ohosCameraSensor[OHOS_CAMERA_SENSOR_END - OHOS_CAMERA_SENSOR_START] = { @@ -261,6 +271,10 @@ static item_info_t g_ohosCameraControl[OHOS_DEVICE_CONTROL_END - OHOS_DEVICE_CON OHOS_DEVICE_CONTROL_START] = {"ejectRetry", META_TYPE_BYTE, 1}, [OHOS_CONTROL_FALL_PROTECTION - OHOS_DEVICE_CONTROL_START] = {"fallProtection", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_SUN_BLOCK_PREVIEW_TYPE - + OHOS_DEVICE_CONTROL_START] = {"sunBlockPreviewType", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR - + OHOS_DEVICE_CONTROL_START] = {"sunBlockBlendColor", 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 23f8f36a..12f9fb55 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -81,6 +81,11 @@ const std::vector g_metadataTags = { OHOS_STATUS_CAMERA_LENS_DIRTY_DETECTION, OHOS_DEVICE_PROTECTION_STATE, OHOS_STATUS_TOF_SENSOR_ABNORMAL, + OHOS_ABILITY_SUN_BLOCK_PREVIEW_TYPES, + OHOS_ABILITY_SUN_BLOCK_BLEND_COLORS, + OHOS_ABILITY_SUN_BLOCK_RGB_CROP_REGION, + OHOS_ABILITY_SUN_BLOCK_RGB_UV_REGION, + OHOS_STATUS_SUN_BLOCK_HINT, OHOS_SENSOR_EXPOSURE_TIME, OHOS_SENSOR_COLOR_CORRECTION_GAINS, @@ -162,6 +167,8 @@ const std::vector g_metadataTags = { OHOS_CONTROL_CAMERA_SESSION_USAGE, OHOS_CONTROL_EJECT_RETRY, OHOS_CONTROL_FALL_PROTECTION, + OHOS_CONTROL_SUN_BLOCK_PREVIEW_TYPE, + OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR, // Camera device image acquisition related OHOS_ABILITY_DEVICE_AVAILABLE_EXPOSUREMODES, diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index 7bbfb8fb..60716f2e 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -69,12 +69,6 @@ bool MetadataUtils::ConvertMetadataToVec(const std::shared_ptr & } common_metadata_header_t *meta = metadata->get(); - if (meta == nullptr) { - WriteData(0, cameraAbility); - METADATA_WARNING_LOG("ConvertMetadataToVec tagCount is 0!"); - return true; - } - uint32_t tagCount = GetCameraMetadataItemCount(meta); if (tagCount > MAX_SUPPORTED_TAGS) { METADATA_ERR_LOG("ConvertMetadataToVec tagCount out of range:%{public}d", tagCount); diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 600793fe..6ea4940b 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -127,6 +127,13 @@ enum OperationMode : ohos.hdi.camera.v1_2.OperationMode_V1_2 { * @version 1.0 */ FLUORESCENCE_PHOTO = 21, + + /** + * sun block mode, which dedicated to uv sunscreen detection mode + * @since 5.0 + * @version 1.0 + */ + SUN_BLOCK = 22, }; /** @@ -205,6 +212,13 @@ enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { * @version 1.0 */ EXTENDED_STREAM_INFO_FRAGMENT =11, + + /** + * Extended stream information of uv sunscreen detection + * @since 5.0 + * @version 1.0 + */ + EXTENDED_STREAM_INFO_UV = 12, }; /** -- Gitee From 3b867011fdfebb9d8d8830dc4243fb2d8c0dab02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AE=B9=E5=BB=B7?= Date: Thu, 7 Nov 2024 09:33:05 +0800 Subject: [PATCH 217/347] display interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱容廷 --- .../include/display_vdi_adapter_interface.h | 4 ++++ display/composer/v1_2/DisplayComposerType.idl | 14 ++++++++++++++ display/composer/v1_2/IDisplayComposer.idl | 13 +++++++++++++ .../v1_2/hdi_impl/display_composer_hdi_impl.h | 16 ++++++++++++++++ .../v1_2/include/idisplay_composer_interface.h | 3 +++ 5 files changed, 50 insertions(+) diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index d4dd7878..9b19f804 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -89,6 +89,8 @@ struct DisplayComposerVdiAdapter { int32_t (*SetHardwareCursorPosition)(uint32_t devId, int32_t x, int32_t y); int32_t (*EnableHardwareCursorStats)(uint32_t devId, bool enable); int32_t (*GetHardwareCursorStats)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); + int32_t (*FastPresent)(uint32_t devId, const PresentParam& param, + const std::vector& inHandles); }; using LoadVdiImplFunc = int32_t (*)(); @@ -149,6 +151,8 @@ using SetDisplayConstraintFunc = int32_t (*)(uint32_t devId, uint64_t frameID, u using SetHardwareCursorPositionFunc = int32_t (*)(uint32_t devId, int32_t x, int32_t y); using EnableHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, bool enable); using GetHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); +using FastPresentFunc = int32_t (*)(uint32_t devId, const PresentParam& param, + const std::vector& inHandles); } // namespace Composer } // namespace Display diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 895a924f..fd909b32 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -98,4 +98,18 @@ enum DisplayPropertyID { DISPLAY_PROPERTY_ID_SKIP_VALIDATE = 1, DISPLAY_CAPBILITY_HARDWARE_CURSOR = 2, DISPLAY_PROPERTY_ID_ADAPTIVE_SYNC = 3, /**< Indicates whether to support adaptive sync(display in advance) */ +}; + +/** + * @brief Defines the data structure of present param. + * + * @since 5.0 + * @version 1.0 + */ +struct PresentParam { + unsigned int isLowLatency; /**< flag of low latency display */ + unsigned int sliceHeight; /**< height of slice */ + unsigned int sliceNum; /**< slice nums of current frame */ + unsigned int imageDimension; /**< low 16 bits: image width, high 16 bits: image height */ + int reserve; /**< reserve */ }; \ No newline at end of file diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 7a86fe6f..a4104172 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -94,4 +94,17 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @version 1.0 */ GetHardwareCursorStats([in] unsigned int devId, [out] unsigned int frameCount, [out] unsigned int vsyncCount); + + /** + * @brief the function to fast present. + * + * @param devId Indicates which device, param Indicates data structure of present param, + * inHandles Indicates input buffer handles. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + FastPresent([in] unsigned int devId, [in] struct PresentParam param, [in] NativeBuffer[] inHandles); } diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 9c23e52a..bada9264 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -147,6 +147,22 @@ public: return ret; } + virtual int32_t FastPresent(uint32_t devId, const PresentParam& param, + const std::vector inHandles) override + { + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); + std::vector> outHandles; + for (auto inHandle : inHandles) { + sptr nativeBuffer = new NativeBuffer(inHandle); + if (nativeBuffer == nullptr) { + HDF_LOGE("failed to alloc mem for NativeBuffer"); + return DISPLAY_FAILURE; + } + outHandles.emplace_back(nativeBuffer); + } + return ToDispErrCode(hdi_v1_2_->FastPresent(devId, param, outHandles)); + } + protected: using BaseType1_1 = V1_1::DisplayComposerHdiImpl; using BaseType1_1::WAIT_TIME_INTERVAL; diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 5a6252b1..94a34db3 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -71,6 +71,9 @@ public: virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) = 0; virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0; + + virtual int32_t FastPresent(uint32_t devId, const PresentParam& param, + const std::vector inHandles) = 0; }; } // V1_2 } // Composer -- Gitee From de7a9863bfef5302d8af6a9f57a5b4932de257cc Mon Sep 17 00:00:00 2001 From: zhjs Date: Fri, 15 Nov 2024 09:29:53 +0800 Subject: [PATCH 218/347] video aihdr Signed-off-by: zhjs --- display/bundle.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/display/bundle.json b/display/bundle.json index 84f242ba..76a2a3b4 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -322,6 +322,14 @@ "header_base": "//drivers/interface/display/graphic/common" } }, + { + "name": "//drivers/interface/display/graphic/common/v2_1:libdisplay_commontype_proxy_2.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/graphic/common" + } + }, { "name": "//drivers/interface/display/graphic/common/v2_1:display_commontype_idl_headers_2.1", "header": { -- Gitee From 12696a91a91c363049245b402fdaaaf241132b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Mon, 18 Nov 2024 11:33:07 +0800 Subject: [PATCH 219/347] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- display/composer/v1_2/DisplayComposerType.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index fd909b32..325f4b36 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -66,6 +66,7 @@ enum BufferUsage : ohos.hdi.display.composer.v1_0.BufferUsage { HBM_USE_AUXILLARY_BUFFER2 = (1ULL << 22), /**< combine with main usage for specific meta feature */ HBM_USE_AUXILLARY_BUFFER3 = (1ULL << 23), /**< combine with main usage for specific meta feature */ HBM_USE_VIDEO_DEC_MV = HBM_USE_VIDEO_DECODER | HBM_USE_AUXILLARY_BUFFER2, /**< ref to VIDEO_DEC */ + HBM_USE_DRM_REDRAW = (1ULL << 24), /**< For DRM redraw framebuffer allocate */ }; -- Gitee From 16eff1ca259aa0bc9e2656d14cce8cd17fdb7454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=B0?= Date: Tue, 19 Nov 2024 06:21:22 +0000 Subject: [PATCH 220/347] =?UTF-8?q?=E4=BF=AE=E6=94=B9capacity=E7=9A=84?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘丰 --- camera/metadata/include/camera_metadata_operator.h | 1 + camera/metadata/include/metadata_utils.h | 1 + camera/metadata/src/camera_metadata_info.cpp | 2 +- camera/metadata/src/metadata_utils.cpp | 6 ++++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_metadata_operator.h b/camera/metadata/include/camera_metadata_operator.h index 2684822f..396a7107 100644 --- a/camera/metadata/include/camera_metadata_operator.h +++ b/camera/metadata/include/camera_metadata_operator.h @@ -33,6 +33,7 @@ #define INDEX_COUNTER 2 #define WRAP_LENGTH 4 +#define ENTRY_DATA_SIZE 4 // data type enum { diff --git a/camera/metadata/include/metadata_utils.h b/camera/metadata/include/metadata_utils.h index e0203426..0c33995d 100644 --- a/camera/metadata/include/metadata_utils.h +++ b/camera/metadata/include/metadata_utils.h @@ -23,6 +23,7 @@ #include "camera_metadata_info.h" #include "message_parcel.h" +#include "camera_metadata_item_info.h" namespace OHOS::Camera { class MetadataUtils { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 12f9fb55..3d493558 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -854,7 +854,7 @@ int CameraMetadata::GetCameraMetadataItem(const common_metadata_header_t *src, u METADATA_ERR_LOG("GetCameraMetadataItem: memset_s failed"); return CAM_META_FAILURE; } - if (index >= src->item_count) { + if (index >= src->item_count || index >= src->item_capacity) { METADATA_ERR_LOG("GetCameraMetadataItem index is greater than item count"); return CAM_META_INVALID_PARAM; } diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index 60716f2e..34738c63 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -106,6 +106,12 @@ bool MetadataUtils::ConvertMetadataToVec(const std::shared_ptr & item.count, item.item); return false; } + uint32_t dataPayloadBytes = item.count * OHOS_CAMERA_METADATA_TYPE_SIZE[item.data_type]; + if (item.count > ENTRY_DATA_SIZE && + ((item.data.u8 + dataPayloadBytes) > (GetMetadataData(meta) + dataCapacity))) { + METADATA_ERR_LOG("ConvertMetadataToVec get meta item failed!"); + return false; + } WriteMetadataDataToVec(item, cameraAbility); } return true; -- Gitee From 76653ca12d0c5f29d6de5602aae8f8f4ccf978e5 Mon Sep 17 00:00:00 2001 From: sqwlly Date: Wed, 20 Nov 2024 11:20:46 +0000 Subject: [PATCH 221/347] add buffer handle external deps Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: Ib1dbe3e2ab8483566db05753bfc57e3aa8f268fc --- camera/sequenceable/buffer_handle/BUILD.gn | 1 + camera/sequenceable/buffer_producer/BUILD.gn | 1 + camera/v1_0/BUILD.gn | 5 ++++- camera/v1_1/BUILD.gn | 5 ++++- camera/v1_2/BUILD.gn | 5 ++++- camera/v1_3/BUILD.gn | 5 ++++- face_auth/v2_0/BUILD.gn | 1 + 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/camera/sequenceable/buffer_handle/BUILD.gn b/camera/sequenceable/buffer_handle/BUILD.gn index 25e7343f..44d59103 100644 --- a/camera/sequenceable/buffer_handle/BUILD.gn +++ b/camera/sequenceable/buffer_handle/BUILD.gn @@ -34,6 +34,7 @@ ohos_shared_library("libbuffer_handle_sequenceable_1.0") { "hilog:libhilog", "ipc:ipc_single", ] + public_external_deps = [ "graphic_surface:buffer_handle" ] cflags_cc = [ "-fstack-protector-strong" ] ldflags = [ "-s" ] if (drivers_interface_camera_feature_coverage) { diff --git a/camera/sequenceable/buffer_producer/BUILD.gn b/camera/sequenceable/buffer_producer/BUILD.gn index b4559322..3014dffd 100644 --- a/camera/sequenceable/buffer_producer/BUILD.gn +++ b/camera/sequenceable/buffer_producer/BUILD.gn @@ -35,6 +35,7 @@ ohos_shared_library("libbuffer_producer_sequenceable_1.0") { "hilog:libhilog", "ipc:ipc_single", ] + public_external_deps = [ "graphic_surface:buffer_handle" ] cflags_cc = [ "-fstack-protector-strong" ] ldflags = [ "-s" ] if (drivers_interface_camera_feature_coverage) { diff --git a/camera/v1_0/BUILD.gn b/camera/v1_0/BUILD.gn index 7e15fc2d..b3b14430 100644 --- a/camera/v1_0/BUILD.gn +++ b/camera/v1_0/BUILD.gn @@ -35,7 +35,10 @@ if (defined(ohos_lite)) { sequenceable_pub_deps = [ "../sequenceable/buffer_producer:libbuffer_producer_sequenceable_1.0", ] - sequenceable_ext_deps = [ "graphic_surface:surface" ] + sequenceable_ext_deps = [ + "graphic_surface:buffer_handle", + "graphic_surface:surface", + ] language = "cpp" subsystem_name = "hdf" diff --git a/camera/v1_1/BUILD.gn b/camera/v1_1/BUILD.gn index 0635d066..f90c2bc8 100644 --- a/camera/v1_1/BUILD.gn +++ b/camera/v1_1/BUILD.gn @@ -32,7 +32,10 @@ if (defined(ohos_lite)) { sequenceable_pub_deps = [ "../sequenceable/buffer_producer:libbuffer_producer_sequenceable_1.0", ] - sequenceable_ext_deps = [ "graphic_surface:surface" ] + sequenceable_ext_deps = [ + "graphic_surface:buffer_handle", + "graphic_surface:surface", + ] language = "cpp" subsystem_name = "hdf" diff --git a/camera/v1_2/BUILD.gn b/camera/v1_2/BUILD.gn index 6ebf316c..f0bed38e 100644 --- a/camera/v1_2/BUILD.gn +++ b/camera/v1_2/BUILD.gn @@ -39,7 +39,10 @@ if (defined(ohos_lite)) { "../sequenceable/buffer_producer:libbuffer_producer_sequenceable_1.0", "../sequenceable/map_data:libmap_data_sequenceable_1.0", ] - sequenceable_ext_deps = [ "graphic_surface:surface" ] + sequenceable_ext_deps = [ + "graphic_surface:buffer_handle", + "graphic_surface:surface", + ] language = "cpp" subsystem_name = "hdf" diff --git a/camera/v1_3/BUILD.gn b/camera/v1_3/BUILD.gn index 2423a4c8..043b0ad4 100644 --- a/camera/v1_3/BUILD.gn +++ b/camera/v1_3/BUILD.gn @@ -40,7 +40,10 @@ if (defined(ohos_lite)) { "../sequenceable/buffer_producer:libbuffer_producer_sequenceable_1.0", "../sequenceable/map_data:libmap_data_sequenceable_1.0", ] - sequenceable_ext_deps = [ "graphic_surface:surface" ] + sequenceable_ext_deps = [ + "graphic_surface:buffer_handle", + "graphic_surface:surface", + ] language = "cpp" subsystem_name = "hdf" diff --git a/face_auth/v2_0/BUILD.gn b/face_auth/v2_0/BUILD.gn index 37dc0214..aff79696 100644 --- a/face_auth/v2_0/BUILD.gn +++ b/face_auth/v2_0/BUILD.gn @@ -25,6 +25,7 @@ hdi("face_auth") { ] sequenceable_ext_deps = [ "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", + "graphic_surface:buffer_handle", "graphic_surface:surface", ] language = "cpp" -- Gitee From 66189b8e5e63c1675954ea51062c7787bff858ad Mon Sep 17 00:00:00 2001 From: yangkan Date: Thu, 21 Nov 2024 17:13:01 +0800 Subject: [PATCH 222/347] =?UTF-8?q?=E4=BF=AE=E6=94=B9matchfd=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- display/composer/v1_0/display_command/display_cmd_utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_0/display_command/display_cmd_utils.h b/display/composer/v1_0/display_command/display_cmd_utils.h index 37da5ebc..f9c1f763 100644 --- a/display/composer/v1_0/display_command/display_cmd_utils.h +++ b/display/composer/v1_0/display_command/display_cmd_utils.h @@ -272,11 +272,16 @@ public: int32_t fdId = -1; DISPLAY_CHK_RETURN(unpacker.ReadInt32(fdId) == false, HDF_FAILURE, HDF_LOGE("%{public}s, read fdId failed", __func__)); - if (fdId < 0 || MatchHdiFd(fdId, hdiFds, fd) == false) { + if (fdId < 0) { + fd = INVALID_FD; + return HDF_SUCCESS; + } + if (!(MatchHdiFd(fdId, hdiFds, fd))) { // If matching failure, the illegal fd is transfered by smq directly, not by binder IPC. HDF_LOGE("%{public}s, matching failure, fd %{public}d, fdId %{public}d, hdiFds.size %{public}zu", __func__, fd, fdId, hdiFds.size()); fd = INVALID_FD; + return HDF_FAILURE; } return HDF_SUCCESS; } -- Gitee From 4c25712df59cbf643d7082ecf007b99b4b749663 Mon Sep 17 00:00:00 2001 From: zhjs Date: Fri, 22 Nov 2024 14:14:39 +0800 Subject: [PATCH 223/347] add dependency Signed-off-by: zhjs --- display/graphic/common/v2_1/BUILD.gn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/display/graphic/common/v2_1/BUILD.gn b/display/graphic/common/v2_1/BUILD.gn index ed24c812..3dc0b995 100644 --- a/display/graphic/common/v2_1/BUILD.gn +++ b/display/graphic/common/v2_1/BUILD.gn @@ -16,6 +16,11 @@ import("//build/config/components/hdi/hdi.gni") hdi("display_commontype") { module_name = "display_commontype" + deps = [ + "//drivers/interface/display/graphic/common/v2_0:libdisplay_commontype_proxy_2.0", + "//drivers/interface/display/graphic/common/v2_0:libdisplay_commontype_stub_2.0", + ] + sources = [ "CMColorSpace.idl" ] language = "cpp" -- Gitee From 675172466ba8cf993c8c26e346468326105f6c43 Mon Sep 17 00:00:00 2001 From: yangkan Date: Fri, 22 Nov 2024 16:39:45 +0800 Subject: [PATCH 224/347] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B9=B3=E5=8F=B0=E9=94=99=E8=AF=AF=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- .../v1_2/display_command/display_cmd_responser.h | 9 ++++++--- 1 file changed, 6 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 3cc4cdf6..ab3735ac 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -291,10 +291,13 @@ REPLY: ret = unpacker.ReadUint32(type) ? HDF_SUCCESS : HDF_FAILURE; DISPLAY_CHECK(ret != HDF_SUCCESS, goto EXIT); - DISPLAY_CHECK(impl_ == nullptr || impl_->SetDisplayConstraint == nullptr, goto EXIT); - ret = impl_->SetDisplayConstraint(devId, frameID, ns, type); + if (impl_ != nullptr && impl_->SetDisplayConstraint != nullptr) { + ret = impl_->SetDisplayConstraint(devId, frameID, ns, type); + } - DISPLAY_CHECK(ret != HDF_SUCCESS && ret != DISPLAY_NOT_SUPPORT && ret != HDF_ERR_NOT_SUPPORT, goto EXIT); + if (ret != HDF_SUCCESS && ret != DISPLAY_NOT_SUPPORT && ret != HDF_ERR_NOT_SUPPORT) { + HDF_LOGE("SetDisplayConstraint failed with ret = %{public}d", ret); + } EXIT: if (ret != HDF_SUCCESS) { errMaps_.emplace(REQUEST_CMD_SET_DISPLAY_CONSTRAINT, ret); -- Gitee From d52f3c1ff84bd9aac22537e95b52b2960322264f Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Sat, 23 Nov 2024 10:33:18 +0800 Subject: [PATCH 225/347] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=9A=E4=B8=BE?= 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 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index c1049edc..7a1d9f0f 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -2664,4 +2664,36 @@ enum CameraVideoRotationSupportedType { OHOS_CAMERA_VIDEO_ROTATION_SUPPORTED, }; +// OHOS_ABILITY_SUN_BLOCK_PREVIEW_TYPES +// OHOS_CONTROL_SUN_BLOCK_PREVIEW_TYPE +enum CameraSunBlockPreviewType { + OHOS_PREVIEW_TYPE_NOT_SUPPORTED = 0, + OHOS_PREVIEW_TYPE_RGB, + OHOS_PREVIEW_TYPE_UV, + OHOS_PREVIEW_TYPE_RGB_UV, +}; + +// OHOS_ABILITY_SUN_BLOCK_BLEND_COLORS +// OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR +enum CameraSunBlockBlendColor { + OHOS_BLEND_COLOR_NOT_SUPPORTED = 0, + OHOS_BLEND_COLOR_NONE = 0, + OHOS_BLEND_COLOR_PURPLE = 1, + OHOS_BLEND_COLOR_SILVER = 2, + OHOS_BLEND_COLOR_GOLD = 3, +}; + +// OHOS_STATUS_SUN_BLOCK_HINT +enum CameraSunBlockHint { + OHOS_HINT_NO_FACE_DETECTED = 2, + OHOS_HINT_FACE_OUT_OF_BOUND = 3, + OHOS_HINT_MOBILEPHONE_TOO_FAR = 4, + OHOS_HINT_MOBILEPHONE_TOO_NEAR = 5, + OHOS_HINT_FACE_TOO_RIGHT = 6, + OHOS_HINT_FACE_TOO_LEFT = 7, + OHOS_HINT_FACE_TOO_LOWER = 8, + OHOS_HINT_FACE_TOO_TOP = 9, + OHOS_HINT_SUNSCREEN_NO_FULL_COVERAGE = 20, +}; + #endif -- Gitee From 0dfc7b0233631d661f2415c7b450b9fc5bc72aa1 Mon Sep 17 00:00:00 2001 From: pxd2022 Date: Sat, 23 Nov 2024 11:26:11 +0800 Subject: [PATCH 226/347] fix free bug Signed-off-by: pxd2022 --- display/composer/cache_manager/cache_manager.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/display/composer/cache_manager/cache_manager.h b/display/composer/cache_manager/cache_manager.h index 239b144d..51f95f58 100644 --- a/display/composer/cache_manager/cache_manager.h +++ b/display/composer/cache_manager/cache_manager.h @@ -85,6 +85,9 @@ public: auto cacheItem = caches_.find(id); if (cacheItem != caches_.end()) { HDF_LOGI("%{public}s: intend to insert a existing cache, SeqNo=%{public}d", __func__, id); + if (cleanUpFunc_ && cacheItem->second != nullptr) { + cleanUpFunc_(cacheItem->second); + } cacheItem->second.reset(cache); } else { if (cacheCountMax_ != 0 && caches_.size() >= cacheCountMax_) { @@ -201,6 +204,9 @@ public: auto cacheItem = caches_.find(id); if (cacheItem != caches_.end()) { HDF_LOGI("%{public}s: intend to insert a existing cache, SeqNo=%{public}d", __func__, id); + if (cleanUpFunc_ && cacheItem->second != nullptr) { + cleanUpFunc_(cacheItem->second); + } cacheItem->second = OHOS::sptr(cache); } else { if (cacheCountMax_ != 0 && caches_.size() >= cacheCountMax_) { -- Gitee From 74613a0069a919fe7f2a98b4ce9329904be9a101 Mon Sep 17 00:00:00 2001 From: xuxuehai Date: Mon, 25 Nov 2024 11:09:09 +0800 Subject: [PATCH 227/347] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B7=AE=E5=BC=82?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuxuehai --- audio/bundle.json | 5 ++++- audio/v1_0/AudioTypes.idl | 1 - audio/v1_0/IAudioAdapter.idl | 1 - audio/v1_0/IAudioCallback.idl | 1 - audio/v1_0/IAudioCapture.idl | 1 - audio/v1_0/IAudioManager.idl | 1 - audio/v1_0/IAudioRender.idl | 1 - audio/v2_0/AudioTypes.idl | 3 +-- audio/v2_0/IAudioAdapter.idl | 1 - audio/v2_0/IAudioCallback.idl | 1 - audio/v2_0/IAudioCapture.idl | 1 - audio/v2_0/IAudioManager.idl | 1 - audio/v2_0/IAudioRender.idl | 1 - audio/v3_0/AudioTypes.idl | 1 - audio/v3_0/IAudioAdapter.idl | 1 - audio/v3_0/IAudioCallback.idl | 1 - audio/v3_0/IAudioCapture.idl | 1 - audio/v3_0/IAudioManager.idl | 1 - audio/v3_0/IAudioRender.idl | 1 - audio/v4_0/AudioTypes.idl | 1 - audio/v4_0/IAudioAdapter.idl | 1 - audio/v4_0/IAudioCallback.idl | 1 - audio/v4_0/IAudioCapture.idl | 1 - audio/v4_0/IAudioManager.idl | 1 - audio/v4_0/IAudioRender.idl | 1 - 25 files changed, 5 insertions(+), 26 deletions(-) diff --git a/audio/bundle.json b/audio/bundle.json index 628cd2e9..6dd6f4e7 100644 --- a/audio/bundle.json +++ b/audio/bundle.json @@ -12,7 +12,10 @@ "component": { "name": "drivers_interface_audio", "subsystem": "hdf", - "adapted_system_type": ["standard"], + "adapted_system_type": [ + "small", + "standard" + ], "rom": "675KB", "ram": "1024KB", "deps": { diff --git a/audio/v1_0/AudioTypes.idl b/audio/v1_0/AudioTypes.idl index 30132567..fa171d32 100644 --- a/audio/v1_0/AudioTypes.idl +++ b/audio/v1_0/AudioTypes.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioAdapter.idl b/audio/v1_0/IAudioAdapter.idl index 4f21ddf4..cbc3bcf1 100644 --- a/audio/v1_0/IAudioAdapter.idl +++ b/audio/v1_0/IAudioAdapter.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioCallback.idl b/audio/v1_0/IAudioCallback.idl index 65f417d8..d030c2e1 100644 --- a/audio/v1_0/IAudioCallback.idl +++ b/audio/v1_0/IAudioCallback.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioCapture.idl b/audio/v1_0/IAudioCapture.idl index 1e1882fa..0f447862 100644 --- a/audio/v1_0/IAudioCapture.idl +++ b/audio/v1_0/IAudioCapture.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioManager.idl b/audio/v1_0/IAudioManager.idl index cd0478e3..8ea83c8f 100644 --- a/audio/v1_0/IAudioManager.idl +++ b/audio/v1_0/IAudioManager.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v1_0/IAudioRender.idl b/audio/v1_0/IAudioRender.idl index 2cd3e0bc..edb991e3 100644 --- a/audio/v1_0/IAudioRender.idl +++ b/audio/v1_0/IAudioRender.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/AudioTypes.idl b/audio/v2_0/AudioTypes.idl index cc69880b..befdc31e 100644 --- a/audio/v2_0/AudioTypes.idl +++ b/audio/v2_0/AudioTypes.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * @@ -366,7 +365,7 @@ enum AudioInputType { */ struct AudioOffloadInfo { - unsigned int sampleRate; /**< Audio sampling rate */ + unsigned int sampleRate; /**< Audio sampling rate */ unsigned int channelCount; /**< Number of audio channels */ unsigned long channelLayout; /**< Audio channel layout */ unsigned int bitRate; /**< bitRate of compressed audio data */ diff --git a/audio/v2_0/IAudioAdapter.idl b/audio/v2_0/IAudioAdapter.idl index 1f7be416..2db00c46 100644 --- a/audio/v2_0/IAudioAdapter.idl +++ b/audio/v2_0/IAudioAdapter.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioCallback.idl b/audio/v2_0/IAudioCallback.idl index 166f158f..7b88c890 100644 --- a/audio/v2_0/IAudioCallback.idl +++ b/audio/v2_0/IAudioCallback.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioCapture.idl b/audio/v2_0/IAudioCapture.idl index b7e0a5a6..1e13e1d3 100644 --- a/audio/v2_0/IAudioCapture.idl +++ b/audio/v2_0/IAudioCapture.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioManager.idl b/audio/v2_0/IAudioManager.idl index 20949a3d..85ada7fe 100644 --- a/audio/v2_0/IAudioManager.idl +++ b/audio/v2_0/IAudioManager.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v2_0/IAudioRender.idl b/audio/v2_0/IAudioRender.idl index a6c7899b..588a1fce 100644 --- a/audio/v2_0/IAudioRender.idl +++ b/audio/v2_0/IAudioRender.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/AudioTypes.idl b/audio/v3_0/AudioTypes.idl index a66797f0..df539133 100644 --- a/audio/v3_0/AudioTypes.idl +++ b/audio/v3_0/AudioTypes.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioAdapter.idl b/audio/v3_0/IAudioAdapter.idl index ef54637b..85f5b75f 100644 --- a/audio/v3_0/IAudioAdapter.idl +++ b/audio/v3_0/IAudioAdapter.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioCallback.idl b/audio/v3_0/IAudioCallback.idl index 256c1e34..bae07091 100644 --- a/audio/v3_0/IAudioCallback.idl +++ b/audio/v3_0/IAudioCallback.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioCapture.idl b/audio/v3_0/IAudioCapture.idl index 2e85f717..c0347732 100644 --- a/audio/v3_0/IAudioCapture.idl +++ b/audio/v3_0/IAudioCapture.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioManager.idl b/audio/v3_0/IAudioManager.idl index 94af7022..a954c9f2 100644 --- a/audio/v3_0/IAudioManager.idl +++ b/audio/v3_0/IAudioManager.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v3_0/IAudioRender.idl b/audio/v3_0/IAudioRender.idl index 691215d5..f27a5e75 100644 --- a/audio/v3_0/IAudioRender.idl +++ b/audio/v3_0/IAudioRender.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index f2ed451b..e57082a3 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioAdapter.idl b/audio/v4_0/IAudioAdapter.idl index f2ff1e07..1145659b 100644 --- a/audio/v4_0/IAudioAdapter.idl +++ b/audio/v4_0/IAudioAdapter.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioCallback.idl b/audio/v4_0/IAudioCallback.idl index 87ee7d9f..c6d734e3 100644 --- a/audio/v4_0/IAudioCallback.idl +++ b/audio/v4_0/IAudioCallback.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioCapture.idl b/audio/v4_0/IAudioCapture.idl index b812a374..aa9954ed 100644 --- a/audio/v4_0/IAudioCapture.idl +++ b/audio/v4_0/IAudioCapture.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioManager.idl b/audio/v4_0/IAudioManager.idl index fb5bb894..56e54b2b 100644 --- a/audio/v4_0/IAudioManager.idl +++ b/audio/v4_0/IAudioManager.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * diff --git a/audio/v4_0/IAudioRender.idl b/audio/v4_0/IAudioRender.idl index 8a28327f..b38bd64b 100644 --- a/audio/v4_0/IAudioRender.idl +++ b/audio/v4_0/IAudioRender.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiAudio - * @ * * @brief Provides unified APIs for audio services to access audio drivers. * -- Gitee From 81cf1860e88a0f8ecca14345c8e99cf31afe4fbd Mon Sep 17 00:00:00 2001 From: Sxs Date: Mon, 25 Nov 2024 06:28:22 +0000 Subject: [PATCH 228/347] update codec/v3_0/CodecTypes.idl. add feature isSupportSeekWithoutFlush Signed-off-by: Sxs --- codec/v3_0/CodecTypes.idl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codec/v3_0/CodecTypes.idl b/codec/v3_0/CodecTypes.idl index 8c3fe41f..4f8b8e8f 100644 --- a/codec/v3_0/CodecTypes.idl +++ b/codec/v3_0/CodecTypes.idl @@ -324,7 +324,7 @@ struct RangeValue { * @brief Defines the video encoding and decoding capabilities. * @since 4.1 - * @version 5.0 + * @version 6.0 */ struct CodecVideoPortCap { struct Rect minSize; /**< Minimum resolution supported. */ @@ -346,6 +346,7 @@ struct CodecVideoPortCap { int maxLTRFrameNum; /**< Maximum long-term reference frame numbers supported */ boolean isSupportWaterMark; /**< Whether supports WaterMark feature */ boolean isSupportQPMap; /**< Whether supports frame qp map feature */ + boolean isSupportSeekWithoutFlush; /**< Whether supports seek without flush feature */ }; /** -- Gitee From cac793b1e232a463b7032271591575c3a61a048b Mon Sep 17 00:00:00 2001 From: chen0088 Date: Mon, 25 Nov 2024 17:14:55 +0800 Subject: [PATCH 229/347] modify Signed-off-by: chen0088 --- distributed_camera/bundle.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/distributed_camera/bundle.json b/distributed_camera/bundle.json index 90cb385a..d6f5e70f 100644 --- a/distributed_camera/bundle.json +++ b/distributed_camera/bundle.json @@ -22,8 +22,7 @@ "hdf_core", "hilog", "c_utils" - ], - "third_party": [] + ] }, "build": { "sub_component": [ -- Gitee From 69171dc101abc98f0e41635a08feaca9c06b0d8d Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 27 Nov 2024 14:10:20 +0800 Subject: [PATCH 230/347] =?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 ++++-- 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 ec1f15c6..478c1850 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -855,8 +855,10 @@ EXIT: " seqNo:" + std::to_string(data.seqNo); } traceMsg += " fd:" + std::to_string(fd); - if (data.fence > ERROR_FENCE_COUNT) { - HDF_LOGI("SetLayerBuffer: %{public}s", traceMsg.c_str()); + if (data.fence > ERROR_FENCE_COUNT || fd > ERROR_FENCE_COUNT || handle.fd > ERROR_FENCE_COUNT) { + HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", + data.buffer == nullptr ? "data.buffer is nullptr!" : "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, + data.seqNo, handle.fd, fd); } HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; -- Gitee From 9a5b14d6b45eb0c2e181df53d8e1e30be7228b29 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 27 Nov 2024 06:28:15 +0000 Subject: [PATCH 231/347] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 5 +++-- 1 file changed, 3 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 478c1850..296c55d1 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -856,8 +856,9 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); if (data.fence > ERROR_FENCE_COUNT || fd > ERROR_FENCE_COUNT || handle.fd > ERROR_FENCE_COUNT) { - HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", - data.buffer == nullptr ? "data.buffer is nullptr!" : "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, + HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, data.buffer->fd:%{public}d, + data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", data.buffer == nullptr ? "data.buffer is nullptr!" : + "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); } HdfTrace traceVdi("SetLayerBuffer", traceMsg); -- Gitee From e6e85169200cb88fe84ba2e8ac48cc154d0149b4 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 27 Nov 2024 06:32:11 +0000 Subject: [PATCH 232/347] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 7 ++++--- 1 file changed, 4 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 296c55d1..314ba413 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -856,9 +856,10 @@ EXIT: } traceMsg += " fd:" + std::to_string(fd); if (data.fence > ERROR_FENCE_COUNT || fd > ERROR_FENCE_COUNT || handle.fd > ERROR_FENCE_COUNT) { - HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, data.buffer->fd:%{public}d, - data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", data.buffer == nullptr ? "data.buffer is nullptr!" : - "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, + HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, " + "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", + data.buffer == nullptr ? "data.buffer is nullptr!" : "", + data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); } HdfTrace traceVdi("SetLayerBuffer", traceMsg); -- Gitee From 69cd15b82df876fc329aac624831e40d3df8523a Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 27 Nov 2024 06:40:07 +0000 Subject: [PATCH 233/347] 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 314ba413..9455a07a 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -857,8 +857,8 @@ EXIT: traceMsg += " fd:" + std::to_string(fd); if (data.fence > ERROR_FENCE_COUNT || fd > ERROR_FENCE_COUNT || handle.fd > ERROR_FENCE_COUNT) { HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, " - "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", - data.buffer == nullptr ? "data.buffer is nullptr!" : "", + "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", + data.buffer == nullptr ? "data.buffer is nullptr!" : "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); } -- Gitee From f474d81b29ca1958b91d2e4dde197d6e06f0d589 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 27 Nov 2024 06:50:54 +0000 Subject: [PATCH 234/347] update display/composer/v1_0/display_command/display_cmd_responser.h. Signed-off-by: l60050612 --- .../composer/v1_0/display_command/display_cmd_responser.h | 8 ++++---- 1 file changed, 4 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 9455a07a..ee77cd04 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -857,10 +857,10 @@ EXIT: traceMsg += " fd:" + std::to_string(fd); if (data.fence > ERROR_FENCE_COUNT || fd > ERROR_FENCE_COUNT || handle.fd > ERROR_FENCE_COUNT) { HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, " - "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", - data.buffer == nullptr ? "data.buffer is nullptr!" : "", - data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, - data.seqNo, handle.fd, fd); + "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", + data.buffer == nullptr ? "data.buffer is nullptr!" : "", + data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, + data.seqNo, handle.fd, fd); } HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; -- Gitee From 82224c2a4a0da322eac9f3e116bc16e1fbe6b300 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Wed, 27 Nov 2024 07:35:52 +0000 Subject: [PATCH 235/347] 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, 1 insertion(+), 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 ee77cd04..76304acb 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -859,8 +859,7 @@ EXIT: HDF_LOGI("SetLayerBuffer: %{public}s data.devId: %{public}d data.layerId: %{public}d, " "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", data.buffer == nullptr ? "data.buffer is nullptr!" : "", - data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, - data.seqNo, handle.fd, fd); + data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); } HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; -- Gitee From 947668be1273f49e05a2bbed721ca0cd839bf7d7 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 17:46:27 +0800 Subject: [PATCH 236/347] fix Signed-off-by: liuziwei --- user_auth/bundle.json | 10 +- user_auth/v3_0/BUILD.gn | 27 ++ user_auth/v3_0/IMessageCallback.idl | 59 +++ user_auth/v3_0/IUserAuthInterface.idl | 528 ++++++++++++++++++++++++ user_auth/v3_0/UserAuthTypes.idl | 572 ++++++++++++++++++++++++++ 5 files changed, 1191 insertions(+), 5 deletions(-) create mode 100644 user_auth/v3_0/BUILD.gn create mode 100644 user_auth/v3_0/IMessageCallback.idl create mode 100644 user_auth/v3_0/IUserAuthInterface.idl create mode 100644 user_auth/v3_0/UserAuthTypes.idl diff --git a/user_auth/bundle.json b/user_auth/bundle.json index 76397b4e..4855a810 100644 --- a/user_auth/bundle.json +++ b/user_auth/bundle.json @@ -1,7 +1,7 @@ { "name":"@ohos/drivers_interface_user_auth", "description":"user_auth device driver", - "version":"5.0", + "version":"5.1", "license":"Apache License 2.0", "publishAs":"code-segment", "segment":{ @@ -35,14 +35,14 @@ }, "build":{ "sub_component":[ - "//drivers/interface/user_auth/v2_0:user_auth_idl_target" + "//drivers/interface/user_auth/v3_0:user_auth_idl_target" ], "test":[ ], "inner_kits":[ { - "name":"//drivers/interface/user_auth/v2_0:libuser_auth_proxy_2.0", + "name":"//drivers/interface/user_auth/v3_0:libuser_auth_proxy_3.0", "header":{ "header_files":[ @@ -51,7 +51,7 @@ } }, { - "name":"//drivers/interface/user_auth/v2_0:user_auth_idl_headers", + "name":"//drivers/interface/user_auth/v3_0:user_auth_idl_headers", "header":{ "header_files":[ @@ -60,7 +60,7 @@ } }, { - "name":"//drivers/interface/user_auth/v2_0:libuser_auth_stub_2.0", + "name":"//drivers/interface/user_auth/v3_0:libuser_auth_stub_3.0", "header":{ "header_files":[ diff --git a/user_auth/v3_0/BUILD.gn b/user_auth/v3_0/BUILD.gn new file mode 100644 index 00000000..093bd01b --- /dev/null +++ b/user_auth/v3_0/BUILD.gn @@ -0,0 +1,27 @@ +# 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("//build/config/components/hdi/hdi.gni") +import("../config.gni") + +hdi("user_auth") { + module_name = "drivers_peripheral_user_auth" + sources = [ + "IMessageCallback.idl", + "IUserAuthInterface.idl", + "UserAuthTypes.idl", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_user_auth" +} diff --git a/user_auth/v3_0/IMessageCallback.idl b/user_auth/v3_0/IMessageCallback.idl new file mode 100644 index 00000000..83d48783 --- /dev/null +++ b/user_auth/v3_0/IMessageCallback.idl @@ -0,0 +1,59 @@ +/* + * 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 HdfUserAuth + * @{ + * + * @brief Provides APIs for the user_auth driver. + * + * The user_auth driver provides a unified interface for the user_auth service to access the user_auth driver. + * After obtaining the user_auth driver proxy, the service can call related APIs to register executors, + * manage credentials, and complete password and biometric authentication. + * @since 5.0 + * @version 1.0 + */ + +/** + * @file IMessageCallback.idl + * + * @brief Defines the callback for an async API, which can be used to send message to framework. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.user_auth.v3_0; + +/** + * @brief Defines the callback for an async API, which can be used to send message to framework. + * + * @since 5.0 + * @version 1.0 + */ +[callback] interface IMessageCallback { + /** + * @brief Defines the function for reporting message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param destRole is the role of destination. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + OnMessage([in] unsigned long scheduleId, [in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/user_auth/v3_0/IUserAuthInterface.idl b/user_auth/v3_0/IUserAuthInterface.idl new file mode 100644 index 00000000..149f3824 --- /dev/null +++ b/user_auth/v3_0/IUserAuthInterface.idl @@ -0,0 +1,528 @@ +/* + * 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 HdfUserAuth + * @{ + * + * @brief Provides APIs for the user_auth driver. + * + * The user_auth driver provides a unified interface for the user_auth service to access the user_auth driver. + * After obtaining the user_auth driver proxy, the service can call related APIs to register executors, + * manage credentials, and complete password and biometric authentication. + * @since 3.2 + * @version 1.0 + */ + +/** + * @file IUserAuthInterface.idl + * + * @brief Declares the user_auth driver APIs, which can be used to register executors, + * manage credentials, and complete password and biometric authentication. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.user_auth.v3_0; + +import ohos.hdi.user_auth.v3_0.UserAuthTypes; +import ohos.hdi.user_auth.v3_0.IMessageCallback; + +/** + * @brief Declares the APIs of the user_auth driver. + * + * @since 3.2 + * @version 1.0 + */ +interface IUserAuthInterface { + /** + * @brief Initializes the cache information of the user_auth driver. + * + * @param deviceUdid Indicates the device udid. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + Init([in] String deviceUdid); + /** + * @brief Adds an authentication executor to obtain the authentication capability. + * + * @param info Indicates executor registration information. See {@link ExecutorRegisterInfo}. + * @param index Indicates the executor index under the authentication framework. + * @param publicKey Indicates the public key of the authentication framework. + * @param templateIds Indicates template IDs enrolled by the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + AddExecutor([in] struct ExecutorRegisterInfo info, [out] unsigned long index, + [out] unsigned char[] publicKey, [out] unsigned long[] templateIds); + /** + * @brief Deletes an executor. + * + * @param index Indicates the executor index under the authentication framework. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + DeleteExecutor([in] unsigned long index); + /** + * @brief Opens a session for authentication credential management. + * + * @param userId Indicates the user ID. + * @param challenge Indicates the random number, which is used to generate an authentication token. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + OpenSession([in] int userId, [out] unsigned char[] challenge); + /** + * @brief Closes the authentication credential management session. + * + * @param userId Indicates the user ID. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + CloseSession([in] int userId); + /** + * @brief Updates the enrollment result and completes the enrollment. + * + * @param userId Indicates the user ID. + * @param scheduleResult Indicates the enrollment result issued by the executor. + * @param info Indicates the enrollment result. See {@link EnrollResultInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + UpdateEnrollmentResult([in] int userId, [in] unsigned char[] scheduleResult, [out] struct EnrollResultInfo info); + /** + * @brief Cancels an enrollment. + * + * @param userId Indicates the user ID. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + CancelEnrollment([in] int userId); + /** + * @brief Deletes credential information. + * + * @param userId Indicates the user ID. + * @param credentialId Indicates the credential index. + * @param authToken Indicates the authentication token of the user password. + * @param info Indicates the credential information to delete. See {@link CredentialInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + DeleteCredential([in] int userId, [in] unsigned long credentialId, [in] unsigned char[] authToken, + [out] struct CredentialInfo info); + /** + * @brief Obtains credential information. + * + * @param userId Indicates the user ID. + * @param authType Indicates the authentication type. See {@link AuthType}. + * @param infos Indicates credential information. See {@link CredentialInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetCredential([in] int userId, [in] int authType, [out] struct CredentialInfo[] infos); + /** + * @brief Obtains user information. + * + * @param userId Indicates the user ID. + * @param secureUid Indicates the secure user ID. + * @param pinSubType Indicates the sub type of PIN authentication. See {@link PinSubType}. + * @param infos Indicates enrolled information. See {@link EnrolledInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetUserInfo([in] int userId, [out] unsigned long secureUid, [out] int pinSubType, + [out] struct EnrolledInfo[] infos); + /** + * @brief Deletes a pin and a user from the IAM subsystem. + * + * @param userId Indicates the user ID. + * @param authToken Indicates the authentication token of the user password. + * @param deletedInfos Indicates the credential information to delete. See {@link CredentialInfo}. + * @param rootSecret protection key for the user file key. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + DeleteUser([in] int userId, [in] unsigned char[] authToken, [out] struct CredentialInfo[] deletedInfos, + [out] unsigned char[] rootSecret); + /** + * @brief Forcibly deletes a user. + * + * @param userId Indicates the user ID. + * @param deletedInfos Indicates the credential information to delete. See {@link CredentialInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + EnforceDeleteUser([in] int userId, [out] struct CredentialInfo[] deletedInfos); + /** + * @brief Updates the authentication result, and evaluates the result of the authentication solution. + * + * @param contextId Indicates the context index. + * @param scheduleResult Indicates the authentication result issued by the executor. + * @param info Indicates authentication result information. See {@link AuthResultInfo}. + * @param enrolledState EnrolledID information. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + UpdateAuthenticationResult([in] unsigned long contextId, [in] unsigned char[] scheduleResult, + [out] struct AuthResultInfo info, [out] EnrolledState enrolledState); + /** + * @brief Cancels authentication. + * + * @param contextId Indicates the context index. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + CancelAuthentication([in] unsigned long contextId); + /** + * @brief Updates the identification result, and evaluates the result of the identification solution. + * + * @param contextId Indicates the context index. + * @param scheduleResult Indicates the identification result issued by the executor. + * @param info Indicates identification result information. See {@link IdentifyResultInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + UpdateIdentificationResult([in] unsigned long contextId, [in] unsigned char[] scheduleResult, + [out] struct IdentifyResultInfo info); + /** + * @brief Cancels identification. + * + * @param contextId Indicates the context index. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + CancelIdentification([in] unsigned long contextId); + /** + * @brief Check whether the authentication capability is avaliable. + * + * @param userId Indicates the user ID. + * @param authType Indicates the authentication type. See {@link AuthType}. + * @param authTrustLevel Indicates the authentication trust level. + * @param checkResult Indicates check result. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetAvailableStatus([in] int userId, [in] int authType, [in] unsigned int authTrustLevel, [out] int checkResult); + /** + * @brief Obtains the valid authentication methods under the current authentication trust level. + * + * @param userId Indicates the user ID. + * @param authTypes Indicates the authentication types to be filtered. See {@link AuthType}. + * @param authTrustLevel Indicates the authentication trust level. + * @param validTypes Indicates the valid authentication types. See {@link AuthType}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetValidSolution([in] int userId, [in] int[] authTypes, [in] unsigned int authTrustLevel, + [out] int[] validTypes); + /** + * @brief Begins authentication, and generates the authentication solution. + * + * @param contextId Indicates the context index. + * @param param Indicates input parameters. See {@link AuthParam}. + * @param scheduleInfos Indicates scheduling information. See {@link ScheduleInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + BeginAuthentication([in] unsigned long contextId, [in] struct AuthParam param, + [out] struct ScheduleInfo[] scheduleInfos); + /** + * @brief Begins the enrollment of authentication credentials. + * If the authentication type is PIN, this method updates the existing PIN credential. + * + * @param userId Indicates the user ID. + * @param authToken Indicates the authentication token of the user password. + * @param param Indicates input parameters. See {@link EnrollParam}. + * @param info Indicates scheduling information. See {@link ScheduleInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + BeginEnrollment([in] unsigned char[] authToken, [in] struct EnrollParam param, + [out] struct ScheduleInfo info); + /** + * @brief Begins identification, and generates the identification solution. + * + * @param contextId Indicates the context index. + * @param authType Indicates the identification type. See @{AuthType}. + * @param challenge Indicates the identification challenge. + * @param executorSensorHint Indicates the executor sensor hint. + * The value 0 indicates that no value is specified. + * @param scheduleInfo Indicates scheduling information. See {@link ScheduleInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + BeginIdentification([in] unsigned long contextId, [in] int authType, [in] unsigned char[] challenge, + [in] unsigned int executorSensorHint, [out] struct ScheduleInfo scheduleInfo); + /** + * @brief Get all enrolled user information. + * + * @param userInfos List of all userInfo. See @{UserInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 4.0 + * @version 1.0 + */ + GetAllUserInfo([out] UserInfo[] userInfos); + /** + * @brief Get all credential of enrolled users. + * + * @param userInfos List of all users. See @{ExtUserInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 4.0 + * @version 1.0 + */ + GetAllExtUserInfo([out] ExtUserInfo[] userInfos); + + /** + * @brief Querying EnrolledId information. + * + * @param userId Indicates the user ID. + * @param authType Indicates the identification type. See @{AuthType}. + * @param enrolledState Enrolled state. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetEnrolledState([in] int userId, [in] int authType, [out] struct EnrolledState enrolledState); + + /** + * @brief Check if unlock result can be reused and return token. + * + * @param info Request information of reused unLock result. See {@link ReuseUnlockParam}. + * @param reuseInfo Reuse unlock info. See {@link ReuseUnlockInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + CheckReuseUnlockResult([in] struct ReuseUnlockParam reuseParam, [out] ReuseUnlockInfo reuseInfo); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. See {@link ExecutorRole}. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Register message callback. + * + * @param messageCallback Indicates the message callback. See {@link IMessageCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + RegisterMessageCallback([in] IMessageCallback messageCallback); + /** + * @brief Prepare remote auth. + * + * @param remoteUdid Indicates the remote device udid. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + PrepareRemoteAuth([in] String remoteUdid); + /** + * @brief Get local schedule from message. + * + * @param remoteUdid Indicates the remote device udid. + * @param message is message received. + * @param scheduleInfo is schedule info. See {@link ScheduleInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetLocalScheduleFromMessage([in] String remoteUdid, [in] unsigned char[] message, [out] ScheduleInfo scheduleInfo); + /** + * @brief Get signed executor info. + * + * @param authTypes Indicates the auth types. See @{AuthType}. + * @param executorRole Indicates the role of executor. See {@link ExecutorRole}. + * @param remoteUdid Indicates the remote device udid. + * @param signedExecutorInfo Indicates the signed executor info. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetSignedExecutorInfo([in] int[] authTypes, [in] int executorRole, [in] String remoteUdid, + [out] unsigned char[] signedExecutorInfo); + /** + * @brief Get auth result from message. + * + * @param remoteUdid Indicates the remote device udid. + * @param message is message received. + * @param authResultInfo Indicates authentication result information. See {@link AuthResultInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetAuthResultFromMessage([in] String remoteUdid, [in] unsigned char[] message, [out] struct AuthResultInfo authResultInfo); + /** + * @brief Set global config param. + * + * @param param The value of global config parameter. See @{GlobalConfigParam}. + * @return Return set result(0:success; other:failed). + * + * @since 5.0 + * @version 1.0 + */ + SetGlobalConfigParam([in] GlobalConfigParam param); + /** + * @brief Verify token and return the plainText. + * + * @param tokenIn Token signed by userAuth. + * @param allowableDuration Allowable duration of token. + * @param tokenPlainOut Token plainText. + * @param rootSecret protection key for the user file key. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.1 + * @version 1.0 + */ + VerifyAuthToken([in] unsigned char[] tokenIn, [in] unsigned long allowableDuration, + [out] struct UserAuthTokenPlain tokenPlainOut, [out] unsigned char[] rootSecret); + /** + * @brief Obtains credential information. + * + * @param credentialId Indicates the credential ID. + * @param infos Indicates credential information. See {@link CredentialInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.1 + * @version 1.0 + */ + GetCredentialById([in] unsigned long credentialId, [out] struct CredentialInfo info); +} +/** @} */ diff --git a/user_auth/v3_0/UserAuthTypes.idl b/user_auth/v3_0/UserAuthTypes.idl new file mode 100644 index 00000000..6ac75e7b --- /dev/null +++ b/user_auth/v3_0/UserAuthTypes.idl @@ -0,0 +1,572 @@ +/* + * 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 HdfUserAuth + * @{ + * + * @brief Provides APIs for the user_auth driver. + * + * The user_auth driver provides a unified interface for the user_auth service to access the user_auth driver. + + * + * @since 4.0 + * @version 1.0 + */ + + /** + * @file UserAuthTypes.idl + * + * @brief Defines the enumeration values and data structures of the user_auth driver. + * + * @since 4.0 + * @version 1.0 + */ + +package ohos.hdi.user_auth.v3_0; + + /** + * @brief Enumerates the credential types for authentication. + * + * @since 3.2 + * @version 2.0 + */ +enum AuthType : int { + /**< All types. */ + ALL = 0, + /**< PIN authentication. */ + PIN = 1, + /**< Facial authentication. */ + FACE = 2, + /**< Fingerprint authentication. */ + FINGERPRINT = 4, + /**< Recovery key. */ + RECOVERY_KEY = 8, + /** Private pin authentication. */ + PRIVATE_PIN = 16, +}; + +/** + * @brief Enumerates executor roles. + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorRole : int { + /**< The executor acts as a collector. */ + COLLECTOR = 1, + /**< The executor acts as a verifier. */ + VERIFIER = 2, + /**< The executor acts as a collector and verifier. */ + ALL_IN_ONE = 3, +}; + +/** + * @brief Enumerates executor security levels. + * + * @since 4.0 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /**< ESL0. */ + ESL0 = 0, + /**< ESL1. */ + ESL1 = 1, + /**< ESL2. */ + ESL2 = 2, + /**< ESL3. */ + ESL3 = 3, +}; + +/** + * @brief Defines pin auth's subtype. + * + * @since 3.2 + * @version 2.0 + */ +enum PinSubType : int { + /**< Six digit pin. */ + PIN_SIX = 10000, + /**< Digit pin. */ + PIN_NUMBER = 10001, + /**< Mixing pin. */ + PIN_MIX = 10002, + /**< Four digit pin. */ + PIN_FOUR = 10003, + /**< Pattern. */ + PATTERN = 10004, + /** Password protection question */ + PIN_QUESTION = 10005, +}; + +/** + * Schedule mode. + * + * @since 3.2 + * @version 1.0 + */ +enum ScheduleMode : int { + /**< The schedule mode is enrollment. */ + ENROLL = 0, + /**< The schedule mode is authentication. */ + AUTH = 1, + /**< The schedule mode is identification. */ + IDENTIFY = 2, +}; + +/** + * Auth intent. + * + * @since 5.0 + * @version 1.0 + */ +enum AuthIntent : int { + /**< The auth intent is default. */ + DEFUALT = 0, + /**< The auth intent is unlock. */ + UNLOCK = 1, + /**< The auth intent silent auth. */ + SILENT_AUTH = 2, + /**< The auth intention is question auth. */ + QUESTION_AUTH = 3, +}; + +/** + * @brief User type. + * + * @since 5.0 + * @version 1.0 + */ +enum UserType : int { + /**< main user. */ + MAIN = 0, + /**< sub user. */ + SUB = 1, + /**< private user. */ + PRIVATE = 2, +}; + +/** + * @brief Reuse mode. + * + * @since 5.0 + * @version 1.0 + */ +enum ReuseMode : int { + /**< sub user. */ + AUTH_TYPE_RELEVANT = 1, + /**< private user. */ + AUTH_TYPE_IRRELEVANT = 2, +}; + +/** + * @brief Defines executor registration information. + * + * @since 4.0 + * @version 2.0 + */ +struct ExecutorRegisterInfo { + /**< Authentication type. See @{AuthType}. */ + int authType; + /**< Executor role. See @{ExecutorRole}. */ + int executorRole; + /**< Executor sensor hint under the same authentication type, 0 is not allowed. */ + unsigned int executorSensorHint; + /**< Executor matcher. */ + unsigned int executorMatcher; + /**< Executor secure level. See @{ExecutorSecureLevel}. */ + int esl; + /**< Indicates the max acl of template.*/ + unsigned int maxTemplateAcl; + /**< Public key of the executor. */ + unsigned char[] publicKey; + /**< Device udid. */ + String deviceUdid; + /**< signed remote executor info. */ + unsigned char[] signedRemoteExecutorInfo; +}; + +/** + * @brief Defines executor information. + * + * @since 4.0 + * @version 1.0 + */ +struct ExecutorInfo { + /**< Executor index under the authentication framework. */ + unsigned long executorIndex; + /**< Executor registration information. See @{ExecutorRegisterInfo}. */ + struct ExecutorRegisterInfo info; +}; + +/** + * @brief Defines executor messages. + * + * @since 4.0 + * @version 1.0 + */ +struct ExecutorSendMsg { + /**< Executor index under the authentication framework. */ + unsigned long executorIndex; + /**< Indicates command ID. */ + int commandId; + /**< Executor message to send. */ + unsigned char[] msg; +}; + +/** + * @brief Defines authentication result information. + * + * @since 4.0 + * @version 2.0 + */ +struct AuthResultInfo { + /**< Authentication result. */ + int result; + /**< Lockout duration, in millisecond. */ + int lockoutDuration; + /**< Remaining authentication attempts before a lockout. */ + int remainAttempts; + /**< Executor messages. See @{ExecutorSendMsg}. */ + struct ExecutorSendMsg[] msgs; + /**< Authentication token. */ + unsigned char[] token; + /**< Protection key for the user file key. */ + unsigned char[] rootSecret; + /**< User ID. */ + int userId; + /**< Credential ID. */ + unsigned long credentialId; + /**< Pin expired info. */ + long pinExpiredInfo; + /**< Remote auth result message. */ + unsigned char[] remoteAuthResultMsg; + /**< Re-enroll flag. */ + boolean reEnrollFlag; +}; + +/** + * @brief Defines identification result information. + * + * @since 4.0 + * @version 1.0 + */ +struct IdentifyResultInfo { + /**< iIdentification result. */ + int result; + /**< User ID. */ + int userId; + /**< Identification token. */ + unsigned char[] token; +}; + +/** + * @brief Defines credential information. + * + * @since 4.0 + * @version 1.0 + */ +struct CredentialInfo { + /**< Credential ID. */ + unsigned long credentialId; + /**< Executor index under the authentication framework. */ + unsigned long executorIndex; + /**< Template ID. */ + unsigned long templateId; + /**< Authentication type. See @{AuthType}. */ + int authType; + /**< Executor matcher. */ + unsigned int executorMatcher; + /**< Executor sensor hint under the same authentication type. 0 is not allowed. */ + unsigned int executorSensorHint; + /**< Auth sub type. */ + int authSubType; +}; + +/** + * @brief Defines credential enrollment information. + * + * @since 4.0 + * @version 1.0 + */ +struct EnrolledInfo { + /**< Enrollment ID. */ + unsigned long enrolledId; + /**< Authentication type. See @{AuthType}. */ + int authType; +}; + +/** + * @brief Defines enrollment result information. + * + * @since 4.0 + * @version 1.0 + */ +struct EnrollResultInfo { + /**< Credential ID. */ + unsigned long credentialId; + /**< Old credential information. See {@link CredentialInfo}. */ + struct CredentialInfo oldInfo; + /**< Protection key for the user file key. */ + unsigned char[] rootSecret; + /**< Old protection key for the user file key. */ + unsigned char[] oldRootSecret; + /**< Indicates the authentication token of the user password. */ + unsigned char[] authToken; +}; + +/** + * @brief Defines scheduling information. + * + * @since 3.2 + * @version 2.0 + */ +struct ScheduleInfo { + /**< Schedule index of authentication. */ + unsigned long scheduleId; + /**< Templates to authenticate. */ + unsigned long[] templateIds; + /**< Authentication type. See @{AuthType}. */ + int authType; + /**< Executor matcher. */ + unsigned int executorMatcher; + /**< Operation to perform. See @{scheduleMode}*/ + int scheduleMode; + /**< Executor indexes. */ + unsigned long [] executorIndexes; + /**< Executor messages. */ + unsigned char[][] executorMessages; +}; + +/** + * @brief Defines enrolled users information. + * + * @since 4.0 + * @version 1.1 + */ +struct UserInfo { + /**< SecureUid of this user. */ + unsigned long secureUid; + /**< PinSubType of this user. See @{@PinSubType}. */ + int pinSubType; + /**< Related enrolled information list. See @{EnrolledInfo}. */ + struct EnrolledInfo[] enrolledInfos; +}; + +/** + * @brief Defines enrolled users information. + * + * @since 4.1 + * @version 1.2 + */ +struct ExtUserInfo { + /**< User ID. */ + int userId; + /**< info of this user. */ + struct UserInfo userInfo; +}; + +/** + * @brief Defines the authentication param. + * + * @since 5.0 + * @version 1.0 + */ +struct AuthParamBase { + /**< User ID. */ + int userId; + /**< Authentication trust level. */ + unsigned int authTrustLevel; + /**< Executor sensor hint under the same authentication type, 0 is not allowed. */ + unsigned int executorSensorHint; + /**< Challenge of the authentication. */ + unsigned char[] challenge; + /**< Caller name. */ + String callerName; + /**< Caller Type. */ + int callerType; + /**< Calling napi or innerkit api version. */ + int apiVersion; +}; + +/** + * @brief Defines the authentication parameter. + * + * @since 5.0 + * @version 1.0 + */ +struct AuthParam { + /**< Authentication parameter. See @{AuthParamBase}. */ + AuthParamBase baseParam; + /**< Authentication type. See @{AuthType}. */ + int authType; + /**< Authentication intent. See @{AuthIntent}. */ + int authIntent; + /**< Is os account verified. */ + boolean isOsAccountVerified; + /**< Collector udid. */ + String collectorUdid; +}; + +/** + * @brief Request information of reused unlock result. + * + * @since 5.0 + * @version 1.0 + */ +struct ReuseUnlockParam { + /**< Authentication parameter. See @{AuthParam}. */ + AuthParamBase baseParam; + /** Authentication type. See @{AuthType}. */ + int[] authTypes; + /** The allowable reuse duration. */ + unsigned long reuseUnlockResultDuration; + /** Reuse unlock result mode. See @{ReuseMode}. */ + int reuseUnlockResultMode; +}; + +/** + * @brief Defines credential enrollment parameters. + * + * @since 3.2 + * @version 2.0 + */ +struct EnrollParam { + /**< Authentication type. See @{AuthType}. */ + int authType; + /**< Executor sensor hint under the same authentication type. 0 is not allowed. */ + unsigned int executorSensorHint; + /**< Caller name. */ + String callerName; + /** Caller Type. */ + int callerType; + /**< Calling napi or innerkit api version. */ + int apiVersion; + /**< User ID. */ + int userId; + /**< User Type. */ + int userType; + /**< Auth sub type. */ + int authSubType; +}; + +/** +* @brief Define credential enrollment ID information. +* + * @since 5.0 + * @version 1.0 +*/ +struct EnrolledState { + /** Desensitization Enrolled ID. */ + unsigned long credentialDigest; + /** Number of Credential. */ + unsigned short credentialCount; +}; + +/** + * @brief The reuse result of unlock device. + * + * @since 5.0 + * @version 1.0 + */ +struct ReuseUnlockInfo { + /**< Authentication type. See @{AuthType}. */ + int authType; + /**< Authentication token. */ + unsigned char[] token; + /**< Enrolled state. See @{EnrolledState}. */ + EnrolledState enrolledState; +}; + +/** + * @brief Global config type. + * + * @since 5.0 + * @version 1.0 + */ +enum GlobalConfigType : int { + /** Pin expired period */ + PIN_EXPIRED_PERIOD = 1, + /** Enable specified authType capability. */ + ENABLE_STATUS = 2, +}; + +/** + * @brief Global config value. + * + * @since 5.0 + * @version 1.0 + */ +union GlobalConfigValue { + /** Pin expired period value. When pinExpiredPeriod equals to 0, userAuth won't check pin expired period. */ + long pinExpiredPeriod; + /** Enable specified authType capability.*/ + boolean enableStatus; +}; + +/** + * @brief Global config param. + * + * @since 5.0 + * @version 1.0 + */ +struct GlobalConfigParam { + /** Global config type. See @{GlobalConfigType}*/ + int type; + /** Global config value. See @{GlobalConfigValue}*/ + GlobalConfigValue value; + /** Specified userIds. GlobalConfigParam will be effect for all userspaces when the array is empty. */ + int[] userIds; + /** Specified authTypes, shouldn't empty. See @{AuthType}.*/ + int[] authTypes; +}; + +/** + * @brief User auth token plain. + * + * @since 5.1 + * @version 1.0 + */ +struct UserAuthTokenPlain { + /** Token version. */ + unsigned int version; + /** User ID. */ + int userId; + /** Challenge of the token. */ + unsigned char[] challenge; + /** Time interval between token signed and verified. */ + unsigned long timeInterval; + /** Authentication trust level. */ + unsigned int authTrustLevel; + /** Authentication type. See @{AuthType}. */ + int authType; + /** Auth mode. */ + int authMode; + /** Security level. */ + unsigned int securityLevel; + /** Token type. */ + int tokenType; + /** SecureUid of the user. */ + unsigned long secureUid; + /** Enrollment ID. */ + unsigned long enrolledId; + /** Credential ID. */ + unsigned long credentialId; + /** Collector udid. */ + String collectorUdid; + /** Verifier udid. */ + String verifierUdid; +}; +/** @} */ \ No newline at end of file -- Gitee From 216f97965eecb5de10cfc17b778407fc7c0ebc92 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 10:05:28 +0000 Subject: [PATCH 237/347] update user_auth/v3_0/IUserAuthInterface.idl. Signed-off-by: liuziwei --- user_auth/v3_0/IUserAuthInterface.idl | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/user_auth/v3_0/IUserAuthInterface.idl b/user_auth/v3_0/IUserAuthInterface.idl index 149f3824..fb980770 100644 --- a/user_auth/v3_0/IUserAuthInterface.idl +++ b/user_auth/v3_0/IUserAuthInterface.idl @@ -495,22 +495,6 @@ interface IUserAuthInterface { * @version 1.0 */ SetGlobalConfigParam([in] GlobalConfigParam param); - /** - * @brief Verify token and return the plainText. - * - * @param tokenIn Token signed by userAuth. - * @param allowableDuration Allowable duration of token. - * @param tokenPlainOut Token plainText. - * @param rootSecret protection key for the user file key. - * - * @return Returns 0 if the operation is successful. - * @return Returns a non-zero value if the operation fails. - * - * @since 5.1 - * @version 1.0 - */ - VerifyAuthToken([in] unsigned char[] tokenIn, [in] unsigned long allowableDuration, - [out] struct UserAuthTokenPlain tokenPlainOut, [out] unsigned char[] rootSecret); /** * @brief Obtains credential information. * -- Gitee From 6bd5d5381849a5733ea98b4e3e6f846c95b73f98 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 10:05:54 +0000 Subject: [PATCH 238/347] update user_auth/v3_0/UserAuthTypes.idl. Signed-off-by: liuziwei --- user_auth/v3_0/UserAuthTypes.idl | 37 -------------------------------- 1 file changed, 37 deletions(-) diff --git a/user_auth/v3_0/UserAuthTypes.idl b/user_auth/v3_0/UserAuthTypes.idl index 6ac75e7b..22c88d2c 100644 --- a/user_auth/v3_0/UserAuthTypes.idl +++ b/user_auth/v3_0/UserAuthTypes.idl @@ -532,41 +532,4 @@ struct GlobalConfigParam { /** Specified authTypes, shouldn't empty. See @{AuthType}.*/ int[] authTypes; }; - -/** - * @brief User auth token plain. - * - * @since 5.1 - * @version 1.0 - */ -struct UserAuthTokenPlain { - /** Token version. */ - unsigned int version; - /** User ID. */ - int userId; - /** Challenge of the token. */ - unsigned char[] challenge; - /** Time interval between token signed and verified. */ - unsigned long timeInterval; - /** Authentication trust level. */ - unsigned int authTrustLevel; - /** Authentication type. See @{AuthType}. */ - int authType; - /** Auth mode. */ - int authMode; - /** Security level. */ - unsigned int securityLevel; - /** Token type. */ - int tokenType; - /** SecureUid of the user. */ - unsigned long secureUid; - /** Enrollment ID. */ - unsigned long enrolledId; - /** Credential ID. */ - unsigned long credentialId; - /** Collector udid. */ - String collectorUdid; - /** Verifier udid. */ - String verifierUdid; -}; /** @} */ \ No newline at end of file -- Gitee From f07bb5fa382918212343c8ee70992ef1e11b5e8b Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 11:38:21 +0000 Subject: [PATCH 239/347] update user_auth/bundle.json. Signed-off-by: liuziwei --- user_auth/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_auth/bundle.json b/user_auth/bundle.json index 4855a810..90a7e803 100644 --- a/user_auth/bundle.json +++ b/user_auth/bundle.json @@ -15,7 +15,7 @@ }, "component":{ "name":"drivers_interface_user_auth", - "subsystem":"hdf", + "subsystem":"drivers", "adapted_system_type":[ "standard" ], -- Gitee From 0b402f7a66ff078df5fad77a550e73a19ce61b4c Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 11:40:38 +0000 Subject: [PATCH 240/347] update user_auth/bundle.json. Signed-off-by: liuziwei --- user_auth/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_auth/bundle.json b/user_auth/bundle.json index 90a7e803..4855a810 100644 --- a/user_auth/bundle.json +++ b/user_auth/bundle.json @@ -15,7 +15,7 @@ }, "component":{ "name":"drivers_interface_user_auth", - "subsystem":"drivers", + "subsystem":"hdf", "adapted_system_type":[ "standard" ], -- Gitee From c94d4bdb5e48d534c1359e047bdf4ee90dd65b17 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 20:37:54 +0800 Subject: [PATCH 241/347] fix Signed-off-by: liuziwei --- pin_auth/bundle.json | 10 +- pin_auth/v2_1/BUILD.gn | 30 +++++ pin_auth/v2_1/IAllInOneExecutor.idl | 196 ++++++++++++++++++++++++++++ pin_auth/v2_1/ICollector.idl | 136 +++++++++++++++++++ pin_auth/v2_1/IExecutorCallback.idl | 110 ++++++++++++++++ pin_auth/v2_1/IPinAuthInterface.idl | 71 ++++++++++ pin_auth/v2_1/IVerifier.idl | 137 +++++++++++++++++++ pin_auth/v2_1/PinAuthTypes.idl | 156 ++++++++++++++++++++++ 8 files changed, 841 insertions(+), 5 deletions(-) create mode 100644 pin_auth/v2_1/BUILD.gn create mode 100644 pin_auth/v2_1/IAllInOneExecutor.idl create mode 100644 pin_auth/v2_1/ICollector.idl create mode 100644 pin_auth/v2_1/IExecutorCallback.idl create mode 100644 pin_auth/v2_1/IPinAuthInterface.idl create mode 100644 pin_auth/v2_1/IVerifier.idl create mode 100644 pin_auth/v2_1/PinAuthTypes.idl diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index a2133135..bfb9cb4c 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -1,7 +1,7 @@ { "name":"@ohos/drivers_interface_pin_auth", "description":"pinauth device driver interface", - "version":"5.0", + "version":"5.1", "license":"Apache License 2.0", "publishAs":"code-segment", "segment":{ @@ -35,14 +35,14 @@ }, "build":{ "sub_component":[ - "//drivers/interface/pin_auth/v2_0:pin_auth_idl_target" + "//drivers/interface/pin_auth/v2_1:pin_auth_idl_target" ], "test":[ ], "inner_kits":[ { - "name":"//drivers/interface/pin_auth/v2_0:libpin_auth_proxy_2.0", + "name":"//drivers/interface/pin_auth/v2_1:libpin_auth_proxy_2.1", "header":{ "header_files":[ @@ -51,7 +51,7 @@ } }, { - "name":"//drivers/interface/pin_auth/v2_0:libpin_auth_stub_2.0", + "name":"//drivers/interface/pin_auth/v2_1:libpin_auth_stub_2.1", "header":{ "header_files":[ @@ -60,7 +60,7 @@ } }, { - "name":"//drivers/interface/pin_auth/v2_0:pin_auth_idl_headers", + "name":"//drivers/interface/pin_auth/v2_1:pin_auth_idl_headers", "header":{ "header_files":[ diff --git a/pin_auth/v2_1/BUILD.gn b/pin_auth/v2_1/BUILD.gn new file mode 100644 index 00000000..b332167f --- /dev/null +++ b/pin_auth/v2_1/BUILD.gn @@ -0,0 +1,30 @@ +# 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("//build/config/components/hdi/hdi.gni") +import("../config.gni") + +hdi("pin_auth") { + module_name = "drivers_peripheral_pin_auth" + sources = [ + "IAllInOneExecutor.idl", + "ICollector.idl", + "IExecutorCallback.idl", + "IPinAuthInterface.idl", + "IVerifier.idl", + "PinAuthTypes.idl", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_pin_auth" +} diff --git a/pin_auth/v2_1/IAllInOneExecutor.idl b/pin_auth/v2_1/IAllInOneExecutor.idl new file mode 100644 index 00000000..d8fb5b30 --- /dev/null +++ b/pin_auth/v2_1/IAllInOneExecutor.idl @@ -0,0 +1,196 @@ +/* + * 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 HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.1 + */ + +/** + * @file IAllInOneExecutor.idl + * + * @brief Defines the APIs of the all-in-one executors. These APIs can be used to get executor information, get property, + * enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.1 + */ + +package ohos.hdi.pin_auth.v2_1; + +import ohos.hdi.pin_auth.v2_1.PinAuthTypes; +import ohos.hdi.pin_auth.v2_1.IExecutorCallback; + +/** + * @brief Defines the APIs of the all-in-one executors. These APIs can be used to get executor information, get property, + * enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.1 + */ + +interface IAllInOneExecutor { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, + [in] unsigned char[] extraInfo); + /** + * @brief Cancels an operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Sets pin data. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param authSubType Indicates the pin sub type. + * @param data Indicates the pin data. + * @param resultCode Indicates the result code. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data, + [in] int resultCode); + /** + * @brief Enrolls templates. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param extraInfo Indicates the extra information of enrollment. + * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Authenticates templates. + * + * @param scheduleId Indicates the schedule ID of authentication. + * @param templateIdList Indicates the templates to authenticate. + * @param extraInfo Indicates the extra information of authentication. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, + [in] IExecutorCallback callbackObj); + /** + * @brief Deletes templates. + * + * @param templateId Indicates the templates to delete. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Delete([in] unsigned long templateId); + /** + * @brief Get property. + * + * @param templateIdList Indicates the templates to process. + * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}. + * @param property Indicates property. See {@link Property}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); + /** + * @brief Sends a command to the driver. + * + * @param commandId Indicates the command ID. See {@link DriverCommandId}. + * @param extraInfo Indicates the extra information of the command. + * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.1 + * @version 1.0 + */ + SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); +} + +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_1/ICollector.idl b/pin_auth/v2_1/ICollector.idl new file mode 100644 index 00000000..26e46970 --- /dev/null +++ b/pin_auth/v2_1/ICollector.idl @@ -0,0 +1,136 @@ +/* + * 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 HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.0 + */ + +/** + * @file ICollector.idl + * + * @brief Defines the APIs of the collectors. These APIs can be used to get executor information, + * cancel, collect data, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_1; + +import ohos.hdi.pin_auth.v2_1.PinAuthTypes; +import ohos.hdi.pin_auth.v2_1.IExecutorCallback; + +/** + * @brief Defines the APIs of the collectors. These APIs can be used to get executor information, + * cancel, collect data, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +interface ICollector { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); + /** + * @brief Cancels an operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Sets pin data. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param authSubType Indicates the pin sub type. + * @param data Indicates the pin data. + * @param resultCode Indicates the result code. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data, + [in] int resultCode); + /** + * @brief Collect template data. + * + * @param scheduleId Indicates the schedule ID of collection. + * @param extraInfo Indicates the extra information of collection. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Collect([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, + [in] IExecutorCallback callbackObj); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_1/IExecutorCallback.idl b/pin_auth/v2_1/IExecutorCallback.idl new file mode 100644 index 00000000..c59f7b29 --- /dev/null +++ b/pin_auth/v2_1/IExecutorCallback.idl @@ -0,0 +1,110 @@ +/* + * 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 HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file IExecutorCallback.idl + * + * @brief Defines the callback for an async API, which can be used to report operation results or + * get information of the async API. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_1; + +import ohos.hdi.pin_auth.v2_1.PinAuthTypes; + +/** + * @brief Defines the callback for an async API, which can be used to report operation results or + * get information of the async API. See {@link IExecutor}. + * + * @since 3.2 + * @version 1.0 + */ +[callback] interface IExecutorCallback { + /** + * @brief Defines the function for reporting operation results. + * + * @param result Indicates the result code. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + OnResult([in] int result, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for reporting information in process. + * + * @param tip Indicates tip code. See {@link FaceTipsCode}. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for getting pin data. + * + * @param algoParameter is the parameter of the algorithm. + * @param authSubType Indicates the pin sub type. + * @param algoVersion is the version of the algorithm. + * @param challenge is challenge. + * @param complexityReg Indicates the complexity reg. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + OnGetData([in] unsigned char[] algoParameter, [in] unsigned long authSubType, [in] unsigned int algoVersion, + [in] unsigned char[] challenge, [in] String complexityReg); + /** + * @brief Defines the function for reporting message. + * + * @param destRole is the role of destination. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnMessage([in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_1/IPinAuthInterface.idl b/pin_auth/v2_1/IPinAuthInterface.idl new file mode 100644 index 00000000..9f1a6850 --- /dev/null +++ b/pin_auth/v2_1/IPinAuthInterface.idl @@ -0,0 +1,71 @@ +/* + * 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 HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file IPinAuthInterface.idl + * + * @brief Defines the API for getting the executor list of the pin auth driver. + * of driver. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_1; + +import ohos.hdi.pin_auth.v2_1.IAllInOneExecutor; +import ohos.hdi.pin_auth.v2_1.ICollector; +import ohos.hdi.pin_auth.v2_1.IVerifier; + +/** + * @brief Defines the API for getting the executor list of the pin auth driver. + * + * @since 3.2 + * @version 1.0 + */ +interface IPinAuthInterface { + /** + * @brief Obtains the executor list of the driver. + * + * @param allInOneExecutors Indicates the all-in-one executor list of the driver. + * See {@link IAllInOneExecutor}. + * @param verifiers Indicates the verifier list of the driver. See {@link IVerifier}. + * @param collectors Indicates the collector list of the driver. See {@link ICollector}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetExecutorList([out] IAllInOneExecutor[] allInOneExecutors, [out] IVerifier[] verifiers, + [out] ICollector[] collectors); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_1/IVerifier.idl b/pin_auth/v2_1/IVerifier.idl new file mode 100644 index 00000000..a07ff61d --- /dev/null +++ b/pin_auth/v2_1/IVerifier.idl @@ -0,0 +1,137 @@ +/* + * 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 HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.0 + */ + +/** + * @file IVerifier.idl + * + * @brief Defines the APIs of the verifiers. These APIs can be used to get executor information, + * cancel, authenticate, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_1; + +import ohos.hdi.pin_auth.v2_1.PinAuthTypes; +import ohos.hdi.pin_auth.v2_1.IExecutorCallback; + +/** + * @brief Defines the APIs of the verifiers. These APIs can be used to get executor information, + * cancel, authenticate, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +interface IVerifier { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, + [in] unsigned char[] extraInfo); + /** + * @brief Cancels an operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Authenticates templates. + * + * @param scheduleId Indicates the schedule ID of authentication. + * @param templateIdList Indicates the templates to authenticate. + * @param extraInfo Indicates the extra information of authentication. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, + [in] IExecutorCallback callbackObj); + /** + * @brief Notify collector ready. + * + * @param scheduleId Indicates the schedule ID of the message. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + NotifyCollectorReady([in] unsigned long scheduleId); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_1/PinAuthTypes.idl b/pin_auth/v2_1/PinAuthTypes.idl new file mode 100644 index 00000000..a3ad8c1d --- /dev/null +++ b/pin_auth/v2_1/PinAuthTypes.idl @@ -0,0 +1,156 @@ +/* + * 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 HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @fiPinTypes.idl + * + * @brief Defines the enumeration and data structure of the pin auth driver, including AuthType, ExecutorRole, + * ExecutorSecureLevel, + * CommandId, ResultCode, ExecutorInfo, and TemplateInfo. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_1; + +/** + * @brief Enumerates the credential types for authentication. + * + * @since 3.2 + * @version 1.1 + */ +enum AuthType : int { + /**< Indicates that the authentication type is PIN. */ + PIN = 1, + /**< Indicates that the authentication type is face. */ + FACE = 2, + /**< Indicates that the authentication type is fingerprint. */ + FINGERPRINT = 4, + /**< Indicates that the authentication type is recovery key. */ + RECOVERY_KEY = 8, + /**< Indicates that the authentication type is private pin. */ + PRIVATE_PIN = 16, +}; + +/** + * @brief Enumerates executor roles. + * + * @since 3.2 + * @version 2.0 + */ +enum ExecutorRole : int { + /**< Indicates that the executor role is scheduler. */ + SCHEDULER = 0, + /**< Indicates that the executor role is collector. */ + COLLECTOR = 1, + /**< Indicates that the executor role is verifier. */ + VERIFIER = 2, + /**< Indicates that the executor role is the combination of collector and verifier. */ + ALL_IN_ONE = 3, +}; + +/** + * @brief Enumerates executor secure levels. + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /**< Indicates that the executor secure level is ESL0. */ + ESL0 = 0, + /**< Indicates that the executor secure level is ESL1. */ + ESL1 = 1, + /**< Indicates that the executor secure level is ESL2. */ + ESL2 = 2, + /**< Indicates that the executor secure level is ESL3. */ + ESL3 = 3, +}; + +/** + * @brief Indicates executor information. + * + * @since 3.2 + * @version 2.0 + */ +struct ExecutorInfo { + /**< Indicates the sensor ID, which must be unique within the driver. */ + unsigned short sensorId; + /**< Indicates the executor matcher. */ + unsigned int executorMatcher; + /**< Indicates the executor role. See @{ExecutorRole}. */ + int executorRole; + /**< Indicates the auth type. See @{AuthType}. */ + int authType; + /**< Indicates the executor secure level. See @{ExecutorSecureLevel}. */ + int esl; + /**< Indicates the public key of the executor. */ + unsigned char[] publicKey; + /**< Indicates extra information. */ + unsigned char[] extraInfo; + /**< Indicates the max acl of template. */ + unsigned int maxTemplateAcl; +}; + +/** + * @brief Enumerates get Property types. + * + * @since 4.0 + * @version 2.0 + */ +enum GetPropertyType : int { + /**< Indicates that the property to get is auth sub type. */ + AUTH_SUB_TYPE = 1, + /**< Indicates that the property to get is lockout duration. */ + LOCKOUT_DURATION = 2, + /**< Indicates that the property to get is remain attempts. */ + REMAIN_ATTEMPTS = 3, + /**< Indicates that the property to get is lockout duration after next fail. */ + NEXT_FAIL_LOCKOUT_DURATION = 6 +}; + +/** + * @brief Indicates executor property. + * + * @since 4.0 + * @version 2.0 + */ +struct Property { + /**< Indicates auth sub type. */ + unsigned long authSubType; + /**< Indicates lockout duration. */ + int lockoutDuration; + /**< Indicates remain attempts. */ + int remainAttempts; + /**< Indicates next fail lockout duration. */ + int nextFailLockoutDuration; +}; + +/** @} */ \ No newline at end of file -- Gitee From 26f3e391cf4376279bebcdd5d9a61502331b76a7 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 12:38:31 +0000 Subject: [PATCH 242/347] update pin_auth/bundle.json. Signed-off-by: liuziwei --- pin_auth/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index bfb9cb4c..286eded7 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -15,7 +15,7 @@ }, "component":{ "name":"drivers_interface_pin_auth", - "subsystem":"hdf", + "subsystem":"driver", "adapted_system_type":[ "standard" ], -- Gitee From 4ad4d9a1b6c2a070b312bd56c99cabbe0862fd1f Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 12:42:39 +0000 Subject: [PATCH 243/347] update pin_auth/bundle.json. Signed-off-by: liuziwei --- pin_auth/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index 286eded7..7279eab6 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -15,7 +15,7 @@ }, "component":{ "name":"drivers_interface_pin_auth", - "subsystem":"driver", + "subsystem":"drivers", "adapted_system_type":[ "standard" ], -- Gitee From 32914b4b3dc007a758b5b15217f3e088271b1f89 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Wed, 27 Nov 2024 12:53:55 +0000 Subject: [PATCH 244/347] update pin_auth/bundle.json. Signed-off-by: liuziwei --- pin_auth/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index 7279eab6..bfb9cb4c 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -15,7 +15,7 @@ }, "component":{ "name":"drivers_interface_pin_auth", - "subsystem":"drivers", + "subsystem":"hdf", "adapted_system_type":[ "standard" ], -- Gitee From faeb1e2450c977fd2c7b2883f5c9d3fed707eef9 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Thu, 28 Nov 2024 11:14:33 +0800 Subject: [PATCH 245/347] =?UTF-8?q?=E5=9C=86=E8=A7=92=E7=A1=AC=E5=8C=96?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=9B=BE=E5=B1=82=E4=B8=8D=E4=BD=BF=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- display/composer/cache_manager/BUILD.gn | 1 + display/composer/cache_manager/layer_cache.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/display/composer/cache_manager/BUILD.gn b/display/composer/cache_manager/BUILD.gn index 2f9a8663..a83df881 100644 --- a/display/composer/cache_manager/BUILD.gn +++ b/display/composer/cache_manager/BUILD.gn @@ -29,6 +29,7 @@ ohos_shared_library("libcomposer_buffer_cache") { "//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", + "//drivers/interface/display/composer/v1_0:libdisplay_composer_proxy_1.0", ] external_deps = [ diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index a5e78fcc..e24f88c4 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -19,6 +19,7 @@ #include "common/include/display_interface_utils.h" #include "hdf_base.h" #include "hdf_log.h" +#include "v1_0/display_composer_type.h" namespace OHOS { namespace HDI { @@ -166,7 +167,7 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - if (needMap_) { + if (needMap_ && ((buffer->GetBufferHandle()->usage & HBM_USE_PROTECTED) != HBM_USE_PROTECTED)) { int32_t ret = Unmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Unmap failed!"); @@ -186,7 +187,7 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) HDF_LOGE("Register Buffer failed!"); return ret; } - if (needMap_) { + if (needMap_ && ((buffer->GetBufferHandle()->usage & HBM_USE_PROTECTED) != HBM_USE_PROTECTED)) { ret = Mmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); -- Gitee From eab428c86f82499f493320fb20fb7d6b328ffa7a Mon Sep 17 00:00:00 2001 From: liuziwei Date: Thu, 28 Nov 2024 11:36:45 +0800 Subject: [PATCH 246/347] fix Signed-off-by: liuziwei --- pin_auth/v2_1/IAllInOneExecutor.idl | 2 +- pin_auth/v2_1/PinAuthTypes.idl | 11 +++++++++++ user_auth/v3_0/IUserAuthInterface.idl | 2 +- user_auth/v3_0/UserAuthTypes.idl | 10 +++++----- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pin_auth/v2_1/IAllInOneExecutor.idl b/pin_auth/v2_1/IAllInOneExecutor.idl index d8fb5b30..a3e60047 100644 --- a/pin_auth/v2_1/IAllInOneExecutor.idl +++ b/pin_auth/v2_1/IAllInOneExecutor.idl @@ -187,7 +187,7 @@ interface IAllInOneExecutor { * @return Returns 0 if the operation is successful. * @return Returns a non-zero value if the operation fails. * - * @since 5.1 + * @since 5.0 * @version 1.0 */ SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); diff --git a/pin_auth/v2_1/PinAuthTypes.idl b/pin_auth/v2_1/PinAuthTypes.idl index a3ad8c1d..bd0166c5 100644 --- a/pin_auth/v2_1/PinAuthTypes.idl +++ b/pin_auth/v2_1/PinAuthTypes.idl @@ -153,4 +153,15 @@ struct Property { int nextFailLockoutDuration; }; +/** + * @brief Enumerates command IDs. + * + * @since 5.0 + * @version 1.0 + */ +enum CommandId : int { + /**< The vendor may add a custom command ID after this. */ + VENDOR_COMMAND_BEGIN = 10000 +}; + /** @} */ \ No newline at end of file diff --git a/user_auth/v3_0/IUserAuthInterface.idl b/user_auth/v3_0/IUserAuthInterface.idl index fb980770..e0684cde 100644 --- a/user_auth/v3_0/IUserAuthInterface.idl +++ b/user_auth/v3_0/IUserAuthInterface.idl @@ -504,7 +504,7 @@ interface IUserAuthInterface { * @return Returns 0 if the operation is successful. * @return Returns a non-zero value if the operation fails. * - * @since 5.1 + * @since 5.0 * @version 1.0 */ GetCredentialById([in] unsigned long credentialId, [out] struct CredentialInfo info); diff --git a/user_auth/v3_0/UserAuthTypes.idl b/user_auth/v3_0/UserAuthTypes.idl index 22c88d2c..6981b30d 100644 --- a/user_auth/v3_0/UserAuthTypes.idl +++ b/user_auth/v3_0/UserAuthTypes.idl @@ -41,7 +41,7 @@ package ohos.hdi.user_auth.v3_0; * @brief Enumerates the credential types for authentication. * * @since 3.2 - * @version 2.0 + * @version 3.0 */ enum AuthType : int { /**< All types. */ @@ -94,7 +94,7 @@ enum ExecutorSecureLevel : int { * @brief Defines pin auth's subtype. * * @since 3.2 - * @version 2.0 + * @version 3.0 */ enum PinSubType : int { /**< Six digit pin. */ @@ -130,7 +130,7 @@ enum ScheduleMode : int { * Auth intent. * * @since 5.0 - * @version 1.0 + * @version 2.0 */ enum AuthIntent : int { /**< The auth intent is default. */ @@ -276,7 +276,7 @@ struct IdentifyResultInfo { * @brief Defines credential information. * * @since 4.0 - * @version 1.0 + * @version 2.0 */ struct CredentialInfo { /**< Credential ID. */ @@ -441,7 +441,7 @@ struct ReuseUnlockParam { * @brief Defines credential enrollment parameters. * * @since 3.2 - * @version 2.0 + * @version 3.0 */ struct EnrollParam { /**< Authentication type. See @{AuthType}. */ -- Gitee From d397b4f82fbeeef4a8a4208bfe4eb870ae66442a Mon Sep 17 00:00:00 2001 From: l60050612 Date: Thu, 28 Nov 2024 05:37:07 +0000 Subject: [PATCH 247/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index e24f88c4..1518502c 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -19,7 +19,7 @@ #include "common/include/display_interface_utils.h" #include "hdf_base.h" #include "hdf_log.h" -#include "v1_0/display_composer_type.h" +#include "gen/drivers/interface/display/composer/v1_0/display_composer_type.h" namespace OHOS { namespace HDI { @@ -167,7 +167,7 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - if (needMap_ && ((buffer->GetBufferHandle()->usage & HBM_USE_PROTECTED) != HBM_USE_PROTECTED)) { + if (needMap_ && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { int32_t ret = Unmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Unmap failed!"); @@ -187,7 +187,7 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) HDF_LOGE("Register Buffer failed!"); return ret; } - if (needMap_ && ((buffer->GetBufferHandle()->usage & HBM_USE_PROTECTED) != HBM_USE_PROTECTED)) { + if (needMap_ && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { ret = Mmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); -- Gitee From ba995265c420b4ed5a9af710ad989e4fba227ea2 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Thu, 28 Nov 2024 07:48:45 +0000 Subject: [PATCH 248/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 1518502c..c11b95f0 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -19,7 +19,7 @@ #include "common/include/display_interface_utils.h" #include "hdf_base.h" #include "hdf_log.h" -#include "gen/drivers/interface/display/composer/v1_0/display_composer_type.h" +#include "v1_0/display_composer_type.h" namespace OHOS { namespace HDI { -- Gitee From be30e5eba76103075cd70679bddfb89d36f84501 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Thu, 28 Nov 2024 08:46:21 +0000 Subject: [PATCH 249/347] update pin_auth/v2_1/IAllInOneExecutor.idl. Signed-off-by: liuziwei --- pin_auth/v2_1/IAllInOneExecutor.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pin_auth/v2_1/IAllInOneExecutor.idl b/pin_auth/v2_1/IAllInOneExecutor.idl index a3e60047..e483337b 100644 --- a/pin_auth/v2_1/IAllInOneExecutor.idl +++ b/pin_auth/v2_1/IAllInOneExecutor.idl @@ -180,7 +180,7 @@ interface IAllInOneExecutor { /** * @brief Sends a command to the driver. * - * @param commandId Indicates the command ID. See {@link DriverCommandId}. + * @param commandId Indicates the command ID. See {@link CommandId}. * @param extraInfo Indicates the extra information of the command. * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. * -- Gitee From 902613a133f566b5d76fe1f21f27c58d3f0063b9 Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Thu, 28 Nov 2024 20:48:44 +0800 Subject: [PATCH 250/347] fixed the null pointer alarm Signed-off-by: linchengfeng --- camera/metadata/src/camera_metadata_info.cpp | 35 +++++++++++++++---- .../map_data/map_data_sequenceable.cpp | 4 +-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 12f9fb55..159cc612 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -540,8 +540,13 @@ common_metadata_header_t *CameraMetadata::FillCameraMetadata(common_metadata_hea metadataHeader->items_start = AlignTo(sizeof(common_metadata_header_t), ITEM_ALIGNMENT); metadataHeader->data_count = 0; metadataHeader->data_capacity = dataCapacity; - size_t dataUnaligned = reinterpret_cast(GetMetadataItems(metadataHeader) + - metadataHeader->item_capacity) - reinterpret_cast(metadataHeader); + camera_metadata_item_entry_t *pItem = GetMetadataItems(metadataHeader); + if (pItem == nullptr) { + METADATA_ERR_LOG("FillCameraMetadata pItem is null"); + return nullptr; + } + size_t dataUnaligned = reinterpret_cast(pItem + metadataHeader->item_capacity) - + reinterpret_cast(metadataHeader); metadataHeader->data_start = AlignTo(dataUnaligned, DATA_ALIGNMENT); METADATA_DEBUG_LOG("MetadataHeader ItemCapacity Size = %{public}u, DataCapacity Size = %{public}u", @@ -803,7 +808,12 @@ int CameraMetadata::AddCameraMetadataItem(common_metadata_header_t *dst, uint32_ } size_t dataPayloadBytes = dataCount * OHOS_CAMERA_METADATA_TYPE_SIZE[dataType]; - camera_metadata_item_entry_t *metadataItem = GetMetadataItems(dst) + dst->item_count; + camera_metadata_item_entry_t *pItem = GetMetadataItems(dst); + if (pItem == nullptr) { + METADATA_ERR_LOG("AddCameraMetadataItem pItem is null"); + return CAM_META_INVALID_PARAM; + } + camera_metadata_item_entry_t *metadataItem = pItem + dst->item_count; ret = memset_s(metadataItem, sizeof(camera_metadata_item_entry_t), 0, sizeof(camera_metadata_item_entry_t)); if (ret != EOK) { METADATA_ERR_LOG("AddCameraMetadataItem: memset_s failed"); @@ -858,8 +868,12 @@ int CameraMetadata::GetCameraMetadataItem(const common_metadata_header_t *src, u METADATA_ERR_LOG("GetCameraMetadataItem index is greater than item count"); return CAM_META_INVALID_PARAM; } - - camera_metadata_item_entry_t *localItem = GetMetadataItems(src) + index; + camera_metadata_item_entry_t *pItem = GetMetadataItems(src); + if (pItem == nullptr) { + METADATA_ERR_LOG("GetCameraMetadataItem pItem is null"); + return CAM_META_INVALID_PARAM; + } + camera_metadata_item_entry_t *localItem = pItem + index; item->index = index; item->item = localItem->item; @@ -1123,6 +1137,10 @@ int CameraMetadata::UpdateCameraMetadataItem(common_metadata_header_t *dst, uint int CameraMetadata::moveMetadataMemery(common_metadata_header_t *dst, camera_metadata_item_entry_t *itemToDelete, size_t dataBytes) { + if (itemToDelete == nullptr) { + METADATA_ERR_LOG("UpdateCameraMetadataItemSize itemToDelete is null"); + return CAM_META_INVALID_PARAM; + } uint8_t *dstMetadataData = GetMetadataData(dst); if (dstMetadataData == nullptr) { METADATA_ERR_LOG("UpdateCameraMetadataItemSize GetMetadataData failed"); @@ -1156,7 +1174,12 @@ int CameraMetadata::DeleteCameraMetadataItemByIndex(common_metadata_header_t *ds } int32_t ret = CAM_META_SUCCESS; - camera_metadata_item_entry_t *itemToDelete = GetMetadataItems(dst) + index; + camera_metadata_item_entry_t *pItem = GetMetadataItems(dst); + if (pItem == nullptr) { + METADATA_ERR_LOG("DeleteCameraMetadataItemByIndex pItem is null"); + return CAM_META_INVALID_PARAM; + } + camera_metadata_item_entry_t *itemToDelete = pItem + index; int32_t dataBytes = CalculateCameraMetadataItemDataSize(itemToDelete->data_type, itemToDelete->count); if (dataBytes > 0) { ret = moveMetadataMemery(dst, itemToDelete, dataBytes); diff --git a/camera/sequenceable/map_data/map_data_sequenceable.cpp b/camera/sequenceable/map_data/map_data_sequenceable.cpp index 72ca9848..ea1ee5c6 100644 --- a/camera/sequenceable/map_data/map_data_sequenceable.cpp +++ b/camera/sequenceable/map_data/map_data_sequenceable.cpp @@ -46,8 +46,8 @@ sptr MapDataSequenceable::Unmarshalling(Parcel &parcel) } int32_t size = parcel.ReadInt32(); - if (size > BUFFER_MAX_USER_DATA_COUNT) { - HDI_CAMERA_LOGE("Too much data obtained from Parcel"); + if (size <= 0 || size > BUFFER_MAX_USER_DATA_COUNT) { + HDI_CAMERA_LOGE("invalid size: %{public}d obtained from Parcel", size); return nullptr; } sptr sequenceData(new MapDataSequenceable()); -- Gitee From e53fda067ec0bf7801b8efb831d24cb3a058f2f9 Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Sat, 30 Nov 2024 08:56:56 +0000 Subject: [PATCH 251/347] fix boundary check Signed-off-by: linchengfeng --- camera/sequenceable/map_data/map_data_sequenceable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/sequenceable/map_data/map_data_sequenceable.cpp b/camera/sequenceable/map_data/map_data_sequenceable.cpp index ea1ee5c6..8ce44924 100644 --- a/camera/sequenceable/map_data/map_data_sequenceable.cpp +++ b/camera/sequenceable/map_data/map_data_sequenceable.cpp @@ -46,7 +46,7 @@ sptr MapDataSequenceable::Unmarshalling(Parcel &parcel) } int32_t size = parcel.ReadInt32(); - if (size <= 0 || size > BUFFER_MAX_USER_DATA_COUNT) { + if (size < 0 || size > BUFFER_MAX_USER_DATA_COUNT) { HDI_CAMERA_LOGE("invalid size: %{public}d obtained from Parcel", size); return nullptr; } -- Gitee From 792a8b1b56df4ced85ae7f7b0c46e629a41f4cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E6=97=AD=E7=8E=89?= <15213585+lu-xuyu@user.noreply.gitee.com> Date: Mon, 2 Dec 2024 09:45:35 +0800 Subject: [PATCH 252/347] Your branch is up to date with 'origin/master'. Signed-off-by:luxuyu --- display/composer/v1_2/DisplayComposerType.idl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 325f4b36..e528859e 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -50,6 +50,8 @@ import ohos.hdi.display.composer.v1_1.DisplayComposerType; enum DispPowerStatus : ohos.hdi.display.composer.v1_1.DispPowerStatus { POWER_STATUS_PRE_ON = 5, /**< The power status is Enter pre-lit screen state */ POWER_STATUS_PRE_OFF = 6, /**< The power status is Exit pre-lit sreen state */ + POWER_STATUS_DOZE = 7, /**< The power status is doze and prepare to present */ + POWER_STATUS_DOZE_SUSPEND = 8, /**< The power status is doze and ended present */ POWER_STATUS_BUTT_V1_2, /**< The power status is invalid */ }; @@ -113,4 +115,4 @@ struct PresentParam { unsigned int sliceNum; /**< slice nums of current frame */ unsigned int imageDimension; /**< low 16 bits: image width, high 16 bits: image height */ int reserve; /**< reserve */ -}; \ No newline at end of file +}; -- Gitee From cbc72a262098069e57787b4d73074a7c90693dfd Mon Sep 17 00:00:00 2001 From: l60050612 Date: Mon, 2 Dec 2024 08:41:25 +0000 Subject: [PATCH 253/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index c11b95f0..63d68f18 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -167,6 +167,10 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } + if (buffer == nullptr || buffer->GetBufferHandle() == nullptr) { + HDF_LOGE("buffer or GetBufferHandle is null!"); + return mapperService->FreeMem(buffer); + } if (needMap_ && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { int32_t ret = Unmap(buffer); if (ret != HDF_SUCCESS) { @@ -187,6 +191,10 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) HDF_LOGE("Register Buffer failed!"); return ret; } + if (buffer == nullptr || buffer->GetBufferHandle() == nullptr) { + HDF_LOGE("buffer or GetBufferHandle is null!"); + return HDF_FAILURE; + } if (needMap_ && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { ret = Mmap(buffer); if (ret != HDF_SUCCESS) { -- Gitee From 0ca697eac27480f7b02b6fba4a06ab70b9663484 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 3 Dec 2024 03:20:40 +0000 Subject: [PATCH 254/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- .../composer/cache_manager/layer_cache.cpp | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 63d68f18..0504d23f 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -167,16 +167,15 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("GetMapperService failed!"); return HDF_FAILURE; } - if (buffer == nullptr || buffer->GetBufferHandle() == nullptr) { - HDF_LOGE("buffer or GetBufferHandle is null!"); - return mapperService->FreeMem(buffer); - } - if (needMap_ && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { - int32_t ret = Unmap(buffer); - if (ret != HDF_SUCCESS) { - HDF_LOGE("Unmap failed!"); + if (needMap_) { + if (buffer != nullptr && buffer->GetBufferHandle() != nullptr && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { + int32_t ret = Unmap(buffer); + if (ret != HDF_SUCCESS) { + HDF_LOGE("Unmap failed!"); + } } - } + } + return mapperService->FreeMem(buffer); } @@ -191,14 +190,13 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) HDF_LOGE("Register Buffer failed!"); return ret; } - if (buffer == nullptr || buffer->GetBufferHandle() == nullptr) { - HDF_LOGE("buffer or GetBufferHandle is null!"); - return HDF_FAILURE; - } - if (needMap_ && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { - ret = Mmap(buffer); - if (ret != HDF_SUCCESS) { - HDF_LOGE("Mmap failed!"); + + if (needMap_) { + if (buffer != nullptr && buffer->GetBufferHandle() != nullptr && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { + ret = Mmap(buffer); + if (ret != HDF_SUCCESS) { + HDF_LOGE("Mmap failed!"); + } } } return HDF_SUCCESS; -- Gitee From 04b2bcac39296e458532eee1b2ea3148577eccfb Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 3 Dec 2024 03:45:01 +0000 Subject: [PATCH 255/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 0504d23f..7a64ab49 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -174,8 +174,8 @@ int32_t LayerCache::FreeMem(sptr& buffer) HDF_LOGE("Unmap failed!"); } } - } - + } + return mapperService->FreeMem(buffer); } @@ -192,7 +192,8 @@ int32_t LayerCache::RegisterBuffer(sptr& buffer) } if (needMap_) { - if (buffer != nullptr && buffer->GetBufferHandle() != nullptr && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { + if (buffer != nullptr && buffer->GetBufferHandle() != nullptr && + ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { ret = Mmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Mmap failed!"); -- Gitee From 08b7c1fe7d44f6eb7f93370a683b4c467802e74e Mon Sep 17 00:00:00 2001 From: l60050612 Date: Tue, 3 Dec 2024 03:45:40 +0000 Subject: [PATCH 256/347] update display/composer/cache_manager/layer_cache.cpp. Signed-off-by: l60050612 --- display/composer/cache_manager/layer_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 7a64ab49..9d153b6a 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -168,7 +168,8 @@ int32_t LayerCache::FreeMem(sptr& buffer) return HDF_FAILURE; } if (needMap_) { - if (buffer != nullptr && buffer->GetBufferHandle() != nullptr && ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { + if (buffer != nullptr && buffer->GetBufferHandle() != nullptr && + ((buffer->GetBufferHandle()->usage & V1_0::HBM_USE_PROTECTED) != V1_0::HBM_USE_PROTECTED)) { int32_t ret = Unmap(buffer); if (ret != HDF_SUCCESS) { HDF_LOGE("Unmap failed!"); -- Gitee From c2d2f78ecd33678d2d7cede3dc903bf92f6c4d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Tue, 3 Dec 2024 07:35:59 +0000 Subject: [PATCH 257/347] update audio/v4_0/AudioTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/v4_0/AudioTypes.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index 3c28e830..29a7a96d 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -76,7 +76,7 @@ enum AudioPortPin { * @brief Enumerates the audio category. * * @since 4.1 - * @version 3.1 + * @version 3.0 */ enum AudioCategory { AUDIO_IN_MEDIA = 0, /**< Media */ @@ -90,7 +90,6 @@ enum AudioCategory { AUDIO_MMAP_VOIP = 8, /**< Audio voip */ AUDIO_IN_NAVIGATION = 9, /**< Audio navigation */ AUDIO_DIRECT = 10,/**< Audio direct */ - AUDIO_RAW = 11,/**< Audio raw */ }; /** @@ -440,6 +439,7 @@ enum AudioInputType { AUDIO_INPUT_CAMCORDER_TYPE = 1 << 7, /**< Assigned camcorder input type */ AUDIO_INPUT_EC_TYPE = 1 << 8, /**< Assigned EC input type */ AUDIO_INPUT_NOISE_REDUCTION_TYPE = 1 << 9, /**< Assigned noise reduction input type */ + AUDIO_INPUT_RAW_TYPE = 1 << 10, /**< Assigned raw input type */ }; /** -- Gitee From 12c3b8471c79493409469fa4998c1a2ece2a3781 Mon Sep 17 00:00:00 2001 From: xuedong Date: Tue, 3 Dec 2024 16:29:05 +0800 Subject: [PATCH 258/347] fix: ipc Signed-off-by: xuedong --- display/composer/v1_2/DisplayComposerType.idl | 1 + .../display_command/display_cmd_requester.h | 59 +++++++++++++++++ .../display_command/display_cmd_responser.h | 63 +++++++++++++++++++ .../v1_2/hdi_impl/display_composer_hdi_impl.h | 6 ++ .../include/idisplay_composer_interface.h | 3 + 5 files changed, 132 insertions(+) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 325f4b36..9d9e05dd 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -83,6 +83,7 @@ enum PixelFormat : ohos.hdi.display.composer.v1_1.PixelFormat { enum DispCmd : ohos.hdi.display.composer.v1_0.DispCmd { REQUEST_CMD_COMMIT_AND_GET_RELEASE_FENCE = 82, /**< Request cmd */ REQUEST_CMD_SET_DISPLAY_CONSTRAINT = 83, /**< LTPO cmd> */ + REQUEST_CMD_SET_LAYER_PERFRAME_PARAM = 84, REQUEST_CMD_BUTT_V1_2, REPLY_CMD_COMMIT_AND_GET_RELEASE_FENCE = 515, /**< Reply cmd */ REPLY_CMD_BUTT_V1_2, diff --git a/display/composer/v1_2/display_command/display_cmd_requester.h b/display/composer/v1_2/display_command/display_cmd_requester.h index 3197e395..996b4e6c 100644 --- a/display/composer/v1_2/display_command/display_cmd_requester.h +++ b/display/composer/v1_2/display_command/display_cmd_requester.h @@ -295,6 +295,65 @@ EXIT: return HDF_SUCCESS; } + int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key, + const std::vector& value) + { + int32_t ret = 0; + bool retBool = false; + size_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_LAYER_PERFRAME_PARAM, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + retBool = requestPacker_.WriteUint32(devId); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write devId failed", __func__)); + + retBool = requestPacker_.WriteUint64(layerId); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write layerId failed", __func__)); + + uint32_t vectStrSize = key.size(); + retBool = requestPacker_.WriteUint32(vectStrSize); + if (vectStrSize > CmdUtils::MAX_MEMORY) { + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vectStr failed", __func__)); + } + for (uint32_t i = 0; i < vectStrSize; i++) { + retBool = requestPacker_.WriteInt32(static_cast(key[i])); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vectStr failed", __func__)); + } + + uint32_t vectSize = value.size(); + retBool = requestPacker_.WriteUint32(vectSize); + if (vectSize > CmdUtils::MAX_MEMORY) { + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vect failed", __func__)); + } + for (uint32_t i = 0; i < vectSize; i++) { + retBool = requestPacker_.WriteUint8(static_cast(value[i])); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vect failed", __func__)); + } + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("SetLayerPerFrameParameterSmq writePos_ rollback %{public}s, %{public}d, %{public}d", + key.c_str(), devId, layerId); + + return HDF_FAILURE; + } + return HDF_SUCCESS; + } + protected: sptr hdi_1_2_; private: 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 ab3735ac..f01a35a5 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -20,6 +20,7 @@ #include "v1_1/display_command/display_cmd_responser.h" #include "v1_2/display_composer_type.h" #include "v1_2/display_command/display_cmd_utils.h" +#include "hdf_trace.h" #define DISPLAY_TRACE HdfTrace trace(__func__, "HDI:DISP:") @@ -65,6 +66,8 @@ public: OnCommitAndGetReleaseFence(unpacker, outFds); } else if (cmd == REQUEST_CMD_SET_DISPLAY_CONSTRAINT) { OnSetDisplayConstraint(unpacker); + } else if (cmd == REQUEST_CMD_SET_LAYER_PERFRAME_PARAM) { + OnSetLayerPerFrameParam(unpacker); } else { return V1_0::DisplayCmdResponser::ProcessRequestCmd(unpacker, cmd, inFds, outFds); } @@ -305,6 +308,66 @@ EXIT: return ret; } + int32_t OnSetLayerPerFrameParam(CommandDataUnpacker& unpacker) + { + DISPLAY_TRACE; + uint32_t devId = 0; + uint32_t layerId = 0; + std::string key; + std::vector value; + uint32_t vectSize = 0; + uint32_t vectStrSize = 0; + + int32_t ret = unpacker.ReadUint32(devId) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + ret = unpacker.ReadUint32(layerId) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + ret = unpacker.ReadUint32(vectStrSize) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + for (uint32_t i = 0; i < vectStrSize; i++) { + int32_t tmpChar; + ret = unpacker.ReadUint32(tmpChar) ? HDF_SUCCESS : HDF_FAILURE; + if (ret != HDF_SUCCESS) { + break; + } + key.push_back(static_cast(tmpChar)); + } + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + ret = unpacker.ReadUint32(vectSize) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + for (uint32_t i = 0; i < vectSize; i++) { + uint8_t tmpValue; + ret = unpacker.ReadUint8(tmpValue) ? HDF_SUCCESS : HDF_FAILURE; + if (ret != HDF_SUCCESS) { + break; + } + value.push_back(static_cast(tmpValue)); + } + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + HDF_LOGD("OnSetLayerPerFrameParam %{public}s, %{public}d, %{public}d", + key.c_str(), devId, layerId); + + if (impl_ != nullptr && impl_->SetLayerPerFrameParameter != nullptr) { + ret = impl_->SetLayerPerFrameParameter(devId, layerId, key, value); + } + + if (ret != HDF_SUCCESS && ret != DISPLAY_NOT_SUPPORT && ret != HDF_ERR_NOT_SUPPORT) { + HDF_LOGE("OnSetLayerPerFrameParam %{public}s, %{public}d, %{public}d, %{public}d", + key.c_str(), devId, layerId, ret); + } +UNPACKER_EXIT: + if (ret != HDF_SUCCESS) { + errMaps_.emplace(REQUEST_CMD_SET_LAYER_PERFRAME_PARAM, ret); + } + return ret; + } + private: using BaseType1_1 = V1_1::DisplayCmdResponser; using BaseType1_1::replyPacker_; diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 027449fa..3ae00237 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -170,6 +170,12 @@ public: return ToDispErrCode(hdi_v1_2_->FastPresent(devId, param, outHandles)); } + virtual int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key, + const std::vector& value) override + { + return ToDispErrCode(req_v1_2_->SetLayerPerFrameParameter(devId, layerId, key, value)); + } + protected: using BaseType1_1 = V1_1::DisplayComposerHdiImpl; using BaseType1_1::WAIT_TIME_INTERVAL; diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index be2c62cc..8a5a280c 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -76,6 +76,9 @@ public: virtual int32_t FastPresent(uint32_t devId, const PresentParam& param, const std::vector inHandles) = 0; + + virtual int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key, + const std::vector& value) = 0; }; } // V1_2 } // Composer -- Gitee From 8377007c6615de040e235355c43019b881185f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AD=A6=E6=B5=B7?= Date: Tue, 3 Dec 2024 08:43:03 +0000 Subject: [PATCH 259/347] update audio/v4_0/AudioTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 许学海 --- audio/v4_0/AudioTypes.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/v4_0/AudioTypes.idl b/audio/v4_0/AudioTypes.idl index 29a7a96d..0658dff8 100644 --- a/audio/v4_0/AudioTypes.idl +++ b/audio/v4_0/AudioTypes.idl @@ -425,7 +425,7 @@ struct AudioSceneDescriptor { * @brief Defines audio input type. * * @since 4.1 - * @version 3.0 + * @version 3.1 */ enum AudioInputType { AUDIO_INPUT_DEFAULT_TYPE = 0, /**< Assigned default input type */ -- Gitee From 0f9538017e336be967cfcb07b1ea59cd7859baff Mon Sep 17 00:00:00 2001 From: xuedong Date: Tue, 3 Dec 2024 17:10:56 +0800 Subject: [PATCH 260/347] fix: ipc Signed-off-by: xuedong --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 3ae00237..6ab47def 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -173,7 +173,7 @@ public: virtual int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value) override { - return ToDispErrCode(req_v1_2_->SetLayerPerFrameParameter(devId, layerId, key, value)); + return ToDispErrCode(req_v1_2_->SetLayerPerFrameParameterSmq(devId, layerId, key, value)); } protected: -- Gitee From 9cb6350eab1ba8b0b66b2fe41f4d12ec4846eefa Mon Sep 17 00:00:00 2001 From: chenweijian Date: Tue, 3 Dec 2024 17:49:09 +0800 Subject: [PATCH 261/347] any app auth result reuse Change-Id: I3ec37cf6f9417a138c8aac6e8fdfe62f389e3a30 Signed-off-by: chenweijian --- user_auth/v3_0/UserAuthTypes.idl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/user_auth/v3_0/UserAuthTypes.idl b/user_auth/v3_0/UserAuthTypes.idl index 6981b30d..b080723a 100644 --- a/user_auth/v3_0/UserAuthTypes.idl +++ b/user_auth/v3_0/UserAuthTypes.idl @@ -162,13 +162,17 @@ enum UserType : int { * @brief Reuse mode. * * @since 5.0 - * @version 1.0 + * @version 2.0 */ enum ReuseMode : int { - /**< sub user. */ + /**< auth type relevant. */ AUTH_TYPE_RELEVANT = 1, - /**< private user. */ + /**< auth type irrelevant. */ AUTH_TYPE_IRRELEVANT = 2, + /**< caller irrelevant and auth type relevant */ + CALLER_IRRELEVANT_AUTH_TYPE_RELEVANT = 3, + /**< caller irrelevant and auth type irrelevant */ + CALLER_IRRELEVANT_AUTH_TYPE_IRRELEVANT = 4, }; /** -- Gitee From 8ba98501a233d96de81cf708c04840d1fecc665b Mon Sep 17 00:00:00 2001 From: xuedong Date: Tue, 3 Dec 2024 19:13:05 +0800 Subject: [PATCH 262/347] fix: ipc Signed-off-by: xuedong --- display/composer/v1_2/display_command/display_cmd_responser.h | 2 +- 1 file changed, 1 insertion(+), 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 f01a35a5..b4f91482 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -329,7 +329,7 @@ EXIT: for (uint32_t i = 0; i < vectStrSize; i++) { int32_t tmpChar; - ret = unpacker.ReadUint32(tmpChar) ? HDF_SUCCESS : HDF_FAILURE; + ret = unpacker.ReadInt32(tmpChar) ? HDF_SUCCESS : HDF_FAILURE; if (ret != HDF_SUCCESS) { break; } -- Gitee From 0431547aca35be3d552a71f110bec4862b822e09 Mon Sep 17 00:00:00 2001 From: xuedong Date: Wed, 4 Dec 2024 14:24:02 +0800 Subject: [PATCH 263/347] fix: ipc Signed-off-by: xuedong --- display/composer/v1_2/DisplayComposerType.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 9d9e05dd..b3e6e79a 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -83,7 +83,7 @@ enum PixelFormat : ohos.hdi.display.composer.v1_1.PixelFormat { enum DispCmd : ohos.hdi.display.composer.v1_0.DispCmd { REQUEST_CMD_COMMIT_AND_GET_RELEASE_FENCE = 82, /**< Request cmd */ REQUEST_CMD_SET_DISPLAY_CONSTRAINT = 83, /**< LTPO cmd> */ - REQUEST_CMD_SET_LAYER_PERFRAME_PARAM = 84, + REQUEST_CMD_SET_LAYER_PERFRAME_PARAM = 84, /**< SetLayer cmd> */ REQUEST_CMD_BUTT_V1_2, REPLY_CMD_COMMIT_AND_GET_RELEASE_FENCE = 515, /**< Reply cmd */ REPLY_CMD_BUTT_V1_2, -- Gitee From df5cc313883f5356562cdcaaf6626bfd5cc0b494 Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Fri, 6 Dec 2024 10:12:08 +0800 Subject: [PATCH 264/347] add OHOS_CONTROL_QUALITY_PRIORITIZATION tag Signed-off-by: linchengfeng --- .../metadata/include/camera_device_ability_items.h | 13 +++++++++++++ camera/metadata/include/camera_metadata_item_info.h | 2 ++ camera/metadata/src/camera_metadata_info.cpp | 1 + 3 files changed, 16 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 7a1d9f0f..584f776b 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1050,6 +1050,13 @@ typedef enum camera_device_metadata_tag { * (i.e. byte: 0-none/1-purple/2-silver/3-gold) */ OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR, + /** + * ohos.ability.qualityPrioritization [static, byte, public] + * + * camera device property, set current camera quality prioritization + * (i.e. byte ...) + */ + OHOS_CONTROL_QUALITY_PRIORITIZATION, /** * ohos.device.controlEnd * @@ -2696,4 +2703,10 @@ enum CameraSunBlockHint { OHOS_HINT_SUNSCREEN_NO_FULL_COVERAGE = 20, }; +// OHOS_ABILITY_CAMERA_QUALITY_PRIORITIZATION +enum CameraQualityPrioritization { + OHOS_CAMERA_QUALITY_PRIORITIZATION_HIGH_QUALITY = 0, + OHOS_CAMERA_QUALITY_PRIORITIZATION_POWER_BALANCE, +}; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 92ed1c93..89c5dfff 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -275,6 +275,8 @@ static item_info_t g_ohosCameraControl[OHOS_DEVICE_CONTROL_END - OHOS_DEVICE_CON OHOS_DEVICE_CONTROL_START] = {"sunBlockPreviewType", META_TYPE_BYTE, 1}, [OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR - OHOS_DEVICE_CONTROL_START] = {"sunBlockBlendColor", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_QUALITY_PRIORITIZATION - + OHOS_DEVICE_CONTROL_START] = {"qualityPrioritization", 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 159cc612..a16bbe82 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -169,6 +169,7 @@ const std::vector g_metadataTags = { OHOS_CONTROL_FALL_PROTECTION, OHOS_CONTROL_SUN_BLOCK_PREVIEW_TYPE, OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR, + OHOS_CONTROL_QUALITY_PRIORITIZATION, // Camera device image acquisition related OHOS_ABILITY_DEVICE_AVAILABLE_EXPOSUREMODES, -- Gitee From 57d722d97e49e298e4ba1206bcaf5021e2de205c Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Fri, 6 Dec 2024 02:18:47 +0000 Subject: [PATCH 265/347] update camera/sequenceable/map_data/map_data_sequenceable.cpp. Signed-off-by: linchengfeng --- camera/sequenceable/map_data/map_data_sequenceable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/sequenceable/map_data/map_data_sequenceable.cpp b/camera/sequenceable/map_data/map_data_sequenceable.cpp index 8ce44924..ea1ee5c6 100644 --- a/camera/sequenceable/map_data/map_data_sequenceable.cpp +++ b/camera/sequenceable/map_data/map_data_sequenceable.cpp @@ -46,7 +46,7 @@ sptr MapDataSequenceable::Unmarshalling(Parcel &parcel) } int32_t size = parcel.ReadInt32(); - if (size < 0 || size > BUFFER_MAX_USER_DATA_COUNT) { + if (size <= 0 || size > BUFFER_MAX_USER_DATA_COUNT) { HDI_CAMERA_LOGE("invalid size: %{public}d obtained from Parcel", size); return nullptr; } -- Gitee From e957ac5cf4c780a4b8e9b8d9466dc87a433a345b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=B0?= Date: Sat, 7 Dec 2024 10:32:29 +0000 Subject: [PATCH 266/347] update camera/metadata/src/metadata_utils.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘丰 --- camera/metadata/src/metadata_utils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index 34738c63..28126cad 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -102,8 +102,7 @@ bool MetadataUtils::ConvertMetadataToVec(const std::shared_ptr & WriteData(item.data_type, cameraAbility); WriteData(item.count, cameraAbility); if (item.count > MAX_SUPPORTED_ITEMS) { - METADATA_ERR_LOG("ConvertMetadataToVec item.count out of range:%{public}d item:%{public}d", - item.count, item.item); + METADATA_ERR_LOG("ConvertMetadataToVec item.count out of range:%{public}d", item.count); return false; } uint32_t dataPayloadBytes = item.count * OHOS_CAMERA_METADATA_TYPE_SIZE[item.data_type]; -- Gitee From 790454b7c53b2922dc54c753ee44d3462f19c618 Mon Sep 17 00:00:00 2001 From: yangkan Date: Mon, 9 Dec 2024 15:09:13 +0800 Subject: [PATCH 267/347] =?UTF-8?q?OnSetLayerZorder=E5=A2=9E=E5=8A=A0buffe?= =?UTF-8?q?r=E4=B8=BA=E7=A9=BA=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- .../composer/cache_manager/device_cache.cpp | 4 -- .../composer/cache_manager/layer_cache.cpp | 10 ++++- display/composer/cache_manager/layer_cache.h | 1 + .../display_command/display_cmd_responser.h | 39 +++++++++++++++---- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/display/composer/cache_manager/device_cache.cpp b/display/composer/cache_manager/device_cache.cpp index bcd8b945..53667a93 100644 --- a/display/composer/cache_manager/device_cache.cpp +++ b/display/composer/cache_manager/device_cache.cpp @@ -151,8 +151,6 @@ int32_t DeviceCache::SetDisplayClientBuffer(BufferHandle*& buffer, uint32_t seqN HDF_LOGE("%{public}s: call NativeBufferCache fail", __func__)); auto ret = realFunc(*handle); if (ret != HDF_SUCCESS) { - clientBufferCaches_->EraseCache(seqNo); - buffer = nullptr; HDF_LOGE("%{public}s: call realFunc fail", __func__); } @@ -170,8 +168,6 @@ int32_t DeviceCache::SetVirtualDisplayBuffer(BufferHandle*& buffer, uint32_t seq HDF_LOGE("%{public}s: call NativeBufferCache fail", __func__)); ret = realFunc(*handle); if (ret != HDF_SUCCESS) { - outputBufferCaches_->EraseCache(seqNo); - buffer = nullptr; HDF_LOGE("%{public}s: call realFunc fail", __func__); } } else { diff --git a/display/composer/cache_manager/layer_cache.cpp b/display/composer/cache_manager/layer_cache.cpp index 9d153b6a..bd0ffd25 100644 --- a/display/composer/cache_manager/layer_cache.cpp +++ b/display/composer/cache_manager/layer_cache.cpp @@ -50,6 +50,14 @@ LayerCache::~LayerCache() { } +bool LayerCache::IsBufferCacheNotExist() +{ + if (bufferCaches_ == nullptr) { + return true; + } + return bufferCaches_->Size() == 0; +} + int32_t LayerCache::Init() { bufferCaches_.reset(new CacheManager()); @@ -84,8 +92,6 @@ int32_t LayerCache::SetLayerBuffer(BufferHandle*& buffer, uint32_t seqNo, bool & HDF_LOGE("%{public}s: call NativeBufferCache fail", __func__)); int32_t ret = realFunc(*handle); if (ret != HDF_SUCCESS) { - bufferCaches_->EraseCache(seqNo); - buffer = nullptr; HDF_LOGE("%{public}s: call realFunc fail", __func__); } diff --git a/display/composer/cache_manager/layer_cache.h b/display/composer/cache_manager/layer_cache.h index aa171ce7..c850d6d6 100644 --- a/display/composer/cache_manager/layer_cache.h +++ b/display/composer/cache_manager/layer_cache.h @@ -38,6 +38,7 @@ public: const std::vector& deletingList, std::function realFunc); int32_t SetBufferCacheMaxCount(uint32_t cacheCount); int32_t ResetLayerBuffer(); + bool IsBufferCacheNotExist(); void Dump() const; static void NativeBufferInit(sptr& buffer); static void NativeBufferCleanUp(sptr& buffer); 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 76304acb..d039ed04 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -440,10 +440,6 @@ EXIT: #endif // DISPLAY_COMMUNITY if (ret != HDF_SUCCESS) { HDF_LOGE("%{public}s, SetDisplayClientBuffer error", __func__); - if (data.isValidBuffer && data.buffer != nullptr) { - FreeBufferHandle(data.buffer); - data.buffer = nullptr; - } errMaps_.emplace(REQUEST_CMD_SET_DISPLAY_CLIENT_BUFFER, ret); } } @@ -635,6 +631,37 @@ EXIT: return; } + int32_t CheckBufferNotExist(uint32_t devId, uint32_t layerId) + { + if (cacheMgr_ == nullptr) { + HDF_LOGE("%{public}s, cacheMgr_ is null, devId:%{public}d, layerId:%{public}d", + __func__, devId, layerId); + return HDF_FAILURE; + } + + std::lock_guard lock(cacheMgr_->GetCacheMgrMutex()); + DeviceCache* devCache = cacheMgr_->DeviceCacheInstance(devId); + if (devCache == nullptr) { + HDF_LOGE("%{public}s, devCache is null, devId:%{public}d, layerId:%{public}d", + __func__, devId, layerId); + return HDF_FAILURE; + } + + LayerCache* layerCache = devCache->LayerCacheInstance(layerId); + if (layerCache == nullptr) { + HDF_LOGE("%{public}s, layerCache is null, devId:%{public}d, layerId:%{public}d", + __func__, devId, layerId); + return HDF_FAILURE; + } + + if (layerCache->IsBufferCacheNotExist()) { + HDF_LOGE("%{public}s, no buffer in devId:%{public}d, layerId:%{public}d", + __func__, devId, layerId); + return HDF_FAILURE; + } + return HDF_SUCCESS; + } + void OnSetLayerZorder(CommandDataUnpacker& unpacker) { DISPLAY_TRACE; @@ -898,10 +925,6 @@ EXIT: #endif // DISPLAY_COMMUNITY if (ret != HDF_SUCCESS) { HDF_LOGE("%{public}s, SetLayerBuffer error", __func__); - if (data.isValidBuffer && data.buffer != nullptr) { - FreeBufferHandle(data.buffer); - data.buffer = nullptr; - } errMaps_.emplace(REQUEST_CMD_SET_DISPLAY_CLIENT_BUFFER, ret); } -- Gitee From 182a0cacec78219aeae41ccea41387ffc7fb166f Mon Sep 17 00:00:00 2001 From: yangkan Date: Tue, 10 Dec 2024 16:37:12 +0800 Subject: [PATCH 268/347] =?UTF-8?q?SetDisplayVsyncEnabled=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E4=BD=BF=E8=83=BD=E6=8B=A6=E6=88=AA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- display/composer/v1_0/hdi_impl/display_composer_hdi_impl.h | 4 +++- 1 file changed, 3 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 317bc594..ef0d059b 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 @@ -30,6 +30,7 @@ #define LOG_TAG "DISP_HDI_COMP" #undef LOG_DOMAIN #define LOG_DOMAIN 0xD002515 +#define MAX_COUNT 10 namespace OHOS { namespace HDI { @@ -219,7 +220,7 @@ public: COMPOSER_CHECK_NULLPTR_RETURN(hdi_); /* Already enabled, return success */ - if (enabled && vsyncEnableCount_[devId] > 0) { + if (enabled && vsyncEnableCount_[devId] > 0 && vsyncEnableCount_[devId] < MAX_COUNT) { HDF_LOGD("%{public}s: Count[%{public}u] = %{public}u, Skip", __func__, devId, vsyncEnableCount_[devId]); ++vsyncEnableCount_[devId]; return DISPLAY_SUCCESS; @@ -227,6 +228,7 @@ public: int32_t ret = ToDispErrCode(hdi_->SetDisplayVsyncEnabled(devId, enabled)); if (ret != DISPLAY_SUCCESS) { + vsyncEnableCount_[devId] = 0; return ret; } -- Gitee From 244b79d28ddd04e084c8c07ee6dad7e7973a71c2 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Tue, 10 Dec 2024 22:10:38 +0800 Subject: [PATCH 269/347] fix Signed-off-by: liuziwei --- user_auth/v3_0/IUserAuthInterface.idl | 17 ++++++++++++ user_auth/v3_0/UserAuthTypes.idl | 37 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/user_auth/v3_0/IUserAuthInterface.idl b/user_auth/v3_0/IUserAuthInterface.idl index e0684cde..6feacf88 100644 --- a/user_auth/v3_0/IUserAuthInterface.idl +++ b/user_auth/v3_0/IUserAuthInterface.idl @@ -508,5 +508,22 @@ interface IUserAuthInterface { * @version 1.0 */ GetCredentialById([in] unsigned long credentialId, [out] struct CredentialInfo info); + /** + * @brief Verify token and return the plainText. + * + * @param tokenIn Token signed by userAuth. + * @param allowableDuration Allowable duration of token. + * @param tokenPlainOut Token plainText. + * @param rootSecret protection key for the user file key. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.1 + * @version 1.0 + */ + VerifyAuthToken([in] unsigned char[] tokenIn, [in] unsigned long allowableDuration, + [out] struct UserAuthTokenPlain tokenPlainOut, [out] unsigned char[] rootSecret); + } /** @} */ diff --git a/user_auth/v3_0/UserAuthTypes.idl b/user_auth/v3_0/UserAuthTypes.idl index b080723a..f82a50be 100644 --- a/user_auth/v3_0/UserAuthTypes.idl +++ b/user_auth/v3_0/UserAuthTypes.idl @@ -536,4 +536,41 @@ struct GlobalConfigParam { /** Specified authTypes, shouldn't empty. See @{AuthType}.*/ int[] authTypes; }; + +/** + * @brief User auth token plain. + * + * @since 5.1 + * @version 1.0 + */ +struct UserAuthTokenPlain { + /** Token version. */ + unsigned int version; + /** User ID. */ + int userId; + /** Challenge of the token. */ + unsigned char[] challenge; + /** Time interval between token signed and verified. */ + unsigned long timeInterval; + /** Authentication trust level. */ + unsigned int authTrustLevel; + /** Authentication type. See @{AuthType}. */ + int authType; + /** Auth mode. */ + int authMode; + /** Security level. */ + unsigned int securityLevel; + /** Token type. */ + int tokenType; + /** SecureUid of the user. */ + unsigned long secureUid; + /** Enrollment ID. */ + unsigned long enrolledId; + /** Credential ID. */ + unsigned long credentialId; + /** Collector udid. */ + String collectorUdid; + /** Verifier udid. */ + String verifierUdid; +}; /** @} */ \ No newline at end of file -- Gitee From 3e2fa0b27f3e02a65adfc575b968b77829940ed5 Mon Sep 17 00:00:00 2001 From: pxd2022 Date: Tue, 10 Dec 2024 21:05:16 +0800 Subject: [PATCH 270/347] bug fix Signed-off-by: pxd2022 --- display/composer/cache_manager/device_cache_manager.cpp | 6 ++++++ .../composer/common/include/display_vdi_adapter_interface.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/display/composer/cache_manager/device_cache_manager.cpp b/display/composer/cache_manager/device_cache_manager.cpp index 28d94f4b..c696d539 100644 --- a/display/composer/cache_manager/device_cache_manager.cpp +++ b/display/composer/cache_manager/device_cache_manager.cpp @@ -135,12 +135,18 @@ void DeviceCacheManager::Dump() const int32_t DeviceCacheManager::AddCacheInternal(uint32_t deviceId, DeviceCache::DeviceType type) { + auto devCache = deviceCaches_->SearchCache(deviceId); + if (devCache != nullptr && devCache->CacheType() == type) { + HDF_LOGI("AddCacheInternal deviceId:%{public}u, type:%{public}u already exist", deviceId, type); + return HDF_SUCCESS; + } DeviceCache* device = DeviceCache::Create(deviceId, type); DISPLAY_CHK_RETURN(device == nullptr, HDF_FAILURE, HDF_LOGE("%{public}s: Create cache failed", __func__)); bool ret = deviceCaches_->InsertCache(deviceId, device); DISPLAY_CHK_RETURN(ret == false, HDF_FAILURE, HDF_LOGE("%{public}s: insert device cache failed", __func__)); + HDF_LOGI("AddCacheInternal deviceId:%{public}u, type:%{public}u success", deviceId, type); return HDF_SUCCESS; } diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index fddea665..2665da49 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -92,6 +92,8 @@ struct DisplayComposerVdiAdapter { int32_t (*SetDisplayActiveRegion)(uint32_t devId, const IRect& rect); int32_t (*FastPresent)(uint32_t devId, const PresentParam& param, const std::vector& inHandles); + int32_t (*ClearDisplayClientBuffer)(uint32_t devId); + int32_t (*ClearLayerBuffer)(uint32_t devId, uint32_t layerId); }; using LoadVdiImplFunc = int32_t (*)(); @@ -155,6 +157,8 @@ using GetHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, uint32_t& frameCo using SetDisplayActiveRegionFunc = int32_t (*)(uint32_t devId, const IRect& rect); using FastPresentFunc = int32_t (*)(uint32_t devId, const PresentParam& param, const std::vector& inHandles); +using ClearDisplayClientBufferFunc = int32_t (*)(uint32_t devId); +using ClearLayerBufferFunc = int32_t (*)(uint32_t devId, uint32_t layerId); } // namespace Composer } // namespace Display -- Gitee From fbd0bcffa2a599def8296b23e02d99511670606a Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Thu, 12 Dec 2024 17:30:29 +0800 Subject: [PATCH 271/347] fix spelling error Signed-off-by: linchengfeng --- 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 159cc612..b9fc1985 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -980,7 +980,7 @@ int CameraMetadata::MetadataExpandItemMem(common_metadata_header_t *dst, camera_ } if (item->data.offset > UINT32_MAX - (uint32_t)oldItemSize || item->data.offset + (uint32_t)oldItemSize > dst->data_count) { - METADATA_ERR_LOG("MetadataExpandItemMem data.offset:%{public}u, oldItemSize:%{pulic}zu, " + METADATA_ERR_LOG("MetadataExpandItemMem data.offset:%{public}u, oldItemSize:%{public}zu, " "dst->data_count:%{public}u", item->data.offset, oldItemSize, dst->data_count); return CAM_META_FAILURE; } -- Gitee From 5708d27a343f2f2488b73dced47e8c6a8c8b2d35 Mon Sep 17 00:00:00 2001 From: fengyong Date: Fri, 13 Dec 2024 11:33:15 +0800 Subject: [PATCH 272/347] fix hff_idl_headers comoile failed Signed-off-by: fengyong --- nfc/bundle.json | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/nfc/bundle.json b/nfc/bundle.json index 25512d4d..d1c910ea 100644 --- a/nfc/bundle.json +++ b/nfc/bundle.json @@ -28,21 +28,11 @@ "build": { "sub_component": [ "//drivers/interface/nfc/v1_1:nfc_idl_target", - "//drivers/interface/nfc/v1_0:nfc_idl_target", - "//drivers/interface/nfc/v1_1:libnfc_stub_1.1", - "//drivers/interface/nfc/v1_0:libnfc_stub_1.0" + "//drivers/interface/nfc/v1_1:libnfc_stub_1.1" ], "test": [ ], "inner_kits": [ - { - "name": "//drivers/interface/nfc/v1_0:libnfc_proxy_1.0", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/nfc" - } - }, { "name": "//drivers/interface/nfc/v1_1:libnfc_proxy_1.1", "header": { @@ -51,14 +41,6 @@ "header_base": "//drivers/interface/nfc" } }, - { - "name": "//drivers/interface/nfc/v1_0:libnfc_stub_1.0", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/nfc" - } - }, { "name": "//drivers/interface/nfc/v1_1:libnfc_stub_1.1", "header": { @@ -67,14 +49,6 @@ "header_base": "//drivers/interface/nfc" } }, - { - "name": "//drivers/interface/nfc/v1_0:nfc_idl_headers", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/nfc" - } - }, { "name": "//drivers/interface/nfc/v1_1:nfc_idl_headers", "header": { -- Gitee From f0aac2ee6e55810b78df742dda628e90941a17d6 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Sun, 8 Dec 2024 15:10:39 +0800 Subject: [PATCH 273/347] add async transfer interface and struct Signed-off-by: wuyuexiang --- usb/v1_0/IUsbInterface.idl | 24 ++++++++++++++++++++++++ usb/v1_0/IUsbdBulkCallback.idl | 6 ++++-- usb/v1_0/UsbTypes.idl | 16 ++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/usb/v1_0/IUsbInterface.idl b/usb/v1_0/IUsbInterface.idl index e3d63786..376a37fb 100644 --- a/usb/v1_0/IUsbInterface.idl +++ b/usb/v1_0/IUsbInterface.idl @@ -482,4 +482,28 @@ interface IUsbInterface { * @since 3.2 */ BulkCancel([in] struct UsbDev dev, [in] struct UsbPipe pipe); + + /* * + * @brief Submit usb async transfer. + * + * @param dev Indicates the USB device address. + * @param info Indicates the param info of the USB transfer. + * @param cb Indicates the callback function of base. + * @param ashmem Indicates the object of share memory + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 3.2 + */ + UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdBulkCallback cb, [in] Ashmem ashmem); + + /* * + * @brief Cancels the usb async transfer by endpoint. + * + * @param dev Indicates the USB device address. + * @param endpoint Indicates the endpoint address. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 3.2 + */ + UsbCancelTransfer([in] struct UsbDev dev, [in] int endpoint); } \ No newline at end of file diff --git a/usb/v1_0/IUsbdBulkCallback.idl b/usb/v1_0/IUsbdBulkCallback.idl index ded1e176..384b07bc 100644 --- a/usb/v1_0/IUsbdBulkCallback.idl +++ b/usb/v1_0/IUsbdBulkCallback.idl @@ -29,6 +29,8 @@ package ohos.hdi.usb.v1_0; +import ohos.hdi.usb.v1_0.UsbTypes; + /** * @brief Defines the callback for reporting usb data. This callback needs to be registered when * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive @@ -38,8 +40,8 @@ package ohos.hdi.usb.v1_0; */ [callback] interface IUsbdBulkCallback { - OnBulkWriteCallback([in] int status, [in] int actLength); + OnBulkWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned int userData); - OnBulkReadCallback([in] int status, [in] int actLength); + OnBulkReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned int userData); } \ No newline at end of file diff --git a/usb/v1_0/UsbTypes.idl b/usb/v1_0/UsbTypes.idl index 055480eb..1fa601c9 100644 --- a/usb/v1_0/UsbTypes.idl +++ b/usb/v1_0/UsbTypes.idl @@ -68,4 +68,20 @@ struct USBDeviceInfo { int status; int busNum; int devNum; +}; + +struct UsbIsoPacketDescriptor { + int isoLength; + int isoActualLength; + int isoStatus; +}; + +struct USBTransferInfo { + int endpoint; + int flags; + int type; + int timeOut; + int length; + unsigned int userData; + unsigned int numIsoPackets; }; \ No newline at end of file -- Gitee From dafc602affc0d40de2d04418719eca3738d4c171 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Fri, 13 Dec 2024 09:04:39 +0800 Subject: [PATCH 274/347] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuyuexiang --- usb/v1_0/IUsbdBulkCallback.idl | 8 ++++++-- usb/v1_0/UsbTypes.idl | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/usb/v1_0/IUsbdBulkCallback.idl b/usb/v1_0/IUsbdBulkCallback.idl index 384b07bc..14e777d8 100644 --- a/usb/v1_0/IUsbdBulkCallback.idl +++ b/usb/v1_0/IUsbdBulkCallback.idl @@ -40,8 +40,12 @@ import ohos.hdi.usb.v1_0.UsbTypes; */ [callback] interface IUsbdBulkCallback { - OnBulkWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned int userData); + OnBulkWriteCallback([in] int status, [in] int actLength); - OnBulkReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned int userData); + OnBulkReadCallback([in] int status, [in] int actLength); + + OnTransferWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); + + OnTransferReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); } \ No newline at end of file diff --git a/usb/v1_0/UsbTypes.idl b/usb/v1_0/UsbTypes.idl index 1fa601c9..70e9008e 100644 --- a/usb/v1_0/UsbTypes.idl +++ b/usb/v1_0/UsbTypes.idl @@ -82,6 +82,6 @@ struct USBTransferInfo { int type; int timeOut; int length; - unsigned int userData; + unsigned long userData; unsigned int numIsoPackets; }; \ No newline at end of file -- Gitee From 0074c471383b3c3d05394afba4123c9cfc85a44b Mon Sep 17 00:00:00 2001 From: WuXinTao Date: Fri, 13 Dec 2024 20:34:05 +0800 Subject: [PATCH 275/347] add code for errMsg Signed-off-by: wuxintao --- huks/bundle.json | 6 +- huks/v1_1/BUILD.gn | 26 ++ huks/v1_1/IHuks.idl | 520 +++++++++++++++++++++++++++++++++++++++ huks/v1_1/IHuksTypes.idl | 82 ++++++ 4 files changed, 631 insertions(+), 3 deletions(-) create mode 100644 huks/v1_1/BUILD.gn create mode 100644 huks/v1_1/IHuks.idl create mode 100755 huks/v1_1/IHuksTypes.idl diff --git a/huks/bundle.json b/huks/bundle.json index 6e795ca2..09c44364 100755 --- a/huks/bundle.json +++ b/huks/bundle.json @@ -29,13 +29,13 @@ }, "build": { "sub_component": [ - "//drivers/interface/huks/v1_0:huks_idl_target" + "//drivers/interface/huks/v1_1:huks_idl_target" ], "test": [ ], "inner_kits": [ { - "name": "//drivers/interface/huks/v1_0:libhuks_proxy_1.0", + "name": "//drivers/interface/huks/v1_1:libhuks_proxy_1.1", "header": { "header_files": [ ], @@ -43,7 +43,7 @@ } }, { - "name": "//drivers/interface/huks/v1_0:huks_idl_headers", + "name": "//drivers/interface/huks/v1_1:huks_idl_headers", "header": { "header_files": [ ], diff --git a/huks/v1_1/BUILD.gn b/huks/v1_1/BUILD.gn new file mode 100644 index 00000000..8dc7e0fa --- /dev/null +++ b/huks/v1_1/BUILD.gn @@ -0,0 +1,26 @@ +# 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("//build/config/components/hdi/hdi.gni") +hdi("huks") { + module_name = "drivers_peripheral_huks" + + sources = [ + "IHuks.idl", + "IHuksTypes.idl", + ] + language = "c" + subsystem_name = "hdf" + part_name = "drivers_interface_huks" + mode = "passthrough" +} diff --git a/huks/v1_1/IHuks.idl b/huks/v1_1/IHuks.idl new file mode 100644 index 00000000..ca7ee8ac --- /dev/null +++ b/huks/v1_1/IHuks.idl @@ -0,0 +1,520 @@ +/* + * 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 HdfHuks + * @{ + * + * @brief Provides standard driver APIs for OpenHarmony Universal KeyStore (HUKS). + * + * The HUKS driver APIs define standard interfaces of the HUKS Core and provide + * a unified driver interface for the HUKS service. + * You can use these APIs to implement key lifecycle management, including + * key generation, key import and export, key operations, key access control, + * and key attestation. + * + * @since 4.0 + */ + + /** + * @file IHuks.idl + * + * @brief Defines the HUKS driver interfaces for key management. + * + * @since 4.0 + */ + +package ohos.hdi.huks.v1_1; + +import ohos.hdi.huks.v1_1.IHuksTypes; + +/** + * @brief Defines the HUKS driver interfaces for key management. + * + * @since 4.0 + * @version 1.0 + */ +interface IHuks { + /** + * @brief Initializes the HUKS driver. + * + * @return Returns 0 if the initialization is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + ModuleInit(); + + /** + * @brief Destroy the HUKS driver, including clear memory, temp key, etc. + * + * @return Returns 0 if the destory is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + ModuleDestroy(); + + /** + * @brief Generates a key and returns the key in ciphertext. + * + * @param keyAlias Indicates the alias {@link HuksBlob} of the key + * to generate. + * @param paramSet Indicates the property set {@link HuksParamSet} of the + * key to generate. For details about the key property set struct, + * see the HUKS Device Development. + * @param keyIn Indicates the material {@link HuksBlob} of the key + * to generate. This parameter is optional. + * @param encKeyOut Indicates the key {@link HuksBlob} generated in + * ciphertext. For details about the key material struct, see the + * HUKS Device Development. + * + * @return Returns 0 if the key is generated. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + GenerateKey([in] struct HuksBlob keyAlias,[in] struct HuksParamSet paramSet, + [in] struct HuksBlob keyIn, [out] struct HuksBlob encKeyOut); + + /** + * @brief Imports a key in plaintext. + * + * @param keyAlias Indicates the alias {@link HuksBlob} of the key to import. + * @param key Indicates the material {@link HuksBlob} in plaintext of the + * key to import. For details about the key material struct, see the + * HUKS Device Development. + * @param paramSet Indicates the property set {@link HuksParamSet} of the + * key to import. For details about the key property set struct, see the + * HUKS Device Development. + * @param encKeyOut Indicates the key {@link HuksBlob} in ciphertext + * imported. For details about the key material struct, see the + * HUKS Device Development. + * + * @return Returns 0 if the key is imported. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + ImportKey([in] struct HuksBlob keyAlias, [in] struct HuksBlob key, + [in] struct HuksParamSet paramSet, [out] struct HuksBlob encKeyOut); + + /** + * @brief Imports an encrypted key. + * + * @param wrappingKeyAlias Indicates the alias of an intermediate key used + * to wrap the key to import. For details, see {@link HuksBlob}. + * @param wrappingEncKey Indicates the encrypted intermediate + * key {@link HuksBlob}. For details about the key material struct, see the + * HUKS Device Development. + * @param wrappedKeyData Indicates the encrypted key + * material {@link HuksBlob} of the key to import. For details about the + * key material struct, see the HUKS Device Development. + * @param paramSet Indicates the property set {@link HuksParamSet} of the + * key to import. For details about the key property set struct, see the + * HUKS Device Development. + * @param encKeyOut Indicates the key {@link HuksBlob} in ciphertext + * imported. For details about the key material struct, see the + * HUKS Device Development. + * + * @return Returns 0 if the key is imported. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + ImportWrappedKey([in] struct HuksBlob wrappingKeyAlias, [in] struct HuksBlob wrappingEncKey, + [in] struct HuksBlob wrappedKeyData, [in] struct HuksParamSet paramSet, [out] struct HuksBlob encKeyOut); + + /** + * @brief Exports the public key of a key pair. + * + * @param encKey Indicates the key pair material {@link HuksBlob} + * in ciphertext. For details about the key material struct, see the + * HUKS Device Development. + * @param paramSet Indicates the property set {@link HuksParamSet} of the + * key to export. For details about the key property set struct, see the + * HUKS Device Development. + * @param keyOut Indicates the public key material {@link HuksBlob} + * exported. For details about the key material struct, see the + * HUKS Device Development. + * + * @return Returns 0 if the public key is exported. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + ExportPublicKey([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [out] struct HuksBlob keyOut); + + /** + * @brief Initializes a key session, decrypts the key material into memory, + * and returns a handle and a token. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameter set {@link HuksParamSet} used + * for the key operation. It contains parameters for the key operation. + * @param handle Indicates the key session handle {@link HuksBlob} returned + * for subsequent key session operations. + * @param token Indicates the key session token {@link HuksBlob}, + * which is used for key access control. + * + * @see Init | Update| Finish + * + * @return Returns 0 if the session initialization is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Init([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [out]struct HuksBlob handle, + [out] struct HuksBlob token); + + /** + * @brief Updates (processes or passes in) data by segment based on + * the cryptographic algorithm used (for example, in key agreement). + * + * @param handle Indicates the key session handle {@link HuksBlob}, + * which is obtained by {@Init()}. + * @param paramSet Indicates the parameter set {@link HuksParamSet} + * used for the key operation. For details about the key property set + * struct, see the HUKS Device Development. + * @param inData Indicates the data segment or parameters {@link HuksBlob}. + * @param outData Indicates the output data {@link HuksBlob}. + * + * @see Init | Finish | Abort + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Update([in] struct HuksBlob handle, [in] struct HuksParamSet paramSet, + [in] struct HuksBlob inData, [out] struct HuksBlob outData); + + /** + * @brief Finishes the key session operation. + * + * @param handle Indicates the key session handle {@link HuksBlob}. + * @param paramSet Indicates the parameter set {@link HuksParamSet} used + * for the key operation. For details about the key property set struct, + * see the HUKS Device Development. + * @param inData Indicates the data segment or parameters {@link HuksBlob}. + * @param outData Indicates the output data {@link HuksBlob}. + * + * @see Init | Update | Abort + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Finish([in] struct HuksBlob handle, [in] struct HuksParamSet paramSet, + [in] struct HuksBlob inData, [out] struct HuksBlob outData); + + /** + * @brief Aborts a key session and releases the data used in the session. + * The aborted session cannot be operated. + * + * @param handle Indicates the key session handle {@link HuksBlob}. + * @param paramSet Indicates the parameter set {@link HuksParamSet} used + * for the key operation. For details about the key property set struct, + * see the HUKS Device Development. + * + * @see Init | Update | Finish + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Abort([in] struct HuksBlob handle, [in] struct HuksParamSet paramSet); + + /** + * @brief Checks the key validity (integrity of the key and its properties). + * + * @param paramSet Indicates the parameter set {@link HuksParamSet} for + * checking the key validity. For details about the key property set struct, + * see the HUKS Device Development. + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext + * to check. For details about the key material struct, see + * the HUKS Device Development. + * + * @return Returns 0 if the key material is valid. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + CheckKeyValidity([in] struct HuksParamSet paramSet, [in] struct HuksBlob encKey); + + /** + * @brief Obtains the certificate chain for the given key. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used to + * obtain the certificate chain. For details about the key property + * set struct, see the HUKS Device Development. + * @param certChain Indicates the certificate chain {@link HuksBlob} + * obtained. For details about the certificate chain struct, see the + * HUKS Device Development. + * + * @return Returns 0 if the certificate chain is obtained. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + AttestKey([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [out] struct HuksBlob certChain); + + /** + * @brief Generates a random number. + * + * @param paramSet Indicates the parameters {@link HuksParamSet} used to + * generate a random number. For details about the key property set struct, + * see the HUKS Device Development. + * @param random Indicates the random number {@link HuksBlob} generated. + * + * @return Returns 0 if a random number is generated. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + GenerateRandom([in] struct HuksParamSet paramSet, [out]struct HuksBlob random); + + /** + * @brief Generates a signature for data using a key. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used for signing. + * For details about the key property set struct, see the HUKS Device Development. + * @param srcData Indicates the data {@link HuksBlob} to be signed. + * @param signature Indicates the signature {@link HuksBlob} generated. + * + * @return Returns 0 if a signature is generated. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Sign([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [in] struct HuksBlob srcData, + [out]struct HuksBlob signature); + + /** + * @brief Verifies a signature. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used for + * signature verification. For details about the key property set struct, + * see the HUKS Device Development. + * @param srcData Indicates the data {@link HuksBlob} whose signature is + * to be verified. + * @param signature Indicates the signature {@link HuksBlob} to verify. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Verify([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [in] struct HuksBlob srcData, + [in] struct HuksBlob signature); + + /** + * @brief Encrypts data using a key. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used for + * encryption. For details about the key property set struct, see the + * HUKS Device Development. + * @param plainText Indicates the data {@link HuksBlob} to encrypt. + * @param cipherText indicates the data {@link HuksBlob} in ciphertext. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Encrypt([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [in] struct HuksBlob plainText, + [out] struct HuksBlob cipherText); + + /** + * @brief Decrypts data using a key. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used for + * decryption. For details about the key property set struct, see the + * HUKS Device Development. + * @param cipherText indicates the data {@link HuksBlob} in ciphertext to decrypt. + * @param plainText Indicates the decrypted data {@link HuksBlob} in plaintext. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Decrypt([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [in] struct HuksBlob cipherText, + [out] struct HuksBlob plainText); + + /** + * @brief Performs key agreement using a private key stored in the HUKS + * and the public key of the service. + * + * @param paramSet Indicates the parameters {@link HuksParamSet} used + * for key agreement. + * @param encPrivateKey Indicates the key pair material {@link HuksBlob} + * stored in the HUKS. For details about the key material struct, see the + * HUKS Device Development. + * @param peerPublicKey Indicates the public key {@link HuksBlob} used + * for key agreement. + * @param agreedKey Indicates the key {@link HuksBlob} in plaintext obtained + * after key agreement. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + AgreeKey([in] struct HuksParamSet paramSet, [in] struct HuksBlob encPrivateKey, [in] struct HuksBlob peerPublicKey, + [out] struct HuksBlob agreedKey); + + /** + * @brief Derives a key from a key stored in the HUKS. + * + * @param paramSet Indicates the parameters {@link HuksParamSet} used for + * key derivation. For details about the key property set struct, see the + * HUKS Device Development. + * @param encKdfKey Indicates the key material {@link HuksBlob} stored + * in the HUKS. For details about the key material struct, see the + * HUKS Device Development. + * @param derivedKey Indicates the derived key {@link HuksBlob} in plaintext. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + DeriveKey([in] struct HuksParamSet paramSet, [in] struct HuksBlob encKdfKey, [out] struct HuksBlob derivedKey); + + /** + * @brief Generates a message authentication code (MAC) using a key + * stored in the HUKS. + * + * @param encKey Indicates the key material {@link HuksBlob} in ciphertext. + * For details about the key material struct, see the HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used for + * generating a MAC. For details about the key property set struct, see the + * HUKS Device Development. + * @param srcData Indicates the data {@link HuksBlob} used to generate a MAC. + * @param mac Indicates the MAC {@link HuksBlob} generated. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + Mac([in] struct HuksBlob encKey, [in] struct HuksParamSet paramSet, [in] struct HuksBlob srcData, + [out] struct HuksBlob mac); + + /** + * @brief Upgrades a key, including its encryption mode and encryption + * material. The HUKS service triggers the upgrade when the key file version + * is earlier than the latest version. + * + * @param encOldKey Indicates the key material {@link HuksBlob} in + * ciphertext to upgrade. For details about the key material struct, see the + * HUKS Device Development. + * @param paramSet Indicates the parameters {@link HuksParamSet} used for + * the upgrade. For details about the key property set struct, see the + * HUKS Device Development. + * @param encNewKey Indicates the key material {@link HuksBlob} in + * ciphertext after the upgrade. For details about the key material struct, + * see the HUKS Device Development. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + UpgradeKey([in] struct HuksBlob encOldKey, [in] struct HuksParamSet paramSet, [out] struct HuksBlob encNewKey); + + /** + * @brief Exports the public key of a chipset key pair. + * + * @param salt Indicates the salt {@link HuksBlob} used to derive the key + * pair of the chipset. + * @param scene Indicates the expected chipset decryption + * scenario {@link HuksParamSet} of the service. For details about the + * key property set struct, see the HUKS Device Development. + * @param publicKey Indicates the public key material {@link HuksBlob} + * exported, for example, the raw data (32 bytes) of the x-axis and y-axis + * values of ECC-P256. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 4.0 + * @version 1.0 + */ + ExportChipsetPlatformPublicKey([in] struct HuksBlob salt, [in] enum HuksChipsetPlatformDecryptScene scene, + [out] struct HuksBlob publicKey); + + /** + * @brief Get the detailed error information of the last called function. + * + * @param errorInfo Indicates the detailed error information {@link HuksBlob. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 5.1 + * @version 1.0 + */ + GetErrorInfo([out] struct HuksBlob errorInfo); + + /** + * @brief Get the runtime statistics of driver layer of the last called function. + * + * @param statInfo Indicates the runtime statistics information {@link HuksBlob}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value otherwise. + * + * @since 5.1 + * @version 1.0 + */ + GetStatInfo([out] struct HuksBlob statInfo); +} +/** @} */ \ No newline at end of file diff --git a/huks/v1_1/IHuksTypes.idl b/huks/v1_1/IHuksTypes.idl new file mode 100755 index 00000000..bab35018 --- /dev/null +++ b/huks/v1_1/IHuksTypes.idl @@ -0,0 +1,82 @@ +/* + * 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 HdfHuks + * @{ + * + * @brief Provides standard driver APIs for the OpenHarmony Universal KeyStore (HUKS). + * + * The HUKS driver APIs define standard interfaces of the HUKS Core and provide + * a unified driver interface for the HUKS service. + * You can use these APIs to implement key lifecycle management, including key + * generation, key import and export, key operations, key access control, and + * key attestation. + * + * @since 4.0 + */ + + /** + * @file IHuksTypes.idl + * + * @brief Defines the structs used in HUKS driver interfaces. + * + * @since 4.0 + */ + +package ohos.hdi.huks.v1_1; + +/** + * @brief Defines the HUKS binary data struct, which encapsulates parameters + * such as the key material and key properties. + * + * @since 4.0 + * @version 1.0 + */ +struct HuksBlob { + /** + * Binary data + */ + unsigned char[] data; +}; + +/** + * @brief Defines the struct for the parameter set of HUKS key management interfaces. + * + * @since 4.0 + * @version 1.0 + */ +struct HuksParamSet { + /** + * Serialized parameter set. For details about the property set struct, + * see the HUKS Device Development. + */ + unsigned char[] data; +}; + +/** + * @brief Enumerates the decryption scenarios using the chipset key. + * + * @since 4.0 + * @version 1.0 + */ +enum HuksChipsetPlatformDecryptScene { + /** + * Chipset key decryption for trusted applications in a Trusted Execution + * Environment (TEE). + */ + HUKS_CHIPSET_PLATFORM_DECRYPT_SCENCE_TA_TO_TA = 1, +}; +/** @} */ \ No newline at end of file -- Gitee From f1c003de334f11e423ea33d244497a90f7a38c3f Mon Sep 17 00:00:00 2001 From: yanguofeng Date: Mon, 16 Dec 2024 14:23:50 +0800 Subject: [PATCH 276/347] feat:ar system type fix Signed-off-by: yanguofeng --- activity_recognition/bundle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity_recognition/bundle.json b/activity_recognition/bundle.json index 8ce7dcb6..1acb673a 100644 --- a/activity_recognition/bundle.json +++ b/activity_recognition/bundle.json @@ -12,7 +12,7 @@ "component": { "name": "drivers_interface_act_recg", "subsystem": "hdf", - "adapted_system_type": ["standard"], + "adapted_system_type": ["small", "standard"], "rom": "150KB", "ram": "200KB", "deps": { -- Gitee From 6cdc69cee9878b21ec36c51f7eb5dc5670fe3d93 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Wed, 18 Dec 2024 10:17:39 +0800 Subject: [PATCH 277/347] update start version Signed-off-by: wuyuexiang --- usb/v1_0/IUsbInterface.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usb/v1_0/IUsbInterface.idl b/usb/v1_0/IUsbInterface.idl index 376a37fb..1b678437 100644 --- a/usb/v1_0/IUsbInterface.idl +++ b/usb/v1_0/IUsbInterface.idl @@ -492,7 +492,7 @@ interface IUsbInterface { * @param ashmem Indicates the object of share memory * * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. - * @since 3.2 + * @since 5.0 */ UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdBulkCallback cb, [in] Ashmem ashmem); @@ -503,7 +503,7 @@ interface IUsbInterface { * @param endpoint Indicates the endpoint address. * * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. - * @since 3.2 + * @since 5.0 */ UsbCancelTransfer([in] struct UsbDev dev, [in] int endpoint); } \ No newline at end of file -- Gitee From 4156f158ddf05a7f0b6de2ff6df002d933cd89bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Fri, 20 Dec 2024 02:37:42 +0000 Subject: [PATCH 278/347] modify mtp interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl b/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl index 75ee4e95..b0bf99b3 100644 --- a/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl +++ b/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl @@ -50,7 +50,7 @@ import ohos.hdi.usb.gadget.mtp.v1_0.UsbfnMtpTypes; interface IUsbfnMtpInterface { /* * - * @brief Opens a USB MTP/PTP driver. + * @brief Open a USB MTP/PTP driver and init resources. * * @param None No parameter needed. * @@ -61,7 +61,7 @@ interface IUsbfnMtpInterface { Start(); /* * - * @brief Closes a USB MTP/PTP driver. + * @brief Close a USB MTP/PTP driver and release resources. * * @param None No parameter needed. * @@ -72,7 +72,7 @@ interface IUsbfnMtpInterface { Stop(); /* * - * @brief Read data by USB MTP/PTP driver. + * @brief Read data by adding a task to readqueue. * * @param data Indicates the data read by USB MTP/PTP driver. * @@ -83,7 +83,7 @@ interface IUsbfnMtpInterface { Read([out] unsigned char[] data); /* * - * @brief Write data by USB MTP/PTP driver. + * @brief Write data by adding a task to writequeue. * * @param data Indicates the data write to USB MTP/PTP driver. * @@ -131,7 +131,7 @@ interface IUsbfnMtpInterface { SendEvent([in] unsigned char[] eventData); /* * - * @brief Init a USB MTP/PTP driver. Used by usb_host. + * @brief Init a USB MTP/PTP port. Used by usb_host. * * @param None No parameter needed. * @@ -142,7 +142,7 @@ interface IUsbfnMtpInterface { Init(); /* * - * @brief Release a USB MTP/PTP driver. Used by usb_host. + * @brief Release a USB MTP/PTP port. Used by usb_host. * * @param None No parameter needed. * -- Gitee From 429418c9ad3f36cdd1d22bb29e7697c217b93646 Mon Sep 17 00:00:00 2001 From: ying1210 Date: Fri, 20 Dec 2024 16:07:49 +0800 Subject: [PATCH 279/347] wifi sta info report Signed-off-by: ying1210 --- wlan/bundle.json | 25 ++++++++++++++++++ wlan/wpa/v1_2/BUILD.gn | 32 +++++++++++++++++++++++ wlan/wpa/v1_2/IWpaInterface.idl | 45 +++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 wlan/wpa/v1_2/BUILD.gn create mode 100644 wlan/wpa/v1_2/IWpaInterface.idl diff --git a/wlan/bundle.json b/wlan/bundle.json index af29ce5a..957e8f54 100644 --- a/wlan/bundle.json +++ b/wlan/bundle.json @@ -31,6 +31,7 @@ "//drivers/interface/wlan/v1_3:wlan_idl_target", "//drivers/interface/wlan/wpa/v1_0:wpa_idl_target", "//drivers/interface/wlan/wpa/v1_1:wpa_idl_target", + "//drivers/interface/wlan/wpa/v1_2:wpa_idl_target", "//drivers/interface/wlan/hostapd/v1_0:hostapd_idl_target", "//drivers/interface/wlan/chip/v1_0:chip_idl_target" ], @@ -156,6 +157,30 @@ ], "header_base": "//drivers/interface/wlan/wpa" } + }, + { + "name": "//drivers/interface/wlan/wpa/v1_2:libwpa_proxy_1.2", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/wlan/wpa" + } + }, + { + "name": "//drivers/interface/wlan/wpa/v1_2:wpa_idl_headers", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/wlan/wpa" + } + }, + { + "name": "//drivers/interface/wlan/wpa/v1_2:libwpa_stub_1.2", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/wlan/wpa" + } }, { "name": "//drivers/interface/wlan/hostapd/v1_0:libhostapd_proxy_1.0", diff --git a/wlan/wpa/v1_2/BUILD.gn b/wlan/wpa/v1_2/BUILD.gn new file mode 100644 index 00000000..1a3186c0 --- /dev/null +++ b/wlan/wpa/v1_2/BUILD.gn @@ -0,0 +1,32 @@ +# 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("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libwpa_proxy_1.2") { + deps = [] + public_configs = [] + } +} else { + hdi("wpa") { + module_name = "wpa_service" + + sources = [ + "IWpaInterface.idl", + ] + + language = "c" + subsystem_name = "hdf" + part_name = "drivers_interface_wlan" + } +} diff --git a/wlan/wpa/v1_2/IWpaInterface.idl b/wlan/wpa/v1_2/IWpaInterface.idl new file mode 100644 index 00000000..04418577 --- /dev/null +++ b/wlan/wpa/v1_2/IWpaInterface.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 IWpaInterface.idl + * + * @brief Provides APIs to enable or disable a WLAN hotspot, scan for hotspots, connect to or disconnect from a WLAN hotspot, + * set the country code, and manage network devices. + * + * @since 5.1 + * @version 1.2 + */ + +package ohos.hdi.wlan.wpa.v1_2; + +import ohos.hdi.wlan.wpa.v1_1.IWpaInterface; + +interface IWpaInterface extends ohos.hdi.wlan.wpa.v1_1.IWpaInterface { + /** + * @brief Get Sta data from wpa_supplicant + * + * @param ifName Indicates the NIC name. + * @param staParam Indicates the param of sta to get data. + * @param staData Indicates the data obtained. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.1 + * @version 1.0 + */ + GetWpaStaData([in] String ifName, [in] String staParam, [out] String staData); +} -- Gitee From 43b778b4dd28cc998f4a75771cadd8dfafd04a51 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Fri, 20 Dec 2024 16:09:38 +0800 Subject: [PATCH 280/347] update idl callback Signed-off-by: wuyuexiang --- usb/v1_0/BUILD.gn | 1 + usb/v1_0/IUsbInterface.idl | 3 +- usb/v1_0/IUsbdBulkCallback.idl | 6 ---- usb/v1_0/IUsbdTransferCallback.idl | 47 ++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 usb/v1_0/IUsbdTransferCallback.idl diff --git a/usb/v1_0/BUILD.gn b/usb/v1_0/BUILD.gn index 30d2ad76..6019e94c 100644 --- a/usb/v1_0/BUILD.gn +++ b/usb/v1_0/BUILD.gn @@ -24,6 +24,7 @@ if (defined(ohos_lite)) { sources = [ "IUsbInterface.idl", "IUsbdBulkCallback.idl", + "IUsbdTransferCallback.idl", "IUsbdSubscriber.idl", "UsbTypes.idl", ] diff --git a/usb/v1_0/IUsbInterface.idl b/usb/v1_0/IUsbInterface.idl index 1b678437..11b38ac7 100644 --- a/usb/v1_0/IUsbInterface.idl +++ b/usb/v1_0/IUsbInterface.idl @@ -43,6 +43,7 @@ package ohos.hdi.usb.v1_0; import ohos.hdi.usb.v1_0.UsbTypes; import ohos.hdi.usb.v1_0.IUsbdSubscriber; import ohos.hdi.usb.v1_0.IUsbdBulkCallback; +import ohos.hdi.usb.v1_0.IUsbdTransferCallback; /* * * @brief Defines the functions for performing basic operations on usb. @@ -494,7 +495,7 @@ interface IUsbInterface { * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. * @since 5.0 */ - UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdBulkCallback cb, [in] Ashmem ashmem); + UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdTransferCallback cb, [in] Ashmem ashmem); /* * * @brief Cancels the usb async transfer by endpoint. diff --git a/usb/v1_0/IUsbdBulkCallback.idl b/usb/v1_0/IUsbdBulkCallback.idl index 14e777d8..ded1e176 100644 --- a/usb/v1_0/IUsbdBulkCallback.idl +++ b/usb/v1_0/IUsbdBulkCallback.idl @@ -29,8 +29,6 @@ package ohos.hdi.usb.v1_0; -import ohos.hdi.usb.v1_0.UsbTypes; - /** * @brief Defines the callback for reporting usb data. This callback needs to be registered when * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive @@ -43,9 +41,5 @@ import ohos.hdi.usb.v1_0.UsbTypes; OnBulkWriteCallback([in] int status, [in] int actLength); OnBulkReadCallback([in] int status, [in] int actLength); - - OnTransferWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); - - OnTransferReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); } \ No newline at end of file diff --git a/usb/v1_0/IUsbdTransferCallback.idl b/usb/v1_0/IUsbdTransferCallback.idl new file mode 100644 index 00000000..d0417ad7 --- /dev/null +++ b/usb/v1_0/IUsbdTransferCallback.idl @@ -0,0 +1,47 @@ +/* + * 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. + * + * @version 1.0 + */ + +package ohos.hdi.usb.v1_0; + +import ohos.hdi.usb.v1_0.UsbTypes; + +/** + * @brief Defines the callback for reporting usb data. This callback needs to be registered when + * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive + * usb data. For details, see {@link IUsbInterface}. + * + * @since 5.0 + */ +[callback] interface IUsbdTransferCallback { + + OnTransferWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); + + OnTransferReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); + +} \ No newline at end of file -- Gitee From 5f4082e619b921ab27d950477e55224aee596050 Mon Sep 17 00:00:00 2001 From: ying1210 Date: Fri, 20 Dec 2024 16:41:06 +0800 Subject: [PATCH 281/347] wifi sta info report Signed-off-by: ying1210 --- wlan/bundle.json | 2 +- wlan/wpa/v1_2/BUILD.gn | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/wlan/bundle.json b/wlan/bundle.json index 957e8f54..278edefd 100644 --- a/wlan/bundle.json +++ b/wlan/bundle.json @@ -158,7 +158,7 @@ "header_base": "//drivers/interface/wlan/wpa" } }, - { + { "name": "//drivers/interface/wlan/wpa/v1_2:libwpa_proxy_1.2", "header": { "header_files": [ diff --git a/wlan/wpa/v1_2/BUILD.gn b/wlan/wpa/v1_2/BUILD.gn index 1a3186c0..7b5dbfaf 100644 --- a/wlan/wpa/v1_2/BUILD.gn +++ b/wlan/wpa/v1_2/BUILD.gn @@ -21,9 +21,7 @@ if (defined(ohos_lite)) { hdi("wpa") { module_name = "wpa_service" - sources = [ - "IWpaInterface.idl", - ] + sources = [ "IWpaInterface.idl" ] language = "c" subsystem_name = "hdf" -- Gitee From c746c61db15e297212241844c81ab7a817f3d113 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Fri, 20 Dec 2024 17:11:26 +0800 Subject: [PATCH 282/347] update interface gn Signed-off-by: wuyuexiang --- usb/v1_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/v1_0/BUILD.gn b/usb/v1_0/BUILD.gn index 6019e94c..b4d42a1d 100644 --- a/usb/v1_0/BUILD.gn +++ b/usb/v1_0/BUILD.gn @@ -24,8 +24,8 @@ if (defined(ohos_lite)) { sources = [ "IUsbInterface.idl", "IUsbdBulkCallback.idl", - "IUsbdTransferCallback.idl", "IUsbdSubscriber.idl", + "IUsbdTransferCallback.idl", "UsbTypes.idl", ] -- Gitee From dc76d0b4cec8dbfc60b2c9dcbe11aa12e1fc42b1 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Mon, 23 Dec 2024 11:47:41 +0800 Subject: [PATCH 283/347] update to V1_2 Signed-off-by: wuyuexiang --- usb/bundle.json | 22 +++++ usb/v1_0/BUILD.gn | 1 - usb/v1_0/IUsbInterface.idl | 25 ------ usb/v1_0/UsbTypes.idl | 16 ---- usb/v1_2/BUILD.gn | 35 ++++++++ usb/v1_2/IUsbInterface.idl | 86 ++++++++++++++++++++ usb/{v1_0 => v1_2}/IUsbdTransferCallback.idl | 7 +- usb/v1_2/UsbTypes.idl | 57 +++++++++++++ 8 files changed, 203 insertions(+), 46 deletions(-) create mode 100644 usb/v1_2/BUILD.gn create mode 100644 usb/v1_2/IUsbInterface.idl rename usb/{v1_0 => v1_2}/IUsbdTransferCallback.idl (95%) create mode 100644 usb/v1_2/UsbTypes.idl diff --git a/usb/bundle.json b/usb/bundle.json index 8fdca89e..f24c4ad4 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -32,6 +32,7 @@ "sub_component": [ "//drivers/interface/usb/v1_0:usb_idl_target", "//drivers/interface/usb/v1_1:usb_idl_target", + "//drivers/interface/usb/v1_2:usb_idl_target", "//drivers/interface/usb/gadget/mtp/v1_0:usbfn_mtp_idl_target", "//drivers/interface/usb/ddk/v1_0:usb_ddk_idl_target" ], @@ -120,6 +121,27 @@ "header_files": [], "header_base": "//drivers/interface/usb" } + }, + { + "name": "//drivers/interface/usb/v1_2:libusb_proxy_1.2", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb" + } + }, + { + "name": "//drivers/interface/usb/v1_2:libusb_stub_1.2", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb" + } + }, + { + "name": "//drivers/interface/usb/v1_2:usb_idl_headers_1.2", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb" + } } ] } diff --git a/usb/v1_0/BUILD.gn b/usb/v1_0/BUILD.gn index b4d42a1d..30d2ad76 100644 --- a/usb/v1_0/BUILD.gn +++ b/usb/v1_0/BUILD.gn @@ -25,7 +25,6 @@ if (defined(ohos_lite)) { "IUsbInterface.idl", "IUsbdBulkCallback.idl", "IUsbdSubscriber.idl", - "IUsbdTransferCallback.idl", "UsbTypes.idl", ] diff --git a/usb/v1_0/IUsbInterface.idl b/usb/v1_0/IUsbInterface.idl index 11b38ac7..e3d63786 100644 --- a/usb/v1_0/IUsbInterface.idl +++ b/usb/v1_0/IUsbInterface.idl @@ -43,7 +43,6 @@ package ohos.hdi.usb.v1_0; import ohos.hdi.usb.v1_0.UsbTypes; import ohos.hdi.usb.v1_0.IUsbdSubscriber; import ohos.hdi.usb.v1_0.IUsbdBulkCallback; -import ohos.hdi.usb.v1_0.IUsbdTransferCallback; /* * * @brief Defines the functions for performing basic operations on usb. @@ -483,28 +482,4 @@ interface IUsbInterface { * @since 3.2 */ BulkCancel([in] struct UsbDev dev, [in] struct UsbPipe pipe); - - /* * - * @brief Submit usb async transfer. - * - * @param dev Indicates the USB device address. - * @param info Indicates the param info of the USB transfer. - * @param cb Indicates the callback function of base. - * @param ashmem Indicates the object of share memory - * - * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. - * @since 5.0 - */ - UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdTransferCallback cb, [in] Ashmem ashmem); - - /* * - * @brief Cancels the usb async transfer by endpoint. - * - * @param dev Indicates the USB device address. - * @param endpoint Indicates the endpoint address. - * - * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. - * @since 5.0 - */ - UsbCancelTransfer([in] struct UsbDev dev, [in] int endpoint); } \ No newline at end of file diff --git a/usb/v1_0/UsbTypes.idl b/usb/v1_0/UsbTypes.idl index 70e9008e..e9d744d7 100644 --- a/usb/v1_0/UsbTypes.idl +++ b/usb/v1_0/UsbTypes.idl @@ -69,19 +69,3 @@ struct USBDeviceInfo { int busNum; int devNum; }; - -struct UsbIsoPacketDescriptor { - int isoLength; - int isoActualLength; - int isoStatus; -}; - -struct USBTransferInfo { - int endpoint; - int flags; - int type; - int timeOut; - int length; - unsigned long userData; - unsigned int numIsoPackets; -}; \ No newline at end of file diff --git a/usb/v1_2/BUILD.gn b/usb/v1_2/BUILD.gn new file mode 100644 index 00000000..885c5b4c --- /dev/null +++ b/usb/v1_2/BUILD.gn @@ -0,0 +1,35 @@ +# 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("//build/config/components/hdi/hdi.gni") +if (defined(ohos_lite)) { + group("libusb_proxy_1.2") { + deps = [] + public_configs = [] + } +} else { + hdi("usb") { + module_name = "usbd" + imports = [ "ohos.hdi.usb.v1_1:usb" ] + + sources = [ + "IUsbInterface.idl", + "UsbTypes.idl", + "IUsbdTransferCallback.idl", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_usb" + } +} diff --git a/usb/v1_2/IUsbInterface.idl b/usb/v1_2/IUsbInterface.idl new file mode 100644 index 00000000..eeb7ff09 --- /dev/null +++ b/usb/v1_2/IUsbInterface.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.1 + */ + +/* * + * @file IUsbInterface.idl + * + * @brief Declares the APIs provided by the usb module for 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v1_2; + +import ohos.hdi.usb.v1_2.UsbTypes; +import ohos.hdi.usb.v1_2.IUsbdTransferCallback; +import ohos.hdi.usb.v1_1.UsbTypes; +import ohos.hdi.usb.v1_1.IUsbInterface; +/* +import ohos.hdi.usb.v1_0.UsbTypes; +import ohos.hdi.usb.v1_0.IUsbdSubscriber; +import ohos.hdi.usb.v1_0.IUsbdBulkCallback; +import ohos.hdi.usb.v1_0.IUsbInterface; +*/ +/* * + * @brief Defines the functions for performing basic operations on usb. + * + * The operations include 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. + */ +interface IUsbInterface extends ohos.hdi.usb.v1_1.IUsbInterface{ + + /* * + * @brief Submit usb async transfer. + * + * @param dev Indicates the USB device address. + * @param info Indicates the param info of the USB transfer. + * @param cb Indicates the callback function of base. + * @param ashmem Indicates the object of share memory + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdTransferCallback cb, [in] Ashmem ashmem); + + /* * + * @brief Cancels the usb async transfer by endpoint. + * + * @param dev Indicates the USB device address. + * @param endpoint Indicates the endpoint address. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UsbCancelTransfer([in] struct UsbDev dev, [in] int endpoint); +} \ No newline at end of file diff --git a/usb/v1_0/IUsbdTransferCallback.idl b/usb/v1_2/IUsbdTransferCallback.idl similarity index 95% rename from usb/v1_0/IUsbdTransferCallback.idl rename to usb/v1_2/IUsbdTransferCallback.idl index d0417ad7..2ef797d6 100644 --- a/usb/v1_0/IUsbdTransferCallback.idl +++ b/usb/v1_2/IUsbdTransferCallback.idl @@ -15,7 +15,6 @@ /** * @addtogroup HdiUsb - * @{ * * @brief Provides unified APIs for usb services to access usb drivers. * @@ -27,16 +26,16 @@ * @version 1.0 */ -package ohos.hdi.usb.v1_0; +package ohos.hdi.usb.v1_2; -import ohos.hdi.usb.v1_0.UsbTypes; +import ohos.hdi.usb.v1_2.UsbTypes; /** * @brief Defines the callback for reporting usb data. This callback needs to be registered when * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive * usb data. For details, see {@link IUsbInterface}. * - * @since 5.0 + * @since 5.1 */ [callback] interface IUsbdTransferCallback { diff --git a/usb/v1_2/UsbTypes.idl b/usb/v1_2/UsbTypes.idl new file mode 100644 index 00000000..a8f83cea --- /dev/null +++ b/usb/v1_2/UsbTypes.idl @@ -0,0 +1,57 @@ +/* + * 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.1 + */ + +/** + * @file UsbTypes.idl + * + * @brief Defines the data used by the usb module, including the usb information, + * and reported usb data. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v1_2; + +import ohos.hdi.usb.v1_1.UsbTypes; + +struct UsbIsoPacketDescriptor { + int isoLength; + int isoActualLength; + int isoStatus; +}; + +struct USBTransferInfo { + int endpoint; + int flags; + int type; + int timeOut; + int length; + unsigned long userData; + unsigned int numIsoPackets; +}; \ No newline at end of file -- Gitee From 2839f239e5bca42087be3ec2af3c9bb8b0b8392f Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Mon, 23 Dec 2024 13:19:47 +0800 Subject: [PATCH 284/347] gn check Signed-off-by: wuyuexiang --- usb/v1_2/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/v1_2/BUILD.gn b/usb/v1_2/BUILD.gn index 885c5b4c..1f687346 100644 --- a/usb/v1_2/BUILD.gn +++ b/usb/v1_2/BUILD.gn @@ -24,8 +24,8 @@ if (defined(ohos_lite)) { sources = [ "IUsbInterface.idl", - "UsbTypes.idl", "IUsbdTransferCallback.idl", + "UsbTypes.idl", ] language = "cpp" -- Gitee From 64510b13a0eb85583146d5b33c85bb276b18b1fc Mon Sep 17 00:00:00 2001 From: yangkan Date: Tue, 24 Dec 2024 14:20:24 +0800 Subject: [PATCH 285/347] =?UTF-8?q?sensor=E5=BC=82=E6=AD=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=8A=E6=8A=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- sensor/bundle.json | 19 ++++++- sensor/v2_1/BUILD.gn | 39 ++++++++++++++ sensor/v2_1/ISensorCallback.idl | 50 ++++++++++++++++++ sensor/v2_1/ISensorInterface.idl | 87 ++++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 sensor/v2_1/BUILD.gn create mode 100644 sensor/v2_1/ISensorCallback.idl create mode 100644 sensor/v2_1/ISensorInterface.idl diff --git a/sensor/bundle.json b/sensor/bundle.json index 1394cdea..34857b18 100644 --- a/sensor/bundle.json +++ b/sensor/bundle.json @@ -27,7 +27,8 @@ }, "build": { "sub_component": [ - "//drivers/interface/sensor/v2_0:sensor_idl_target" + "//drivers/interface/sensor/v2_0:sensor_idl_target", + "//drivers/interface/sensor/v2_1:sensor_idl_target" ], "test": [ ], @@ -55,6 +56,22 @@ ], "header_base": "//drivers/interface/sensor" } + }, + { + "name": "//drivers/interface/sensor/v2_1:libsensor_proxy_2.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/sensor" + } + }, + { + "name": "//drivers/interface/sensor/v2_1:libsensor_stub_2.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/sensor" + } } ] } diff --git a/sensor/v2_1/BUILD.gn b/sensor/v2_1/BUILD.gn new file mode 100644 index 00000000..13dcd572 --- /dev/null +++ b/sensor/v2_1/BUILD.gn @@ -0,0 +1,39 @@ +# 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("//build/config/components/hdi/hdi.gni") +if (defined(ohos_lite)) { + group("libsensor_proxy_2.1") { + deps = [] + public_configs = [] + } +} else { + hdi("sensor") { + module_name = "sensor_service" + + sources = [ + "ISensorCallback.idl", + "ISensorInterface.idl", + "SensorTypes.idl", + ] + + deps = [ + "//drivers/interface/sensor/v2_0:libsensor_proxy_2.0", + "//drivers/interface/sensor/v2_0:libsensor_stub_2.0", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_sensor" + } +} diff --git a/sensor/v2_1/ISensorCallback.idl b/sensor/v2_1/ISensorCallback.idl new file mode 100644 index 00000000..2863e4f1 --- /dev/null +++ b/sensor/v2_1/ISensorCallback.idl @@ -0,0 +1,50 @@ +/* + * 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 HdiSensor + * @{ + * + * @brief Provides unified APIs for sensor services to access sensor drivers. + * + * A sensor service can obtain a sensor driver object or agent and then call APIs provided by this object or agent to + * access different types of sensor devices based on the sensor IDs, thereby obtaining sensor information, + * subscribing to or unsubscribing from sensor data, enabling or disabling a sensor, + * setting the sensor data reporting mode, and setting sensor options such as the accuracy and measurement range. + * + * @version 2.0 + */ + +package ohos.hdi.sensor.v2_1; + +import ohos.hdi.sensor.v2_0.SensorTypes; +import ohos.hdi.sensor.v2_0.ISensorCallback; + +/** + * @brief Defines the callback for reporting sensor data. This callback needs to be registered when + * a sensor user subscribes to sensor data. Only after the sensor is enabled, the sensor data subscriber can receive + * sensor data. For details, see {@link ISensorInterface}. + * + * @since 5.1 + */ +[callback] interface ISensorCallback extends ohos.hdi.sensor.v2_0.ISensorCallback { + /** + * @brief Defines the function for reporting sensor data. + * @param event Indicates the information about sensor event in the system. + * + * @since 1.0 + */ + [oneway] OnDataEventOneWay([in] struct HdfSensorEvents event); +} diff --git a/sensor/v2_1/ISensorInterface.idl b/sensor/v2_1/ISensorInterface.idl new file mode 100644 index 00000000..1540f92d --- /dev/null +++ b/sensor/v2_1/ISensorInterface.idl @@ -0,0 +1,87 @@ +/* + * 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 HdiSensor + * @{ + * + * @brief Provides unified APIs for sensor services to access sensor drivers. + * + * A sensor service can obtain a sensor driver object or agent and then call APIs provided by this object or agent to + * access different types of sensor devices based on the sensor IDs, thereby obtaining sensor information, + * subscribing to or unsubscribing from sensor data, enabling or disabling a sensor, + * setting the sensor data reporting mode, and setting sensor options such as the accuracy and measurement range. + * + * @since 5.1 + */ + +/** + * @file ISensorInterface.idl + * + * @brief Declares the APIs provided by the sensor module for obtaining sensor information, subscribing to or + * unsubscribing from sensor data, enabling or disabling a sensor, setting the sensor data reporting mode, + * and setting sensor options such as the accuracy and measurement range. + * + * @since 5.1 + * @version 2.1 + */ + +package ohos.hdi.sensor.v2_0; + +import ohos.hdi.sensor.v2_0.SensorTypes; +import ohos.hdi.sensor.v2_1.ISensorCallback; +import ohos.hdi.sensor.v2_0.ISensorInterface; + +/** + * @brief Defines the functions for performing basic operations on sensors. + * + * The operations include obtaining sensor information, subscribing to or unsubscribing from sensor data, + * enabling or disabling a sensor, setting the sensor data reporting mode, and setting sensor options such as + * the accuracy and measurement range. + */ + +interface ISensorInterface extends ohos.hdi.sensor.v2_0.ISensorInterface { + /** + * @brief Registers the callback for reporting sensor data to the subscriber. + * + * @param groupId Indicates the sensor group ID. + * The sensorId enumeration value range is 128-160, which means that the medical sensor service is subscribed. + * It only needs to be subscribed once successfully, and there is no need to subscribe repeatedly. + * The sensorId enumeration value range is not within 128-160, which means that the traditional sensor + * is subscribed, and the subscription is successful once. + * @param callbackObj Indicates the callback to register. For details, see {@link ISensorCallback}. + * @return Returns 0 if the callback is successfully registered; returns a negative value otherwise. + * + * @since 5.1 + * @version 1.0 + */ + RegisterOneWay([in] int groupId, [in] ISensorCallback callbackObj); + + /** + * @brief Deregisters the callback for reporting sensor data. + * + * @param groupId Indicates the sensor group ID. + * The sensorId enumeration value range is 128-160, which means that the medical sensor service is subscribed. + * It only needs to cancel the subscription once successfully, and there is no need to + * cancel the subscription repeatedly. The sensorId enumeration value range is not within 128-160, + * which means that the traditional sensor is subscribed. You can cancel the subscription once successfully. + * @param callbackObj Indicates the callback to deregister. For details, see {@link ISensorCallback}. + * @return Returns 0 if the callback is successfully deregistered; returns a negative value otherwise. + * + * @since 5.1 + * @version 1.0 + */ + UnregisterOneWay([in] int groupId, [in] ISensorCallback callbackObj); +} -- Gitee From fdd98ece8582ead2ab544b782bac0271c45cd0fe Mon Sep 17 00:00:00 2001 From: lzw7991 Date: Tue, 24 Dec 2024 18:51:41 +0800 Subject: [PATCH 286/347] support hardware cursor 2.0 Signed-off-by: lzw7991 --- .../common/include/display_vdi_adapter_interface.h | 4 ++-- display/composer/v1_2/IDisplayComposer.idl | 5 +++-- .../composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 8 ++++++-- .../composer/v1_2/include/idisplay_composer_interface.h | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index 2665da49..4dbe6373 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -86,7 +86,7 @@ struct DisplayComposerVdiAdapter { int32_t (*GetHDRCapabilityInfos)(uint32_t devId, HDRCapability& info); int32_t (*RegDisplayVBlankIdleCallback)(VBlankIdleCallback cb, void* data); int32_t (*SetDisplayConstraint)(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type); - int32_t (*SetHardwareCursorPosition)(uint32_t devId, int32_t x, int32_t y); + int32_t (*UpdateHardwareCursor)(uint32_t devId, int32_t x, int32_t y, BufferHandle* buffer); int32_t (*EnableHardwareCursorStats)(uint32_t devId, bool enable); int32_t (*GetHardwareCursorStats)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); int32_t (*SetDisplayActiveRegion)(uint32_t devId, const IRect& rect); @@ -151,7 +151,7 @@ using GetDisplaySupportedColorGamutsFunc = int32_t (*)(uint32_t devId, std::vect using GetHDRCapabilityInfosFunc = int32_t (*)(uint32_t devId, HDRCapability& info); using RegDisplayVBlankIdleCallbackFunc = int32_t (*)(VBlankIdleCallback cb, void* data); using SetDisplayConstraintFunc = int32_t (*)(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type); -using SetHardwareCursorPositionFunc = int32_t (*)(uint32_t devId, int32_t x, int32_t y); +using UpdateHardwareCursorFunc = int32_t (*)(uint32_t devId, int32_t x, int32_t y, BufferHandle* buffer); using EnableHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, bool enable); using GetHardwareCursorStatsFunc = int32_t (*)(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount); using SetDisplayActiveRegionFunc = int32_t (*)(uint32_t devId, const IRect& rect); diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index e74291a4..23df9a95 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -60,16 +60,17 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos ClearLayerBuffer([in] unsigned int devId, [in] unsigned int layerId); /** - * @brief Set Hardware Cursor Position. + * @brief Update Hardware Cursor Position and Style. * * @param devId Indicates which device, x and y Indicates the position of hardware cursor. + * buffer Indicates input buffer handle. * * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 5.0 * @version 1.0 */ - SetHardwareCursorPosition([in] unsigned int devId, [in] int x, [in] int y); + UpdateHardwareCursor([in] unsigned int devId, [in] int x, [in] int y, [in] NativeBuffer buffer); /** * @brief Enable Hardware Cursor. diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 6ab47def..12d866f4 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -126,10 +126,14 @@ public: return ToDispErrCode(hdi_v1_2_->ClearLayerBuffer(devId, layerId)); } - virtual int32_t SetHardwareCursorPosition(uint32_t devId, int32_t x, int32_t y) override + virtual int32_t UpdateHardwareCursor(uint32_t devId, int32_t x, int32_t y, BufferHandle* buffer) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); - int32_t ret = ToDispErrCode(hdi_v1_2_->SetHardwareCursorPosition(devId, x, y)); + COMPOSER_CHECK_NULLPTR_RETURN(buffer); + stpr hdiBuffer = new NativeBuffer(buffer); + COMPOSER_CHECK_NULLPTR_RETURN(hdiBuffer); + + int32_t ret = ToDispErrCode(hdi_v1_2_->UpdateHardwareCursor(devId, x, y, hdiBuffer)); return ret; } diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 8a5a280c..23aae31e 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -66,7 +66,7 @@ public: virtual int32_t ClearLayerBuffer(uint32_t devId, uint32_t layerId) = 0; - virtual int32_t SetHardwareCursorPosition(uint32_t devId, int32_t x, int32_t y) = 0; + virtual int32_t UpdateHardwareCursor(uint32_t devId, int32_t x, int32_t y, BufferHandle* buffer) = 0; virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) = 0; -- Gitee From 5449acd882c4d09f4137e4895921349c8bfd6dd5 Mon Sep 17 00:00:00 2001 From: lzw7991 Date: Tue, 24 Dec 2024 19:41:39 +0800 Subject: [PATCH 287/347] support hardware cursor 2.0 Signed-off-by: lzw7991 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 12d866f4..cd1fa427 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -130,7 +130,7 @@ public: { COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); COMPOSER_CHECK_NULLPTR_RETURN(buffer); - stpr hdiBuffer = new NativeBuffer(buffer); + sptr hdiBuffer = new NativeBuffer(buffer); COMPOSER_CHECK_NULLPTR_RETURN(hdiBuffer); int32_t ret = ToDispErrCode(hdi_v1_2_->UpdateHardwareCursor(devId, x, y, hdiBuffer)); -- Gitee From 7281b359d42d6dc5195657fb6d19a834d875ce6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 24 Dec 2024 13:07:45 +0000 Subject: [PATCH 288/347] update sensor/v2_1/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- sensor/v2_1/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/sensor/v2_1/BUILD.gn b/sensor/v2_1/BUILD.gn index 13dcd572..6a9efb87 100644 --- a/sensor/v2_1/BUILD.gn +++ b/sensor/v2_1/BUILD.gn @@ -24,7 +24,6 @@ if (defined(ohos_lite)) { sources = [ "ISensorCallback.idl", "ISensorInterface.idl", - "SensorTypes.idl", ] deps = [ -- Gitee From ac2df72e8fc0b4fab767e4e23182bf553639bdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Tue, 24 Dec 2024 13:37:19 +0000 Subject: [PATCH 289/347] update sensor/v2_1/ISensorInterface.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- sensor/v2_1/ISensorInterface.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensor/v2_1/ISensorInterface.idl b/sensor/v2_1/ISensorInterface.idl index 1540f92d..eb58881b 100644 --- a/sensor/v2_1/ISensorInterface.idl +++ b/sensor/v2_1/ISensorInterface.idl @@ -38,7 +38,7 @@ * @version 2.1 */ -package ohos.hdi.sensor.v2_0; +package ohos.hdi.sensor.v2_1; import ohos.hdi.sensor.v2_0.SensorTypes; import ohos.hdi.sensor.v2_1.ISensorCallback; -- Gitee From 9b849c9579dd08787f59f8c333020d6840c19bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=99=85=E7=BA=A2?= Date: Wed, 25 Dec 2024 03:28:58 +0000 Subject: [PATCH 290/347] format brief MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秦际红 --- usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl b/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl index b0bf99b3..54ec9555 100644 --- a/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl +++ b/usb/gadget/mtp/v1_0/IUsbfnMtpInterface.idl @@ -72,7 +72,7 @@ interface IUsbfnMtpInterface { Stop(); /* * - * @brief Read data by adding a task to readqueue. + * @brief Read data by adding a task to read queue. * * @param data Indicates the data read by USB MTP/PTP driver. * @@ -83,7 +83,7 @@ interface IUsbfnMtpInterface { Read([out] unsigned char[] data); /* * - * @brief Write data by adding a task to writequeue. + * @brief Write data by adding a task to write queue. * * @param data Indicates the data write to USB MTP/PTP driver. * -- Gitee From 430aefe659f8565948ef3b302ea3b5b592c131ae Mon Sep 17 00:00:00 2001 From: liwenjun Date: Tue, 24 Dec 2024 09:14:06 +0800 Subject: [PATCH 291/347] =?UTF-8?q?HDF=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liwenjun --- wlan/chip/v1_0/ChipTypes.idl | 13 +++++++++++++ wlan/chip/v1_0/IChipIface.idl | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/wlan/chip/v1_0/ChipTypes.idl b/wlan/chip/v1_0/ChipTypes.idl index a9c92319..b4b209fb 100644 --- a/wlan/chip/v1_0/ChipTypes.idl +++ b/wlan/chip/v1_0/ChipTypes.idl @@ -183,4 +183,17 @@ struct SignalPollResult { int c1Rssi; unsigned char[] ext; }; + +/** + * @brief Defines the projection parameters, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @since 5.0 + * @version 1.0 + */ +struct ProjectionScreenCmdParam { + /** ID of the projection command. */ + int cmdId; + /** Content of the projection command. */ + byte[] buf; +}; /** @} */ \ No newline at end of file diff --git a/wlan/chip/v1_0/IChipIface.idl b/wlan/chip/v1_0/IChipIface.idl index 1596635a..089a6f7e 100644 --- a/wlan/chip/v1_0/IChipIface.idl +++ b/wlan/chip/v1_0/IChipIface.idl @@ -353,5 +353,19 @@ interface IChipIface { * @version 1.0 */ GetCoexictenceChannelList([in] String ifName, [out] unsigned char[] paramBuf); + + /** + * @brief Sets the projection parameters, This interface is preferentially used to communicate with the Wi-Fi service. + * + * @param ifName Indicates the NIC name. + * @param param Indicates the projection parameters to set. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SetProjectionScreenParam([in] String ifName, [in] struct ProjectionScreenCmdParam param); }; /** @} */ \ No newline at end of file -- Gitee From 839d3eff957c61641a788210608d4f300f64095a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Wed, 25 Dec 2024 16:27:29 +0800 Subject: [PATCH 292/347] c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- sensor/v2_1/ISensorCallback.idl | 5 ++++- sensor/v2_1/ISensorInterface.idl | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sensor/v2_1/ISensorCallback.idl b/sensor/v2_1/ISensorCallback.idl index 2863e4f1..c06a2391 100644 --- a/sensor/v2_1/ISensorCallback.idl +++ b/sensor/v2_1/ISensorCallback.idl @@ -24,6 +24,7 @@ * subscribing to or unsubscribing from sensor data, enabling or disabling a sensor, * setting the sensor data reporting mode, and setting sensor options such as the accuracy and measurement range. * + * @since 5.1 * @version 2.0 */ @@ -38,6 +39,7 @@ import ohos.hdi.sensor.v2_0.ISensorCallback; * sensor data. For details, see {@link ISensorInterface}. * * @since 5.1 + * @version 1.1 */ [callback] interface ISensorCallback extends ohos.hdi.sensor.v2_0.ISensorCallback { /** @@ -45,6 +47,7 @@ import ohos.hdi.sensor.v2_0.ISensorCallback; * @param event Indicates the information about sensor event in the system. * * @since 1.0 + * @version 1.0 */ - [oneway] OnDataEventOneWay([in] struct HdfSensorEvents event); + [oneway] OnDataEventAsync([in] struct HdfSensorEvents[] events); } diff --git a/sensor/v2_1/ISensorInterface.idl b/sensor/v2_1/ISensorInterface.idl index eb58881b..9b97ee06 100644 --- a/sensor/v2_1/ISensorInterface.idl +++ b/sensor/v2_1/ISensorInterface.idl @@ -35,7 +35,7 @@ * and setting sensor options such as the accuracy and measurement range. * * @since 5.1 - * @version 2.1 + * @version 1.1 */ package ohos.hdi.sensor.v2_1; @@ -67,7 +67,7 @@ interface ISensorInterface extends ohos.hdi.sensor.v2_0.ISensorInterface { * @since 5.1 * @version 1.0 */ - RegisterOneWay([in] int groupId, [in] ISensorCallback callbackObj); + RegisterAsync([in] int groupId, [in] ISensorCallback callbackObj); /** * @brief Deregisters the callback for reporting sensor data. @@ -83,5 +83,5 @@ interface ISensorInterface extends ohos.hdi.sensor.v2_0.ISensorInterface { * @since 5.1 * @version 1.0 */ - UnregisterOneWay([in] int groupId, [in] ISensorCallback callbackObj); + UnregisterAsync([in] int groupId, [in] ISensorCallback callbackObj); } -- Gitee From 6bc4a3caa2bdce417323296e13fab468835612f9 Mon Sep 17 00:00:00 2001 From: wuwenchao Date: Mon, 23 Dec 2024 22:43:24 +0800 Subject: [PATCH 293/347] Auto fps support Signed-off-by: wuwenchao --- .../include/camera_device_ability_items.h | 31 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 10 ++++++ .../include/camera_metadata_operator.h | 1 + camera/metadata/src/camera_metadata_info.cpp | 5 ++- 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 584f776b..b3b72e96 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1427,6 +1427,15 @@ typedef enum camera_device_metadata_tag { * (i.e. byte[] ...) */ OHOS_CONTROL_DEFERRED_IMAGE_DELIVERY, + /** + * ohos.ability.autoVideoFrameRate [static, byte[], public] + * + * Camera device property, reporting that the camera supports automatic frame rate adjustment + * (i.e. byte[] ...) + * @since 5.1 + * @version 1.0 + */ + OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE, /** * ohos.stream.abilityEnd * @@ -1434,6 +1443,22 @@ typedef enum camera_device_metadata_tag { */ OHOS_STREAM_ABILITY_END, + /** + * ohos.control.autoVideoFrameRate [static, byte[], public] + * + * camera stream property, set camera support automatic frame rate adjustment + * (i.e. byte[] ...) + * @since 5.1 + * @version 1.0 + */ + OHOS_CONTROL_AUTO_VIDEO_FRAME_RATE = OHOS_STREAM_CONTROL_START, + /** + * ohos.stream.controlEnd + * + * camera stream controlEnd + */ + OHOS_STREAM_CONTROL_END, + /** * ohos.jpeg.gpsCoordinates [static, double[], public] * @@ -2709,4 +2734,10 @@ enum CameraQualityPrioritization { OHOS_CAMERA_QUALITY_PRIORITIZATION_POWER_BALANCE, }; +// OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE +enum CameraStreamAutoFpsControl { + OHOS_STREAM_AUTO_FPS_DISABLE = 0, + OHOS_STREAM_AUTO_FPS_ENABLE, +}; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 89c5dfff..857675cb 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -16,6 +16,7 @@ #ifndef CAMERA_METADATA_ITEM_INFO_H #define CAMERA_METADATA_ITEM_INFO_H +#include "camera_device_ability_items.h" #include "camera_metadata_operator.h" namespace OHOS::Camera { @@ -46,6 +47,7 @@ static uint32_t g_ohosCameraSectionBounds[OHOS_SECTION_COUNT][2] = { [OHOS_SECTION_CAMERA_EFFECT] = {OHOS_CAMERA_EFFECT_START, OHOS_CAMERA_EFFECT_END }, [OHOS_SECTION_CAMERA_SECURE] = {OHOS_CAMERA_SECURE_START, OHOS_CAMERA_SECURE_END }, [OHOS_SECTION_CAMERA_XMAGE] = {OHOS_XMAGE_COLOR_MODES_START, OHOS_XMAGE_COLOR_MODES_END }, + [OHOS_SECTION_STREAM_CONTROL] = {OHOS_STREAM_CONTROL_START, OHOS_STREAM_CONTROL_END }, }; static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAMERA_PROPERTIES_START] = { @@ -357,6 +359,13 @@ static item_info_t g_ohosStreamAbility[OHOS_STREAM_ABILITY_END - OHOS_STREAM_ABI OHOS_STREAM_ABILITY_START] = {"deferredImageDeliverySupportModes", META_TYPE_BYTE, -1}, [OHOS_CONTROL_DEFERRED_IMAGE_DELIVERY - OHOS_STREAM_ABILITY_START] = {"deferredImageDeliveryMode", META_TYPE_BYTE, -1}, + [OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE - + OHOS_STREAM_ABILITY_START] = {"streamAutoFpsSupportedMode", META_TYPE_BYTE, -1}, +}; + +static item_info_t g_ohosStreamControl[OHOS_STREAM_CONTROL_END - OHOS_STREAM_CONTROL_START] = { + [OHOS_CONTROL_AUTO_VIDEO_FRAME_RATE - + OHOS_STREAM_CONTROL_START] = {"streamAutoFpsControl", META_TYPE_BYTE, 1}, }; static item_info_t g_ohosStreamJpeg[OHOS_STREAM_JPEG_END - OHOS_STREAM_JPEG_START] = { @@ -578,6 +587,7 @@ const static item_info_t *g_ohosItemInfo[OHOS_SECTION_COUNT] = { g_ohosPostProcess, g_ohosCameraSecure, g_ohosCameraXmage, + g_ohosStreamControl, }; } // namespace Camera #endif /* CAMERA_METADATA_ITEM_INFO_H */ diff --git a/camera/metadata/include/camera_metadata_operator.h b/camera/metadata/include/camera_metadata_operator.h index 396a7107..08b22b7d 100644 --- a/camera/metadata/include/camera_metadata_operator.h +++ b/camera/metadata/include/camera_metadata_operator.h @@ -132,6 +132,7 @@ typedef enum camera_metadata_sec { OHOS_SECTION_CAMERA_EFFECT, OHOS_SECTION_CAMERA_SECURE, OHOS_SECTION_CAMERA_XMAGE, + OHOS_SECTION_STREAM_CONTROL, OHOS_SECTION_COUNT, } camera_metadata_sec_t; diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 1c6ea875..02b5d6bc 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -170,6 +170,8 @@ const std::vector g_metadataTags = { OHOS_CONTROL_SUN_BLOCK_PREVIEW_TYPE, OHOS_CONTROL_SUN_BLOCK_BLEND_COLOR, OHOS_CONTROL_QUALITY_PRIORITIZATION, + OHOS_CONTROL_AUTO_VIDEO_FRAME_RATE, + OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE, // Camera device image acquisition related OHOS_ABILITY_DEVICE_AVAILABLE_EXPOSUREMODES, @@ -349,7 +351,8 @@ std::map g_metadataSectionMap = { {OHOS_STREAM_VIDEO, OHOS_SECTION_STREAM_VIDEO}, {OHOS_CAMERA_EFFECT, OHOS_SECTION_CAMERA_EFFECT}, {OHOS_CAMERA_SECURE, OHOS_SECTION_CAMERA_SECURE}, - {OHOS_XMAGE_COLOR_ABILITY, OHOS_SECTION_CAMERA_XMAGE} + {OHOS_XMAGE_COLOR_ABILITY, OHOS_SECTION_CAMERA_XMAGE}, + {OHOS_STREAM_CONTROL, OHOS_SECTION_STREAM_CONTROL}, }; CameraMetadata::CameraMetadata(size_t itemCapacity, size_t dataCapacity) -- Gitee From fd9d623df8d6d04faa86197e3dc3f6c3b25be992 Mon Sep 17 00:00:00 2001 From: dairan Date: Thu, 26 Dec 2024 10:38:42 +0800 Subject: [PATCH 294/347] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ser=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/bundle.json | 22 ++++ usb/serial/v1_0/BUILD.gn | 27 +++++ usb/serial/v1_0/ISerialInterface.idl | 129 +++++++++++++++++++++++ usb/serial/v1_0/SerialTypes.idl | 152 +++++++++++++++++++++++++++ 4 files changed, 330 insertions(+) create mode 100644 usb/serial/v1_0/BUILD.gn create mode 100644 usb/serial/v1_0/ISerialInterface.idl create mode 100644 usb/serial/v1_0/SerialTypes.idl diff --git a/usb/bundle.json b/usb/bundle.json index 8fdca89e..3a753670 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -32,6 +32,7 @@ "sub_component": [ "//drivers/interface/usb/v1_0:usb_idl_target", "//drivers/interface/usb/v1_1:usb_idl_target", + "//drivers/interface/usb/serial/v1_0:serial_idl_target", "//drivers/interface/usb/gadget/mtp/v1_0:usbfn_mtp_idl_target", "//drivers/interface/usb/ddk/v1_0:usb_ddk_idl_target" ], @@ -120,6 +121,27 @@ "header_files": [], "header_base": "//drivers/interface/usb" } + }, + { + "name": "//drivers/interface/usb/serial/v1_0:libserial_proxy_1.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/serial" + } + }, + { + "name": "//drivers/interface/usb/serial/v1_0:libserial_stub_1.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/serial" + } + }, + { + "name": "//drivers/interface/usb/serial/v1_0:serial_idl_headers", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/serial" + } } ] } diff --git a/usb/serial/v1_0/BUILD.gn b/usb/serial/v1_0/BUILD.gn new file mode 100644 index 00000000..07622173 --- /dev/null +++ b/usb/serial/v1_0/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") +hdi("serial") { + module_name = "serial" + + sources = [ + "ISerialInterface.idl", + "SerialTypes.idl", + ] + + language = "cpp" + mode = "ipc" + subsystem_name = "hdf" + part_name = "drivers_interface_usb" +} diff --git a/usb/serial/v1_0/ISerialInterface.idl b/usb/serial/v1_0/ISerialInterface.idl new file mode 100644 index 00000000..f18ba12d --- /dev/null +++ b/usb/serial/v1_0/ISerialInterface.idl @@ -0,0 +1,129 @@ +/* + * 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 HdiSerial + * + * + * @brief Provides unified APIs for serial services to access serial drivers. + * + * A serial service can obtain a serial driver object or agent and then call APIs provided by this object or agent to + * access different types of serial devices based on the serial IDs, thereby obtaining serial information, + * subscribing to or unsubscribing from serial data, enabling or disabling a serial, + * setting the serial data reporting mode, and setting serial options such as the accuracy and measurement range. + * + * @since 5.0 + */ + +/* * + * @file ISerialInterface.idl + * + * @brief Declares the APIs provided by the serial module for obtaining serial information, subscribing to or + * unsubscribing from serial data, enabling or disabling a serial, setting the serial data reporting mode, + * and setting serial options such as the accuracy and measurement range. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.usb.serial.v1_0; +import ohos.hdi.usb.serial.v1_0.SerialTypes; + +/* * + * @brief Defines the functions for performing basic operations on serial. + * + * The operations include obtaining serial port list information, opening and closing serial port, + * reading or writing serial port data, and setting or obtaining serial port properties. + */ +interface ISerialInterface { + + /** + * @brief Open and configure the serial port. + * + * Initializes and opens a serial communication port and sets communication parameters such as baud rate and parity. + * + * @param portId Indicates the Serial port device portId. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + */ + SerialOpen([in]int portId); + + /** + * @brief Close the serial port and release resources. + * + * Terminate the connection to the serial port, ensuring that the port and associated resources are released + * after all data transfers are complete. + * + * @param portId Indicates the Serial port device portId. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + */ + SerialClose([in]int portId); + + /** + * @brief Read data from the serial port. + * + * @param portId Indicates the Serial port device portId + * @param data Indicates the pointer to the buffer for receiving the data. + * + * @return Returns the size of the data that is successfully read; returns a negative number if the reading fails. + */ + SerialRead([in] int portId, [out] unsigned char []data, [in] unsigned int size); + + /** + * @brief Read data from the serial port. + * + * @param portId Indicates the Serial port device portId + * @param data Indicates the pointer to the data to write. + * + * @return Returns the size of the data that is successfully write; returns a negative number if the reading fails. + */ + SerialWrite([in] int portId, [in] unsigned char []data, [in] unsigned int size); + + /** + * @brief Sets the SERIAL attribute. + * + * SERIAL attributes include data bits, stop bits, parity bit, CTS, RTS, and receiving and transmitting FIFO. + * + * @param portId Indicates the Serial port device portId + * @param attribute Indicates the pointer to the SERIAL attribute to set. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + */ + SerialSetAttribute([in] int portId, [in] struct SerialAttribute attribute); + + /** + * @brief Obtains the SERIAL attribute. + * + * SERIAL attributes include data bits, stop bits, parity bit, CTS, RTS, and receiving and transmitting FIFO. + * + * @param portId Indicates the Serial port device portId + * @param attribute Indicates the pointer to the obtained SERIAL attribute. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + */ + SerialGetAttribute([in] int portId, [out] struct SerialAttribute attribute); + + /** + * @brief Obtains the SERIAL Port list. + * + * @param portId Indicates the Serial port device portId + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + */ + SerialGetPortList([out] struct SerialPort[] portList); +} + + diff --git a/usb/serial/v1_0/SerialTypes.idl b/usb/serial/v1_0/SerialTypes.idl new file mode 100644 index 00000000..f4609163 --- /dev/null +++ b/usb/serial/v1_0/SerialTypes.idl @@ -0,0 +1,152 @@ +/* + * 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 HdiSerial + * + * + * @brief Provides unified APIs for serial services to access serial drivers. + * + * A serial service can obtain a serial driver object or agent and then call APIs provided by this object or agent to + * access different types of serial devices based on the serial IDs, thereby obtaining serial information, + * subscribing to or unsubscribing from serial data, enabling or disabling a serial, + * setting the serial data reporting mode, and setting serial options such as the accuracy and measurement range. + * + * @since 5.0 + */ + + /** + * @file UsbTypes.idl + * + * @brief Defines the data used by the serial module, including the serial information, + * and reported serial data. + * + * @since 5.0 + * @version 1.0 + */ + + +package ohos.hdi.usb.serial.v1_0; + +enum SerialBaudrate : unsigned int { + BAUDRATE_50 = 50, + BAUDRATE_75 = 75, + BAUDRATE_110 = 110, + BAUDRATE_134 = 134, + BAUDRATE_150 = 150, + BAUDRATE_200 = 200, + BAUDRATE_300 = 300, + BAUDRATE_600 = 600, + BAUDRATE_1200 = 1200, + BAUDRATE_1800 = 1800, + BAUDRATE_2400 = 2400, + BAUDRATE_4800 = 4800, + BAUDRATE_9600 = 9600, + BAUDRATE_19200 = 19200, + BAUDRATE_38400 = 38400, + BAUDRATE_57600 = 57600, + BAUDRATE_115200 = 115200, + BAUDRATE_230400 = 230400, + BAUDRATE_460800 = 460800, + BAUDRATE_500000 = 500000, + BAUDRATE_576000 = 576000, + BAUDRATE_921600 = 921600, + BAUDRATE_1000000 = 1000000, + BAUDRATE_1152000 = 1152000, + BAUDRATE_1500000 = 1500000, + BAUDRATE_2000000 = 2000000, + BAUDRATE_2500000 = 2500000, + BAUDRATE_3000000 = 3000000, + BAUDRATE_3500000 = 3500000, + BAUDRATE_4000000 = 4000000 +}; + +enum SerialDataBits : unsigned char { + /* Indicates the USB word length, which is 8 data bits per frame. */ + USB_ATTR_DATABIT_8 = 0, + /* Indicates the USB word length, which is 7 data bits per frame. */ + USB_ATTR_DATABIT_7, + /* Indicates the USB word length, which is 6 data bits per frame. */ + USB_ATTR_DATABIT_6, + /* Indicates the USB word length, which is 5 data bits per frame. */ + USB_ATTR_DATABIT_5, + /* Indicates the USB word length, which is 4 data bits per frame. */ + USB_ATTR_DATABIT_4 +}; + +enum SerialParity : unsigned char { + /* Indicates that the USB device has no parity bit. */ + USB_ATTR_PARITY_NONE = 0, + /* Indicates that the USB device has an odd parity bit. */ + USB_ATTR_PARITY_ODD, + /* Indicates that the USB device has an even parity bit. */ + USB_ATTR_PARITY_EVEN, + /* Indicates that the parity bit is 1. */ + USB_ATTR_PARITY_MARK, + /* Indicates that the parity bit is 0. */ + USB_ATTR_PARITY_SPACE +}; + +enum SerialStopBits : unsigned char { + /* that the USB device has 1 stop bit. */ + USB_ATTR_STOPBIT_1 = 0, + /* Indicates that the USB device has 1.5 stop bits. */ + USB_ATTR_STOPBIT_1P5, + /* Indicates that the USB device has 2 stop bits. */ + USB_ATTR_STOPBIT_2 +}; + +struct DeviceInfo { + unsigned char busNum; + unsigned char devAddr; + int vid; + int pid; + String serialNum; +}; + +/** + * @brief Defines basic attributes of the USB to serial port. + * + * You can configure the attributes via {@link SerialSetAttribute}. If the parameters are not set, + * default attributes are used. + * + * @attention The USB controller determines which USB attribute parameters are supported. + * + */ +struct SerialAttribute { + unsigned int baudrate; + unsigned char stopBits; + unsigned char parity; + unsigned char dataBits; +}; + +struct SerialPort { + int portId; + DeviceInfo deviceInfo; +}; + +/** + * @brief Enumerates USB Serial commands. + * + */ +enum SerialIoCmd { + USB_SERIAL_GET_PORT_LIST = 0, /**< Get the serial port list. */ + USB_SERIAL_OPEN, /**< Reference count management and initialize the USB device. */ + USB_SERIAL_CLOSE, /**< Reference count management and deinitialize the USB device. */ + USB_SERIAL_READ, /**< Read data. */ + USB_SERIAL_WRITE, /**< Write data. */ + USB_SERIAL_GET_ATTRIBUTE, /**< Obtain the device attributes. */ + USB_SERIAL_SET_ATTRIBUTE /**< Set the device attributes. */ +}; \ No newline at end of file -- Gitee From 8ae9b4799d2ad280ae4e45215672419f09d3e3be Mon Sep 17 00:00:00 2001 From: dairan Date: Thu, 26 Dec 2024 11:08:13 +0800 Subject: [PATCH 295/347] =?UTF-8?q?=E6=9B=B4=E6=94=B9idl=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/serial/v1_0/ISerialInterface.idl | 32 ++++++++++++++++++++++++++-- usb/serial/v1_0/SerialTypes.idl | 4 ++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/usb/serial/v1_0/ISerialInterface.idl b/usb/serial/v1_0/ISerialInterface.idl index f18ba12d..c0113c03 100644 --- a/usb/serial/v1_0/ISerialInterface.idl +++ b/usb/serial/v1_0/ISerialInterface.idl @@ -24,7 +24,7 @@ * subscribing to or unsubscribing from serial data, enabling or disabling a serial, * setting the serial data reporting mode, and setting serial options such as the accuracy and measurement range. * - * @since 5.0 + * @since 5.1 */ /* * @@ -34,7 +34,7 @@ * unsubscribing from serial data, enabling or disabling a serial, setting the serial data reporting mode, * and setting serial options such as the accuracy and measurement range. * - * @since 5.0 + * @since 5.1 * @version 1.0 */ @@ -57,6 +57,10 @@ interface ISerialInterface { * @param portId Indicates the Serial port device portId. * * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 */ SerialOpen([in]int portId); @@ -69,6 +73,10 @@ interface ISerialInterface { * @param portId Indicates the Serial port device portId. * * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 */ SerialClose([in]int portId); @@ -79,6 +87,10 @@ interface ISerialInterface { * @param data Indicates the pointer to the buffer for receiving the data. * * @return Returns the size of the data that is successfully read; returns a negative number if the reading fails. + * + * @since 5.1 + * + * @version 1.0 */ SerialRead([in] int portId, [out] unsigned char []data, [in] unsigned int size); @@ -89,6 +101,10 @@ interface ISerialInterface { * @param data Indicates the pointer to the data to write. * * @return Returns the size of the data that is successfully write; returns a negative number if the reading fails. + * + * @since 5.1 + * + * @version 1.0 */ SerialWrite([in] int portId, [in] unsigned char []data, [in] unsigned int size); @@ -101,6 +117,10 @@ interface ISerialInterface { * @param attribute Indicates the pointer to the SERIAL attribute to set. * * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 */ SerialSetAttribute([in] int portId, [in] struct SerialAttribute attribute); @@ -113,6 +133,10 @@ interface ISerialInterface { * @param attribute Indicates the pointer to the obtained SERIAL attribute. * * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 */ SerialGetAttribute([in] int portId, [out] struct SerialAttribute attribute); @@ -122,6 +146,10 @@ interface ISerialInterface { * @param portId Indicates the Serial port device portId * * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 */ SerialGetPortList([out] struct SerialPort[] portList); } diff --git a/usb/serial/v1_0/SerialTypes.idl b/usb/serial/v1_0/SerialTypes.idl index f4609163..6f1397d6 100644 --- a/usb/serial/v1_0/SerialTypes.idl +++ b/usb/serial/v1_0/SerialTypes.idl @@ -24,7 +24,7 @@ * subscribing to or unsubscribing from serial data, enabling or disabling a serial, * setting the serial data reporting mode, and setting serial options such as the accuracy and measurement range. * - * @since 5.0 + * @since 5.1 */ /** @@ -33,7 +33,7 @@ * @brief Defines the data used by the serial module, including the serial information, * and reported serial data. * - * @since 5.0 + * @since 5.1 * @version 1.0 */ -- Gitee From 43e50bc775584dde68fe64a482fd7e014aa9a7d1 Mon Sep 17 00:00:00 2001 From: yangkan Date: Thu, 26 Dec 2024 07:33:01 +0000 Subject: [PATCH 296/347] update sensor/v2_1/BUILD.gn. Signed-off-by: yangkan --- sensor/v2_1/BUILD.gn | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sensor/v2_1/BUILD.gn b/sensor/v2_1/BUILD.gn index 6a9efb87..28393032 100644 --- a/sensor/v2_1/BUILD.gn +++ b/sensor/v2_1/BUILD.gn @@ -26,10 +26,9 @@ if (defined(ohos_lite)) { "ISensorInterface.idl", ] - deps = [ - "//drivers/interface/sensor/v2_0:libsensor_proxy_2.0", - "//drivers/interface/sensor/v2_0:libsensor_stub_2.0", - ] + proxy_deps = [ "../v2_0:libsensor_proxy_2.0" ] + + stub_deps = [ "../v2_0:libsensor_stub_2.0" ] language = "cpp" subsystem_name = "hdf" -- Gitee From 18560fdfb8fdccf9d565c98157b32dcab23df7b4 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Tue, 24 Dec 2024 17:44:38 +0800 Subject: [PATCH 297/347] update code check Signed-off-by: wuyuexiang --- usb/v1_0/UsbTypes.idl | 2 +- usb/v1_2/IUsbInterface.idl | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/usb/v1_0/UsbTypes.idl b/usb/v1_0/UsbTypes.idl index e9d744d7..055480eb 100644 --- a/usb/v1_0/UsbTypes.idl +++ b/usb/v1_0/UsbTypes.idl @@ -68,4 +68,4 @@ struct USBDeviceInfo { int status; int busNum; int devNum; -}; +}; \ No newline at end of file diff --git a/usb/v1_2/IUsbInterface.idl b/usb/v1_2/IUsbInterface.idl index eeb7ff09..b1f5e639 100644 --- a/usb/v1_2/IUsbInterface.idl +++ b/usb/v1_2/IUsbInterface.idl @@ -43,12 +43,7 @@ import ohos.hdi.usb.v1_2.UsbTypes; import ohos.hdi.usb.v1_2.IUsbdTransferCallback; import ohos.hdi.usb.v1_1.UsbTypes; import ohos.hdi.usb.v1_1.IUsbInterface; -/* -import ohos.hdi.usb.v1_0.UsbTypes; -import ohos.hdi.usb.v1_0.IUsbdSubscriber; -import ohos.hdi.usb.v1_0.IUsbdBulkCallback; -import ohos.hdi.usb.v1_0.IUsbInterface; -*/ + /* * * @brief Defines the functions for performing basic operations on usb. * -- Gitee From 9330eb7046472811667626fec5cce31d2545cb3a Mon Sep 17 00:00:00 2001 From: dairan Date: Fri, 27 Dec 2024 16:55:51 +0800 Subject: [PATCH 298/347] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9D=83?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/serial/v1_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/serial/v1_0/BUILD.gn b/usb/serial/v1_0/BUILD.gn index 07622173..978305e9 100644 --- a/usb/serial/v1_0/BUILD.gn +++ b/usb/serial/v1_0/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# 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 -- Gitee From c993e3f11fd95b9a5a7b9393efcc5deff5939341 Mon Sep 17 00:00:00 2001 From: xuedong Date: Sat, 28 Dec 2024 11:29:43 +0800 Subject: [PATCH 299/347] fix: correct the incorrect write mode. Signed-off-by: xuedong --- display/composer/v1_2/display_command/display_cmd_requester.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/composer/v1_2/display_command/display_cmd_requester.h b/display/composer/v1_2/display_command/display_cmd_requester.h index 996b4e6c..b18185ce 100644 --- a/display/composer/v1_2/display_command/display_cmd_requester.h +++ b/display/composer/v1_2/display_command/display_cmd_requester.h @@ -311,7 +311,7 @@ EXIT: DISPLAY_CHK_BREAK(retBool == false, HDF_LOGE("%{public}s: write devId failed", __func__)); - retBool = requestPacker_.WriteUint64(layerId); + retBool = requestPacker_.WriteUint32(layerId); DISPLAY_CHK_BREAK(retBool == false, HDF_LOGE("%{public}s: write layerId failed", __func__)); @@ -348,7 +348,7 @@ EXIT: requestPacker_.RollBack(writePos); HDF_LOGE("SetLayerPerFrameParameterSmq writePos_ rollback %{public}s, %{public}d, %{public}d", key.c_str(), devId, layerId); - + return HDF_FAILURE; } return HDF_SUCCESS; -- Gitee From 49ce0976258f99dc533963207d26a6f56a3d118f Mon Sep 17 00:00:00 2001 From: xiayifan Date: Sat, 28 Dec 2024 16:31:22 +0800 Subject: [PATCH 300/347] add fusion pressure sensor Signed-off-by: xiayifan --- sensor/v2_1/BUILD.gn | 1 + sensor/v2_1/SensorTypes.idl | 51 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 sensor/v2_1/SensorTypes.idl diff --git a/sensor/v2_1/BUILD.gn b/sensor/v2_1/BUILD.gn index 28393032..b986b750 100644 --- a/sensor/v2_1/BUILD.gn +++ b/sensor/v2_1/BUILD.gn @@ -24,6 +24,7 @@ if (defined(ohos_lite)) { sources = [ "ISensorCallback.idl", "ISensorInterface.idl", + "SensorTypes.idl", ] proxy_deps = [ "../v2_0:libsensor_proxy_2.0" ] diff --git a/sensor/v2_1/SensorTypes.idl b/sensor/v2_1/SensorTypes.idl new file mode 100644 index 00000000..90803e49 --- /dev/null +++ b/sensor/v2_1/SensorTypes.idl @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-2023 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 HdiSensor + * @{ + * + * @brief Provides unified APIs for sensor services to access sensor drivers. + * + * A sensor service can obtain a sensor driver object or agent and then call APIs provided by this object or agent to + * access different types of sensor devices based on the sensor IDs, thereby obtaining sensor information, + * subscribing to or unsubscribing from sensor data, enabling or disabling a sensor, + * setting the sensor data reporting mode, and setting sensor options such as the accuracy and measurement range. + * + * @version 2.0 + */ + +/** + * @file SensorTypes.idl + * + * @brief Defines the data used by the sensor module, including the sensor information, + * and reported sensor data. + * + * @since 4.1 + * @version 2.1 + */ + +package ohos.hdi.sensor.v2_1; +import ohos.hdi.sensor.v2_0.SensorTypes; + +/** + * @brief Enumerates sensor types. + * + * @since 4.0 + */ +enum HdfSensorTypeTag : ohos.hdi.sensor.v2_0.HdfSensorTypeTag { + HDF_SENSOR_TYPE_FUSION_PRESSURE = 283, /**< fusion pressure sensor */ +}; + -- Gitee From 226c5669e481b7b175f7c5073c4f8e5d23175d32 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Mon, 30 Dec 2024 16:56:34 +0800 Subject: [PATCH 301/347] add nova short video HDI tag Signed-off-by: zhanglei --- .../include/camera_device_ability_items.h | 82 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 10 +++ camera/metadata/src/camera_metadata_info.cpp | 8 ++ 3 files changed, 100 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index b3b72e96..d8a341cf 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1213,6 +1213,48 @@ typedef enum camera_device_metadata_tag { * (i.e. float ...) */ OHOS_CONTROL_FOCUS_DISTANCE, + /** + * ohos.ability.focusRangeTypes [static, enum[], public] + * + * camera device property, report current camera support focus range types + * (i.e. enum[]: AUTO, NEAR ...) + */ + OHOS_ABILITY_FOCUS_RANGE_TYPES, + /** + * ohos.control.focusRangeType [static, enum, public] + * + * camera device property, set current camera focus range type + * (i.e. enum: AUTO/NEAR ...) + */ + OHOS_CONTROL_FOCUS_RANGE_TYPE, + /** + * ohos.control.focusTrackingMode [static, enum, public] + * + * camera device property, set current camera focus tracking mode + * (i.e. enum: AUTO ...) + */ + OHOS_CONTROL_FOCUS_TRACKING_MODE, + /** + * ohos.ability.focusTrackingRegion [static, int32[], public] + * + * camera device property, report current camera focus tracking region + * (i.e. int32[] ...) + */ + OHOS_ABILITY_FOCUS_TRACKING_REGION, + /** + * ohos.ability.focusDrivenTypes [static, enum[], public] + * + * camera device property, report current camera support focus driven types + * (i.e. enum[]: AUTO, FACE ...) + */ + OHOS_ABILITY_FOCUS_DRIVEN_TYPES, + /** + * ohos.control.focusDrivenType [static, enum, public] + * + * camera device property, set current camera focus driven type + * (i.e. enum: AUTO/FACE ...) + */ + OHOS_CONTROL_FOCUS_DRIVEN_TYPE, /** * ohos.device.focusEnd * @@ -2118,6 +2160,20 @@ typedef enum camera_device_metadata_tag { * (i.e. int32 ...) */ OHOS_CONTROL_CAMERA_VIDEO_ROTATION, + /** + * ohos.ability.colorReservationTypes [static, enum[], public] + * + * camera device property, report current camera support color reservation types + * (i.e. enum[]: NONE, PORTRAIT ...) + */ + OHOS_ABILITY_COLOR_RESERVATION_TYPES, + /** + * ohos.control.colorReservationType [static, enum, public] + * + * camera device property, set current camera color reservation type + * (i.e. enum: NONE/PORTRAIT ...) + */ + OHOS_CONTROL_COLOR_RESERVATION_TYPE, /** * ohos.camera.effectEnd * @@ -2740,4 +2796,30 @@ enum CameraStreamAutoFpsControl { OHOS_STREAM_AUTO_FPS_ENABLE, }; +// OHOS_ABILITY_FOCUS_RANGE_TYPES +// OHOS_CONTROL_FOCUS_RANGE_TYPE +typedef enum camera_focus_range_type { + OHOS_CAMERA_FOCUS_RANGE_AUTO = 0, + OHOS_CAMERA_FOCUS_RANGE_NEAR +} camera_focus_range_type_t; + +// OHOS_ABILITY_FOCUS_DRIVEN_TYPES +// OHOS_CONTROL_FOCUS_DRIVEN_TYPE +typedef enum camera_focus_driven_type { + OHOS_CAMERA_FOCUS_DRIVEN_AUTO = 0, + OHOS_CAMERA_FOCUS_DRIVEN_FACE +} camera_focus_driven_type_t; + +// OHOS_CONTROL_FOCUS_TRACKING_MODE +typedef enum camera_focus_tracking_mode { + OHOS_CAMERA_FOCUS_TRACKING_AUTO = 0, +} camera_focus_tracking_mode_t; + +// OHOS_ABILITY_COLOR_RESERVATION_TYPES +// OHOS_CONTROL_COLOR_RESERVATION_TYPE +typedef enum camera_color_reservation_type { + OHOS_CAMERA_COLOR_RESERVATION_NONE = 0, + OHOS_CAMERA_COLOR_RESERVATION_PORTRAIT +} camera_color_reservation_type_t; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 857675cb..d77cd0f3 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -312,6 +312,12 @@ static item_info_t g_ohosDeviceFocus[OHOS_DEVICE_FOCUS_END - OHOS_DEVICE_FOCUS_S [OHOS_ABILITY_EQUIVALENT_FOCUS - OHOS_DEVICE_FOCUS_START] = {"equivalentFocus", META_TYPE_INT32, -1}, [OHOS_CONTROL_FOCUS_DISTANCE - OHOS_DEVICE_FOCUS_START] = {"controlFocusDistance", META_TYPE_FLOAT, 1}, + [OHOS_ABILITY_FOCUS_RANGE_TYPES - OHOS_DEVICE_FOCUS_START] = {"focusRangeTypes", META_TYPE_BYTE, -1}, + [OHOS_CONTROL_FOCUS_RANGE_TYPE - OHOS_DEVICE_FOCUS_START] = {"focusRangeType", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_FOCUS_TRACKING_MODE - OHOS_DEVICE_FOCUS_START] = {"focusTrackingMode", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_FOCUS_TRACKING_REGION - OHOS_DEVICE_FOCUS_START] = {"focusTrackingRegion", META_TYPE_INT32, -1}, + [OHOS_ABILITY_FOCUS_DRIVEN_TYPES - OHOS_DEVICE_FOCUS_START] = {"focusDrivenTypes", META_TYPE_BYTE, -1}, + [OHOS_CONTROL_FOCUS_DRIVEN_TYPE - OHOS_DEVICE_FOCUS_START] = {"focusDrivenType", META_TYPE_BYTE, 1}, }; static item_info_t g_ohosDeviceWhite[OHOS_DEVICE_WHITE_BLANCE_END - OHOS_DEVICE_WHITE_BLANCE_START] = { @@ -545,6 +551,10 @@ static item_info_t g_ohosPostProcess[OHOS_CAMERA_EFFECT_END - OHOS_CAMERA_EFFECT OHOS_CAMERA_EFFECT_START] = {"movingPhotoStart", META_TYPE_INT64, 1}, [OHOS_MOVING_PHOTO_END - OHOS_CAMERA_EFFECT_START] = {"movingPhotoEnd", META_TYPE_INT64, 1}, + [OHOS_ABILITY_COLOR_RESERVATION_TYPES - + OHOS_CAMERA_EFFECT_START] = {"colorReservationTypes", META_TYPE_BYTE, -1}, + [OHOS_CONTROL_COLOR_RESERVATION_TYPE - + OHOS_CAMERA_EFFECT_START] = {"colorReservationType", META_TYPE_BYTE, 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 02b5d6bc..3c003fce 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -195,6 +195,12 @@ const std::vector g_metadataTags = { OHOS_CONTROL_LENS_FOCUS_DISTANCE, OHOS_ABILITY_EQUIVALENT_FOCUS, OHOS_CONTROL_FOCUS_DISTANCE, + OHOS_ABILITY_FOCUS_RANGE_TYPES, + OHOS_CONTROL_FOCUS_RANGE_TYPE, + OHOS_CONTROL_FOCUS_TRACKING_MODE, + OHOS_ABILITY_FOCUS_TRACKING_REGION, + OHOS_ABILITY_FOCUS_DRIVEN_TYPES, + OHOS_CONTROL_FOCUS_DRIVEN_TYPE, OHOS_ABILITY_DEVICE_AVAILABLE_AWBMODES, OHOS_ABILITY_AWB_MODES, @@ -321,6 +327,8 @@ const std::vector g_metadataTags = { OHOS_MOVING_PHOTO_BUFFER_DURATION, OHOS_MOVING_PHOTO_START, OHOS_MOVING_PHOTO_END, + OHOS_ABILITY_COLOR_RESERVATION_TYPES, + OHOS_CONTROL_COLOR_RESERVATION_TYPE, // camera secure related OHOS_CONTROL_SECURE_FACE_MODE, -- Gitee From 4c2fa7d115fe2b84801b6b13463e0151219c5698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=98=93=E5=87=A1?= Date: Tue, 31 Dec 2024 07:07:03 +0000 Subject: [PATCH 302/347] update sensor/v2_1/SensorTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 夏易凡 --- sensor/v2_1/SensorTypes.idl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sensor/v2_1/SensorTypes.idl b/sensor/v2_1/SensorTypes.idl index 90803e49..9e0410ab 100644 --- a/sensor/v2_1/SensorTypes.idl +++ b/sensor/v2_1/SensorTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * 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 @@ -24,7 +24,7 @@ * subscribing to or unsubscribing from sensor data, enabling or disabling a sensor, * setting the sensor data reporting mode, and setting sensor options such as the accuracy and measurement range. * - * @version 2.0 + * @version 1.1 */ /** @@ -34,7 +34,7 @@ * and reported sensor data. * * @since 4.1 - * @version 2.1 + * @version 1.1 */ package ohos.hdi.sensor.v2_1; @@ -43,7 +43,8 @@ import ohos.hdi.sensor.v2_0.SensorTypes; /** * @brief Enumerates sensor types. * - * @since 4.0 + * @since 4.1 + * @version 1.1 */ enum HdfSensorTypeTag : ohos.hdi.sensor.v2_0.HdfSensorTypeTag { HDF_SENSOR_TYPE_FUSION_PRESSURE = 283, /**< fusion pressure sensor */ -- Gitee From a2238115332a87dd47c0bd4b9e0f40c5aaaf90be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=98=93=E5=87=A1?= Date: Tue, 31 Dec 2024 08:11:12 +0000 Subject: [PATCH 303/347] update sensor/v2_1/SensorTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 夏易凡 --- sensor/v2_1/SensorTypes.idl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sensor/v2_1/SensorTypes.idl b/sensor/v2_1/SensorTypes.idl index 9e0410ab..d931906c 100644 --- a/sensor/v2_1/SensorTypes.idl +++ b/sensor/v2_1/SensorTypes.idl @@ -1,6 +1,6 @@ /* * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -33,7 +33,7 @@ * @brief Defines the data used by the sensor module, including the sensor information, * and reported sensor data. * - * @since 4.1 + * @since 5.1 * @version 1.1 */ @@ -43,7 +43,7 @@ import ohos.hdi.sensor.v2_0.SensorTypes; /** * @brief Enumerates sensor types. * - * @since 4.1 + * @since 5.1 * @version 1.1 */ enum HdfSensorTypeTag : ohos.hdi.sensor.v2_0.HdfSensorTypeTag { -- Gitee From 7e971627e15b01a3239cf0a6fb4a515ab5aec745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=98=93=E5=87=A1?= Date: Thu, 2 Jan 2025 01:49:19 +0000 Subject: [PATCH 304/347] update sensor/v2_1/SensorTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 夏易凡 --- sensor/v2_1/SensorTypes.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/sensor/v2_1/SensorTypes.idl b/sensor/v2_1/SensorTypes.idl index d931906c..d7484c7a 100644 --- a/sensor/v2_1/SensorTypes.idl +++ b/sensor/v2_1/SensorTypes.idl @@ -1,4 +1,5 @@ /* + * SPDX-License-Identifier: Apache-2.0 * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. -- Gitee From 73d9efdacf0232307239cef909aa7cc97f77abdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=98=93=E5=87=A1?= Date: Thu, 2 Jan 2025 08:03:26 +0000 Subject: [PATCH 305/347] update sensor/v2_1/SensorTypes.idl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 夏易凡 --- sensor/v2_1/SensorTypes.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensor/v2_1/SensorTypes.idl b/sensor/v2_1/SensorTypes.idl index d7484c7a..9606c993 100644 --- a/sensor/v2_1/SensorTypes.idl +++ b/sensor/v2_1/SensorTypes.idl @@ -1,6 +1,6 @@ /* * SPDX-License-Identifier: Apache-2.0 - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- Gitee From ccef37f767e4875bf97c0a61afc701626ec7cf8b Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Tue, 7 Jan 2025 20:49:46 +0800 Subject: [PATCH 306/347] update info Signed-off-by: wuyuexiang --- usb/v1_2/BUILD.gn | 2 +- usb/v1_2/IUsbInterface.idl | 2 +- usb/v1_2/IUsbdTransferCallback.idl | 26 +++++++++++++++++++++++++- usb/v1_2/UsbTypes.idl | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/usb/v1_2/BUILD.gn b/usb/v1_2/BUILD.gn index 1f687346..243297f4 100644 --- a/usb/v1_2/BUILD.gn +++ b/usb/v1_2/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/usb/v1_2/IUsbInterface.idl b/usb/v1_2/IUsbInterface.idl index b1f5e639..3618d5cc 100644 --- a/usb/v1_2/IUsbInterface.idl +++ b/usb/v1_2/IUsbInterface.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/usb/v1_2/IUsbdTransferCallback.idl b/usb/v1_2/IUsbdTransferCallback.idl index 2ef797d6..70c0414b 100644 --- a/usb/v1_2/IUsbdTransferCallback.idl +++ b/usb/v1_2/IUsbdTransferCallback.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -39,8 +39,32 @@ import ohos.hdi.usb.v1_2.UsbTypes; */ [callback] interface IUsbdTransferCallback { + /* * + * @brief Usb async transfer write callback. + * + * @param status Indicates the async transfer status code. + * @param actLength Indicates the actual length of transfered data. + * @param descs Indicates the iso transfer result. + * @param userData Indicates the custom user data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ OnTransferWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); + /* * + * @brief Usb async transfer read callback. + * + * @param status Indicates the async transfer status code. + * @param actLength Indicates the actual length of transfered data. + * @param descs Indicates the iso transfer result. + * @param userData Indicates the custom user data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ OnTransferReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); } \ No newline at end of file diff --git a/usb/v1_2/UsbTypes.idl b/usb/v1_2/UsbTypes.idl index a8f83cea..5fd57896 100644 --- a/usb/v1_2/UsbTypes.idl +++ b/usb/v1_2/UsbTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 -- Gitee From 0bbe0d6844db82c361d6194e52a074b7d122c901 Mon Sep 17 00:00:00 2001 From: wuyuexiang Date: Tue, 7 Jan 2025 22:23:11 +0800 Subject: [PATCH 307/347] rollback idl Signed-off-by: wuyuexiang --- usb/v1_2/IUsbdTransferCallback.idl | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/usb/v1_2/IUsbdTransferCallback.idl b/usb/v1_2/IUsbdTransferCallback.idl index 70c0414b..b0eff187 100644 --- a/usb/v1_2/IUsbdTransferCallback.idl +++ b/usb/v1_2/IUsbdTransferCallback.idl @@ -39,32 +39,8 @@ import ohos.hdi.usb.v1_2.UsbTypes; */ [callback] interface IUsbdTransferCallback { - /* * - * @brief Usb async transfer write callback. - * - * @param status Indicates the async transfer status code. - * @param actLength Indicates the actual length of transfered data. - * @param descs Indicates the iso transfer result. - * @param userData Indicates the custom user data. - * - * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. - * @since 5.1 - * @version 1.0 - */ OnTransferWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); - /* * - * @brief Usb async transfer read callback. - * - * @param status Indicates the async transfer status code. - * @param actLength Indicates the actual length of transfered data. - * @param descs Indicates the iso transfer result. - * @param userData Indicates the custom user data. - * - * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. - * @since 5.1 - * @version 1.0 - */ OnTransferReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); } \ No newline at end of file -- Gitee From 21480e09f8cc86d65664a27a11fecdee22d4a8f9 Mon Sep 17 00:00:00 2001 From: LuoBin Date: Thu, 9 Jan 2025 16:59:09 +0800 Subject: [PATCH 308/347] =?UTF-8?q?USB=20DDK=E5=A2=9E=E5=BC=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: LuoBin Change-Id: I7290090d90ffc66a0f85027ac3e94d305a225792 --- usb/bundle.json | 24 +++++++++++- usb/ddk/v1_1/BUILD.gn | 28 +++++++++++++ usb/ddk/v1_1/IUsbDdk.idl | 76 ++++++++++++++++++++++++++++++++++++ usb/ddk/v1_1/UsbDdkTypes.idl | 51 ++++++++++++++++++++++++ 4 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 usb/ddk/v1_1/BUILD.gn create mode 100644 usb/ddk/v1_1/IUsbDdk.idl create mode 100644 usb/ddk/v1_1/UsbDdkTypes.idl diff --git a/usb/bundle.json b/usb/bundle.json index f24c4ad4..80571dab 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -34,7 +34,8 @@ "//drivers/interface/usb/v1_1:usb_idl_target", "//drivers/interface/usb/v1_2:usb_idl_target", "//drivers/interface/usb/gadget/mtp/v1_0:usbfn_mtp_idl_target", - "//drivers/interface/usb/ddk/v1_0:usb_ddk_idl_target" + "//drivers/interface/usb/ddk/v1_0:usb_ddk_idl_target", + "//drivers/interface/usb/ddk/v1_1:usb_ddk_idl_target" ], "test": [], "inner_kits": [ @@ -142,6 +143,27 @@ "header_files": [], "header_base": "//drivers/interface/usb" } + }, + { + "name": "//drivers/interface/usb/ddk/v1_1:libusb_ddk_proxy_1.1", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/ddk" + } + }, + { + "name": "//drivers/interface/usb/ddk/v1_1:libusb_ddk_stub_1.1", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/ddk" + } + }, + { + "name": "//drivers/interface/usb/ddk/v1_1:usb_ddk_idl_headers", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/ddk" + } } ] } diff --git a/usb/ddk/v1_1/BUILD.gn b/usb/ddk/v1_1/BUILD.gn new file mode 100644 index 00000000..a272b2a0 --- /dev/null +++ b/usb/ddk/v1_1/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") +hdi("usb_ddk") { + module_name = "usb_ddk" + imports = [ "ohos.hdi.usb.ddk.v1_0:usb_ddk" ] + + sources = [ + "IUsbDdk.idl", + "UsbDdkTypes.idl", + ] + + language = "cpp" + mode = "ipc" + subsystem_name = "hdf" + part_name = "drivers_interface_usb" +} diff --git a/usb/ddk/v1_1/IUsbDdk.idl b/usb/ddk/v1_1/IUsbDdk.idl new file mode 100644 index 00000000..96968723 --- /dev/null +++ b/usb/ddk/v1_1/IUsbDdk.idl @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 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 HdiUsbDdk + * @{ + * + * @brief Provides USB DDK APIs to open and close USB interfaces, perform non-isochronous and isochronous\n + * data transfer over USB pipes, and implement control transfer and interrupt transfer, etc. + * @since 5.1 + * @version 1.1 + */ + +/** + * @file IUsbDdk.idl + * + * @brief Declares the USB DDK APIs used by the USB host to access USB devices. + * + * @since 5.1 + * @version 1.1 + */ + +package ohos.hdi.usb.ddk.v1_1; + +import ohos.hdi.usb.ddk.v1_1.UsbDdkTypes; +import ohos.hdi.usb.ddk.v1_0.IUsbDdk; + +/** + * @brief Declares the USB DDK APIs used by the USB host to access USB devices. + * @since 5.1 + * @version 1.1 + */ +interface IUsbDdk extends ohos.hdi.usb.ddk.v1_0.IUsbDdk +{ + /** + * @brief Obtains usb devices. + * + * @param devices USB device array. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetDevices([out] List deviceIds); + + /** + * @brief Updates peripheral driver information. + * + * @param driverInfo Driver ability information. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + UpdateDriverInfo([in] struct DriverAbilityInfo driverInfo); + + /** + * @brief Removes Driver information. + * + * @param driverUid Driver Uid. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + RemoveDriverInfo([in] String driverUid); +} diff --git a/usb/ddk/v1_1/UsbDdkTypes.idl b/usb/ddk/v1_1/UsbDdkTypes.idl new file mode 100644 index 00000000..53fecea0 --- /dev/null +++ b/usb/ddk/v1_1/UsbDdkTypes.idl @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2025 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 HdiUsbDdk + * @{ + * + * @brief Provides USB DDK types and declares the macros, enumerated variables, and\n + * data structures required by the USB DDK APIs. + * + * @since 5.1 + * @version 1.1 + */ + +/** + * @file UsbDdkTypes.idl + * + * @brief Provides the enumerated variables, structures, and macros used in USB DDK APIs. + * + * @since 5.1 + * @version 1.1 + */ + +package ohos.hdi.usb.ddk.v1_1; + +import ohos.hdi.usb.ddk.v1_0.UsbDdkTypes; + +/** + * @brief Defines driver info. + * + * @since 5.1 + * @version 1.0 + */ +struct DriverAbilityInfo { + /** Driver uid */ + String driverUid; + /** Vendor id array */ + unsigned short[] vids; +}; \ No newline at end of file -- Gitee From cc333706affbf764d87dd0fa80ffcbe082fcf2b1 Mon Sep 17 00:00:00 2001 From: limabiao Date: Fri, 27 Dec 2024 11:33:11 +0800 Subject: [PATCH 309/347] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=9D=9E=E6=A0=87?= =?UTF-8?q?=E5=A4=96=E8=AE=BE=E6=89=A9=E5=B1=95=E9=A9=B1=E5=8A=A8-HID=20DD?= =?UTF-8?q?K=E5=A2=9E=E5=BC=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: limabiao Change-Id: Ice744fb8c577c300a3bcb2b7af30bc9da64a37de --- input/bundle.json | 27 +++- input/ddk/v1_1/BUILD.gn | 28 ++++ input/ddk/v1_1/HidDdkTypes.idl | 115 +++++++++++++++++ input/ddk/v1_1/IHidDdk.idl | 226 +++++++++++++++++++++++++++++++++ 4 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 input/ddk/v1_1/BUILD.gn create mode 100644 input/ddk/v1_1/HidDdkTypes.idl create mode 100644 input/ddk/v1_1/IHidDdk.idl diff --git a/input/bundle.json b/input/bundle.json index 0f996a41..cd050d0a 100644 --- a/input/bundle.json +++ b/input/bundle.json @@ -28,7 +28,8 @@ "build": { "sub_component": [ "//drivers/interface/input/v1_0:input_idl_target", - "//drivers/interface/input/ddk/v1_0:hid_ddk_idl_target" + "//drivers/interface/input/ddk/v1_0:hid_ddk_idl_target", + "//drivers/interface/input/ddk/v1_1:hid_ddk_idl_target" ], "test": [ ], @@ -72,6 +73,30 @@ ], "header_base": "//drivers/interface/input/ddk" } + }, + { + "name": "//drivers/interface/input/ddk/v1_1:libhid_ddk_proxy_1.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/input/ddk" + } + }, + { + "name": "//drivers/interface/input/ddk/v1_1:libhid_ddk_stub_1.1", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/input/ddk" + } + }, + { + "name": "//drivers/interface/input/ddk/v1_1:hid_ddk_idl_headers", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/input/ddk" + } } ] } diff --git a/input/ddk/v1_1/BUILD.gn b/input/ddk/v1_1/BUILD.gn new file mode 100644 index 00000000..cf55b1f6 --- /dev/null +++ b/input/ddk/v1_1/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") +hdi("hid_ddk") { + module_name = "hid_ddk" + imports = [ "ohos.hdi.input.ddk.v1_0:hid_ddk" ] + + sources = [ + "HidDdkTypes.idl", + "IHidDdk.idl", + ] + + language = "cpp" + mode = "ipc" + subsystem_name = "hdf" + part_name = "drivers_interface_input" +} diff --git a/input/ddk/v1_1/HidDdkTypes.idl b/input/ddk/v1_1/HidDdkTypes.idl new file mode 100644 index 00000000..2be5bca8 --- /dev/null +++ b/input/ddk/v1_1/HidDdkTypes.idl @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2025 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 HdiHidDdk + * @{ + * + * @brief Provides HID DDK APIs, including open device, get an input report, send an output report, etc. + * + * @since 5.1 + * @version 1.1 + */ + + /** + * @file HidDdkTypes.idl + * + * @brief Provides definitions of enum variables and structs in the HID DDK. + * + * @since 5.1 + * @version 1.1 + */ + +package ohos.hdi.input.ddk.v1_1; + +import ohos.hdi.input.ddk.v1_0.HidDdkTypes; + +/** + * @brief Defines the basic device handle. + * + * @since 5.1 + * @version 1.0 + */ +struct HidDeviceHandle { + /** Device file descriptor */ + int fd; + /** Enable or not the nonblocking reads */ + int nonBlock; +}; + +/** + * @brief Defines the report type. + * + * @since 5.1 + * @version 1.0 + */ +enum HidReportType { + /** Input report */ + HID_INPUT_REPORT = 0, + /** Output report */ + HID_OUTPUT_REPORT = 1, + /** Feature report */ + HID_FEATURE_REPORT = 2 +}; + +/** + * @brief Defines the raw dev info. + * + * @since 5.1 + * @version 1.0 + */ +struct HidRawDevInfo { + /** Bus type */ + unsigned int busType; + /** Vendor ID */ + unsigned short vendor; + /** Product ID */ + unsigned short product; +}; + +/** + * @brief Defines the error codes used in the HID DDK. + * + * @since 5.1 + * @version 1.0 + */ +enum HidDdkErrCode { + /** @error Operation successful */ + HID_DDK_SUCCESS = 0, + /** @error Permission denied */ + HID_DDK_NO_PERM = 201, + /** @error Invalid parameter */ + HID_DDK_INVALID_PARAMETER = 401, + /** @error Operation failed */ + HID_DDK_FAILURE = 27300001, + /** @error Null pointer exception */ + HID_DDK_NULL_PTR = 27300002, + /** @error Invalid operation */ + HID_DDK_INVALID_OPERATION = 27300003, + /** @error Timeout */ + HID_DDK_TIMEOUT = 27300004, + /** @error Init operation */ + HID_DDK_INIT_ERROR = 27300005, + /** @error Service error operation */ + HID_DDK_SERVICE_ERROR = 27300006, + /** @error Buff is outside accessible address space */ + HID_DDK_MEMORY_ERROR = 27300007, + /** @error Physical I/O error has occurred. */ + HID_DDK_IO_ERROR = 27300008, + /** @error Device not found. */ + HID_DDK_DEVICE_NOT_FOUND = 27300009 +}; + +/** @} */ \ No newline at end of file diff --git a/input/ddk/v1_1/IHidDdk.idl b/input/ddk/v1_1/IHidDdk.idl new file mode 100644 index 00000000..61959d14 --- /dev/null +++ b/input/ddk/v1_1/IHidDdk.idl @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2025 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 HdiHidDdk + * @{ + * + * @brief Provides HID DDK APIs, including open device, get an input report, send an output report, etc. + * + * @since 5.1 + * @version 1.1 + */ + + /** + * @file IHidDdk.idl + * + * @brief Declares the HID DDK interfaces for the host to access an input device. + * + * @since 5.1 + * @version 1.1 + */ + +package ohos.hdi.input.ddk.v1_1; + +import ohos.hdi.input.ddk.v1_1.HidDdkTypes; +import ohos.hdi.input.ddk.v1_0.HidDdkTypes; +import ohos.hdi.input.ddk.v1_0.IHidDdk; + +/** + * @brief Declares the HID DDK interfaces for the host to access an input device. + * + * @since 5.1 + * @version 1.1 + */ +interface IHidDdk extends ohos.hdi.input.ddk.v1_0.IHidDdk { + /** + * @brief Initializes the HID DDK. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Init(); + + /** + * @brief Releases the HID DDK. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Release(); + + /** + * @brief Open HID device by deviceId in blocking mode. + * + * @param deviceId ID of the device to be operated. + * @param interfaceIndex Interface index, which corresponds to interface which supports USB protocol HID. + * @param dev Device operation handle. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Open([in] unsigned long deviceId, [in] unsigned char interfaceIndex, [out] struct HidDeviceHandle dev); + + /** + * @brief Close HID device by dev. + * + * @param dev Device operation handle. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Close([in] struct HidDeviceHandle dev); + + /** + * @brief Write an Output report to a HID device. + * + * @param dev Device operation handle. + * @param data The data to be sent. + * @param bytesWritten The acture bytes of the data be sent. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Write([in] struct HidDeviceHandle dev, [in] unsigned char[] data, [out] unsigned int bytesWritten); + + /** + * @brief Read an input report from the device with timeout. + * + * @param dev Device operation handle. + * @param data A buffer to put the read data into. + * @param buffSize A buffer size to put the read data into. + * @param timeout Timeout in milliseconds or -1 for blocking wait. + * @param bytesRead The number of bytes to read. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + ReadTimeout([in] struct HidDeviceHandle dev, [out] unsigned char[] data, [in] unsigned int buffSize, [in] int timeout, [out] unsigned int bytesRead); + + /** + * @brief Set the device handle to be non-blocking. + * + * @param dev Device operation handle. + * @param nonBlock Enable or not the nonblocking reads + * - 1 to enable nonblocking + * - 0 to disable nonblocking. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SetNonBlocking([in] struct HidDeviceHandle dev, [in] int nonBlock); + + /** + * @brief Get a raw info from the device. + * + * @param dev Device operation handle. + * @param rawDevInfo Vendor id, product id and bus type get from the device. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetRawInfo([in] struct HidDeviceHandle dev, [out] struct HidRawDevInfo rawDevInfo); + + /** + * @brief Get a raw name from the device. + * + * @param dev Device operation handle. + * @param data A buffer to put the read data into. + * @param buffSize A buffer size to put the read data into. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetRawName([in] struct HidDeviceHandle dev, [out] unsigned char[] data, [in] unsigned int buffSize); + + /** + * @brief Get a physical address from the device. + * + * @param dev Device operation handle. + * @param data A buffer to put the read data into. + * @param buffSize A buffer size to put the read data into. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetPhysicalAddress([in] struct HidDeviceHandle dev, [out] unsigned char[] data, [in] unsigned int buffSize); + + /** + * @brief Get a raw unique id from the device. + * + * @param dev Device operation handle. + * @param data A buffer to put the read data into. + * @param buffSize A buffer size to put the read data into. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetRawUniqueId([in] struct HidDeviceHandle dev, [out] unsigned char[] data, [in] unsigned int buffSize); + + /** + * @brief Send a report to the device. + * + * @param dev Device operation handle. + * @param reportType Report type will be sent. + * @param data The data to be sent. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SendReport([in] struct HidDeviceHandle dev, [in] HidReportType reportType, [in] unsigned char[] data); + + /** + * @brief Get a report from the device. + * + * @param dev Device operation handle. + * @param reportType Report type get from device. + * @param reportNumber The specified report number. + * @param data A buffer to put the read data into. + * @param buffSize A buffer size to put the read data into. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetReport([in] struct HidDeviceHandle dev, [in] HidReportType reportType, [in] unsigned char reportNumber, [out] unsigned char[] data, [in] unsigned int buffSize); + + /** + * @brief Get a report descriptor from the device. + * + * @param dev Device operation handle. + * @param buf The buffer to copy descriptor into. + * @param buffSize A buffer size to put the read data into. + * @param bytesRead The number of bytes to read. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + GetReportDescriptor([in] struct HidDeviceHandle dev, [out] unsigned char[] buf, [in] unsigned int buffSize, [out] unsigned int bytesRead); +} + +/** @} */ \ No newline at end of file -- Gitee From 0e4975110ee1898c9fd4ba40c84a8014ba234776 Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Mon, 13 Jan 2025 03:09:33 +0000 Subject: [PATCH 310/347] add aigc interface Signed-off-by: linchengfeng --- .../include/camera_device_ability_items.h | 18 ++++++++++++++++++ .../include/camera_metadata_item_info.h | 4 ++++ camera/metadata/src/camera_metadata_info.cpp | 2 ++ 3 files changed, 24 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index b3b72e96..f32758c1 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -469,6 +469,24 @@ typedef enum camera_device_metadata_tag { * (i.e. byte ...) */ OHOS_STATUS_SUN_BLOCK_HINT, + /** + * ohos.ability.autoAigcPhoto [static, int31[], public] + * + * camera device property, report current camera whether support auto auto aigc photo by mode + * (i.e. enum: OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED ...) + * @since 5.1 + * @version 1.0 + */ + OHOS_ABILITY_AUTO_AIGC_PHOTO, + /** + * ohos.control.autoAigcPhoto [static, enum, public] + * + * camera device property, set current camera whether support auto aigc photo + * (i.e. byte: -1-false/1-true ...) + * @since 5.1 + * @version 1.0 + */ + OHOS_CONTROL_AUTO_AIGC_PHOTO, /** * ohos.camera.propertiesEnd * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 857675cb..b9e6b357 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -150,6 +150,10 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"sunBlockRgbUvRegion", META_TYPE_FLOAT, -1}, [OHOS_STATUS_SUN_BLOCK_HINT - OHOS_CAMERA_PROPERTIES_START] = {"sunBlockHint", META_TYPE_BYTE, -1}, + [OHOS_ABILITY_AUTO_AIGC_PHOTO - + OHOS_CAMERA_PROPERTIES_START] = {"autoAigcPhoto", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_AUTO_AIGC_PHOTO - + OHOS_CAMERA_PROPERTIES_START] = {"controlAutoAigcPhoto", 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 02b5d6bc..514b80bf 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -86,6 +86,8 @@ const std::vector g_metadataTags = { OHOS_ABILITY_SUN_BLOCK_RGB_CROP_REGION, OHOS_ABILITY_SUN_BLOCK_RGB_UV_REGION, OHOS_STATUS_SUN_BLOCK_HINT, + OHOS_ABILITY_AUTO_AIGC_PHOTO, + OHOS_CONTROL_AUTO_AIGC_PHOTO, OHOS_SENSOR_EXPOSURE_TIME, OHOS_SENSOR_COLOR_CORRECTION_GAINS, -- Gitee From 9cb34508d0e7b144b8e6079ba0c519bca8f6f32f Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Wed, 15 Jan 2025 16:55:54 +0800 Subject: [PATCH 311/347] fix aigc interface Signed-off-by: linchengfeng --- camera/metadata/include/camera_device_ability_items.h | 6 +++--- camera/metadata/include/camera_metadata_item_info.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index f32758c1..e80c53dc 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -470,10 +470,10 @@ typedef enum camera_device_metadata_tag { */ OHOS_STATUS_SUN_BLOCK_HINT, /** - * ohos.ability.autoAigcPhoto [static, int31[], public] + * ohos.ability.autoAigcPhoto [static, int32[], public] * * camera device property, report current camera whether support auto auto aigc photo by mode - * (i.e. enum: OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED ...) + * (i.e. int32[]: [mode, OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED, mode ...] ...) * @since 5.1 * @version 1.0 */ @@ -482,7 +482,7 @@ typedef enum camera_device_metadata_tag { * ohos.control.autoAigcPhoto [static, enum, public] * * camera device property, set current camera whether support auto aigc photo - * (i.e. byte: -1-false/1-true ...) + * (i.e. byte: 0-false/1-true ...) * @since 5.1 * @version 1.0 */ diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index b9e6b357..3874b7a5 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -151,7 +151,7 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME [OHOS_STATUS_SUN_BLOCK_HINT - OHOS_CAMERA_PROPERTIES_START] = {"sunBlockHint", META_TYPE_BYTE, -1}, [OHOS_ABILITY_AUTO_AIGC_PHOTO - - OHOS_CAMERA_PROPERTIES_START] = {"autoAigcPhoto", META_TYPE_BYTE, 1}, + OHOS_CAMERA_PROPERTIES_START] = {"autoAigcPhoto", META_TYPE_INT32, -1}, [OHOS_CONTROL_AUTO_AIGC_PHOTO - OHOS_CAMERA_PROPERTIES_START] = {"controlAutoAigcPhoto", META_TYPE_BYTE, 1}, }; -- Gitee From 6dd4009cc16a4320f2ef7f663e371c5195438590 Mon Sep 17 00:00:00 2001 From: dairan Date: Fri, 10 Jan 2025 21:05:08 +0800 Subject: [PATCH 312/347] fix:add usb interface Signed-off-by: dairan --- usb/bundle.json | 22 ++ usb/v2_0/BUILD.gn | 38 ++ usb/v2_0/IUsbDeviceInterface.idl | 111 ++++++ usb/v2_0/IUsbHostInterface.idl | 591 +++++++++++++++++++++++++++++ usb/v2_0/IUsbPortInterface.idl | 108 ++++++ usb/v2_0/IUsbdBulkCallback.idl | 47 +++ usb/v2_0/IUsbdSubscriber.idl | 49 +++ usb/v2_0/IUsbdTransferCallback.idl | 48 +++ usb/v2_0/UsbTypes.idl | 171 +++++++++ 9 files changed, 1185 insertions(+) create mode 100644 usb/v2_0/BUILD.gn create mode 100644 usb/v2_0/IUsbDeviceInterface.idl create mode 100644 usb/v2_0/IUsbHostInterface.idl create mode 100644 usb/v2_0/IUsbPortInterface.idl create mode 100644 usb/v2_0/IUsbdBulkCallback.idl create mode 100644 usb/v2_0/IUsbdSubscriber.idl create mode 100644 usb/v2_0/IUsbdTransferCallback.idl create mode 100644 usb/v2_0/UsbTypes.idl diff --git a/usb/bundle.json b/usb/bundle.json index f24c4ad4..ff865343 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -33,6 +33,7 @@ "//drivers/interface/usb/v1_0:usb_idl_target", "//drivers/interface/usb/v1_1:usb_idl_target", "//drivers/interface/usb/v1_2:usb_idl_target", + "//drivers/interface/usb/v2_0:usb_idl_target", "//drivers/interface/usb/gadget/mtp/v1_0:usbfn_mtp_idl_target", "//drivers/interface/usb/ddk/v1_0:usb_ddk_idl_target" ], @@ -142,6 +143,27 @@ "header_files": [], "header_base": "//drivers/interface/usb" } + }, + { + "name": "//drivers/interface/usb/v2_0:libusb_proxy_2.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb" + } + }, + { + "name": "//drivers/interface/usb/v2_0:libusb_stub_2.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb" + } + }, + { + "name": "//drivers/interface/usb/v2_0:usb_idl_headers_2.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb" + } } ] } diff --git a/usb/v2_0/BUILD.gn b/usb/v2_0/BUILD.gn new file mode 100644 index 00000000..4cec6d16 --- /dev/null +++ b/usb/v2_0/BUILD.gn @@ -0,0 +1,38 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") +if (defined(ohos_lite)) { + group("libusb_proxy_2.0") { + deps = [] + public_configs = [] + } +} else { + hdi("usb") { + module_name = "usbd" + + sources = [ + "IUsbDeviceInterface.idl", + "IUsbHostInterface.idl", + "IUsbPortInterface.idl", + "IUsbdBulkCallback.idl", + "IUsbdSubscriber.idl", + "IUsbdTransferCallback.idl", + "UsbTypes.idl", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_usb" + } +} diff --git a/usb/v2_0/IUsbDeviceInterface.idl b/usb/v2_0/IUsbDeviceInterface.idl new file mode 100644 index 00000000..1b3c9244 --- /dev/null +++ b/usb/v2_0/IUsbDeviceInterface.idl @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2025 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +import ohos.hdi.usb.v2_0.IUsbdSubscriber; + +interface IUsbDeviceInterface { + + /* * + * @brief Obtains the list of functions (represented by bit field) supported by the current device. + * + * @param funcs Indicates the list of functions supported by the current device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetCurrentFunctions([out] int funcs); + + /* * + * @brief Sets the list of functions (represented by bit field) supported by the current device. + * + * @param funcs Indicates the list of functions supported by the current device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + SetCurrentFunctions([in] int funcs); + + /* * + * @brief Get Accessory Strings. + * + * @param accessoryInfo Indicates the accessory information. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetAccessoryInfo([out] String[] accessoryInfo); + + /* * + * @brief open the accessory. + * + * @param fd accessory file descriptor + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + OpenAccessory([out] FileDescriptor fd); + + /* * + * @brief close the accessory. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + CloseAccessory([in] FileDescriptor fd); + + /* * + * @brief Binds a subscriber. + * + * @param subscriber Indicates the subscriber. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + BindUsbdDeviceSubscriber([in] IUsbdSubscriber subscriber); + + /* * + * @brief Unbinds a subscriber. + * + * @param subscriber Indicates the subscriber. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UnbindUsbdDeviceSubscriber([in] IUsbdSubscriber subscriber); +} \ No newline at end of file diff --git a/usb/v2_0/IUsbHostInterface.idl b/usb/v2_0/IUsbHostInterface.idl new file mode 100644 index 00000000..451e9c97 --- /dev/null +++ b/usb/v2_0/IUsbHostInterface.idl @@ -0,0 +1,591 @@ +/* + * Copyright (c) 2025 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.1 + * @version 1.0 + */ + +/* * + * @file IUsbHostInterface.idl + * + * @brief Declares the APIs provided by the usb module for 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +import ohos.hdi.usb.v2_0.UsbTypes; +import ohos.hdi.usb.v2_0.IUsbdSubscriber; +import ohos.hdi.usb.v2_0.IUsbdBulkCallback; +import ohos.hdi.usb.v2_0.IUsbdTransferCallback; + +/* * + * @brief Defines the functions for performing basic operations on usb. + * + * The operations include 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. + */ +interface IUsbHostInterface { + + /* * + * @brief Opens a USB device to set up a connection. + * + * @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.1 + * @version 1.0 + */ + OpenDevice([in] struct UsbDev dev); + + /* * + * @brief Closes a USB device to release all system resources related to the 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.1 + * @version 1.0 + */ + CloseDevice([in] struct UsbDev dev); + + /* * + * @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.1 + * @version 1.0 + */ + ResetDevice([in] struct UsbDev dev); + + /* * + * @brief Claims a USB interface exclusively. This must be done before data transfer. + * + * @param dev Indicates the USB device address. + * @param interfaceid Indicates the interface ID of the USB device. + * @param force Indicates whether to enable the force mode. The value 1 indicates that the force mode is + * enabled, and value 0 indicates the opposite. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + ClaimInterface([in] struct UsbDev dev, [in] unsigned char interfaceid, [in] unsigned char force); + + /* * + * @brief Sets the alternate settings for the specified USB interface. This allows you to switch between two + * interfaces with the same ID but different alternate settings. + * + * @param dev Indicates the USB device address. + * @param interfaceid Indicates the interface ID of the USB device. + * @param altIndex Indicates the alternate settings of the USB interface. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + SetInterface([in] struct UsbDev dev, [in] unsigned char interfaceid, [in] unsigned char altIndex); + + /* * + * @brief Releases a USB interface. This is usually done after data transfer. + * + * @param dev Indicates the USB device address. + * @param interfaceid Indicates the interface ID of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + ReleaseInterface([in] struct UsbDev dev, [in] unsigned char interfaceid); + + /* * + * @brief Sets the configuration information of a USB device. + * + * @param dev Indicates the USB device address. + * @param configIndex Indicates the configuration information of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + SetConfig([in] struct UsbDev dev, [in] unsigned char configIndex); + + /* * + * @brief Manage a USB interface exclusively. Detach or attach the interface. + * + * @param dev Indicates the USB device address. + * @param interfaceid Indicates the interface ID of the USB device. + * @param disable Indicates whether to disable the interface. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + ManageInterface([in] struct UsbDev dev, [in] unsigned char interfaceid, [in] boolean disable); + + /* * + * @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.1 + * @version 1.0 + */ + ClearHalt([in] struct UsbDev dev, [in] struct UsbPipe pipe); + + /* * + * @brief Obtains USB device speed. + * + * @param dev Indicates the USB device address. + * @param speed Indicates the USB device speed. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetDeviceSpeed([in] struct UsbDev dev, [out] unsigned char speed); + + /* * + * @brief Obtains the file descriptor. + * + * @param dev Indicates the USB device address. + * @param fd USB device file descriptor + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetDeviceFileDescriptor([in] struct UsbDev dev, [out] FileDescriptor fd); + + /* * + * @brief Obtains the string descriptor of a USB device based on the specified string ID. + * + * @param dev Indicates the USB device address. + * @param descId Indicates string descriptor ID. + * @param descriptor Indicates the configuration descriptor of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetStringDescriptor([in] struct UsbDev dev, [in] unsigned char descId, [out] unsigned char[] descriptor); + + /* * + * @brief Obtains the raw descriptor. + * + * @param dev Indicates the USB device address. + * @param descriptor Indicates the raw descriptor of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetRawDescriptor([in] struct UsbDev dev, [out] unsigned char[] descriptor); + + /* * + * @brief Obtains the configuration information of a USB device. + * + * @param dev Indicates the USB device address. + * @param configIndex Indicates the configuration information of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetConfig([in] struct UsbDev dev, [out] unsigned char configIndex); + + /* * + * @brief Obtain the activation information of the USB device interface. + * + * @param dev Indicates the USB device address. + * @param interfaceid Indicates the interface ID of the USB device. + * @param unactivated Indicates whether the interface unactivated. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetInterfaceActiveStatus([in] struct UsbDev dev, [in] unsigned char interfaceid, [out] boolean unactivated ); + + /* * + * @brief Obtains the USB device descriptor. + * + * @param dev Indicates the USB device address. + * @param descriptor Indicates the USB device descriptor. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetDeviceDescriptor([in] struct UsbDev dev, [out] unsigned char[] descriptor); + + /* * + * @brief Obtains the configuration descriptor of a USB device based on the specified config ID. + * + * @param dev Indicates the USB device address. + * @param descId Indicates configuration descriptor ID. + * @param descriptor Indicates the configuration descriptor of the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + GetConfigDescriptor([in] struct UsbDev dev, [in] unsigned char descId, [out] unsigned char[] descriptor); + + /* * + * @brief Obtains the file descriptor. + * + * @param dev Indicates the USB device address. + * @param fd USB device file descriptor + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + * @deprecated since 5.1 + * @useinstead ohos.hdi.usb.v2_0.IUsbInterface.GetDeviceFileDescriptor + */ + GetFileDescriptor([in] struct UsbDev dev, [out] int fd); + + /* * + * @brief Sends or receives requests for isochronous transfer on a specified endpoint. The data transfer direction + * is determined by the endpoint direction. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param clientData Indicates the client data. + * @param buffer Indicates the transferred data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + RequestQueue([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] unsigned char[] clientData, [in] unsigned char[] buffer); + + /* * + * @brief Waits for the operation result of the isochronous transfer request in RequestQueue. + * + * @param dev Indicates the USB device address. + * @param clientData Indicates the client data. + * @param buffer Indicates the transferred data. + * @param timeout Indicates the timeout duration. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + RequestWait([in] struct UsbDev dev, [out] unsigned char[] clientData, [out] unsigned char[] buffer, [in] int timeout); + + /* * + * @brief Cancels the data transfer requests to be processed. + * + * @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.1 + * @version 1.0 + */ + RequestCancel([in] struct UsbDev dev, [in] struct UsbPipe pipe); + + /* * + * @brief Reads data on a specified endpoint during bulk transfer. The endpoint must be in the data reading + * direction. You can specify a timeout duration if needed. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @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.1 + * @version 1.0 + * @deprecated since 5.1 + * @useinstead ohos.hdi.usb.v2_0.IUsbInterface.BulkTransferReadwithLength + */ + BulkTransferRead([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [out] unsigned char[] data); + + /* * + * @brief Writes data on a specified endpoint during bulk transfer. The endpoint must be in the data writing + * direction. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @param data Indicates the written data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + BulkTransferWrite([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] unsigned char[] data); + + /* * + * @brief Reads data on a specified endpoint during bulk transfer. The endpoint must be in the data reading + * direction. You can specify a timeout duration if needed. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @param length the maximum number of bytes to receive into the data buffer. + * @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.1 + * @version 1.0 + */ + BulkTransferReadwithLength([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] int length, [out] unsigned char[] data); + + /* * + * @brief Registers a callback for isochronous bulk transfer. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param cb Indicates the reference to the callback. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + RegBulkCallback([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] IUsbdBulkCallback cb); + + /* * + * @brief Unregisters the callback for isochronous bulk transfer. + * + * @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.1 + * @version 1.0 + */ + UnRegBulkCallback([in] struct UsbDev dev, [in] struct UsbPipe pipe); + + /* * + * @brief Reads data during isochronous bulk transfer. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param ashmem Indicates the shared memory, which is used to store the read data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + BulkRead([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] Ashmem ashmem); + + /* * + * @brief Writes data during isochronous bulk transfer. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param ashmem Indicates the shared memory, which is used to store the written data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + BulkWrite([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] Ashmem ashmem); + + /* * + * @brief Cancels the isochronous bulk transfer. The read and write operations on the current USB interface will + * be cancelled. + * + * @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.1 + * @version 1.0 + */ + BulkCancel([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& + * 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.1 + * @version 1.0 + * @deprecated since 5.1 + * @useinstead ohos.hdi.usb.v2_0.IUsbInterface.ControlTransferReadwithLength + */ + ControlTransferRead([in] struct UsbDev dev, [in] struct UsbCtrlTransfer ctrl, [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 writing direction. + * + * @param dev Indicates the USB device address. + * @param ctrl Indicates the control data packet structure. + * @param data Indicates the write data. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + ControlTransferWrite([in] struct UsbDev dev, [in] struct UsbCtrlTransfer ctrl, [in] 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.1 + * @version 1.0 + */ + ControlTransferReadwithLength([in] struct UsbDev dev, [in] struct UsbCtrlTransferParams ctrl, [out] unsigned char[] data); + + /* * + * @brief Reads data on a specified endpoint during interrupt transfer. The endpoint must be in the data reading + * direction. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @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.1 + * @version 1.0 + */ + InterruptTransferRead([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [out] unsigned char[] data); + + /* * + * @brief Writes data on a specified endpoint during interrupt transfer. The endpoint must be in the data writing + * direction. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @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.1 + * @version 1.0 + */ + InterruptTransferWrite([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] unsigned char[] data); + + /* * + * @brief Reads data on a specified endpoint during isochronous transfer. The endpoint must be in the data reading + * direction. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @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.1 + * @version 1.0 + */ + IsoTransferRead([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [out] unsigned char[] data); + + /* * + * @brief Writes data on a specified endpoint during isochronous transfer. The endpoint must be in the data writing + * direction. + * + * @param dev Indicates the USB device address. + * @param pipe Indicates the pipe of the USB device. + * @param timeout Indicates the timeout duration. + * @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.1 + * @version 1.0 + */ + IsoTransferWrite([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] unsigned char[] data); + + /* * + * @brief Binds a subscriber. + * + * @param subscriber Indicates the subscriber. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + BindUsbdHostSubscriber([in] IUsbdSubscriber subscriber); + + /* * + * @brief Unbinds a subscriber. + * + * @param subscriber Indicates the subscriber. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UnbindUsbdHostSubscriber([in] IUsbdSubscriber subscriber); + + /* * + * @brief Submit usb async transfer. + * + * @param dev Indicates the USB device address. + * @param info Indicates the param info of the USB transfer. + * @param cb Indicates the callback function of base. + * @param ashmem Indicates the object of share memory + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UsbSubmitTransfer([in] struct UsbDev dev, [in] USBTransferInfo info, [in] IUsbdTransferCallback cb, [in] Ashmem ashmem); + + /* * + * @brief Cancels the usb async transfer by endpoint. + * + * @param dev Indicates the USB device address. + * @param endpoint Indicates the endpoint address. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UsbCancelTransfer([in] struct UsbDev dev, [in] int endpoint); +} \ No newline at end of file diff --git a/usb/v2_0/IUsbPortInterface.idl b/usb/v2_0/IUsbPortInterface.idl new file mode 100644 index 00000000..b647ddfc --- /dev/null +++ b/usb/v2_0/IUsbPortInterface.idl @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2025 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.1 + * @version 1.0 + */ + +/* * + * @file IUsbPortInterface.idl + * + * @brief Declares the APIs provided by the usb module for 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +import ohos.hdi.usb.v2_0.UsbTypes; +import ohos.hdi.usb.v2_0.IUsbdSubscriber; + +interface IUsbPortInterface { + + /* * + * @brief Set the USB port role and data role. + * + * @param portId Indicates the port ID of the USB interface. + * @param powerRole Indicates the power role. + * @param dataRole Indicates the data role. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + SetPortRole([in] int portId, [in] int powerRole, [in] int dataRole); + + /* * + * @brief Queries the current settings of a port. + * + * @param portId Indicates the port ID of the USB interface. + * @param powerRole Indicates the power role. + * @param dataRole Indicates the data role. + * @param mode Indicates the mode. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + QueryPort([out] int portId, [out] int powerRole, [out] int dataRole, [out] int mode); + + /* * + * @brief Queries the current settings of all ports. + * + * @param portList Indicates the ports ID of the USB interface. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + QueryPorts([out] struct UsbPort[] portList); + + /* * + * @brief Binds a subscriber. + * + * @param subscriber Indicates the subscriber. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + BindUsbdPortSubscriber([in] IUsbdSubscriber subscriber); + + /* * + * @brief Unbinds a subscriber. + * + * @param subscriber Indicates the subscriber. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 5.1 + * @version 1.0 + */ + UnbindUsbdPortSubscriber([in] IUsbdSubscriber subscriber); +} \ No newline at end of file diff --git a/usb/v2_0/IUsbdBulkCallback.idl b/usb/v2_0/IUsbdBulkCallback.idl new file mode 100644 index 00000000..7731c0f6 --- /dev/null +++ b/usb/v2_0/IUsbdBulkCallback.idl @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2025 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +/** + * @brief Defines the callback for reporting usb data. This callback needs to be registered when + * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive + * usb data. For details, see {@link IUsbHostInterface}. + * + * @since 5.1 + * @version 1.0 + */ +[callback] interface IUsbdBulkCallback { + + OnBulkWriteCallback([in] int status, [in] int actLength); + + OnBulkReadCallback([in] int status, [in] int actLength); + +} \ No newline at end of file diff --git a/usb/v2_0/IUsbdSubscriber.idl b/usb/v2_0/IUsbdSubscriber.idl new file mode 100644 index 00000000..a78a953e --- /dev/null +++ b/usb/v2_0/IUsbdSubscriber.idl @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +import ohos.hdi.usb.v2_0.UsbTypes; + +/** + * @brief Defines the callback for reporting usb data. This callback needs to be registered when + * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive + * usb data. For details, see {@link IUsbInterface}. + * + * @since 5.1 + * @version 1.0 + */ +[callback] interface IUsbdSubscriber { + + DeviceEvent([in] struct USBDeviceInfo info); + + PortChangedEvent([in] struct PortInfo info); + +} \ No newline at end of file diff --git a/usb/v2_0/IUsbdTransferCallback.idl b/usb/v2_0/IUsbdTransferCallback.idl new file mode 100644 index 00000000..2e91aff5 --- /dev/null +++ b/usb/v2_0/IUsbdTransferCallback.idl @@ -0,0 +1,48 @@ +/* + * 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.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +import ohos.hdi.usb.v2_0.UsbTypes; + +/** + * @brief Defines the callback for reporting usb data. This callback needs to be registered when + * a usb user subscribes to usb data. Only after the usb is enabled, the usb data subscriber can receive + * usb data. For details, see {@link IUsbInterface}. + * + * @since 5.1 + * @version 1.0 + */ +[callback] interface IUsbdTransferCallback { + + OnTransferWriteCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); + + OnTransferReadCallback([in] int status, [in] int actLength, [in] UsbIsoPacketDescriptor[] descs, [in] unsigned long userData); + +} \ No newline at end of file diff --git a/usb/v2_0/UsbTypes.idl b/usb/v2_0/UsbTypes.idl new file mode 100644 index 00000000..a124a031 --- /dev/null +++ b/usb/v2_0/UsbTypes.idl @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2025 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.1 + * @version 1.0 + */ + +/** + * @file UsbTypes.idl + * + * @brief Defines the data used by the usb module, including the usb information, + * and reported usb data. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.usb.v2_0; + +/** + * @brief Defines the ControlTransfer Params, which is used by {@link IUsbHostInterface::ControlTransferReadwithLength}. + * @since 5.1 + * @version 1.0 + */ +struct UsbCtrlTransferParams { + int requestType; + int requestCmd; + int value; + int index; + int length; + int timeout; +}; + +/** + * @brief Defines the UsbDev Params. + * @since 5.1 + * @version 1.0 + */ +struct UsbDev { + unsigned char busNum; + unsigned char devAddr; +}; + +/** + * @brief Defines the UsbPipe Params. + * @since 5.1 + * @version 1.0 + */ +struct UsbPipe { + unsigned char intfId; + unsigned char endpointId; +}; + +/** + * @brief Defines the UsbCtrlTransfer Params. + * @since 5.1 + * @version 1.0 + */ +struct UsbCtrlTransfer { + int requestType; + int requestCmd; + int value; + int index; + int timeout; +}; + +/** + * @brief Defines the USBDeviceInfo Params. + * @since 5.1 + * @version 1.0 + */ +struct USBDeviceInfo { + int status; + int busNum; + int devNum; +}; + +/** + * @brief Defines the RoleCombinations Params. + * @since 5.1 + * @version 1.0 + */ +struct RoleCombinations { + int powerRole; + int dataRole; +}; + +/** + * @brief Defines the PortInfo Params. + * @since 5.1 + * @version 1.0 + */ +struct PortInfo { + int portId; + int powerRole; + int dataRole; + int mode; +}; + +/** + * @brief Defines the UsbPortStatus Params. + * @since 5.1 + * @version 1.0 + */ +struct UsbPortStatus { + int currentMode; + int currentPowerRole; + int currentDataRole; + int isConnected; + RoleCombinations[] supportedRoleCombinations; +}; + +/** + * @brief Defines the UsbPort Params. + * @since 5.1 + * @version 1.0 + */ +struct UsbPort { + int id; + int supportedModes; + UsbPortStatus usbPortStatus; +}; + +/** + * @brief Defines the USB iso packet descriptor params. + * @since 5.1 + * @version 1.0 + */ +struct UsbIsoPacketDescriptor { + int isoLength; + int isoActualLength; + int isoStatus; +}; + +/** + * @brief Defines the USB transferInfo Params. + * @since 5.1 + * @version 1.0 + */ +struct USBTransferInfo { + int endpoint; + int flags; + int type; + int timeOut; + int length; + unsigned long userData; + unsigned int numIsoPackets; +}; -- Gitee From 2a8d6c48da2013cf822dfae650ff3d36a7d5c571 Mon Sep 17 00:00:00 2001 From: cold Date: Tue, 14 Jan 2025 14:15:13 +0800 Subject: [PATCH 313/347] metadataChangeParcel Signed-off-by: cold --- camera/metadata/src/metadata_utils.cpp | 84 ++++++++------------------ 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index 28126cad..576fc97e 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -361,41 +361,17 @@ bool MetadataUtils::WriteMetadata(const camera_metadata_item_t &item, MessagePar bool bRet = false; size_t i; if (item.data_type == META_TYPE_BYTE) { - std::vector byteBuffers; - for (i = 0; i < item.count; i++) { - byteBuffers.push_back(*(item.data.u8 + i)); - } - bRet = data.WriteUInt8Vector(byteBuffers); + bRet = data.WriteUnpadBuffer(item.data.u8, item.count * sizeof(uint8_t)); } else if (item.data_type == META_TYPE_INT32) { - std::vector int32Buffers; - for (i = 0; i < item.count; i++) { - int32Buffers.push_back(*(item.data.i32 + i)); - } - bRet = data.WriteInt32Vector(int32Buffers); + bRet = data.WriteUnpadBuffer(item.data.i32, item.count * sizeof(int32_t)); } else if (item.data_type == META_TYPE_FLOAT) { - std::vector floatBuffers; - for (i = 0; i < item.count; i++) { - floatBuffers.push_back(*(item.data.f + i)); - } - bRet = data.WriteFloatVector(floatBuffers); + bRet = data.WriteUnpadBuffer(item.data.f, item.count * sizeof(float)); } else if (item.data_type == META_TYPE_UINT32) { - std::vector uInt32Buffers; - for (i = 0; i < item.count; i++) { - uInt32Buffers.push_back(*(item.data.ui32 + i)); - } - bRet = data.WriteUInt32Vector(uInt32Buffers); + bRet = data.WriteUnpadBuffer(item.data.ui32, item.count * sizeof(uint32_t)); } else if (item.data_type == META_TYPE_INT64) { - std::vector int64Buffers; - for (i = 0; i < item.count; i++) { - int64Buffers.push_back(*(item.data.i64 + i)); - } - bRet = data.WriteInt64Vector(int64Buffers); + bRet = data.WriteUnpadBuffer(item.data.i64, item.count * sizeof(int64_t)); } else if (item.data_type == META_TYPE_DOUBLE) { - std::vector doubleBuffers; - for (i = 0; i < item.count; i++) { - doubleBuffers.push_back(*(item.data.d + i)); - } - bRet = data.WriteDoubleVector(doubleBuffers); + bRet = data.WriteUnpadBuffer(item.data.d, item.count * sizeof(double)); } else if (item.data_type == META_TYPE_RATIONAL) { std::vector rationalBuffers; for (i = 0; i < item.count; i++) { @@ -569,73 +545,61 @@ int MetadataUtils::copyDecodeFromStringMem(common_metadata_header_t *meta, char static void ReadMetadataUInt8(camera_metadata_item_t &entry, MessageParcel &data) { - std::vector buffers; - data.ReadUInt8Vector(&buffers); entry.data.u8 = new(std::nothrow) uint8_t[entry.count]; if (entry.data.u8 != nullptr) { - for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { - entry.data.u8[i] = buffers.at(i); - } + size_t dataSize = entry.count * sizeof(uint8_t); + const uint8_t* ptr = data.ReadUnpadBuffer(dataSize); + memcpy_s(entry.data.u8, dataSize, ptr, dataSize); } } static void ReadMetadataInt32(camera_metadata_item_t &entry, MessageParcel &data) { - std::vector buffers; - data.ReadInt32Vector(&buffers); entry.data.i32 = new(std::nothrow) int32_t[entry.count]; if (entry.data.i32 != nullptr) { - for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { - entry.data.i32[i] = buffers.at(i); - } + size_t dataSize = entry.count * sizeof(int32_t); + const uint8_t* ptr = data.ReadUnpadBuffer(dataSize); + memcpy_s(entry.data.i32, dataSize, ptr, dataSize); } } static void ReadMetadataUInt32(camera_metadata_item_t &entry, MessageParcel &data) { - std::vector buffers; - data.ReadUInt32Vector(&buffers); entry.data.ui32 = new(std::nothrow) uint32_t[entry.count]; if (entry.data.ui32 != nullptr) { - for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { - entry.data.ui32[i] = buffers.at(i); - } + size_t dataSize = entry.count * sizeof(uint32_t); + const uint8_t* ptr = data.ReadUnpadBuffer(dataSize); + memcpy_s(entry.data.ui32, dataSize, ptr, dataSize); } } static void ReadMetadataFloat(camera_metadata_item_t &entry, MessageParcel &data) { - std::vector buffers; - data.ReadFloatVector(&buffers); entry.data.f = new(std::nothrow) float[entry.count]; if (entry.data.f != nullptr) { - for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { - entry.data.f[i] = buffers.at(i); - } + size_t dataSize = entry.count * sizeof(float); + const uint8_t* ptr = data.ReadUnpadBuffer(dataSize); + memcpy_s(entry.data.f, dataSize, ptr, dataSize); } } static void ReadMetadataInt64(camera_metadata_item_t &entry, MessageParcel &data) { - std::vector buffers; - data.ReadInt64Vector(&buffers); entry.data.i64 = new(std::nothrow) int64_t[entry.count]; if (entry.data.i64 != nullptr) { - for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { - entry.data.i64[i] = buffers.at(i); - } + size_t dataSize = entry.count * sizeof(int64_t); + const uint8_t* ptr = data.ReadUnpadBuffer(dataSize); + memcpy_s(entry.data.i64, dataSize, ptr, dataSize); } } static void ReadMetadataDouble(camera_metadata_item_t &entry, MessageParcel &data) { - std::vector buffers; - data.ReadDoubleVector(&buffers); entry.data.d = new(std::nothrow) double[entry.count]; if (entry.data.d != nullptr) { - for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { - entry.data.d[i] = buffers.at(i); - } + size_t dataSize = entry.count * sizeof(double); + const uint8_t* ptr = data.ReadUnpadBuffer(dataSize); + memcpy_s(entry.data.d, dataSize, ptr, dataSize); } } -- Gitee From 3f786e350159549779b49e2f2b11eb8b76ebe538 Mon Sep 17 00:00:00 2001 From: "yangmaoquan@chinasoftinc.com" Date: Sat, 21 Dec 2024 11:15:57 +0800 Subject: [PATCH 314/347] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=9D=9E=E6=A0=87?= =?UTF-8?q?=E5=A4=96=E8=AE=BE=E6=89=A9=E5=B1=95=E9=A9=B1=E5=8A=A8-USBSeria?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8a3896651dec92b20853839456342df6d09a1a51 Signed-off-by: yangmaoquan@chinasoftinc.com --- usb/bundle.json | 21 ++ usb/usb_serial_ddk/v1_0/BUILD.gn | 28 +++ usb/usb_serial_ddk/v1_0/IUsbSerialDdk.idl | 186 ++++++++++++++++++ usb/usb_serial_ddk/v1_0/UsbSerialDdkTypes.idl | 96 +++++++++ 4 files changed, 331 insertions(+) create mode 100644 usb/usb_serial_ddk/v1_0/BUILD.gn create mode 100644 usb/usb_serial_ddk/v1_0/IUsbSerialDdk.idl create mode 100644 usb/usb_serial_ddk/v1_0/UsbSerialDdkTypes.idl diff --git a/usb/bundle.json b/usb/bundle.json index 60f8bc45..7ac12c09 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -186,6 +186,27 @@ "header_files": [], "header_base": "//drivers/interface/usb/ddk" } + }, + { + "name": "//drivers/interface/usb/usb_serial_ddk/v1_0:libusb_serial_ddk_proxy_1.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/usb_serial_ddk" + } + }, + { + "name": "//drivers/interface/usb/usb_serial_ddk/v1_0:libusb_serial_ddk_stub_1.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/usb_serial_ddk" + } + }, + { + "name": "//drivers/interface/usb/usb_serial_ddk/v1_0:usb_serial_ddk_idl_headers", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/usb_serial_ddk" + } } ] } diff --git a/usb/usb_serial_ddk/v1_0/BUILD.gn b/usb/usb_serial_ddk/v1_0/BUILD.gn new file mode 100644 index 00000000..57ce74cb --- /dev/null +++ b/usb/usb_serial_ddk/v1_0/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") + +hdi("usb_serial_ddk") { + module_name = "usb_serial_ddk" + + sources = [ + "IUsbSerialDdk.idl", + "UsbSerialDdkTypes.idl", + ] + + language = "cpp" + mode = "ipc" + subsystem_name = "hdf" + part_name = "drivers_interface_usb" +} diff --git a/usb/usb_serial_ddk/v1_0/IUsbSerialDdk.idl b/usb/usb_serial_ddk/v1_0/IUsbSerialDdk.idl new file mode 100644 index 00000000..735eb7ce --- /dev/null +++ b/usb/usb_serial_ddk/v1_0/IUsbSerialDdk.idl @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2025 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 HdiUsbUsbSerialDdk + * @{ + * + * @brief Provides USB SERIAL DDK types and declares the macros, enumerated variables, and\n + * data structures required by the USB SERIAL DDK APIs. + * + * @syscap SystemCapability.Driver.UsbSerial.Extension + * @since 5.1 + * @version 1.0 + */ + +/** + * @file IUsbSerialDdk.idl + * + * @brief Declares the USB SERIAL DDK APIs used by the USB serial host to access USB serial devices. + * + * @since 5.1 + * @version 1.0 + */ +package ohos.hdi.usb.usb_serial_ddk.v1_0; + +import ohos.hdi.usb.usb_serial_ddk.v1_0.UsbSerialDdkTypes; + +/* * + * @brief Declares the USB DDK APIs used by the USB host to access USB devices. + */ +interface IUsbSerialDdk +{ + + /* * + * @brief Initializes the USB serial DDK. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Init(); + + /* * + * @brief Releases the DDK. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Release(); + + /** + * @brief Open USB serial device by deviceId. + * + * @param deviceId ID of the device to be operated. + * @param interfaceIndex Interface index, which corresponds to interface which supports USB Protocol ACM. + * @param dev Device handle. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Open([in] unsigned long deviceId, [in] unsigned long interfaceIndex, [out] struct UsbSerialDeviceHandle dev); + + /** + * @brief Close USB serial device. + * + * @param dev Device handle. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Close([in] struct UsbSerialDeviceHandle dev); + + /** + * @brief Read bytesRead into buff from UsbSerial device. + * + * @param dev Device handle. + * @param bufferSize Max buff size. + * @param buff Received data from a serial device. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Read([in] struct UsbSerialDeviceHandle dev, [in] unsigned int bufferSize, [out] List buff); + + /** + * @brief Write bytesWritten from buff to UsbSerial device. + * + * @param dev Device handle. + * @param buff Serial information write to device. + * @param bytesWritten Actual bytes written. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Write([in] struct UsbSerialDeviceHandle dev, [in] List buff, [out] unsigned int bytesWritten); + + /** + * @brief Set the serial port baud rate. + * + * @param dev Device handle. + * @param baudRate Serial port baud rate set to connect device. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SetBaudRate([in] struct UsbSerialDeviceHandle dev, [in] unsigned int baudRate); + + /** + * @brief Set the serial port parameters. + * + * @param dev Device handle. + * @param params Serial port params set to connect device. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SetParams([in] struct UsbSerialDeviceHandle dev, [in] struct UsbSerialParams params); + + /** + * @brief Sets the read timeout (in milliseconds)/blocking mode + * + * @param dev Device handle. + * @param timeout Set to -1 to infinite timeout, 0 to return immediately with any data (non + blocking, or >0 to wait for data for a specified number of milliseconds). Timeout will + be rounded to the nearest 100ms (a Linux API restriction). Maximum value limited to + 25500ms (another Linux API restriction). + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SetTimeout([in] struct UsbSerialDeviceHandle dev, [in] int timeout); + + /** + * @brief Sets FlowControl params. + * + * @param dev Device handle. + * @param flowControl flow control mode. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SetFlowControl([in] struct UsbSerialDeviceHandle dev, [in] enum UsbSerialFlowControl flowControl); + + /** + * @brief flush buffers after write. + * + * @param dev Device handle. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Flush([in] struct UsbSerialDeviceHandle dev); + + /** + * @brief flush read buffers. + * + * @param dev Device handle. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + FlushInput([in] struct UsbSerialDeviceHandle dev); + + /** + * @brief flush write buffers. + * + * @param dev Device handle. + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + FlushOutput([in] struct UsbSerialDeviceHandle dev); +} diff --git a/usb/usb_serial_ddk/v1_0/UsbSerialDdkTypes.idl b/usb/usb_serial_ddk/v1_0/UsbSerialDdkTypes.idl new file mode 100644 index 00000000..cca5b4cd --- /dev/null +++ b/usb/usb_serial_ddk/v1_0/UsbSerialDdkTypes.idl @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2025 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 HdiUsbSerialDdk + * @{ + * + * @brief Provides USB SERIAL DDK types and declares the macros, enumerated variables, and\n + * data structures required by the USB SERIAL DDK APIs. + * + * @syscap SystemCapability.Driver.UsbSerial.Extension + * @since 5.1 + * @version 1.0 + */ + + /** + * @file UsbSerialDdkTypes.idl + * + * @brief Defines the enumeration values and data structures of the user_auth driver. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.usb.usb_serial_ddk.v1_0; + + /** + * @brief Defines USB Serial UsbSerialDeviceHandle for USB SERIAL DDK. + * + * @since 5.1 + * @version 1.0 + */ +struct UsbSerialDeviceHandle { + /** The usb serial device fd */ + unsigned int fd; +}; + +/** + * @brief Defines flow control for USB SERIAL DDK. + * + * @since 5.1 + * @version 1.0 + */ +enum UsbSerialFlowControl { + /** No flow control */ + USB_SERIAL_NO_FLOW_CONTROL = 0, + /** Software flow control */ + USB_SERIAL_SOFTWARE_FLOW_CONTROL = 1, + /** Hardware flow control */ + USB_SERIAL_HARDWARE_FLOW_CONTROL = 2, +}; + +/** + * @brief Defines parity for USB SERIAL DDK. + * + * @since 5.1 + * @version 1.0 + */ +enum UsbSerialParity { + /** No parity */ + USB_SERIAL_PARITY_NONE = 0, + /** Odd parity */ + USB_SERIAL_PARITY_ODD = 1, + /** Even parity */ + USB_SERIAL_PARITY_EVEN = 2, +}; + + /** + * @brief Defines USB Serial Port Params for USB SERIAL DDK. + * + * @since 5.1 + * @version 1.0 + */ +struct UsbSerialParams { + /** The baud rate requested by the system */ + unsigned int baudRate; + /** The number of data bits to transmit */ + unsigned char nDataBits; + /** The number of half stop bits. */ + unsigned char nStopBits; + /** The parity setting to use during communication */ + enum UsbSerialParity parity; +}; +/** @} */ -- Gitee From 002b91b476d0e812971e598c23dfba943d135456 Mon Sep 17 00:00:00 2001 From: dairan Date: Thu, 6 Feb 2025 18:38:17 +0800 Subject: [PATCH 315/347] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=89=88=E6=9D=83?= =?UTF-8?q?=E5=A4=B4=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/serial/v1_0/BUILD.gn | 2 +- usb/serial/v1_0/ISerialInterface.idl | 2 +- usb/serial/v1_0/SerialTypes.idl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usb/serial/v1_0/BUILD.gn b/usb/serial/v1_0/BUILD.gn index 978305e9..521b7f48 100644 --- a/usb/serial/v1_0/BUILD.gn +++ b/usb/serial/v1_0/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/usb/serial/v1_0/ISerialInterface.idl b/usb/serial/v1_0/ISerialInterface.idl index c0113c03..de4dcd86 100644 --- a/usb/serial/v1_0/ISerialInterface.idl +++ b/usb/serial/v1_0/ISerialInterface.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/usb/serial/v1_0/SerialTypes.idl b/usb/serial/v1_0/SerialTypes.idl index 6f1397d6..72f7569e 100644 --- a/usb/serial/v1_0/SerialTypes.idl +++ b/usb/serial/v1_0/SerialTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 -- Gitee From 48286db5dc9b09f03e3a65265497cd49a24c2105 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Fri, 7 Feb 2025 17:21:10 +0800 Subject: [PATCH 316/347] =?UTF-8?q?interface=20display=20composer=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l60050612 --- .../include/display_vdi_adapter_interface.h | 3 +++ display/composer/v1_2/IDisplayComposer.idl | 15 ++++++++++++++- .../v1_2/hdi_impl/display_composer_hdi_impl.h | 8 +++++++- .../v1_2/include/idisplay_composer_interface.h | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index 4dbe6373..b37e3431 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -94,6 +94,7 @@ struct DisplayComposerVdiAdapter { const std::vector& inHandles); int32_t (*ClearDisplayClientBuffer)(uint32_t devId); int32_t (*ClearLayerBuffer)(uint32_t devId, uint32_t layerId); + int32_t (*GetDisplayIdentificationData)(uint32_t devId, uint8_t& portId, std::vector& edidData); }; using LoadVdiImplFunc = int32_t (*)(); @@ -159,6 +160,8 @@ using FastPresentFunc = int32_t (*)(uint32_t devId, const PresentParam& param, const std::vector& inHandles); using ClearDisplayClientBufferFunc = int32_t (*)(uint32_t devId); using ClearLayerBufferFunc = int32_t (*)(uint32_t devId, uint32_t layerId); +using GetDisplayIdentificationDataFunc = int32_t (*)(uint32_t devId, uint8_t& portId, std::vector& edidData); + } // namespace Composer } // namespace Display diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 23df9a95..73b26198 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -106,7 +106,7 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @return Returns 0 if the operation is successful; returns an error code defined * in {@link DispErrCode} otherwise. * @since 5.0 - * @version 1.2 + * @version 1.0 */ SetDisplayActiveRegion([in] unsigned int devId, [in] struct IRect rect); @@ -122,4 +122,17 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @version 1.0 */ FastPresent([in] unsigned int devId, [in] struct PresentParam param, [in] NativeBuffer[] inHandles); + + /** + * @brief the function to GetDisplayIdentificationData. + * + * @param devId Indicates which device, portId Indicates which port, + * edidData Indicates the edid value. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + GetDisplayIdentificationData([in] unsigned int devId, [out] unsigned char portId, [out] unsigned char[] edidData); } diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index cd1fa427..6ff9559b 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -179,7 +179,13 @@ public: { return ToDispErrCode(req_v1_2_->SetLayerPerFrameParameterSmq(devId, layerId, key, value)); } - + + virtual int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, std::vector& edidData) override + { + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); + return ToDispErrCode(hdi_v1_2_->GetDisplayIdentificationData(devId, portId, edidData)); + } + protected: using BaseType1_1 = V1_1::DisplayComposerHdiImpl; using BaseType1_1::WAIT_TIME_INTERVAL; diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 23aae31e..a57b9d26 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -77,6 +77,8 @@ public: virtual int32_t FastPresent(uint32_t devId, const PresentParam& param, const std::vector inHandles) = 0; + virtual int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, std::vector& edidData) = 0; + virtual int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value) = 0; }; -- Gitee From ed41c8636ffe1586ee574dd0c50f4fc1ae7c8117 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sat, 8 Feb 2025 02:21:58 +0000 Subject: [PATCH 317/347] update display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h. Signed-off-by: l60050612 --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 6ff9559b..c5a845cc 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -180,10 +180,11 @@ public: return ToDispErrCode(req_v1_2_->SetLayerPerFrameParameterSmq(devId, layerId, key, value)); } - virtual int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, std::vector& edidData) override + virtual int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, + std::vector& edidData) override { - COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); - return ToDispErrCode(hdi_v1_2_->GetDisplayIdentificationData(devId, portId, edidData)); + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); + return ToDispErrCode(hdi_v1_2_->GetDisplayIdentificationData(devId, portId, edidData)); } protected: -- Gitee From ae95400f1d08dafbc19bc7f54ccba0f06497aac1 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Thu, 26 Dec 2024 01:04:39 +0800 Subject: [PATCH 318/347] prerecord Signed-off-by: zhanglei Change-Id: Iacee1c1411272cf1291156b842355d76e4bba96d --- .../include/camera_device_ability_items.h | 33 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 6 ++++ camera/metadata/src/camera_metadata_info.cpp | 3 ++ 3 files changed, 42 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 469d33ed..253a130b 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1496,6 +1496,13 @@ typedef enum camera_device_metadata_tag { * @version 1.0 */ OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE, + /** + * ohos.ability.prerecord [static, int32[], public] + * + * camera device property, query camera support prerecord and duration + * (i.e. int32[] ...) + */ + OHOS_ABILITY_PRERECORD, /** * ohos.stream.abilityEnd * @@ -1512,6 +1519,20 @@ typedef enum camera_device_metadata_tag { * @version 1.0 */ OHOS_CONTROL_AUTO_VIDEO_FRAME_RATE = OHOS_STREAM_CONTROL_START, + /** + * ohos.control.prerecord.mode [static, enum, public] + * + * camera stream property, set current camera prerecord mode + * (i.e. enum: ON/OFF ...) + */ + OHOS_CONTROL_PRERECORD_MODE, + /** + * ohos.control.record.state [static, enum, public] + * + * camera stream property, set current camera record state + * (i.e. enum: PRERECORD_START/RECORD_START/RECORD_END ...) + */ + OHOS_CONTROL_RECORD_STATE, /** * ohos.stream.controlEnd * @@ -2840,4 +2861,16 @@ typedef enum camera_color_reservation_type { OHOS_CAMERA_COLOR_RESERVATION_PORTRAIT } camera_color_reservation_type_t; +// OHOS_CONTROL_PRERECORD_MODE +enum CameraPrerecordMode { + OHOS_CAMERA_PRERECORD_MODE_ON = 1, + OHOS_CAMERA_PRERECORD_MODE_OFF = 2, +}; + +// OHOS_CONTROL_RECORD_STATE +enum CameraRecordState { + OHOS_CAMERA_RECORD_STATE_PRERECORD_START = 1, + OHOS_CAMERA_RECORD_STATE_RECORD_START = 2, + OHOS_CAMERA_RECORD_STATE_RECORD_STOP = 3, +}; #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 9e789522..77a39ec9 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -371,11 +371,17 @@ static item_info_t g_ohosStreamAbility[OHOS_STREAM_ABILITY_END - OHOS_STREAM_ABI OHOS_STREAM_ABILITY_START] = {"deferredImageDeliveryMode", META_TYPE_BYTE, -1}, [OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE - OHOS_STREAM_ABILITY_START] = {"streamAutoFpsSupportedMode", META_TYPE_BYTE, -1}, + [OHOS_ABILITY_PRERECORD - + OHOS_STREAM_ABILITY_START] = {"prerecord", META_TYPE_INT32, -1}, }; static item_info_t g_ohosStreamControl[OHOS_STREAM_CONTROL_END - OHOS_STREAM_CONTROL_START] = { [OHOS_CONTROL_AUTO_VIDEO_FRAME_RATE - OHOS_STREAM_CONTROL_START] = {"streamAutoFpsControl", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_PRERECORD_MODE - + OHOS_STREAM_CONTROL_START] = {"prerecordMode", META_TYPE_BYTE, 1}, + [OHOS_CONTROL_RECORD_STATE - + OHOS_STREAM_CONTROL_START] = {"recordState", META_TYPE_BYTE, 1}, }; static item_info_t g_ohosStreamJpeg[OHOS_STREAM_JPEG_END - OHOS_STREAM_JPEG_START] = { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 2ba50ed7..121d9ad4 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -233,6 +233,9 @@ const std::vector g_metadataTags = { OHOS_ABILITY_SCENE_STREAM_QUICK_THUMBNAIL_AVAILABLE, OHOS_ABILITY_DEFERRED_IMAGE_DELIVERY, OHOS_CONTROL_DEFERRED_IMAGE_DELIVERY, + OHOS_ABILITY_PRERECORD, + OHOS_CONTROL_PRERECORD_MODE, + OHOS_CONTROL_RECORD_STATE, OHOS_JPEG_GPS_COORDINATES, OHOS_JPEG_GPS_PROCESSING_METHOD, -- Gitee From e9d750abbb4e63b985a99ee27bb794752ac6e964 Mon Sep 17 00:00:00 2001 From: zhangqiang_bk Date: Fri, 7 Feb 2025 16:05:20 +0800 Subject: [PATCH 319/347] update cs cnap Signed-off-by: zhangqiang_bk --- ril/bundle.json | 24 ++++++- ril/v1_4/BUILD.gn | 35 ++++++++++ ril/v1_4/IRil.idl | 72 ++++++++++++++++++++ ril/v1_4/IRilCallback.idl | 72 ++++++++++++++++++++ ril/v1_4/Types.idl | 139 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 341 insertions(+), 1 deletion(-) create mode 100644 ril/v1_4/BUILD.gn create mode 100644 ril/v1_4/IRil.idl create mode 100644 ril/v1_4/IRilCallback.idl create mode 100644 ril/v1_4/Types.idl diff --git a/ril/bundle.json b/ril/bundle.json index de1338fe..4b8fe43b 100644 --- a/ril/bundle.json +++ b/ril/bundle.json @@ -29,7 +29,8 @@ "sub_component": [ "//drivers/interface/ril/v1_1:ril_idl_target", "//drivers/interface/ril/v1_2:ril_idl_target", - "//drivers/interface/ril/v1_3:ril_idl_target" + "//drivers/interface/ril/v1_3:ril_idl_target", + "//drivers/interface/ril/v1_4:ril_idl_target" ], "test": [ ], @@ -96,6 +97,27 @@ "header_files": [], "header_base": "//drivers/interface/ril" } + }, + { + "name": "//drivers/interface/ril/v1_4:libril_proxy_1.4", + "header": { + "header_files": [], + "header_base": "//drivers/interface/ril" + } + }, + { + "name": "//drivers/interface/ril/v1_4:libril_stub_1.4", + "header": { + "header_files": [], + "header_base": "//drivers/interface/ril" + } + }, + { + "name": "//drivers/interface/ril/v1_4:ril_idl_headers_1.4", + "header": { + "header_files": [], + "header_base": "//drivers/interface/ril" + } } ] } diff --git a/ril/v1_4/BUILD.gn b/ril/v1_4/BUILD.gn new file mode 100644 index 00000000..055f6b39 --- /dev/null +++ b/ril/v1_4/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") +if (defined(ohos_lite)) { + group("libril_proxy_1.4") { + deps = [] + public_configs = [] + } +} else { + hdi("ril") { + branch_protector_ret = "pac_ret" + module_name = "ril_service" + proxy_deps = [ "../v1_3:libril_proxy_1.3" ] + stub_deps = [ "../v1_3:libril_stub_1.3" ] + sources = [ + "IRil.idl", + "IRilCallback.idl", + "Types.idl", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_ril" + } +} diff --git a/ril/v1_4/IRil.idl b/ril/v1_4/IRil.idl new file mode 100644 index 00000000..d20470ee --- /dev/null +++ b/ril/v1_4/IRil.idl @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2025 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 Ril + * @{ + * + * @brief Defines Ril-related APIs. + * + * The radio interface layer (RIL) module provides APIs and callbacks for upper-layer + * telephony services, including call, SMS, MMS, network search, and SIM card services. + * + * @since 5.1 + * @version 1.0 + */ + +/** + * @file IRil.idl + * + * @brief Declares the request API of the RIL module. + * + * @since 5.1 + * @version 1.0 + */ + +/** + * @brief Defines the path for the package of the RIL module APIs. + * + * @since 5.1 + * @version 1.0 + */ +package ohos.hdi.ril.v1_4; + +import ohos.hdi.ril.v1_4.IRilCallback; +import ohos.hdi.ril.v1_3.IRil; + +/** + * @brief Declares the request API of the RIL module. + * + * Request APIs are called to make calls, send SMS and MMS messages, activate SIM cards, + * and access the Internet. + * + * @since 5.1 + * @version 1.0 + */ +interface IRil extends ohos.hdi.ril.v1_3.IRil { + /** + * @brief Sets an IRil callback. + * + * @param rilCallback Callback to set. For details, see {@link IRilCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-0 value if the operation fails. + * + * @since 5.1 + * @version 1.0 + */ + [oneway] SetCallback1_4([in] IRilCallback rilCallback); +} +/** @} */ diff --git a/ril/v1_4/IRilCallback.idl b/ril/v1_4/IRilCallback.idl new file mode 100644 index 00000000..be2dc165 --- /dev/null +++ b/ril/v1_4/IRilCallback.idl @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2025 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 Ril + * @{ + * + * @brief Defines Ril-related APIs. + * + * The radio interface layer (RIL) module provides APIs and callbacks for upper-layer telephony services, + * including call, SMS, MMS, network search, and SIM card services. + * + * @since 5.1 + * @version 1.0 + */ + +/** + * @file IRilCallback.idl + * + * @brief Declares callback APIs of the RIL module. + * + * @since 5.1 + * @version 1.0 + */ + +/** + * @brief Defines the path for the package of the RIL module APIs. + * + * @since 5.1 + * @version 1.0 + */ +package ohos.hdi.ril.v1_4; + +import ohos.hdi.ril.v1_3.IRilCallback; +import ohos.hdi.ril.v1_4.Types; + +/** + * @brief Declares callback APIs of the RIL module. + * + * These APIs provide the callback functions for making calls, sending SMS and MMS messages, + * activating SIM cards, and accessing the Internet. The caller needs to implement these callbacks. + * + * @since 5.1 + * @version 1.0 + */ +[callback] interface IRilCallback extends ohos.hdi.ril.v1_3.IRilCallback { + /** + * @brief Callback for the response of querying the call status information list. + * + * @param responseInfo Common response information, such as the card slot ID and request sequence ID. + * For details, see {@link RilRadioResponseInfo}. + * @param callList Call status information list. For details, see {@link CallInfoExtList}. + * + * @since 5.1 + * @version 1.0 + */ + [oneway] GetCallListResponseExt([in] struct RilRadioResponseInfo responseInfo, + [in] struct CallInfoExtList callList); +} +/** @} */ \ No newline at end of file diff --git a/ril/v1_4/Types.idl b/ril/v1_4/Types.idl new file mode 100644 index 00000000..6b52bd79 --- /dev/null +++ b/ril/v1_4/Types.idl @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2025 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 Ril + * + * @brief Defines Ril-related APIs. + * + * The radio interface layer (RIL) module provides APIs and callbacks for upper-layer telephony services, + * including call, SMS, MMS, network search, and SIM card services. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.ril.v1_4; + +import ohos.hdi.ril.v1_1.Types; +import ohos.hdi.ril.v1_2.Types; +import ohos.hdi.ril.v1_3.Types; + +/** + * @brief Defines the call status information. + */ +struct CallInfoExt { + /** + * Call ID + */ + int index; + + /** + * Call direction. The value 0 indicates the calling party, and the value 1 indicates the called party. + */ + int dir; + + /** + * Call status: + *- 0: activated state + *- 1: call hold state + *- 2: calling party, dialing state + *- 3: calling party, ringback tone state + *- 4: called party, incoming call state + *- 5: called party, call waiting state + *- 6: disconnected state + *- 7: disconnecting state + *- 8: idle state + */ + int state; + + /** + * Call mode: + *- 0: voice call + *- 1: data call + *- 2: fax + */ + int mode; + + /** + * Multi-party call status: + *- 0: not a multi-party call + *- 1: a multi-party call + */ + int mpty; + + /** + * Call domain of the voice call: + *- 0: CS domain + *- 1: IP multimedia system (IMS) domain + */ + int voiceDomain; + + /** + * Call type. Currently, the value can only be 0, indicating a voice call. + */ + int callType; + + /** + * Code address type: + *-129: common number + *- 145: international number + */ + int type; + + /** + * Phone number + */ + String number; + + /** + * Name of a phone number in the phonebook + */ + String alpha; + + /** + * Indicates remote party name. + */ + String name; + + /** + * Identifies the CNAP display name; + * - 0:Allowed + * - 1:Restricted + * - 2:Not Specified/Unknown + * - 3:Payphone + */ + int namePresentation; +}; + +/** + * @brief Defines the call status information list. + */ +struct CallInfoExtList { + /** + * Total number + */ + int callSize; + + /** + * ID of the call status information list + */ + int flag; + + /** + * Call status information list + */ + List calls; +}; \ No newline at end of file -- Gitee From 40bd34823f03ec3784563b8cbbea299a121f49fd Mon Sep 17 00:00:00 2001 From: liuhu Date: Wed, 12 Feb 2025 12:42:45 +0800 Subject: [PATCH 320/347] =?UTF-8?q?HDI=E6=A8=A1=E6=9D=BF=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie32f81dc7deb69c0abe6302f52074d38e396b3e9 Signed-off-by: liuhu --- fingerprint_auth/bundle.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fingerprint_auth/bundle.json b/fingerprint_auth/bundle.json index aff42c45..4fc1165e 100644 --- a/fingerprint_auth/bundle.json +++ b/fingerprint_auth/bundle.json @@ -47,14 +47,6 @@ ], "header_base": "//drivers/interface/fingerprint_auth" } - }, - { - "name": "//drivers/interface/fingerprint_auth/v2_0:fingerprint_auth_idl_headers", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/fingerprint_auth" - } } ] } -- Gitee From 7b477f3d41437bc47e1a4ddba516d2299d8e864c Mon Sep 17 00:00:00 2001 From: chaimengtao Date: Wed, 12 Feb 2025 12:57:21 +0800 Subject: [PATCH 321/347] =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chaimengtao --- face_auth/bundle.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/face_auth/bundle.json b/face_auth/bundle.json index c6ef576d..8b373484 100644 --- a/face_auth/bundle.json +++ b/face_auth/bundle.json @@ -49,14 +49,6 @@ ], "header_base": "//drivers/interface/face_auth" } - }, - { - "name": "//drivers/interface/face_auth/v2_0:face_auth_idl_headers", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/face_auth" - } } ] } -- Gitee From 8cca49e54db2ed82b62ebda746c83ed7831835bd Mon Sep 17 00:00:00 2001 From: xyc Date: Wed, 12 Feb 2025 13:09:24 +0800 Subject: [PATCH 322/347] =?UTF-8?q?HDI=E6=A8=A1=E6=9D=BF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xyc Change-Id: I911305808d291db20f52fbcba95494ca11040682 --- pin_auth/bundle.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index bfb9cb4c..cb9fa89c 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -55,15 +55,6 @@ "header":{ "header_files":[ - ], - "header_base":"//drivers/interface/pin_auth" - } - }, - { - "name":"//drivers/interface/pin_auth/v2_1:pin_auth_idl_headers", - "header":{ - "header_files":[ - ], "header_base":"//drivers/interface/pin_auth" } -- Gitee From 402bbc0848545fff213c4763b7ac1960d460d655 Mon Sep 17 00:00:00 2001 From: zhjs Date: Wed, 12 Feb 2025 11:57:40 +0800 Subject: [PATCH 323/347] tone Signed-off-by: zhjs --- .../include/display_vdi_adapter_interface.h | 4 ++ display/composer/v1_2/DisplayComposerType.idl | 1 + .../display_command/display_cmd_requester.h | 55 ++++++++++++++++++ .../display_command/display_cmd_responser.h | 58 +++++++++++++++++++ .../v1_2/hdi_impl/display_composer_hdi_impl.h | 6 ++ .../include/idisplay_composer_interface.h | 3 + 6 files changed, 127 insertions(+) diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index 4dbe6373..9f7a393a 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -79,6 +79,8 @@ struct DisplayComposerVdiAdapter { int32_t (*GetDisplayVBlankPeriod)(uint32_t devId, uint64_t& period); int32_t (*SetLayerPerFrameParameter)( uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value); + int32_t (*SetDisplayPerFrameParameter)( + uint32_t devId, const std::string& key, const std::vector& value); int32_t (*GetSupportedLayerPerFrameParameterKey)(std::vector& keys); int32_t (*SetDisplayOverlayResolution)(uint32_t devId, uint32_t width, uint32_t height); int32_t (*RegRefreshCallback)(RefreshCallback cb, void* data); @@ -144,6 +146,8 @@ using SetDisplayModeAsyncFunc = int32_t (*)(uint32_t devId, uint32_t modeId, Mod using GetDisplayVBlankPeriodFunc = int32_t (*)(uint32_t devId, uint64_t& period); using SetLayerPerFrameParameterFunc = int32_t (*)( uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value); +using SetDisplayPerFrameParameterFunc = int32_t (*)( + uint32_t devId, const std::string& key, const std::vector& value); using GetSupportedLayerPerFrameParameterKeyFunc = int32_t (*)(std::vector& keys); using SetDisplayOverlayResolutionFunc = int32_t (*)(uint32_t devId, uint32_t width, uint32_t height); using RegRefreshCallbackFunc = int32_t (*)(RefreshCallback cb, void* data); diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index b32a3098..0115dc98 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -86,6 +86,7 @@ enum DispCmd : ohos.hdi.display.composer.v1_0.DispCmd { REQUEST_CMD_COMMIT_AND_GET_RELEASE_FENCE = 82, /**< Request cmd */ REQUEST_CMD_SET_DISPLAY_CONSTRAINT = 83, /**< LTPO cmd> */ REQUEST_CMD_SET_LAYER_PERFRAME_PARAM = 84, /**< SetLayer cmd> */ + REQUEST_CMD_SET_DISPLAY_PERFRAME_PARAM = 85, /**< SetDisplay cmd> */ REQUEST_CMD_BUTT_V1_2, REPLY_CMD_COMMIT_AND_GET_RELEASE_FENCE = 515, /**< Reply cmd */ REPLY_CMD_BUTT_V1_2, diff --git a/display/composer/v1_2/display_command/display_cmd_requester.h b/display/composer/v1_2/display_command/display_cmd_requester.h index b18185ce..0d6bb089 100644 --- a/display/composer/v1_2/display_command/display_cmd_requester.h +++ b/display/composer/v1_2/display_command/display_cmd_requester.h @@ -354,6 +354,61 @@ EXIT: return HDF_SUCCESS; } + int32_t SetDisplayPerFrameParameterSmq(uint32_t devId, const std::string& key, + const std::vector& value) + { + int32_t ret = 0; + bool retBool = false; + size_t writePos = requestPacker_.ValidSize(); + + do { + ret = CmdUtils::StartSection(REQUEST_CMD_SET_DISPLAY_PERFRAME_PARAM, requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: StartSection failed", __func__)); + + retBool = requestPacker_.WriteUint32(devId); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write devId failed", __func__)); + + uint32_t vectStrSize = key.size(); + retBool = requestPacker_.WriteUint32(vectStrSize); + if (vectStrSize > CmdUtils::MAX_MEMORY) { + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vectStr failed", __func__)); + } + for (uint32_t i = 0; i < vectStrSize; i++) { + retBool = requestPacker_.WriteInt32(static_cast(key[i])); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vectStr failed", __func__)); + } + + uint32_t vectSize = value.size(); + retBool = requestPacker_.WriteUint32(vectSize); + if (vectSize > CmdUtils::MAX_MEMORY) { + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vect failed", __func__)); + } + for (uint32_t i = 0; i < vectSize; i++) { + retBool = requestPacker_.WriteUint8(static_cast(value[i])); + DISPLAY_CHK_BREAK(retBool == false, + HDF_LOGE("%{public}s: write vect failed", __func__)); + } + + ret = CmdUtils::EndSection(requestPacker_); + DISPLAY_CHK_BREAK(ret != HDF_SUCCESS, + HDF_LOGE("%{public}s: EndSection failed", __func__)); + } while (0); + + if (retBool == false || ret != HDF_SUCCESS) { + requestPacker_.RollBack(writePos); + HDF_LOGE("SetDisplayPerFrameParameterSmq writePos_ rollback %{public}s, %{public}d", + key.c_str(), devId); + + return HDF_FAILURE; + } + return HDF_SUCCESS; + } + protected: sptr hdi_1_2_; private: 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 b4f91482..c9d51f1d 100644 --- a/display/composer/v1_2/display_command/display_cmd_responser.h +++ b/display/composer/v1_2/display_command/display_cmd_responser.h @@ -68,6 +68,8 @@ public: OnSetDisplayConstraint(unpacker); } else if (cmd == REQUEST_CMD_SET_LAYER_PERFRAME_PARAM) { OnSetLayerPerFrameParam(unpacker); + } else if (cmd == REQUEST_CMD_SET_DISPLAY_PERFRAME_PARAM) { + OnSetDisplayPerFrameParam(unpacker); } else { return V1_0::DisplayCmdResponser::ProcessRequestCmd(unpacker, cmd, inFds, outFds); } @@ -368,6 +370,62 @@ UNPACKER_EXIT: return ret; } + int32_t OnSetDisplayPerFrameParam(CommandDataUnpacker& unpacker) + { + DISPLAY_TRACE; + uint32_t devId = 0; + std::string key; + std::vector value; + uint32_t vectSize = 0; + uint32_t vectStrSize = 0; + + int32_t ret = unpacker.ReadUint32(devId) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + ret = unpacker.ReadUint32(vectStrSize) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + for (uint32_t i = 0; i < vectStrSize; i++) { + int32_t tmpChar; + ret = unpacker.ReadInt32(tmpChar) ? HDF_SUCCESS : HDF_FAILURE; + if (ret != HDF_SUCCESS) { + break; + } + key.push_back(static_cast(tmpChar)); + } + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + ret = unpacker.ReadUint32(vectSize) ? HDF_SUCCESS : HDF_FAILURE; + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + for (uint32_t i = 0; i < vectSize; i++) { + uint8_t tmpValue; + ret = unpacker.ReadUint8(tmpValue) ? HDF_SUCCESS : HDF_FAILURE; + if (ret != HDF_SUCCESS) { + break; + } + value.push_back(static_cast(tmpValue)); + } + DISPLAY_CHECK(ret != HDF_SUCCESS, goto UNPACKER_EXIT); + + HDF_LOGD("OnSetDisplayPerFrameParam %{public}s, %{public}d", + key.c_str(), devId); + + if (impl_ != nullptr && impl_->SetDisplayPerFrameParameter != nullptr) { + ret = impl_->SetDisplayPerFrameParameter(devId, key, value); + } + + if (ret != HDF_SUCCESS && ret != DISPLAY_NOT_SUPPORT && ret != HDF_ERR_NOT_SUPPORT) { + HDF_LOGE("OnSetDisplayPerFrameParam %{public}s, %{public}d, %{public}d", + key.c_str(), devId, ret); + } +UNPACKER_EXIT: + if (ret != HDF_SUCCESS) { + errMaps_.emplace(REQUEST_CMD_SET_DISPLAY_PERFRAME_PARAM, ret); + } + return ret; + } + private: using BaseType1_1 = V1_1::DisplayCmdResponser; using BaseType1_1::replyPacker_; diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index cd1fa427..b47e61c1 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -180,6 +180,12 @@ public: return ToDispErrCode(req_v1_2_->SetLayerPerFrameParameterSmq(devId, layerId, key, value)); } + virtual int32_t SetDisplayPerFrameParameterSmq(uint32_t devId, const std::string& key, + const std::vector& value) override + { + return ToDispErrCode(req_v1_2_->SetDisplayPerFrameParameterSmq(devId, key, value)); + } + protected: using BaseType1_1 = V1_1::DisplayComposerHdiImpl; using BaseType1_1::WAIT_TIME_INTERVAL; diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 23aae31e..aa9c46f9 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -79,6 +79,9 @@ public: virtual int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key, const std::vector& value) = 0; + + virtual int32_t SetDisplayPerFrameParameterSmq(uint32_t devId, const std::string& key, + const std::vector& value) = 0; }; } // V1_2 } // Composer -- Gitee From bf1b62322bf604a124b55a60f4d9e4c341c57ebb Mon Sep 17 00:00:00 2001 From: songhuan Date: Wed, 5 Feb 2025 17:40:10 +0800 Subject: [PATCH 324/347] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=9D=9E=E6=A0=87?= =?UTF-8?q?=E5=A4=96=E8=AE=BESCSI=E5=91=BD=E4=BB=A4=E5=AD=97=E5=8F=8A?= =?UTF-8?q?=E6=9E=84=E5=BB=BASCSI=20DDK=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: songhuan Change-Id: I35fcfe15d4fe64a270f1a93516ba2c704311fe58 --- usb/bundle.json | 14 + usb/scsi_ddk/v1_0/BUILD.gn | 28 ++ usb/scsi_ddk/v1_0/IScsiPeripheralDdk.idl | 192 ++++++++++++++ usb/scsi_ddk/v1_0/ScsiPeripheralDdkTypes.idl | 260 +++++++++++++++++++ 4 files changed, 494 insertions(+) create mode 100644 usb/scsi_ddk/v1_0/BUILD.gn create mode 100644 usb/scsi_ddk/v1_0/IScsiPeripheralDdk.idl create mode 100644 usb/scsi_ddk/v1_0/ScsiPeripheralDdkTypes.idl diff --git a/usb/bundle.json b/usb/bundle.json index 7ac12c09..fd793f7d 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -207,6 +207,20 @@ "header_files": [], "header_base": "//drivers/interface/usb/usb_serial_ddk" } + }, + { + "name": "//drivers/interface/usb/scsi_ddk/v1_0:libscsi_ddk_proxy_1.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/scsi_ddk" + } + }, + { + "name": "//drivers/interface/usb/scsi_ddk/v1_0:libscsi_ddk_stub_1.0", + "header": { + "header_files": [], + "header_base": "//drivers/interface/usb/scsi_ddk" + } } ] } diff --git a/usb/scsi_ddk/v1_0/BUILD.gn b/usb/scsi_ddk/v1_0/BUILD.gn new file mode 100644 index 00000000..7a8c304b --- /dev/null +++ b/usb/scsi_ddk/v1_0/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") + +hdi("scsi_ddk") { + module_name = "scsi_ddk" + + sources = [ + "IScsiPeripheralDdk.idl", + "ScsiPeripheralDdkTypes.idl", + ] + + language = "cpp" + mode = "ipc" + subsystem_name = "hdf" + part_name = "drivers_interface_usb" +} diff --git a/usb/scsi_ddk/v1_0/IScsiPeripheralDdk.idl b/usb/scsi_ddk/v1_0/IScsiPeripheralDdk.idl new file mode 100644 index 00000000..b96cc58a --- /dev/null +++ b/usb/scsi_ddk/v1_0/IScsiPeripheralDdk.idl @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2025 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 HdiScsiDdk + * @{ + * + * @brief Provides SCSI DDK APIs to open and close SCSI interfaces. + * @since 5.1 + * @version 1.0 + */ + +/* * + * @file IScsiPeripheralDdk.idl + * + * @brief Declares the SCSI DDK APIs used by the SCSI host to access SCSI devices. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.usb.scsi_ddk.v1_0; + +import ohos.hdi.usb.scsi_ddk.v1_0.ScsiPeripheralDdkTypes; + +/* * + * @brief Declares the SCSI DDK APIs used by the SCSI host to access SCSI devices. + */ +interface IScsiPeripheralDdk +{ + /* * + * @brief Initializes the DDK. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Init(); + + /* * + * @brief Releases the DDK. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Release(); + + /* * + * @brief Open SCSI device by deviceId. + * + * @param deviceId ID of the device to be operated. + * @param interfaceIndex Interface index, which corresponds to interface which supports USB Protocol UAS. + * @param dev Device handle. + * @param fd The file descriptor obtained for memory mapping. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Open([in] unsigned long deviceId, [in] unsigned char interfaceIndex, [out] struct ScsiPeripheralDevice dev, [out] FileDescriptor fd); + + /* * + * @brief Close SCSI device. + * + * @param dev Device handle. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Close([in] struct ScsiPeripheralDevice dev); + + /* * + * @brief Get the device capacity. + * + * @param dev Device handle. + * @param request ReadCapacity request information. + * @param capacityInfo The data of read capacity command. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + ReadCapacity10([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralReadCapacityRequest request, [out] struct ScsiPeripheralCapacityInfo capacityInfo, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Check if the logical unit is ready. + * + * @param dev Device handle. + * @param request Test unit ready request information. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + TestUnitReady([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralTestUnitReadyRequest request, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Get the information regarding the logical unit and SCSI target device. + * + * @param dev Device handle. + * @param request Inquiry request information. + * @param inquiryInfo The data of inquiry command. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Inquiry([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralInquiryRequest request, [out] struct ScsiPeripheralInquiryInfo inquiryInfo, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Get the sense data. + * + * @param dev Device handle. + * @param request RequestSense request information. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + RequestSense([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralRequestSenseRequest request, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Read from the specified logical block(s). + * + * @param dev Device handle. + * @param request The request parameters. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Read10([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralIORequest request, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Write data to the specified logical block(s). + * + * @param dev Device handle. + * @param request The request parameters. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Write10([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralIORequest request, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Verify the specified logical block(s) on the medium. + * + * @param dev Device handle. + * @param request The request parameters. + * @param request Verify request information. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + Verify10([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralVerifyRequest request, [out] struct ScsiPeripheralResponse response); + + /* * + * @brief Send SCSI command that specified by CDB. + * + * @param dev Device handle. + * @param request The request parameters. + * @param response The response parameters. + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.1 + * @version 1.0 + */ + SendRequestByCDB([in] struct ScsiPeripheralDevice dev, [in] struct ScsiPeripheralRequest request, [out] struct ScsiPeripheralResponse response); +} diff --git a/usb/scsi_ddk/v1_0/ScsiPeripheralDdkTypes.idl b/usb/scsi_ddk/v1_0/ScsiPeripheralDdkTypes.idl new file mode 100644 index 00000000..796056aa --- /dev/null +++ b/usb/scsi_ddk/v1_0/ScsiPeripheralDdkTypes.idl @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025 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 HdiScsiDdk + * @{ + * + * @brief Provides SCSI DDK types and declares the macros, enumerated variables, and\n + * data structures required by the SCSI DDK APIs. + * + * @since 5.1 + * @version 1.0 + */ + +/** + * @file ScsiPeripheralDdkTypes.idl + * + * @brief Provides the enumerated variables, structures, and macros used in SCSI DDK APIs. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.usb.scsi_ddk.v1_0; + +/** + * @brief Opaque SCSI device structure. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralDevice { + /** File descriptor for device. */ + int devFd; + /** File descriptor for mmap. */ + int memMapFd; + /** Logical block length in bytes. */ + unsigned int lbLength; +}; + +/** + * @brief Request parameters. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralRequest { + /** Command descriptor block. */ + unsigned char[] commandDescriptorBlock; + /** Data transfer direction. */ + int dataTransferDirection; + /** Buffer size. */ + unsigned int memMapSize; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; + +/** + * @brief Response parameters. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralResponse { + /** Sense data. */ + unsigned char[] senseData; + /** The status at completion of the call, such as good, busy, or timeout. */ + unsigned char status; + /** Shifted, masked scsi status. */ + unsigned char maskedStatus; + /** Messaging level data (optional). */ + unsigned char msgStatus; + /** Byte count actually written to sbp. */ + unsigned char sbLenWr; + /** Errors from host adapter. */ + unsigned short hostStatus; + /** Errors from software driver. */ + unsigned short driverStatus; + /** Dxfer_len - actual_transferred. */ + int resId; + /** Time taken by cmd (unit: millisec). */ + unsigned int duration; + /** byte length of actual transferred data. */ + int transferredLength; +}; + +/** + * @brief Request parameters for read/write. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralIORequest { + /** Starting with the logical block. */ + unsigned int lbAddress; + /** Number of contiguous logical blocks that shall be read. */ + unsigned short transferLength; + /** Control byte. */ + unsigned char control; + /** Byte 1 of the CDB. */ + unsigned char byte1; + /** Byte 6 of the CDB. */ + unsigned char byte6; + /** Buffer size. */ + unsigned int memMapSize; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; + +/** + * @brief SCSI test unit ready request. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralTestUnitReadyRequest { + /** Control byte. */ + unsigned char control; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; + +/** + * @brief SCSI inquiry request. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralInquiryRequest { + /** Page code. */ + unsigned char pageCode; + /** Allocation length. */ + unsigned short allocationLength; + /** Control byte. */ + unsigned char control; + /** Byte 1 of the CDB. */ + unsigned char byte1; + /** Buffer size. */ + unsigned int memMapSize; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; + +/** + * @brief SCSI inquiry data. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralInquiryInfo { + /** Peripheral device type. */ + unsigned char deviceType; + /** Vendor identification. */ + unsigned char[] idVendor; + /** Product identification. */ + unsigned char[] idProduct; + /** Product revision. */ + unsigned char[] revProduct; +}; + +/** + * @brief SCSI read capacity request. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralReadCapacityRequest { + /** Logical block address. */ + unsigned int lbAddress; + /** Control byte. */ + unsigned char control; + /** Byte 8 of the CDB. */ + unsigned char byte8; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; + +/** + * @brief SCSI read capacity data. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralCapacityInfo { + /** Returned logical block address. */ + unsigned int lbAddress; + /** Logical block length in bytes. */ + unsigned int lbLength; +}; + +/** + * @brief SCSI request sense request. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralRequestSenseRequest { + /** Allocation length. */ + unsigned char allocationLength; + /** Control byte. */ + unsigned char control; + /** Byte 1 of the CDB. */ + unsigned char byte1; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; + +/** + * @brief Basic sense data of Information、Command-specific information、Sense key specific. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralBasicSenseInfo { + /** Response code. */ + unsigned char responseCode; + /** Information valid bit. */ + boolean valid; + /** Information sense data descriptor. */ + unsigned long information; + /** Command-specific information sense data descriptor. */ + unsigned long commandSpecific; + /** Sense key specific valid bit. */ + boolean sksv; + /** Sense key specific sense data descriptor. */ + unsigned int senseKeySpecific; +}; + +/** + * @brief SCSI verify request. + * + * @since 5.1 + * @version 1.0 + */ +struct ScsiPeripheralVerifyRequest { + /** Starting with the logical block. */ + unsigned int lbAddress; + /** Number of contiguous logical blocks that shall be verify. */ + unsigned short verificationLength; + /** Control byte. */ + unsigned char control; + /** Byte 1 of the CDB. */ + unsigned char byte1; + /** Byte 6 of the CDB. */ + unsigned char byte6; + /** Timeout(unit: millisec). */ + unsigned int timeout; +}; -- Gitee From 487d5c08a63d03d9ef236b541aa735c9b1291781 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Wed, 12 Feb 2025 18:15:44 +0800 Subject: [PATCH 325/347] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=BA=91=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20uint32=5Ft=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanglei --- .../map_data/map_data_sequenceable.cpp | 21 +++++++++++++++++++ .../map_data/map_data_sequenceable.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/camera/sequenceable/map_data/map_data_sequenceable.cpp b/camera/sequenceable/map_data/map_data_sequenceable.cpp index ea1ee5c6..31cd7b67 100644 --- a/camera/sequenceable/map_data/map_data_sequenceable.cpp +++ b/camera/sequenceable/map_data/map_data_sequenceable.cpp @@ -73,6 +73,10 @@ sptr MapDataSequenceable::Unmarshalling(Parcel &parcel) ret = sequenceData->Set(key, type, parcel.ReadString()); break; } + case MapDataType::U32: { + ret = sequenceData->Set(key, type, parcel.ReadUint32()); + break; + } default: break; } @@ -122,6 +126,13 @@ bool MapDataSequenceable::Marshalling(Parcel &parcel) const dataParcel.WriteString(string); break; } + case MapDataType::U32: { + uint32_t u32 = 0; + auto pVal = std::any_cast(&data.val); + SET_DATA_FROM_POINTER(u32, pVal); + dataParcel.WriteUint32(u32); + break; + } default: break; } @@ -134,6 +145,11 @@ int32_t MapDataSequenceable::Get(const std::string &key, int32_t &value) const return Get(key, MapDataType::I32, value); } +int32_t MapDataSequenceable::Get(const std::string &key, uint32_t &value) const +{ + return Get(key, MapDataType::U32, value); +} + int32_t MapDataSequenceable::Get(const std::string &key, int64_t &value) const { return Get(key, MapDataType::I64, value); @@ -154,6 +170,11 @@ int32_t MapDataSequenceable::Set(const std::string &key, int32_t value) return Set(key, MapDataType::I32, value); } +int32_t MapDataSequenceable::Set(const std::string &key, uint32_t value) +{ + return Set(key, MapDataType::U32, value); +} + int32_t MapDataSequenceable::Set(const std::string &key, int64_t value) { return Set(key, MapDataType::I64, value); diff --git a/camera/sequenceable/map_data/map_data_sequenceable.h b/camera/sequenceable/map_data/map_data_sequenceable.h index 1f629678..2a4998a4 100644 --- a/camera/sequenceable/map_data/map_data_sequenceable.h +++ b/camera/sequenceable/map_data/map_data_sequenceable.h @@ -36,10 +36,12 @@ public: virtual ~MapDataSequenceable() = default; int32_t Get(const std::string &key, int32_t &value) const; + int32_t Get(const std::string &key, uint32_t &value) const; int32_t Get(const std::string &key, int64_t &value) const; int32_t Get(const std::string &key, double &value) const; int32_t Get(const std::string &key, std::string &value) const; int32_t Set(const std::string &key, int32_t value); + int32_t Set(const std::string &key, uint32_t value); int32_t Set(const std::string &key, int64_t value); int32_t Set(const std::string &key, double value); int32_t Set(const std::string &key, const std::string& value); @@ -54,6 +56,7 @@ private: I64, F64, STRING, + U32, }; template int32_t Get(const std::string &key, MapDataType type, T &value) const; -- Gitee From 9df37849d161aa7dea8761577b01e32b1baa950d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B0=B8=E9=A3=9E?= Date: Thu, 13 Feb 2025 11:12:51 +0800 Subject: [PATCH 326/347] =?UTF-8?q?HDI=E6=A8=A1=E6=9D=BF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李永飞 Change-Id: I4117f95e35e77150e4d90ccb43cdafcd45639979 --- user_auth/bundle.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/user_auth/bundle.json b/user_auth/bundle.json index 4855a810..e5e5038f 100644 --- a/user_auth/bundle.json +++ b/user_auth/bundle.json @@ -46,15 +46,6 @@ "header":{ "header_files":[ - ], - "header_base":"//drivers/interface/user_auth" - } - }, - { - "name":"//drivers/interface/user_auth/v3_0:user_auth_idl_headers", - "header":{ - "header_files":[ - ], "header_base":"//drivers/interfaces/user_auth" } -- Gitee From e23430c2c59285e9ece636dcde90f68126618eca Mon Sep 17 00:00:00 2001 From: wujh Date: Thu, 13 Feb 2025 11:38:36 +0000 Subject: [PATCH 327/347] update display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h. Signed-off-by: wujh --- display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 9f1800f6..2b0042e4 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -185,7 +185,6 @@ public: { return ToDispErrCode(req_v1_2_->SetDisplayPerFrameParameterSmq(devId, key, value)); } - virtual int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, std::vector& edidData) override -- Gitee From 3813c5b1a2c867591d849c21468bae5ac15c18a5 Mon Sep 17 00:00:00 2001 From: dairan Date: Sun, 16 Feb 2025 21:34:02 +0800 Subject: [PATCH 328/347] =?UTF-8?q?=E4=BF=AE=E6=AD=A3bundle.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/bundle.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usb/bundle.json b/usb/bundle.json index 9ff5a6e1..8cedf99e 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -242,9 +242,9 @@ "header": { "header_files": [], "header_base": "//drivers/interface/usb/serial" - }, + } } ] } } -} \ No newline at end of file +} -- Gitee From 2f97a14def1aea229575bb2025c527fbc72b4f75 Mon Sep 17 00:00:00 2001 From: dairan Date: Sun, 16 Feb 2025 21:41:43 +0800 Subject: [PATCH 329/347] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=BD=A2=E5=8F=82=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/serial/v1_0/ISerialInterface.idl | 314 +++++++++++++-------------- 1 file changed, 157 insertions(+), 157 deletions(-) diff --git a/usb/serial/v1_0/ISerialInterface.idl b/usb/serial/v1_0/ISerialInterface.idl index de4dcd86..f312b60f 100644 --- a/usb/serial/v1_0/ISerialInterface.idl +++ b/usb/serial/v1_0/ISerialInterface.idl @@ -1,157 +1,157 @@ -/* - * Copyright (c) 2025 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 HdiSerial - * - * - * @brief Provides unified APIs for serial services to access serial drivers. - * - * A serial service can obtain a serial driver object or agent and then call APIs provided by this object or agent to - * access different types of serial devices based on the serial IDs, thereby obtaining serial information, - * subscribing to or unsubscribing from serial data, enabling or disabling a serial, - * setting the serial data reporting mode, and setting serial options such as the accuracy and measurement range. - * - * @since 5.1 - */ - -/* * - * @file ISerialInterface.idl - * - * @brief Declares the APIs provided by the serial module for obtaining serial information, subscribing to or - * unsubscribing from serial data, enabling or disabling a serial, setting the serial data reporting mode, - * and setting serial options such as the accuracy and measurement range. - * - * @since 5.1 - * @version 1.0 - */ - -package ohos.hdi.usb.serial.v1_0; -import ohos.hdi.usb.serial.v1_0.SerialTypes; - -/* * - * @brief Defines the functions for performing basic operations on serial. - * - * The operations include obtaining serial port list information, opening and closing serial port, - * reading or writing serial port data, and setting or obtaining serial port properties. - */ -interface ISerialInterface { - - /** - * @brief Open and configure the serial port. - * - * Initializes and opens a serial communication port and sets communication parameters such as baud rate and parity. - * - * @param portId Indicates the Serial port device portId. - * - * @return Returns 0 if the setting is successful; returns a negative number otherwise. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialOpen([in]int portId); - - /** - * @brief Close the serial port and release resources. - * - * Terminate the connection to the serial port, ensuring that the port and associated resources are released - * after all data transfers are complete. - * - * @param portId Indicates the Serial port device portId. - * - * @return Returns 0 if the setting is successful; returns a negative number otherwise. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialClose([in]int portId); - - /** - * @brief Read data from the serial port. - * - * @param portId Indicates the Serial port device portId - * @param data Indicates the pointer to the buffer for receiving the data. - * - * @return Returns the size of the data that is successfully read; returns a negative number if the reading fails. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialRead([in] int portId, [out] unsigned char []data, [in] unsigned int size); - - /** - * @brief Read data from the serial port. - * - * @param portId Indicates the Serial port device portId - * @param data Indicates the pointer to the data to write. - * - * @return Returns the size of the data that is successfully write; returns a negative number if the reading fails. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialWrite([in] int portId, [in] unsigned char []data, [in] unsigned int size); - - /** - * @brief Sets the SERIAL attribute. - * - * SERIAL attributes include data bits, stop bits, parity bit, CTS, RTS, and receiving and transmitting FIFO. - * - * @param portId Indicates the Serial port device portId - * @param attribute Indicates the pointer to the SERIAL attribute to set. - * - * @return Returns 0 if the setting is successful; returns a negative number otherwise. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialSetAttribute([in] int portId, [in] struct SerialAttribute attribute); - - /** - * @brief Obtains the SERIAL attribute. - * - * SERIAL attributes include data bits, stop bits, parity bit, CTS, RTS, and receiving and transmitting FIFO. - * - * @param portId Indicates the Serial port device portId - * @param attribute Indicates the pointer to the obtained SERIAL attribute. - * - * @return Returns 0 if the setting is successful; returns a negative number otherwise. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialGetAttribute([in] int portId, [out] struct SerialAttribute attribute); - - /** - * @brief Obtains the SERIAL Port list. - * - * @param portId Indicates the Serial port device portId - * - * @return Returns 0 if the setting is successful; returns a negative number otherwise. - * - * @since 5.1 - * - * @version 1.0 - */ - SerialGetPortList([out] struct SerialPort[] portList); -} - - +/* + * Copyright (c) 2025 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 HdiSerial + * + * + * @brief Provides unified APIs for serial services to access serial drivers. + * + * A serial service can obtain a serial driver object or agent and then call APIs provided by this object or agent to + * access different types of serial devices based on the serial IDs, thereby obtaining serial information, + * subscribing to or unsubscribing from serial data, enabling or disabling a serial, + * setting the serial data reporting mode, and setting serial options such as the accuracy and measurement range. + * + * @since 5.1 + */ + +/* * + * @file ISerialInterface.idl + * + * @brief Declares the APIs provided by the serial module for obtaining serial information, subscribing to or + * unsubscribing from serial data, enabling or disabling a serial, setting the serial data reporting mode, + * and setting serial options such as the accuracy and measurement range. + * + * @since 5.1 + * @version 1.0 + */ + +package ohos.hdi.usb.serial.v1_0; +import ohos.hdi.usb.serial.v1_0.SerialTypes; + +/* * + * @brief Defines the functions for performing basic operations on serial. + * + * The operations include obtaining serial port list information, opening and closing serial port, + * reading or writing serial port data, and setting or obtaining serial port properties. + */ +interface ISerialInterface { + + /** + * @brief Open and configure the serial port. + * + * Initializes and opens a serial communication port and sets communication parameters such as baud rate and parity. + * + * @param portId Indicates the Serial port device portId. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialOpen([in]int portId); + + /** + * @brief Close the serial port and release resources. + * + * Terminate the connection to the serial port, ensuring that the port and associated resources are released + * after all data transfers are complete. + * + * @param portId Indicates the Serial port device portId. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialClose([in]int portId); + + /** + * @brief Read data from the serial port. + * + * @param portId Indicates the Serial port device portId + * @param data Indicates the pointer to the buffer for receiving the data. + * + * @return Returns the size of the data that is successfully read; returns a negative number if the reading fails. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialRead([in] int portId, [out] unsigned char []data, [in] unsigned int size, [in] unsigned int timeout); + + /** + * @brief Read data from the serial port. + * + * @param portId Indicates the Serial port device portId + * @param data Indicates the pointer to the data to write. + * + * @return Returns the size of the data that is successfully write; returns a negative number if the reading fails. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialWrite([in] int portId, [in] unsigned char []data, [in] unsigned int size, [in] unsigned int timeout); + + /** + * @brief Sets the SERIAL attribute. + * + * SERIAL attributes include data bits, stop bits, parity bit, CTS, RTS, and receiving and transmitting FIFO. + * + * @param portId Indicates the Serial port device portId + * @param attribute Indicates the pointer to the SERIAL attribute to set. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialSetAttribute([in] int portId, [in] struct SerialAttribute attribute); + + /** + * @brief Obtains the SERIAL attribute. + * + * SERIAL attributes include data bits, stop bits, parity bit, CTS, RTS, and receiving and transmitting FIFO. + * + * @param portId Indicates the Serial port device portId + * @param attribute Indicates the pointer to the obtained SERIAL attribute. + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialGetAttribute([in] int portId, [out] struct SerialAttribute attribute); + + /** + * @brief Obtains the SERIAL Port list. + * + * @param portId Indicates the Serial port device portId + * + * @return Returns 0 if the setting is successful; returns a negative number otherwise. + * + * @since 5.1 + * + * @version 1.0 + */ + SerialGetPortList([out] struct SerialPort[] portList); +} + + -- Gitee From 67f288bda9dc88adc789ee6d480dca96fe1e01c0 Mon Sep 17 00:00:00 2001 From: fanzhe Date: Mon, 17 Feb 2025 16:15:14 +0800 Subject: [PATCH 330/347] =?UTF-8?q?=E5=88=A0=E9=99=A4usb=20serial=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fanzhe Change-Id: I78b944749579936ddc8aa1438cb344221f35fccd --- usb/bundle.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/usb/bundle.json b/usb/bundle.json index fd793f7d..eed92a1b 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -201,13 +201,6 @@ "header_base": "//drivers/interface/usb/usb_serial_ddk" } }, - { - "name": "//drivers/interface/usb/usb_serial_ddk/v1_0:usb_serial_ddk_idl_headers", - "header": { - "header_files": [], - "header_base": "//drivers/interface/usb/usb_serial_ddk" - } - }, { "name": "//drivers/interface/usb/scsi_ddk/v1_0:libscsi_ddk_proxy_1.0", "header": { -- Gitee From ddb358941c96545b3fc8637a396654dca0c88546 Mon Sep 17 00:00:00 2001 From: dairan Date: Tue, 18 Feb 2025 17:13:55 +0800 Subject: [PATCH 331/347] =?UTF-8?q?idl=5Fheader=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- usb/bundle.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/usb/bundle.json b/usb/bundle.json index 8cedf99e..5c63a965 100644 --- a/usb/bundle.json +++ b/usb/bundle.json @@ -236,13 +236,6 @@ "header_files": [], "header_base": "//drivers/interface/usb/serial" } - }, - { - "name": "//drivers/interface/usb/serial/v1_0:serial_idl_headers", - "header": { - "header_files": [], - "header_base": "//drivers/interface/usb/serial" - } } ] } -- Gitee From f80f7442ad5bdae51867ccfe38521a03e53fa0c1 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Thu, 20 Feb 2025 01:27:24 +0000 Subject: [PATCH 332/347] add hdi interface for offlinephoto Signed-off-by: kerongfeng --- .../metadata/include/camera_device_ability_items.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 253a130b..4be7c98c 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1496,6 +1496,20 @@ typedef enum camera_device_metadata_tag { * @version 1.0 */ OHOS_ABILITY_AUTO_VIDEO_FRAME_RATE, + /* + * ohos.ability.changeToOfflineStreamOpeator [static, byte[], public] + * + * camera stream property, get camera support offline stream + * (i.e. byte[] ...) + */ + OHOS_ABILITY_CHANGETO_OFFLINE_STREAM_OPEATOR, + /** + * ohos.control.changeToOfflineStreamOpeator [static, byte[], public] + * + * camera stream property, set camera support offline stream + * (i.e. byte[] ...) + */ + OHOS_CONTROL_CHANGETO_OFFLINE_STREAM_OPEATOR, /** * ohos.ability.prerecord [static, int32[], public] * -- Gitee From e0584023596363daf8ef5a89188dc2df45104c26 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Thu, 20 Feb 2025 01:27:30 +0000 Subject: [PATCH 333/347] add hdi interface for offlinephoto Signed-off-by: kerongfeng --- camera/metadata/src/camera_metadata_info.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 121d9ad4..2a741d9c 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -236,6 +236,8 @@ const std::vector g_metadataTags = { OHOS_ABILITY_PRERECORD, OHOS_CONTROL_PRERECORD_MODE, OHOS_CONTROL_RECORD_STATE, + OHOS_ABILITY_CHANGETO_OFFLINE_STREAM_OPEATOR, + OHOS_CONTROL_CHANGETO_OFFLINE_STREAM_OPEATOR, OHOS_JPEG_GPS_COORDINATES, OHOS_JPEG_GPS_PROCESSING_METHOD, -- Gitee From 6a3e9ff39148e070080634b648b44acdb4d5bdc0 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Thu, 20 Feb 2025 01:27:35 +0000 Subject: [PATCH 334/347] add hdi interface for offlinephoto Signed-off-by: kerongfeng --- camera/metadata/include/camera_metadata_item_info.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 77a39ec9..6a3b1d08 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -373,6 +373,10 @@ static item_info_t g_ohosStreamAbility[OHOS_STREAM_ABILITY_END - OHOS_STREAM_ABI OHOS_STREAM_ABILITY_START] = {"streamAutoFpsSupportedMode", META_TYPE_BYTE, -1}, [OHOS_ABILITY_PRERECORD - OHOS_STREAM_ABILITY_START] = {"prerecord", META_TYPE_INT32, -1}, + [OHOS_ABILITY_CHANGETO_OFFLINE_STREAM_OPEATOR - + OHOS_STREAM_ABILITY_START] = {"offlineSupportedValue", META_TYPE_BYTE, -1}, + [OHOS_CONTROL_CHANGETO_OFFLINE_STREAM_OPEATOR - + OHOS_STREAM_ABILITY_START] = {"offlineControlValue", META_TYPE_BYTE, -1}, }; static item_info_t g_ohosStreamControl[OHOS_STREAM_CONTROL_END - OHOS_STREAM_CONTROL_START] = { -- Gitee From c2c8302fec4db2cfe348c32205f8df3c57a1e9f7 Mon Sep 17 00:00:00 2001 From: xyc Date: Thu, 20 Feb 2025 09:53:31 +0800 Subject: [PATCH 335/347] revert remove idl_headers Signed-off-by: xyc Change-Id: Icebbd0bfc3141e74ad08c4de74dd353730ef7173 --- face_auth/bundle.json | 8 ++++++++ fingerprint_auth/bundle.json | 8 ++++++++ pin_auth/bundle.json | 9 +++++++++ user_auth/bundle.json | 9 +++++++++ 4 files changed, 34 insertions(+) diff --git a/face_auth/bundle.json b/face_auth/bundle.json index 8b373484..c6ef576d 100644 --- a/face_auth/bundle.json +++ b/face_auth/bundle.json @@ -49,6 +49,14 @@ ], "header_base": "//drivers/interface/face_auth" } + }, + { + "name": "//drivers/interface/face_auth/v2_0:face_auth_idl_headers", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/face_auth" + } } ] } diff --git a/fingerprint_auth/bundle.json b/fingerprint_auth/bundle.json index 4fc1165e..aff42c45 100644 --- a/fingerprint_auth/bundle.json +++ b/fingerprint_auth/bundle.json @@ -47,6 +47,14 @@ ], "header_base": "//drivers/interface/fingerprint_auth" } + }, + { + "name": "//drivers/interface/fingerprint_auth/v2_0:fingerprint_auth_idl_headers", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/fingerprint_auth" + } } ] } diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index cb9fa89c..bfb9cb4c 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -55,6 +55,15 @@ "header":{ "header_files":[ + ], + "header_base":"//drivers/interface/pin_auth" + } + }, + { + "name":"//drivers/interface/pin_auth/v2_1:pin_auth_idl_headers", + "header":{ + "header_files":[ + ], "header_base":"//drivers/interface/pin_auth" } diff --git a/user_auth/bundle.json b/user_auth/bundle.json index e5e5038f..9f7fc68a 100644 --- a/user_auth/bundle.json +++ b/user_auth/bundle.json @@ -50,6 +50,15 @@ "header_base":"//drivers/interfaces/user_auth" } }, + { + "name":"//drivers/interface/user_auth/v3_0:user_auth_idl_headers", + "header":{ + "header_files":[ + + ], + "header_base":"//drivers/interfaces/user_auth" + } + }, { "name":"//drivers/interface/user_auth/v3_0:libuser_auth_stub_3.0", "header":{ -- Gitee From 7c4c71f4668d849ef2eb751509579fb58eb0a23a Mon Sep 17 00:00:00 2001 From: liangqi Date: Thu, 20 Feb 2025 17:21:46 +0800 Subject: [PATCH 336/347] =?UTF-8?q?hdi=E7=BC=96=E8=AF=91=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liangqi --- usb/v1_1/BUILD.gn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usb/v1_1/BUILD.gn b/usb/v1_1/BUILD.gn index e7c65b8f..346d59b7 100644 --- a/usb/v1_1/BUILD.gn +++ b/usb/v1_1/BUILD.gn @@ -27,6 +27,10 @@ if (defined(ohos_lite)) { "UsbTypes.idl", ] + proxy_deps = [ "../v1_0:libusb_proxy_1.0" ] + + stub_deps = [ "../v1_0:libusb_stub_1.0" ] + language = "cpp" subsystem_name = "hdf" part_name = "drivers_interface_usb" -- Gitee From c7ff3486cd502490d40400f16d16051591dca703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=94=BF?= Date: Thu, 20 Feb 2025 20:00:57 +0800 Subject: [PATCH 337/347] xxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李政 --- .../include/camera_device_ability_items.h | 36 +++++++++++++++++++ .../include/camera_metadata_item_info.h | 6 ++++ camera/metadata/src/camera_metadata_info.cpp | 3 ++ 3 files changed, 45 insertions(+) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 253a130b..0f8bc730 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -469,6 +469,36 @@ typedef enum camera_device_metadata_tag { * (i.e. byte ...) */ OHOS_STATUS_SUN_BLOCK_HINT, + /** + * ohos.ability.cameraLimitedCapabilityes [static, double[], public] + * + * Camera capability set for limited concurrent scenarios. + * This item contains other capability items for device capability control, + * such as OHOS_ABILITY_FLASH_MODES or other 3A capabilities. + * Resolution is reported through OHOS_ABLE_AVAILABLE_PROFILE_LEVEL. + * (i.e. OHOS_ABILITY_FLASH_MODES, length, flashMode, flashMode, ...) + * @since 5.1 + * @version 1.0 + */ + OHOS_ABILITY_CAMERA_LIMITED_CAPABILITIES, + /** + * ohos.ability.cameraConcurrentType [static, byte, public] + * + * Indicates whether the current camera is in full concurrency mode or limited concurrency mode. + * (i.e. byte) + * @since 5.1 + * @version 1.0 + */ + OHOS_ABILITY_CAMERA_CONCURRENT_TYPE, + /** + * ohos.ability.cameraConcurrentType [static, int32, public] + * + * Concurrent camera combinations are supported. The camera combinations are separated by - 1. + * (i.e. int32[] [2, 3, -1, 1, 2]) + * @since 5.1 + * @version 1.0 + */ + OHOS_ABILITY_CONCURRENT_SUPPORTED_CAMERAS, /** * ohos.ability.autoAigcPhoto [static, int32[], public] * @@ -2873,4 +2903,10 @@ enum CameraRecordState { OHOS_CAMERA_RECORD_STATE_RECORD_START = 2, OHOS_CAMERA_RECORD_STATE_RECORD_STOP = 3, }; + +// OHOS_ABILITY_CAMERA_CONCURRENT_TYPE +enum CameraConcurrentType { + OHOS_CAMERA_COCURRENT_FULL = 0, + OHOS_CAMERA_COCURRENT_LIIMITED, +}; #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 77a39ec9..9105105a 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -154,6 +154,12 @@ static item_info_t g_ohosCameraProperties[OHOS_CAMERA_PROPERTIES_END - OHOS_CAME OHOS_CAMERA_PROPERTIES_START] = {"autoAigcPhoto", META_TYPE_INT32, -1}, [OHOS_CONTROL_AUTO_AIGC_PHOTO - OHOS_CAMERA_PROPERTIES_START] = {"controlAutoAigcPhoto", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CAMERA_LIMITED_CAPABILITIES - + OHOS_CAMERA_PROPERTIES_START] = {"cameraLimitedCapability", META_TYPE_DOUBLE, -1}, + [OHOS_ABILITY_CAMERA_CONCURRENT_TYPE - + OHOS_CAMERA_PROPERTIES_START] = {"cameraConcurrentType", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_CONCURRENT_SUPPORTED_CAMERAS - + OHOS_CAMERA_PROPERTIES_START] = {"cameraConcurrentSupportedCameras", META_TYPE_INT32, 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 121d9ad4..7804894a 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -88,6 +88,9 @@ const std::vector g_metadataTags = { OHOS_STATUS_SUN_BLOCK_HINT, OHOS_ABILITY_AUTO_AIGC_PHOTO, OHOS_CONTROL_AUTO_AIGC_PHOTO, + OHOS_ABILITY_CAMERA_LIMITED_CAPABILITIES, + OHOS_ABILITY_CAMERA_CONCURRENT_TYPE, + OHOS_ABILITY_CONCURRENT_SUPPORTED_CAMERAS, OHOS_SENSOR_EXPOSURE_TIME, OHOS_SENSOR_COLOR_CORRECTION_GAINS, -- Gitee From 7432a0927e5ec6be274e891197b3c7a9ffcfa55e Mon Sep 17 00:00:00 2001 From: xyc Date: Fri, 21 Feb 2025 16:06:47 +0800 Subject: [PATCH 338/347] fix wrong path Signed-off-by: xyc Change-Id: I2c8efe7dff23c09a23a99eaa5e277f871a869fe7 --- user_auth/bundle.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_auth/bundle.json b/user_auth/bundle.json index 9f7fc68a..be388763 100644 --- a/user_auth/bundle.json +++ b/user_auth/bundle.json @@ -47,7 +47,7 @@ "header_files":[ ], - "header_base":"//drivers/interfaces/user_auth" + "header_base":"//drivers/interface/user_auth" } }, { @@ -56,7 +56,7 @@ "header_files":[ ], - "header_base":"//drivers/interfaces/user_auth" + "header_base":"//drivers/interface/user_auth" } }, { -- Gitee From 5b8813eb508a4220b39ef9eb2f3f6e7c8c92e192 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sat, 22 Feb 2025 14:04:55 +0800 Subject: [PATCH 339/347] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E9=9C=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 d039ed04..7331b6a5 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -887,7 +887,8 @@ EXIT: "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", data.buffer == nullptr ? "data.buffer is nullptr!" : "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); - } + cacheMgr_.Dump(); + } HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); -- Gitee From f11556ed780b488d53ebda289176064e61c2762a Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sat, 22 Feb 2025 06:24:15 +0000 Subject: [PATCH 340/347] 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 7331b6a5..d0e4831f 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -887,8 +887,8 @@ EXIT: "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", data.buffer == nullptr ? "data.buffer is nullptr!" : "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); - cacheMgr_.Dump(); - } + cacheMgr_.Dump(); + } HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; int rc = impl_->SetLayerBuffer(data.devId, data.layerId, handle, fd); -- Gitee From fcda5270e4536e46b7e9f31114d103b9d00a79ff Mon Sep 17 00:00:00 2001 From: zhjs Date: Sat, 22 Feb 2025 14:30:12 +0800 Subject: [PATCH 341/347] adaptive fov Signed-off-by: zhjs --- display/graphic/common/v2_1/BUILD.gn | 5 ++- .../common/v2_1/BufferHandleMetaKeyType.idl | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 display/graphic/common/v2_1/BufferHandleMetaKeyType.idl diff --git a/display/graphic/common/v2_1/BUILD.gn b/display/graphic/common/v2_1/BUILD.gn index 3dc0b995..8a6bb051 100644 --- a/display/graphic/common/v2_1/BUILD.gn +++ b/display/graphic/common/v2_1/BUILD.gn @@ -21,7 +21,10 @@ hdi("display_commontype") { "//drivers/interface/display/graphic/common/v2_0:libdisplay_commontype_stub_2.0", ] - sources = [ "CMColorSpace.idl" ] + sources = [ + "BufferHandleMetaKeyType.idl", + "CMColorSpace.idl", + ] language = "cpp" subsystem_name = "hdf" diff --git a/display/graphic/common/v2_1/BufferHandleMetaKeyType.idl b/display/graphic/common/v2_1/BufferHandleMetaKeyType.idl new file mode 100644 index 00000000..0d810c02 --- /dev/null +++ b/display/graphic/common/v2_1/BufferHandleMetaKeyType.idl @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 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 HdiDisplay + * + * @since 5.1 + * @version 2.1 + */ + +package ohos.hdi.display.graphic.common.v2_1; +import ohos.hdi.display.graphic.common.v2_0.BufferHandleMetaKeyType; + +/** + * @ brief Enumerates buffer handle attribution keys. + * + */ +enum BufferHandleAttrKey : ohos.hdi.display.graphic.common.v2_0.BufferHandleAttrKey { + ATTRKEY_VIDEO_TV_PQ = 2049, // value: TvPQMetadata + ATTRKEY_ADAPTIVE_FOV_METADATA = 2050, // value: byte stream of look up table +}; \ No newline at end of file -- Gitee From 552e99578f10c0373b4a9f984857c2fa3c8e1559 Mon Sep 17 00:00:00 2001 From: l60050612 Date: Sat, 22 Feb 2025 06:54:28 +0000 Subject: [PATCH 342/347] 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 d0e4831f..bf387c2f 100755 --- a/display/composer/v1_0/display_command/display_cmd_responser.h +++ b/display/composer/v1_0/display_command/display_cmd_responser.h @@ -887,7 +887,7 @@ EXIT: "data.buffer->fd:%{public}d, data.seqNo:%{public}d handle.fd:%{public}d, fd:%{public}d", data.buffer == nullptr ? "data.buffer is nullptr!" : "", data.devId, data.layerId, data.buffer == nullptr ? -1 : data.buffer->fd, data.seqNo, handle.fd, fd); - cacheMgr_.Dump(); + cacheMgr_->Dump(); } HdfTrace traceVdi("SetLayerBuffer", traceMsg); needMoveFd = true; -- Gitee From d8f7f587d0fb0560cdb945ccef987f79de07662b Mon Sep 17 00:00:00 2001 From: cjj Date: Tue, 25 Feb 2025 10:27:24 +0800 Subject: [PATCH 343/347] fix check_code Signed-off-by: cjj --- .../include/camera_device_ability_items.h | 15 +++++++++------ .../metadata/include/camera_metadata_item_info.h | 1 + camera/metadata/src/camera_metadata_info.cpp | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 5b312008..9efedca7 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1450,12 +1450,15 @@ typedef enum camera_device_metadata_tag { * camera device property, set current camera support camera zoom performance * (i.e. byte ...) */ - OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE, - /** - * ohos.device.zoomEnd - * - * camera device zoomEnd - */ + OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE, + /** + * ohos.control.zoomBezierCurvePoint [static, byte, public] + * + * camera device property, set current camera support camera BEZIER_CURVC_POINT + * (i.e. byte ...) + */ + OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT, + /** OHOS_DEVICE_ZOOM_END, // Camera flow control related diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 29cd41cf..b37bc232 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -355,6 +355,7 @@ static item_info_t g_ohosDeviceZoom[OHOS_DEVICE_ZOOM_END - OHOS_DEVICE_ZOOM_STAR [OHOS_CONTROL_SMOOTH_ZOOM_RATIOS - OHOS_DEVICE_ZOOM_START] = {"controlZoomRatios", META_TYPE_UINT32, -1}, [OHOS_CONTROL_PREPARE_ZOOM - OHOS_DEVICE_ZOOM_START] = {"controlPreZoom", META_TYPE_BYTE, 1}, [OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE - OHOS_DEVICE_ZOOM_START] = {"zoomPerformance", META_TYPE_UINT32, -1}, + [OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT - OHOS_DEVICE_ZOOM_START] = {"zoomBezierCurvePoint", META_TYPE_FLOAT, -1}, }; diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 4dfb096b..f9417628 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -226,6 +226,7 @@ const std::vector g_metadataTags = { OHOS_CONTROL_SMOOTH_ZOOM_RATIOS, OHOS_CONTROL_PREPARE_ZOOM, OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE, + OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT, // Camera flow control related OHOS_ABILITY_STREAM_AVAILABLE_BASIC_CONFIGURATIONS, -- Gitee From 3fdc8cd3d8fe189bfad7f255b0218eeb39ea4b02 Mon Sep 17 00:00:00 2001 From: cjj Date: Tue, 25 Feb 2025 03:32:01 +0000 Subject: [PATCH 344/347] update camera/metadata/include/camera_device_ability_items.h. Signed-off-by: cjj --- camera/metadata/include/camera_device_ability_items.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 9efedca7..34b94dd7 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1459,7 +1459,11 @@ typedef enum camera_device_metadata_tag { */ OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT, /** - OHOS_DEVICE_ZOOM_END, + * ohos.device.zoomEnd + * + * camera device zoomEnd + */ + OHOS_DEVICE_ZOOM_END, // Camera flow control related /** -- Gitee From 24f34ed365332a6cd26b64629ea065080903a5c0 Mon Sep 17 00:00:00 2001 From: cjj Date: Tue, 25 Feb 2025 03:33:39 +0000 Subject: [PATCH 345/347] update camera/metadata/include/camera_metadata_item_info.h. Signed-off-by: cjj --- camera/metadata/include/camera_metadata_item_info.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index b37bc232..2f34a9c8 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -355,7 +355,8 @@ static item_info_t g_ohosDeviceZoom[OHOS_DEVICE_ZOOM_END - OHOS_DEVICE_ZOOM_STAR [OHOS_CONTROL_SMOOTH_ZOOM_RATIOS - OHOS_DEVICE_ZOOM_START] = {"controlZoomRatios", META_TYPE_UINT32, -1}, [OHOS_CONTROL_PREPARE_ZOOM - OHOS_DEVICE_ZOOM_START] = {"controlPreZoom", META_TYPE_BYTE, 1}, [OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE - OHOS_DEVICE_ZOOM_START] = {"zoomPerformance", META_TYPE_UINT32, -1}, - [OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT - OHOS_DEVICE_ZOOM_START] = {"zoomBezierCurvePoint", META_TYPE_FLOAT, -1}, + [OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT - + OHOS_DEVICE_ZOOM_START] = {"zoomBezierCurvePoint", META_TYPE_FLOAT, -1}, }; -- Gitee From da8fdb208b35c18306793e37695b1a07967c6155 Mon Sep 17 00:00:00 2001 From: cjj Date: Tue, 25 Feb 2025 03:35:13 +0000 Subject: [PATCH 346/347] update camera/metadata/include/camera_device_ability_items.h. Signed-off-by: cjj --- camera/metadata/include/camera_device_ability_items.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 34b94dd7..335f0c69 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1457,13 +1457,13 @@ typedef enum camera_device_metadata_tag { * camera device property, set current camera support camera BEZIER_CURVC_POINT * (i.e. byte ...) */ - OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT, + OHOS_ABILITY_CAMERA_ZOOM_BEZIER_CURVC_POINT, /** * ohos.device.zoomEnd * * camera device zoomEnd */ - OHOS_DEVICE_ZOOM_END, + OHOS_DEVICE_ZOOM_END, // Camera flow control related /** -- Gitee From def3bce21a1706f6c108edf47079c98a62ad82ec Mon Sep 17 00:00:00 2001 From: cjj Date: Tue, 25 Feb 2025 03:52:24 +0000 Subject: [PATCH 347/347] update camera/metadata/include/camera_device_ability_items.h. Signed-off-by: cjj --- camera/metadata/include/camera_device_ability_items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 335f0c69..bf58a463 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1450,7 +1450,7 @@ typedef enum camera_device_metadata_tag { * camera device property, set current camera support camera zoom performance * (i.e. byte ...) */ - OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE, + OHOS_ABILITY_CAMERA_ZOOM_PERFORMANCE, /** * ohos.control.zoomBezierCurvePoint [static, byte, public] * -- Gitee