4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 /*===========================================================================================
26 ========================================================================================== */
32 #include "mm_camcorder_internal.h"
33 #include "mm_camcorder_configure.h"
35 /*---------------------------------------------------------------------------
36 | MACRO DEFINITIONS: |
37 ---------------------------------------------------------------------------*/
38 #define CONFIGURE_PATH "/opt/etc"
39 #define CONFIGURE_PATH_RETRY "/usr/etc"
41 /*---------------------------------------------------------------------------
42 | GLOBAL VARIABLE DEFINITIONS |
43 ---------------------------------------------------------------------------*/
45 /*---------------------------------------------------------------------------
46 | LOCAL VARIABLE DEFINITIONS |
47 ---------------------------------------------------------------------------*/
48 static int conf_main_category_size[CONFIGURE_CATEGORY_MAIN_NUM] = { 0, };
49 static int conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_NUM] = { 0, };
51 static conf_info_table* conf_main_info_table[CONFIGURE_CATEGORY_MAIN_NUM] = { NULL, };
52 static conf_info_table* conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_NUM] = { NULL, };
55 * Videosrc element default value
57 static type_element _videosrc_element_default = {
67 * Audiosrc element default value
69 static type_int ___audiosrc_default_channel = { "Channel", 1 };
70 static type_int ___audiosrc_default_bitrate = { "BitRate", 8000 };
71 static type_int ___audiosrc_default_depth = { "Depth", 16 };
72 static type_int ___audiosrc_default_blocksize = { "BlockSize", 1280 };
73 static type_int* __audiosrc_default_int_array[] = {
74 &___audiosrc_default_channel,
75 &___audiosrc_default_bitrate,
76 &___audiosrc_default_depth,
77 &___audiosrc_default_blocksize,
79 static type_string ___audiosrc_default_device = { "Device", "default" };
80 static type_string* __audiosrc_default_string_array[] = {
81 &___audiosrc_default_device,
83 static type_element _audiosrc_element_default = {
86 __audiosrc_default_int_array,
87 sizeof( __audiosrc_default_int_array ) / sizeof( type_int* ),
88 __audiosrc_default_string_array,
89 sizeof( __audiosrc_default_string_array ) / sizeof( type_string* ),
92 static type_element _audiomodemsrc_element_default = {
93 "AudiomodemsrcElement",
95 __audiosrc_default_int_array,
96 sizeof( __audiosrc_default_int_array ) / sizeof( type_int* ),
97 __audiosrc_default_string_array,
98 sizeof( __audiosrc_default_string_array ) / sizeof( type_string* ),
103 * Videosink element default value
105 static type_int ___videosink_default_display_id = { "display-id", 3 };
106 static type_int ___videosink_default_x = { "x", 0 };
107 static type_int ___videosink_default_y = { "y", 0 };
108 static type_int ___videosink_default_width = { "width", 800 };
109 static type_int ___videosink_default_height = { "height", 480 };
110 static type_int ___videosink_default_rotation = { "rotation", 1 };
111 static type_int* __videosink_default_int_array[] = {
112 &___videosink_default_display_id,
113 &___videosink_default_x,
114 &___videosink_default_y,
115 &___videosink_default_width,
116 &___videosink_default_height,
117 &___videosink_default_rotation,
119 static type_string* __videosink_default_string_array[] = { NULL };
120 static type_element _videosink_element_x_default = {
123 __videosink_default_int_array,
124 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
125 __videosink_default_string_array,
126 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
128 static type_element _videosink_element_evas_default = {
129 "VideosinkElementEvas",
131 __videosink_default_int_array,
132 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
133 __videosink_default_string_array,
134 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
136 static type_element _videosink_element_gl_default = {
137 "VideosinkElementGL",
139 __videosink_default_int_array,
140 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
141 __videosink_default_string_array,
142 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
144 static type_element _videosink_element_null_default = {
145 "VideosinkElementNull",
147 __videosink_default_int_array,
148 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
149 __videosink_default_string_array,
150 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
154 * Videoscale element default value
156 static type_element _videoscale_element_default = {
166 * Record sink element default value
168 static type_element _recordsink_element_default = {
178 * H263 element default value
180 static type_element _h263_element_default = {
190 * H264 element default value
192 static type_element _h264_element_default = {
202 * H26L element default value
204 static type_element _h26l_element_default = {
214 * MPEG4 element default value
216 static type_element _mpeg4_element_default = {
226 * MPEG1 element default value
228 static type_element _mpeg1_element_default = {
238 * THEORA element default value
240 static type_element _theora_element_default = {
250 * AMR element default value
252 static type_element _amr_element_default = {
262 * G723_1 element default value
264 static type_element _g723_1_element_default = {
274 * MP3 element default value
276 static type_element _mp3_element_default = {
286 * AAC element default value
288 static type_element _aac_element_default = {
298 * MMF element default value
300 static type_element _mmf_element_default = {
310 * ADPCM element default value
312 static type_element _adpcm_element_default = {
314 "ffenc_adpcm_ima_qt",
322 * WAVE element default value
324 static type_element _wave_element_default = {
333 static type_element _vorbis_element_default = {
343 * MIDI element default value
345 static type_element _midi_element_default = {
355 * IMELODY element default value
357 static type_element _imelody_element_default = {
367 * JPEG element default value
369 static type_element _jpeg_element_default = {
379 * PNG element default value
381 static type_element _png_element_default = {
391 * BMP element default value
393 static type_element _bmp_element_default = {
403 * WBMP element default value
405 static type_element _wbmp_element_default = {
415 * TIFF element default value
417 static type_element _tiff_element_default = {
427 * PCX element default value
429 static type_element _pcx_element_default = {
439 * GIF element default value
441 static type_element _gif_element_default = {
451 * ICO element default value
453 static type_element _ico_element_default = {
463 * RAS element default value
465 static type_element _ras_element_default = {
475 * TGA element default value
477 static type_element _tga_element_default = {
487 * XBM element default value
489 static type_element _xbm_element_default = {
499 * XPM element default value
501 static type_element _xpm_element_default = {
511 * 3GP element default value
513 static type_element _3gp_element_default = {
523 * AMR mux element default value
525 static type_element _amrmux_element_default = {
535 * MP4 element default value
537 static type_element _mp4_element_default = {
547 * AAC mux element default value
549 static type_element _aacmux_element_default = {
559 * MP3 mux element default value
561 static type_element _mp3mux_element_default = {
571 * OGG element default value
573 static type_element _ogg_element_default = {
583 * WAV element default value
585 static type_element _wav_element_default = {
595 * AVI element default value
597 static type_element _avi_element_default = {
607 * WMA element default value
609 static type_element _wma_element_default = {
619 * WMV element default value
621 static type_element _wmv_element_default = {
631 * MID element default value
633 static type_element _mid_element_default = {
643 * MMF mux element default value
645 static type_element _mmfmux_element_default = {
655 * MATROSKA element default value
657 static type_element _matroska_element_default = {
667 * [General] matching table
669 static conf_info_table conf_main_general_table[] = {
670 { "SyncStateChange", CONFIGURE_VALUE_INT, {1} },
671 { "GSTInitOption", CONFIGURE_VALUE_STRING_ARRAY, {NULL} },
672 { "ModelName", CONFIGURE_VALUE_STRING, {(char*)"Samsung Camera"} },
673 { "DisabledAttributes", CONFIGURE_VALUE_STRING_ARRAY, {NULL} },
677 * [VideoInput] matching table
679 static conf_info_table conf_main_video_input_table[] = {
680 { "UseConfCtrl", CONFIGURE_VALUE_INT, {1} },
681 { "ConfCtrlFile0", CONFIGURE_VALUE_STRING, {(char*)"mmfw_camcorder_dev_video_pri.ini"} },
682 { "ConfCtrlFile1", CONFIGURE_VALUE_STRING, {(char*)"mmfw_camcorder_dev_video_sec.ini"} },
683 { "VideosrcElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videosrc_element_default} },
684 { "UseVideoscale", CONFIGURE_VALUE_INT, {0} },
685 { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videoscale_element_default} },
686 { "UseZeroCopyFormat", CONFIGURE_VALUE_INT, {0} },
690 * [AudioInput] matching table
692 static conf_info_table conf_main_audio_input_table[] = {
693 { "AudiosrcElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_audiosrc_element_default} },
694 { "AudiomodemsrcElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_audiomodemsrc_element_default} },
698 * [VideoOutput] matching table
700 static conf_info_table conf_main_video_output_table[] = {
701 { "DisplayDevice", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
702 { "Videosink", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
703 { "VideosinkElementX", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videosink_element_x_default} },
704 { "VideosinkElementEvas", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videosink_element_evas_default} },
705 { "VideosinkElementGL", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videosink_element_gl_default} },
706 { "VideosinkElementNull", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videosink_element_null_default} },
707 { "UseVideoscale", CONFIGURE_VALUE_INT, {0} },
708 { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videoscale_element_default} },
712 * [Capture] matching table
714 static conf_info_table conf_main_capture_table[] = {
715 { "UseEncodebin", CONFIGURE_VALUE_INT, {0} },
716 { "UseCaptureMode", CONFIGURE_VALUE_INT, {0} },
717 { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_videoscale_element_default} },
721 * [Record] matching table
723 static conf_info_table conf_main_record_table[] = {
724 { "UseAudioEncoderQueue", CONFIGURE_VALUE_INT, {1} },
725 { "UseVideoEncoderQueue", CONFIGURE_VALUE_INT, {1} },
726 { "VideoProfile", CONFIGURE_VALUE_INT, {0} },
727 { "VideoAutoAudioConvert", CONFIGURE_VALUE_INT, {0} },
728 { "VideoAutoAudioResample", CONFIGURE_VALUE_INT, {0} },
729 { "VideoAutoColorSpace", CONFIGURE_VALUE_INT, {0} },
730 { "AudioProfile", CONFIGURE_VALUE_INT, {0} },
731 { "AudioAutoAudioConvert", CONFIGURE_VALUE_INT, {0} },
732 { "AudioAutoAudioResample", CONFIGURE_VALUE_INT, {0} },
733 { "AudioAutoColorSpace", CONFIGURE_VALUE_INT, {0} },
734 { "ImageProfile", CONFIGURE_VALUE_INT, {0} },
735 { "ImageAutoAudioConvert", CONFIGURE_VALUE_INT, {0} },
736 { "ImageAutoAudioResample", CONFIGURE_VALUE_INT, {0} },
737 { "ImageAutoColorSpace", CONFIGURE_VALUE_INT, {0} },
738 { "RecordsinkElement", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_recordsink_element_default} },
739 { "UseNoiseSuppressor", CONFIGURE_VALUE_INT, {0} },
740 { "DropVideoFrame", CONFIGURE_VALUE_INT, {0} },
741 { "PassFirstVideoFrame", CONFIGURE_VALUE_INT, {0} },
745 * [VideoEncoder] matching table
747 static conf_info_table conf_main_video_encoder_table[] = {
748 { "H263", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_h263_element_default} },
749 { "H264", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_h264_element_default} },
750 { "H26L", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_h26l_element_default} },
751 { "MPEG4", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mpeg4_element_default} },
752 { "MPEG1", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mpeg1_element_default} },
753 { "THEORA", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_theora_element_default} },
757 * [AudioEncoder] matching table
759 static conf_info_table conf_main_audio_encoder_table[] = {
760 { "AMR", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_amr_element_default} },
761 { "G723_1", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_g723_1_element_default} },
762 { "MP3", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mp3_element_default} },
763 { "AAC", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_aac_element_default} },
764 { "MMF", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mmf_element_default} },
765 { "ADPCM", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_adpcm_element_default} },
766 { "WAVE", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_wave_element_default} },
767 { "MIDI", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_midi_element_default} },
768 { "IMELODY", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_imelody_element_default} },
769 { "VORBIS", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_vorbis_element_default} },
773 * [ImageEncoder] matching table
775 static conf_info_table conf_main_image_encoder_table[] = {
776 { "JPEG", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_jpeg_element_default} },
777 { "PNG", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_png_element_default} },
778 { "BMP", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_bmp_element_default} },
779 { "WBMP", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_wbmp_element_default} },
780 { "TIFF", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_tiff_element_default} },
781 { "PCX", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_pcx_element_default} },
782 { "GIF", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_gif_element_default} },
783 { "ICO", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_ico_element_default} },
784 { "RAS", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_ras_element_default} },
785 { "TGA", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_tga_element_default} },
786 { "XBM", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_xbm_element_default} },
787 { "XPM", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_xpm_element_default} },
791 * [Mux] matching table
793 static conf_info_table conf_main_mux_table[] = {
794 { "3GP", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_3gp_element_default} },
795 { "AMR", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_amrmux_element_default} },
796 { "MP4", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mp4_element_default} },
797 { "AAC", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_aacmux_element_default} },
798 { "MP3", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mp3mux_element_default} },
799 { "OGG", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_ogg_element_default} },
800 { "WAV", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_wav_element_default} },
801 { "AVI", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_avi_element_default} },
802 { "WMA", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_wma_element_default} },
803 { "WMV", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_wmv_element_default} },
804 { "MID", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mid_element_default} },
805 { "MMF", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_mmfmux_element_default} },
806 { "MATROSKA", CONFIGURE_VALUE_ELEMENT, {(type_element*)&_matroska_element_default} },
815 * [Camera] matching table
817 static conf_info_table conf_ctrl_camera_table[] = {
818 { "InputIndex", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
819 { "DeviceName", CONFIGURE_VALUE_STRING, {NULL} },
820 { "PreviewResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
821 { "CaptureResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
822 { "FPS", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
823 { "PictureFormat", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
824 { "Overlay", CONFIGURE_VALUE_INT_RANGE, {NULL} },
825 { "RecommendDisplayRotation", CONFIGURE_VALUE_INT, {3} },
826 { "RecommendPreviewFormatCapture", CONFIGURE_VALUE_INT, {MM_PIXEL_FORMAT_YUYV} },
827 { "RecommendPreviewFormatRecord", CONFIGURE_VALUE_INT, {MM_PIXEL_FORMAT_NV12} },
831 * [Strobe] matching table
833 static conf_info_table conf_ctrl_strobe_table[] = {
834 { "StrobeControl", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
835 { "StrobeMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
836 { "StrobeEV", CONFIGURE_VALUE_INT_RANGE, {NULL} },
840 * [Effect] matching table
842 static conf_info_table conf_ctrl_effect_table[] = {
843 { "Brightness", CONFIGURE_VALUE_INT_RANGE, {NULL} },
844 { "Contrast", CONFIGURE_VALUE_INT_RANGE, {NULL} },
845 { "Saturation", CONFIGURE_VALUE_INT_RANGE, {NULL} },
846 { "Sharpness", CONFIGURE_VALUE_INT_RANGE, {NULL} },
847 { "WhiteBalance", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
848 { "ColorTone", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
849 { "Flip", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
850 { "WDR", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
851 { "PartColorMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
852 { "PartColor", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
856 * [Photograph] matching table
858 static conf_info_table conf_ctrl_photograph_table[] = {
859 { "LensInit", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
860 { "DigitalZoom", CONFIGURE_VALUE_INT_RANGE, {NULL} },
861 { "OpticalZoom", CONFIGURE_VALUE_INT_RANGE, {NULL} },
862 { "FocusMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
863 { "AFType", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
864 { "AEType", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
865 { "ExposureValue", CONFIGURE_VALUE_INT_RANGE, {NULL} },
866 { "FNumber", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
867 { "ShutterSpeed", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
868 { "ISO", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
869 { "ProgramMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
870 { "AntiHandshake", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
874 * [Capture] matching table
876 static conf_info_table conf_ctrl_capture_table[] = {
877 { "OutputMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
878 { "JpegQuality", CONFIGURE_VALUE_INT_RANGE, {NULL} },
879 { "MultishotNumber", CONFIGURE_VALUE_INT_RANGE, {NULL} },
880 { "SensorEncodedCapture", CONFIGURE_VALUE_INT, {1} },
884 * [Detect] matching table
886 static conf_info_table conf_ctrl_detect_table[] = {
887 { "DetectMode", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
888 { "DetectNumber", CONFIGURE_VALUE_INT_RANGE, {NULL} },
889 { "DetectSelect", CONFIGURE_VALUE_INT_RANGE, {NULL} },
890 { "DetectSelectNumber", CONFIGURE_VALUE_INT_RANGE, {NULL} },
896 get_new_string( char* src_string )
898 return strdup(src_string);
902 _mmcamcorder_conf_init( int type, camera_conf** configure_info )
905 int info_table_size = sizeof( conf_info_table );
907 _mmcam_dbg_log( "Entered..." );
909 if( type == CONFIGURE_TYPE_MAIN )
911 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_GENERAL] = conf_main_general_table;
912 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT] = conf_main_video_input_table;
913 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT] = conf_main_audio_input_table;
914 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT] = conf_main_video_output_table;
915 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_CAPTURE] = conf_main_capture_table;
916 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_RECORD] = conf_main_record_table;
917 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER] = conf_main_video_encoder_table;
918 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER] = conf_main_audio_encoder_table;
919 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER] = conf_main_image_encoder_table;
920 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_MUX] = conf_main_mux_table;
922 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_GENERAL] = sizeof( conf_main_general_table ) / info_table_size;
923 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT] = sizeof( conf_main_video_input_table ) / info_table_size;
924 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT] = sizeof( conf_main_audio_input_table ) / info_table_size;
925 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT] = sizeof( conf_main_video_output_table ) / info_table_size;
926 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_CAPTURE] = sizeof( conf_main_capture_table ) / info_table_size;
927 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_RECORD] = sizeof( conf_main_record_table ) / info_table_size;
928 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER] = sizeof( conf_main_video_encoder_table ) / info_table_size;
929 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER] = sizeof( conf_main_audio_encoder_table ) / info_table_size;
930 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER] = sizeof( conf_main_image_encoder_table ) / info_table_size;
931 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_MUX] = sizeof( conf_main_mux_table ) / info_table_size;
933 (*configure_info)->info = (conf_info**)g_malloc0( sizeof( conf_info* ) * CONFIGURE_CATEGORY_MAIN_NUM );
935 for( i = 0 ; i < CONFIGURE_CATEGORY_MAIN_NUM ; i++ )
937 (*configure_info)->info[i] = NULL;
942 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_CAMERA] = conf_ctrl_camera_table;
943 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_STROBE] = conf_ctrl_strobe_table;
944 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_EFFECT] = conf_ctrl_effect_table;
945 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH] = conf_ctrl_photograph_table;
946 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_CAPTURE] = conf_ctrl_capture_table;
947 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_DETECT] = conf_ctrl_detect_table;
949 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_CAMERA] = sizeof( conf_ctrl_camera_table ) / info_table_size;
950 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_STROBE] = sizeof( conf_ctrl_strobe_table ) / info_table_size;
951 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_EFFECT] = sizeof( conf_ctrl_effect_table ) / info_table_size;
952 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH] = sizeof( conf_ctrl_photograph_table ) / info_table_size;
953 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_CAPTURE] = sizeof( conf_ctrl_capture_table ) / info_table_size;
954 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_DETECT] = sizeof( conf_ctrl_detect_table ) / info_table_size;
956 (*configure_info)->info = (conf_info**)g_malloc0( sizeof( conf_info* ) * CONFIGURE_CATEGORY_CTRL_NUM );
958 for( i = 0 ; i < CONFIGURE_CATEGORY_CTRL_NUM ; i++ )
960 (*configure_info)->info[i] = NULL;
964 _mmcam_dbg_log( "Done." );
970 _mmcamcorder_conf_get_info( int type, char* ConfFile, camera_conf** configure_info )
972 int ret = MM_ERROR_NONE;
974 char* conf_path = NULL;
976 _mmcam_dbg_log( "Opening...[%s]", ConfFile );
978 mmf_return_val_if_fail( ConfFile, FALSE );
980 conf_path = (char*)malloc( strlen(ConfFile)+strlen(CONFIGURE_PATH)+3 );
982 if( conf_path == NULL )
984 _mmcam_dbg_err( "malloc failed." );
985 return MM_ERROR_CAMCORDER_LOW_MEMORY;
988 snprintf( conf_path, strlen(ConfFile)+strlen(CONFIGURE_PATH)+2, "%s/%s", CONFIGURE_PATH, ConfFile );
989 _mmcam_dbg_log( "Try open Configure File[%s]", conf_path );
991 fd = fopen( conf_path, "r" );
994 _mmcam_dbg_warn( "File open failed.[%s] retry...", conf_path );
995 snprintf( conf_path, strlen(ConfFile)+strlen(CONFIGURE_PATH_RETRY)+2, "%s/%s", CONFIGURE_PATH_RETRY, ConfFile );
996 _mmcam_dbg_log( "Try open Configure File[%s]", conf_path );
997 fd = fopen( conf_path, "r" );
1000 _mmcam_dbg_warn( "File open failed.[%s] But keep going... All value will be returned as default.Type[%d]",
1007 ret = _mmcamcorder_conf_parse_info( type, fd, configure_info );
1012 ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE;
1015 if( conf_path != NULL )
1021 _mmcam_dbg_log( "Leave..." );
1027 _mmcamcorder_conf_parse_info( int type, FILE* fd, camera_conf** configure_info )
1029 const unsigned int BUFFER_NUM_DETAILS = 256;
1030 const unsigned int BUFFER_NUM_TOKEN = 20;
1031 size_t BUFFER_LENGTH_STRING = 256;
1032 const char* delimiters = " |=,\t\n";
1035 int count_main_category = 0;
1036 int count_details = 0;
1037 int length_read = 0;
1038 int count_token = 0;
1041 char *buffer_string = (char*)g_malloc0(sizeof(char)*BUFFER_LENGTH_STRING);
1042 char *buffer_details[BUFFER_NUM_DETAILS];
1043 char *buffer_token[BUFFER_NUM_TOKEN];
1045 char *category_name = NULL;
1046 char *detail_string = NULL;
1047 char *user_ptr = NULL;
1049 _mmcam_dbg_log( "" );
1051 camera_conf* new_conf = (camera_conf*)g_malloc0(sizeof(camera_conf));
1053 if( new_conf == NULL )
1055 _mmcam_dbg_err( "Failed to create new configure structure.type[%d]", type );
1056 *configure_info = NULL;
1058 return MM_ERROR_CAMCORDER_LOW_MEMORY;
1061 new_conf->type = type;
1062 *configure_info = new_conf;
1064 _mmcamcorder_conf_init( type, &new_conf );
1066 mmf_return_val_if_fail( fd > 0, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
1069 count_main_category = 0;
1071 while( !feof( fd ) )
1073 if( read_main == 0 )
1075 length_read = getline( &buffer_string, &BUFFER_LENGTH_STRING, fd );
1076 /*_mmcam_dbg_log( "Read Line : [%s]", buffer_string );*/
1079 token = strtok_r( buffer_string, delimiters, &user_ptr );
1081 if ((token) && (token[0] == ';'))
1083 /*_mmcam_dbg_log( "Comment - Nothing to do" );*/
1089 /*_mmcam_dbg_log( "token : [%s]", token );*/
1090 buffer_token[count_token] = token;
1092 token = strtok_r( NULL, delimiters, &user_ptr );
1095 if( count_token == 0 )
1104 if( *buffer_token[0] == ';' )
1106 /*_mmcam_dbg_log( "Comment - Nothing to do" );*/
1109 else if( *buffer_token[0] == '[' )
1111 category_name = get_new_string( buffer_token[0] );
1113 count_main_category++;
1116 while( !feof( fd ) )
1118 length_read = getline( &buffer_string, &BUFFER_LENGTH_STRING, fd );
1119 /*_mmcam_dbg_log( "Read Detail Line : [%s], read length : [%d]", buffer_string, length_read );*/
1121 detail_string = get_new_string( buffer_string );
1123 token = strtok_r( buffer_string, delimiters, &user_ptr );
1125 if( token && token[0] != ';' && length_read > -1 )
1127 /*_mmcam_dbg_log( "token : [%s]", token );*/
1128 if( token[0] == '[' )
1131 buffer_token[0] = token;
1132 SAFE_FREE( detail_string );
1136 buffer_details[count_details++] = detail_string;
1140 SAFE_FREE( detail_string );
1144 _mmcam_dbg_log( "type : %d, category_name : %s, count : [%d]", type, category_name, count_details );
1146 if( count_details == 0 )
1148 _mmcam_dbg_warn( "category %s has no detail value... skip this category...", category_name );
1155 if( type == CONFIGURE_TYPE_MAIN )
1157 if( !strcmp( "[General]", category_name ) )
1159 category = CONFIGURE_CATEGORY_MAIN_GENERAL;
1161 else if( !strcmp( "[VideoInput]", category_name ) )
1163 category = CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT;
1165 else if( !strcmp( "[AudioInput]", category_name ) )
1167 category = CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT;
1169 else if( !strcmp( "[VideoOutput]", category_name ) )
1171 category = CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT;
1173 else if( !strcmp( "[Capture]", category_name ) )
1175 category = CONFIGURE_CATEGORY_MAIN_CAPTURE;
1177 else if( !strcmp( "[Record]", category_name ) )
1179 category = CONFIGURE_CATEGORY_MAIN_RECORD;
1181 else if( !strcmp( "[VideoEncoder]", category_name ) )
1183 category = CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER;
1185 else if( !strcmp( "[AudioEncoder]", category_name ) )
1187 category = CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER;
1189 else if( !strcmp( "[ImageEncoder]", category_name ) )
1191 category = CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER;
1193 else if( !strcmp( "[Mux]", category_name ) )
1195 category = CONFIGURE_CATEGORY_MAIN_MUX;
1200 if( !strcmp( "[Camera]", category_name ) )
1202 category = CONFIGURE_CATEGORY_CTRL_CAMERA;
1204 else if( !strcmp( "[Strobe]", category_name ) )
1206 category = CONFIGURE_CATEGORY_CTRL_STROBE;
1208 else if( !strcmp( "[Effect]", category_name ) )
1210 category = CONFIGURE_CATEGORY_CTRL_EFFECT;
1212 else if( !strcmp( "[Photograph]", category_name ) )
1214 category = CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH;
1216 else if( !strcmp( "[Capture]", category_name ) )
1218 category = CONFIGURE_CATEGORY_CTRL_CAPTURE;
1220 else if( !strcmp( "[Detect]", category_name ) )
1222 category = CONFIGURE_CATEGORY_CTRL_DETECT;
1226 if( category != -1 )
1228 _mmcamcorder_conf_add_info( type, &(new_conf->info[category]),
1229 buffer_details, category, count_details );
1233 _mmcam_dbg_warn( "No matched category[%s],type[%d]... check it.", category_name, type );
1240 for( i = 0 ; i < count_details ; i++ )
1242 SAFE_FREE( buffer_details[i] );
1249 SAFE_FREE( category_name );
1253 //(*configure_info) = new_conf;
1255 SAFE_FREE( buffer_string );
1257 _mmcam_dbg_log( "Done." );
1259 return MM_ERROR_NONE;
1264 _mmcamcorder_conf_release_info( camera_conf** configure_info )
1266 int i, j, k, type, count, category_num;
1267 camera_conf* temp_conf = (*configure_info);
1270 type_int_range* temp_int_range;
1271 type_int_array* temp_int_array;
1272 type_int_pair_array* temp_int_pair_array;
1273 type_string* temp_string;
1274 type_string_array* temp_string_array;
1275 type_element* temp_element;
1277 _mmcam_dbg_log( "Entered..." );
1279 mmf_return_if_fail( temp_conf );
1281 if( (*configure_info)->type == CONFIGURE_TYPE_MAIN )
1283 category_num = CONFIGURE_CATEGORY_MAIN_NUM;
1287 category_num = CONFIGURE_CATEGORY_CTRL_NUM;
1290 for( i = 0 ; i < category_num ; i++ )
1292 if( temp_conf->info[i] )
1294 for( j = 0 ; j < temp_conf->info[i]->count ; j++ )
1296 if( temp_conf->info[i]->detail_info[j] == NULL )
1301 if( _mmcamcorder_conf_get_value_type( temp_conf->type, i, ((type_element*)(temp_conf->info[i]->detail_info[j]))->name, &type ) )
1305 case CONFIGURE_VALUE_INT:
1307 temp_int = (type_int*)(temp_conf->info[i]->detail_info[j]);
1308 SAFE_FREE( temp_int->name );
1311 case CONFIGURE_VALUE_INT_RANGE:
1313 temp_int_range = (type_int_range*)(temp_conf->info[i]->detail_info[j]);
1314 SAFE_FREE( temp_int_range->name );
1317 case CONFIGURE_VALUE_INT_ARRAY:
1319 temp_int_array = (type_int_array*)(temp_conf->info[i]->detail_info[j]);
1320 SAFE_FREE( temp_int_array->name );
1321 SAFE_FREE( temp_int_array->value );
1324 case CONFIGURE_VALUE_INT_PAIR_ARRAY:
1326 temp_int_pair_array = (type_int_pair_array*)(temp_conf->info[i]->detail_info[j]);
1327 SAFE_FREE( temp_int_pair_array->name );
1328 SAFE_FREE( temp_int_pair_array->value[0] );
1329 SAFE_FREE( temp_int_pair_array->value[1] );
1332 case CONFIGURE_VALUE_STRING:
1334 temp_string = (type_string*)(temp_conf->info[i]->detail_info[j]);
1335 SAFE_FREE( temp_string->name );
1336 SAFE_FREE( temp_string->value );
1339 case CONFIGURE_VALUE_STRING_ARRAY:
1341 temp_string_array = (type_string_array*)(temp_conf->info[i]->detail_info[j]);
1342 SAFE_FREE( temp_string_array->name );
1344 count = temp_string_array->count;
1345 for( k = 0 ; k < count ; k++ )
1347 SAFE_FREE( temp_string_array->value[k] );
1349 SAFE_FREE( temp_string_array->value );
1351 SAFE_FREE( temp_string_array->default_value );
1354 case CONFIGURE_VALUE_ELEMENT:
1356 temp_element = (type_element*)(temp_conf->info[i]->detail_info[j]);
1357 SAFE_FREE( temp_element->name );
1358 SAFE_FREE( temp_element->element_name );
1360 count = temp_element->count_int;
1361 for( k = 0 ; k < count ; k++ )
1363 SAFE_FREE( temp_element->value_int[k]->name );
1364 SAFE_FREE( temp_element->value_int[k] );
1366 SAFE_FREE( temp_element->value_int );
1368 count = temp_element->count_string;
1369 for( k = 0 ; k < count ; k++ )
1371 SAFE_FREE( temp_element->value_string[k]->name );
1372 SAFE_FREE( temp_element->value_string[k]->value );
1373 SAFE_FREE( temp_element->value_string[k] );
1375 SAFE_FREE( temp_element->value_string );
1381 SAFE_FREE( temp_conf->info[i]->detail_info[j] );
1382 temp_conf->info[i]->detail_info[j] = NULL;
1385 SAFE_FREE( temp_conf->info[i]->detail_info );
1386 temp_conf->info[i]->detail_info = NULL;
1388 SAFE_FREE( temp_conf->info[i] );
1389 temp_conf->info[i] = NULL;
1393 SAFE_FREE( (*configure_info)->info );
1394 SAFE_FREE( (*configure_info) );
1396 _mmcam_dbg_log( "Done." );
1400 _mmcamcorder_conf_get_value_type( int type, int category, char* name, int* value_type )
1403 int count_value = 0;
1405 /*_mmcam_dbg_log( "Entered..." );*/
1407 mmf_return_val_if_fail( name, FALSE );
1409 if( !_mmcamcorder_conf_get_category_size( type, category, &count_value ) )
1411 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
1415 /*_mmcam_dbg_log( "Number of value : [%d]", count_value );*/
1417 if( type == CONFIGURE_TYPE_MAIN )
1419 for( i = 0 ; i < count_value ; i++ )
1421 if( !strcmp( conf_main_info_table[category][i].name, name ) )
1423 *value_type = conf_main_info_table[category][i].value_type;
1424 /*_mmcam_dbg_log( "Category[%d],Name[%s],Type[%d]", category, name, *value_type );*/
1431 for( i = 0 ; i < count_value ; i++ )
1433 if( !strcmp( conf_ctrl_info_table[category][i].name, name ) )
1435 *value_type = conf_ctrl_info_table[category][i].value_type;
1436 /*_mmcam_dbg_log( "Category[%d],Name[%s],Type[%d]", category, name, *value_type );*/
1447 _mmcamcorder_conf_add_info( int type, conf_info** info, char** buffer_details, int category, int count_details )
1449 const int BUFFER_NUM_TOKEN = 256;
1456 char *buffer_token[BUFFER_NUM_TOKEN];
1457 char *user_ptr = NULL;
1459 const char *delimiters = " |=,\t\n";
1460 const char *delimiters_sub = " |\t\n";
1461 const char *delimiters_3rd = "|\n";
1463 mmf_return_val_if_fail( buffer_details, FALSE );
1465 (*info) = (conf_info*)g_malloc0( sizeof(conf_info) );
1466 (*info)->detail_info = (void**)g_malloc0(sizeof(void*) * count_details);
1467 (*info)->count = count_details;
1469 for ( i = 0 ; i < count_details ; i++ ) {
1470 /*_mmcam_dbg_log("Read line\"%s\"", buffer_details[i]);*/
1472 token = strtok_r( buffer_details[i], delimiters, &user_ptr );
1475 buffer_token[count_token] = token;
1478 (*info)->detail_info[i] = NULL;
1479 _mmcam_dbg_warn( "No token... check it.[%s]", buffer_details[i] );
1483 if (!_mmcamcorder_conf_get_value_type(type, category, buffer_token[0], &value_type)) {
1484 (*info)->detail_info[i] = NULL;
1485 _mmcam_dbg_warn( "Failed to get value type... check it. Category[%d],Name[%s]", category, buffer_token[0] );
1489 if (value_type != CONFIGURE_VALUE_STRING && value_type != CONFIGURE_VALUE_STRING_ARRAY) {
1490 token = strtok_r( NULL, delimiters, &user_ptr );
1492 buffer_token[count_token] = token;
1493 /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/
1495 token = strtok_r( NULL, delimiters, &user_ptr );
1498 if (count_token < 2) {
1499 (*info)->detail_info[i] = NULL;
1500 _mmcam_dbg_warn( "Number of token is too small... check it.[%s]", buffer_details[i] );
1503 } else { /* CONFIGURE_VALUE_STRING or CONFIGURE_VALUE_STRING_ARRAY */
1505 strtok_r( NULL, delimiters_sub, &user_ptr );
1507 if (value_type == CONFIGURE_VALUE_STRING_ARRAY) {
1508 token = strtok_r( NULL, delimiters_sub, &user_ptr );
1510 buffer_token[count_token] = token;
1511 /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/
1513 token = strtok_r( NULL, delimiters_sub, &user_ptr );
1515 } else { /* CONFIGURE_VALUE_STRING */
1516 token = strtok_r( NULL, delimiters_3rd, &user_ptr );
1519 buffer_token[count_token] = token;
1520 /*_mmcam_dbg_log("token : [%s]", buffer_token[count_token]);*/
1525 if (count_token < 2) {
1526 (*info)->detail_info[i] = NULL;
1527 _mmcam_dbg_warn( "No string value... check it.[%s]", buffer_details[i] );
1534 case CONFIGURE_VALUE_INT:
1538 new_int = (type_int*)g_malloc0( sizeof(type_int) );
1539 new_int->name = get_new_string( buffer_token[0] );
1540 new_int->value = atoi( buffer_token[1] );
1541 (*info)->detail_info[i] = (void*)new_int;
1542 /*_mmcam_dbg_log("INT - name[%s],value[%d]", new_int->name, new_int->value);*/
1545 case CONFIGURE_VALUE_INT_RANGE:
1547 type_int_range* new_int_range;
1549 new_int_range = (type_int_range*)g_malloc0( sizeof(type_int_range) );
1550 new_int_range->name = get_new_string( buffer_token[0] );
1551 new_int_range->min = atoi( buffer_token[1] );
1552 new_int_range->max = atoi( buffer_token[2] );
1553 new_int_range->default_value = atoi( buffer_token[3] );
1554 (*info)->detail_info[i] = (void*)new_int_range;
1556 _mmcam_dbg_log("INT RANGE - name[%s],min[%d],max[%d],default[%d]",
1557 new_int_range->name,
1560 new_int_range->default_value);
1564 case CONFIGURE_VALUE_INT_ARRAY:
1566 int count_value = count_token - 2;
1567 type_int_array* new_int_array;
1569 new_int_array = (type_int_array*)g_malloc0( sizeof(type_int_array) );
1570 new_int_array->name = get_new_string( buffer_token[0] );
1571 new_int_array->value = (int*)g_malloc0( sizeof(int)*count_value );
1572 new_int_array->count = count_value;
1574 /*_mmcam_dbg_log("INT ARRAY - name[%s]", new_int_array->name);*/
1575 for ( j = 0 ; j < count_value ; j++ ) {
1576 new_int_array->value[j] = atoi( buffer_token[j+1] );
1577 /*_mmcam_dbg_log(" index[%d] - value[%d]", j, new_int_array->value[j]);*/
1580 new_int_array->default_value = atoi( buffer_token[count_token-1] );
1581 /*_mmcam_dbg_log(" default value[%d]", new_int_array->default_value);*/
1583 (*info)->detail_info[i] = (void*)new_int_array;
1586 case CONFIGURE_VALUE_INT_PAIR_ARRAY:
1588 int count_value = ( count_token - 3 ) >> 1;
1589 type_int_pair_array* new_int_pair_array;
1591 new_int_pair_array = (type_int_pair_array*)g_malloc0( sizeof(type_int_pair_array) );
1592 new_int_pair_array->name = get_new_string( buffer_token[0] );
1593 new_int_pair_array->value[0] = (int*)g_malloc( sizeof(int)*(count_value) );
1594 new_int_pair_array->value[1] = (int*)g_malloc( sizeof(int)*(count_value) );
1595 new_int_pair_array->count = count_value;
1597 /*_mmcam_dbg_log("INT PAIR ARRAY - name[%s],count[%d]", new_int_pair_array->name, count_value);*/
1598 for ( j = 0 ; j < count_value ; j++ ) {
1599 new_int_pair_array->value[0][j] = atoi( buffer_token[(j<<1)+1] );
1600 new_int_pair_array->value[1][j] = atoi( buffer_token[(j<<1)+2] );
1602 _mmcam_dbg_log(" index[%d] - value[%d,%d]", j,
1603 new_int_pair_array->value[0][j],
1604 new_int_pair_array->value[1][j]);
1608 new_int_pair_array->default_value[0] = atoi( buffer_token[count_token-2] );
1609 new_int_pair_array->default_value[1] = atoi( buffer_token[count_token-1] );
1611 _mmcam_dbg_log(" default value[%d,%d]",
1612 new_int_pair_array->default_value[0],
1613 new_int_pair_array->default_value[1]);
1615 (*info)->detail_info[i] = (void*)new_int_pair_array;
1618 case CONFIGURE_VALUE_STRING:
1620 type_string* new_string;
1622 new_string = (type_string*)g_malloc0( sizeof(type_string) );
1623 new_string->name = get_new_string( buffer_token[0] );
1624 new_string->value = get_new_string( buffer_token[1] );
1625 (*info)->detail_info[i] = (void*)new_string;
1627 /*_mmcam_dbg_log("STRING - name[%s],value[%s]", new_string->name, new_string->value);*/
1630 case CONFIGURE_VALUE_STRING_ARRAY:
1632 int count_value = count_token - 2;
1633 type_string_array* new_string_array;
1635 new_string_array = (type_string_array*)g_malloc0( sizeof(type_string_array) );
1636 new_string_array->name = get_new_string( buffer_token[0] );
1637 new_string_array->count = count_value;
1638 new_string_array->value = (char**)g_malloc0( sizeof(char*)*count_value );;
1640 /*_mmcam_dbg_log("STRING ARRAY - name[%s]", new_string_array->name);*/
1641 for ( j = 0 ; j < count_value ; j++ ) {
1642 new_string_array->value[j] = get_new_string( buffer_token[j+1] );
1643 /*_mmcam_dbg_log(" index[%d] - value[%s]", j, new_string_array->value[j]);*/
1646 new_string_array->default_value = get_new_string( buffer_token[count_token-1] );
1647 /*_mmcam_dbg_log(" default value[%s]", new_string_array->default_value);*/
1648 (*info)->detail_info[i] = (void*)new_string_array;
1651 case CONFIGURE_VALUE_ELEMENT:
1653 type_element* new_element;
1655 new_element = (type_element*)g_malloc0( sizeof(type_element) );
1656 new_element->name = get_new_string( buffer_token[0] );
1657 new_element->element_name = get_new_string( buffer_token[1] );
1658 new_element->count_int = atoi( buffer_token[2] );
1659 new_element->value_int = NULL;
1660 new_element->count_string = atoi( buffer_token[3] );
1661 new_element->value_string = NULL;
1663 _mmcam_dbg_log("Element - name[%s],element_name[%s],count_int[%d],count_string[%d]",
1664 new_element->name, new_element->element_name, new_element->count_int, new_element->count_string);
1667 /* add int values */
1668 if ( new_element->count_int > 0 ) {
1669 new_element->value_int = (type_int**)g_malloc0( sizeof(type_int*)*(new_element->count_int) );
1671 for ( j = 0 ; j < new_element->count_int ; j++ ) {
1672 new_element->value_int[j] = (type_int*)g_malloc( sizeof(type_int) );
1673 new_element->value_int[j]->name = get_new_string( buffer_token[4+(j<<1)] );
1674 new_element->value_int[j]->value = atoi( buffer_token[5+(j<<1)] );
1676 _mmcam_dbg_log(" Element INT[%d] - name[%s],value[%d]",
1677 j, new_element->value_int[j]->name, new_element->value_int[j]->value);
1683 new_element->value_int = NULL;
1686 /* add string values */
1687 if ( new_element->count_string > 0 ) {
1688 new_element->value_string = (type_string**)g_malloc0( sizeof(type_string*)*(new_element->count_string) );
1689 for ( ; j < new_element->count_string + new_element->count_int ; j++ ) {
1690 new_element->value_string[j-new_element->count_int] = (type_string*)g_malloc0( sizeof(type_string) );
1691 new_element->value_string[j-new_element->count_int]->name = get_new_string( buffer_token[4+(j<<1)] );
1692 new_element->value_string[j-new_element->count_int]->value = get_new_string( buffer_token[5+(j<<1)] );
1694 _mmcam_dbg_log(" Element STRING[%d] - name[%s],value[%s]",
1695 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);
1699 new_element->value_string = NULL;
1702 (*info)->detail_info[i] = (void*)new_element;
1715 _mmcamcorder_conf_add_info_with_caps( int type, conf_info** info, char** buffer_details, int category, int count_details )
1717 const int BUFFER_NUM_TOKEN = 256;
1721 int count_token = 0;
1724 char *buffer_token[BUFFER_NUM_TOKEN];
1725 char *user_ptr = NULL;
1727 const char* delimiters = " |=,\t\n";
1728 const char* delimiters_sub = " |\t\n";
1729 const char* delimiters_3rd = "|\n";
1731 //_mmcam_dbg_log( "" );
1733 mmf_return_val_if_fail( buffer_details, FALSE );
1735 (*info) = (conf_info*)g_malloc0( sizeof(conf_info) );
1736 (*info)->detail_info = (void**)g_malloc0( sizeof(void*)*count_details );
1737 (*info)->count = count_details;
1739 //g_print( "Count[%d]\n", (*info)->count );
1740 //g_print( "Pointer[%x]\n", (*info) );
1742 for( i = 0 ; i < count_details ; i++ )
1744 //_mmcam_dbg_log( "Read line\"%s\"", buffer_details[i] );
1747 token = strtok_r( buffer_details[i], delimiters, &user_ptr );
1751 buffer_token[count_token] = token;
1756 (*info)->detail_info[i] = NULL;
1757 _mmcam_dbg_warn( "No token... check it.[%s]", buffer_details[i] );
1761 if( !_mmcamcorder_conf_get_value_type( type, category, buffer_token[0], &value_type ) )
1763 (*info)->detail_info[i] = NULL;
1764 _mmcam_dbg_warn( "Failed to get value type... check it. Category[%d],Name[%s]", category, buffer_token[0] );
1768 if( value_type != CONFIGURE_VALUE_STRING && value_type != CONFIGURE_VALUE_STRING_ARRAY )
1770 token = strtok_r( NULL, delimiters, &user_ptr );
1774 buffer_token[count_token] = token;
1775 //_mmcam_dbg_log( "token : [%s]", buffer_token[count_token] );
1777 token = strtok_r( NULL, delimiters, &user_ptr );
1780 if( count_token < 2 )
1782 (*info)->detail_info[i] = NULL;
1783 _mmcam_dbg_warn( "Number of token is too small... check it.[%s]", buffer_details[i] );
1787 else // CONFIGURE_VALUE_STRING or CONFIGURE_VALUE_STRING_ARRAY
1790 strtok_r( NULL, delimiters_sub, &user_ptr );
1792 if( value_type == CONFIGURE_VALUE_STRING_ARRAY )
1794 token = strtok_r( NULL, delimiters_sub, &user_ptr );
1798 buffer_token[count_token] = token;
1799 //_mmcam_dbg_log( "token : [%s]", buffer_token[count_token] );
1801 token = strtok_r( NULL, delimiters_sub, &user_ptr );
1804 else // CONFIGURE_VALUE_STRING
1806 token = strtok_r( NULL, delimiters_3rd, &user_ptr );
1811 buffer_token[count_token] = token;
1812 //_mmcam_dbg_log( "token : [%s]", buffer_token[count_token] );
1817 if( count_token < 2 )
1819 (*info)->detail_info[i] = NULL;
1820 _mmcam_dbg_warn( "No string value... check it.[%s]", buffer_details[i] );
1825 switch( value_type )
1827 case CONFIGURE_VALUE_INT:
1831 new_int = (type_int*)g_malloc0( sizeof(type_int) );
1832 new_int->name = get_new_string( buffer_token[0] );
1833 new_int->value = atoi( buffer_token[1] );
1834 (*info)->detail_info[i] = (void*)new_int;
1836 //_mmcam_dbg_log( "INT - name[%s],value[%d]", new_int->name, new_int->value );
1839 case CONFIGURE_VALUE_INT_RANGE:
1841 type_int_range* new_int_range;
1843 new_int_range = (type_int_range*)g_malloc0( sizeof(type_int_range) );
1844 new_int_range->name = get_new_string( buffer_token[0] );
1845 new_int_range->min = atoi( buffer_token[1] );
1846 new_int_range->max = atoi( buffer_token[2] );
1847 new_int_range->default_value = atoi( buffer_token[3] );
1848 (*info)->detail_info[i] = (void*)new_int_range;
1851 _mmcam_dbg_log( "INT RANGE - name[%s],min[%d],max[%d],default[%d]",
1852 new_int_range->name,
1855 new_int_range->default_value );
1859 case CONFIGURE_VALUE_INT_ARRAY:
1861 int count_value = count_token - 2;
1862 type_int_array* new_int_array;
1864 new_int_array = (type_int_array*)g_malloc0( sizeof(type_int_array) );
1865 new_int_array->name = get_new_string( buffer_token[0] );
1866 new_int_array->value = (int*)g_malloc0( sizeof(int)*count_value );
1867 new_int_array->count = count_value;
1869 //_mmcam_dbg_log( "INT ARRAY - name[%s]", new_int_array->name );
1870 for( j = 0 ; j < count_value ; j++ )
1872 new_int_array->value[j] = atoi( buffer_token[j+1] );
1873 //_mmcam_dbg_log( " index[%d] - value[%d]", j, new_int_array->value[j] );
1876 new_int_array->default_value = atoi( buffer_token[count_token-1] );
1877 //_mmcam_dbg_log( " default value[%d]", new_int_array->default_value );
1879 (*info)->detail_info[i] = (void*)new_int_array;
1882 case CONFIGURE_VALUE_INT_PAIR_ARRAY:
1884 int count_value = ( count_token - 3 ) >> 1;
1885 type_int_pair_array* new_int_pair_array;
1887 new_int_pair_array = (type_int_pair_array*)g_malloc0( sizeof(type_int_pair_array) );
1888 new_int_pair_array->name = get_new_string( buffer_token[0] );
1889 new_int_pair_array->value[0] = (int*)g_malloc( sizeof(int)*(count_value) );
1890 new_int_pair_array->value[1] = (int*)g_malloc( sizeof(int)*(count_value) );
1891 new_int_pair_array->count = count_value;
1893 //_mmcam_dbg_log( "INT PAIR ARRAY - name[%s],count[%d]", new_int_pair_array->name, count_value );
1894 for( j = 0 ; j < count_value ; j++ )
1896 new_int_pair_array->value[0][j] = atoi( buffer_token[(j<<1)+1] );
1897 new_int_pair_array->value[1][j] = atoi( buffer_token[(j<<1)+2] );
1899 _mmcam_dbg_log( " index[%d] - value[%d,%d]", j,
1900 new_int_pair_array->value[0][j],
1901 new_int_pair_array->value[1][j] );
1905 new_int_pair_array->default_value[0] = atoi( buffer_token[count_token-2] );
1906 new_int_pair_array->default_value[1] = atoi( buffer_token[count_token-1] );
1909 _mmcam_dbg_log( " default value[%d,%d]",
1910 new_int_pair_array->default_value[0],
1911 new_int_pair_array->default_value[1] );
1915 (*info)->detail_info[i] = (void*)new_int_pair_array;
1918 case CONFIGURE_VALUE_STRING:
1920 type_string* new_string;
1922 new_string = (type_string*)g_malloc0( sizeof(type_string) );
1923 new_string->name = get_new_string( buffer_token[0] );
1924 new_string->value = get_new_string( buffer_token[1] );
1925 (*info)->detail_info[i] = (void*)new_string;
1927 //_mmcam_dbg_log( "STRING - name[%s],value[%s]", new_string->name, new_string->value );
1930 case CONFIGURE_VALUE_STRING_ARRAY:
1932 int count_value = count_token - 2;
1933 type_string_array* new_string_array;
1935 new_string_array = (type_string_array*)g_malloc0( sizeof(type_string_array) );
1936 new_string_array->name = get_new_string( buffer_token[0] );
1937 new_string_array->count = count_value;
1938 new_string_array->value = (char**)g_malloc0( sizeof(char*)*count_value );;
1940 //_mmcam_dbg_log( "STRING ARRAY - name[%s]", new_string_array->name );
1941 for( j = 0 ; j < count_value ; j++ )
1943 new_string_array->value[j] = get_new_string( buffer_token[j+1] );
1944 //_mmcam_dbg_log( " index[%d] - value[%s]", j, new_string_array->value[j] );
1947 new_string_array->default_value = get_new_string( buffer_token[count_token-1] );
1948 //_mmcam_dbg_log( " default value[%s]", new_string_array->default_value );
1950 (*info)->detail_info[i] = (void*)new_string_array;
1953 case CONFIGURE_VALUE_ELEMENT:
1955 type_element* new_element;
1957 new_element = (type_element*)g_malloc0( sizeof(type_element) );
1958 new_element->name = get_new_string( buffer_token[0] );
1959 new_element->element_name = get_new_string( buffer_token[1] );
1960 new_element->count_int = atoi( buffer_token[2] );
1961 new_element->value_int = NULL;
1962 new_element->count_string = atoi( buffer_token[3] );
1963 new_element->value_string = NULL;
1965 //_mmcam_dbg_log( "Element - name[%s],element_name[%s],count_int[%d],count_string[%d]", new_element->name, new_element->element_name, new_element->count_int, new_element->count_string );
1967 /* add int values */
1968 if( new_element->count_int > 0 )
1970 new_element->value_int = (type_int**)g_malloc0( sizeof(type_int*)*(new_element->count_int) );
1972 for( j = 0 ; j < new_element->count_int ; j++ )
1974 new_element->value_int[j] = (type_int*)g_malloc( sizeof(type_int) );
1975 new_element->value_int[j]->name = get_new_string( buffer_token[4+(j<<1)] );
1976 new_element->value_int[j]->value = atoi( buffer_token[5+(j<<1)] );
1977 //_mmcam_dbg_log( " Element INT[%d] - name[%s],value[%d]", j, new_element->value_int[j]->name, new_element->value_int[j]->value );
1982 new_element->value_int = NULL;
1985 /* add string values */
1986 if( new_element->count_string > 0 )
1988 new_element->value_string = (type_string**)g_malloc0( sizeof(type_string*)*(new_element->count_string) );
1990 for( ; j < new_element->count_string + new_element->count_int ; j++ )
1992 new_element->value_string[j-new_element->count_int] = (type_string*)g_malloc0( sizeof(type_string) );
1993 new_element->value_string[j-new_element->count_int]->name = get_new_string( buffer_token[4+(j<<1)] );
1994 new_element->value_string[j-new_element->count_int]->value = get_new_string( buffer_token[5+(j<<1)] );
1995 //_mmcam_dbg_log( " Element STRING[%d] - name[%s],value[%s]", 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 );
2000 new_element->value_string = NULL;
2003 (*info)->detail_info[i] = (void*)new_element;
2011 //_mmcam_dbg_log( "Done." );
2018 _mmcamcorder_conf_get_value_int( camera_conf* configure_info, int category, char* name, int* value )
2023 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2025 mmf_return_val_if_fail( configure_info, FALSE );
2026 mmf_return_val_if_fail( name, FALSE );
2028 if( configure_info->info[category] )
2030 count = configure_info->info[category]->count;
2031 info = configure_info->info[category];
2033 for( i = 0 ; i < count ; i++ )
2035 if( info->detail_info[i] == NULL )
2040 if( !strcmp( ((type_int*)(info->detail_info[i]))->name , name ) )
2042 *value = ((type_int*)(info->detail_info[i]))->value;
2043 //_mmcam_dbg_log( "Get[%s] int[%d]", name, *value );
2049 if( _mmcamcorder_conf_get_default_value_int( configure_info->type, category, name, value ) )
2051 //_mmcam_dbg_log( "Get[%s] int[%d]", name, *value );
2055 _mmcam_dbg_warn( "Faild to get int... check it...Category[%d],Name[%s]", category, name );
2061 _mmcamcorder_conf_get_value_int_range( camera_conf* configure_info, int category, char* name, type_int_range** value )
2066 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2068 mmf_return_val_if_fail( configure_info, FALSE );
2069 mmf_return_val_if_fail( name, FALSE );
2071 if( configure_info->info[category] )
2073 count = configure_info->info[category]->count;
2074 info = configure_info->info[category];
2076 for( i = 0 ; i < count ; i++ )
2078 if( info->detail_info[i] == NULL )
2083 if( !strcmp( ((type_int_range*)(info->detail_info[i]))->name , name ) )
2085 *value = (type_int_range*)(info->detail_info[i]);
2087 _mmcam_dbg_log( "Get[%s] int range - min[%d],max[%d],default[%d]",
2088 name, (*value)->min, (*value)->max, (*value)->default_value );
2097 _mmcam_dbg_warn( "Faild to get int range... check it...Category[%d],Name[%s]", category, name );
2103 _mmcamcorder_conf_get_value_int_array( camera_conf* configure_info, int category, char* name, type_int_array** value )
2108 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2110 mmf_return_val_if_fail( configure_info, FALSE );
2111 mmf_return_val_if_fail( name, FALSE );
2113 if( configure_info->info[category] )
2115 count = configure_info->info[category]->count;
2116 info = configure_info->info[category];
2118 for( i = 0 ; i < count ; i++ )
2120 if( info->detail_info[i] == NULL )
2125 if( !strcmp( ((type_int_array*)(info->detail_info[i]))->name , name ) )
2127 *value = (type_int_array*)(info->detail_info[i]);
2129 _mmcam_dbg_log( "Get[%s] int array - [%x],count[%d],default[%d]",
2130 name, (*value)->value, (*value)->count, (*value)->default_value );
2139 _mmcam_dbg_warn( "Faild to get int array... check it...Category[%d],Name[%s]", category, name );
2145 _mmcamcorder_conf_get_value_int_pair_array( camera_conf* configure_info, int category, char* name, type_int_pair_array** value )
2150 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2152 mmf_return_val_if_fail( configure_info, FALSE );
2153 mmf_return_val_if_fail( name, FALSE );
2155 if( configure_info->info[category] )
2157 count = configure_info->info[category]->count;
2158 info = configure_info->info[category];
2160 for( i = 0 ; i < count ; i++ )
2162 if( info->detail_info[i] == NULL )
2167 if( !strcmp( ((type_int_pair_array*)(info->detail_info[i]))->name , name ) )
2169 *value = (type_int_pair_array*)(info->detail_info[i]);
2171 _mmcam_dbg_log( "Get[%s] int pair array - [%x][%x],count[%d],default[%d][%d]",
2172 name, (*value)->value[0], (*value)->value[1], (*value)->count,
2173 (*value)->default_value[0], (*value)->default_value[1] );
2182 _mmcam_dbg_warn( "Faild to get int pair array... check it...Category[%d],Name[%s]", category, name );
2188 _mmcamcorder_conf_get_value_string( camera_conf* configure_info, int category, char* name, char** value )
2193 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2195 mmf_return_val_if_fail( configure_info, FALSE );
2196 mmf_return_val_if_fail( name, FALSE );
2198 if( configure_info->info[category] )
2200 count = configure_info->info[category]->count;
2201 info = configure_info->info[category];
2203 for( i = 0 ; i < count ; i++ )
2205 if( info->detail_info[i] == NULL )
2210 if( !strcmp( ((type_string*)(info->detail_info[i]))->name , name ) )
2212 *value = ((type_string*)(info->detail_info[i]))->value;
2213 //_mmcam_dbg_log( "Get[%s] string[%s]", name, *value );
2219 if( _mmcamcorder_conf_get_default_value_string( configure_info->type, category, name, value ) )
2221 //_mmcam_dbg_log( "Get[%s]string[%s]", name, *value );
2225 _mmcam_dbg_warn( "Faild to get string... check it...Category[%d],Name[%s]", category, name );
2231 _mmcamcorder_conf_get_value_string_array ( camera_conf* configure_info, int category, char* name, type_string_array** value )
2236 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2238 mmf_return_val_if_fail( configure_info, FALSE );
2239 mmf_return_val_if_fail( name, FALSE );
2241 if( configure_info->info[category] )
2243 count = configure_info->info[category]->count;
2244 info = configure_info->info[category];
2246 for( i = 0 ; i < count ; i++ )
2248 if( info->detail_info[i] == NULL )
2253 if( !strcmp( ((type_string_array*)(info->detail_info[i]))->name , name ) )
2255 *value = (type_string_array*)(info->detail_info[i]);
2257 _mmcam_dbg_log( "Get[%s] string array - [%x],count[%d],default[%s]",
2258 name, (*value)->value, (*value)->count, (*value)->default_value );
2267 _mmcam_dbg_warn( "Faild to get string array... check it...Category[%d],Name[%s]", category, name );
2273 _mmcamcorder_conf_get_element( camera_conf* configure_info, int category, char* name, type_element** element )
2278 //_mmcam_dbg_log( "Entered... category[%d],name[%s]", category, name );
2280 mmf_return_val_if_fail( configure_info, FALSE );
2281 mmf_return_val_if_fail( name, FALSE );
2283 if( configure_info->info[category] )
2285 count = configure_info->info[category]->count;
2286 info = configure_info->info[category];
2288 for( i = 0 ; i < count ; i++ )
2290 if( info->detail_info[i] == NULL )
2295 if( !strcmp( ((type_element*)(info->detail_info[i]))->name , name ) )
2297 *element = (type_element*)(info->detail_info[i]);
2298 //_mmcam_dbg_log( "Get[%s] element[%x]", name, *element );
2304 if( _mmcamcorder_conf_get_default_element( configure_info->type, category, name, element ) )
2306 //_mmcam_dbg_log( "Get[%s] element[%x]", name, *element );
2310 _mmcam_dbg_warn( "Faild to get element name... check it...Category[%d],Name[%s]", category, name );
2316 _mmcamcorder_conf_get_value_element_name( type_element* element, char** value )
2318 //_mmcam_dbg_log( "Entered..." );
2320 mmf_return_val_if_fail( element, FALSE );
2322 *value = element->element_name;
2324 //_mmcam_dbg_log( "Get element name : [%s]", *value );
2330 _mmcamcorder_conf_get_value_element_int( type_element* element, char* name, int* value )
2334 //_mmcam_dbg_log( "Entered..." );
2336 mmf_return_val_if_fail( element, FALSE );
2337 mmf_return_val_if_fail( name, FALSE );
2339 for( i = 0 ; i < element->count_int ; i++ )
2341 if( !strcmp( element->value_int[i]->name , name ) )
2343 *value = element->value_int[i]->value;
2344 //_mmcam_dbg_log( "Get[%s] element int[%d]", name, *value );
2349 _mmcam_dbg_warn( "Faild to get int in element... ElementName[%p],Name[%s],Count[%d]",
2350 element->name, name, element->count_int );
2356 _mmcamcorder_conf_get_value_element_string( type_element* element, char* name, char** value )
2360 //_mmcam_dbg_log( "Entered..." );
2362 mmf_return_val_if_fail( element, FALSE );
2363 mmf_return_val_if_fail( name, FALSE );
2365 for( i = 0 ; i < element->count_string ; i++ )
2367 if( !strcmp( element->value_string[i]->name , name ) )
2369 *value = element->value_string[i]->value;
2370 //_mmcam_dbg_log( "Get[%s] element string[%s]", name, *value );
2375 _mmcam_dbg_warn( "Faild to get int in element... ElementName[%p],Name[%s],Count[%d]",
2376 element->name, name, element->count_string );
2382 _mmcamcorder_conf_set_value_element_property( GstElement* gst, type_element* element )
2386 //_mmcam_dbg_log( "Entered..." );
2388 mmf_return_val_if_fail( gst, FALSE );
2389 mmf_return_val_if_fail( element, FALSE );
2391 if( element->count_int == 0 )
2393 _mmcam_dbg_log( "There is no integer property to set in INI file[%s].", element->name );
2397 if( element->value_int == NULL )
2399 _mmcam_dbg_warn( "count_int[%d] is NOT zero, but value_int is NULL", element->count_int );
2403 for( i = 0 ; i < element->count_int ; i++ )
2405 MMCAMCORDER_G_OBJECT_SET( gst, element->value_int[i]->name, element->value_int[i]->value );
2407 _mmcam_dbg_log( "Element[%s] Set[%s] -> integer[%d]",
2408 element->element_name,
2409 element->value_int[i]->name,
2410 element->value_int[i]->value );
2414 if( element->count_string == 0 )
2416 _mmcam_dbg_log( "There is no string property to set in INI file[%s].", element->name );
2420 if( element->value_string == NULL )
2422 _mmcam_dbg_warn( "count_string[%d] is NOT zero, but value_string is NULL", element->count_string );
2426 for( i = 0 ; i < element->count_string ; i++ )
2428 MMCAMCORDER_G_OBJECT_SET( gst, element->value_string[i]->name, element->value_string[i]->value );
2430 _mmcam_dbg_log( "Element[%s] Set[%s] -> string[%s]",
2431 element->element_name,
2432 element->value_string[i]->name,
2433 element->value_string[i]->value );
2437 //_mmcam_dbg_log( "Done." );
2443 _mmcamcorder_conf_get_default_value_int( int type, int category, char* name, int* value )
2446 int count_value = 0;
2448 //_mmcam_dbg_log( "Entered..." );
2450 mmf_return_val_if_fail( name, FALSE );
2452 if( !_mmcamcorder_conf_get_category_size( type, category, &count_value ) )
2454 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
2458 if( type == CONFIGURE_TYPE_MAIN )
2460 for( i = 0 ; i < count_value ; i++ )
2462 if( !strcmp( conf_main_info_table[category][i].name, name ) )
2464 *value = conf_main_info_table[category][i].value_int;
2471 for( i = 0 ; i < count_value ; i++ )
2473 if( !strcmp( conf_ctrl_info_table[category][i].name, name ) )
2475 *value = conf_ctrl_info_table[category][i].value_int;
2481 _mmcam_dbg_warn( "Failed to get default int... check it... Type[%d],Category[%d],Name[%s]", type, category, name );
2487 _mmcamcorder_conf_get_default_value_string( int type, int category, char* name, char** value )
2490 int count_value = 0;
2492 //_mmcam_dbg_log( "Entered..." );
2494 mmf_return_val_if_fail( name, FALSE );
2496 if( !_mmcamcorder_conf_get_category_size( type, category, &count_value ) )
2498 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
2502 if( type == CONFIGURE_TYPE_MAIN )
2504 for( i = 0 ; i < count_value ; i++ )
2506 if( !strcmp( conf_main_info_table[category][i].name, name ) )
2508 *value = conf_main_info_table[category][i].value_string;
2509 _mmcam_dbg_log( "Get[%s] default string[%s]", name, *value );
2516 for( i = 0 ; i < count_value ; i++ )
2518 if( !strcmp( conf_ctrl_info_table[category][i].name, name ) )
2520 *value = conf_ctrl_info_table[category][i].value_string;
2521 _mmcam_dbg_log( "Get[%s] default string[%s]", name, *value );
2527 _mmcam_dbg_warn( "Failed to get default string... check it... Type[%d],Category[%d],Name[%s]", type, category, name );
2533 _mmcamcorder_conf_get_default_element( int type, int category, char* name, type_element** element )
2536 int count_value = 0;
2538 //_mmcam_dbg_log( "Entered..." );
2540 mmf_return_val_if_fail( name, FALSE );
2542 if( !_mmcamcorder_conf_get_category_size( type, category, &count_value ) )
2544 _mmcam_dbg_warn( "No matched category... check it... categoty[%d]", category );
2548 if( type == CONFIGURE_TYPE_MAIN )
2550 for( i = 0 ; i < count_value ; i++ )
2552 if( !strcmp( conf_main_info_table[category][i].name, name ) )
2554 *element = conf_main_info_table[category][i].value_element;
2555 _mmcam_dbg_log( "Get[%s] element[%p]", name, *element );
2562 for( i = 0 ; i < count_value ; i++ )
2564 if( !strcmp( conf_ctrl_info_table[category][i].name, name ) )
2566 *element = conf_ctrl_info_table[category][i].value_element;
2567 _mmcam_dbg_log( "Get[%s] element[%p]", name, *element );
2573 _mmcam_dbg_warn( "Failed to get default element... check it... Type[%d],Category[%d],Name[%s]", type, category, name );
2579 _mmcamcorder_conf_get_category_size( int type, int category, int* size )
2581 // mmf_return_val_if_fail( conf_main_category_size, FALSE );
2582 // mmf_return_val_if_fail( conf_ctrl_category_size, FALSE );
2584 if( type == CONFIGURE_TYPE_MAIN )
2586 mmf_return_val_if_fail( category < CONFIGURE_CATEGORY_MAIN_NUM, FALSE );
2588 *size = (int)conf_main_category_size[category];
2592 mmf_return_val_if_fail( category < CONFIGURE_CATEGORY_CTRL_NUM, FALSE );
2594 *size = (int)conf_ctrl_category_size[category];
2601 _mmcamcorder_conf_print_info( camera_conf** configure_info )
2603 int i, j, k, type, category_type;
2606 type_int_range *temp_int_range;
2607 type_int_array *temp_int_array;
2608 type_int_pair_array *temp_int_pair_array;
2609 type_string *temp_string;
2610 type_element *temp_element;
2612 g_print( "[ConfigureInfoPrint] : Entered.\n" );
2614 mmf_return_if_fail( *configure_info );
2616 if( (*configure_info)->type == CONFIGURE_TYPE_MAIN )
2618 category_type = CONFIGURE_CATEGORY_MAIN_NUM;
2622 category_type = CONFIGURE_CATEGORY_CTRL_NUM;
2625 for( i = 0 ; i < category_type ; i++ )
2627 if( (*configure_info)->info[i] )
2629 g_print( "[ConfigureInfo] : Category [%d]\n", i );
2630 for( j = 0 ; j < (*configure_info)->info[i]->count ; j++ )
2632 if( _mmcamcorder_conf_get_value_type( (*configure_info)->type, i, ((type_int*)((*configure_info)->info[i]->detail_info[j]))->name, &type ) )
2636 case CONFIGURE_VALUE_INT:
2637 temp_int = (type_int*)((*configure_info)->info[i]->detail_info[j]);
2638 g_print( "[ConfigureInfo] : INT - Name[%s],Value [%d]\n", temp_int->name, temp_int->value );
2640 case CONFIGURE_VALUE_INT_RANGE:
2641 temp_int_range = (type_int_range*)((*configure_info)->info[i]->detail_info[j]);
2642 g_print( "[ConfigureInfo] : INT_RANGE - Name[%s],Value [%d]~[%d], default [%d]\n",
2643 temp_int_range->name, temp_int_range->min, temp_int_range->max, temp_int_range->default_value );
2645 case CONFIGURE_VALUE_INT_ARRAY:
2646 temp_int_array = (type_int_array*)((*configure_info)->info[i]->detail_info[j]);
2647 g_print( "[ConfigureInfo] : INT_ARRAY - Name[%s], default [%d]\n - ",
2648 temp_int_array->name, temp_int_array->default_value );
2649 for( k = 0 ; k < temp_int_array->count ; k++ )
2651 g_print( "[%d] ", temp_int_array->value[k] );
2655 case CONFIGURE_VALUE_INT_PAIR_ARRAY:
2656 temp_int_pair_array = (type_int_pair_array*)((*configure_info)->info[i]->detail_info[j]);
2657 g_print( "[ConfigureInfo] : INT_PAIR_ARRAY - Name[%s], default [%d][%d]\n - ",
2658 temp_int_pair_array->name, temp_int_pair_array->default_value[0], temp_int_pair_array->default_value[0] );
2659 for( k = 0 ; k < temp_int_pair_array->count ; k++ )
2661 g_print( "[%d,%d] ", temp_int_pair_array->value[0][k], temp_int_pair_array->value[1][k] );
2665 case CONFIGURE_VALUE_STRING:
2666 temp_string = (type_string*)((*configure_info)->info[i]->detail_info[j]);
2667 g_print( "[ConfigureInfo] : STRING - Name[%s],Value[%s]\n", temp_string->name, temp_string->value );
2669 case CONFIGURE_VALUE_ELEMENT:
2670 temp_element = (type_element*)((*configure_info)->info[i]->detail_info[j]);
2671 g_print( "[ConfigureInfo] : Element - Name[%s],Element_Name[%s]\n", temp_element->name, temp_element->element_name );
2672 for( k = 0 ; k < temp_element->count_int ; k++ )
2674 g_print( " - INT[%d] Name[%s],Value[%d]\n", k, temp_element->value_int[k]->name, temp_element->value_int[k]->value );
2676 for( k = 0 ; k < temp_element->count_string ; k++ )
2678 g_print( " - STRING[%d] Name[%s],Value[%s]\n", k, temp_element->value_string[k]->name, temp_element->value_string[k]->value );
2682 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 );
2688 g_print( "[ConfigureInfo] : Failed to get value type." );
2694 g_print( "[ConfigureInfoPrint] : Done.\n" );
2698 static type_element *
2699 __mmcamcorder_get_audio_codec_element(MMHandleType handle)
2701 type_element *telement = NULL;
2702 char * codec_type_str = NULL;
2703 int codec_type = MM_AUDIO_CODEC_INVALID;
2704 mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2705 _MMCamcorderSubContext *sc = NULL;
2707 mmf_return_val_if_fail(hcamcorder, NULL);
2708 sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2710 mmf_return_val_if_fail(sc, NULL);
2714 /* Check element availability */
2715 mm_camcorder_get_attributes(handle, NULL, MMCAM_AUDIO_ENCODER, &codec_type, NULL);
2717 switch( codec_type )
2719 case MM_AUDIO_CODEC_AMR:
2720 codec_type_str = "AMR";
2722 case MM_AUDIO_CODEC_G723_1:
2723 codec_type_str = "G723_1";
2725 case MM_AUDIO_CODEC_MP3:
2726 codec_type_str = "MP3";
2728 case MM_AUDIO_CODEC_AAC:
2729 codec_type_str = "AAC";
2731 case MM_AUDIO_CODEC_MMF:
2732 codec_type_str = "MMF";
2734 case MM_AUDIO_CODEC_ADPCM:
2735 codec_type_str = "ADPCM";
2737 case MM_AUDIO_CODEC_WAVE:
2738 codec_type_str = "WAVE";
2740 case MM_AUDIO_CODEC_MIDI:
2741 codec_type_str = "MIDI";
2743 case MM_AUDIO_CODEC_IMELODY:
2744 codec_type_str = "IMELODY";
2746 case MM_AUDIO_CODEC_VORBIS:
2747 codec_type_str = "VORBIS";
2750 _mmcam_dbg_err( "Not supported audio codec[%d]", codec_type );
2754 _mmcamcorder_conf_get_element( hcamcorder->conf_main,
2755 CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER,
2763 static type_element *
2764 __mmcamcorder_get_video_codec_element(MMHandleType handle)
2766 type_element *telement = NULL;
2767 char * codec_type_str = NULL;
2768 int codec_type = MM_VIDEO_CODEC_INVALID;
2769 mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2770 _MMCamcorderSubContext *sc = NULL;
2772 mmf_return_val_if_fail(hcamcorder, NULL);
2773 sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2775 mmf_return_val_if_fail(sc, NULL);
2779 /* Check element availability */
2780 mm_camcorder_get_attributes(handle, NULL, MMCAM_VIDEO_ENCODER, &codec_type, NULL);
2782 switch( codec_type )
2784 case MM_VIDEO_CODEC_H263:
2785 codec_type_str = "H263";
2787 case MM_VIDEO_CODEC_H264:
2788 codec_type_str = "H264";
2790 case MM_VIDEO_CODEC_H26L:
2791 codec_type_str = "H26L";
2793 case MM_VIDEO_CODEC_MPEG4:
2794 codec_type_str = "MPEG4";
2796 case MM_VIDEO_CODEC_MPEG1:
2797 codec_type_str = "MPEG1";
2799 case MM_VIDEO_CODEC_THEORA: // OGG
2800 codec_type_str = "THEORA";
2803 _mmcam_dbg_err( "Not supported video codec[%d]", codec_type );
2807 _mmcamcorder_conf_get_element( hcamcorder->conf_main,
2808 CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER,
2816 static type_element *
2817 __mmcamcorder_get_image_codec_element(MMHandleType handle)
2819 type_element *telement = NULL;
2820 char * codec_type_str = NULL;
2821 int codec_type = MM_IMAGE_CODEC_INVALID;
2822 mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2823 _MMCamcorderSubContext *sc = NULL;
2825 mmf_return_val_if_fail(hcamcorder, NULL);
2826 sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2828 mmf_return_val_if_fail(sc, NULL);
2832 /* Check element availability */
2833 mm_camcorder_get_attributes(handle, NULL, MMCAM_IMAGE_ENCODER, &codec_type, NULL);
2835 switch( codec_type )
2837 case MM_IMAGE_CODEC_JPEG:
2838 codec_type_str = "JPEG";
2840 case MM_IMAGE_CODEC_SRW:
2841 codec_type_str = "SRW";
2843 case MM_IMAGE_CODEC_JPEG_SRW:
2844 codec_type_str = "JPEG_SRW";
2846 case MM_IMAGE_CODEC_PNG:
2847 codec_type_str = "PNG";
2849 case MM_IMAGE_CODEC_BMP:
2850 codec_type_str = "BMP";
2852 case MM_IMAGE_CODEC_WBMP:
2853 codec_type_str = "WBMP";
2855 case MM_IMAGE_CODEC_TIFF:
2856 codec_type_str = "TIFF";
2858 case MM_IMAGE_CODEC_PCX:
2859 codec_type_str = "PCX";
2861 case MM_IMAGE_CODEC_GIF:
2862 codec_type_str = "GIF";
2864 case MM_IMAGE_CODEC_ICO:
2865 codec_type_str = "ICO";
2867 case MM_IMAGE_CODEC_RAS:
2868 codec_type_str = "RAS";
2870 case MM_IMAGE_CODEC_TGA:
2871 codec_type_str = "TGA";
2873 case MM_IMAGE_CODEC_XBM:
2874 codec_type_str = "XBM";
2876 case MM_IMAGE_CODEC_XPM:
2877 codec_type_str = "XPM";
2880 _mmcam_dbg_err( "Not supported image codec[%d]", codec_type );
2884 _mmcamcorder_conf_get_element( hcamcorder->conf_main,
2885 CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER,
2893 static type_element *
2894 __mmcamcorder_get_file_format_element(MMHandleType handle)
2896 type_element *telement = NULL;
2897 char * mux_type_str = NULL;
2898 int file_type = MM_FILE_FORMAT_INVALID;
2899 mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
2900 _MMCamcorderSubContext *sc = NULL;
2902 mmf_return_val_if_fail(hcamcorder, NULL);
2903 sc = MMF_CAMCORDER_SUBCONTEXT(handle);
2905 mmf_return_val_if_fail(sc, NULL);
2909 /* Check element availability */
2910 mm_camcorder_get_attributes(handle, NULL, MMCAM_FILE_FORMAT, &file_type, NULL);
2914 case MM_FILE_FORMAT_3GP:
2915 mux_type_str = "3GP";
2917 case MM_FILE_FORMAT_AMR:
2918 mux_type_str = "AMR";
2920 case MM_FILE_FORMAT_MP4:
2921 mux_type_str = "MP4";
2923 case MM_FILE_FORMAT_AAC:
2924 mux_type_str = "AAC";
2926 case MM_FILE_FORMAT_MP3:
2927 mux_type_str = "MP3";
2929 case MM_FILE_FORMAT_OGG:
2930 mux_type_str = "OGG";
2932 case MM_FILE_FORMAT_WAV:
2933 mux_type_str = "WAV";
2935 case MM_FILE_FORMAT_AVI:
2936 mux_type_str = "AVI";
2938 case MM_FILE_FORMAT_WMA:
2939 mux_type_str = "WMA";
2941 case MM_FILE_FORMAT_WMV:
2942 mux_type_str = "WMV";
2944 case MM_FILE_FORMAT_MID:
2945 mux_type_str = "MID";
2947 case MM_FILE_FORMAT_MMF:
2948 mux_type_str = "MMF";
2950 case MM_FILE_FORMAT_MATROSKA:
2951 mux_type_str = "MATROSKA";
2954 _mmcam_dbg_err( "Not supported file format[%d]", file_type );
2958 _mmcamcorder_conf_get_element( hcamcorder->conf_main,
2959 CONFIGURE_CATEGORY_MAIN_MUX,
2968 _mmcamcorder_get_type_element(MMHandleType handle, int type)
2970 type_element *telement = NULL;
2972 _mmcam_dbg_log("type:%d", type);
2976 case MM_CAM_AUDIO_ENCODER:
2977 telement = __mmcamcorder_get_audio_codec_element(handle);
2979 case MM_CAM_VIDEO_ENCODER:
2980 telement = __mmcamcorder_get_video_codec_element(handle);
2982 case MM_CAM_IMAGE_ENCODER:
2983 telement = __mmcamcorder_get_image_codec_element(handle);
2985 case MM_CAM_FILE_FORMAT:
2986 telement = __mmcamcorder_get_file_format_element(handle);
2989 _mmcam_dbg_log("Can't get element type form this profile.(%d)", type);
2997 _mmcamcorder_get_audio_codec_format(MMHandleType handle, char * name)
3000 char* audio_fmt_type[] = {
3001 "AMR", /**< AMR codec*/
3002 "G723_1", /**< G723.1 codec*/
3003 "MP3", /**< MP3 codec*/
3004 "OGG", /**< OGG codec*/
3005 "AAC", /**< AAC codec*/
3006 "WMA", /**< WMA codec*/
3007 "MMF", /**< MMF codec*/
3008 "ADPCM", /**< ADPCM codec */
3009 "WAVE", /**< WAVE codec */
3010 "WAVE_NEW", /**< WAVE codec */
3011 "MIDI", /**< MIDI codec */
3012 "IMELODY", /**< IMELODY codec */
3014 "MPA", /**< MPEG1-Layer1 codec */
3015 "MP2", /**< MPEG1-Layer2 codec */
3016 "G711", /**< G711 codec */
3017 "G722", /**< G722 wideband speech codec */
3018 "G722_1", /**< G722.1 codec */
3019 "G722_2", /**< G722.2 (AMR-WB) codec */
3020 "G723", /**< G723 wideband speech codec */
3021 "G726", /**< G726 (ADPCM) codec */
3022 "G728", /**< G728 speech codec */
3023 "G729", /**< G729 codec */
3024 "G729A", /**< G729a codec */
3025 "G729_1", /**< G729.1 codec */
3026 "REAL", /**< Real audio */
3027 "AAC_LC", /**< AAC-Low complexity codec */
3028 "AAC_MAIN", /**< AAC-Main profile codec */
3029 "AAC_SRS", /**< AAC-Scalable sample rate codec */
3030 "AAC_LTP", /**< AAC-Long term prediction codec */
3031 "AAC_HE_V1", /**< AAC-High Efficiency v1 codec */
3032 "AAC_HE_V2", /**< AAC-High efficiency v2 codec */
3033 "AC3", /**< DolbyDigital codec */
3034 "ALAC", /**< Apple Lossless audio codec */
3035 "ATRAC", /**< Sony audio codec */
3036 "SPEEX", /**< SPEEX audio codec */
3037 "VORBIS", /**< Vor*/
3038 "AIFF", /**< AIFF codec*/
3039 "AU", /**< AU codec*/
3040 "NONE", /**< None (will be deprecated) */
3041 "PCM", /**< PCM codec */
3042 "ALAW", /**< ALAW codec */
3043 "MULAW", /**< MULAW codec */
3044 "MS_ADPCM" /**< MS ADPCM codec */
3047 for (i = 0; i < MM_AUDIO_CODEC_NUM; i++)
3049 if (!strcmp(name, audio_fmt_type[i]))
3051 // _mmcam_dbg_log( "Audio codec[%d]", i);
3056 _mmcam_dbg_err( "Not supported audio codec[%s]", name);
3064 _mmcamcorder_get_video_codec_format(MMHandleType handle, char * name)
3067 char* video_fmt_type[] = {
3068 "NONE", /**< None (will be deprecated) */
3069 "H263", /**< H263 codec*/
3070 "H264", /**< H264 codec*/
3071 "H26L", /**< H26L codec*/
3072 "MPEG4", /**< MPEG4 codec*/
3073 "MPEG1", /**< MPEG1 codec*/
3074 "WMV", /**< WMV codec*/
3075 "DIVX", /**< DIVX codec*/
3076 "XVID", /**< XVID codec*/
3077 "H261", /**< H261 codec*/
3078 "H262", /**< H262/MPEG2-part2 codec*/
3079 "H263V2", /**< H263v2 codec*/
3080 "H263V3", /**< H263v3 codec*/
3081 "MJPEG", /**< Motion JPEG Video codec*/
3082 "MPEG2", /**< MPEG2 codec*/
3083 "MPEG4_SIMPLE", /**< MPEG4 part-2 Simple profile codec*/
3084 "MPEG4_ADV_SIMPLE",/**< MPEG4 part-2 Advanced Simple profile codec*/
3085 "MPEG4_MAIN", /**< MPEG4 part-2 Main profile codec*/
3086 "MPEG4_CORE", /**< MPEG4 part-2 Core profile codec*/
3087 "MPEG4_ACE", /**< MPEG4 part-2 Adv Coding Eff profile codec*/
3088 "MPEG4_ARTS", /**< MPEG4 part-2 Adv RealTime Simple profile codec*/
3089 "MPEG4_AVC", /**< MPEG4 part-10 (h.264) codec*/
3090 "REAL", /**< Real video*/
3091 "VC1", /**< VC-1 video*/
3092 "AVS", /**< AVS video*/
3093 "CINEPAK", /**< Cinepak videocodec */
3094 "INDEO", /**< Indeo videocodec */
3095 "THEORA" /**< Theora videocodec */
3098 for (i = 0; i < MM_VIDEO_CODEC_NUM; i++)
3100 if (!strcmp(name, video_fmt_type[i]))
3102 // _mmcam_dbg_log( "Video codec[%d]", i);
3107 _mmcam_dbg_err( "Not supported Video codec[%s]", name);
3115 _mmcamcorder_get_image_codec_format(MMHandleType handle, char * name)
3118 char* image_fmt_type[] = {
3119 "JPEG", /**< JPEG codec */
3120 "PNG", /**< PNG codec */
3121 "BMP", /**< BMP codec */
3122 "WBMP", /**< WBMP codec */
3123 "TIFF", /**< TIFF codec */
3124 "PCX", /**< PCX codec */
3125 "GIF", /**< GIF codec */
3126 "ICO", /**< ICO codec */
3127 "RAS", /**< RAS codec */
3128 "TGA", /**< TGA codec */
3129 "XBM", /**< XBM codec */
3130 "XPM" /**< XPM codec */
3131 "SRW" /**< SRW (Samsung standard RAW) */
3132 "JPEG_SRW" /**< JPEG + SRW */
3135 for (i = 0; i < MM_IMAGE_CODEC_NUM; i++)
3137 if (!strcmp(name, image_fmt_type[i]))
3139 // _mmcam_dbg_log( "Image codec[%d]", i);
3144 _mmcam_dbg_err( "Not supported Image codec[%s]", name);
3151 _mmcamcorder_get_mux_format(MMHandleType handle, char * name)
3154 char* mux_fmt_type[] = {
3155 "3GP", /**< 3GP file format */
3156 "ASF", /**< Advanced Systems File file format */
3157 "AVI", /**< Audio Video Interleaved file format */
3158 "MATROSKA", /**< MATROSAK file format */
3159 "MP4", /**< MP4 file format */
3160 "OGG", /**< OGG file format */
3161 "NUT", /**< NUT file format */
3162 "QT", /**< MOV file format */
3163 "REAL", /**< RealMedia file format */
3164 "AMR", /**< AMR file format */
3165 "AAC", /**< AAC file format */
3166 "MP3", /**< MP3 file format */
3167 "AIFF", /**< AIFF file format */
3168 "AU", /**< Audio file format */
3169 "WAV", /**< WAV file format */
3170 "MID", /**< MID file format */
3171 "MMF", /**< MMF file format */
3172 "DIVX", /**< DivX file format */
3173 "FLV", /**< Flash video file format */
3174 "VOB", /**< DVD-Video Object file format */
3175 "IMELODY", /**< IMelody file format */
3176 "WMA", /**< WMA file format */
3177 "WMV", /**< WMV file format */
3178 "JPG" /**< JPEG file format */
3181 for (i = 0; i < MM_FILE_FORMAT_NUM; i++)
3183 if (!strcmp(name, mux_fmt_type[i]))
3185 // _mmcam_dbg_log( "Mux[%d]", i);
3190 _mmcam_dbg_err( "Not supported Mux[%s]", name);
3197 _mmcamcorder_get_format(MMHandleType handle, int conf_category, char * name)
3201 mmf_return_val_if_fail(name, -1);
3203 switch(conf_category)
3205 case CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER:
3206 fmt = _mmcamcorder_get_audio_codec_format(handle, name);
3208 case CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER:
3209 fmt = _mmcamcorder_get_video_codec_format(handle, name);
3211 case CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER:
3212 fmt = _mmcamcorder_get_image_codec_format(handle, name);
3214 case CONFIGURE_CATEGORY_MAIN_MUX:
3215 fmt = _mmcamcorder_get_mux_format(handle, name);
3218 _mmcam_dbg_log("Can't get format from this category.(%d)", conf_category);
3225 _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** format)
3227 mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
3228 camera_conf* configure_info = NULL;
3230 int total_count = 0;
3232 mmf_return_val_if_fail(hcamcorder, 0);
3234 _mmcam_dbg_log("conf_category:%d", conf_category);
3236 configure_info = hcamcorder->conf_main;
3238 if( configure_info->info[conf_category] )
3240 int count = configure_info->info[conf_category]->count;
3241 conf_info* info = configure_info->info[conf_category];
3246 _mmcam_dbg_log("count[%d], info[%p]", count, info);
3248 if ((count <= 0) || (!info))
3253 arr = (int*) g_malloc0(count * sizeof(int));
3255 for( i = 0 ; i < count ; i++ )
3257 if( info->detail_info[i] == NULL )
3262 name = ((type_element*)(info->detail_info[i]))->name;
3264 if ((fmt = _mmcamcorder_get_format(handle, conf_category, name)) >= 0)
3266 arr[total_count++] = fmt;
3268 _mmcam_dbg_log("name:%s, fmt:%d", name, fmt);