blob: a5edc853ac85d6514edb79704ebf6bb9e4671f3d [file] [log] [blame]
Alex Ray819cfd82013-02-20 17:46:41 -08001/*
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 Raya0ed4be2013-02-25 15:02:16 -080020#include <cutils/bitops.h>
Alex Ray819cfd82013-02-20 17:46:41 -080021#include <hardware/hardware.h>
22#include <hardware/camera_common.h>
Alex Raya0ed4be2013-02-25 15:02:16 -080023#include "Camera.h"
Alex Ray7915e972013-10-17 21:52:03 -070024#include "VendorTags.h"
Alex Ray819cfd82013-02-20 17:46:41 -080025
26namespace default_camera_hal {
27// CameraHAL contains all module state that isn't specific to an individual
28// camera device.
29class CameraHAL {
30 public:
31 CameraHAL(int num_cameras);
32 ~CameraHAL();
33
34 // Camera Module Interface (see <hardware/camera_common.h>)
35 int getNumberOfCameras();
36 int getCameraInfo(int camera_id, struct camera_info *info);
37 int setCallbacks(const camera_module_callbacks_t *callbacks);
Alex Ray7915e972013-10-17 21:52:03 -070038 void getVendorTagOps(vendor_tag_ops_t* ops);
Alex Ray819cfd82013-02-20 17:46:41 -080039
40 // Hardware Module Interface (see <hardware/hardware.h>)
41 int open(const hw_module_t* mod, const char* name, hw_device_t** dev);
42
43 private:
44 // Number of cameras
45 const int mNumberOfCameras;
46 // Callback handle
47 const camera_module_callbacks_t *mCallbacks;
Alex Raya0ed4be2013-02-25 15:02:16 -080048 // Array of camera devices, contains mNumberOfCameras device pointers
49 Camera **mCameras;
Alex Ray819cfd82013-02-20 17:46:41 -080050};
51} // namespace default_camera_hal
52
53#endif // CAMERA_HAL_H_