a6349c336408f2908e57f40c05510b6516968920
[adaptation/intel_mfld/gst-plugins-atomisp.git] / gst-libs / atomisphal / gstv4l2mfldadvci.c
1 /* GStreamer MFLD ADVIC API
2  * Copyright (C) 2010 Intel Corporation <www.intel.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include "gstv4l2mfldadvci.h"
21 #include <linux/videodev2.h>
22 #include <math.h>
23 #include <sys/ioctl.h>
24 #include <gst/gst.h>
25 #include "ci_adv_pub.h"
26
27 void cam_lib_3a_dbg(const char *format, ...);
28
29 int __android_log_print(int prio, const char *tag, const char *fmt, ...)
30 {
31  return 0;
32 }
33
34 /* for debug message and error message output
35  *
36  */
37 static bool use_3A_debug = FALSE;
38
39 void
40 cam_lib_3a_dbg (const char *format, ...)
41 {
42   va_list ap;
43   if (use_3A_debug) {
44     va_start (ap, format);
45     vfprintf (stdout, format, ap);
46     va_end (ap);
47   }
48 }
49
50
51 static void
52 lib_3a_void (void)
53 {
54   return;
55 }
56
57 static void
58 lib_3a_int (int a)
59 {
60   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
61   return;
62 }
63
64 static int
65 lib_3a_int_void (void)
66 {
67   return 0;
68 }
69
70 static void
71 lib_3a_ae (void)
72 {
73   return;
74 }
75
76 static void
77 lib_3a_init(void)
78 {
79   const char *env;
80   use_3A_debug= ((env = getenv ("LIBMFLDCAM_DEBUG")) && strstr (env, "verbose"));
81   cam_lib_3a_dbg("%s:%d", __func__, __LINE__);
82 }
83
84 static void
85 lib_3a_uninit(void)
86 {
87   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
88   ci_adv_uninit();
89 }
90
91 static void
92 lib_3a_dis_process (struct atomisp_dis_statistics *stats,
93                      struct atomisp_dis_vector *motion_vector)
94 {
95   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
96   return;
97 }
98
99 static void
100 lib_3a_dis_calc_still (struct atomisp_dis_vector * vector, int frame_number)
101 {
102   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
103   return;
104 }
105
106 static void
107 lib_3a_do_redeye_removal (ia_frame *ia_frame)
108 {
109   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
110 }
111
112 static void
113 lib_3a_still_compose (ia_frame *com_buf,
114                      ia_frame bufs[],
115                      int frame_dis,
116                      struct atomisp_dis_vector vectors[])
117 {
118   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
119   return;
120 }
121
122 static void
123 lib_3a_AeSetFlickerMode(ia_3a_ae_flicker_mode mode)
124 {
125   cam_lib_3a_dbg("%s:%d mode:%d\n", __func__, __LINE__,mode);
126   ci_adv_ae_set_flicker_mode(mode);
127 }
128
129 static void
130 lib_3a_AeGetFlickerMode(ia_3a_ae_flicker_mode *mode)
131 {
132   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
133   *mode= ia_3a_ae_get_flicker_mode();
134 }
135
136 static void
137 lib_3a_AeSetExposureProgram(ia_3a_ae_exposure_program program)
138 {
139   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
140   ci_adv_ae_set_exposure_program(program);
141 }
142
143 static void
144 lib_3a_AeGetExposureProgram(ia_3a_ae_exposure_program *program)
145 {
146   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
147   ci_adv_ae_get_exposure_program(program);
148 }
149
150 static void
151 lib_3a_AfSetMode(ia_3a_af_mode mode)
152 {
153   cam_lib_3a_dbg("%s:%d mode:%d\n", __func__, __LINE__,mode);
154   ci_adv_af_set_mode(mode);
155 }
156
157 static void
158 lib_3a_AfGetMode(ia_3a_af_mode *mode)
159 {
160   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
161   *mode = ia_3a_af_get_focus_mode();
162 }
163
164 static void
165 lib_3a_AfSetRange(ia_3a_af_range range)
166 {
167   cam_lib_3a_dbg ("%s:%d\n", __func__, __LINE__);
168   ci_adv_af_set_range(range);
169 }
170
171 static void
172 lib_3a_AfGetRange(ia_3a_af_range *range)
173 {
174   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
175   *range = ia_3a_af_get_focus_range();
176 }
177
178 static void
179 lib_3a_AwbSetMode(ia_3a_awb_mode mode)
180 {
181   cam_lib_3a_dbg("%s:%d mode:%d\n" , __func__, __LINE__,mode);
182   ci_adv_awb_set_mode(mode);
183 }
184
185 static void
186 lib_3a_AwbGetMode(ia_3a_awb_mode *mode)
187 {
188   *mode = ia_3a_awb_get_mode();
189 }
190
191 static void
192 lib_3a_AwbSetLightSource(ia_3a_awb_light_source ls)
193 {
194   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
195   ci_adv_awb_set_light_source(ls);
196 }
197
198 static void
199 lib_3a_AwbGetLightSource(ia_3a_awb_light_source *ls)
200 {
201   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
202   *ls = ia_3a_awb_get_light_source();
203 }
204
205 static ci_adv_Err
206 lib_3a_int_int (int i)
207 {
208   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
209   return ci_adv_Success;
210 }
211
212 static ci_adv_Err
213 lib_3a_intp (int *p)
214 {
215   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
216   return ci_adv_Success;
217 }
218
219 static int
220 lib_3a_isp_set_fd (int fd, const char *sensor_id)
221 {
222   int sensor_type;
223   ia_3a_window window;
224
225   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
226   if (ci_adv_init(sensor_id, fd, NULL) == 0) {
227     sensor_type = SENSOR_TYPE_RAW;
228   } else {
229     sensor_type = SENSOR_TYPE_SOC;
230  }
231
232   if (sensor_type == SENSOR_TYPE_RAW) {
233     cam_lib_3a_dbg("SENSOR_TYPE_RAW");
234     ci_adv_awb_enable(TRUE);
235     ci_adv_awb_lock(FALSE);
236
237     ci_adv_ae_enable(TRUE);
238     ci_adv_ae_lock(FALSE);
239
240     ci_adv_af_enable(TRUE);
241     ci_adv_af_lock(FALSE);
242
243     window.x_left = 0;
244     window.x_right = 0,
245     window.y_top = 0;
246     window.y_bottom = 0;
247     window.weight = 0;
248
249     ci_adv_ae_set_window(&window);
250
251     ci_adv_ae_set_exposure_program(ia_3a_ae_exposure_program_auto);
252     ci_adv_ae_set_mode(ia_3a_ae_mode_auto);
253     ci_adv_ae_set_metering_mode(ia_3a_ae_metering_mode_center);
254     ci_adv_af_set_range (ia_3a_af_range_full);
255     ci_adv_awb_set_mode(ia_3a_awb_mode_auto);
256     ci_adv_af_set_mode(ia_3a_af_mode_auto);
257     ci_adv_af_set_metering_mode (ia_3a_af_metering_mode_auto);
258
259   }
260
261   return sensor_type;
262 }
263
264 static void
265 lib_3a_switch_mode (ia_3a_isp_mode mode, float frame_rate)
266 {
267   cam_lib_3a_dbg("%s:%d mode:%d frame_rate:%f\n", __func__, __LINE__, mode,frame_rate);
268   ci_adv_configure(mode, frame_rate);
269 }
270
271 static ci_adv_Err lib_3a_AeGetWindowsNum(int *num)
272 {
273   cam_lib_3a_dbg ("%s:%d\n", __func__, __LINE__);
274   return ci_adv_Success;
275 }
276
277 static void lib_3a_AwbVersion(int * major, int * minor)
278 {
279   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
280   ci_adv_awb_version(major,minor);
281 }
282
283 static void lib_3a_AeVersion(int * major, int * minor)
284 {
285   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
286   ci_adv_ae_version(major,minor);
287 }
288
289 static void lib_3a_AfVersion(int * major, int * minor)
290 {
291   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
292   ci_adv_af_version(major,minor);
293 }
294
295 static void lib_3a_AfGetStillAfStatus(ia_3a_af_status *status)
296 {
297   *status = ci_adv_af_get_status();
298 }
299
300 static bool lib_3a_af_is_complete(void)
301 {
302
303   ia_3a_af_status status;
304   bool completed = FALSE;
305
306   lib_3a_AfGetStillAfStatus(&status);
307
308   if (status == ia_3a_af_status_error) {
309     cam_lib_3a_dbg("==== still AF failed \n");
310     completed = TRUE;
311   }
312    else if (status == ia_3a_af_status_success) {
313     cam_lib_3a_dbg("==== still AF success");
314     completed = TRUE;
315   } else if (status == ia_3a_af_status_cancelled) {
316     cam_lib_3a_dbg("==== still AF cancelled \n");
317     completed = TRUE;
318   }
319   else {
320     cam_lib_3a_dbg("==== still AF continue %d \n", status);
321   }
322
323   return completed;
324 }
325
326 static void lib_3a_RerVersion(int * major, int * minor)
327 {
328   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
329   return;
330 }
331
332 static ci_adv_Err lib_3a_AeGetManualShutter(int *time)
333 {
334   /* TODO time is float */
335   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
336   ci_adv_ae_set_manual_shutter((float)*time);
337   return ci_adv_Success;
338 }
339
340 static void lib_3a_Awbdata(unsigned * num_p, unsigned * avg_r, unsigned * avg_gr,
341         unsigned * avg_b, unsigned * avg_gb)
342 {
343   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
344   return;
345 }
346
347 static void lib_3a_AeGetManualAperture(int *aperture)
348 {
349   // TODO returns float
350   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
351   *aperture = (int)ia_3a_ae_get_manual_aperture();
352 }
353
354 static void lib_3a_AeGetFlashMode(ia_3a_ae_flash_mode *mode)
355 {
356   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
357   *mode= ia_3a_ae_get_flash_mode();
358 }
359
360 static void lib_3a_AeSetFlashMode(ia_3a_ae_flash_mode mode)
361 {
362   cam_lib_3a_dbg("%s:%d mode:%d \n", __func__, __LINE__, mode);
363   ci_adv_ae_set_flash_mode(mode);
364 }
365
366 static void lib_3a_AwbGetManualColorTemperature(int *ctemp)
367 {
368   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
369   *ctemp = ia_3a_awb_get_manual_color_temperature();
370 }
371
372 static void
373 lib_3a_Awbmatrix(int msqWbGain[3], int msqCcMtrx[9], unsigned short * shift)
374 {
375   cam_lib_3a_dbg ("%s:%d\n", __func__, __LINE__);
376 }
377
378 static void lib_3a_GetGridInfo(void * grid_info)
379 {
380   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
381 }
382
383 static void
384 lib_3a_AeSetMeteringMode(ia_3a_ae_metering_mode mode)
385 {
386   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
387   ci_adv_ae_set_metering_mode(mode);
388 }
389
390 static void
391 lib_3a_AeGetMeteringMode(ia_3a_ae_metering_mode *mode)
392 {
393   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
394   *mode = ia_3a_ae_get_metering_mode();
395 }
396
397 static void
398 lib_3a_AfSetMeteringMode(ia_3a_af_metering_mode mode)
399 {
400   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
401   ci_adv_af_set_metering_mode(mode);
402 }
403
404 static void
405 lib_3a_AfGetMeteringMode(ia_3a_af_metering_mode *mode)
406 {
407   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
408   ci_adv_af_get_metering_mode(mode);
409 }
410
411 static void
412 lib_3a_Ae_Af_GetWindow(ia_3a_window *window)
413 {
414   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
415   ia_3a_ae_get_window(window);
416 }
417
418 static void
419 lib_3a_Ae_Af_SetWindow( ia_3a_window *window)
420 {
421   cam_lib_3a_dbg("%s:window....%d:%d:%d:%d:%d\n",
422       __func__, window->x_left,window->x_right,
423       window->y_top , window->y_bottom, window->weight);
424
425   ci_adv_ae_set_window(window);
426   ci_adv_af_set_windows(1, window);
427 }
428
429 static void
430 lib_3a_af_start( )
431 {
432   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
433   ci_adv_af_start();
434 }
435
436 static void
437 lib_3a_af_stop( )
438 {
439   cam_lib_3a_dbg ("%s:%d\n", __func__, __LINE__);
440   ci_adv_af_stop();
441 }
442
443 static void
444 lib_3a_ae_calc_for_flash( )
445 {
446   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
447   ci_adv_process_for_flash(ia_3a_flash_stage_none);
448 }
449 static void
450 lib_3a_calc_without_flash( )
451 {
452   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
453   ci_adv_process_for_flash(ia_3a_flash_stage_pre);
454 }
455
456 static void
457 lib_3a_calc_with_flash( )
458 {
459   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
460   ci_adv_process_for_flash(ia_3a_flash_stage_main);
461 }
462
463 static void
464 lib_3a_AeAfAwb_process( struct timeval *frame_timestamp)
465 {
466   int status;
467   //cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
468   status =  ci_adv_process_frame(TRUE,frame_timestamp);
469 }
470 static void
471 lib_3a_get_statistics( )
472 {
473  // cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
474   ci_adv_3a_stat cur_stat;
475   ci_adv_get_3a_stat (&cur_stat);
476  /* cam_lib_3a_dbg("%8.3f, %8.3f, %8.3f, %8.3f, %8d, %8.3f, %8.3f, %8.3f\n",
477                 cur_stat.bv,
478                 cur_stat.tv,
479                 cur_stat.sv,
480                 cur_stat.av,
481                 cur_stat.focus_pos,
482                 cur_stat.wb_gain_r,
483                 cur_stat.wb_gain_g,
484                 cur_stat.wb_gain_b);
485 */
486 }
487
488 static void
489 lib_3a_awb_apply_results( )
490 {
491 }
492 static void
493 lib_3a_AwbSetImageEffect(ia_3a_image_effect effect)
494 {
495   cam_lib_3a_dbg("%s:%d effect %d\n", __func__, __LINE__, effect);
496
497   ci_adv_isp_set_image_effect(effect);
498 }
499
500 static void
501 lib_3a_AwbGetImageEffect(ia_3a_image_effect *effect)
502 {
503   *effect = ci_adv_isp_get_image_effect();
504   cam_lib_3a_dbg("%s:%d effect: %d\n", __func__, __LINE__, *effect);
505
506 }
507
508 static void
509 lib_ae_is_flash_needed(bool *useflash)
510 {
511   ci_adv_ae_is_flash_necessary(useflash);
512   cam_lib_3a_dbg("%s:%d useflash: %d\n", __func__, __LINE__, *useflash);
513
514 }
515
516 static ci_adv_Err
517 lib_3a_AeSetManualIso(int sensitivity)
518 {
519         float sv;
520         if (sensitivity <=0)
521         {
522                 cam_lib_3a_dbg("error in get log2 math computation in line %d; sensitivity: %d\n", __LINE__, sensitivity);
523                 return ci_adv_InvalidArgument;
524         }
525
526         sv = log10((float)sensitivity / 3.125) / log10(2.0);
527         ci_adv_err ret = ci_adv_ae_set_manual_iso(sv);
528         if(ci_adv_success != ret)
529                 return ret;
530
531         cam_lib_3a_dbg(" *** manual set iso in EV: %f\n", sv);
532
533         return ci_adv_success;
534 }
535
536 static ci_adv_Err
537 lib_3a_AeGetManualIso(int *sensitivity)
538 {
539         float sv;
540         ci_adv_err ret = ci_adv_ae_get_manual_iso(&sv);
541         if(ci_adv_success != ret)
542                 return ret;
543         *sensitivity = (int)(3.125 * pow(2, sv));
544
545         return ci_adv_success;
546 }
547
548 static void
549 lib_3a_GetMakerNote(ia_3a_mknote_mode mknMode, ia_3a_mknote *note)
550 {
551     note = ci_adv_get_maker_note(mknMode);
552 }
553
554 static void
555 lib_3a_AddMakerNoteRecord(ia_3a_mknote_field_type mkn_format_id,
556                                    ia_3a_mknote_field_name mkn_name_id,
557                                    const void *record,
558                                    unsigned short record_size)
559 {
560   ci_adv_add_maker_note_record(mkn_format_id, mkn_name_id, record, record_size);
561 }
562
563 static void
564 lib_3a_PutMakerNote(ia_3a_mknote *mknData)
565 {
566     if (mknData != NULL)
567     {
568         ci_adv_put_maker_note(mknData);
569     }
570 }
571
572 static void
573 lib_3a_ResetMakerNote(void)
574 {
575     ci_adv_reset_maker_note();
576 }
577
578
579 void
580 lib_3a_link_functions_init (GstV4l2MFLDAdvCI *mfldadvci)
581 {
582
583   mfldadvci->initialized = 0;
584   mfldadvci->init = lib_3a_init;
585   mfldadvci->uninit = lib_3a_uninit;
586   mfldadvci->isp_set_fd = lib_3a_isp_set_fd;
587   mfldadvci->mode_spec_init = lib_3a_int_void; /* TODO */
588   mfldadvci->switch_mode = lib_3a_switch_mode;
589
590   mfldadvci->AeAfAwb_process = lib_3a_AeAfAwb_process;
591   mfldadvci->get_statistics = lib_3a_get_statistics; /* TODO atomisp_dis_statistics  ? */
592
593   mfldadvci->ae_calc_for_flash = lib_3a_ae_calc_for_flash;
594   mfldadvci->ae_calc_without_flash = lib_3a_calc_without_flash;
595   mfldadvci->ae_calc_with_flash = lib_3a_calc_with_flash;
596
597   mfldadvci->ae_is_flash_needed = lib_ae_is_flash_needed;
598
599   mfldadvci->ae_apply_results = lib_3a_ae;
600
601   mfldadvci->af_start = lib_3a_af_start;
602   mfldadvci->af_stop = lib_3a_af_stop;
603   mfldadvci->af_is_complete = lib_3a_af_is_complete;
604   mfldadvci->awb_apply_results = lib_3a_awb_apply_results;
605   mfldadvci->awb_calc_flash = lib_3a_void;
606
607   mfldadvci->dis_read_statistics = lib_3a_void;
608   mfldadvci->update_dis_results = lib_3a_void;
609   mfldadvci->dis_process = lib_3a_dis_process;
610   mfldadvci->dis_calc_still = lib_3a_dis_calc_still;
611
612   mfldadvci->do_redeye_removal = lib_3a_do_redeye_removal;
613   mfldadvci->still_compose = lib_3a_still_compose;
614   mfldadvci->load_gdc_table = lib_3a_void;
615
616   mfldadvci->AeSetBias = lib_3a_int_int;
617   mfldadvci->AeGetBias = lib_3a_intp;
618   mfldadvci->AeSetFlickerMode = lib_3a_AeSetFlickerMode;
619   mfldadvci->AeGetFlickerMode = lib_3a_AeGetFlickerMode;
620   mfldadvci->AeSetExposureProgram = lib_3a_AeSetExposureProgram;
621   mfldadvci->AeGetExposureProgram = lib_3a_AeGetExposureProgram;
622   mfldadvci->AeSetMeteringMode = lib_3a_AeSetMeteringMode;
623   mfldadvci->AeGetMeteringMode = lib_3a_AeGetMeteringMode;
624   mfldadvci->AeGetWindow = lib_3a_Ae_Af_GetWindow;
625   mfldadvci->AeSetWindow = lib_3a_Ae_Af_SetWindow;
626   mfldadvci->AeSetIso = lib_3a_AeSetManualIso;
627   mfldadvci->AeGetIso = lib_3a_AeGetManualIso;
628
629
630   mfldadvci->AfSetMode = lib_3a_AfSetMode;
631   mfldadvci->AfGetMode = lib_3a_AfGetMode;
632   mfldadvci->AfSetRange = lib_3a_AfSetRange;
633   mfldadvci->AfGetRange = lib_3a_AfGetRange;
634   mfldadvci->AfSetMeteringMode = lib_3a_AfSetMeteringMode;
635   mfldadvci->AfGetMeteringMode = lib_3a_AfGetMeteringMode;
636   mfldadvci->AfGetWindow = lib_3a_Ae_Af_GetWindow;
637   mfldadvci->AfSetWindow = lib_3a_Ae_Af_SetWindow;
638
639   mfldadvci->AwbSetMode = lib_3a_AwbSetMode;
640   mfldadvci->AwbGetMode = lib_3a_AwbGetMode;
641   mfldadvci->AwbSetLightSource = lib_3a_AwbSetLightSource;
642   mfldadvci->AwbGetLightSource = lib_3a_AwbGetLightSource;
643   mfldadvci->AwbSetImageEffect = lib_3a_AwbSetImageEffect;
644   mfldadvci->AwbGetImageEffect = lib_3a_AwbGetImageEffect;
645
646   mfldadvci->AeGetWindowsNum = lib_3a_AeGetWindowsNum;
647   mfldadvci->AwbVersion = lib_3a_AwbVersion;
648   mfldadvci->AeVersion = lib_3a_AeVersion;
649   mfldadvci->AfVersion = lib_3a_AfVersion;
650   mfldadvci->AfGetStillAfStatus = lib_3a_AfGetStillAfStatus;
651   mfldadvci->RerVersion = lib_3a_RerVersion;
652   mfldadvci->AeGetManualShutter = lib_3a_AeGetManualShutter;
653   mfldadvci->Awbdata = lib_3a_Awbdata;
654   mfldadvci->AeGetManualAperture = lib_3a_AeGetManualAperture;
655   mfldadvci->AeSetFlashMode = lib_3a_AeSetFlashMode;
656   mfldadvci->AeGetFlashMode = lib_3a_AeGetFlashMode;
657   mfldadvci->AwbGetManualColorTemperature = lib_3a_AwbGetManualColorTemperature;
658   mfldadvci->Awbmatrix = lib_3a_Awbmatrix;
659   mfldadvci->GetGridInfo = lib_3a_GetGridInfo;
660   mfldadvci->GetMakerNote  = lib_3a_GetMakerNote;
661   mfldadvci->AddMakerNoteRecord = lib_3a_AddMakerNoteRecord;
662   mfldadvci->PutMakerNote = lib_3a_PutMakerNote;
663   mfldadvci->ResetMakerNote = lib_3a_ResetMakerNote;
664 }