From 86c673a8e2e729e6d56706b578a8f752df0ceded Mon Sep 17 00:00:00 2001 From: zhuzhihui7 Date: Tue, 20 May 2025 11:42:04 +0800 Subject: [PATCH] =?UTF-8?q?hdf=E9=A9=B1=E5=8A=A8=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=8D=95=E6=A1=86=E6=9E=B6=E5=92=8C=E5=8F=8C?= =?UTF-8?q?=E6=A1=86=E6=9E=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuzhihui7 --- distributed_audio/audioext/v2_0/BUILD.gn | 1 + .../audioext/v2_0/IDAudioHdfCallback.idl | 55 +++++++++++++++++++ .../audioext/v2_0/IDAudioManager.idl | 28 +++++++++- distributed_camera/v1_1/BUILD.gn | 1 + .../v1_1/IDCameraHdfCallback.idl | 42 ++++++++++++++ distributed_camera/v1_1/IDCameraProvider.idl | 28 +++++++++- 6 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 distributed_audio/audioext/v2_0/IDAudioHdfCallback.idl create mode 100644 distributed_camera/v1_1/IDCameraHdfCallback.idl diff --git a/distributed_audio/audioext/v2_0/BUILD.gn b/distributed_audio/audioext/v2_0/BUILD.gn index b5adde5c..232c50db 100644 --- a/distributed_audio/audioext/v2_0/BUILD.gn +++ b/distributed_audio/audioext/v2_0/BUILD.gn @@ -16,6 +16,7 @@ hdi("daudioext") { module_name = "daudioext" sources = [ "IDAudioCallback.idl", + "IDAudioHdfCallback.idl", "IDAudioManager.idl", "Types.idl", ] diff --git a/distributed_audio/audioext/v2_0/IDAudioHdfCallback.idl b/distributed_audio/audioext/v2_0/IDAudioHdfCallback.idl new file mode 100644 index 00000000..116aba12 --- /dev/null +++ b/distributed_audio/audioext/v2_0/IDAudioHdfCallback.idl @@ -0,0 +1,55 @@ +/* + * 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 Distributed Audio + * @{ + * + * @brief Provides APIs for communication to distributed audio SA service + * + * Call of the transmission interface between the distributed audio HDF service and + * the distributed audio SA service, and provide hardware driver interfaces for + * the upper layer. + * + * @since 6.0 + * @version 1.0 + */ + +package ohos.hdi.distributed_audio.audioext.v2_0; + +import ohos.hdi.distributed_audio.audioext.v2_0.Types; + +/** + * @brief Basic operations for Distributed Audio devices. + * + * There are currently no events. + * + * @since 6.0 + * @version 1.0 + */ +[callback] interface IDAudioHdfCallback { + /** + * @brief Notify distributed audio HDF of events. + * + * @param devId Device ID for distributed audio devices. + * @param event Notification event types (such as focus events, volume events) + * + * @return a value of 0 if success, return a negative value if failed. + * + * @since 6.0 + * @version 1.0 + */ + NotifyEvent([in] int devId, [in] struct DAudioEvent event); +} \ No newline at end of file diff --git a/distributed_audio/audioext/v2_0/IDAudioManager.idl b/distributed_audio/audioext/v2_0/IDAudioManager.idl index 4f180e04..780c708a 100644 --- a/distributed_audio/audioext/v2_0/IDAudioManager.idl +++ b/distributed_audio/audioext/v2_0/IDAudioManager.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -29,6 +29,7 @@ package ohos.hdi.distributed_audio.audioext.v2_0; import ohos.hdi.distributed_audio.audioext.v2_0.IDAudioCallback; +import ohos.hdi.distributed_audio.audioext.v2_0.IDAudioHdfCallback; import ohos.hdi.distributed_audio.audioext.v2_0.Types; /** @@ -83,4 +84,29 @@ interface IDAudioManager { * @version 2.0 */ NotifyEvent([in] String adpName, [in] int devId, [in] int streamId, [in] struct DAudioEvent event); + + /** + * @brief Registering distributed audio HDF drivers listener. + * + * @param serviceName Service name. + * @param callbackObj Distributed Audio HDF listener Callback. + * + * @return a value of 0 if success and a negative value if failed. + * + * @since 6.0 + * @version 1.0 + */ + RegisterAudioHdfListener([in] String serviceName, [in] IDAudioHdfCallback callbackObj); + + /** + * @brief Unregistering distributed audio HDF drivers listener. + * + * @param serviceName Service name. + * + * @return a value of 0 if success and a negative value if failed. + * + * @since 6.0 + * @version 1.0 + */ + UnRegisterAudioHdfListener([in] String serviceName); } \ No newline at end of file diff --git a/distributed_camera/v1_1/BUILD.gn b/distributed_camera/v1_1/BUILD.gn index 6d435160..5cb450f8 100644 --- a/distributed_camera/v1_1/BUILD.gn +++ b/distributed_camera/v1_1/BUILD.gn @@ -16,6 +16,7 @@ hdi("distributed_camera_provider") { module_name = "distributed_camera_provider_service" sources = [ "DCameraTypes.idl", + "IDCameraHdfCallback.idl", "IDCameraProvider.idl", "IDCameraProviderCallback.idl", ] diff --git a/distributed_camera/v1_1/IDCameraHdfCallback.idl b/distributed_camera/v1_1/IDCameraHdfCallback.idl new file mode 100644 index 00000000..e7594d8c --- /dev/null +++ b/distributed_camera/v1_1/IDCameraHdfCallback.idl @@ -0,0 +1,42 @@ +/* + * 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. + */ + +/** + * @file IDCameraHdfCallback.idl + * + * @brief Declares callbacks for distributed camera SA service. The caller needs to implement the callbacks. + * + * @since 6.0 + * @version 1.0 + */ + +package ohos.hdi.distributed_camera.v1_1; + +import ohos.hdi.distributed_camera.v1_1.DCameraTypes; + +[callback] interface IDCameraHdfCallback { + /** + * @brief Notify distributed camera HDF of events. + * + * @param devId Device ID for distributed audio devices. + * @param event Notification event types (such as focus events, volume events) + * + * @return a value of 0 if success, return a negative value if failed. + * + * @since 6.0 + * @version 1.0 + */ + NotifyEvent([in] int devId, [in] struct DCameraHDFEvent event); +} diff --git a/distributed_camera/v1_1/IDCameraProvider.idl b/distributed_camera/v1_1/IDCameraProvider.idl index fb9bec60..db6c2ae7 100644 --- a/distributed_camera/v1_1/IDCameraProvider.idl +++ b/distributed_camera/v1_1/IDCameraProvider.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -26,6 +26,7 @@ package ohos.hdi.distributed_camera.v1_1; import ohos.hdi.distributed_camera.v1_1.DCameraTypes; +import ohos.hdi.distributed_camera.v1_1.IDCameraHdfCallback; import ohos.hdi.distributed_camera.v1_1.IDCameraProviderCallback; interface IDCameraProvider { @@ -123,4 +124,29 @@ interface IDCameraProvider { * @version 1.1 */ Notify([in] struct DHBase dhBase,[in] struct DCameraHDFEvent event); + + /** + * @brief Registering distributed camera HDF drivers listener. + * + * @param serviceName Service name. + * @param callbackObj Distributed camera HDF listener Callback. + * + * @return a value of 0 if success and a negative value if failed. + * + * @since 6.0 + * @version 1.0 + */ + RegisterCameraHdfListener([in] String serviceName, [in] IDCameraHdfCallback callbackObj); + + /** + * @brief Unregistering distributed camera HDF drivers listener. + * + * @param serviceName Service name. + * + * @return a value of 0 if success and a negative value if failed. + * + * @since 6.0 + * @version 1.0 + */ + UnRegisterCameraHdfListener([in] String serviceName); } -- Gitee