1 2/* 3 * Copyright (c) 2022 Huawei Device Co., Ltd. 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/** 18 * @file icamera_device_callback.h 19 * 20 * @brief Declares callbacks for reporting camera device errors and metadata. 21 * 22 * @since 3.2 23 * @version 1.0 24 */ 25 26package ohos.hdi.camera.v1_0; 27 28import ohos.hdi.camera.v1_0.Types; 29 30[callback] interface ICameraDeviceCallback { 31 /** 32 * @brief Called when an error occurs on the camera device. The caller needs to implement this function. 33 * 34 * @param type Indicates the error type. For details, see {@link ErrorType}. 35 * @param errorCode Indicates the error code. This parameter is not used currently. 36 * 37 * @since 3.2 38 * @version 1.0 39 */ 40 OnError([in] enum ErrorType type, [in] int errorCode); 41 42 /** 43 * @brief Called to report metadata related to the camera device. 44 * For details about the reporting mode, see {@link SetResultMode}. 45 * 46 * @param timestamp Indicates the timestamp when the metadata is reported. 47 * @param result Indicates the metadata reported. The reported metadata is specified by {@link EnableResult}. 48 * You can call {@link GetEnabledResults} to obtain enabled metadata and 49 * call {@link DisableResult} to disable metadata reporting. 50 * 51 * @since 3.2 52 * @version 1.0 53 */ 54 OnResult([in] unsigned long timestamp, [in] unsigned char[] result); 55} 56