1 /* Copyright (c) 2012-2014, 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 __MM_QCAMERA_APP_H__
31 #define __MM_QCAMERA_APP_H__
32 
33 #include <pthread.h>
34 #include <errno.h>
35 #include <sys/ioctl.h>
36 #include <sys/types.h>
37 #include <sys/stat.h>
38 #include <fcntl.h>
39 #include <poll.h>
40 #include <linux/fb.h>
41 #include <linux/msm_mdp.h>
42 #include <semaphore.h>
43 
44 #include "mm_camera_interface.h"
45 #include "mm_jpeg_interface.h"
46 #include "mm_qcamera_socket.h"
47 
48 #define MM_QCAMERA_APP_INTERATION 1
49 
50 #define MM_APP_MAX_DUMP_FRAME_NUM 1000
51 
52 #define PREVIEW_BUF_NUM 7
53 #define VIDEO_BUF_NUM 7
54 #define ISP_PIX_BUF_NUM 9
55 #define STATS_BUF_NUM 4
56 #define RDI_BUF_NUM 8
57 #define CAPTURE_BUF_NUM 5
58 
59 #define DEFAULT_PREVIEW_FORMAT    CAM_FORMAT_YUV_420_NV21
60 #define DEFAULT_PREVIEW_WIDTH     640
61 #define DEFAULT_PREVIEW_HEIGHT    480
62 #define DEFAULT_PREVIEW_PADDING   CAM_PAD_TO_WORD
63 #define DEFAULT_VIDEO_FORMAT      CAM_FORMAT_YUV_420_NV12
64 #define DEFAULT_VIDEO_WIDTH       800
65 #define DEFAULT_VIDEO_HEIGHT      480
66 #define DEFAULT_VIDEO_PADDING     CAM_PAD_TO_2K
67 #define DEFAULT_SNAPSHOT_FORMAT   CAM_FORMAT_YUV_420_NV21
68 #define DEFAULT_RAW_FORMAT        CAM_FORMAT_BAYER_QCOM_RAW_10BPP_GBRG
69 
70 #define DEFAULT_SNAPSHOT_WIDTH    1024
71 #define DEFAULT_SNAPSHOT_HEIGHT   768
72 #define DEFAULT_SNAPSHOT_PADDING  CAM_PAD_TO_WORD
73 
74 #define DEFAULT_OV_FORMAT         MDP_Y_CRCB_H2V2
75 #define DEFAULT_OV_FORMAT_BPP     3/2
76 #define DEFAULT_CAMERA_FORMAT_BPP 3/2
77 #define FB_PATH                   "/dev/graphics/fb0"
78 #define BACKLIGHT_CONTROL         "/sys/class/leds/lcd-backlight/brightness"
79 #define BACKLIGHT_LEVEL           "205"
80 
81 #define ENABLE_REPROCESSING       1
82 
83 #define INVALID_KEY_PRESS 0
84 #define BASE_OFFSET  ('Z' - 'A' + 1)
85 #define BASE_OFFSET_NUM  ('Z' - 'A' + 2)
86 
87 #ifndef TRUE
88 #define TRUE 1
89 #endif
90 
91 #ifndef FALSE
92 #define FALSE 0
93 #endif
94 
95 typedef enum {
96     TUNE_CMD_INIT,
97     TUNE_CMD_GET_LIST,
98     TUNE_CMD_GET_PARAMS,
99     TUNE_CMD_SET_PARAMS,
100     TUNE_CMD_MISC,
101     TUNE_CMD_DEINIT,
102 } mm_camera_tune_cmd_t;
103 
104 typedef enum {
105     TUNE_PREVCMD_INIT,
106     TUNE_PREVCMD_SETDIM,
107     TUNE_PREVCMD_GETINFO,
108     TUNE_PREVCMD_GETCHUNKSIZE,
109     TUNE_PREVCMD_GETFRAME,
110     TUNE_PREVCMD_UNSUPPORTED,
111     TUNE_PREVCMD_DEINIT,
112 } mm_camera_tune_prevcmd_t;
113 
114 typedef void (*prev_callback) (mm_camera_buf_def_t *preview_frame);
115 
116 typedef struct {
117   char *send_buf;
118   uint32_t send_len;
119   void *next;
120 } eztune_prevcmd_rsp;
121 
122 typedef struct {
123     int (*command_process) (void *recv, mm_camera_tune_cmd_t cmd,
124       void *param, char *send_buf, uint32_t send_len);
125     int (*prevcommand_process) (void *recv, mm_camera_tune_prevcmd_t cmd,
126       void *param, char **send_buf, uint32_t *send_len);
127     void (*prevframe_callback) (mm_camera_buf_def_t *preview_frame);
128 } mm_camera_tune_func_t;
129 
130 typedef struct {
131     mm_camera_tune_func_t *func_tbl;
132     void *lib_handle;
133 }mm_camera_tuning_lib_params_t;
134 
135 typedef enum {
136     MM_CAMERA_OK,
137     MM_CAMERA_E_GENERAL,
138     MM_CAMERA_E_NO_MEMORY,
139     MM_CAMERA_E_NOT_SUPPORTED,
140     MM_CAMERA_E_INVALID_INPUT,
141     MM_CAMERA_E_INVALID_OPERATION, /* 5 */
142     MM_CAMERA_E_ENCODE,
143     MM_CAMERA_E_BUFFER_REG,
144     MM_CAMERA_E_PMEM_ALLOC,
145     MM_CAMERA_E_CAPTURE_FAILED,
146     MM_CAMERA_E_CAPTURE_TIMEOUT, /* 10 */
147 } mm_camera_status_type_t;
148 
149 typedef enum {
150     MM_CHANNEL_TYPE_ZSL,      /* preview, and snapshot main */
151     MM_CHANNEL_TYPE_CAPTURE,  /* snapshot main, and postview */
152     MM_CHANNEL_TYPE_PREVIEW,  /* preview only */
153     MM_CHANNEL_TYPE_SNAPSHOT, /* snapshot main only */
154     MM_CHANNEL_TYPE_VIDEO,    /* video only */
155     MM_CHANNEL_TYPE_RDI,      /* rdi only */
156     MM_CHANNEL_TYPE_REPROCESS,/* offline reprocess */
157     MM_CHANNEL_TYPE_MAX
158 } mm_camera_channel_type_t;
159 
160 typedef struct {
161     int                     fd;
162     int                     main_ion_fd;
163     ion_user_handle_t       handle;
164     uint32_t                size;
165     void *                  data;
166 } mm_camera_app_meminfo_t;
167 
168 typedef struct {
169     mm_camera_buf_def_t buf;
170     mm_camera_app_meminfo_t mem_info;
171 } mm_camera_app_buf_t;
172 
173 typedef struct {
174     uint32_t s_id;
175     mm_camera_stream_config_t s_config;
176     cam_frame_len_offset_t offset;
177     uint8_t num_of_bufs;
178     uint32_t multipleOf;
179     mm_camera_app_buf_t s_bufs[MM_CAMERA_MAX_NUM_FRAMES];
180     mm_camera_app_buf_t s_info_buf;
181 } mm_camera_stream_t;
182 
183 typedef struct {
184     uint32_t ch_id;
185     uint8_t num_streams;
186     mm_camera_stream_t streams[MAX_STREAM_NUM_IN_BUNDLE];
187 } mm_camera_channel_t;
188 
189 typedef void (*release_data_fn)(void* data, void *user_data);
190 
191 typedef struct {
192     struct cam_list list;
193     void* data;
194 } camera_q_node;
195 
196 typedef struct {
197     camera_q_node m_head;
198     int m_size;
199     pthread_mutex_t m_lock;
200     release_data_fn m_dataFn;
201     void * m_userData;
202 } mm_camera_queue_t;
203 
204 typedef struct {
205     uint16_t user_input_display_width;
206     uint16_t user_input_display_height;
207 } USER_INPUT_DISPLAY_T;
208 
209 typedef struct {
210     mm_camera_vtbl_t *cam;
211     uint8_t num_channels;
212     mm_camera_channel_t channels[MM_CHANNEL_TYPE_MAX];
213     mm_jpeg_ops_t jpeg_ops;
214     uint32_t jpeg_hdl;
215     mm_camera_app_buf_t cap_buf;
216     mm_camera_app_buf_t parm_buf;
217 
218     uint32_t current_jpeg_sess_id;
219     mm_camera_super_buf_t* current_job_frames;
220     uint32_t current_job_id;
221     mm_camera_app_buf_t jpeg_buf;
222 
223     int fb_fd;
224     struct fb_var_screeninfo vinfo;
225     struct mdp_overlay data_overlay;
226     uint32_t slice_size;
227     uint32_t buffer_width, buffer_height;
228     uint32_t buffer_size;
229     cam_format_t buffer_format;
230     uint32_t frame_size;
231     uint32_t frame_count;
232     int encodeJpeg;
233     int zsl_enabled;
234     int8_t focus_supported;
235     prev_callback user_preview_cb;
236     parm_buffer_t *params_buffer;
237     USER_INPUT_DISPLAY_T preview_resolution;
238 
239     //Reprocess params&stream
240     int8_t enable_reproc;
241     int32_t reproc_sharpness;
242     cam_denoise_param_t reproc_wnr;
243     int8_t enable_CAC;
244     mm_camera_queue_t pp_frames;
245     mm_camera_stream_t *reproc_stream;
246     metadata_buffer_t *metadata;
247     int8_t is_chromatix_reload;
248     tune_chromatix_t tune_data;
249 } mm_camera_test_obj_t;
250 
251 typedef struct {
252   void *ptr;
253   void* ptr_jpeg;
254 
255   uint8_t (*get_num_of_cameras) ();
256   mm_camera_vtbl_t *(*mm_camera_open) (uint8_t camera_idx);
257   uint32_t (*jpeg_open) (mm_jpeg_ops_t *ops, mm_dimension picture_size);
258 
259 } hal_interface_lib_t;
260 
261 typedef struct {
262     uint8_t num_cameras;
263     hal_interface_lib_t hal_lib;
264 } mm_camera_app_t;
265 
266 typedef struct {
267     uint32_t width;
268     uint32_t height;
269 } mm_camera_lib_snapshot_params;
270 
271 typedef enum {
272     MM_CAMERA_LIB_NO_ACTION = 0,
273     MM_CAMERA_LIB_RAW_CAPTURE,
274     MM_CAMERA_LIB_JPEG_CAPTURE,
275     MM_CAMERA_LIB_SET_FOCUS_MODE,
276     MM_CAMERA_LIB_DO_AF,
277     MM_CAMERA_LIB_CANCEL_AF,
278     MM_CAMERA_LIB_LOCK_AE,
279     MM_CAMERA_LIB_UNLOCK_AE,
280     MM_CAMERA_LIB_LOCK_AWB,
281     MM_CAMERA_LIB_UNLOCK_AWB,
282     MM_CAMERA_LIB_GET_CHROMATIX,
283     MM_CAMERA_LIB_SET_RELOAD_CHROMATIX,
284     MM_CAMERA_LIB_GET_AFTUNE,
285     MM_CAMERA_LIB_SET_RELOAD_AFTUNE,
286     MM_CAMERA_LIB_SET_AUTOFOCUS_TUNING,
287     MM_CAMERA_LIB_ZSL_ENABLE,
288     MM_CAMERA_LIB_EV,
289     MM_CAMERA_LIB_ANTIBANDING,
290     MM_CAMERA_LIB_SET_VFE_COMMAND,
291     MM_CAMERA_LIB_SET_POSTPROC_COMMAND,
292     MM_CAMERA_LIB_SET_3A_COMMAND,
293     MM_CAMERA_LIB_AEC_ENABLE,
294     MM_CAMERA_LIB_AEC_DISABLE,
295     MM_CAMERA_LIB_AF_ENABLE,
296     MM_CAMERA_LIB_AF_DISABLE,
297     MM_CAMERA_LIB_AWB_ENABLE,
298     MM_CAMERA_LIB_AWB_DISABLE,
299     MM_CAMERA_LIB_AEC_FORCE_LC,
300     MM_CAMERA_LIB_AEC_FORCE_GAIN,
301     MM_CAMERA_LIB_AEC_FORCE_EXP,
302     MM_CAMERA_LIB_AEC_FORCE_SNAP_LC,
303     MM_CAMERA_LIB_AEC_FORCE_SNAP_GAIN,
304     MM_CAMERA_LIB_AEC_FORCE_SNAP_EXP,
305     MM_CAMERA_LIB_WB,
306     MM_CAMERA_LIB_EXPOSURE_METERING,
307     MM_CAMERA_LIB_BRIGHTNESS,
308     MM_CAMERA_LIB_CONTRAST,
309     MM_CAMERA_LIB_SATURATION,
310     MM_CAMERA_LIB_SHARPNESS,
311     MM_CAMERA_LIB_ISO,
312     MM_CAMERA_LIB_ZOOM,
313     MM_CAMERA_LIB_BESTSHOT,
314     MM_CAMERA_LIB_FLASH,
315     MM_CAMERA_LIB_FPS_RANGE,
316     MM_CAMERA_LIB_WNR_ENABLE,
317     MM_CAMERA_LIB_SET_TINTLESS,
318 } mm_camera_lib_commands;
319 
320 typedef struct {
321     int32_t stream_width, stream_height;
322     cam_focus_mode_type af_mode;
323 } mm_camera_lib_params;
324 
325 typedef struct {
326   tuneserver_protocol_t *proto;
327   int clientsocket_id;
328   prserver_protocol_t *pr_proto;
329   int pr_clientsocket_id;
330   mm_camera_tuning_lib_params_t tuning_params;
331 } tuningserver_t;
332 
333 typedef struct {
334     mm_camera_app_t app_ctx;
335     mm_camera_test_obj_t test_obj;
336     mm_camera_lib_params current_params;
337     int stream_running;
338     tuningserver_t tsctrl;
339 } mm_camera_lib_ctx;
340 
341 typedef mm_camera_lib_ctx mm_camera_lib_handle;
342 
343 typedef int (*mm_app_test_t) (mm_camera_app_t *cam_apps);
344 typedef struct {
345     mm_app_test_t f;
346     int r;
347 } mm_app_tc_t;
348 
349 extern int mm_app_unit_test_entry(mm_camera_app_t *cam_app);
350 extern int mm_app_dual_test_entry(mm_camera_app_t *cam_app);
351 extern void mm_app_dump_frame(mm_camera_buf_def_t *frame,
352                               char *name,
353                               char *ext,
354                               int frame_idx);
355 extern void mm_app_dump_jpeg_frame(const void * data,
356                                    uint32_t size,
357                                    char* name,
358                                    char* ext,
359                                    int index);
360 extern int mm_camera_app_timedwait(uint8_t seconds);
361 extern int mm_camera_app_wait();
362 extern void mm_camera_app_done();
363 extern int mm_app_alloc_bufs(mm_camera_app_buf_t* app_bufs,
364                              cam_frame_len_offset_t *frame_offset_info,
365                              uint8_t num_bufs,
366                              uint8_t is_streambuf,
367                              size_t multipleOf);
368 extern int mm_app_release_bufs(uint8_t num_bufs,
369                                mm_camera_app_buf_t* app_bufs);
370 extern int mm_app_stream_initbuf(cam_frame_len_offset_t *frame_offset_info,
371                                  uint8_t *num_bufs,
372                                  uint8_t **initial_reg_flag,
373                                  mm_camera_buf_def_t **bufs,
374                                  mm_camera_map_unmap_ops_tbl_t *ops_tbl,
375                                  void *user_data);
376 extern int32_t mm_app_stream_deinitbuf(mm_camera_map_unmap_ops_tbl_t *ops_tbl,
377                                        void *user_data);
378 extern int mm_app_cache_ops(mm_camera_app_meminfo_t *mem_info,
379                             unsigned int cmd);
380 extern int32_t mm_app_stream_clean_invalidate_buf(int index, void *user_data);
381 extern int32_t mm_app_stream_invalidate_buf(int index, void *user_data);
382 extern int mm_app_open(mm_camera_app_t *cam_app,
383                        uint8_t cam_id,
384                        mm_camera_test_obj_t *test_obj);
385 extern int mm_app_close(mm_camera_test_obj_t *test_obj);
386 extern mm_camera_channel_t * mm_app_add_channel(
387                                          mm_camera_test_obj_t *test_obj,
388                                          mm_camera_channel_type_t ch_type,
389                                          mm_camera_channel_attr_t *attr,
390                                          mm_camera_buf_notify_t channel_cb,
391                                          void *userdata);
392 extern int mm_app_del_channel(mm_camera_test_obj_t *test_obj,
393                               mm_camera_channel_t *channel);
394 extern mm_camera_stream_t * mm_app_add_stream(mm_camera_test_obj_t *test_obj,
395                                               mm_camera_channel_t *channel);
396 extern int mm_app_del_stream(mm_camera_test_obj_t *test_obj,
397                              mm_camera_channel_t *channel,
398                              mm_camera_stream_t *stream);
399 extern int mm_app_config_stream(mm_camera_test_obj_t *test_obj,
400                                 mm_camera_channel_t *channel,
401                                 mm_camera_stream_t *stream,
402                                 mm_camera_stream_config_t *config);
403 extern int mm_app_start_channel(mm_camera_test_obj_t *test_obj,
404                                 mm_camera_channel_t *channel);
405 extern int mm_app_stop_channel(mm_camera_test_obj_t *test_obj,
406                                mm_camera_channel_t *channel);
407 extern mm_camera_channel_t *mm_app_get_channel_by_type(
408                                     mm_camera_test_obj_t *test_obj,
409                                     mm_camera_channel_type_t ch_type);
410 
411 extern int mm_app_start_preview(mm_camera_test_obj_t *test_obj);
412 extern int mm_app_stop_preview(mm_camera_test_obj_t *test_obj);
413 extern int mm_app_start_preview_zsl(mm_camera_test_obj_t *test_obj);
414 extern int mm_app_stop_preview_zsl(mm_camera_test_obj_t *test_obj);
415 extern mm_camera_channel_t * mm_app_add_preview_channel(
416                                 mm_camera_test_obj_t *test_obj);
417 extern mm_camera_stream_t * mm_app_add_raw_stream(mm_camera_test_obj_t *test_obj,
418                                                 mm_camera_channel_t *channel,
419                                                 mm_camera_buf_notify_t stream_cb,
420                                                 void *userdata,
421                                                 uint8_t num_bufs,
422                                                 uint8_t num_burst);
423 extern int mm_app_stop_and_del_channel(mm_camera_test_obj_t *test_obj,
424                                        mm_camera_channel_t *channel);
425 extern mm_camera_channel_t * mm_app_add_snapshot_channel(
426                                                mm_camera_test_obj_t *test_obj);
427 extern mm_camera_stream_t * mm_app_add_snapshot_stream(
428                                                 mm_camera_test_obj_t *test_obj,
429                                                 mm_camera_channel_t *channel,
430                                                 mm_camera_buf_notify_t stream_cb,
431                                                 void *userdata,
432                                                 uint8_t num_bufs,
433                                                 uint8_t num_burst);
434 extern mm_camera_stream_t * mm_app_add_metadata_stream(mm_camera_test_obj_t *test_obj,
435                                                mm_camera_channel_t *channel,
436                                                mm_camera_buf_notify_t stream_cb,
437                                                void *userdata,
438                                                uint8_t num_bufs);
439 extern int mm_app_start_record_preview(mm_camera_test_obj_t *test_obj);
440 extern int mm_app_stop_record_preview(mm_camera_test_obj_t *test_obj);
441 extern int mm_app_start_record(mm_camera_test_obj_t *test_obj);
442 extern int mm_app_stop_record(mm_camera_test_obj_t *test_obj);
443 extern int mm_app_start_live_snapshot(mm_camera_test_obj_t *test_obj);
444 extern int mm_app_stop_live_snapshot(mm_camera_test_obj_t *test_obj);
445 extern int mm_app_start_capture(mm_camera_test_obj_t *test_obj,
446                                 uint8_t num_snapshots);
447 extern int mm_app_stop_capture(mm_camera_test_obj_t *test_obj);
448 extern int mm_app_start_capture_raw(mm_camera_test_obj_t *test_obj, uint8_t num_snapshots);
449 extern int mm_app_stop_capture_raw(mm_camera_test_obj_t *test_obj);
450 extern int mm_app_start_rdi(mm_camera_test_obj_t *test_obj, uint8_t num_burst);
451 extern int mm_app_stop_rdi(mm_camera_test_obj_t *test_obj);
452 extern int mm_app_initialize_fb(mm_camera_test_obj_t *test_obj);
453 extern int mm_app_close_fb(mm_camera_test_obj_t *test_obj);
454 extern int mm_app_fb_write(mm_camera_test_obj_t *test_obj, char *buffer);
455 extern int mm_app_overlay_display(mm_camera_test_obj_t *test_obj, int bufferFd);
456 extern int mm_app_allocate_ion_memory(mm_camera_app_buf_t *buf, int ion_type);
457 extern int mm_app_deallocate_ion_memory(mm_camera_app_buf_t *buf);
458 int mm_app_set_params(mm_camera_test_obj_t *test_obj,
459                       cam_intf_parm_type_t param_type,
460                       int32_t value);
461 /* JIG camera lib interface */
462 
463 int mm_camera_lib_open(mm_camera_lib_handle *handle, int cam_id);
464 int mm_camera_lib_get_caps(mm_camera_lib_handle *handle,
465                            cam_capability_t *caps);
466 int mm_camera_lib_start_stream(mm_camera_lib_handle *handle);
467 int mm_camera_lib_send_command(mm_camera_lib_handle *handle,
468                                mm_camera_lib_commands cmd,
469                                void *data, void *out_data);
470 int mm_camera_lib_stop_stream(mm_camera_lib_handle *handle);
471 int mm_camera_lib_number_of_cameras(mm_camera_lib_handle *handle);
472 int mm_camera_lib_close(mm_camera_lib_handle *handle);
473 int32_t mm_camera_load_tuninglibrary(
474   mm_camera_tuning_lib_params_t *tuning_param);
475 int mm_camera_lib_set_preview_usercb(
476   mm_camera_lib_handle *handle, prev_callback cb);
477 //
478 
479 int mm_app_start_regression_test(int run_tc);
480 int mm_app_load_hal(mm_camera_app_t *my_cam_app);
481 
482 extern int createEncodingSession(mm_camera_test_obj_t *test_obj,
483                           mm_camera_stream_t *m_stream,
484                           mm_camera_buf_def_t *m_frame);
485 extern int encodeData(mm_camera_test_obj_t *test_obj, mm_camera_super_buf_t* recvd_frame,
486                mm_camera_stream_t *m_stream);
487 extern int mm_app_take_picture(mm_camera_test_obj_t *test_obj, uint8_t);
488 
489 extern mm_camera_channel_t * mm_app_add_reprocess_channel(mm_camera_test_obj_t *test_obj,
490                                                    mm_camera_stream_t *source_stream);
491 extern int mm_app_start_reprocess(mm_camera_test_obj_t *test_obj);
492 extern int mm_app_stop_reprocess(mm_camera_test_obj_t *test_obj);
493 extern int mm_app_do_reprocess(mm_camera_test_obj_t *test_obj,
494         mm_camera_buf_def_t *frame,
495         uint8_t meta_idx,
496         mm_camera_super_buf_t *super_buf,
497         mm_camera_stream_t *src_meta);
498 extern void mm_app_release_ppinput(void *data, void *user_data);
499 
500 extern int mm_camera_queue_init(mm_camera_queue_t *queue,
501                          release_data_fn data_rel_fn,
502                          void *user_data);
503 extern int mm_qcamera_queue_release(mm_camera_queue_t *queue);
504 extern int mm_qcamera_queue_isempty(mm_camera_queue_t *queue);
505 extern int mm_qcamera_queue_enqueue(mm_camera_queue_t *queue, void *data);
506 extern void* mm_qcamera_queue_dequeue(mm_camera_queue_t *queue,
507                                       int bFromHead);
508 extern void mm_qcamera_queue_flush(mm_camera_queue_t *queue);
509 
510 #endif /* __MM_QCAMERA_APP_H__ */
511 
512 
513 
514 
515 
516 
517 
518 
519 
520