• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024-2025 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.IDCameraHdfCallback;
30import ohos.hdi.distributed_camera.v1_1.IDCameraProviderCallback;
31
32interface IDCameraProvider {
33    /**
34     * @brief Enable distributed camera device and set callback. For details about the callbacks,
35     * see {@link IDCameraProviderCallback}.
36     *
37     * @param dhBase [in] Distributed hardware device base info.
38     *
39     * @param abilityInfo [in] The static capability info of the distributed camera device to be enabled.
40     *
41     * @param callbackObj [in] Indicates the callbacks to set.
42     *
43     * @return Returns <b>NO_ERROR</b> if the operation is successful,
44     * returns an error code defined in {@link DCamRetCode} otherwise.
45     *
46     * @since 5.0
47     * @version 1.1
48     */
49    EnableDCameraDevice([in] struct DHBase dhBase,[in] String abilityInfo,[in] IDCameraProviderCallback callbackObj);
50
51    /**
52     * @brief Disable distributed camera device.
53     *
54     * @param dhBase [in] Distributed hardware device base info
55     *
56     * @return Returns <b>NO_ERROR</b> if the operation is successful,
57     * returns an error code defined in {@link DCamRetCode} otherwise.
58     *
59     * @since 5.0
60     * @version 1.1
61     */
62    DisableDCameraDevice([in] struct DHBase dhBase);
63
64    /**
65     * @brief Acquire a frame buffer from the procedure handle which attached to the streamId.
66     *
67     * @param dhBase [in] Distributed hardware device base info
68     *
69     * @param streamId [in] Indicates the ID of the stream to which the procedure handle is to be attached.
70     *
71     * @param buffer [out] A frame buffer
72     *
73     * @return Returns <b>NO_ERROR</b> if the operation is successful,
74     * returns an error code defined in {@link DCamRetCode} otherwise.
75     *
76     * @since 5.0
77     * @version 1.1
78     */
79    AcquireBuffer([in] struct DHBase dhBase,[in] int streamId,[out] struct DCameraBuffer buffer);
80
81    /**
82     * @brief Notify distributed camera HDF service when a frame buffer has been filled.
83     *
84     * @param dhBase [in] Distributed hardware device base info
85     *
86     * @param streamId [in] Indicates the ID of the stream to which the frame buffer is to be attached.
87     *
88     * @param buffer [in] output frame buffer
89     *
90     * @return Returns <b>NO_ERROR</b> if the operation is successful,
91     * returns an error code defined in {@link DCamRetCode} otherwise.
92     *
93     * @since 5.0
94     * @version 1.1
95     */
96    ShutterBuffer([in] struct DHBase dhBase,[in] int streamId,[in] struct DCameraBuffer buffer);
97
98    /**
99     * @brief Called to report metadata related to the distributed camera device.
100     *
101     * @param dhBase [in] Distributed hardware device base info
102     *
103     * @param result Indicates the metadata reported.
104     *
105     * @return Returns <b>NO_ERROR</b> if the operation is successful,
106     * returns an error code defined in {@link DCamRetCode} otherwise.
107     *
108     * @since 5.0
109     * @version 1.1
110     */
111    OnSettingsResult([in] struct DHBase dhBase,[in] struct DCameraSettings result);
112
113    /**
114     * @brief Called to notify some events from distributed camera SA service to distributed camera HDF service.
115     *
116     * @param dhBase [in] Distributed hardware device base info
117     *
118     * @param event [in] Detail event contents
119     *
120     * @return Returns <b>NO_ERROR</b> if the operation is successful,
121     * returns an error code defined in {@link DCamRetCode} otherwise.
122     *
123     * @since 5.0
124     * @version 1.1
125     */
126    Notify([in] struct DHBase dhBase,[in] struct DCameraHDFEvent event);
127
128    /**
129     * @brief Registering distributed camera HDF drivers listener.
130     *
131     * @param serviceName Service name.
132     * @param callbackObj Distributed camera HDF listener Callback.
133     *
134     * @return a value of 0 if success and a negative value if failed.
135     *
136     * @since 6.0
137     * @version 1.0
138     */
139    RegisterCameraHdfListener([in] String serviceName, [in] IDCameraHdfCallback callbackObj);
140
141    /**
142     * @brief Unregistering distributed camera HDF drivers listener.
143     *
144     * @param serviceName Service name.
145     *
146     * @return a value of 0 if success and a negative value if failed.
147     *
148     * @since 6.0
149     * @version 1.0
150     */
151    UnRegisterCameraHdfListener([in] String serviceName);
152}
153