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 icamera_host.h
18 *
19 * @brief Management class of the camera service that provides Hardware Driver Interfaces (HDIs) for the upper layer.
20 *
21 * @since 5.0
22 * @version 1.3
23 */
24
25package ohos.hdi.camera.v1_3;
26
27import ohos.hdi.camera.v1_2.ICameraHost;
28import ohos.hdi.camera.v1_3.ICameraDevice;
29import ohos.hdi.camera.v1_0.ICameraDeviceCallback;
30import ohos.hdi.camera.v1_3.Types;
31
32interface ICameraHost extends ohos.hdi.camera.v1_2.ICameraHost {
33    /**
34     * @brief Opens a camera device.
35     *
36     * By calling this function, you can obtain the <b>ICameraDevice</b> instance and operate the
37     * specific camera device mapping to the instance.
38     *
39     * @param cameraId Indicates the ID of the camera device, which can be obtained by calling {@link GetCameraIds}.
40     * @param callback Indicates the callback related to the camera. For details, see {@link ICameraDeviceCallback}.
41     * @param device Indicates the <b>ICameraDevice</b> instance corresponding to the ID of the camera device.
42     *
43     * @return Returns <b>NO_ERROR</b> if the operation is successful; returns an error code defined
44     * in {@link CamRetCode} otherwise.
45     *
46     * @since 5.0
47     * @version 1.3
48     */
49    OpenCamera_V1_3([in] String cameraId, [in] ICameraDeviceCallback callbackObj, [out] ICameraDevice device);
50
51    /**
52     * @brief Opens a camera device in secure mode.
53     *
54     * By calling this function, you can obtain the <b>ICameraDevice</b> instance and operate the
55     * specific camera device mapping to the instance.
56     *
57     * @param cameraId Indicates the ID of the camera device, which can be obtained by calling {@link GetCameraIds}.
58     * @param callback Indicates the callback related to the camera. For details, see {@link ICameraDeviceCallback}.
59     * @param device Indicates the <b>ICameraDevice</b> instance corresponding to the ID of the camera device.
60     *
61     * @return Returns <b>NO_ERROR</b> if the operation is successful; returns an error code defined
62     * in {@link CamRetCode} otherwise.
63     *
64     * @since 5.0
65     * @version 1.0
66     */
67    OpenSecureCamera([in] String cameraId, [in] ICameraDeviceCallback callbackObj, [out] ICameraDevice device);
68
69    /**
70     * @brief Obtain the resource cost of opening the camera on the camera device through cameraHost
71     *
72     * @param resourceCost Indicates open the resource cost of the camera device
73     * @param cameraId Indicates the ID of the camera device, which can be obtained by calling {@link GetCameraIds}.
74     *
75     * @return Returns <b>NO_ERROR</b> if the operation is successful; returns an error code defined
76     * in {@link CamRetCode} otherwise.
77     *
78     * @since 5.0
79     * @version 1.0
80     */
81    GetResourceCost([in] String cameraId, [out] CameraDeviceResourceCost resourceCost);
82}
83