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