1/* Copyright (c) 2011-2013, 2016, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 *     * Redistributions of source code must retain the above copyright
7 *       notice, this list of conditions and the following disclaimer.
8 *     * Redistributions in binary form must reproduce the above
9 *       copyright notice, this list of conditions and the following
10 *       disclaimer in the documentation and/or other materials provided
11 *       with the distribution.
12 *     * Neither the name of The Linux Foundation nor the names of its
13 *       contributors may be used to endorse or promote products derived
14 *       from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29
30#ifndef ANDROID_HARDWARE_QUALCOMM_CAMERA_H
31#define ANDROID_HARDWARE_QUALCOMM_CAMERA_H
32
33// Camera dependencies
34#include "QCamera2HWI.h"
35
36extern "C" {
37
38  int get_number_of_cameras();
39  int get_camera_info(int camera_id, struct camera_info *info);
40
41  int camera_device_open(const struct hw_module_t* module, const char* id,
42          struct hw_device_t** device);
43
44  hw_device_t * open_camera_device(int cameraId);
45
46  int close_camera_device( hw_device_t *);
47
48namespace android {
49  int set_preview_window(struct camera_device *,
50          struct preview_stream_ops *window);
51  void set_CallBacks(struct camera_device *,
52          camera_notify_callback notify_cb,
53          camera_data_callback data_cb,
54          camera_data_timestamp_callback data_cb_timestamp,
55          camera_request_memory get_memory,
56          void *user);
57
58  void enable_msg_type(struct camera_device *, int32_t msg_type);
59
60  void disable_msg_type(struct camera_device *, int32_t msg_type);
61  int msg_type_enabled(struct camera_device *, int32_t msg_type);
62
63  int start_preview(struct camera_device *);
64
65  void stop_preview(struct camera_device *);
66
67  int preview_enabled(struct camera_device *);
68  int store_meta_data_in_buffers(struct camera_device *, int enable);
69
70  int start_recording(struct camera_device *);
71
72  void stop_recording(struct camera_device *);
73
74  int recording_enabled(struct camera_device *);
75
76  void release_recording_frame(struct camera_device *,
77                  const void *opaque);
78
79  int auto_focus(struct camera_device *);
80
81  int cancel_auto_focus(struct camera_device *);
82
83  int take_picture(struct camera_device *);
84
85  int cancel_picture(struct camera_device *);
86
87  int set_parameters(struct camera_device *, const char *parms);
88
89  char* get_parameters(struct camera_device *);
90
91  void put_parameters(struct camera_device *, char *);
92
93  int send_command(struct camera_device *,
94              int32_t cmd, int32_t arg1, int32_t arg2);
95
96  void release(struct camera_device *);
97
98  int dump(struct camera_device *, int fd);
99
100
101
102}; // namespace android
103
104} //extern "C"
105
106#endif
107
108