1 /* Copyright (c) 2011, 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 34 #include "QCameraHWI.h" 35 36 extern "C" { 37 int get_number_of_cameras(); 38 int get_camera_info(int camera_id, struct camera_info *info); 39 40 int camera_device_open(const struct hw_module_t* module, const char* id, 41 struct hw_device_t** device); 42 43 hw_device_t * open_camera_device(int cameraId); 44 45 int close_camera_device( hw_device_t *); 46 47 namespace android { 48 int set_preview_window(struct camera_device *, 49 struct preview_stream_ops *window); 50 void set_CallBacks(struct camera_device *, 51 camera_notify_callback notify_cb, 52 camera_data_callback data_cb, 53 camera_data_timestamp_callback data_cb_timestamp, 54 camera_request_memory get_memory, 55 void *user); 56 57 void enable_msg_type(struct camera_device *, int32_t msg_type); 58 59 void disable_msg_type(struct camera_device *, int32_t msg_type); 60 int msg_type_enabled(struct camera_device *, int32_t msg_type); 61 62 int start_preview(struct camera_device *); 63 64 void stop_preview(struct camera_device *); 65 66 int preview_enabled(struct camera_device *); 67 int store_meta_data_in_buffers(struct camera_device *, int enable); 68 69 int start_recording(struct camera_device *); 70 71 void stop_recording(struct camera_device *); 72 73 int recording_enabled(struct camera_device *); 74 75 void release_recording_frame(struct camera_device *, 76 const void *opaque); 77 78 int auto_focus(struct camera_device *); 79 80 int cancel_auto_focus(struct camera_device *); 81 82 int take_picture(struct camera_device *); 83 84 int cancel_picture(struct camera_device *); 85 86 int set_parameters(struct camera_device *, const char *parms); 87 88 char* get_parameters(struct camera_device *); 89 90 void put_parameters(struct camera_device *, char *); 91 92 int send_command(struct camera_device *, 93 int32_t cmd, int32_t arg1, int32_t arg2); 94 95 void release(struct camera_device *); 96 97 int dump(struct camera_device *, int fd); 98 99 100 101 }; // namespace android 102 103 } //extern "C" 104 105 #endif 106 107