aboutsummaryrefslogtreecommitdiff
path: root/camera/QCamera2/stack/mm-camera-test/inc
diff options
context:
space:
mode:
authorPrateek Chaubey <chaubeyprateek@gmail.com>2018-01-07 20:55:14 +0530
committerDavide Garberi <dade.garberi@gmail.com>2018-01-19 14:09:15 +0100
commit6616278131edd80a12545085e06ee6b0e0a0a788 (patch)
tree0aef88ed11809a9d67f6abe4dc2ff782a14737e2 /camera/QCamera2/stack/mm-camera-test/inc
parentcc4ccf34871da343111bf68d16ba4e4c67cac1dc (diff)
msm8996-common: zuk: Import OSS Camera HAL
Tag: LA.HB.1.3.2-32600-8x96.0 Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'camera/QCamera2/stack/mm-camera-test/inc')
-rw-r--r--camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_app.h533
-rw-r--r--camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_commands.h68
-rw-r--r--camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_dbg.h38
-rw-r--r--camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_main_menu.h439
-rw-r--r--camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_socket.h113
5 files changed, 1191 insertions, 0 deletions
diff --git a/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_app.h b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_app.h
new file mode 100644
index 0000000..1b94ea8
--- /dev/null
+++ b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_app.h
@@ -0,0 +1,533 @@
+/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __MM_QCAMERA_APP_H__
+#define __MM_QCAMERA_APP_H__
+
+// System dependencies
+#include <pthread.h>
+#include <linux/msm_ion.h>
+#include <linux/msm_mdp.h>
+
+// Camera dependencies
+#include "mm_camera_interface.h"
+#include "mm_jpeg_interface.h"
+#include "mm_qcamera_socket.h"
+
+#define MM_QCAMERA_APP_INTERATION 1
+
+#define MM_APP_MAX_DUMP_FRAME_NUM 1000
+
+#define PREVIEW_BUF_NUM 7
+#define SNAPSHOT_BUF_NUM 10
+#define VIDEO_BUF_NUM 7
+#define ISP_PIX_BUF_NUM 9
+#define STATS_BUF_NUM 4
+#define RDI_BUF_NUM 8
+#define CAPTURE_BUF_NUM 5
+
+#define DEFAULT_PREVIEW_FORMAT CAM_FORMAT_YUV_420_NV21
+#define DEFAULT_PREVIEW_WIDTH 1280
+#define DEFAULT_PREVIEW_HEIGHT 960
+#define DEFAULT_PREVIEW_PADDING CAM_PAD_TO_WORD
+#define DEFAULT_VIDEO_FORMAT CAM_FORMAT_YUV_420_NV12
+#define DEFAULT_VIDEO_WIDTH 800
+#define DEFAULT_VIDEO_HEIGHT 480
+#define DEFAULT_VIDEO_PADDING CAM_PAD_TO_2K
+#define DEFAULT_SNAPSHOT_FORMAT CAM_FORMAT_YUV_420_NV21
+#define DEFAULT_RAW_FORMAT CAM_FORMAT_BAYER_MIPI_RAW_10BPP_GBRG
+
+#define DEFAULT_SNAPSHOT_WIDTH 4160
+#define DEFAULT_SNAPSHOT_HEIGHT 3120
+#define DEFAULT_SNAPSHOT_PADDING CAM_PAD_TO_WORD
+
+#define DEFAULT_OV_FORMAT MDP_Y_CRCB_H2V2
+#define DEFAULT_OV_FORMAT_BPP 3/2
+#define DEFAULT_CAMERA_FORMAT_BPP 3/2
+#define FB_PATH "/dev/graphics/fb0"
+#define BACKLIGHT_CONTROL "/sys/class/leds/lcd-backlight/brightness"
+#define BACKLIGHT_LEVEL "205"
+
+#define ENABLE_REPROCESSING 1
+
+#define INVALID_KEY_PRESS 0
+#define BASE_OFFSET ('Z' - 'A' + 1)
+#define BASE_OFFSET_NUM ('Z' - 'A' + 2)
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+typedef enum {
+ TUNE_CMD_INIT,
+ TUNE_CMD_GET_LIST,
+ TUNE_CMD_GET_PARAMS,
+ TUNE_CMD_SET_PARAMS,
+ TUNE_CMD_MISC,
+ TUNE_CMD_DEINIT,
+} mm_camera_tune_cmd_t;
+
+typedef enum {
+ TUNE_PREVCMD_INIT,
+ TUNE_PREVCMD_SETDIM,
+ TUNE_PREVCMD_GETINFO,
+ TUNE_PREVCMD_GETCHUNKSIZE,
+ TUNE_PREVCMD_GETFRAME,
+ TUNE_PREVCMD_UNSUPPORTED,
+ TUNE_PREVCMD_DEINIT,
+} mm_camera_tune_prevcmd_t;
+
+typedef void (*cam_stream_user_cb) (mm_camera_buf_def_t *frame);
+typedef void (*prev_callback) (mm_camera_buf_def_t *preview_frame);
+
+
+typedef struct {
+ char *send_buf;
+ uint32_t send_len;
+ void *next;
+} eztune_prevcmd_rsp;
+
+typedef struct {
+ int (*command_process) (void *recv, mm_camera_tune_cmd_t cmd,
+ void *param, char *send_buf, uint32_t send_len);
+ int (*prevcommand_process) (void *recv, mm_camera_tune_prevcmd_t cmd,
+ void *param, char **send_buf, uint32_t *send_len);
+ void (*prevframe_callback) (mm_camera_buf_def_t *preview_frame);
+} mm_camera_tune_func_t;
+
+typedef struct {
+ mm_camera_tune_func_t *func_tbl;
+ void *lib_handle;
+}mm_camera_tuning_lib_params_t;
+
+typedef enum {
+ MM_CAMERA_OK,
+ MM_CAMERA_E_GENERAL,
+ MM_CAMERA_E_NO_MEMORY,
+ MM_CAMERA_E_NOT_SUPPORTED,
+ MM_CAMERA_E_INVALID_INPUT,
+ MM_CAMERA_E_INVALID_OPERATION, /* 5 */
+ MM_CAMERA_E_ENCODE,
+ MM_CAMERA_E_BUFFER_REG,
+ MM_CAMERA_E_PMEM_ALLOC,
+ MM_CAMERA_E_CAPTURE_FAILED,
+ MM_CAMERA_E_CAPTURE_TIMEOUT, /* 10 */
+} mm_camera_status_type_t;
+
+typedef enum {
+ MM_CHANNEL_TYPE_ZSL, /* preview, and snapshot main */
+ MM_CHANNEL_TYPE_CAPTURE, /* snapshot main, and postview */
+ MM_CHANNEL_TYPE_PREVIEW, /* preview only */
+ MM_CHANNEL_TYPE_SNAPSHOT, /* snapshot main only */
+ MM_CHANNEL_TYPE_VIDEO, /* video only */
+ MM_CHANNEL_TYPE_RDI, /* rdi only */
+ MM_CHANNEL_TYPE_REPROCESS,/* offline reprocess */
+ MM_CHANNEL_TYPE_MAX
+} mm_camera_channel_type_t;
+
+typedef struct {
+ int fd;
+ int main_ion_fd;
+ ion_user_handle_t handle;
+ size_t size;
+ parm_buffer_t *data;
+} mm_camera_app_meminfo_t;
+
+typedef struct {
+ mm_camera_buf_def_t buf;
+ mm_camera_app_meminfo_t mem_info;
+} mm_camera_app_buf_t;
+
+typedef struct {
+ uint32_t s_id;
+ mm_camera_stream_config_t s_config;
+ cam_frame_len_offset_t offset;
+ uint8_t num_of_bufs;
+ uint32_t multipleOf;
+ mm_camera_app_buf_t s_bufs[MM_CAMERA_MAX_NUM_FRAMES];
+ mm_camera_app_buf_t s_info_buf;
+} mm_camera_stream_t;
+
+typedef struct {
+ uint32_t ch_id;
+ uint8_t num_streams;
+ mm_camera_stream_t streams[MAX_STREAM_NUM_IN_BUNDLE];
+} mm_camera_channel_t;
+
+typedef void (*release_data_fn)(void* data, void *user_data);
+
+typedef struct {
+ struct cam_list list;
+ void* data;
+} camera_q_node;
+
+typedef struct {
+ camera_q_node m_head;
+ int m_size;
+ pthread_mutex_t m_lock;
+ release_data_fn m_dataFn;
+ void * m_userData;
+} mm_camera_queue_t;
+
+typedef struct {
+ uint16_t user_input_display_width;
+ uint16_t user_input_display_height;
+} USER_INPUT_DISPLAY_T;
+
+typedef struct {
+ mm_camera_vtbl_t *cam;
+ uint8_t num_channels;
+ mm_camera_channel_t channels[MM_CHANNEL_TYPE_MAX];
+ mm_jpeg_ops_t jpeg_ops;
+ uint32_t jpeg_hdl;
+ mm_camera_app_buf_t cap_buf;
+ mm_camera_app_buf_t parm_buf;
+
+ uint32_t current_jpeg_sess_id;
+ mm_camera_super_buf_t* current_job_frames;
+ uint32_t current_job_id;
+ mm_camera_app_buf_t jpeg_buf;
+
+ int fb_fd;
+ struct fb_var_screeninfo vinfo;
+ struct mdp_overlay data_overlay;
+ uint32_t slice_size;
+ uint32_t buffer_width, buffer_height;
+ uint32_t buffer_size;
+ cam_format_t buffer_format;
+ uint32_t frame_size;
+ uint32_t frame_count;
+ int encodeJpeg;
+ int zsl_enabled;
+ int8_t focus_supported;
+ cam_stream_user_cb user_preview_cb;
+ cam_stream_user_cb user_metadata_cb;
+ parm_buffer_t *params_buffer;
+ USER_INPUT_DISPLAY_T preview_resolution;
+
+ //Reprocess params&stream
+ int8_t enable_reproc;
+ int32_t reproc_sharpness;
+ cam_denoise_param_t reproc_wnr;
+ int8_t enable_CAC;
+ mm_camera_queue_t pp_frames;
+ mm_camera_stream_t *reproc_stream;
+ metadata_buffer_t *metadata;
+ int8_t is_chromatix_reload;
+} mm_camera_test_obj_t;
+
+typedef struct {
+ void *ptr;
+ void* ptr_jpeg;
+
+ uint8_t (*get_num_of_cameras) ();
+ int32_t (*mm_camera_open) (uint8_t camera_idx, mm_camera_vtbl_t **camera_vtbl);
+ uint32_t (*jpeg_open)(mm_jpeg_ops_t *ops, mm_jpeg_mpo_ops_t *mpo_ops,
+ mm_dimension picture_size,
+ cam_jpeg_metadata_t *jpeg_metadata);
+
+} hal_interface_lib_t;
+
+typedef struct {
+ uint8_t num_cameras;
+ hal_interface_lib_t hal_lib;
+} mm_camera_app_t;
+
+typedef struct {
+ uint32_t width;
+ uint32_t height;
+} mm_camera_lib_snapshot_params;
+
+typedef enum {
+ MM_CAMERA_LIB_NO_ACTION = 0,
+ MM_CAMERA_LIB_RAW_CAPTURE,
+ MM_CAMERA_LIB_JPEG_CAPTURE,
+ MM_CAMERA_LIB_SET_FOCUS_MODE,
+ MM_CAMERA_LIB_DO_AF,
+ MM_CAMERA_LIB_CANCEL_AF,
+ MM_CAMERA_LIB_LOCK_AE,
+ MM_CAMERA_LIB_UNLOCK_AE,
+ MM_CAMERA_LIB_LOCK_AWB,
+ MM_CAMERA_LIB_UNLOCK_AWB,
+ MM_CAMERA_LIB_GET_CHROMATIX,
+ MM_CAMERA_LIB_SET_RELOAD_CHROMATIX,
+ MM_CAMERA_LIB_GET_AFTUNE,
+ MM_CAMERA_LIB_SET_RELOAD_AFTUNE,
+ MM_CAMERA_LIB_SET_AUTOFOCUS_TUNING,
+ MM_CAMERA_LIB_ZSL_ENABLE,
+ MM_CAMERA_LIB_EV,
+ MM_CAMERA_LIB_ANTIBANDING,
+ MM_CAMERA_LIB_SET_VFE_COMMAND,
+ MM_CAMERA_LIB_SET_POSTPROC_COMMAND,
+ MM_CAMERA_LIB_SET_3A_COMMAND,
+ MM_CAMERA_LIB_AEC_ENABLE,
+ MM_CAMERA_LIB_AEC_DISABLE,
+ MM_CAMERA_LIB_AF_ENABLE,
+ MM_CAMERA_LIB_AF_DISABLE,
+ MM_CAMERA_LIB_AWB_ENABLE,
+ MM_CAMERA_LIB_AWB_DISABLE,
+ MM_CAMERA_LIB_AEC_FORCE_LC,
+ MM_CAMERA_LIB_AEC_FORCE_GAIN,
+ MM_CAMERA_LIB_AEC_FORCE_EXP,
+ MM_CAMERA_LIB_AEC_FORCE_SNAP_LC,
+ MM_CAMERA_LIB_AEC_FORCE_SNAP_GAIN,
+ MM_CAMERA_LIB_AEC_FORCE_SNAP_EXP,
+ MM_CAMERA_LIB_WB,
+ MM_CAMERA_LIB_EXPOSURE_METERING,
+ MM_CAMERA_LIB_BRIGHTNESS,
+ MM_CAMERA_LIB_CONTRAST,
+ MM_CAMERA_LIB_SATURATION,
+ MM_CAMERA_LIB_SHARPNESS,
+ MM_CAMERA_LIB_ISO,
+ MM_CAMERA_LIB_ZOOM,
+ MM_CAMERA_LIB_BESTSHOT,
+ MM_CAMERA_LIB_FLASH,
+ MM_CAMERA_LIB_FPS_RANGE,
+ MM_CAMERA_LIB_WNR_ENABLE,
+ MM_CAMERA_LIB_SET_TINTLESS,
+} mm_camera_lib_commands;
+
+typedef struct {
+ int32_t stream_width, stream_height;
+ cam_focus_mode_type af_mode;
+} mm_camera_lib_params;
+
+typedef struct {
+ tuneserver_protocol_t *proto;
+ int clientsocket_id;
+ prserver_protocol_t *pr_proto;
+ int pr_clientsocket_id;
+ mm_camera_tuning_lib_params_t tuning_params;
+} tuningserver_t;
+
+typedef struct {
+ mm_camera_app_t app_ctx;
+ mm_camera_test_obj_t test_obj;
+ mm_camera_lib_params current_params;
+ int stream_running;
+ tuningserver_t tsctrl;
+} mm_camera_lib_ctx;
+
+typedef mm_camera_lib_ctx mm_camera_lib_handle;
+
+typedef int (*mm_app_test_t) (mm_camera_app_t *cam_apps);
+typedef struct {
+ mm_app_test_t f;
+ int r;
+} mm_app_tc_t;
+
+extern int mm_app_unit_test_entry(mm_camera_app_t *cam_app);
+extern int mm_app_dual_test_entry(mm_camera_app_t *cam_app);
+extern int setmetainfoCommand(mm_camera_test_obj_t *test_obj,
+ cam_stream_size_info_t *value);
+
+extern void mm_app_dump_frame(mm_camera_buf_def_t *frame,
+ char *name,
+ char *ext,
+ uint32_t frame_idx);
+extern void mm_app_dump_jpeg_frame(const void * data,
+ size_t size,
+ char* name,
+ char* ext,
+ uint32_t index);
+extern int mm_camera_app_timedwait(uint8_t seconds);
+extern int mm_camera_app_wait();
+extern void mm_camera_app_done();
+extern int mm_app_alloc_bufs(mm_camera_app_buf_t* app_bufs,
+ cam_frame_len_offset_t *frame_offset_info,
+ uint8_t num_bufs,
+ uint8_t is_streambuf,
+ size_t multipleOf);
+extern int mm_app_release_bufs(uint8_t num_bufs,
+ mm_camera_app_buf_t* app_bufs);
+extern int mm_app_stream_initbuf(cam_frame_len_offset_t *frame_offset_info,
+ uint8_t *num_bufs,
+ uint8_t **initial_reg_flag,
+ mm_camera_buf_def_t **bufs,
+ mm_camera_map_unmap_ops_tbl_t *ops_tbl,
+ void *user_data);
+extern int32_t mm_app_stream_deinitbuf(mm_camera_map_unmap_ops_tbl_t *ops_tbl,
+ void *user_data);
+extern int mm_app_cache_ops(mm_camera_app_meminfo_t *mem_info, int cmd);
+extern int32_t mm_app_stream_clean_invalidate_buf(uint32_t index, void *user_data);
+extern int32_t mm_app_stream_invalidate_buf(uint32_t index, void *user_data);
+extern int mm_app_open(mm_camera_app_t *cam_app,
+ int cam_id,
+ mm_camera_test_obj_t *test_obj);
+extern int mm_app_close(mm_camera_test_obj_t *test_obj);
+extern mm_camera_channel_t * mm_app_add_channel(
+ mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_type_t ch_type,
+ mm_camera_channel_attr_t *attr,
+ mm_camera_buf_notify_t channel_cb,
+ void *userdata);
+extern int mm_app_del_channel(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel);
+extern mm_camera_stream_t * mm_app_add_stream(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel);
+extern int mm_app_del_stream(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel,
+ mm_camera_stream_t *stream);
+extern int mm_app_config_stream(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel,
+ mm_camera_stream_t *stream,
+ mm_camera_stream_config_t *config);
+extern int mm_app_start_channel(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel);
+extern int mm_app_stop_channel(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel);
+extern mm_camera_channel_t *mm_app_get_channel_by_type(
+ mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_type_t ch_type);
+
+extern int mm_app_start_preview(mm_camera_test_obj_t *test_obj);
+extern int mm_app_stop_preview(mm_camera_test_obj_t *test_obj);
+extern int mm_app_start_preview_zsl(mm_camera_test_obj_t *test_obj);
+extern int mm_app_stop_preview_zsl(mm_camera_test_obj_t *test_obj);
+extern mm_camera_channel_t * mm_app_add_preview_channel(
+ mm_camera_test_obj_t *test_obj);
+extern mm_camera_stream_t * mm_app_add_raw_stream(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel,
+ mm_camera_buf_notify_t stream_cb,
+ void *userdata,
+ uint8_t num_bufs,
+ uint8_t num_burst);
+extern int mm_app_stop_and_del_channel(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel);
+extern mm_camera_channel_t * mm_app_add_snapshot_channel(
+ mm_camera_test_obj_t *test_obj);
+extern mm_camera_stream_t * mm_app_add_snapshot_stream(
+ mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel,
+ mm_camera_buf_notify_t stream_cb,
+ void *userdata,
+ uint8_t num_bufs,
+ uint8_t num_burst);
+extern mm_camera_stream_t * mm_app_add_metadata_stream(mm_camera_test_obj_t *test_obj,
+ mm_camera_channel_t *channel,
+ mm_camera_buf_notify_t stream_cb,
+ void *userdata,
+ uint8_t num_bufs);
+extern int mm_app_start_record_preview(mm_camera_test_obj_t *test_obj);
+extern int mm_app_stop_record_preview(mm_camera_test_obj_t *test_obj);
+extern int mm_app_start_record(mm_camera_test_obj_t *test_obj);
+extern int mm_app_stop_record(mm_camera_test_obj_t *test_obj);
+extern int mm_app_start_live_snapshot(mm_camera_test_obj_t *test_obj);
+extern int mm_app_stop_live_snapshot(mm_camera_test_obj_t *test_obj);
+extern int mm_app_start_capture(mm_camera_test_obj_t *test_obj,
+ uint8_t num_snapshots);
+extern int mm_app_stop_capture(mm_camera_test_obj_t *test_obj);
+extern int mm_app_start_capture_raw(mm_camera_test_obj_t *test_obj,
+ uint8_t num_snapshots);
+extern int mm_app_stop_capture_raw(mm_camera_test_obj_t *test_obj);
+extern int mm_app_start_rdi(mm_camera_test_obj_t *test_obj, uint8_t num_burst);
+extern int mm_app_stop_rdi(mm_camera_test_obj_t *test_obj);
+extern int mm_app_initialize_fb(mm_camera_test_obj_t *test_obj);
+extern int mm_app_close_fb(mm_camera_test_obj_t *test_obj);
+extern int mm_app_fb_write(mm_camera_test_obj_t *test_obj, char *buffer);
+extern int mm_app_overlay_display(mm_camera_test_obj_t *test_obj, int bufferFd);
+extern int mm_app_allocate_ion_memory(mm_camera_app_buf_t *buf, unsigned int ion_type);
+extern int mm_app_deallocate_ion_memory(mm_camera_app_buf_t *buf);
+extern int mm_app_set_params(mm_camera_test_obj_t *test_obj,
+ cam_intf_parm_type_t param_type,
+ int32_t value);
+extern int mm_app_set_preview_fps_range(mm_camera_test_obj_t *test_obj,
+ cam_fps_range_t *fpsRange);
+extern int mm_app_set_face_detection(mm_camera_test_obj_t *test_obj,
+ cam_fd_set_parm_t *fd_set_parm);
+extern int mm_app_set_metadata_usercb(mm_camera_test_obj_t *test_obj,
+ cam_stream_user_cb usercb);
+extern int mm_app_set_face_detection(mm_camera_test_obj_t *test_obj,
+ cam_fd_set_parm_t *fd_set_parm);
+extern int mm_app_set_flash_mode(mm_camera_test_obj_t *test_obj,
+ cam_flash_mode_t flashMode);
+
+/* JIG camera lib interface */
+
+int mm_camera_lib_open(mm_camera_lib_handle *handle, int cam_id);
+int mm_camera_lib_get_caps(mm_camera_lib_handle *handle,
+ cam_capability_t *caps);
+int mm_camera_lib_start_stream(mm_camera_lib_handle *handle);
+int mm_camera_lib_send_command(mm_camera_lib_handle *handle,
+ mm_camera_lib_commands cmd,
+ void *data, void *out_data);
+int mm_camera_lib_stop_stream(mm_camera_lib_handle *handle);
+int mm_camera_lib_number_of_cameras(mm_camera_lib_handle *handle);
+int mm_camera_lib_close(mm_camera_lib_handle *handle);
+int32_t mm_camera_load_tuninglibrary(
+ mm_camera_tuning_lib_params_t *tuning_param);
+int mm_camera_lib_set_preview_usercb(
+ mm_camera_lib_handle *handle, cam_stream_user_cb cb);
+//
+
+int mm_app_start_regression_test(int run_tc);
+int mm_app_load_hal(mm_camera_app_t *my_cam_app);
+
+extern int createEncodingSession(mm_camera_test_obj_t *test_obj,
+ mm_camera_stream_t *m_stream,
+ mm_camera_buf_def_t *m_frame);
+extern int encodeData(mm_camera_test_obj_t *test_obj, mm_camera_super_buf_t* recvd_frame,
+ mm_camera_stream_t *m_stream);
+extern int mm_app_take_picture(mm_camera_test_obj_t *test_obj, uint8_t);
+
+extern mm_camera_channel_t * mm_app_add_reprocess_channel(mm_camera_test_obj_t *test_obj,
+ mm_camera_stream_t *source_stream);
+extern int mm_app_start_reprocess(mm_camera_test_obj_t *test_obj);
+extern int mm_app_stop_reprocess(mm_camera_test_obj_t *test_obj);
+extern int mm_app_do_reprocess(mm_camera_test_obj_t *test_obj,
+ mm_camera_buf_def_t *frame,
+ uint32_t meta_idx,
+ mm_camera_super_buf_t *super_buf,
+ mm_camera_stream_t *src_meta);
+extern void mm_app_release_ppinput(void *data, void *user_data);
+
+extern int mm_camera_queue_init(mm_camera_queue_t *queue,
+ release_data_fn data_rel_fn,
+ void *user_data);
+extern int mm_qcamera_queue_release(mm_camera_queue_t *queue);
+extern int mm_qcamera_queue_isempty(mm_camera_queue_t *queue);
+extern int mm_qcamera_queue_enqueue(mm_camera_queue_t *queue, void *data);
+extern void* mm_qcamera_queue_dequeue(mm_camera_queue_t *queue,
+ int bFromHead);
+extern void mm_qcamera_queue_flush(mm_camera_queue_t *queue);
+
+#endif /* __MM_QCAMERA_APP_H__ */
+
+
+
+
+
+
+
+
+
diff --git a/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_commands.h b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_commands.h
new file mode 100644
index 0000000..1a7ac33
--- /dev/null
+++ b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_commands.h
@@ -0,0 +1,68 @@
+/* Copyright (c) 2013, 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __MM_QCAMERA_COMMANDS_H__
+#define __MM_QCAMERA_COMMANDS_H__
+
+// Camera dependencies
+#include "mm_qcamera_socket.h"
+#include "mm_qcamera_app.h"
+
+int tuneserver_close_cam(mm_camera_lib_handle *lib_handle);
+int tuneserver_stop_cam(mm_camera_lib_handle *lib_handle);
+int tuneserver_open_cam(mm_camera_lib_handle *lib_handle);
+
+int tuneserver_initialize_tuningp(void * ctrl, int client_socket_id,
+ char *send_buf, uint32_t send_len);
+int tuneserver_deinitialize_tuningp(void * ctrl, int client_socket_id,
+ char *send_buf, uint32_t send_len);
+int tuneserver_process_get_list_cmd(void * ctrl, void *recv_cmd,
+ char *send_buf, uint32_t send_len);
+int tuneserver_process_misc_cmd(void * ctrl, void *recv_cmd,
+ char *send_buf, uint32_t send_len);
+int tuneserver_process_get_params_cmd(void * ctrl, void *recv_cmd,
+ char *send_buf, uint32_t send_len);
+int tuneserver_process_set_params_cmd(void * ctrl, void *recv_cmd,
+ char *send_buf, uint32_t send_len);
+
+int tuneserver_initialize_prevtuningp(void * ctrl,
+ int pr_client_socket_id, cam_dimension_t dimension,
+ char **send_buf, uint32_t *send_len);
+int tuneserver_deinitialize_prevtuningp(void * ctrl,
+ char **send_buf, uint32_t *send_len);
+int tuneserver_preview_getinfo(void * ctrl,
+ char **send_buf, uint32_t *send_len);
+int tuneserver_preview_getchunksize(void * ctrl,
+ char **send_buf, uint32_t *send_len);
+int tuneserver_preview_getframe(void * ctrl,
+ char **send_buf, uint32_t *send_len);
+int tuneserver_preview_unsupported(void * ctrl,
+ char **send_buf, uint32_t *send_len);
+
+#endif /*__MM_QCAMERA_COMMANDS_H__*/
diff --git a/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_dbg.h b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_dbg.h
new file mode 100644
index 0000000..acd197e
--- /dev/null
+++ b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_dbg.h
@@ -0,0 +1,38 @@
+/* Copyright (c) 2012, 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __MM_QCAMERA_DBG_H__
+#define __MM_QCAMERA_DBG_H__
+
+#ifdef QCAMERA_REDEFINE_LOG
+#define CAM_MODULE CAM_HAL_MODULE
+#include "mm_camera_dbg.h"
+#endif
+
+#endif /* __MM_QCAMERA_DBG_H__ */
diff --git a/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_main_menu.h b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_main_menu.h
new file mode 100644
index 0000000..1b9eb4e
--- /dev/null
+++ b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_main_menu.h
@@ -0,0 +1,439 @@
+/* Copyright (c) 2013, 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __MM_QCAMERA_MAIN_MENU_H__
+#define __MM_QCAMERA_MAIN_MENU_H__
+
+// Camera dependencies
+#include "mm_camera_interface.h"
+#include "mm_jpeg_interface.h"
+
+#define VIDEO_BUFFER_SIZE (PREVIEW_WIDTH * PREVIEW_HEIGHT * 3/2)
+#define THUMBNAIL_BUFFER_SIZE (THUMBNAIL_WIDTH * THUMBNAIL_HEIGHT * 3/2)
+#define SNAPSHOT_BUFFER_SIZE (PICTURE_WIDTH * PICTURE_HEIGHT * 3/2)
+
+/*===========================================================================
+ * Macro
+ *===========================================================================*/
+#define PREVIEW_FRAMES_NUM 5
+#define VIDEO_FRAMES_NUM 5
+#define THUMBNAIL_FRAMES_NUM 1
+#define SNAPSHOT_FRAMES_NUM 1
+#define MAX_NUM_FORMAT 32
+
+typedef enum
+{
+ START_PREVIEW,
+ STOP_PREVIEW,
+ SET_WHITE_BALANCE,
+ SET_TINTLESS_ENABLE,
+ SET_TINTLESS_DISABLE,
+ SET_EXP_METERING,
+ GET_CTRL_VALUE,
+ TOGGLE_AFR,
+ SET_ISO,
+ BRIGHTNESS_GOTO_SUBMENU,
+ CONTRAST_GOTO_SUBMENU,
+ EV_GOTO_SUBMENU,
+ SATURATION_GOTO_SUBMENU,
+ SET_ZOOM,
+ SET_SHARPNESS,
+ TAKE_JPEG_SNAPSHOT,
+ START_RECORDING,
+ STOP_RECORDING,
+ BEST_SHOT,
+ LIVE_SHOT,
+ FLASH_MODES,
+ TOGGLE_ZSL,
+ TAKE_RAW_SNAPSHOT,
+ SWITCH_SNAP_RESOLUTION,
+ TOGGLE_WNR,
+ EXIT
+} Camera_main_menu_t;
+
+typedef enum
+{
+ ACTION_NO_ACTION,
+ ACTION_START_PREVIEW,
+ ACTION_STOP_PREVIEW,
+ ACTION_SET_WHITE_BALANCE,
+ ACTION_SET_TINTLESS_ENABLE,
+ ACTION_SET_TINTLESS_DISABLE,
+ ACTION_SET_EXP_METERING,
+ ACTION_GET_CTRL_VALUE,
+ ACTION_TOGGLE_AFR,
+ ACTION_SET_ISO,
+ ACTION_BRIGHTNESS_INCREASE,
+ ACTION_BRIGHTNESS_DECREASE,
+ ACTION_CONTRAST_INCREASE,
+ ACTION_CONTRAST_DECREASE,
+ ACTION_EV_INCREASE,
+ ACTION_EV_DECREASE,
+ ACTION_SATURATION_INCREASE,
+ ACTION_SATURATION_DECREASE,
+ ACTION_SET_ZOOM,
+ ACTION_SHARPNESS_INCREASE,
+ ACTION_SHARPNESS_DECREASE,
+ ACTION_TAKE_JPEG_SNAPSHOT,
+ ACTION_START_RECORDING,
+ ACTION_STOP_RECORDING,
+ ACTION_SET_BESTSHOT_MODE,
+ ACTION_TAKE_LIVE_SNAPSHOT,
+ ACTION_SET_FLASH_MODE,
+ ACTION_SWITCH_CAMERA,
+ ACTION_TOGGLE_ZSL,
+ ACTION_TAKE_RAW_SNAPSHOT,
+ ACTION_SWITCH_RESOLUTION,
+ ACTION_TOGGLE_WNR,
+ ACTION_EXIT
+} camera_action_t;
+
+#define INVALID_KEY_PRESS 0
+#define BASE_OFFSET ('Z' - 'A' + 1)
+#define BASE_OFFSET_NUM ('Z' - 'A' + 2)
+#define PAD_TO_WORD(a) (((a)+3)&~3)
+
+
+#define SQCIF_WIDTH 128
+#define SQCIF_HEIGHT 96
+#define QCIF_WIDTH 176
+#define QCIF_HEIGHT 144
+#define QVGA_WIDTH 320
+#define QVGA_HEIGHT 240
+#define HD_THUMBNAIL_WIDTH 256
+#define HD_THUMBNAIL_HEIGHT 144
+#define CIF_WIDTH 352
+#define CIF_HEIGHT 288
+#define VGA_WIDTH 640
+#define VGA_HEIGHT 480
+#define WVGA_WIDTH 800
+#define WVGA_HEIGHT 480
+#define WVGA_PLUS_WIDTH 960
+#define WVGA_PLUS_HEIGHT 720
+
+#define MP1_WIDTH 1280
+#define MP1_HEIGHT 960
+#define MP2_WIDTH 1600
+#define MP2_HEIGHT 1200
+#define MP3_WIDTH 2048
+#define MP3_HEIGHT 1536
+#define MP5_WIDTH 2592
+#define MP5_HEIGHT 1944
+#define MP8_WIDTH 3264
+#define MP8_HEIGHT 2448
+#define MP12_WIDTH 4000
+#define MP12_HEIGHT 3000
+
+#define SVGA_WIDTH 800
+#define SVGA_HEIGHT 600
+#define XGA_WIDTH 1024
+#define XGA_HEIGHT 768
+#define HD720_WIDTH 1280
+#define HD720_HEIGHT 720
+#define HD720_PLUS_WIDTH 1440
+#define HD720_PLUS_HEIGHT 1080
+#define WXGA_WIDTH 1280
+#define WXGA_HEIGHT 768
+#define HD1080_WIDTH 1920
+#define HD1080_HEIGHT 1080
+
+
+#define ONEMP_WIDTH 1280
+#define SXGA_WIDTH 1280
+#define UXGA_WIDTH 1600
+#define QXGA_WIDTH 2048
+#define FIVEMP_WIDTH 2560
+
+
+#define ONEMP_HEIGHT 960
+#define SXGA_HEIGHT 1024
+#define UXGA_HEIGHT 1200
+#define QXGA_HEIGHT 1536
+#define FIVEMP_HEIGHT 1920
+
+
+typedef enum
+{
+ RESOLUTION_MIN,
+ QCIF = RESOLUTION_MIN,
+ QVGA,
+ VGA,
+ WVGA,
+ WVGA_PLUS ,
+ HD720,
+ HD720_PLUS,
+ HD1080,
+ RESOLUTION_PREVIEW_VIDEO_MAX = HD1080,
+ WXGA,
+ MP1,
+ MP2,
+ MP3,
+ MP5,
+ MP8,
+ MP12,
+ RESOLUTION_MAX = MP12,
+} Camera_Resolution;
+
+typedef struct{
+ uint16_t width;
+ uint16_t height;
+ char * name;
+ char * str_name;
+ int supported;
+} DIMENSION_TBL_T;
+
+typedef enum {
+ WHITE_BALANCE_STATE,
+ WHITE_BALANCE_TEMPERATURE,
+ BRIGHTNESS_CTRL,
+ EV,
+ CONTRAST_CTRL,
+ SATURATION_CTRL,
+ SHARPNESS_CTRL
+} Get_Ctrl_modes;
+
+typedef enum {
+ AUTO_EXP_FRAME_AVG,
+ AUTO_EXP_CENTER_WEIGHTED,
+ AUTO_EXP_SPOT_METERING,
+ AUTO_EXP_SMART_METERING,
+ AUTO_EXP_USER_METERING,
+ AUTO_EXP_SPOT_METERING_ADV,
+ AUTO_EXP_CENTER_WEIGHTED_ADV,
+ AUTO_EXP_MAX
+} Exp_Metering_modes;
+
+typedef enum {
+ ISO_AUTO,
+ ISO_DEBLUR,
+ ISO_100,
+ ISO_200,
+ ISO_400,
+ ISO_800,
+ ISO_1600,
+ ISO_MAX
+} ISO_modes;
+
+typedef enum {
+ BESTSHOT_AUTO,
+ BESTSHOT_ACTION,
+ BESTSHOT_PORTRAIT,
+ BESTSHOT_LANDSCAPE,
+ BESTSHOT_NIGHT,
+ BESTSHOT_NIGHT_PORTRAIT,
+ BESTSHOT_THEATRE,
+ BESTSHOT_BEACH,
+ BESTSHOT_SNOW,
+ BESTSHOT_SUNSET,
+ BESTSHOT_ANTISHAKE,
+ BESTSHOT_FIREWORKS,
+ BESTSHOT_SPORTS,
+ BESTSHOT_PARTY,
+ BESTSHOT_CANDLELIGHT,
+ BESTSHOT_ASD,
+ BESTSHOT_BACKLIGHT,
+ BESTSHOT_FLOWERS,
+ BESTSHOT_AR,
+ BESTSHOT_HDR,
+ BESTSHOT_MAX
+}Bestshot_modes;
+
+typedef enum {
+ FLASH_MODE_OFF,
+ FLASH_MODE_AUTO,
+ FLASH_MODE_ON,
+ FLASH_MODE_TORCH,
+ FLASH_MODE_MAX,
+}Flash_modes;
+
+typedef enum {
+ WB_AUTO,
+ WB_INCANDESCENT,
+ WB_FLUORESCENT,
+ WB_WARM_FLUORESCENT,
+ WB_DAYLIGHT,
+ WB_CLOUDY_DAYLIGHT,
+ WB_TWILIGHT,
+ WB_SHADE,
+ WB_MAX
+} White_Balance_modes;
+
+typedef enum
+{
+ MENU_ID_MAIN,
+ MENU_ID_WHITEBALANCECHANGE,
+ MENU_ID_EXPMETERINGCHANGE,
+ MENU_ID_GET_CTRL_VALUE,
+ MENU_ID_TOGGLEAFR,
+ MENU_ID_ISOCHANGE,
+ MENU_ID_BRIGHTNESSCHANGE,
+ MENU_ID_CONTRASTCHANGE,
+ MENU_ID_EVCHANGE,
+ MENU_ID_SATURATIONCHANGE,
+ MENU_ID_ZOOMCHANGE,
+ MENU_ID_SHARPNESSCHANGE,
+ MENU_ID_BESTSHOT,
+ MENU_ID_FLASHMODE,
+ MENU_ID_SENSORS,
+ MENU_ID_SWITCH_RES,
+ MENU_ID_INVALID,
+} menu_id_change_t;
+
+typedef enum
+{
+ DECREASE_ZOOM,
+ INCREASE_ZOOM,
+ INCREASE_STEP_ZOOM,
+ DECREASE_STEP_ZOOM,
+} Camera_Zoom;
+
+typedef enum
+{
+ INC_CONTRAST,
+ DEC_CONTRAST,
+} Camera_Contrast_changes;
+
+typedef enum
+{
+ INC_BRIGHTNESS,
+ DEC_BRIGHTNESS,
+} Camera_Brightness_changes;
+
+typedef enum
+{
+ INCREASE_EV,
+ DECREASE_EV,
+} Camera_EV_changes;
+
+typedef enum {
+ INC_SATURATION,
+ DEC_SATURATION,
+} Camera_Saturation_changes;
+
+typedef enum
+{
+ INC_ISO,
+ DEC_ISO,
+} Camera_ISO_changes;
+
+typedef enum
+{
+ INC_SHARPNESS,
+ DEC_SHARPNESS,
+} Camera_Sharpness_changes;
+
+typedef enum {
+ ZOOM_IN,
+ ZOOM_OUT,
+} Zoom_direction;
+
+typedef struct{
+ Camera_main_menu_t main_menu;
+ char * menu_name;
+} CAMERA_MAIN_MENU_TBL_T;
+
+typedef struct{
+ char * menu_name;
+ int present;
+} CAMERA_SENSOR_MENU_TLB_T;
+
+typedef struct{
+ Camera_Resolution cs_id;
+ uint16_t width;
+ uint16_t height;
+ char * name;
+ char * str_name;
+} PREVIEW_DIMENSION_TBL_T;
+
+typedef struct {
+ White_Balance_modes wb_id;
+ char * wb_name;
+} WHITE_BALANCE_TBL_T;
+
+typedef struct {
+ Get_Ctrl_modes get_ctrl_id;
+ char * get_ctrl_name;
+} GET_CTRL_TBL_T;
+
+typedef struct{
+ Exp_Metering_modes exp_metering_id;
+ char * exp_metering_name;
+} EXP_METERING_TBL_T;
+
+typedef struct {
+ Bestshot_modes bs_id;
+ char *name;
+} BESTSHOT_MODE_TBT_T;
+
+typedef struct {
+ Flash_modes bs_id;
+ char *name;
+} FLASH_MODE_TBL_T;
+
+typedef struct {
+ ISO_modes iso_modes;
+ char *iso_modes_name;
+} ISO_TBL_T;
+
+typedef struct {
+ Zoom_direction zoom_direction;
+ char * zoom_direction_name;
+} ZOOM_TBL_T;
+
+typedef struct {
+ Camera_Sharpness_changes sharpness_change;
+ char *sharpness_change_name;
+} SHARPNESS_TBL_T;
+
+typedef struct {
+ Camera_Brightness_changes bc_id;
+ char * brightness_name;
+} CAMERA_BRIGHTNESS_TBL_T;
+
+typedef struct {
+ Camera_Contrast_changes cc_id;
+ char * contrast_name;
+} CAMERA_CONTRST_TBL_T;
+
+typedef struct {
+ Camera_EV_changes ec_id;
+ char * EV_name;
+} CAMERA_EV_TBL_T;
+
+typedef struct {
+ Camera_Saturation_changes sc_id;
+ char * saturation_name;
+} CAMERA_SATURATION_TBL_T;
+
+typedef struct {
+ Camera_Sharpness_changes bc_id;
+ char * sharpness_name;
+} CAMERA_SHARPNESS_TBL_T;
+
+#endif /* __MM_QCAMERA_MAIN_MENU_H__ */
diff --git a/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_socket.h b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_socket.h
new file mode 100644
index 0000000..186c109
--- /dev/null
+++ b/camera/QCamera2/stack/mm-camera-test/inc/mm_qcamera_socket.h
@@ -0,0 +1,113 @@
+/* Copyright (c) 2013-2014, 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __MM_QCAMERA_SOCKET_H__
+#define __MM_QCAMERA_SOCKET_H__
+
+// System dependencies
+#include <arpa/inet.h>
+
+#undef __FD_SET
+#define __FD_SET(fd, fdsetp) \
+ (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1LU<<((fd) & 31)))
+
+#undef __FD_CLR
+#define __FD_CLR(fd, fdsetp) \
+ (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1LU<<((fd) & 31)))
+
+#undef __FD_ISSET
+#define __FD_ISSET(fd, fdsetp) \
+ ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1LU<<((fd) & 31))) != 0)
+
+#undef __FD_ZERO
+#define __FD_ZERO(fdsetp) \
+ (memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
+
+#define TUNESERVER_MAX_RECV 2048
+#define TUNESERVER_MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#define TUNESERVER_GET_LIST 1014
+#define TUNESERVER_GET_PARMS 1015
+#define TUNESERVER_SET_PARMS 1016
+#define TUNESERVER_MISC_CMDS 1021
+
+#define TUNE_PREV_GET_INFO 0x0001
+#define TUNE_PREV_CH_CNK_SIZE 0x0002
+#define TUNE_PREV_GET_PREV_FRAME 0x0003
+#define TUNE_PREV_GET_JPG_SNAP 0x0004
+#define TUNE_PREV_GET_RAW_SNAP 0x0005
+#define TUNE_PREV_GET_RAW_PREV 0x0006
+
+typedef struct {
+ char data[128];
+} tuneserver_misc_cmd;
+
+typedef enum {
+ TUNESERVER_RECV_COMMAND = 1,
+ TUNESERVER_RECV_PAYLOAD_SIZE,
+ TUNESERVER_RECV_PAYLOAD,
+ TUNESERVER_RECV_RESPONSE,
+ TUNESERVERER_RECV_INVALID,
+} tuneserver_recv_cmd_t;
+
+typedef struct {
+ uint16_t current_cmd;
+ tuneserver_recv_cmd_t next_recv_code;
+ uint32_t next_recv_len;
+ void *recv_buf;
+ uint32_t recv_len;
+ uint32_t send_len;
+ void *send_buf;
+} tuneserver_protocol_t;
+
+typedef enum {
+ TUNE_PREV_RECV_COMMAND = 1,
+ TUNE_PREV_RECV_NEWCNKSIZE,
+ TUNE_PREV_RECV_INVALID
+} tune_prev_cmd_t;
+
+typedef struct _eztune_preview_protocol_t {
+ uint16_t current_cmd;
+ tune_prev_cmd_t next_recv_code;
+ uint32_t next_recv_len;
+ int32_t send_len;
+ char* send_buf;
+ uint32_t send_buf_size;
+ uint32_t new_cnk_size;
+ uint32_t new_cmd_available;
+} prserver_protocol_t;
+
+typedef union {
+ struct sockaddr addr;
+ struct sockaddr_in addr_in;
+} mm_qcamera_sock_addr_t;
+
+int eztune_server_start(void *lib_handle);
+
+#endif /*__MM_QCAMERA_SOCKET_H__*/