2b510688e365bba731f4372239f8562084519567
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_configure.c
1 /*
2  * libmm-camcorder
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jeongmo Yang <jm80.yang@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 /*=======================================================================================
23 |  INCLUDE FILES                                                                        |
24 =======================================================================================*/
25 #include <stdio.h>
26 #include <string.h>
27 #include <stdlib.h>
28 #include <unistd.h>
29
30 #include "mm_camcorder_internal.h"
31 #include "mm_camcorder_configure.h"
32
33 /*-----------------------------------------------------------------------
34 |    MACRO DEFINITIONS:                                                 |
35 -----------------------------------------------------------------------*/
36
37 /*-----------------------------------------------------------------------
38 |    GLOBAL VARIABLE DEFINITIONS                                        |
39 -----------------------------------------------------------------------*/
40
41 /*-----------------------------------------------------------------------
42 |    LOCAL VARIABLE DEFINITIONS                                         |
43 -----------------------------------------------------------------------*/
44
45 char *get_new_string(char* src_string)
46 {
47         return g_strdup(src_string);
48 }
49
50 void _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf** configure_info)
51 {
52         int i = 0;
53         int info_table_size = sizeof(conf_info_table);
54
55         mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
56
57         /* Videosrc element default value */
58         static type_element _videosrc_element_default = {
59                 "VideosrcElement",
60                 "videotestsrc",
61                 NULL,
62                 0,
63                 NULL,
64                 0,
65         };
66
67         /* Audiosrc element default value */
68         static type_int  ___audiosrc_default_channel = { "Channel", 1 };
69         static type_int  ___audiosrc_default_bitrate = { "BitRate", 8000 };
70         static type_int  ___audiosrc_default_depth = { "Depth", 16 };
71         static type_int  ___audiosrc_default_blocksize = { "BlockSize", 1280 };
72         static type_int* __audiosrc_default_int_array[] = {
73                 &___audiosrc_default_channel,
74                 &___audiosrc_default_bitrate,
75                 &___audiosrc_default_depth,
76                 &___audiosrc_default_blocksize,
77         };
78         static type_string  ___audiosrc_default_device = { "Device", "default" };
79         static type_string* __audiosrc_default_string_array[] = {
80                 &___audiosrc_default_device,
81         };
82         static type_element _audiosrc_element_default = {
83                 "AudiosrcElement",
84                 "audiotestsrc",
85                 __audiosrc_default_int_array,
86                 sizeof( __audiosrc_default_int_array ) / sizeof( type_int* ),
87                 __audiosrc_default_string_array,
88                 sizeof( __audiosrc_default_string_array ) / sizeof( type_string* ),
89         };
90
91         static type_element _audiomodemsrc_element_default = {
92                 "AudiomodemsrcElement",
93                 "audiotestsrc",
94                 __audiosrc_default_int_array,
95                 sizeof( __audiosrc_default_int_array ) / sizeof( type_int* ),
96                 __audiosrc_default_string_array,
97                 sizeof( __audiosrc_default_string_array ) / sizeof( type_string* ),
98         };
99
100
101         /* Videosink element default value */
102         static type_int  ___videosink_default_display_id = { "display-id", 3 };
103         static type_int  ___videosink_default_x = { "x", 0 };
104         static type_int  ___videosink_default_y = { "y", 0 };
105         static type_int  ___videosink_default_width = { "width", 800 };
106         static type_int  ___videosink_default_height = { "height", 480 };
107         static type_int  ___videosink_default_rotation = { "rotation", 1 };
108         static type_int* __videosink_default_int_array[] = {
109                 &___videosink_default_display_id,
110                 &___videosink_default_x,
111                 &___videosink_default_y,
112                 &___videosink_default_width,
113                 &___videosink_default_height,
114                 &___videosink_default_rotation,
115         };
116         static type_string* __videosink_default_string_array[] = { NULL };
117         static type_element _videosink_element_overlay_default = {
118                 "VideosinkElementOverlay",
119                 "waylandsink",
120                 __videosink_default_int_array,
121                 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
122                 __videosink_default_string_array,
123                 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
124         };
125         static type_element _videosink_element_evas_default = {
126                 "VideosinkElementEvas",
127                 "evasimagesink",
128                 __videosink_default_int_array,
129                 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
130                 __videosink_default_string_array,
131                 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
132         };
133         static type_element _videosink_element_gl_default = {
134                 "VideosinkElementGL",
135                 "glimagesink",
136                 __videosink_default_int_array,
137                 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
138                 __videosink_default_string_array,
139                 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
140         };
141         static type_element _videosink_element_remote_default = {
142                 "VideosinkElementRemote",
143                 "shmsink",
144                 __videosink_default_int_array,
145                 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
146                 __videosink_default_string_array,
147                 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
148         };
149         static type_element _videosink_element_null_default = {
150                 "VideosinkElementNull",
151                 "fakesink",
152                 __videosink_default_int_array,
153                 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
154                 __videosink_default_string_array,
155                 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
156         };
157
158         /* Videoscale element default value */
159         static type_element _videoscale_element_default = {
160                 "VideoscaleElement",
161                 "videoscale",
162                 NULL,
163                 0,
164                 NULL,
165                 0,
166         };
167
168         /* Videoconvert element default value */
169         static type_element _videoconvert_element_default = {
170                 "VideoconvertElement",
171                 "videoconvert",
172                 NULL,
173                 0,
174                 NULL,
175                 0,
176         };
177
178         /* H.264 decoder element default value */
179         static type_element _videodecoder_element_h264_default = {
180                 "VideodecoderElementH264",
181                 "avdec_h264",
182                 NULL,
183                 0,
184                 NULL,
185                 0,
186         };
187
188         /* Record sink element default value */
189         static type_element _recordsink_element_default = {
190                 "RecordsinkElement",
191                 "fakesink",
192                 NULL,
193                 0,
194                 NULL,
195                 0,
196         };
197
198         /* H263 element default value */
199         static type_element _h263_element_default = {
200                 "H263",
201                 "avenc_h263",
202                 NULL,
203                 0,
204                 NULL,
205                 0,
206         };
207
208         /* H264 element default value */
209         static type_element _h264_element_default = {
210                 "H264",
211                 NULL,
212                 NULL,
213                 0,
214                 NULL,
215                 0,
216         };
217
218         /* H26L element default value */
219         static type_element _h26l_element_default = {
220                 "H26L",
221                 NULL,
222                 NULL,
223                 0,
224                 NULL,
225                 0,
226         };
227
228         /* MPEG4 element default value */
229         static type_element _mpeg4_element_default = {
230                 "MPEG4",
231                 "avenc_mpeg4",
232                 NULL,
233                 0,
234                 NULL,
235                 0,
236         };
237
238         /* MPEG1 element default value */
239         static type_element _mpeg1_element_default = {
240                 "MPEG1",
241                 "avenc_mpeg1video",
242                 NULL,
243                 0,
244                 NULL,
245                 0,
246         };
247
248         /* THEORA element default value */
249         static type_element _theora_element_default = {
250                 "THEORA",
251                 "theoraenc",
252                 NULL,
253                 0,
254                 NULL,
255                 0,
256         };
257
258         /* AMR element default value */
259         static type_element _amr_element_default = {
260                 "AMR",
261                 "amrnbenc",
262                 NULL,
263                 0,
264                 NULL,
265                 0,
266         };
267
268         /* G723_1 element default value */
269         static type_element _g723_1_element_default = {
270                 "G723_1",
271                 NULL,
272                 NULL,
273                 0,
274                 NULL,
275                 0,
276         };
277
278         /* MP3 element default value */
279         static type_element _mp3_element_default = {
280                 "MP3",
281                 "lamemp3enc",
282                 NULL,
283                 0,
284                 NULL,
285                 0,
286         };
287
288         /* AAC element default value */
289         static type_element _aac_element_default = {
290                 "AAC",
291                 NULL,
292                 NULL,
293                 0,
294                 NULL,
295                 0,
296         };
297
298         /* MMF element default value */
299         static type_element _mmf_element_default = {
300                 "MMF",
301                 NULL,
302                 NULL,
303                 0,
304                 NULL,
305                 0,
306         };
307
308         /* ADPCM element default value */
309         static type_element _adpcm_element_default = {
310                 "ADPCM",
311                 "avenc_adpcm_ima_qt",
312                 NULL,
313                 0,
314                 NULL,
315                 0,
316         };
317
318         /* WAVE element default value */
319         static type_element _wave_element_default = {
320                 "WAVE",
321                 "wavenc",
322                 NULL,
323                 0,
324                 NULL,
325                 0,
326         };
327
328         /* VORBIS element default value */
329         static type_element _vorbis_element_default = {
330                 "VORBIS",
331                 "vorbisenc",
332                 NULL,
333                 0,
334                 NULL,
335                 0,
336         };
337
338         /* MIDI element default value */
339         static type_element _midi_element_default = {
340                 "MIDI",
341                 NULL,
342                 NULL,
343                 0,
344                 NULL,
345                 0,
346         };
347
348         /* IMELODY element default value */
349         static type_element _imelody_element_default = {
350                 "IMELODY",
351                 NULL,
352                 NULL,
353                 0,
354                 NULL,
355                 0,
356         };
357
358         /* JPEG element default value */
359         static type_element _jpeg_element_default = {
360                 "JPEG",
361                 "jpegenc",
362                 NULL,
363                 0,
364                 NULL,
365                 0,
366         };
367
368         /* PNG element default value */
369         static type_element _png_element_default = {
370                 "PNG",
371                 "pngenc",
372                 NULL,
373                 0,
374                 NULL,
375                 0,
376         };
377
378         /* BMP element default value */
379         static type_element _bmp_element_default = {
380                 "BMP",
381                 NULL,
382                 NULL,
383                 0,
384                 NULL,
385                 0,
386         };
387
388         /* WBMP element default value */
389         static type_element _wbmp_element_default = {
390                 "WBMP",
391                 NULL,
392                 NULL,
393                 0,
394                 NULL,
395                 0,
396         };
397
398         /* TIFF element default value */
399         static type_element _tiff_element_default = {
400                 "TIFF",
401                 NULL,
402                 NULL,
403                 0,
404                 NULL,
405                 0,
406         };
407
408         /* PCX element default value */
409         static type_element _pcx_element_default = {
410                 "PCX",
411                 NULL,
412                 NULL,
413                 0,
414                 NULL,
415                 0,
416         };
417
418         /* GIF element default value */
419         static type_element _gif_element_default = {
420                 "GIF",
421                 NULL,
422                 NULL,
423                 0,
424                 NULL,
425                 0,
426         };
427
428         /* ICO element default value */
429         static type_element _ico_element_default = {
430                 "ICO",
431                 NULL,
432                 NULL,
433                 0,
434                 NULL,
435                 0,
436         };
437
438         /* RAS element default value */
439         static type_element _ras_element_default = {
440                 "RAS",
441                 NULL,
442                 NULL,
443                 0,
444                 NULL,
445                 0,
446         };
447
448         /* TGA element default value */
449         static type_element _tga_element_default = {
450                 "TGA",
451                 NULL,
452                 NULL,
453                 0,
454                 NULL,
455                 0,
456         };
457
458         /* XBM element default value */
459         static type_element _xbm_element_default = {
460                 "XBM",
461                 NULL,
462                 NULL,
463                 0,
464                 NULL,
465                 0,
466         };
467
468         /* XPM element default value */
469         static type_element _xpm_element_default = {
470                 "XPM",
471                 NULL,
472                 NULL,
473                 0,
474                 NULL,
475                 0,
476         };
477
478         /* 3GP element default value */
479         static type_element _3gp_element_default = {
480                 "3GP",
481                 "avmux_3gp",
482                 NULL,
483                 0,
484                 NULL,
485                 0,
486         };
487
488         /* AMR mux element default value */
489         static type_element _amrmux_element_default = {
490                 "AMR",
491                 "avmux_amr",
492                 NULL,
493                 0,
494                 NULL,
495                 0,
496         };
497
498         /* MP4 element default value */
499         static type_element _mp4_element_default = {
500                 "MP4",
501                 "avmux_mp4",
502                 NULL,
503                 0,
504                 NULL,
505                 0,
506         };
507
508         /* AAC mux element default value */
509         static type_element _aacmux_element_default = {
510                 "AAC",
511                 NULL,
512                 NULL,
513                 0,
514                 NULL,
515                 0,
516         };
517
518         /* MP3 mux element default value */
519         static type_element _mp3mux_element_default = {
520                 "MP3",
521                 NULL,
522                 NULL,
523                 0,
524                 NULL,
525                 0,
526         };
527
528         /* OGG element default value */
529         static type_element _ogg_element_default = {
530                 "OGG",
531                 "oggmux",
532                 NULL,
533                 0,
534                 NULL,
535                 0,
536         };
537
538         /* WAV element default value */
539         static type_element _wav_element_default = {
540                 "WAV",
541                 NULL,
542                 NULL,
543                 0,
544                 NULL,
545                 0,
546         };
547
548         /* AVI element default value */
549         static type_element _avi_element_default = {
550                 "AVI",
551                 "avimux",
552                 NULL,
553                 0,
554                 NULL,
555                 0,
556         };
557
558         /* WMA element default value */
559         static type_element _wma_element_default = {
560                 "WMA",
561                 NULL,
562                 NULL,
563                 0,
564                 NULL,
565                 0,
566         };
567
568         /* WMV element default value */
569         static type_element _wmv_element_default = {
570                 "WMV",
571                 NULL,
572                 NULL,
573                 0,
574                 NULL,
575                 0,
576         };
577
578         /* MID element default value */
579         static type_element _mid_element_default = {
580                 "MID",
581                 NULL,
582                 NULL,
583                 0,
584                 NULL,
585                 0,
586         };
587
588         /* MMF mux element default value */
589         static type_element _mmfmux_element_default = {
590                 "MMF",
591                 "avmux_mmf",
592                 NULL,
593                 0,
594                 NULL,
595                 0,
596         };
597
598         /* MATROSKA element default value */
599         static type_element _matroska_element_default = {
600                 "MATROSKA",
601                 "matroskamux",
602                 NULL,
603                 0,
604                 NULL,
605                 0,
606         };
607
608         /* M2TS element default value */
609         static type_element _m2ts_element_default = {
610                 "M2TS",
611                 "mpegtsmux",
612                 NULL,
613                 0,
614                 NULL,
615                 0,
616         };
617
618         /* [General] matching table */
619         static conf_info_table conf_main_general_table[] = {
620                 { "SyncStateChange", CONFIGURE_VALUE_INT,           {.value_int = 1} },
621                 { "GSTInitOption",   CONFIGURE_VALUE_STRING_ARRAY,  {NULL} },
622                 { "ModelName",       CONFIGURE_VALUE_STRING,        {NULL} },
623                 { "DisabledAttributes", CONFIGURE_VALUE_STRING_ARRAY,  {NULL} },
624         };
625
626         /* [VideoInput] matching table */
627         static conf_info_table conf_main_video_input_table[] = {
628                 { "UseConfCtrl",        CONFIGURE_VALUE_INT,            {.value_int = 1} },
629                 { "ConfCtrlFile0",      CONFIGURE_VALUE_STRING,         {NULL} },
630                 { "ConfCtrlFile1",      CONFIGURE_VALUE_STRING,         {NULL} },
631                 { "VideosrcElement",    CONFIGURE_VALUE_ELEMENT,        {&_videosrc_element_default} },
632                 { "UseVideoscale",      CONFIGURE_VALUE_INT,            {.value_int = 0} },
633                 { "VideoscaleElement",  CONFIGURE_VALUE_ELEMENT,        {&_videoscale_element_default} },
634                 { "UseZeroCopyFormat",  CONFIGURE_VALUE_INT,            {.value_int = 0} },
635                 { "DeviceCount",        CONFIGURE_VALUE_INT,            {.value_int = MM_VIDEO_DEVICE_NUM} },
636                 { "SupportMediaPacketPreviewCb",  CONFIGURE_VALUE_INT,  {.value_int = 0} },
637         };
638
639         /* [AudioInput] matching table */
640         static conf_info_table conf_main_audio_input_table[] = {
641                 { "AudioDevice",          CONFIGURE_VALUE_INT_ARRAY, {NULL} },
642                 { "AudiosrcElement",      CONFIGURE_VALUE_ELEMENT, {&_audiosrc_element_default} },
643                 { "AudiomodemsrcElement", CONFIGURE_VALUE_ELEMENT, {&_audiomodemsrc_element_default} },
644         };
645
646         /* [VideoOutput] matching table */
647         static conf_info_table conf_main_video_output_table[] = {
648                 { "DisplayDevice",           CONFIGURE_VALUE_INT_ARRAY, {NULL} },
649                 { "DisplayMode",             CONFIGURE_VALUE_INT_ARRAY, {NULL} },
650                 { "Videosink",               CONFIGURE_VALUE_INT_ARRAY, {NULL} },
651                 { "VideosinkElementOverlay", CONFIGURE_VALUE_ELEMENT,   {&_videosink_element_overlay_default} },
652                 { "VideosinkElementEvas",    CONFIGURE_VALUE_ELEMENT,   {&_videosink_element_evas_default} },
653                 { "VideosinkElementGL",      CONFIGURE_VALUE_ELEMENT,   {&_videosink_element_gl_default} },
654                 { "VideosinkElementRemote",  CONFIGURE_VALUE_ELEMENT,   {&_videosink_element_remote_default} },
655                 { "VideosinkElementNull",    CONFIGURE_VALUE_ELEMENT,   {&_videosink_element_null_default} },
656                 { "UseVideoscale",           CONFIGURE_VALUE_INT,       {.value_int = 0} },
657                 { "VideoscaleElement",       CONFIGURE_VALUE_ELEMENT,   {&_videoscale_element_default} },
658                 { "VideoconvertElement",     CONFIGURE_VALUE_ELEMENT,   {&_videoconvert_element_default} },
659                 { "VideodecoderElementH264", CONFIGURE_VALUE_ELEMENT,   {&_videodecoder_element_h264_default} },
660                 { "RecreateDecoder",         CONFIGURE_VALUE_INT,       {.value_int = 0} }
661         };
662
663         /* [Capture] matching table */
664         static conf_info_table conf_main_capture_table[] = {
665                 { "UseEncodebin",           CONFIGURE_VALUE_INT,     {.value_int = 0} },
666                 { "UseCaptureMode",         CONFIGURE_VALUE_INT,     {.value_int = 0} },
667                 { "VideoscaleElement",      CONFIGURE_VALUE_ELEMENT, {&_videoscale_element_default} },
668                 { "PlayCaptureSound",       CONFIGURE_VALUE_INT,     {.value_int = 1} },
669         };
670
671         /* [Record] matching table */
672         static conf_info_table conf_main_record_table[] = {
673                 { "UseAudioEncoderQueue",   CONFIGURE_VALUE_INT,     {.value_int = 1} },
674                 { "UseVideoEncoderQueue",   CONFIGURE_VALUE_INT,     {.value_int = 1} },
675                 { "VideoProfile",           CONFIGURE_VALUE_INT,     {.value_int = 0} },
676                 { "VideoAutoAudioConvert",  CONFIGURE_VALUE_INT,     {.value_int = 0} },
677                 { "VideoAutoAudioResample", CONFIGURE_VALUE_INT,     {.value_int = 0} },
678                 { "VideoAutoColorSpace",    CONFIGURE_VALUE_INT,     {.value_int = 0} },
679                 { "AudioProfile",           CONFIGURE_VALUE_INT,     {.value_int = 0} },
680                 { "AudioAutoAudioConvert",  CONFIGURE_VALUE_INT,     {.value_int = 0} },
681                 { "AudioAutoAudioResample", CONFIGURE_VALUE_INT,     {.value_int = 0} },
682                 { "AudioAutoColorSpace",    CONFIGURE_VALUE_INT,     {.value_int = 0} },
683                 { "ImageProfile",           CONFIGURE_VALUE_INT,     {.value_int = 0} },
684                 { "ImageAutoAudioConvert",  CONFIGURE_VALUE_INT,     {.value_int = 0} },
685                 { "ImageAutoAudioResample", CONFIGURE_VALUE_INT,     {.value_int = 0} },
686                 { "ImageAutoColorSpace",    CONFIGURE_VALUE_INT,     {.value_int = 0} },
687                 { "RecordsinkElement",      CONFIGURE_VALUE_ELEMENT, {&_recordsink_element_default} },
688                 { "UseNoiseSuppressor",     CONFIGURE_VALUE_INT,     {.value_int = 0} },
689                 { "DropVideoFrame",         CONFIGURE_VALUE_INT,     {.value_int = 0} },
690                 { "PassFirstVideoFrame",    CONFIGURE_VALUE_INT,     {.value_int = 0} },
691                 { "SupportDualStream",      CONFIGURE_VALUE_INT,     {.value_int = FALSE} },
692         };
693
694         /* [VideoEncoder] matching table */
695         static conf_info_table conf_main_video_encoder_table[] = {
696                 { "H263",    CONFIGURE_VALUE_ELEMENT, {&_h263_element_default} },
697                 { "H264",    CONFIGURE_VALUE_ELEMENT, {&_h264_element_default} },
698                 { "H26L",    CONFIGURE_VALUE_ELEMENT, {&_h26l_element_default} },
699                 { "MPEG4",   CONFIGURE_VALUE_ELEMENT, {&_mpeg4_element_default} },
700                 { "MPEG1",   CONFIGURE_VALUE_ELEMENT, {&_mpeg1_element_default} },
701                 { "THEORA",  CONFIGURE_VALUE_ELEMENT, {&_theora_element_default} },
702         };
703
704         /* [AudioEncoder] matching table */
705         static conf_info_table conf_main_audio_encoder_table[] = {
706                 { "AMR",     CONFIGURE_VALUE_ELEMENT, {&_amr_element_default} },
707                 { "G723_1",  CONFIGURE_VALUE_ELEMENT, {&_g723_1_element_default} },
708                 { "MP3",     CONFIGURE_VALUE_ELEMENT, {&_mp3_element_default} },
709                 { "AAC",     CONFIGURE_VALUE_ELEMENT, {&_aac_element_default} },
710                 { "MMF",     CONFIGURE_VALUE_ELEMENT, {&_mmf_element_default} },
711                 { "ADPCM",   CONFIGURE_VALUE_ELEMENT, {&_adpcm_element_default} },
712                 { "WAVE",    CONFIGURE_VALUE_ELEMENT, {&_wave_element_default} },
713                 { "MIDI",    CONFIGURE_VALUE_ELEMENT, {&_midi_element_default} },
714                 { "IMELODY", CONFIGURE_VALUE_ELEMENT, {&_imelody_element_default} },
715                 { "VORBIS",  CONFIGURE_VALUE_ELEMENT, {&_vorbis_element_default} },
716         };
717
718         /* [ImageEncoder] matching table */
719         static conf_info_table conf_main_image_encoder_table[] = {
720                 { "JPEG", CONFIGURE_VALUE_ELEMENT, {&_jpeg_element_default} },
721                 { "PNG",  CONFIGURE_VALUE_ELEMENT, {&_png_element_default} },
722                 { "BMP",  CONFIGURE_VALUE_ELEMENT, {&_bmp_element_default} },
723                 { "WBMP", CONFIGURE_VALUE_ELEMENT, {&_wbmp_element_default} },
724                 { "TIFF", CONFIGURE_VALUE_ELEMENT, {&_tiff_element_default} },
725                 { "PCX",  CONFIGURE_VALUE_ELEMENT, {&_pcx_element_default} },
726                 { "GIF",  CONFIGURE_VALUE_ELEMENT, {&_gif_element_default} },
727                 { "ICO",  CONFIGURE_VALUE_ELEMENT, {&_ico_element_default} },
728                 { "RAS",  CONFIGURE_VALUE_ELEMENT, {&_ras_element_default} },
729                 { "TGA",  CONFIGURE_VALUE_ELEMENT, {&_tga_element_default} },
730                 { "XBM",  CONFIGURE_VALUE_ELEMENT, {&_xbm_element_default} },
731                 { "XPM",  CONFIGURE_VALUE_ELEMENT, {&_xpm_element_default} },
732         };
733
734         /* [Mux] matching table */
735         static conf_info_table conf_main_mux_table[] = {
736                 { "3GP",      CONFIGURE_VALUE_ELEMENT, {&_3gp_element_default} },
737                 { "AMR",      CONFIGURE_VALUE_ELEMENT, {&_amrmux_element_default} },
738                 { "MP4",      CONFIGURE_VALUE_ELEMENT, {&_mp4_element_default} },
739                 { "AAC",      CONFIGURE_VALUE_ELEMENT, {&_aacmux_element_default} },
740                 { "MP3",      CONFIGURE_VALUE_ELEMENT, {&_mp3mux_element_default} },
741                 { "OGG",      CONFIGURE_VALUE_ELEMENT, {&_ogg_element_default} },
742                 { "WAV",      CONFIGURE_VALUE_ELEMENT, {&_wav_element_default} },
743                 { "AVI",      CONFIGURE_VALUE_ELEMENT, {&_avi_element_default} },
744                 { "WMA",      CONFIGURE_VALUE_ELEMENT, {&_wma_element_default} },
745                 { "WMV",      CONFIGURE_VALUE_ELEMENT, {&_wmv_element_default} },
746                 { "MID",      CONFIGURE_VALUE_ELEMENT, {&_mid_element_default} },
747                 { "MMF",      CONFIGURE_VALUE_ELEMENT, {&_mmfmux_element_default} },
748                 { "MATROSKA", CONFIGURE_VALUE_ELEMENT, {&_matroska_element_default} },
749                 { "M2TS",     CONFIGURE_VALUE_ELEMENT, {&_m2ts_element_default} },
750         };
751
752
753         /*******************
754         *  Camera control *
755         *******************/
756
757         /* [Camera] matching table */
758         static conf_info_table conf_ctrl_camera_table[] = {
759                 { "InputIndex",           CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
760                 { "DeviceName",           CONFIGURE_VALUE_STRING,         {NULL} },
761                 { "PreviewResolution",    CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
762                 { "CaptureResolution",    CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
763                 { "VideoResolution",      CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
764                 { "FPS0",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
765                 { "FPS1",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
766                 { "FPS2",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
767                 { "FPS3",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
768                 { "FPS4",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
769                 { "FPS5",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
770                 { "FPS6",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
771                 { "FPS7",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
772                 { "FPS8",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
773                 { "FPS9",                 CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
774                 { "PictureFormat",        CONFIGURE_VALUE_INT_ARRAY,      {NULL} },
775                 { "Overlay",              CONFIGURE_VALUE_INT_RANGE,      {NULL} },
776                 { "RecommendDisplayRotation", CONFIGURE_VALUE_INT,     {.value_int = 3}    },
777                 { "RecommendPreviewFormatCapture", CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_YUYV} },
778                 { "RecommendPreviewFormatRecord",  CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_NV12} },
779                 { "RecommendPreviewResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
780                 { "FacingDirection",      CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR} },
781         };
782
783         /* [Strobe] matching table */
784         static conf_info_table conf_ctrl_strobe_table[] = {
785                 { "StrobeControl",        CONFIGURE_VALUE_INT_ARRAY, {NULL} },
786                 { "StrobeMode",           CONFIGURE_VALUE_INT_ARRAY, {NULL} },
787                 { "StrobeEV",             CONFIGURE_VALUE_INT_RANGE, {NULL} },
788         };
789
790         /* [Effect] matching table */
791         static conf_info_table conf_ctrl_effect_table[] = {
792                 { "Brightness",           CONFIGURE_VALUE_INT_RANGE, {NULL} },
793                 { "BrightnessStepDenominator", CONFIGURE_VALUE_INT, {.value_int = 2} },
794                 { "Contrast",             CONFIGURE_VALUE_INT_RANGE, {NULL} },
795                 { "Saturation",           CONFIGURE_VALUE_INT_RANGE, {NULL} },
796                 { "Sharpness",            CONFIGURE_VALUE_INT_RANGE, {NULL} },
797                 { "WhiteBalance",         CONFIGURE_VALUE_INT_ARRAY, {NULL} },
798                 { "ColorTone",            CONFIGURE_VALUE_INT_ARRAY, {NULL} },
799                 { "Flip",                 CONFIGURE_VALUE_INT_ARRAY, {NULL} },
800                 { "Rotation",             CONFIGURE_VALUE_INT_ARRAY, {NULL} },
801                 { "WDR",                  CONFIGURE_VALUE_INT_ARRAY, {NULL} },
802                 { "PartColorMode",        CONFIGURE_VALUE_INT_ARRAY, {NULL} },
803                 { "PartColor",            CONFIGURE_VALUE_INT_ARRAY, {NULL} },
804         };
805
806         /* [Photograph] matching table */
807         static conf_info_table conf_ctrl_photograph_table[] = {
808                 { "LensInit",             CONFIGURE_VALUE_INT_ARRAY, {NULL} },
809                 { "DigitalZoom",          CONFIGURE_VALUE_INT_RANGE, {NULL} },
810                 { "OpticalZoom",          CONFIGURE_VALUE_INT_RANGE, {NULL} },
811                 { "FocusMode",            CONFIGURE_VALUE_INT_ARRAY, {NULL} },
812                 { "AFType",               CONFIGURE_VALUE_INT_ARRAY, {NULL} },
813                 { "AEType",               CONFIGURE_VALUE_INT_ARRAY, {NULL} },
814                 { "ExposureValue",        CONFIGURE_VALUE_INT_RANGE, {NULL} },
815                 { "FNumber",              CONFIGURE_VALUE_INT_ARRAY, {NULL} },
816                 { "ShutterSpeed",         CONFIGURE_VALUE_INT_ARRAY, {NULL} },
817                 { "ISO",                  CONFIGURE_VALUE_INT_ARRAY, {NULL} },
818                 { "ProgramMode",          CONFIGURE_VALUE_INT_ARRAY, {NULL} },
819                 { "AntiHandshake",        CONFIGURE_VALUE_INT_ARRAY, {NULL} },
820                 { "VideoStabilization",   CONFIGURE_VALUE_INT_ARRAY, {NULL} },
821                 { "FaceZoomMode",         CONFIGURE_VALUE_INT_ARRAY, {NULL} },
822                 { "FaceZoomLevel",        CONFIGURE_VALUE_INT_RANGE, {NULL} },
823                 { "PanMecha",             CONFIGURE_VALUE_INT_RANGE, {NULL} },
824                 { "PanElec",              CONFIGURE_VALUE_INT_RANGE, {NULL} },
825                 { "TiltMecha",            CONFIGURE_VALUE_INT_RANGE, {NULL} },
826                 { "TiltElec",             CONFIGURE_VALUE_INT_RANGE, {NULL} },
827         };
828
829         /* [Capture] matching table */
830         static conf_info_table conf_ctrl_capture_table[] = {
831                 { "OutputMode",           CONFIGURE_VALUE_INT_ARRAY, {NULL} },
832                 { "JpegQuality",          CONFIGURE_VALUE_INT_RANGE, {NULL} },
833                 { "MultishotNumber",      CONFIGURE_VALUE_INT_RANGE, {NULL} },
834                 { "SensorEncodedCapture", CONFIGURE_VALUE_INT,       {.value_int = 1} },
835                 { "SupportHDR",           CONFIGURE_VALUE_INT_ARRAY, {NULL} },
836                 { "SupportZSL",           CONFIGURE_VALUE_INT,       {.value_int = FALSE} },
837         };
838
839         /* [Detect] matching table */
840         static conf_info_table conf_ctrl_detect_table[] = {
841                 { "DetectMode",           CONFIGURE_VALUE_INT_ARRAY, {NULL} },
842                 { "DetectNumber",         CONFIGURE_VALUE_INT_RANGE, {NULL} },
843                 { "DetectSelect",         CONFIGURE_VALUE_INT_RANGE, {NULL} },
844                 { "DetectSelectNumber",   CONFIGURE_VALUE_INT_RANGE, {NULL} },
845         };
846
847         if (hcamcorder == NULL) {
848                 _mmcam_dbg_err("handle is NULL");
849                 return;
850         }
851
852         _mmcam_dbg_log("Entered...");
853
854         if (type == CONFIGURE_TYPE_MAIN) {
855                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_GENERAL]       = conf_main_general_table;
856                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT]   = conf_main_video_input_table;
857                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT]   = conf_main_audio_input_table;
858                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT]  = conf_main_video_output_table;
859                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_CAPTURE]       = conf_main_capture_table;
860                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_RECORD]        = conf_main_record_table;
861                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER] = conf_main_video_encoder_table;
862                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER] = conf_main_audio_encoder_table;
863                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER] = conf_main_image_encoder_table;
864                 hcamcorder->conf_main_info_table[CONFIGURE_CATEGORY_MAIN_MUX]           = conf_main_mux_table;
865
866                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_GENERAL]       = sizeof( conf_main_general_table ) / info_table_size;
867                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT]   = sizeof( conf_main_video_input_table ) / info_table_size;
868                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT]   = sizeof( conf_main_audio_input_table ) / info_table_size;
869                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT]  = sizeof( conf_main_video_output_table ) / info_table_size;
870                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_CAPTURE]       = sizeof( conf_main_capture_table ) / info_table_size;
871                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_RECORD]        = sizeof( conf_main_record_table ) / info_table_size;
872                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER] = sizeof( conf_main_video_encoder_table ) / info_table_size;
873                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER] = sizeof( conf_main_audio_encoder_table ) / info_table_size;
874                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER] = sizeof( conf_main_image_encoder_table ) / info_table_size;
875                 hcamcorder->conf_main_category_size[CONFIGURE_CATEGORY_MAIN_MUX]           = sizeof( conf_main_mux_table ) / info_table_size;
876
877                 (*configure_info)->info = (conf_detail**)g_malloc0( sizeof( conf_detail* ) * CONFIGURE_CATEGORY_MAIN_NUM );
878
879                 for (i = 0 ; i < CONFIGURE_CATEGORY_MAIN_NUM ; i++) {
880                         (*configure_info)->info[i] = NULL;
881                 }
882         } else {
883                 hcamcorder->conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_CAMERA]     = conf_ctrl_camera_table;
884                 hcamcorder->conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_STROBE]     = conf_ctrl_strobe_table;
885                 hcamcorder->conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_EFFECT]     = conf_ctrl_effect_table;
886                 hcamcorder->conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH] = conf_ctrl_photograph_table;
887                 hcamcorder->conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_CAPTURE]    = conf_ctrl_capture_table;
888                 hcamcorder->conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_DETECT]     = conf_ctrl_detect_table;
889
890                 hcamcorder->conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_CAMERA]     = sizeof( conf_ctrl_camera_table ) / info_table_size;
891                 hcamcorder->conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_STROBE]     = sizeof( conf_ctrl_strobe_table ) / info_table_size;
892                 hcamcorder->conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_EFFECT]     = sizeof( conf_ctrl_effect_table ) / info_table_size;
893                 hcamcorder->conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH] = sizeof( conf_ctrl_photograph_table ) / info_table_size;
894                 hcamcorder->conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_CAPTURE]    = sizeof( conf_ctrl_capture_table ) / info_table_size;
895                 hcamcorder->conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_DETECT]     = sizeof( conf_ctrl_detect_table ) / info_table_size;
896
897                 (*configure_info)->info = (conf_detail**)g_malloc0( sizeof( conf_detail* ) * CONFIGURE_CATEGORY_CTRL_NUM );
898
899                 for (i = 0 ; i < CONFIGURE_CATEGORY_CTRL_NUM ; i++) {
900                         (*configure_info)->info[i] = NULL;
901                 }
902         }
903
904         _mmcam_dbg_log("Done.");
905
906         return;
907 }
908
909
910 int _mmcamcorder_conf_get_info(MMHandleType handle, int type, const char *ConfFile, camera_conf **configure_info)
911 {
912         int ret = MM_ERROR_NONE;
913         FILE *fd = NULL;
914         char conf_path[60] = {'\0',};
915
916         _mmcam_dbg_log("Opening...[%s]", ConfFile);
917
918         mmf_return_val_if_fail(ConfFile, FALSE);
919
920         snprintf(conf_path, sizeof(conf_path), "%s/multimedia/%s", SYSCONFDIR, ConfFile);
921         _mmcam_dbg_log("Try open Configure File[%s]", conf_path);
922
923         fd = fopen(conf_path, "r");
924         if (fd == NULL) {
925                 _mmcam_dbg_warn("File open failed.[%s] retry...", conf_path);
926
927                 snprintf(conf_path, sizeof(conf_path), "%s/multimedia/%s", TZ_SYS_ETC, ConfFile);
928                 _mmcam_dbg_log("Try open Configure File[%s]", conf_path);
929                 fd = fopen(conf_path, "r");
930                 if (fd == NULL) {
931                         _mmcam_dbg_warn("open failed.[%s] errno [%d]", conf_path, errno);
932                 }
933         }
934
935         if (fd != NULL) {
936                 ret = _mmcamcorder_conf_parse_info(handle, type, fd, configure_info);
937                 fclose(fd);
938         } else {
939                 if (errno == ENOENT) {
940                         ret = MM_ERROR_CAMCORDER_NOT_SUPPORTED;
941                 } else {
942                         ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE;
943                 }
944         }
945
946         _mmcam_dbg_log("Leave...");
947
948         return ret;
949 }
950
951
952 int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE* fd, camera_conf** configure_info)
953 {
954         const unsigned int BUFFER_NUM_DETAILS = 256;
955         const unsigned int BUFFER_NUM_TOKEN = 20;
956         size_t BUFFER_LENGTH_STRING = 256;
957         const char* delimiters = " |=,\t\n";
958
959         int category = 0;
960         int count_main_category = 0;
961         int count_details = 0;
962         int length_read = 0;
963         int count_token = 0;
964         int read_main = 0;
965
966         char *buffer_string = NULL;
967         char *buffer_details[BUFFER_NUM_DETAILS];
968         char *buffer_token[BUFFER_NUM_TOKEN];
969         char *token = NULL;
970         char *category_name = NULL;
971         char *detail_string = NULL;
972         char *user_ptr = NULL;
973
974         _mmcam_dbg_log( "" );
975
976         camera_conf* new_conf = (camera_conf *)g_malloc0(sizeof(camera_conf));
977         if (new_conf == NULL) {
978                 _mmcam_dbg_err("new_conf alloc failed : %d", sizeof(camera_conf));
979                 *configure_info = NULL;
980                 return MM_ERROR_CAMCORDER_LOW_MEMORY;
981         }
982
983         buffer_string = (char*)g_malloc0(sizeof(char) * BUFFER_LENGTH_STRING);
984         if (buffer_string == NULL) {
985                 _mmcam_dbg_err("buffer_string alloc failed : %d", sizeof(char) * BUFFER_LENGTH_STRING);
986                 *configure_info = NULL;
987                 SAFE_G_FREE(new_conf);
988                 return MM_ERROR_CAMCORDER_LOW_MEMORY;
989         }
990
991         new_conf->type  = type;
992         *configure_info = new_conf;
993
994         _mmcamcorder_conf_init(handle, type, &new_conf);
995
996         if (fd == NULL) {
997                 _mmcam_dbg_err("failed file descriptor fail");
998                 *configure_info = NULL;
999                 SAFE_G_FREE(buffer_string);
1000                 SAFE_G_FREE(new_conf);
1001                 return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
1002         }
1003
1004         read_main = 0;
1005         count_main_category = 0;
1006
1007         while( !feof( fd ) )
1008         {
1009                 if( read_main == 0 )
1010                 {
1011                         length_read = getline( &buffer_string, &BUFFER_LENGTH_STRING, fd );
1012                         /*_mmcam_dbg_log( "Read Line : [%s]", buffer_string );*/
1013
1014                         count_token = 0;
1015                         token = strtok_r( buffer_string, delimiters, &user_ptr );
1016
1017                         if ((token) && (token[0] == ';') && (length_read > -1))
1018                         {
1019                                 /*_mmcam_dbg_log( "Comment - Nothing to do" );*/
1020                                 continue;
1021                         }
1022
1023                         while( token )
1024                         {
1025                                 /*_mmcam_dbg_log( "token : [%s]", token );*/
1026                                 buffer_token[count_token] = token;
1027                                 count_token++;
1028                                 token = strtok_r( NULL, delimiters, &user_ptr );
1029                         }
1030
1031                         if( count_token == 0 )
1032                         {
1033                                 continue;
1034                         }
1035                 }
1036
1037                 read_main = 0;
1038
1039                 /* Comment */
1040                 if( *buffer_token[0] == ';' )
1041                 {
1042                         /*_mmcam_dbg_log( "Comment - Nothing to do" );*/
1043                 }
1044                 /* Main Category */
1045                 else if( *buffer_token[0] == '[' )
1046                 {
1047                         category_name = get_new_string( buffer_token[0] );
1048                         if (category_name == NULL) {
1049                                 _mmcam_dbg_err("strdup failed for [%s]", buffer_token[0]);
1050                                 continue;
1051                         }
1052
1053                         count_main_category++;
1054                         count_details = 0;
1055
1056                         while( !feof( fd ) )
1057                         {
1058                                 length_read = getline( &buffer_string, &BUFFER_LENGTH_STRING, fd );
1059                                 /*_mmcam_dbg_log( "Read Detail Line : [%s], read length : [%d]", buffer_string, length_read );*/
1060
1061                                 detail_string = get_new_string( buffer_string );
1062
1063                                 token = strtok_r( buffer_string, delimiters, &user_ptr );
1064
1065                                 if( token && token[0] != ';' && length_read > -1 )
1066                                 {
1067                                         /*_mmcam_dbg_log( "token : [%s]", token );*/
1068                                         if( token[0] == '[' )
1069                                         {
1070                                                 read_main = 1;
1071                                                 buffer_token[0] = token;
1072                                                 SAFE_G_FREE( detail_string );
1073                                                 break;
1074                                         }
1075
1076                                         buffer_details[count_details++] = detail_string;
1077                                 }
1078                                 else
1079                                 {
1080                                         SAFE_G_FREE( detail_string );
1081                                 }
1082                         }
1083
1084                         /*_mmcam_dbg_log( "type : %d, category_name : %s, count : [%d]", type, category_name, count_details );*/
1085
1086                         if( count_details == 0 )
1087                         {
1088                                 _mmcam_dbg_warn( "category %s has no detail value... skip this category...", category_name );
1089                                 SAFE_G_FREE(category_name);
1090                                 continue;
1091                         }
1092
1093                         category = -1;
1094
1095                         /* Details */
1096                         if( type == CONFIGURE_TYPE_MAIN )
1097                         {
1098                                 if( !strcmp( "[General]", category_name ) )
1099                                 {
1100                                         category = CONFIGURE_CATEGORY_MAIN_GENERAL;
1101                                 }
1102                                 else if( !strcmp( "[VideoInput]", category_name ) )
1103                                 {
1104                                         category = CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT;
1105                                 }
1106                                 else if( !strcmp( "[AudioInput]", category_name ) )
1107                                 {
1108                                         category = CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT;
1109                                 }
1110                                 else if( !strcmp( "[VideoOutput]", category_name ) )
1111                                 {
1112                                         category = CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT;
1113                                 }
1114                                 else if( !strcmp( "[Capture]", category_name ) )
1115                                 {
1116                                         category = CONFIGURE_CATEGORY_MAIN_CAPTURE;
1117                                 }
1118                                 else if( !strcmp( "[Record]", category_name ) )
1119                                 {
1120                                         category = CONFIGURE_CATEGORY_MAIN_RECORD;
1121                                 }
1122                                 else if( !strcmp( "[VideoEncoder]", category_name ) )
1123                                 {
1124                                         category = CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER;
1125                                 }
1126                                 else if( !strcmp( "[AudioEncoder]", category_name ) )
1127                                 {
1128                                         category = CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER;
1129                                 }
1130                                 else if( !strcmp( "[ImageEncoder]", category_name ) )
1131                                 {
1132                                         category = CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER;
1133                                 }
1134                                 else if( !strcmp( "[Mux]", category_name ) )
1135                                 {
1136                                         category = CONFIGURE_CATEGORY_MAIN_MUX;
1137                                 }
1138                         }
1139                         else
1140                         {
1141                                 if( !strcmp( "[Camera]", category_name ) )
1142                                 {
1143                                         category = CONFIGURE_CATEGORY_CTRL_CAMERA;
1144                                 }
1145                                 else if( !strcmp( "[Strobe]", category_name ) )
1146                                 {
1147                                         category = CONFIGURE_CATEGORY_CTRL_STROBE;
1148                                 }
1149                                 else if( !strcmp( "[Effect]", category_name ) )
1150                                 {
1151                                         category = CONFIGURE_CATEGORY_CTRL_EFFECT;
1152                                 }
1153                                 else if( !strcmp( "[Photograph]", category_name ) )
1154                                 {
1155                                         category = CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH;
1156                                 }
1157                                 else if( !strcmp( "[Capture]", category_name ) )
1158                                 {
1159                                         category = CONFIGURE_CATEGORY_CTRL_CAPTURE;
1160                                 }
1161                                 else if( !strcmp( "[Detect]", category_name ) )
1162                                 {
1163                                         category = CONFIGURE_CATEGORY_CTRL_DETECT;
1164                                 }
1165                         }
1166
1167                         if( category != -1 )
1168                         {
1169                                 _mmcamcorder_conf_add_info( handle, type, &(new_conf->info[category]),
1170                                                 buffer_details, category, count_details );
1171                         }
1172                         else
1173                         {
1174                                 _mmcam_dbg_warn( "No matched category[%s],type[%d]... check it.", category_name, type );
1175                         }
1176
1177                         // Free memory
1178                         {
1179                                 int i;
1180
1181                                 for( i = 0 ; i < count_details ; i++ )
1182                                 {
1183                                         SAFE_G_FREE( buffer_details[i] );
1184                                 }
1185                         }
1186                 }
1187
1188                 SAFE_G_FREE(category_name);
1189         }
1190
1191         //(*configure_info) = new_conf;
1192
1193         SAFE_G_FREE( buffer_string );
1194
1195         /*_mmcam_dbg_log( "Done." );*/
1196
1197         return MM_ERROR_NONE;
1198 }
1199
1200
1201 void _mmcamcorder_conf_release_info(MMHandleType handle, camera_conf **configure_info)
1202 {
1203         int i = 0;
1204         int j = 0;
1205         int k = 0;
1206         int type = CONFIGURE_VALUE_INT;
1207         int count = 0;
1208         int category_num = CONFIGURE_CATEGORY_MAIN_NUM;
1209         camera_conf *temp_conf = (*configure_info);
1210
1211         type_int2 *temp_int = NULL;
1212         type_int_range *temp_int_range = NULL;
1213         type_int_array *temp_int_array = NULL;
1214         type_int_pair_array *temp_int_pair_array = NULL;
1215         type_string2 *temp_string = NULL;
1216         type_string_array *temp_string_array = NULL;
1217         type_element2 *temp_element = NULL;
1218
1219         _mmcam_dbg_log("Entered...");
1220
1221         mmf_return_if_fail(temp_conf);
1222
1223         if ((*configure_info)->type == CONFIGURE_TYPE_MAIN) {
1224                 category_num = CONFIGURE_CATEGORY_MAIN_NUM;
1225         } else {
1226                 category_num = CONFIGURE_CATEGORY_CTRL_NUM;
1227         }
1228
1229         for (i = 0 ; i < category_num ; i++) {
1230                 if (temp_conf->info[i]) {
1231                         for (j = 0 ; j < temp_conf->info[i]->count ; j++) {
1232                                 if (temp_conf->info[i]->detail_info[j] == NULL) {
1233                                         continue;
1234                                 }
1235
1236                                 if (_mmcamcorder_conf_get_value_type(handle, temp_conf->type, i, ((type_element*)(temp_conf->info[i]->detail_info[j]))->name, &type)) {
1237                                         switch (type) {
1238                                         case CONFIGURE_VALUE_INT:
1239                                                 temp_int = (type_int2*)(temp_conf->info[i]->detail_info[j]);
1240                                                 SAFE_G_FREE(temp_int->name);
1241                                                 break;
1242                                         case CONFIGURE_VALUE_INT_RANGE:
1243                                                 temp_int_range = (type_int_range*)(temp_conf->info[i]->detail_info[j]);
1244                                                 SAFE_G_FREE(temp_int_range->name);
1245                                                 break;
1246                                         case CONFIGURE_VALUE_INT_ARRAY:
1247                                                 temp_int_array = (type_int_array*)(temp_conf->info[i]->detail_info[j]);
1248                                                 SAFE_G_FREE(temp_int_array->name);
1249                                                 SAFE_G_FREE(temp_int_array->value);
1250                                                 break;
1251                                         case CONFIGURE_VALUE_INT_PAIR_ARRAY:
1252                                                 temp_int_pair_array = (type_int_pair_array*)(temp_conf->info[i]->detail_info[j]);
1253                                                 SAFE_G_FREE(temp_int_pair_array->name);
1254                                                 SAFE_G_FREE(temp_int_pair_array->value[0]);
1255                                                 SAFE_G_FREE(temp_int_pair_array->value[1]);
1256                                                 break;
1257                                         case CONFIGURE_VALUE_STRING:
1258                                                 temp_string = (type_string2*)(temp_conf->info[i]->detail_info[j]);
1259                                                 SAFE_G_FREE(temp_string->name);
1260                                                 SAFE_G_FREE(temp_string->value);
1261                                                 break;
1262                                         case CONFIGURE_VALUE_STRING_ARRAY:
1263                                                 temp_string_array = (type_string_array*)(temp_conf->info[i]->detail_info[j]);
1264                                                 SAFE_G_FREE(temp_string_array->name);
1265                                                 if (temp_string_array->value) {
1266                                                         count = temp_string_array->count;
1267                                                         for (k = 0 ; k < count ; k++) {
1268                                                                 SAFE_G_FREE(temp_string_array->value[k]);
1269                                                         }
1270                                                         SAFE_G_FREE(temp_string_array->value);
1271                                                 }
1272                                                 SAFE_G_FREE(temp_string_array->default_value);
1273                                                 break;
1274                                         case CONFIGURE_VALUE_ELEMENT:
1275                                                 temp_element = (type_element2*)(temp_conf->info[i]->detail_info[j]);
1276                                                 SAFE_G_FREE(temp_element->name);
1277                                                 SAFE_G_FREE(temp_element->element_name);
1278
1279                                                 if (temp_element->value_int) {
1280                                                         count = temp_element->count_int;
1281                                                         for (k = 0 ; k < count ; k++) {
1282                                                                 SAFE_G_FREE(temp_element->value_int[k]->name);
1283                                                                 SAFE_G_FREE(temp_element->value_int[k]);
1284                                                         }
1285                                                         SAFE_G_FREE(temp_element->value_int);
1286                                                 }
1287
1288                                                 if (temp_element->value_string) {
1289                                                         count = temp_element->count_string;
1290                                                         for (k = 0 ; k < count ; k++) {
1291                                                                 SAFE_G_FREE(temp_element->value_string[k]->name);
1292                                                                 SAFE_G_FREE(temp_element->value_string[k]->value);
1293                                                                 SAFE_G_FREE(temp_element->value_string[k]);
1294                                                         }
1295                                                         SAFE_G_FREE(temp_element->value_string);
1296                                                 }
1297                                                 break;
1298                                         default:
1299                                                 _mmcam_dbg_warn("unknown type %d", type);
1300                                                 break;
1301                                         }
1302                                 }
1303
1304                                 SAFE_G_FREE(temp_conf->info[i]->detail_info[j]);
1305                         }
1306
1307                         SAFE_G_FREE(temp_conf->info[i]->detail_info);
1308
1309                         SAFE_G_FREE(temp_conf->info[i]);
1310                         temp_conf->info[i] = NULL;
1311                 }
1312         }
1313
1314         SAFE_G_FREE((*configure_info)->info);
1315         SAFE_G_FREE((*configure_info));
1316
1317         _mmcam_dbg_log("Done.");
1318 }
1319
1320 int _mmcamcorder_conf_get_value_type(MMHandleType handle, int type, int category, const char* name, int* value_type)
1321 {
1322         int i = 0;
1323         int count_value = 0;
1324
1325         mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
1326
1327         if (hcamcorder == NULL) {
1328                 _mmcam_dbg_err("handle is NULL");
1329                 return FALSE;
1330         }
1331
1332         /*_mmcam_dbg_log( "Entered..." );*/
1333
1334         mmf_return_val_if_fail( name, FALSE );
1335
1336         if( !_mmcamcorder_conf_get_category_size( handle, type, category, &count_value ) )
1337         {
1338                 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
1339                 return FALSE;
1340         }
1341
1342         /*_mmcam_dbg_log( "Number of value : [%d]", count_value );*/
1343
1344         if( type == CONFIGURE_TYPE_MAIN )
1345         {
1346                 for( i = 0 ; i < count_value ; i++ )
1347                 {
1348                         if( !strcmp( hcamcorder->conf_main_info_table[category][i].name, name ) )
1349                         {
1350                                 *value_type = hcamcorder->conf_main_info_table[category][i].value_type;
1351                                 /*_mmcam_dbg_log( "Category[%d],Name[%s],Type[%d]", category, name, *value_type );*/
1352                                 return TRUE;
1353                         }
1354                 }
1355         }
1356         else
1357         {
1358                 for( i = 0 ; i < count_value ; i++ )
1359                 {
1360                         if( !strcmp( hcamcorder->conf_ctrl_info_table[category][i].name, name ) )
1361                         {
1362                                 *value_type = hcamcorder->conf_ctrl_info_table[category][i].value_type;
1363                                 /*_mmcam_dbg_log( "Category[%d],Name[%s],Type[%d]", category, name, *value_type );*/
1364                                 return TRUE;
1365                         }
1366                 }
1367         }
1368
1369         return FALSE;
1370 }
1371
1372
1373 int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail** info, char** buffer_details, int category, int count_details )
1374 {
1375         const int BUFFER_NUM_TOKEN = 256;
1376
1377         int i = 0;
1378         int j = 0;
1379         int count_token;
1380         int value_type;
1381         char *token = NULL;
1382         char *buffer_token[BUFFER_NUM_TOKEN];
1383         char *user_ptr = NULL;
1384
1385         const char *delimiters     = " |=,\t\n";
1386         const char *delimiters_sub = " |\t\n";
1387         const char *delimiters_3rd = "|\n";
1388
1389         mmf_return_val_if_fail( buffer_details, FALSE );
1390
1391         (*info) = (conf_detail*)g_malloc0( sizeof(conf_detail) );
1392         if (*info == NULL) {
1393                 _mmcam_dbg_err("allocation failed");
1394                 return FALSE;
1395         }
1396         (*info)->detail_info = (void**)g_malloc0(sizeof(void*) * count_details);
1397         (*info)->count = count_details;
1398
1399         for ( i = 0 ; i < count_details ; i++ ) {
1400                 /*_mmcam_dbg_log("Read line\"%s\"", buffer_details[i]);*/
1401                 count_token = 0;
1402                 token = strtok_r( buffer_details[i], delimiters, &user_ptr );
1403
1404                 if (token) {
1405                         buffer_token[count_token] = token;
1406                         count_token++;
1407                 } else {
1408                         (*info)->detail_info[i] = NULL;
1409                         _mmcam_dbg_warn( "No token... check it.[%s]", buffer_details[i] );
1410                         continue;
1411                 }
1412
1413                 if (!_mmcamcorder_conf_get_value_type(handle, type, category, buffer_token[0], &value_type)) {
1414                         (*info)->detail_info[i] = NULL;
1415                         _mmcam_dbg_warn( "Failed to get value type... check it. Category[%d],Name[%s]", category, buffer_token[0] );
1416                         continue;
1417                 }
1418
1419                 if (value_type != CONFIGURE_VALUE_STRING && value_type != CONFIGURE_VALUE_STRING_ARRAY) {
1420                         token = strtok_r( NULL, delimiters, &user_ptr );
1421                         while (token) {
1422                                 buffer_token[count_token] = token;
1423                                 /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/
1424                                 count_token++;
1425                                 token = strtok_r( NULL, delimiters, &user_ptr );
1426                         }
1427
1428                         if (count_token < 2) {
1429                                 (*info)->detail_info[i] = NULL;
1430                                 _mmcam_dbg_warn( "Number of token is too small... check it.[%s]", buffer_details[i] );
1431                                 continue;
1432                         }
1433                 } else { /* CONFIGURE_VALUE_STRING or CONFIGURE_VALUE_STRING_ARRAY */
1434                         /* skip "=" */
1435                         strtok_r( NULL, delimiters_sub, &user_ptr );
1436
1437                         if (value_type == CONFIGURE_VALUE_STRING_ARRAY) {
1438                                 token = strtok_r( NULL, delimiters_sub, &user_ptr );
1439                                 while (token) {
1440                                         buffer_token[count_token] = token;
1441                                         /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/
1442                                         count_token++;
1443                                         token = strtok_r( NULL, delimiters_sub, &user_ptr );
1444                                 }
1445                         } else { /* CONFIGURE_VALUE_STRING */
1446                                 token = strtok_r( NULL, delimiters_3rd, &user_ptr );
1447                                 if (token) {
1448                                         g_strchug( token );
1449                                         buffer_token[count_token] = token;
1450                                         /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/
1451                                         count_token++;
1452                                 }
1453                         }
1454
1455                         if (count_token < 2) {
1456                                 (*info)->detail_info[i] = NULL;
1457                                 _mmcam_dbg_warn( "No string value... check it.[%s]", buffer_details[i] );
1458                                 continue;
1459                         }
1460                 }
1461
1462                 switch (value_type)
1463                 {
1464                         case CONFIGURE_VALUE_INT:
1465                         {
1466                                 type_int2* new_int;
1467
1468                                 new_int        = (type_int2*)g_malloc0( sizeof(type_int2) );
1469                                 if ( new_int == NULL ) {
1470                                         _mmcam_dbg_err("allocation failed");
1471                                         break;
1472                                 }
1473                                 new_int->name  = get_new_string( buffer_token[0] );
1474                                 new_int->value = atoi( buffer_token[1] );
1475                                 (*info)->detail_info[i] = (void*)new_int;
1476                                 /*_mmcam_dbg_log("INT - name[%s],value[%d]", new_int->name, new_int->value);*/
1477                                 break;
1478                         }
1479                         case CONFIGURE_VALUE_INT_RANGE:
1480                         {
1481                                 type_int_range* new_int_range;
1482
1483                                 new_int_range                = (type_int_range*)g_malloc0( sizeof(type_int_range) );
1484                                 if ( new_int_range == NULL ) {
1485                                         _mmcam_dbg_err("allocation failed");
1486                                         break;
1487                                 }
1488                                 new_int_range->name          = get_new_string( buffer_token[0] );
1489                                 new_int_range->min           = atoi( buffer_token[1] );
1490                                 new_int_range->max           = atoi( buffer_token[2] );
1491                                 new_int_range->default_value = atoi( buffer_token[3] );
1492                                 (*info)->detail_info[i]      = (void*)new_int_range;
1493                                 /*
1494                                 _mmcam_dbg_log("INT RANGE - name[%s],min[%d],max[%d],default[%d]",
1495                                                 new_int_range->name,
1496                                                 new_int_range->min,
1497                                                 new_int_range->max,
1498                                                 new_int_range->default_value);
1499                                 */
1500                                 break;
1501                         }
1502                         case CONFIGURE_VALUE_INT_ARRAY:
1503                         {
1504                                 int count_value = count_token - 2;
1505                                 type_int_array* new_int_array;
1506
1507                                 new_int_array = (type_int_array*)g_malloc0( sizeof(type_int_array) );
1508                                 if (new_int_array == NULL) {
1509                                         _mmcam_dbg_err("allocation failed");
1510                                         break;
1511                                 }
1512                                 new_int_array->name = get_new_string( buffer_token[0] );
1513                                 new_int_array->value = (int*)g_malloc0( sizeof(int)*count_value );
1514                                 if (new_int_array->value == NULL) {
1515                                         SAFE_G_FREE(new_int_array->name);
1516                                         SAFE_G_FREE(new_int_array);
1517                                         _mmcam_dbg_err("allocation failed");
1518                                         break;
1519                                 }
1520                                 new_int_array->count = count_value;
1521
1522                                 /*_mmcam_dbg_log("INT ARRAY - name[%s]", new_int_array->name);*/
1523                                 for ( j = 0 ; j < count_value ; j++ ) {
1524                                         new_int_array->value[j] = atoi( buffer_token[j+1] );
1525                                         /*_mmcam_dbg_log("   index[%d] - value[%d]", j, new_int_array->value[j]);*/
1526                                 }
1527
1528                                 new_int_array->default_value = atoi( buffer_token[count_token-1] );
1529                                 /*_mmcam_dbg_log("   default value[%d]", new_int_array->default_value);*/
1530
1531                                 (*info)->detail_info[i] = (void*)new_int_array;
1532                                 break;
1533                         }
1534                         case CONFIGURE_VALUE_INT_PAIR_ARRAY:
1535                         {
1536                                 int count_value = ( count_token - 3 ) >> 1;
1537                                 type_int_pair_array* new_int_pair_array;
1538
1539                                 new_int_pair_array = (type_int_pair_array*)g_malloc0( sizeof(type_int_pair_array) );
1540                                 if ( new_int_pair_array == NULL ) {
1541                                         _mmcam_dbg_err("allocation failed");
1542                                         break;
1543                                 }
1544                                 new_int_pair_array->name     = get_new_string( buffer_token[0] );
1545                                 new_int_pair_array->value[0] = (int*)g_malloc0( sizeof(int)*(count_value) );
1546                                 if ( new_int_pair_array->value[0] == NULL ) {
1547                                         SAFE_G_FREE(new_int_pair_array->name);
1548                                         SAFE_G_FREE(new_int_pair_array);
1549                                         _mmcam_dbg_err("allocation failed");
1550                                         break;
1551                                 }
1552                                 new_int_pair_array->value[1] = (int*)g_malloc0( sizeof(int)*(count_value) );
1553                                 if ( new_int_pair_array->value[1] == NULL ) {
1554                                         SAFE_G_FREE(new_int_pair_array->value[0]);
1555                                         SAFE_G_FREE(new_int_pair_array->name);
1556                                         SAFE_G_FREE(new_int_pair_array);
1557                                         _mmcam_dbg_err("allocation failed");
1558                                         break;
1559                                 }
1560                                 new_int_pair_array->count    = count_value;
1561
1562                                 /*_mmcam_dbg_log("INT PAIR ARRAY - name[%s],count[%d]", new_int_pair_array->name, count_value);*/
1563                                 for ( j = 0 ; j < count_value ; j++ ) {
1564                                         new_int_pair_array->value[0][j] = atoi( buffer_token[(j<<1)+1] );
1565                                         new_int_pair_array->value[1][j] = atoi( buffer_token[(j<<1)+2] );
1566                                         /*
1567                                         _mmcam_dbg_log("   index[%d] - value[%d,%d]", j,
1568                                                         new_int_pair_array->value[0][j],
1569                                                         new_int_pair_array->value[1][j]);
1570                                         */
1571                                 }
1572
1573                                 new_int_pair_array->default_value[0] = atoi( buffer_token[count_token-2] );
1574                                 new_int_pair_array->default_value[1] = atoi( buffer_token[count_token-1] );
1575                                 /*
1576                                 _mmcam_dbg_log("   default value[%d,%d]",
1577                                                 new_int_pair_array->default_value[0],
1578                                                 new_int_pair_array->default_value[1]);
1579                                 */
1580                                 (*info)->detail_info[i] = (void*)new_int_pair_array;
1581                                 break;
1582                         }
1583                         case CONFIGURE_VALUE_STRING:
1584                         {
1585                                 type_string2* new_string;
1586
1587                                 new_string = (type_string2*)g_malloc0( sizeof(type_string2) );
1588                                 if (new_string == NULL) {
1589                                         _mmcam_dbg_err("allocation failed");
1590                                         break;
1591                                 }
1592                                 new_string->name  = get_new_string( buffer_token[0] );
1593                                 new_string->value = get_new_string( buffer_token[1] );
1594                                 (*info)->detail_info[i] = (void*)new_string;
1595
1596                                 /*_mmcam_dbg_log("STRING - name[%s],value[%s]", new_string->name, new_string->value);*/
1597                                 break;
1598                         }
1599                         case CONFIGURE_VALUE_STRING_ARRAY:
1600                         {
1601                                 int count_value = count_token - 2;
1602                                 type_string_array* new_string_array;
1603
1604                                 new_string_array = (type_string_array*)g_malloc0( sizeof(type_string_array) );
1605                                 if ( new_string_array == NULL ) {
1606                                         break;
1607                                 }
1608                                 new_string_array->name  = get_new_string( buffer_token[0] );
1609                                 new_string_array->count = count_value;
1610                                 new_string_array->value = (char**)g_malloc0( sizeof(char*)*count_value );
1611                                 if ( new_string_array->value == NULL ) {
1612                                         SAFE_G_FREE(new_string_array->name);
1613                                         SAFE_G_FREE(new_string_array);
1614                                         _mmcam_dbg_err("allocation failed");
1615                                         break;
1616                                 }
1617                                 /*_mmcam_dbg_log("STRING ARRAY - name[%s]", new_string_array->name);*/
1618                                 for ( j = 0 ; j < count_value ; j++ ) {
1619                                         new_string_array->value[j] = get_new_string( buffer_token[j+1] );
1620                                         /*_mmcam_dbg_log("   index[%d] - value[%s]", j, new_string_array->value[j]);*/
1621                                 }
1622
1623                                 new_string_array->default_value = get_new_string( buffer_token[count_token-1] );
1624                                 /*_mmcam_dbg_log("   default value[%s]", new_string_array->default_value);*/
1625                                 (*info)->detail_info[i] = (void*)new_string_array;
1626                                 break;
1627                         }
1628                         case CONFIGURE_VALUE_ELEMENT:
1629                         {
1630                                 type_element2* new_element;
1631
1632                                 new_element = (type_element2*)g_malloc0( sizeof(type_element2) );
1633                                 if ( new_element == NULL ) {
1634                                         _mmcam_dbg_err("allocation failed");
1635                                         break;
1636                                 }
1637                                 new_element->name         = get_new_string( buffer_token[0] );
1638                                 new_element->element_name = get_new_string( buffer_token[1] );
1639                                 new_element->count_int    = atoi( buffer_token[2] );
1640                                 new_element->value_int    = NULL;
1641                                 new_element->count_string = atoi( buffer_token[3] );
1642                                 new_element->value_string = NULL;
1643                                 /*
1644                                 _mmcam_dbg_log("Element - name[%s],element_name[%s],count_int[%d],count_string[%d]",
1645                                                new_element->name, new_element->element_name, new_element->count_int, new_element->count_string);
1646                                 */
1647
1648                                 /* add int values */
1649                                 if ( new_element->count_int > 0 && new_element->count_int <= 30 ) {
1650                                         new_element->value_int = (type_int2**)g_malloc0( sizeof(type_int2*)*(new_element->count_int) );
1651                                         if ( new_element->value_int) {
1652                                                 for ( j = 0 ; j < new_element->count_int ; j++ ) {
1653                                                         new_element->value_int[j]        = (type_int2*)g_malloc0( sizeof(type_int2) );
1654                                                         if ( new_element->value_int[j] ) {
1655                                                                 new_element->value_int[j]->name  = get_new_string( buffer_token[4+(j<<1)] );
1656                                                                 new_element->value_int[j]->value = atoi( buffer_token[5+(j<<1)] );
1657                                                         } else {
1658                                                                 _mmcam_dbg_err("allocation failed");
1659                                                         }
1660                                                         /*
1661                                                         _mmcam_dbg_log("   Element INT[%d] - name[%s],value[%d]",
1662                                                                        j, new_element->value_int[j]->name, new_element->value_int[j]->value);
1663                                                         */
1664                                                 }
1665                                         } else {
1666                                                 _mmcam_dbg_err("allocation failed");
1667                                         }
1668                                 } else {
1669                                         /*_mmcam_dbg_err("invalid count - %d", new_element->count_int);*/
1670                                         new_element->value_int = NULL;
1671                                 }
1672
1673                                 /* add string values */
1674                                 if ( new_element->count_string > 0 && new_element->count_string <= 30 &&
1675                                      new_element->count_int >= 0 && new_element->count_int <= 30 ) {
1676                                         new_element->value_string = (type_string2**)g_malloc0( sizeof(type_string2*)*(new_element->count_string) );
1677                                         if (new_element->value_string) {
1678                                                 for ( ; j < new_element->count_string + new_element->count_int ; j++ ) {
1679                                                         new_element->value_string[j-new_element->count_int]     = (type_string2*)g_malloc0( sizeof(type_string2) );
1680                                                         if(new_element->value_string[j-new_element->count_int]) {
1681                                                                 new_element->value_string[j-new_element->count_int]->name       = get_new_string( buffer_token[4+(j<<1)] );
1682                                                                 new_element->value_string[j-new_element->count_int]->value      = get_new_string( buffer_token[5+(j<<1)] );
1683                                                                 /*
1684                                                                 _mmcam_dbg_log("   Element STRING[%d] - name[%s],value[%s]",
1685                                                                                j-new_element->count_int, new_element->value_string[j-new_element->count_int]->name, new_element->value_string[j-new_element->count_int]->value);
1686                                                                 */
1687                                                         } else {
1688                                                                 _mmcam_dbg_err("allocation failed");
1689                                                         }
1690                                                 }
1691                                         } else {
1692                                                 _mmcam_dbg_err("malloc failed : %d", sizeof(type_string2*)*(new_element->count_string));
1693                                         }
1694                                 } else {
1695                                         /*_mmcam_dbg_err("invalid count - %d", new_element->count_string);*/
1696                                         new_element->value_string = NULL;
1697                                 }
1698
1699                                 (*info)->detail_info[i] = (void*)new_element;
1700                                 break;
1701                         }
1702                         default:
1703                                 break;
1704                 }
1705         }
1706
1707         return TRUE;
1708 }
1709
1710
1711 int _mmcamcorder_conf_get_value_int(MMHandleType handle, camera_conf* configure_info, int category, const char* name, int* value)
1712 {
1713         int i, count;
1714         conf_detail* info;
1715
1716         //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
1717
1718         mmf_return_val_if_fail( configure_info, FALSE );
1719         mmf_return_val_if_fail( name, FALSE );
1720
1721         if( configure_info->info[category] )
1722         {
1723                 count = configure_info->info[category]->count;
1724                 info = configure_info->info[category];
1725
1726                 for( i = 0 ; i < count ; i++ )
1727                 {
1728                         if( info->detail_info[i] == NULL )
1729                         {
1730                                 continue;
1731                         }
1732
1733                         if( !strcmp( ((type_int*)(info->detail_info[i]))->name , name ) )
1734                         {
1735                                 *value = ((type_int*)(info->detail_info[i]))->value;
1736                                 //_mmcam_dbg_log( "Get[%s] int[%d]", name, *value );
1737                                 return TRUE;
1738                         }
1739                 }
1740         }
1741
1742         if( _mmcamcorder_conf_get_default_value_int( handle, configure_info->type, category, name, value ) )
1743         {
1744                 //_mmcam_dbg_log( "Get[%s] int[%d]", name, *value );
1745                 return TRUE;
1746         }
1747
1748         _mmcam_dbg_warn( "Faild to get int... check it...Category[%d],Name[%s]", category, name );
1749
1750         return FALSE;
1751 }
1752
1753 int
1754 _mmcamcorder_conf_get_value_int_range( camera_conf* configure_info, int category, const char* name, type_int_range** value )
1755 {
1756         int i, count;
1757         conf_detail* info;
1758
1759         //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
1760
1761         mmf_return_val_if_fail( configure_info, FALSE );
1762         mmf_return_val_if_fail( name, FALSE );
1763
1764         if( configure_info->info[category] )
1765         {
1766                 count = configure_info->info[category]->count;
1767                 info = configure_info->info[category];
1768
1769                 for( i = 0 ; i < count ; i++ )
1770                 {
1771                         if( info->detail_info[i] == NULL )
1772                         {
1773                                 continue;
1774                         }
1775
1776                         if( !strcmp( ((type_int_range*)(info->detail_info[i]))->name , name ) )
1777                         {
1778                                 *value = (type_int_range*)(info->detail_info[i]);
1779                                 /*
1780                                 _mmcam_dbg_log( "Get[%s] int range - min[%d],max[%d],default[%d]",
1781                                                 name, (*value)->min, (*value)->max, (*value)->default_value );
1782                                 */
1783                                 return TRUE;
1784                         }
1785                 }
1786         }
1787
1788         *value = NULL;
1789
1790         /*_mmcam_dbg_warn( "Faild to get int range... check it...Category[%d],Name[%s]", category, name );*/
1791
1792         return FALSE;
1793 }
1794
1795 int
1796 _mmcamcorder_conf_get_value_int_array( camera_conf* configure_info, int category, const char* name, type_int_array** value )
1797 {
1798         int i, count;
1799         conf_detail* info;
1800
1801         /*_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );*/
1802
1803         mmf_return_val_if_fail( configure_info, FALSE );
1804         mmf_return_val_if_fail( name, FALSE );
1805
1806         if( configure_info->info[category] )
1807         {
1808                 count   = configure_info->info[category]->count;
1809                 info    = configure_info->info[category];
1810
1811                 for( i = 0 ; i < count ; i++ )
1812                 {
1813                         if( info->detail_info[i] == NULL )
1814                         {
1815                                 continue;
1816                         }
1817
1818                         if( !strcmp( ((type_int_array*)(info->detail_info[i]))->name , name ) )
1819                         {
1820                                 *value = (type_int_array*)(info->detail_info[i]);
1821                                 /*
1822                                 _mmcam_dbg_log( "Get[%s] int array - [%x],count[%d],default[%d]",
1823                                                 name, (*value)->value, (*value)->count, (*value)->default_value );
1824                                 */
1825                                 return TRUE;
1826                         }
1827                 }
1828         }
1829
1830         *value = NULL;
1831
1832         /*_mmcam_dbg_warn( "Faild to get int array... check it...Category[%d],Name[%s]", category, name );*/
1833
1834         return FALSE;
1835 }
1836
1837 int
1838 _mmcamcorder_conf_get_value_int_pair_array( camera_conf* configure_info, int category, const char* name, type_int_pair_array** value )
1839 {
1840         int i, count;
1841         conf_detail* info;
1842
1843         //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
1844
1845         mmf_return_val_if_fail( configure_info, FALSE );
1846         mmf_return_val_if_fail( name, FALSE );
1847
1848         if( configure_info->info[category] )
1849         {
1850                 count = configure_info->info[category]->count;
1851                 info = configure_info->info[category];
1852
1853                 for( i = 0 ; i < count ; i++ )
1854                 {
1855                         if( info->detail_info[i] == NULL )
1856                         {
1857                                 continue;
1858                         }
1859
1860                         if( !strcmp( ((type_int_pair_array*)(info->detail_info[i]))->name , name ) )
1861                         {
1862                                 *value = (type_int_pair_array*)(info->detail_info[i]);
1863                                 /*
1864                                 _mmcam_dbg_log( "Get[%s] int pair array - [%x][%x],count[%d],default[%d][%d]",
1865                                                 name, (*value)->value[0], (*value)->value[1], (*value)->count,
1866                                                 (*value)->default_value[0], (*value)->default_value[1] );
1867                                 */
1868                                 return TRUE;
1869                         }
1870                 }
1871         }
1872
1873         *value = NULL;
1874
1875         _mmcam_dbg_warn( "Faild to get int pair array... check it...Category[%d],Name[%s]", category, name );
1876
1877         return FALSE;
1878 }
1879
1880 int _mmcamcorder_conf_get_value_string(MMHandleType handle, camera_conf* configure_info, int category, const char* name, const char** value)
1881 {
1882         int i, count;
1883         conf_detail* info;
1884
1885         //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
1886
1887         mmf_return_val_if_fail( configure_info, FALSE );
1888         mmf_return_val_if_fail( name, FALSE );
1889
1890         if( configure_info->info[category] )
1891         {
1892                 count = configure_info->info[category]->count;
1893                 info = configure_info->info[category];
1894
1895                 for( i = 0 ; i < count ; i++ )
1896                 {
1897                         if( info->detail_info[i] == NULL )
1898                         {
1899                                 continue;
1900                         }
1901
1902                         if( !strcmp( ((type_string*)(info->detail_info[i]))->name , name ) )
1903                         {
1904                                 *value = ((type_string*)(info->detail_info[i]))->value;
1905                                 //_mmcam_dbg_log( "Get[%s] string[%s]", name, *value );
1906                                 return TRUE;
1907                         }
1908                 }
1909         }
1910
1911         if( _mmcamcorder_conf_get_default_value_string(handle, configure_info->type, category, name, value ) )
1912         {
1913                 //_mmcam_dbg_log( "Get[%s]string[%s]", name, *value );
1914                 return TRUE;
1915         }
1916
1917         _mmcam_dbg_warn( "Faild to get string... check it...Category[%d],Name[%s]", category, name );
1918
1919         return FALSE;
1920 }
1921
1922 int
1923 _mmcamcorder_conf_get_value_string_array( camera_conf* configure_info, int category, const char* name, type_string_array** value )
1924 {
1925         int i, count;
1926         conf_detail* info;
1927
1928         //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
1929
1930         mmf_return_val_if_fail( configure_info, FALSE );
1931         mmf_return_val_if_fail( name, FALSE );
1932
1933         if( configure_info->info[category] )
1934         {
1935                 count = configure_info->info[category]->count;
1936                 info = configure_info->info[category];
1937
1938                 for( i = 0 ; i < count ; i++ )
1939                 {
1940                         if( info->detail_info[i] == NULL )
1941                         {
1942                                 continue;
1943                         }
1944
1945                         if( !strcmp( ((type_string_array*)(info->detail_info[i]))->name , name ) )
1946                         {
1947                                 *value = (type_string_array*)(info->detail_info[i]);
1948                                 /*
1949                                 _mmcam_dbg_log( "Get[%s] string array - [%x],count[%d],default[%s]",
1950                                                 name, (*value)->value, (*value)->count, (*value)->default_value );
1951                                 */
1952                                 return TRUE;
1953                         }
1954                 }
1955         }
1956
1957         *value = NULL;
1958
1959         /*_mmcam_dbg_warn( "Faild to get string array... check it...Category[%d],Name[%s]", category, name );*/
1960
1961         return FALSE;
1962 }
1963
1964 int _mmcamcorder_conf_get_element(MMHandleType handle, camera_conf* configure_info, int category, const char* name, type_element** element)
1965 {
1966         int i, count;
1967         conf_detail* info;
1968
1969         //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
1970
1971         mmf_return_val_if_fail( configure_info, FALSE );
1972         mmf_return_val_if_fail( name, FALSE );
1973
1974         if( configure_info->info[category] )
1975         {
1976                 count = configure_info->info[category]->count;
1977                 info = configure_info->info[category];
1978
1979                 for( i = 0 ; i < count ; i++ )
1980                 {
1981                         if( info->detail_info[i] == NULL )
1982                         {
1983                                 continue;
1984                         }
1985
1986                         if( !strcmp( ((type_element*)(info->detail_info[i]))->name , name ) )
1987                         {
1988                                 *element = (type_element*)(info->detail_info[i]);
1989                                 //_mmcam_dbg_log( "Get[%s] element[%x]", name, *element );
1990                                 return TRUE;
1991                         }
1992                 }
1993         }
1994
1995         if( _mmcamcorder_conf_get_default_element(handle, configure_info->type, category, name, element ) )
1996         {
1997                 //_mmcam_dbg_log( "Get[%s] element[%x]", name, *element );
1998                 return TRUE;
1999         }
2000
2001         _mmcam_dbg_warn( "Faild to get element name... check it...Category[%d],Name[%s]", category, name );
2002
2003         return FALSE;
2004 }
2005
2006 int
2007 _mmcamcorder_conf_get_value_element_name( type_element* element, const char** value )
2008 {
2009         //_mmcam_dbg_log( "Entered..." );
2010
2011         mmf_return_val_if_fail( element, FALSE );
2012
2013         *value = element->element_name;
2014
2015         //_mmcam_dbg_log( "Get element name : [%s]", *value );
2016
2017         return TRUE;
2018 }
2019
2020 int
2021 _mmcamcorder_conf_get_value_element_int( type_element* element, const char* name, int* value )
2022 {
2023         int i;
2024
2025         //_mmcam_dbg_log( "Entered..." );
2026
2027         mmf_return_val_if_fail( element, FALSE );
2028         mmf_return_val_if_fail( name, FALSE );
2029
2030         for( i = 0 ; i < element->count_int ; i++ )
2031         {
2032                 if( !strcmp( element->value_int[i]->name , name ) )
2033                 {
2034                         *value = element->value_int[i]->value;
2035                         //_mmcam_dbg_log( "Get[%s] element int[%d]", name, *value );
2036                         return TRUE;
2037                 }
2038         }
2039
2040         _mmcam_dbg_warn( "Faild to get int in element... ElementName[%p],Name[%s],Count[%d]",
2041                 element->name, name, element->count_int );
2042
2043         return FALSE;
2044 }
2045
2046 int
2047 _mmcamcorder_conf_get_value_element_string( type_element* element, const char* name, const char** value )
2048 {
2049         int i;
2050
2051         //_mmcam_dbg_log( "Entered..." );
2052
2053         mmf_return_val_if_fail( element, FALSE );
2054         mmf_return_val_if_fail( name, FALSE );
2055
2056         for( i = 0 ; i < element->count_string ; i++ )
2057         {
2058                 if( !strcmp( element->value_string[i]->name , name ) )
2059                 {
2060                         *value = element->value_string[i]->value;
2061                         //_mmcam_dbg_log( "Get[%s] element string[%s]", name, *value );
2062                         return TRUE;
2063                 }
2064         }
2065
2066         _mmcam_dbg_warn( "Faild to get int in element... ElementName[%p],Name[%s],Count[%d]",
2067                 element->name, name, element->count_string );
2068
2069         return FALSE;
2070 }
2071
2072 int
2073 _mmcamcorder_conf_set_value_element_property( GstElement* gst, type_element* element )
2074 {
2075         int i;
2076
2077         //_mmcam_dbg_log( "Entered..." );
2078
2079         mmf_return_val_if_fail( gst, FALSE );
2080         mmf_return_val_if_fail( element, FALSE );
2081
2082         if( element->count_int == 0 )
2083         {
2084                 /*_mmcam_dbg_log( "There is no integer property to set in INI file[%s].", element->name );*/
2085         }
2086         else
2087         {
2088                 if( element->value_int == NULL )
2089                 {
2090                         _mmcam_dbg_warn( "count_int[%d] is NOT zero, but value_int is NULL", element->count_int );
2091                         return FALSE;
2092                 }
2093
2094                 for( i = 0 ; i < element->count_int ; i++ )
2095                 {
2096                         MMCAMCORDER_G_OBJECT_SET( gst, element->value_int[i]->name, element->value_int[i]->value );
2097
2098                         /*
2099                         _mmcam_dbg_log( "Element[%s] Set[%s] -> integer[%d]",
2100                                 element->element_name,
2101                                 element->value_int[i]->name,
2102                                 element->value_int[i]->value );
2103                                 */
2104                 }
2105         }
2106
2107         if( element->count_string == 0 )
2108         {
2109                 _mmcam_dbg_log( "There is no string property to set in INI file[%s].", element->name );
2110         }
2111         else
2112         {
2113                 if( element->value_string == NULL )
2114                 {
2115                         _mmcam_dbg_warn( "count_string[%d] is NOT zero, but value_string is NULL", element->count_string );
2116                         return FALSE;
2117                 }
2118
2119                 for( i = 0 ; i < element->count_string ; i++ )
2120                 {
2121                         MMCAMCORDER_G_OBJECT_SET_POINTER( gst, element->value_string[i]->name, element->value_string[i]->value );
2122
2123                         _mmcam_dbg_log( "Element[%s] Set[%s] -> string[%s]",
2124                                 element->element_name,
2125                                 element->value_string[i]->name,
2126                                 element->value_string[i]->value );
2127                 }
2128         }
2129
2130         //_mmcam_dbg_log( "Done." );
2131
2132         return TRUE;
2133 }
2134
2135 int
2136 _mmcamcorder_conf_get_default_value_int(MMHandleType handle, int type, int category, const char* name, int* value )
2137 {
2138         int i = 0;
2139         int count_value = 0;
2140
2141         mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
2142
2143         if (hcamcorder == NULL) {
2144                 _mmcam_dbg_err("handle is NULL");
2145                 return FALSE;
2146         }
2147
2148         //_mmcam_dbg_log( "Entered..." );
2149
2150         mmf_return_val_if_fail( name, FALSE );
2151
2152         if( !_mmcamcorder_conf_get_category_size( handle, type, category, &count_value ) )
2153         {
2154                 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
2155                 return FALSE;
2156         }
2157
2158         if( type == CONFIGURE_TYPE_MAIN )
2159         {
2160                 for( i = 0 ; i < count_value ; i++ )
2161                 {
2162                         if( !strcmp( hcamcorder->conf_main_info_table[category][i].name, name ) )
2163                         {
2164                                 *value = hcamcorder->conf_main_info_table[category][i].value_int;
2165                                 return TRUE;
2166                         }
2167                 }
2168         }
2169         else
2170         {
2171                 for( i = 0 ; i < count_value ; i++ )
2172                 {
2173                         if( !strcmp( hcamcorder->conf_ctrl_info_table[category][i].name, name ) )
2174                         {
2175                                 *value = hcamcorder->conf_ctrl_info_table[category][i].value_int;
2176                                 return TRUE;
2177                         }
2178                 }
2179         }
2180
2181         _mmcam_dbg_warn( "Failed to get default int... check it... Type[%d],Category[%d],Name[%s]", type, category, name );
2182
2183         return FALSE;
2184 }
2185
2186 int _mmcamcorder_conf_get_default_value_string(MMHandleType handle, int type, int category, const char* name, const char** value)
2187 {
2188         int i = 0;
2189         int count_value = 0;
2190
2191         mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
2192
2193         if (hcamcorder == NULL) {
2194                 _mmcam_dbg_err("handle is NULL");
2195                 return FALSE;
2196         }
2197
2198         //_mmcam_dbg_log( "Entered..." );
2199
2200         mmf_return_val_if_fail( name, FALSE );
2201
2202         if( !_mmcamcorder_conf_get_category_size( handle, type, category, &count_value ) )
2203         {
2204                 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
2205                 return FALSE;
2206         }
2207
2208         if( type == CONFIGURE_TYPE_MAIN )
2209         {
2210                 for( i = 0 ; i < count_value ; i++ )
2211                 {
2212                         if( !strcmp( hcamcorder->conf_main_info_table[category][i].name, name ) )
2213                         {
2214                                 *value = hcamcorder->conf_main_info_table[category][i].value_string;
2215                                 _mmcam_dbg_log( "Get[%s] default string[%s]", name, *value );
2216                                 return TRUE;
2217                         }
2218                 }
2219         }
2220         else
2221         {
2222                 for( i = 0 ; i < count_value ; i++ )
2223                 {
2224                         if( !strcmp( hcamcorder->conf_ctrl_info_table[category][i].name, name ) )
2225                         {
2226                                 *value = hcamcorder->conf_ctrl_info_table[category][i].value_string;
2227                                 _mmcam_dbg_log( "Get[%s] default string[%s]", name, *value );
2228                                 return TRUE;
2229                         }
2230                 }
2231         }
2232
2233         _mmcam_dbg_warn( "Failed to get default string... check it... Type[%d],Category[%d],Name[%s]", type, category, name );
2234
2235         return FALSE;
2236 }
2237
2238 int _mmcamcorder_conf_get_default_element(MMHandleType handle, int type, int category, const char* name, type_element** element)
2239 {
2240         int i = 0;
2241         int count_value = 0;
2242
2243         mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
2244
2245         if (hcamcorder == NULL) {
2246                 _mmcam_dbg_err("handle is NULL");
2247                 return FALSE;
2248         }
2249
2250         //_mmcam_dbg_log( "Entered..." );
2251
2252         mmf_return_val_if_fail( name, FALSE );
2253
2254         if( !_mmcamcorder_conf_get_category_size( handle, type, category, &count_value ) )
2255         {
2256                 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
2257                 return FALSE;
2258         }
2259
2260         if( type == CONFIGURE_TYPE_MAIN )
2261         {
2262                 for( i = 0 ; i < count_value ; i++ )
2263                 {
2264                         if( !strcmp( hcamcorder->conf_main_info_table[category][i].name, name ) )
2265                         {
2266                                 *element = hcamcorder->conf_main_info_table[category][i].value_element;
2267                                 _mmcam_dbg_log( "Get[%s] element[%p]", name, *element );
2268                                 return TRUE;
2269                         }
2270                 }
2271         }
2272         else
2273         {
2274                 for( i = 0 ; i < count_value ; i++ )
2275                 {
2276                         if( !strcmp( hcamcorder->conf_ctrl_info_table[category][i].name, name ) )
2277                         {
2278                                 *element = hcamcorder->conf_ctrl_info_table[category][i].value_element;
2279                                 _mmcam_dbg_log( "Get[%s] element[%p]", name, *element );
2280                                 return TRUE;
2281                         }
2282                 }
2283         }
2284
2285         _mmcam_dbg_warn( "Failed to get default element... check it... Type[%d],Category[%d],Name[%s]", type, category, name );
2286
2287         return FALSE;
2288 }
2289
2290 int _mmcamcorder_conf_get_category_size(MMHandleType handle, int type, int category, int* size)
2291 {
2292         mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
2293
2294         if (hcamcorder == NULL) {
2295                 _mmcam_dbg_err("handle is NULL");
2296                 return FALSE;
2297         }
2298
2299 //      mmf_return_val_if_fail( conf_main_category_size, FALSE );
2300 //      mmf_return_val_if_fail( conf_ctrl_category_size, FALSE );
2301
2302         if( type == CONFIGURE_TYPE_MAIN )
2303         {
2304                 mmf_return_val_if_fail( category < CONFIGURE_CATEGORY_MAIN_NUM, FALSE );
2305
2306                 *size = (int)hcamcorder->conf_main_category_size[category];
2307         }
2308         else
2309         {
2310                 mmf_return_val_if_fail( category < CONFIGURE_CATEGORY_CTRL_NUM, FALSE );
2311
2312                 *size = (int)hcamcorder->conf_ctrl_category_size[category];
2313         }
2314
2315         return TRUE;
2316 }
2317
2318 void
2319 _mmcamcorder_conf_print_info(MMHandleType handle, camera_conf** configure_info )
2320 {
2321         int i, j, k, type, category_type;
2322
2323         type_int                *temp_int;
2324         type_int_range          *temp_int_range;
2325         type_int_array          *temp_int_array;
2326         type_int_pair_array     *temp_int_pair_array;
2327         type_string             *temp_string;
2328         type_element            *temp_element;
2329
2330         g_print( "[ConfigureInfoPrint] : Entered.\n" );
2331
2332         mmf_return_if_fail( *configure_info );
2333
2334         if( (*configure_info)->type == CONFIGURE_TYPE_MAIN )
2335         {
2336                 category_type = CONFIGURE_CATEGORY_MAIN_NUM;
2337         }
2338         else
2339         {
2340                 category_type = CONFIGURE_CATEGORY_CTRL_NUM;
2341         }
2342
2343         for( i = 0 ; i < category_type ; i++ )
2344         {
2345                 if( (*configure_info)->info[i] )
2346                 {
2347                         g_print( "[ConfigureInfo] : Category [%d]\n", i );
2348                         for( j = 0 ; j < (*configure_info)->info[i]->count ; j++ )
2349                         {
2350                                 if( _mmcamcorder_conf_get_value_type(handle, (*configure_info)->type, i, ((type_int*)((*configure_info)->info[i]->detail_info[j]))->name, &type ) )
2351                                 {
2352                                         switch( type )
2353                                         {
2354                                                 case CONFIGURE_VALUE_INT:
2355                                                         temp_int = (type_int*)((*configure_info)->info[i]->detail_info[j]);
2356                                                         g_print( "[ConfigureInfo] : INT - Name[%s],Value [%d]\n", temp_int->name, temp_int->value );
2357                                                         break;
2358                                                 case CONFIGURE_VALUE_INT_RANGE:
2359                                                         temp_int_range = (type_int_range*)((*configure_info)->info[i]->detail_info[j]);
2360                                                         g_print( "[ConfigureInfo] : INT_RANGE - Name[%s],Value [%d]~[%d], default [%d]\n",
2361                                                                  temp_int_range->name, temp_int_range->min, temp_int_range->max, temp_int_range->default_value );
2362                                                         break;
2363                                                 case CONFIGURE_VALUE_INT_ARRAY:
2364                                                         temp_int_array = (type_int_array*)((*configure_info)->info[i]->detail_info[j]);
2365                                                         g_print( "[ConfigureInfo] : INT_ARRAY - Name[%s], default [%d]\n                            - ",
2366                                                                  temp_int_array->name, temp_int_array->default_value );
2367                                                         for( k = 0 ; k < temp_int_array->count ; k++ )
2368                                                         {
2369                                                                 g_print( "[%d] ", temp_int_array->value[k] );
2370                                                         }
2371                                                         g_print( "\n" );
2372                                                         break;
2373                                                 case CONFIGURE_VALUE_INT_PAIR_ARRAY:
2374                                                         temp_int_pair_array = (type_int_pair_array*)((*configure_info)->info[i]->detail_info[j]);
2375                                                         g_print( "[ConfigureInfo] : INT_PAIR_ARRAY - Name[%s], default [%d][%d]\n                            - ",
2376                                                                  temp_int_pair_array->name, temp_int_pair_array->default_value[0], temp_int_pair_array->default_value[0] );
2377                                                         for( k = 0 ; k < temp_int_pair_array->count ; k++ )
2378                                                         {
2379                                                                 g_print( "[%d,%d] ", temp_int_pair_array->value[0][k], temp_int_pair_array->value[1][k] );
2380                                                         }
2381                                                         g_print( "\n" );
2382                                                         break;
2383                                                 case CONFIGURE_VALUE_STRING:
2384                                                         temp_string = (type_string*)((*configure_info)->info[i]->detail_info[j]);
2385                                                         g_print( "[ConfigureInfo] : STRING - Name[%s],Value[%s]\n", temp_string->name, temp_string->value );
2386                                                         break;
2387                                                 case CONFIGURE_VALUE_ELEMENT:
2388                                                         temp_element = (type_element*)((*configure_info)->info[i]->detail_info[j]);
2389                                                         g_print( "[ConfigureInfo] : Element - Name[%s],Element_Name[%s]\n", temp_element->name, temp_element->element_name );
2390                                                         for( k = 0 ; k < temp_element->count_int ; k++ )
2391                                                         {
2392                                                                 g_print( "                          - INT[%d] Name[%s],Value[%d]\n", k, temp_element->value_int[k]->name, temp_element->value_int[k]->value );
2393                                                         }
2394                                                         for( k = 0 ; k < temp_element->count_string ; k++ )
2395                                                         {
2396                                                                 g_print( "                          - STRING[%d] Name[%s],Value[%s]\n", k, temp_element->value_string[k]->name, temp_element->value_string[k]->value );
2397                                                         }
2398                                                         break;
2399                                                 default:
2400                                                         g_print( "[ConfigureInfo] : Not matched value type... So can not print data... check it... Name[%s],type[%d]\n", ((type_int*)((*configure_info)->info[i]->detail_info[j]))->name, type );
2401                                                         break;
2402                                         }
2403                                 }
2404                                 else
2405                                 {
2406                                         g_print( "[ConfigureInfo] : Failed to get value type." );
2407                                 }
2408                         }
2409                 }
2410         }
2411
2412         g_print( "[ConfigureInfoPrint] : Done.\n" );
2413 }
2414
2415
2416 static type_element *
2417 __mmcamcorder_get_audio_codec_element(MMHandleType handle)
2418 {
2419         type_element *telement = NULL;
2420         const char *codec_type_str = NULL;
2421         int codec_type = MM_AUDIO_CODEC_INVALID;
2422         mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2423         _MMCamcorderSubContext *sc = NULL;
2424
2425         mmf_return_val_if_fail(hcamcorder, NULL);
2426         sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2427
2428         mmf_return_val_if_fail(sc, NULL);
2429
2430         _mmcam_dbg_log("");
2431
2432         /* Check element availability */
2433         mm_camcorder_get_attributes(handle, NULL, MMCAM_AUDIO_ENCODER, &codec_type, NULL);
2434
2435         switch( codec_type )
2436         {
2437                 case MM_AUDIO_CODEC_AMR:
2438                         codec_type_str = "AMR";
2439                         break;
2440                 case MM_AUDIO_CODEC_G723_1:
2441                         codec_type_str = "G723_1";
2442                         break;
2443                 case MM_AUDIO_CODEC_MP3:
2444                         codec_type_str = "MP3";
2445                         break;
2446                 case MM_AUDIO_CODEC_AAC:
2447                         codec_type_str = "AAC";
2448                         break;
2449                 case MM_AUDIO_CODEC_MMF:
2450                         codec_type_str = "MMF";
2451                         break;
2452                 case MM_AUDIO_CODEC_ADPCM:
2453                         codec_type_str = "ADPCM";
2454                         break;
2455                 case MM_AUDIO_CODEC_WAVE:
2456                         codec_type_str = "WAVE";
2457                         break;
2458                 case MM_AUDIO_CODEC_MIDI:
2459                         codec_type_str = "MIDI";
2460                         break;
2461                 case MM_AUDIO_CODEC_IMELODY:
2462                         codec_type_str = "IMELODY";
2463                         break;
2464                 case MM_AUDIO_CODEC_VORBIS:
2465                         codec_type_str = "VORBIS";
2466                         break;
2467                 default:
2468                         _mmcam_dbg_err( "Not supported audio codec[%d]", codec_type );
2469                         return NULL;
2470         }
2471
2472         _mmcamcorder_conf_get_element(handle, hcamcorder->conf_main,
2473                                       CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER,
2474                                       codec_type_str,
2475                                       &telement);
2476
2477         return telement;
2478 }
2479
2480
2481 static type_element *
2482 __mmcamcorder_get_video_codec_element(MMHandleType handle)
2483 {
2484         type_element *telement = NULL;
2485         const char *codec_type_str = NULL;
2486         int codec_type = MM_VIDEO_CODEC_INVALID;
2487         mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2488         _MMCamcorderSubContext *sc = NULL;
2489
2490         mmf_return_val_if_fail(hcamcorder, NULL);
2491         sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2492
2493         mmf_return_val_if_fail(sc, NULL);
2494
2495         _mmcam_dbg_log("");
2496
2497         /* Check element availability */
2498         mm_camcorder_get_attributes(handle, NULL, MMCAM_VIDEO_ENCODER, &codec_type, NULL);
2499
2500         switch( codec_type )
2501         {
2502                 case MM_VIDEO_CODEC_H263:
2503                         codec_type_str = "H263";
2504                         break;
2505                 case MM_VIDEO_CODEC_H264:
2506                         codec_type_str = "H264";
2507                         break;
2508                 case MM_VIDEO_CODEC_H26L:
2509                         codec_type_str = "H26L";
2510                         break;
2511                 case MM_VIDEO_CODEC_MPEG4:
2512                         codec_type_str = "MPEG4";
2513                         break;
2514                 case MM_VIDEO_CODEC_MPEG1:
2515                         codec_type_str = "MPEG1";
2516                         break;
2517                 case MM_VIDEO_CODEC_THEORA:
2518                         codec_type_str = "THEORA";
2519                         break;
2520                 default:
2521                         _mmcam_dbg_err( "Not supported video codec[%d]", codec_type );
2522                         return NULL;
2523         }
2524
2525         _mmcamcorder_conf_get_element(handle, hcamcorder->conf_main,
2526                                       CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER,
2527                                       codec_type_str,
2528                                       &telement);
2529
2530         return telement;
2531 }
2532
2533
2534 static type_element *
2535 __mmcamcorder_get_image_codec_element(MMHandleType handle)
2536 {
2537         type_element *telement = NULL;
2538         const char *codec_type_str = NULL;
2539         int codec_type = MM_IMAGE_CODEC_INVALID;
2540         mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2541         _MMCamcorderSubContext *sc = NULL;
2542
2543         mmf_return_val_if_fail(hcamcorder, NULL);
2544         sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2545
2546         mmf_return_val_if_fail(sc, NULL);
2547
2548         _mmcam_dbg_log("");
2549
2550         /* Check element availability */
2551         mm_camcorder_get_attributes(handle, NULL, MMCAM_IMAGE_ENCODER, &codec_type, NULL);
2552
2553         switch( codec_type )
2554         {
2555                 case MM_IMAGE_CODEC_JPEG:
2556                         codec_type_str = "JPEG";
2557                         break;
2558                 case MM_IMAGE_CODEC_SRW:
2559                         codec_type_str = "SRW";
2560                         break;
2561                 case MM_IMAGE_CODEC_JPEG_SRW:
2562                         codec_type_str = "JPEG_SRW";
2563                         break;
2564                 case MM_IMAGE_CODEC_PNG:
2565                         codec_type_str = "PNG";
2566                         break;
2567                 case MM_IMAGE_CODEC_BMP:
2568                         codec_type_str = "BMP";
2569                         break;
2570                 case MM_IMAGE_CODEC_WBMP:
2571                         codec_type_str = "WBMP";
2572                         break;
2573                 case MM_IMAGE_CODEC_TIFF:
2574                         codec_type_str = "TIFF";
2575                         break;
2576                 case MM_IMAGE_CODEC_PCX:
2577                         codec_type_str = "PCX";
2578                         break;
2579                 case MM_IMAGE_CODEC_GIF:
2580                         codec_type_str = "GIF";
2581                         break;
2582                 case MM_IMAGE_CODEC_ICO:
2583                         codec_type_str = "ICO";
2584                         break;
2585                 case MM_IMAGE_CODEC_RAS:
2586                         codec_type_str = "RAS";
2587                         break;
2588                 case MM_IMAGE_CODEC_TGA:
2589                         codec_type_str = "TGA";
2590                         break;
2591                 case MM_IMAGE_CODEC_XBM:
2592                         codec_type_str = "XBM";
2593                         break;
2594                 case MM_IMAGE_CODEC_XPM:
2595                         codec_type_str = "XPM";
2596                         break;
2597                 default:
2598                         _mmcam_dbg_err( "Not supported image codec[%d]", codec_type );
2599                         return NULL;
2600         }
2601
2602         _mmcamcorder_conf_get_element(handle, hcamcorder->conf_main,
2603                                       CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER,
2604                                       codec_type_str,
2605                                       &telement);
2606
2607         return telement;
2608 }
2609
2610
2611 static type_element *
2612 __mmcamcorder_get_file_format_element(MMHandleType handle)
2613 {
2614         type_element *telement = NULL;
2615         const char *mux_type_str = NULL;
2616         int file_type = MM_FILE_FORMAT_INVALID;
2617         mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2618         _MMCamcorderSubContext *sc = NULL;
2619
2620         mmf_return_val_if_fail(hcamcorder, NULL);
2621         sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2622
2623         mmf_return_val_if_fail(sc, NULL);
2624
2625         _mmcam_dbg_log("");
2626
2627         /* Check element availability */
2628         mm_camcorder_get_attributes(handle, NULL, MMCAM_FILE_FORMAT, &file_type, NULL);
2629
2630         switch( file_type )
2631         {
2632                 case MM_FILE_FORMAT_3GP:
2633                         mux_type_str = "3GP";
2634                         break;
2635                 case MM_FILE_FORMAT_AMR:
2636                         mux_type_str = "AMR";
2637                         break;
2638                 case MM_FILE_FORMAT_MP4:
2639                         mux_type_str = "MP4";
2640                         break;
2641                 case MM_FILE_FORMAT_AAC:
2642                         mux_type_str = "AAC";
2643                         break;
2644                 case MM_FILE_FORMAT_MP3:
2645                         mux_type_str = "MP3";
2646                         break;
2647                 case MM_FILE_FORMAT_OGG:
2648                         mux_type_str = "OGG";
2649                         break;
2650                 case MM_FILE_FORMAT_WAV:
2651                         mux_type_str = "WAV";
2652                         break;
2653                 case MM_FILE_FORMAT_AVI:
2654                         mux_type_str = "AVI";
2655                         break;
2656                 case MM_FILE_FORMAT_WMA:
2657                         mux_type_str = "WMA";
2658                         break;
2659                 case MM_FILE_FORMAT_WMV:
2660                         mux_type_str = "WMV";
2661                         break;
2662                 case MM_FILE_FORMAT_MID:
2663                         mux_type_str = "MID";
2664                         break;
2665                 case MM_FILE_FORMAT_MMF:
2666                         mux_type_str = "MMF";
2667                         break;
2668                 case MM_FILE_FORMAT_MATROSKA:
2669                         mux_type_str = "MATROSKA";
2670                         break;
2671                 case MM_FILE_FORMAT_M2TS:
2672                         mux_type_str = "M2TS";
2673                         break;
2674                 default:
2675                         _mmcam_dbg_err( "Not supported file format[%d]", file_type );
2676                         return NULL;
2677         }
2678
2679         _mmcamcorder_conf_get_element(handle, hcamcorder->conf_main,
2680                                       CONFIGURE_CATEGORY_MAIN_MUX,
2681                                       mux_type_str,
2682                                       &telement);
2683
2684         return telement;
2685 }
2686
2687
2688 type_element *
2689 _mmcamcorder_get_type_element(MMHandleType handle, int type)
2690 {
2691         type_element *telement = NULL;
2692
2693         _mmcam_dbg_log("type:%d", type);
2694
2695         switch(type)
2696         {
2697                 case MM_CAM_AUDIO_ENCODER:
2698                         telement = __mmcamcorder_get_audio_codec_element(handle);
2699                         break;
2700                 case MM_CAM_VIDEO_ENCODER:
2701                         telement = __mmcamcorder_get_video_codec_element(handle);
2702                         break;
2703                 case MM_CAM_IMAGE_ENCODER:
2704                         telement = __mmcamcorder_get_image_codec_element(handle);
2705                         break;
2706                 case MM_CAM_FILE_FORMAT:
2707                         telement = __mmcamcorder_get_file_format_element(handle);
2708                         break;
2709                 default :
2710                         _mmcam_dbg_log("Can't get element type form this profile.(%d)", type);
2711         }
2712
2713         return telement;
2714 }
2715
2716
2717 int _mmcamcorder_get_audio_codec_format(MMHandleType handle, const char *name)
2718 {
2719         int codec_index = MM_AUDIO_CODEC_INVALID;
2720
2721         if (!name) {
2722                 _mmcam_dbg_err("name is NULL");
2723                 return MM_AUDIO_CODEC_INVALID;
2724         }
2725
2726         if (!strcmp(name, "AMR")) {
2727                 codec_index = MM_AUDIO_CODEC_AMR;
2728         } else if (!strcmp(name, "G723_1")) {
2729                 codec_index = MM_AUDIO_CODEC_G723_1;
2730         } else if (!strcmp(name, "MP3")) {
2731                 codec_index = MM_AUDIO_CODEC_MP3;
2732         } else if (!strcmp(name, "AAC")) {
2733                 codec_index = MM_AUDIO_CODEC_AAC;
2734         } else if (!strcmp(name, "MMF")) {
2735                 codec_index = MM_AUDIO_CODEC_MMF;
2736         } else if (!strcmp(name, "ADPCM")) {
2737                 codec_index = MM_AUDIO_CODEC_ADPCM;
2738         } else if (!strcmp(name, "WAVE")) {
2739                 codec_index = MM_AUDIO_CODEC_WAVE;
2740         } else if (!strcmp(name, "MIDI")) {
2741                 codec_index = MM_AUDIO_CODEC_MIDI;
2742         } else if (!strcmp(name, "IMELODY")) {
2743                 codec_index = MM_AUDIO_CODEC_IMELODY;
2744         } else if (!strcmp(name, "VORBIS")) {
2745                 codec_index = MM_AUDIO_CODEC_VORBIS;
2746         }
2747
2748         /*_mmcam_dbg_log("audio codec index %d", codec_index);*/
2749
2750         return codec_index;
2751 }
2752
2753
2754
2755 int _mmcamcorder_get_video_codec_format(MMHandleType handle, const char *name)
2756 {
2757         int codec_index = MM_VIDEO_CODEC_INVALID;
2758
2759         if (!name) {
2760                 _mmcam_dbg_err("name is NULL");
2761                 return MM_VIDEO_CODEC_INVALID;
2762         }
2763
2764         if (!strcmp(name, "H263")) {
2765                 codec_index = MM_VIDEO_CODEC_H263;
2766         } else if (!strcmp(name, "H264")) {
2767                 codec_index = MM_VIDEO_CODEC_H264;
2768         } else if (!strcmp(name, "H26L")) {
2769                 codec_index = MM_VIDEO_CODEC_H26L;
2770         } else if (!strcmp(name, "MPEG4")) {
2771                 codec_index = MM_VIDEO_CODEC_MPEG4;
2772         } else if (!strcmp(name, "MPEG1")) {
2773                 codec_index = MM_VIDEO_CODEC_MPEG1;
2774         } else if (!strcmp(name, "THEORA")) {
2775                 codec_index = MM_VIDEO_CODEC_THEORA;
2776         }
2777
2778         /*_mmcam_dbg_log("video codec index %d", codec_index);*/
2779
2780         return codec_index;
2781 }
2782
2783
2784
2785 int _mmcamcorder_get_image_codec_format(MMHandleType handle, const char *name)
2786 {
2787         int codec_index = MM_IMAGE_CODEC_INVALID;
2788
2789         if (!name) {
2790                 _mmcam_dbg_err("name is NULL");
2791                 return MM_IMAGE_CODEC_INVALID;
2792         }
2793
2794         if (!strcmp(name, "JPEG")) {
2795                 codec_index = MM_IMAGE_CODEC_JPEG;
2796         } else if (!strcmp(name, "PNG")) {
2797                 codec_index = MM_IMAGE_CODEC_PNG;
2798         } else if (!strcmp(name, "BMP")) {
2799                 codec_index = MM_IMAGE_CODEC_BMP;
2800         } else if (!strcmp(name, "WBMP")) {
2801                 codec_index = MM_IMAGE_CODEC_WBMP;
2802         } else if (!strcmp(name, "TIFF")) {
2803                 codec_index = MM_IMAGE_CODEC_TIFF;
2804         } else if (!strcmp(name, "PCX")) {
2805                 codec_index = MM_IMAGE_CODEC_PCX;
2806         } else if (!strcmp(name, "GIF")) {
2807                 codec_index = MM_IMAGE_CODEC_GIF;
2808         } else if (!strcmp(name, "ICO")) {
2809                 codec_index = MM_IMAGE_CODEC_ICO;
2810         } else if (!strcmp(name, "RAS")) {
2811                 codec_index = MM_IMAGE_CODEC_RAS;
2812         } else if (!strcmp(name, "TGA")) {
2813                 codec_index = MM_IMAGE_CODEC_TGA;
2814         } else if (!strcmp(name, "XBM")) {
2815                 codec_index = MM_IMAGE_CODEC_XBM;
2816         } else if (!strcmp(name, "XPM")) {
2817                 codec_index = MM_IMAGE_CODEC_XPM;
2818         }
2819
2820         _mmcam_dbg_log("image codec index %d", codec_index);
2821
2822         return codec_index;
2823 }
2824
2825
2826 int _mmcamcorder_get_mux_format(MMHandleType handle, const char *name)
2827 {
2828         int mux_index = MM_FILE_FORMAT_INVALID;
2829
2830         if (!name) {
2831                 _mmcam_dbg_err("name is NULL");
2832                 return MM_FILE_FORMAT_INVALID;
2833         }
2834
2835         if (!strcmp(name, "3GP")) {
2836                 mux_index = MM_FILE_FORMAT_3GP;
2837         } else if (!strcmp(name, "AMR")) {
2838                 mux_index = MM_FILE_FORMAT_AMR;
2839         } else if (!strcmp(name, "MP4")) {
2840                 mux_index = MM_FILE_FORMAT_MP4;
2841         } else if (!strcmp(name, "AAC")) {
2842                 mux_index = MM_FILE_FORMAT_AAC;
2843         } else if (!strcmp(name, "MP3")) {
2844                 mux_index = MM_FILE_FORMAT_MP3;
2845         } else if (!strcmp(name, "OGG")) {
2846                 mux_index = MM_FILE_FORMAT_OGG;
2847         } else if (!strcmp(name, "WAV")) {
2848                 mux_index = MM_FILE_FORMAT_WAV;
2849         } else if (!strcmp(name, "AVI")) {
2850                 mux_index = MM_FILE_FORMAT_AVI;
2851         } else if (!strcmp(name, "WMA")) {
2852                 mux_index = MM_FILE_FORMAT_WMA;
2853         } else if (!strcmp(name, "WMV")) {
2854                 mux_index = MM_FILE_FORMAT_WMV;
2855         } else if (!strcmp(name, "MID")) {
2856                 mux_index = MM_FILE_FORMAT_MID;
2857         } else if (!strcmp(name, "MMF")) {
2858                 mux_index = MM_FILE_FORMAT_MMF;
2859         } else if (!strcmp(name, "MATROSKA")) {
2860                 mux_index = MM_FILE_FORMAT_MATROSKA;
2861         } else if (!strcmp(name, "M2TS")) {
2862                 mux_index = MM_FILE_FORMAT_M2TS;
2863
2864         }
2865
2866         /*_mmcam_dbg_log("mux index %d", mux_index);*/
2867
2868         return mux_index;
2869 }
2870
2871
2872 int
2873 _mmcamcorder_get_format(MMHandleType handle, int conf_category, const char *name)
2874 {
2875         int fmt = -1;
2876
2877         mmf_return_val_if_fail(name, -1);
2878
2879         switch(conf_category)
2880         {
2881                 case CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER:
2882                         fmt = _mmcamcorder_get_audio_codec_format(handle, name);
2883                         break;
2884                 case CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER:
2885                         fmt = _mmcamcorder_get_video_codec_format(handle, name);
2886                         break;
2887                 case CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER:
2888                         fmt = _mmcamcorder_get_image_codec_format(handle, name);
2889                         break;
2890                 case CONFIGURE_CATEGORY_MAIN_MUX:
2891                         fmt = _mmcamcorder_get_mux_format(handle, name);
2892                         break;
2893                 default :
2894                         _mmcam_dbg_log("Can't get format from this category.(%d)", conf_category);
2895         }
2896
2897         return fmt;
2898 }
2899
2900 int
2901 _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** format)
2902 {
2903         mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2904         camera_conf* configure_info = NULL;
2905         int *arr = NULL;
2906         int total_count = 0;
2907
2908         mmf_return_val_if_fail(hcamcorder, 0);
2909
2910         /*_mmcam_dbg_log("conf_category:%d", conf_category);*/
2911
2912         configure_info = hcamcorder->conf_main;
2913
2914         if (configure_info->info[conf_category]) {
2915                 int i = 0;
2916                 int fmt = 0;
2917                 const char *name = NULL;
2918                 int count = configure_info->info[conf_category]->count;
2919                 conf_detail *info = configure_info->info[conf_category];
2920
2921                 /*_mmcam_dbg_log("count[%d], info[%p]", count, info);*/
2922
2923                 if (count <= 0 || !info) {
2924                         return total_count;
2925                 }
2926
2927                 arr = (int*) g_malloc0(count * sizeof(int));
2928                 if (arr == NULL) {
2929                         _mmcam_dbg_err("malloc failed : %d", count * sizeof(int));
2930                         return 0;
2931                 }
2932
2933                 for (i = 0 ; i < count ; i++) {
2934                         if (info->detail_info[i] == NULL) {
2935                                 continue;
2936                         }
2937
2938                         name = ((type_element*)(info->detail_info[i]))->name;
2939                         fmt = _mmcamcorder_get_format(handle, conf_category, name);
2940                         if (fmt >= 0) {
2941                                 arr[total_count++] = fmt;
2942                         }
2943
2944                         /*_mmcam_dbg_log("name:%s, fmt:%d", name, fmt);*/
2945                 }
2946         }
2947
2948         *format = arr;
2949
2950         return total_count;
2951 }