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 IDCameraProviderCallback.idl
18 *
19 * @brief Declares callbacks for distributed camera SA service. The caller needs to implement the callbacks.
20 *
21 * @since 5.0
22 * @version 1.1
23 */
24
25package ohos.hdi.distributed_camera.v1_1;
26
27import ohos.hdi.distributed_camera.v1_1.DCameraTypes;
28
29[callback] interface IDCameraProviderCallback {
30    /**
31     * @brief Create the transmission channel between the source device and the sink device.
32     * Open and initialize the distributed camera session.
33     *
34     * @param dhBase [in] Distributed hardware device base info
35     *
36     * @return Returns <b>NO_ERROR</b> if the operation is successful,
37     * returns an error code defined in {@link DCamRetCode} otherwise.
38     *
39     * @since 5.0
40     * @version 1.1
41     */
42    OpenSession([in] struct DHBase dhBase);
43
44    /**
45     * @brief Close the distributed camera session, and destroy the transmission channel between
46     * the source device and the sink device.
47     *
48     * @param dhBase [in] Distributed hardware device base info
49     *
50     * @return Returns <b>NO_ERROR</b> if the operation is successful,
51     * returns an error code defined in {@link DCamRetCode} otherwise.
52     *
53     * @since 5.0
54     * @version 1.1
55     */
56    CloseSession([in] struct DHBase dhBase);
57
58    /**
59     * @brief Configures streams.
60     *
61     * @param dhBase [in] Distributed hardware device base info
62     *
63     * @param streamInfos [in] Indicates the list of stream information, which is defined by {@link DCStreamInfo}.
64     *
65     * @return Returns <b>NO_ERROR</b> if the operation is successful,
66     * returns an error code defined in {@link DCamRetCode} otherwise.
67     *
68     * @since 5.0
69     * @version 1.1
70     */
71    ConfigureStreams([in] struct DHBase dhBase,[in] struct DCStreamInfo[] streamInfos);
72
73    /**
74     * @brief Releases streams.
75     *
76     * @param dhBase [in] Distributed hardware device base info
77     *
78     * @param streamIds [IN] Indicates the IDs of the streams to release.
79     *
80     * @return Returns <b>NO_ERROR</b> if the operation is successful,
81     * returns an error code defined in {@link DCamRetCode} otherwise.
82     *
83     * @since 5.0
84     * @version 1.1
85     */
86    ReleaseStreams([in] struct DHBase dhBase,[in] int[] streamIds);
87
88    /**
89     * @brief Start capture images.
90     * This function must be called after {@link ConfigStreams}.
91     * There are two image capture modes: continuous capture and single capture.
92     *
93     * @param dhBase [in] Distributed hardware device base info
94     *
95     * @param captureInfos [in] Indicates the capture request configuration information.
96     * For details, see {@link DCCaptureInfo}.
97     *
98     * @return Returns <b>NO_ERROR</b> if the operation is successful,
99     * returns an error code defined in {@link DCamRetCode} otherwise.
100     *
101     * @since 5.0
102     * @version 1.1
103     */
104    StartCapture([in] struct DHBase dhBase,[in] struct DCCaptureInfo[] captureInfos);
105
106    /**
107     * @brief Stop capture images.
108     *
109     * @param dhBase [in] Distributed hardware device base info
110     *
111     * @return Returns <b>NO_ERROR</b> if the operation is successful,
112     * returns an error code defined in {@link DCamRetCode} otherwise.
113     *
114     * @since 5.0
115     * @version 1.1
116     */
117    StopCapture([in] struct DHBase dhBase,[in] int[] streamIds);
118
119    /**
120     * @brief Updates distributed camera device control parameters.
121     *
122     * @param dhBase [in] Distributed hardware device base info
123     *
124     * @param settings [in] Indicates the camera parameters, including the sensor frame rate and 3A parameters.
125     * For details about the settings, see {@link DCameraSettings}.
126     *
127     * @return Returns <b>NO_ERROR</b> if the operation is successful,
128     * returns an error code defined in {@link DCamRetCode} otherwise.
129     *
130     * @since 5.0
131     * @version 1.1
132     */
133    UpdateSettings([in] struct DHBase dhBase,[in] struct DCameraSettings[] settings);
134
135    /**
136     * @brief Notify distributed camera SA of events.
137     *
138     * @param streamId Stream ID for distributed camera devices.
139     * @param event Notification event types (such as focus events, volume events)
140     *
141     * @return a value of 0 if success, return a negative value if failed.
142     *
143     * @since 5.0
144     * @version 1.1
145     */
146    NotifyEvent([in] struct DHBase dhBase, [in] struct DCameraHDFEvent event);
147}
148