1 /* 2 * Copyright (c) 2021 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 #ifndef HOS_CAMERA_HOST_C_IF_H 17 #define HOS_CAMERA_HOST_C_IF_H 18 19 #include "camera_types_c_if.h" 20 #include "camera_device_c_if.h" 21 #include "camera_metadata_c_if.h" 22 23 #define CAMERA_C_HAL_LIB_PATH HDF_LIBRARY_FULL_PATH("libcamera_c_hal") 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 typedef struct CameraHostCallbackCIF { 30 void (*OnCameraStatus)(char* cameraId, int cameraStatus); 31 void (*OnFlashlightStatus)(char* cameraId, int flashlightStatus); 32 } CameraHostCallbackCIF; 33 34 typedef struct CameraHostCIF { 35 int (*SetCallback)(CameraHostCallbackCIF callback); 36 int (*GetCameraIds)(char** ids[], int* size); 37 int (*GetCameraAbility)(const char* cameraId, CameraAbilityCIF* ability); 38 int (*OpenCamera)(const char* cameraId, CameraDeviceCallbackCIF callback, CameraDeviceCIF* device); 39 int (*SetFlashlight)(const char* cameraId, int* isEnable); 40 } CameraHostCIF; 41 42 typedef int (*HOST_C_FUNC_SETCALLBACK)(CameraHostCallbackCIF callback); 43 typedef int (*HOST_C_FUNC_GETCAMERAIDS)(char** ids[], int* size); 44 typedef int (*HOST_C_FUNC_GETCAMERAABILITY)(const char* cameraId, CameraAbilityCIF* ability); 45 typedef int (*HOST_C_FUNC_OPENCAMERA)(const char* cameraId, CameraDeviceCallbackCIF callback, CameraDeviceCIF* device); 46 typedef int (*HOST_C_FUNC_SETFLASHLIGHT)(const char* cameraId, int* isEnable); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53