• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
20 #include <cutils/bitops.h>
21 #include <hardware/hardware.h>
22 #include <hardware/camera_common.h>
23 #include "Camera.h"
24 
25 namespace default_camera_hal {
26 // CameraHAL contains all module state that isn't specific to an individual
27 // camera device.
28 class CameraHAL {
29     public:
30         CameraHAL(int num_cameras);
31         ~CameraHAL();
32 
33         // Camera Module Interface (see <hardware/camera_common.h>)
34         int getNumberOfCameras();
35         int getCameraInfo(int camera_id, struct camera_info *info);
36         int setCallbacks(const camera_module_callbacks_t *callbacks);
37 
38         // Hardware Module Interface (see <hardware/hardware.h>)
39         int open(const hw_module_t* mod, const char* name, hw_device_t** dev);
40 
41     private:
42         // Number of cameras
43         const int mNumberOfCameras;
44         // Callback handle
45         const camera_module_callbacks_t *mCallbacks;
46         // Array of camera devices, contains mNumberOfCameras device pointers
47         Camera **mCameras;
48 };
49 } // namespace default_camera_hal
50 
51 #endif // CAMERA_HAL_H_
52