1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at 6c5e268c6Sopenharmony_ci * 7c5e268c6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c5e268c6Sopenharmony_ci * 9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and 13c5e268c6Sopenharmony_ci * limitations under the License. 14c5e268c6Sopenharmony_ci */ 15c5e268c6Sopenharmony_ci 16c5e268c6Sopenharmony_ci/** 17c5e268c6Sopenharmony_ci * @file IDCameraProviderCallback.idl 18c5e268c6Sopenharmony_ci * 19c5e268c6Sopenharmony_ci * @brief Declares callbacks for distributed camera SA service. The caller needs to implement the callbacks. 20c5e268c6Sopenharmony_ci * 21c5e268c6Sopenharmony_ci * @since 5.0 22c5e268c6Sopenharmony_ci * @version 1.1 23c5e268c6Sopenharmony_ci */ 24c5e268c6Sopenharmony_ci 25c5e268c6Sopenharmony_cipackage ohos.hdi.distributed_camera.v1_1; 26c5e268c6Sopenharmony_ci 27c5e268c6Sopenharmony_ciimport ohos.hdi.distributed_camera.v1_1.DCameraTypes; 28c5e268c6Sopenharmony_ci 29c5e268c6Sopenharmony_ci[callback] interface IDCameraProviderCallback { 30c5e268c6Sopenharmony_ci /** 31c5e268c6Sopenharmony_ci * @brief Create the transmission channel between the source device and the sink device. 32c5e268c6Sopenharmony_ci * Open and initialize the distributed camera session. 33c5e268c6Sopenharmony_ci * 34c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 35c5e268c6Sopenharmony_ci * 36c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 37c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 38c5e268c6Sopenharmony_ci * 39c5e268c6Sopenharmony_ci * @since 5.0 40c5e268c6Sopenharmony_ci * @version 1.1 41c5e268c6Sopenharmony_ci */ 42c5e268c6Sopenharmony_ci OpenSession([in] struct DHBase dhBase); 43c5e268c6Sopenharmony_ci 44c5e268c6Sopenharmony_ci /** 45c5e268c6Sopenharmony_ci * @brief Close the distributed camera session, and destroy the transmission channel between 46c5e268c6Sopenharmony_ci * the source device and the sink device. 47c5e268c6Sopenharmony_ci * 48c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 49c5e268c6Sopenharmony_ci * 50c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 51c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 52c5e268c6Sopenharmony_ci * 53c5e268c6Sopenharmony_ci * @since 5.0 54c5e268c6Sopenharmony_ci * @version 1.1 55c5e268c6Sopenharmony_ci */ 56c5e268c6Sopenharmony_ci CloseSession([in] struct DHBase dhBase); 57c5e268c6Sopenharmony_ci 58c5e268c6Sopenharmony_ci /** 59c5e268c6Sopenharmony_ci * @brief Configures streams. 60c5e268c6Sopenharmony_ci * 61c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 62c5e268c6Sopenharmony_ci * 63c5e268c6Sopenharmony_ci * @param streamInfos [in] Indicates the list of stream information, which is defined by {@link DCStreamInfo}. 64c5e268c6Sopenharmony_ci * 65c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 66c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 67c5e268c6Sopenharmony_ci * 68c5e268c6Sopenharmony_ci * @since 5.0 69c5e268c6Sopenharmony_ci * @version 1.1 70c5e268c6Sopenharmony_ci */ 71c5e268c6Sopenharmony_ci ConfigureStreams([in] struct DHBase dhBase,[in] struct DCStreamInfo[] streamInfos); 72c5e268c6Sopenharmony_ci 73c5e268c6Sopenharmony_ci /** 74c5e268c6Sopenharmony_ci * @brief Releases streams. 75c5e268c6Sopenharmony_ci * 76c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 77c5e268c6Sopenharmony_ci * 78c5e268c6Sopenharmony_ci * @param streamIds [IN] Indicates the IDs of the streams to release. 79c5e268c6Sopenharmony_ci * 80c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 81c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 82c5e268c6Sopenharmony_ci * 83c5e268c6Sopenharmony_ci * @since 5.0 84c5e268c6Sopenharmony_ci * @version 1.1 85c5e268c6Sopenharmony_ci */ 86c5e268c6Sopenharmony_ci ReleaseStreams([in] struct DHBase dhBase,[in] int[] streamIds); 87c5e268c6Sopenharmony_ci 88c5e268c6Sopenharmony_ci /** 89c5e268c6Sopenharmony_ci * @brief Start capture images. 90c5e268c6Sopenharmony_ci * This function must be called after {@link ConfigStreams}. 91c5e268c6Sopenharmony_ci * There are two image capture modes: continuous capture and single capture. 92c5e268c6Sopenharmony_ci * 93c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 94c5e268c6Sopenharmony_ci * 95c5e268c6Sopenharmony_ci * @param captureInfos [in] Indicates the capture request configuration information. 96c5e268c6Sopenharmony_ci * For details, see {@link DCCaptureInfo}. 97c5e268c6Sopenharmony_ci * 98c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 99c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 100c5e268c6Sopenharmony_ci * 101c5e268c6Sopenharmony_ci * @since 5.0 102c5e268c6Sopenharmony_ci * @version 1.1 103c5e268c6Sopenharmony_ci */ 104c5e268c6Sopenharmony_ci StartCapture([in] struct DHBase dhBase,[in] struct DCCaptureInfo[] captureInfos); 105c5e268c6Sopenharmony_ci 106c5e268c6Sopenharmony_ci /** 107c5e268c6Sopenharmony_ci * @brief Stop capture images. 108c5e268c6Sopenharmony_ci * 109c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 110c5e268c6Sopenharmony_ci * 111c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 112c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 113c5e268c6Sopenharmony_ci * 114c5e268c6Sopenharmony_ci * @since 5.0 115c5e268c6Sopenharmony_ci * @version 1.1 116c5e268c6Sopenharmony_ci */ 117c5e268c6Sopenharmony_ci StopCapture([in] struct DHBase dhBase,[in] int[] streamIds); 118c5e268c6Sopenharmony_ci 119c5e268c6Sopenharmony_ci /** 120c5e268c6Sopenharmony_ci * @brief Updates distributed camera device control parameters. 121c5e268c6Sopenharmony_ci * 122c5e268c6Sopenharmony_ci * @param dhBase [in] Distributed hardware device base info 123c5e268c6Sopenharmony_ci * 124c5e268c6Sopenharmony_ci * @param settings [in] Indicates the camera parameters, including the sensor frame rate and 3A parameters. 125c5e268c6Sopenharmony_ci * For details about the settings, see {@link DCameraSettings}. 126c5e268c6Sopenharmony_ci * 127c5e268c6Sopenharmony_ci * @return Returns <b>NO_ERROR</b> if the operation is successful, 128c5e268c6Sopenharmony_ci * returns an error code defined in {@link DCamRetCode} otherwise. 129c5e268c6Sopenharmony_ci * 130c5e268c6Sopenharmony_ci * @since 5.0 131c5e268c6Sopenharmony_ci * @version 1.1 132c5e268c6Sopenharmony_ci */ 133c5e268c6Sopenharmony_ci UpdateSettings([in] struct DHBase dhBase,[in] struct DCameraSettings[] settings); 134c5e268c6Sopenharmony_ci 135c5e268c6Sopenharmony_ci /** 136c5e268c6Sopenharmony_ci * @brief Notify distributed camera SA of events. 137c5e268c6Sopenharmony_ci * 138c5e268c6Sopenharmony_ci * @param streamId Stream ID for distributed camera devices. 139c5e268c6Sopenharmony_ci * @param event Notification event types (such as focus events, volume events) 140c5e268c6Sopenharmony_ci * 141c5e268c6Sopenharmony_ci * @return a value of 0 if success, return a negative value if failed. 142c5e268c6Sopenharmony_ci * 143c5e268c6Sopenharmony_ci * @since 5.0 144c5e268c6Sopenharmony_ci * @version 1.1 145c5e268c6Sopenharmony_ci */ 146c5e268c6Sopenharmony_ci NotifyEvent([in] struct DHBase dhBase, [in] struct DCameraHDFEvent event); 147c5e268c6Sopenharmony_ci} 148