diff --git a/distributed_audio/audioext/v2_0/BUILD.gn b/distributed_audio/audioext/v2_0/BUILD.gn index b5adde5cb4207b9a0371c7671413eb2732f2ac61..232c50dbbec54afb6148f4141d2e82b89a89cc3f 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 0000000000000000000000000000000000000000..116aba12eca34d0105c371b7eda1fe46d22d6ba4 --- /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 4f180e049b4fffab1279eaed24b0b2818259c6cc..780c708a2b898a1aa9aca1d7d2e8f9d21d0c01cd 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 6d435160cb4f6606b5cb3838c91f0d466df02357..5cb450f850df75749f9934fd03a8916a3457857f 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 0000000000000000000000000000000000000000..e7594d8c28f435ac2699ef87f83804c9188b0492 --- /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 fb9bec6041b16225f719a2b32ae2a026f9dea19c..db6c2ae73876f97f5d204e5f514e8352c6d414d2 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); }