1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file IDCameraProvider.idl 18 * 19 * @brief Transfer interfaces call between distributed camera SA service and distributed camera HDF service, 20 * and provide Hardware Driver Interfaces (HDIs) for the upper layer. 21 * 22 * @since 5.0 23 * @version 1.1 24 */ 25 26package ohos.hdi.distributed_camera.v1_1; 27 28import ohos.hdi.distributed_camera.v1_1.DCameraTypes; 29import ohos.hdi.distributed_camera.v1_1.IDCameraProviderCallback; 30 31interface IDCameraProvider { 32 /** 33 * @brief Enable distributed camera device and set callback. For details about the callbacks, 34 * see {@link IDCameraProviderCallback}. 35 * 36 * @param dhBase [in] Distributed hardware device base info. 37 * 38 * @param abilityInfo [in] The static capability info of the distributed camera device to be enabled. 39 * 40 * @param callbackObj [in] Indicates the callbacks to set. 41 * 42 * @return Returns <b>NO_ERROR</b> if the operation is successful, 43 * returns an error code defined in {@link DCamRetCode} otherwise. 44 * 45 * @since 5.0 46 * @version 1.1 47 */ 48 EnableDCameraDevice([in] struct DHBase dhBase,[in] String abilityInfo,[in] IDCameraProviderCallback callbackObj); 49 50 /** 51 * @brief Disable distributed camera device. 52 * 53 * @param dhBase [in] Distributed hardware device base info 54 * 55 * @return Returns <b>NO_ERROR</b> if the operation is successful, 56 * returns an error code defined in {@link DCamRetCode} otherwise. 57 * 58 * @since 5.0 59 * @version 1.1 60 */ 61 DisableDCameraDevice([in] struct DHBase dhBase); 62 63 /** 64 * @brief Acquire a frame buffer from the procedure handle which attached to the streamId. 65 * 66 * @param dhBase [in] Distributed hardware device base info 67 * 68 * @param streamId [in] Indicates the ID of the stream to which the procedure handle is to be attached. 69 * 70 * @param buffer [out] A frame buffer 71 * 72 * @return Returns <b>NO_ERROR</b> if the operation is successful, 73 * returns an error code defined in {@link DCamRetCode} otherwise. 74 * 75 * @since 5.0 76 * @version 1.1 77 */ 78 AcquireBuffer([in] struct DHBase dhBase,[in] int streamId,[out] struct DCameraBuffer buffer); 79 80 /** 81 * @brief Notify distributed camera HDF service when a frame buffer has been filled. 82 * 83 * @param dhBase [in] Distributed hardware device base info 84 * 85 * @param streamId [in] Indicates the ID of the stream to which the frame buffer is to be attached. 86 * 87 * @param buffer [in] output frame buffer 88 * 89 * @return Returns <b>NO_ERROR</b> if the operation is successful, 90 * returns an error code defined in {@link DCamRetCode} otherwise. 91 * 92 * @since 5.0 93 * @version 1.1 94 */ 95 ShutterBuffer([in] struct DHBase dhBase,[in] int streamId,[in] struct DCameraBuffer buffer); 96 97 /** 98 * @brief Called to report metadata related to the distributed camera device. 99 * 100 * @param dhBase [in] Distributed hardware device base info 101 * 102 * @param result Indicates the metadata reported. 103 * 104 * @return Returns <b>NO_ERROR</b> if the operation is successful, 105 * returns an error code defined in {@link DCamRetCode} otherwise. 106 * 107 * @since 5.0 108 * @version 1.1 109 */ 110 OnSettingsResult([in] struct DHBase dhBase,[in] struct DCameraSettings result); 111 112 /** 113 * @brief Called to notify some events from distributed camera SA service to distributed camera HDF service. 114 * 115 * @param dhBase [in] Distributed hardware device base info 116 * 117 * @param event [in] Detail event contents 118 * 119 * @return Returns <b>NO_ERROR</b> if the operation is successful, 120 * returns an error code defined in {@link DCamRetCode} otherwise. 121 * 122 * @since 5.0 123 * @version 1.1 124 */ 125 Notify([in] struct DHBase dhBase,[in] struct DCameraHDFEvent event); 126} 127