Alex Ray | 819cfd8 | 2013-02-20 17:46:41 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 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 | #ifndef CAMERA_HAL_H_ |
| 18 | #define CAMERA_HAL_H_ |
| 19 | |
Alex Ray | a0ed4be | 2013-02-25 15:02:16 -0800 | [diff] [blame] | 20 | #include <cutils/bitops.h> |
Alex Ray | 819cfd8 | 2013-02-20 17:46:41 -0800 | [diff] [blame] | 21 | #include <hardware/hardware.h> |
| 22 | #include <hardware/camera_common.h> |
Ruben Brunk | b35bee2 | 2014-01-17 14:48:19 -0800 | [diff] [blame] | 23 | #include <system/camera_vendor_tags.h> |
Alex Ray | a0ed4be | 2013-02-25 15:02:16 -0800 | [diff] [blame] | 24 | #include "Camera.h" |
Alex Ray | 7915e97 | 2013-10-17 21:52:03 -0700 | [diff] [blame] | 25 | #include "VendorTags.h" |
Alex Ray | 819cfd8 | 2013-02-20 17:46:41 -0800 | [diff] [blame] | 26 | |
| 27 | namespace default_camera_hal { |
| 28 | // CameraHAL contains all module state that isn't specific to an individual |
| 29 | // camera device. |
| 30 | class CameraHAL { |
| 31 | public: |
Chih-Hung Hsieh | 928e679 | 2016-06-30 14:17:31 -0700 | [diff] [blame] | 32 | explicit CameraHAL(int num_cameras); |
Alex Ray | 819cfd8 | 2013-02-20 17:46:41 -0800 | [diff] [blame] | 33 | ~CameraHAL(); |
| 34 | |
| 35 | // Camera Module Interface (see <hardware/camera_common.h>) |
| 36 | int getNumberOfCameras(); |
| 37 | int getCameraInfo(int camera_id, struct camera_info *info); |
| 38 | int setCallbacks(const camera_module_callbacks_t *callbacks); |
Alex Ray | 7915e97 | 2013-10-17 21:52:03 -0700 | [diff] [blame] | 39 | void getVendorTagOps(vendor_tag_ops_t* ops); |
Alex Ray | 819cfd8 | 2013-02-20 17:46:41 -0800 | [diff] [blame] | 40 | |
| 41 | // Hardware Module Interface (see <hardware/hardware.h>) |
| 42 | int open(const hw_module_t* mod, const char* name, hw_device_t** dev); |
| 43 | |
| 44 | private: |
| 45 | // Number of cameras |
| 46 | const int mNumberOfCameras; |
| 47 | // Callback handle |
| 48 | const camera_module_callbacks_t *mCallbacks; |
Alex Ray | a0ed4be | 2013-02-25 15:02:16 -0800 | [diff] [blame] | 49 | // Array of camera devices, contains mNumberOfCameras device pointers |
| 50 | Camera **mCameras; |
Alex Ray | 819cfd8 | 2013-02-20 17:46:41 -0800 | [diff] [blame] | 51 | }; |
| 52 | } // namespace default_camera_hal |
| 53 | |
| 54 | #endif // CAMERA_HAL_H_ |