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 /*=======================================================================================
24 =======================================================================================*/
30 #include "mm_camcorder_internal.h"
31 #include "mm_camcorder_configure.h"
33 /*-----------------------------------------------------------------------
34 | MACRO DEFINITIONS: |
35 -----------------------------------------------------------------------*/
36 #define CONFIGURE_PATH "/usr/etc"
37 #define CONFIGURE_PATH_RETRY "/opt/etc"
39 /*-----------------------------------------------------------------------
40 | GLOBAL VARIABLE DEFINITIONS |
41 -----------------------------------------------------------------------*/
43 /*-----------------------------------------------------------------------
44 | LOCAL VARIABLE DEFINITIONS |
45 -----------------------------------------------------------------------*/
46 static int conf_main_category_size[CONFIGURE_CATEGORY_MAIN_NUM] = { 0, };
47 static int conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_NUM] = { 0, };
49 static conf_info_table* conf_main_info_table[CONFIGURE_CATEGORY_MAIN_NUM] = { NULL, };
50 static conf_info_table* conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_NUM] = { NULL, };
53 * Videosrc element default value
55 static type_element _videosrc_element_default = {
65 * Audiosrc element default value
67 static type_int ___audiosrc_default_channel = { "Channel", 1 };
68 static type_int ___audiosrc_default_bitrate = { "BitRate", 8000 };
69 static type_int ___audiosrc_default_depth = { "Depth", 16 };
70 static type_int ___audiosrc_default_blocksize = { "BlockSize", 1280 };
71 static type_int* __audiosrc_default_int_array[] = {
72 &___audiosrc_default_channel,
73 &___audiosrc_default_bitrate,
74 &___audiosrc_default_depth,
75 &___audiosrc_default_blocksize,
77 static type_string ___audiosrc_default_device = { "Device", "default" };
78 static type_string* __audiosrc_default_string_array[] = {
79 &___audiosrc_default_device,
81 static type_element _audiosrc_element_default = {
84 __audiosrc_default_int_array,
85 sizeof( __audiosrc_default_int_array ) / sizeof( type_int* ),
86 __audiosrc_default_string_array,
87 sizeof( __audiosrc_default_string_array ) / sizeof( type_string* ),
90 static type_element _audiomodemsrc_element_default = {
91 "AudiomodemsrcElement",
93 __audiosrc_default_int_array,
94 sizeof( __audiosrc_default_int_array ) / sizeof( type_int* ),
95 __audiosrc_default_string_array,
96 sizeof( __audiosrc_default_string_array ) / sizeof( type_string* ),
101 * Videosink element default value
103 static type_int ___videosink_default_display_id = { "display-id", 3 };
104 static type_int ___videosink_default_x = { "x", 0 };
105 static type_int ___videosink_default_y = { "y", 0 };
106 static type_int ___videosink_default_width = { "width", 800 };
107 static type_int ___videosink_default_height = { "height", 480 };
108 static type_int ___videosink_default_rotation = { "rotation", 1 };
109 static type_int* __videosink_default_int_array[] = {
110 &___videosink_default_display_id,
111 &___videosink_default_x,
112 &___videosink_default_y,
113 &___videosink_default_width,
114 &___videosink_default_height,
115 &___videosink_default_rotation,
117 static type_string* __videosink_default_string_array[] = { NULL };
118 static type_element _videosink_element_x_default = {
121 __videosink_default_int_array,
122 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
123 __videosink_default_string_array,
124 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
126 static type_element _videosink_element_evas_default = {
127 "VideosinkElementEvas",
129 __videosink_default_int_array,
130 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
131 __videosink_default_string_array,
132 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
134 static type_element _videosink_element_gl_default = {
135 "VideosinkElementGL",
137 __videosink_default_int_array,
138 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
139 __videosink_default_string_array,
140 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
142 static type_element _videosink_element_null_default = {
143 "VideosinkElementNull",
145 __videosink_default_int_array,
146 sizeof( __videosink_default_int_array ) / sizeof( type_int* ),
147 __videosink_default_string_array,
148 sizeof( __videosink_default_string_array ) / sizeof( type_string* ),
152 * Videoscale element default value
154 static type_element _videoscale_element_default = {
164 * Record sink element default value
166 static type_element _recordsink_element_default = {
176 * H263 element default value
178 static type_element _h263_element_default = {
188 * H264 element default value
190 static type_element _h264_element_default = {
200 * H26L element default value
202 static type_element _h26l_element_default = {
212 * MPEG4 element default value
214 static type_element _mpeg4_element_default = {
224 * MPEG1 element default value
226 static type_element _mpeg1_element_default = {
236 * THEORA element default value
238 static type_element _theora_element_default = {
248 * AMR element default value
250 static type_element _amr_element_default = {
260 * G723_1 element default value
262 static type_element _g723_1_element_default = {
272 * MP3 element default value
274 static type_element _mp3_element_default = {
284 * AAC element default value
286 static type_element _aac_element_default = {
296 * MMF element default value
298 static type_element _mmf_element_default = {
308 * ADPCM element default value
310 static type_element _adpcm_element_default = {
312 "ffenc_adpcm_ima_qt",
320 * WAVE element default value
322 static type_element _wave_element_default = {
331 static type_element _vorbis_element_default = {
341 * MIDI element default value
343 static type_element _midi_element_default = {
353 * IMELODY element default value
355 static type_element _imelody_element_default = {
365 * JPEG element default value
367 static type_element _jpeg_element_default = {
377 * PNG element default value
379 static type_element _png_element_default = {
389 * BMP element default value
391 static type_element _bmp_element_default = {
401 * WBMP element default value
403 static type_element _wbmp_element_default = {
413 * TIFF element default value
415 static type_element _tiff_element_default = {
425 * PCX element default value
427 static type_element _pcx_element_default = {
437 * GIF element default value
439 static type_element _gif_element_default = {
449 * ICO element default value
451 static type_element _ico_element_default = {
461 * RAS element default value
463 static type_element _ras_element_default = {
473 * TGA element default value
475 static type_element _tga_element_default = {
485 * XBM element default value
487 static type_element _xbm_element_default = {
497 * XPM element default value
499 static type_element _xpm_element_default = {
509 * 3GP element default value
511 static type_element _3gp_element_default = {
521 * AMR mux element default value
523 static type_element _amrmux_element_default = {
533 * MP4 element default value
535 static type_element _mp4_element_default = {
545 * AAC mux element default value
547 static type_element _aacmux_element_default = {
557 * MP3 mux element default value
559 static type_element _mp3mux_element_default = {
569 * OGG element default value
571 static type_element _ogg_element_default = {
581 * WAV element default value
583 static type_element _wav_element_default = {
593 * AVI element default value
595 static type_element _avi_element_default = {
605 * WMA element default value
607 static type_element _wma_element_default = {
617 * WMV element default value
619 static type_element _wmv_element_default = {
629 * MID element default value
631 static type_element _mid_element_default = {
641 * MMF mux element default value
643 static type_element _mmfmux_element_default = {
653 * MATROSKA element default value
655 static type_element _matroska_element_default = {
665 * [General] matching table
667 static conf_info_table conf_main_general_table[] = {
668 { "SyncStateChange", CONFIGURE_VALUE_INT, {1} },
669 { "GSTInitOption", CONFIGURE_VALUE_STRING_ARRAY, {(int)NULL} },
670 { "ModelName", CONFIGURE_VALUE_STRING, {(int)"Samsung Camera"} },
671 { "DisabledAttributes", CONFIGURE_VALUE_STRING_ARRAY, {(int)NULL} },
675 * [VideoInput] matching table
677 static conf_info_table conf_main_video_input_table[] = {
678 { "UseConfCtrl", CONFIGURE_VALUE_INT, {1} },
679 { "ConfCtrlFile0", CONFIGURE_VALUE_STRING, {(int)"mmfw_camcorder_dev_video_pri.ini"} },
680 { "ConfCtrlFile1", CONFIGURE_VALUE_STRING, {(int)"mmfw_camcorder_dev_video_sec.ini"} },
681 { "VideosrcElement", CONFIGURE_VALUE_ELEMENT, {(int)&_videosrc_element_default} },
682 { "UseVideoscale", CONFIGURE_VALUE_INT, {0} },
683 { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {(int)&_videoscale_element_default} },
684 { "UseZeroCopyFormat", CONFIGURE_VALUE_INT, {0} },
685 { "DeviceCount", CONFIGURE_VALUE_INT, {MM_VIDEO_DEVICE_NUM} },
689 * [AudioInput] matching table
691 static conf_info_table conf_main_audio_input_table[] = {
692 { "AudiosrcElement", CONFIGURE_VALUE_ELEMENT, {(int)&_audiosrc_element_default} },
693 { "AudiomodemsrcElement", CONFIGURE_VALUE_ELEMENT, {(int)&_audiomodemsrc_element_default} },
697 * [VideoOutput] matching table
699 static conf_info_table conf_main_video_output_table[] = {
700 { "DisplayDevice", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
701 { "DisplayMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
702 { "Videosink", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
703 { "VideosinkElementX", CONFIGURE_VALUE_ELEMENT, {(int)&_videosink_element_x_default} },
704 { "VideosinkElementEvas", CONFIGURE_VALUE_ELEMENT, {(int)&_videosink_element_evas_default} },
705 { "VideosinkElementGL", CONFIGURE_VALUE_ELEMENT, {(int)&_videosink_element_gl_default} },
706 { "VideosinkElementNull", CONFIGURE_VALUE_ELEMENT, {(int)&_videosink_element_null_default} },
707 { "UseVideoscale", CONFIGURE_VALUE_INT, {0} },
708 { "VideoscaleElement", CONFIGURE_VALUE_ELEMENT, {(int)&_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, {(int)&_videoscale_element_default} },
718 { "PlayCaptureSound", CONFIGURE_VALUE_INT, {1} },
722 * [Record] matching table
724 static conf_info_table conf_main_record_table[] = {
725 { "UseAudioEncoderQueue", CONFIGURE_VALUE_INT, {1} },
726 { "UseVideoEncoderQueue", CONFIGURE_VALUE_INT, {1} },
727 { "VideoProfile", CONFIGURE_VALUE_INT, {0} },
728 { "VideoAutoAudioConvert", CONFIGURE_VALUE_INT, {0} },
729 { "VideoAutoAudioResample", CONFIGURE_VALUE_INT, {0} },
730 { "VideoAutoColorSpace", CONFIGURE_VALUE_INT, {0} },
731 { "AudioProfile", CONFIGURE_VALUE_INT, {0} },
732 { "AudioAutoAudioConvert", CONFIGURE_VALUE_INT, {0} },
733 { "AudioAutoAudioResample", CONFIGURE_VALUE_INT, {0} },
734 { "AudioAutoColorSpace", CONFIGURE_VALUE_INT, {0} },
735 { "ImageProfile", CONFIGURE_VALUE_INT, {0} },
736 { "ImageAutoAudioConvert", CONFIGURE_VALUE_INT, {0} },
737 { "ImageAutoAudioResample", CONFIGURE_VALUE_INT, {0} },
738 { "ImageAutoColorSpace", CONFIGURE_VALUE_INT, {0} },
739 { "RecordsinkElement", CONFIGURE_VALUE_ELEMENT, {(int)&_recordsink_element_default} },
740 { "UseNoiseSuppressor", CONFIGURE_VALUE_INT, {0} },
741 { "DropVideoFrame", CONFIGURE_VALUE_INT, {0} },
742 { "PassFirstVideoFrame", CONFIGURE_VALUE_INT, {0} },
746 * [VideoEncoder] matching table
748 static conf_info_table conf_main_video_encoder_table[] = {
749 { "H263", CONFIGURE_VALUE_ELEMENT, {(int)&_h263_element_default} },
750 { "H264", CONFIGURE_VALUE_ELEMENT, {(int)&_h264_element_default} },
751 { "H26L", CONFIGURE_VALUE_ELEMENT, {(int)&_h26l_element_default} },
752 { "MPEG4", CONFIGURE_VALUE_ELEMENT, {(int)&_mpeg4_element_default} },
753 { "MPEG1", CONFIGURE_VALUE_ELEMENT, {(int)&_mpeg1_element_default} },
754 { "THEORA", CONFIGURE_VALUE_ELEMENT, {(int)&_theora_element_default} },
758 * [AudioEncoder] matching table
760 static conf_info_table conf_main_audio_encoder_table[] = {
761 { "AMR", CONFIGURE_VALUE_ELEMENT, {(int)&_amr_element_default} },
762 { "G723_1", CONFIGURE_VALUE_ELEMENT, {(int)&_g723_1_element_default} },
763 { "MP3", CONFIGURE_VALUE_ELEMENT, {(int)&_mp3_element_default} },
764 { "AAC", CONFIGURE_VALUE_ELEMENT, {(int)&_aac_element_default} },
765 { "MMF", CONFIGURE_VALUE_ELEMENT, {(int)&_mmf_element_default} },
766 { "ADPCM", CONFIGURE_VALUE_ELEMENT, {(int)&_adpcm_element_default} },
767 { "WAVE", CONFIGURE_VALUE_ELEMENT, {(int)&_wave_element_default} },
768 { "MIDI", CONFIGURE_VALUE_ELEMENT, {(int)&_midi_element_default} },
769 { "IMELODY", CONFIGURE_VALUE_ELEMENT, {(int)&_imelody_element_default} },
770 { "VORBIS", CONFIGURE_VALUE_ELEMENT, {(int)&_vorbis_element_default} },
774 * [ImageEncoder] matching table
776 static conf_info_table conf_main_image_encoder_table[] = {
777 { "JPEG", CONFIGURE_VALUE_ELEMENT, {(int)&_jpeg_element_default} },
778 { "PNG", CONFIGURE_VALUE_ELEMENT, {(int)&_png_element_default} },
779 { "BMP", CONFIGURE_VALUE_ELEMENT, {(int)&_bmp_element_default} },
780 { "WBMP", CONFIGURE_VALUE_ELEMENT, {(int)&_wbmp_element_default} },
781 { "TIFF", CONFIGURE_VALUE_ELEMENT, {(int)&_tiff_element_default} },
782 { "PCX", CONFIGURE_VALUE_ELEMENT, {(int)&_pcx_element_default} },
783 { "GIF", CONFIGURE_VALUE_ELEMENT, {(int)&_gif_element_default} },
784 { "ICO", CONFIGURE_VALUE_ELEMENT, {(int)&_ico_element_default} },
785 { "RAS", CONFIGURE_VALUE_ELEMENT, {(int)&_ras_element_default} },
786 { "TGA", CONFIGURE_VALUE_ELEMENT, {(int)&_tga_element_default} },
787 { "XBM", CONFIGURE_VALUE_ELEMENT, {(int)&_xbm_element_default} },
788 { "XPM", CONFIGURE_VALUE_ELEMENT, {(int)&_xpm_element_default} },
792 * [Mux] matching table
794 static conf_info_table conf_main_mux_table[] = {
795 { "3GP", CONFIGURE_VALUE_ELEMENT, {(int)&_3gp_element_default} },
796 { "AMR", CONFIGURE_VALUE_ELEMENT, {(int)&_amrmux_element_default} },
797 { "MP4", CONFIGURE_VALUE_ELEMENT, {(int)&_mp4_element_default} },
798 { "AAC", CONFIGURE_VALUE_ELEMENT, {(int)&_aacmux_element_default} },
799 { "MP3", CONFIGURE_VALUE_ELEMENT, {(int)&_mp3mux_element_default} },
800 { "OGG", CONFIGURE_VALUE_ELEMENT, {(int)&_ogg_element_default} },
801 { "WAV", CONFIGURE_VALUE_ELEMENT, {(int)&_wav_element_default} },
802 { "AVI", CONFIGURE_VALUE_ELEMENT, {(int)&_avi_element_default} },
803 { "WMA", CONFIGURE_VALUE_ELEMENT, {(int)&_wma_element_default} },
804 { "WMV", CONFIGURE_VALUE_ELEMENT, {(int)&_wmv_element_default} },
805 { "MID", CONFIGURE_VALUE_ELEMENT, {(int)&_mid_element_default} },
806 { "MMF", CONFIGURE_VALUE_ELEMENT, {(int)&_mmfmux_element_default} },
807 { "MATROSKA", CONFIGURE_VALUE_ELEMENT, {(int)&_matroska_element_default} },
816 * [Camera] matching table
818 static conf_info_table conf_ctrl_camera_table[] = {
819 { "InputIndex", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
820 { "DeviceName", CONFIGURE_VALUE_STRING, {(int)NULL} },
821 { "PreviewResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {(int)NULL} },
822 { "CaptureResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {(int)NULL} },
823 { "FPS", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
824 { "PictureFormat", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
825 { "Overlay", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
826 { "RecommendDisplayRotation", CONFIGURE_VALUE_INT, {3} },
827 { "RecommendPreviewFormatCapture", CONFIGURE_VALUE_INT, {MM_PIXEL_FORMAT_YUYV} },
828 { "RecommendPreviewFormatRecord", CONFIGURE_VALUE_INT, {MM_PIXEL_FORMAT_NV12} },
829 { "RecommendPreviewResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {(int)NULL} },
830 { "FacingDirection", CONFIGURE_VALUE_INT, {MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR} },
834 * [Strobe] matching table
836 static conf_info_table conf_ctrl_strobe_table[] = {
837 { "StrobeControl", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
838 { "StrobeMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
839 { "StrobeEV", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
843 * [Effect] matching table
845 static conf_info_table conf_ctrl_effect_table[] = {
846 { "Brightness", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
847 { "Contrast", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
848 { "Saturation", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
849 { "Sharpness", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
850 { "WhiteBalance", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
851 { "ColorTone", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
852 { "Flip", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
853 { "WDR", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
854 { "PartColorMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
855 { "PartColor", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
859 * [Photograph] matching table
861 static conf_info_table conf_ctrl_photograph_table[] = {
862 { "LensInit", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
863 { "DigitalZoom", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
864 { "OpticalZoom", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
865 { "FocusMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
866 { "AFType", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
867 { "AEType", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
868 { "ExposureValue", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
869 { "FNumber", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
870 { "ShutterSpeed", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
871 { "ISO", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
872 { "ProgramMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
873 { "AntiHandshake", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
874 { "VideoStabilization", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
875 { "FaceZoomMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
876 { "FaceZoomLevel", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
880 * [Capture] matching table
882 static conf_info_table conf_ctrl_capture_table[] = {
883 { "OutputMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
884 { "JpegQuality", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
885 { "MultishotNumber", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
886 { "SensorEncodedCapture", CONFIGURE_VALUE_INT, {1} },
887 { "SupportHDR", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
891 * [Detect] matching table
893 static conf_info_table conf_ctrl_detect_table[] = {
894 { "DetectMode", CONFIGURE_VALUE_INT_ARRAY, {(int)NULL} },
895 { "DetectNumber", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
896 { "DetectSelect", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
897 { "DetectSelectNumber", CONFIGURE_VALUE_INT_RANGE, {(int)NULL} },
903 get_new_string( char* src_string )
905 return strdup(src_string);
908 void _mmcamcorder_conf_init(int type, camera_conf** configure_info)
911 int info_table_size = sizeof(conf_info_table);
913 _mmcam_dbg_log("Entered...");
915 if (type == CONFIGURE_TYPE_MAIN) {
916 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_GENERAL] = conf_main_general_table;
917 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT] = conf_main_video_input_table;
918 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT] = conf_main_audio_input_table;
919 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT] = conf_main_video_output_table;
920 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_CAPTURE] = conf_main_capture_table;
921 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_RECORD] = conf_main_record_table;
922 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER] = conf_main_video_encoder_table;
923 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER] = conf_main_audio_encoder_table;
924 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER] = conf_main_image_encoder_table;
925 conf_main_info_table[CONFIGURE_CATEGORY_MAIN_MUX] = conf_main_mux_table;
927 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_GENERAL] = sizeof( conf_main_general_table ) / info_table_size;
928 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT] = sizeof( conf_main_video_input_table ) / info_table_size;
929 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT] = sizeof( conf_main_audio_input_table ) / info_table_size;
930 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT] = sizeof( conf_main_video_output_table ) / info_table_size;
931 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_CAPTURE] = sizeof( conf_main_capture_table ) / info_table_size;
932 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_RECORD] = sizeof( conf_main_record_table ) / info_table_size;
933 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER] = sizeof( conf_main_video_encoder_table ) / info_table_size;
934 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER] = sizeof( conf_main_audio_encoder_table ) / info_table_size;
935 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER] = sizeof( conf_main_image_encoder_table ) / info_table_size;
936 conf_main_category_size[CONFIGURE_CATEGORY_MAIN_MUX] = sizeof( conf_main_mux_table ) / info_table_size;
938 (*configure_info)->info = (conf_info**)g_malloc0( sizeof( conf_info* ) * CONFIGURE_CATEGORY_MAIN_NUM );
940 for (i = 0 ; i < CONFIGURE_CATEGORY_MAIN_NUM ; i++) {
941 (*configure_info)->info[i] = NULL;
944 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_CAMERA] = conf_ctrl_camera_table;
945 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_STROBE] = conf_ctrl_strobe_table;
946 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_EFFECT] = conf_ctrl_effect_table;
947 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH] = conf_ctrl_photograph_table;
948 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_CAPTURE] = conf_ctrl_capture_table;
949 conf_ctrl_info_table[CONFIGURE_CATEGORY_CTRL_DETECT] = conf_ctrl_detect_table;
951 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_CAMERA] = sizeof( conf_ctrl_camera_table ) / info_table_size;
952 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_STROBE] = sizeof( conf_ctrl_strobe_table ) / info_table_size;
953 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_EFFECT] = sizeof( conf_ctrl_effect_table ) / info_table_size;
954 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH] = sizeof( conf_ctrl_photograph_table ) / info_table_size;
955 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_CAPTURE] = sizeof( conf_ctrl_capture_table ) / info_table_size;
956 conf_ctrl_category_size[CONFIGURE_CATEGORY_CTRL_DETECT] = sizeof( conf_ctrl_detect_table ) / info_table_size;
958 (*configure_info)->info = (conf_info**)g_malloc0( sizeof( conf_info* ) * CONFIGURE_CATEGORY_CTRL_NUM );
960 for (i = 0 ; i < CONFIGURE_CATEGORY_CTRL_NUM ; i++) {
961 (*configure_info)->info[i] = NULL;
965 _mmcam_dbg_log("Done.");
972 _mmcamcorder_conf_get_info( int type, char* ConfFile, camera_conf** configure_info )
974 int ret = MM_ERROR_NONE;
976 char* conf_path = NULL;
978 _mmcam_dbg_log( "Opening...[%s]", ConfFile );
980 mmf_return_val_if_fail( ConfFile, FALSE );
982 conf_path = (char*)malloc( strlen(ConfFile)+strlen(CONFIGURE_PATH)+3 );
984 if( conf_path == NULL )
986 _mmcam_dbg_err( "malloc failed." );
987 return MM_ERROR_CAMCORDER_LOW_MEMORY;
990 snprintf( conf_path, strlen(ConfFile)+strlen(CONFIGURE_PATH)+2, "%s/%s", CONFIGURE_PATH, ConfFile );
991 _mmcam_dbg_log( "Try open Configure File[%s]", conf_path );
993 fd = fopen( conf_path, "r" );
996 _mmcam_dbg_warn( "File open failed.[%s] retry...", conf_path );
997 snprintf( conf_path, strlen(ConfFile)+strlen(CONFIGURE_PATH_RETRY)+2, "%s/%s", CONFIGURE_PATH_RETRY, ConfFile );
998 _mmcam_dbg_log( "Try open Configure File[%s]", conf_path );
999 fd = fopen( conf_path, "r" );
1002 _mmcam_dbg_warn( "File open failed.[%s] But keep going... All value will be returned as default.Type[%d]",
1009 ret = _mmcamcorder_conf_parse_info( type, fd, configure_info );
1014 ret = MM_ERROR_CAMCORDER_CREATE_CONFIGURE;
1017 if( conf_path != NULL )
1023 _mmcam_dbg_log( "Leave..." );
1029 _mmcamcorder_conf_parse_info( int type, FILE* fd, camera_conf** configure_info )
1031 const unsigned int BUFFER_NUM_DETAILS = 256;
1032 const unsigned int BUFFER_NUM_TOKEN = 20;
1033 size_t BUFFER_LENGTH_STRING = 256;
1034 const char* delimiters = " |=,\t\n";
1037 int count_main_category = 0;
1038 int count_details = 0;
1039 int length_read = 0;
1040 int count_token = 0;
1043 char *buffer_string = (char*)g_malloc0(sizeof(char)*BUFFER_LENGTH_STRING);
1044 char *buffer_details[BUFFER_NUM_DETAILS];
1045 char *buffer_token[BUFFER_NUM_TOKEN];
1047 char *category_name = NULL;
1048 char *detail_string = NULL;
1049 char *user_ptr = NULL;
1051 _mmcam_dbg_log( "" );
1053 camera_conf* new_conf = (camera_conf*)g_malloc0(sizeof(camera_conf));
1055 if( new_conf == NULL )
1057 _mmcam_dbg_err( "Failed to create new configure structure.type[%d]", type );
1058 *configure_info = NULL;
1060 return MM_ERROR_CAMCORDER_LOW_MEMORY;
1063 new_conf->type = type;
1064 *configure_info = new_conf;
1066 _mmcamcorder_conf_init( type, &new_conf );
1068 mmf_return_val_if_fail( fd > 0, MM_ERROR_CAMCORDER_INVALID_ARGUMENT );
1071 count_main_category = 0;
1073 while( !feof( fd ) )
1075 if( read_main == 0 )
1077 length_read = getline( &buffer_string, &BUFFER_LENGTH_STRING, fd );
1078 /*_mmcam_dbg_log( "Read Line : [%s]", buffer_string );*/
1081 token = strtok_r( buffer_string, delimiters, &user_ptr );
1083 if ((token) && (token[0] == ';'))
1085 /*_mmcam_dbg_log( "Comment - Nothing to do" );*/
1091 /*_mmcam_dbg_log( "token : [%s]", token );*/
1092 buffer_token[count_token] = token;
1094 token = strtok_r( NULL, delimiters, &user_ptr );
1097 if( count_token == 0 )
1106 if( *buffer_token[0] == ';' )
1108 /*_mmcam_dbg_log( "Comment - Nothing to do" );*/
1111 else if( *buffer_token[0] == '[' )
1113 category_name = get_new_string( buffer_token[0] );
1115 count_main_category++;
1118 while( !feof( fd ) )
1120 length_read = getline( &buffer_string, &BUFFER_LENGTH_STRING, fd );
1121 /*_mmcam_dbg_log( "Read Detail Line : [%s], read length : [%d]", buffer_string, length_read );*/
1123 detail_string = get_new_string( buffer_string );
1125 token = strtok_r( buffer_string, delimiters, &user_ptr );
1127 if( token && token[0] != ';' && length_read > -1 )
1129 /*_mmcam_dbg_log( "token : [%s]", token );*/
1130 if( token[0] == '[' )
1133 buffer_token[0] = token;
1134 SAFE_FREE( detail_string );
1138 buffer_details[count_details++] = detail_string;
1142 SAFE_FREE( detail_string );
1146 _mmcam_dbg_log( "type : %d, category_name : %s, count : [%d]", type, category_name, count_details );
1148 if( count_details == 0 )
1150 _mmcam_dbg_warn( "category %s has no detail value... skip this category...", category_name );
1151 SAFE_FREE(category_name);
1158 if( type == CONFIGURE_TYPE_MAIN )
1160 if( !strcmp( "[General]", category_name ) )
1162 category = CONFIGURE_CATEGORY_MAIN_GENERAL;
1164 else if( !strcmp( "[VideoInput]", category_name ) )
1166 category = CONFIGURE_CATEGORY_MAIN_VIDEO_INPUT;
1168 else if( !strcmp( "[AudioInput]", category_name ) )
1170 category = CONFIGURE_CATEGORY_MAIN_AUDIO_INPUT;
1172 else if( !strcmp( "[VideoOutput]", category_name ) )
1174 category = CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT;
1176 else if( !strcmp( "[Capture]", category_name ) )
1178 category = CONFIGURE_CATEGORY_MAIN_CAPTURE;
1180 else if( !strcmp( "[Record]", category_name ) )
1182 category = CONFIGURE_CATEGORY_MAIN_RECORD;
1184 else if( !strcmp( "[VideoEncoder]", category_name ) )
1186 category = CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER;
1188 else if( !strcmp( "[AudioEncoder]", category_name ) )
1190 category = CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER;
1192 else if( !strcmp( "[ImageEncoder]", category_name ) )
1194 category = CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER;
1196 else if( !strcmp( "[Mux]", category_name ) )
1198 category = CONFIGURE_CATEGORY_MAIN_MUX;
1203 if( !strcmp( "[Camera]", category_name ) )
1205 category = CONFIGURE_CATEGORY_CTRL_CAMERA;
1207 else if( !strcmp( "[Strobe]", category_name ) )
1209 category = CONFIGURE_CATEGORY_CTRL_STROBE;
1211 else if( !strcmp( "[Effect]", category_name ) )
1213 category = CONFIGURE_CATEGORY_CTRL_EFFECT;
1215 else if( !strcmp( "[Photograph]", category_name ) )
1217 category = CONFIGURE_CATEGORY_CTRL_PHOTOGRAPH;
1219 else if( !strcmp( "[Capture]", category_name ) )
1221 category = CONFIGURE_CATEGORY_CTRL_CAPTURE;
1223 else if( !strcmp( "[Detect]", category_name ) )
1225 category = CONFIGURE_CATEGORY_CTRL_DETECT;
1229 if( category != -1 )
1231 _mmcamcorder_conf_add_info( type, &(new_conf->info[category]),
1232 buffer_details, category, count_details );
1236 _mmcam_dbg_warn( "No matched category[%s],type[%d]... check it.", category_name, type );
1243 for( i = 0 ; i < count_details ; i++ )
1245 SAFE_FREE( buffer_details[i] );
1250 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);
2996 int _mmcamcorder_get_audio_codec_format(MMHandleType handle, char *name)
2998 int codec_index = MM_AUDIO_CODEC_INVALID;
3001 _mmcam_dbg_err("name is NULL");
3002 return MM_AUDIO_CODEC_INVALID;
3005 if (!strcmp(name, "AMR")) {
3006 codec_index = MM_AUDIO_CODEC_AMR;
3007 } else if (!strcmp(name, "G723_1")) {
3008 codec_index = MM_AUDIO_CODEC_G723_1;
3009 } else if (!strcmp(name, "MP3")) {
3010 codec_index = MM_AUDIO_CODEC_MP3;
3011 } else if (!strcmp(name, "AAC")) {
3012 codec_index = MM_AUDIO_CODEC_AAC;
3013 } else if (!strcmp(name, "MMF")) {
3014 codec_index = MM_AUDIO_CODEC_MMF;
3015 } else if (!strcmp(name, "ADPCM")) {
3016 codec_index = MM_AUDIO_CODEC_ADPCM;
3017 } else if (!strcmp(name, "WAVE")) {
3018 codec_index = MM_AUDIO_CODEC_WAVE;
3019 } else if (!strcmp(name, "MIDI")) {
3020 codec_index = MM_AUDIO_CODEC_MIDI;
3021 } else if (!strcmp(name, "IMELODY")) {
3022 codec_index = MM_AUDIO_CODEC_IMELODY;
3023 } else if (!strcmp(name, "VORBIS")) {
3024 codec_index = MM_AUDIO_CODEC_VORBIS;
3027 _mmcam_dbg_log("audio codec index %d", codec_index);
3034 int _mmcamcorder_get_video_codec_format(MMHandleType handle, char *name)
3036 int codec_index = MM_VIDEO_CODEC_INVALID;
3039 _mmcam_dbg_err("name is NULL");
3040 return MM_VIDEO_CODEC_INVALID;
3043 if (!strcmp(name, "H263")) {
3044 codec_index = MM_VIDEO_CODEC_H263;
3045 } else if (!strcmp(name, "H264")) {
3046 codec_index = MM_VIDEO_CODEC_H264;
3047 } else if (!strcmp(name, "H26L")) {
3048 codec_index = MM_VIDEO_CODEC_H26L;
3049 } else if (!strcmp(name, "MPEG4")) {
3050 codec_index = MM_VIDEO_CODEC_MPEG4;
3051 } else if (!strcmp(name, "MPEG1")) {
3052 codec_index = MM_VIDEO_CODEC_MPEG1;
3053 } else if (!strcmp(name, "THEORA")) {
3054 codec_index = MM_VIDEO_CODEC_THEORA;
3057 _mmcam_dbg_log("video codec index %d", codec_index);
3064 int _mmcamcorder_get_image_codec_format(MMHandleType handle, char *name)
3066 int codec_index = MM_IMAGE_CODEC_INVALID;
3069 _mmcam_dbg_err("name is NULL");
3070 return MM_IMAGE_CODEC_INVALID;
3073 if (!strcmp(name, "JPEG")) {
3074 codec_index = MM_IMAGE_CODEC_JPEG;
3075 } else if (!strcmp(name, "PNG")) {
3076 codec_index = MM_IMAGE_CODEC_PNG;
3077 } else if (!strcmp(name, "BMP")) {
3078 codec_index = MM_IMAGE_CODEC_BMP;
3079 } else if (!strcmp(name, "WBMP")) {
3080 codec_index = MM_IMAGE_CODEC_WBMP;
3081 } else if (!strcmp(name, "TIFF")) {
3082 codec_index = MM_IMAGE_CODEC_TIFF;
3083 } else if (!strcmp(name, "PCX")) {
3084 codec_index = MM_IMAGE_CODEC_PCX;
3085 } else if (!strcmp(name, "GIF")) {
3086 codec_index = MM_IMAGE_CODEC_GIF;
3087 } else if (!strcmp(name, "ICO")) {
3088 codec_index = MM_IMAGE_CODEC_ICO;
3089 } else if (!strcmp(name, "RAS")) {
3090 codec_index = MM_IMAGE_CODEC_RAS;
3091 } else if (!strcmp(name, "TGA")) {
3092 codec_index = MM_IMAGE_CODEC_TGA;
3093 } else if (!strcmp(name, "XBM")) {
3094 codec_index = MM_IMAGE_CODEC_XBM;
3095 } else if (!strcmp(name, "XPM")) {
3096 codec_index = MM_IMAGE_CODEC_XPM;
3099 _mmcam_dbg_log("image codec index %d", codec_index);
3105 int _mmcamcorder_get_mux_format(MMHandleType handle, char *name)
3107 int mux_index = MM_FILE_FORMAT_INVALID;
3110 _mmcam_dbg_err("name is NULL");
3111 return MM_FILE_FORMAT_INVALID;
3114 if (!strcmp(name, "3GP")) {
3115 mux_index = MM_FILE_FORMAT_3GP;
3116 } else if (!strcmp(name, "AMR")) {
3117 mux_index = MM_FILE_FORMAT_AMR;
3118 } else if (!strcmp(name, "MP4")) {
3119 mux_index = MM_FILE_FORMAT_MP4;
3120 } else if (!strcmp(name, "AAC")) {
3121 mux_index = MM_FILE_FORMAT_AAC;
3122 } else if (!strcmp(name, "MP3")) {
3123 mux_index = MM_FILE_FORMAT_MP3;
3124 } else if (!strcmp(name, "OGG")) {
3125 mux_index = MM_FILE_FORMAT_OGG;
3126 } else if (!strcmp(name, "WAV")) {
3127 mux_index = MM_FILE_FORMAT_WAV;
3128 } else if (!strcmp(name, "AVI")) {
3129 mux_index = MM_FILE_FORMAT_AVI;
3130 } else if (!strcmp(name, "WMA")) {
3131 mux_index = MM_FILE_FORMAT_WMA;
3132 } else if (!strcmp(name, "WMV")) {
3133 mux_index = MM_FILE_FORMAT_WMV;
3134 } else if (!strcmp(name, "MID")) {
3135 mux_index = MM_FILE_FORMAT_MID;
3136 } else if (!strcmp(name, "MMF")) {
3137 mux_index = MM_FILE_FORMAT_MMF;
3138 } else if (!strcmp(name, "MATROSKA")) {
3139 mux_index = MM_FILE_FORMAT_MATROSKA;
3142 _mmcam_dbg_log("mux index %d", mux_index);
3149 _mmcamcorder_get_format(MMHandleType handle, int conf_category, char * name)
3153 mmf_return_val_if_fail(name, -1);
3155 switch(conf_category)
3157 case CONFIGURE_CATEGORY_MAIN_AUDIO_ENCODER:
3158 fmt = _mmcamcorder_get_audio_codec_format(handle, name);
3160 case CONFIGURE_CATEGORY_MAIN_VIDEO_ENCODER:
3161 fmt = _mmcamcorder_get_video_codec_format(handle, name);
3163 case CONFIGURE_CATEGORY_MAIN_IMAGE_ENCODER:
3164 fmt = _mmcamcorder_get_image_codec_format(handle, name);
3166 case CONFIGURE_CATEGORY_MAIN_MUX:
3167 fmt = _mmcamcorder_get_mux_format(handle, name);
3170 _mmcam_dbg_log("Can't get format from this category.(%d)", conf_category);
3177 _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int ** format)
3179 mmf_camcorder_t *hcamcorder= MMF_CAMCORDER(handle);
3180 camera_conf* configure_info = NULL;
3182 int total_count = 0;
3184 mmf_return_val_if_fail(hcamcorder, 0);
3186 _mmcam_dbg_log("conf_category:%d", conf_category);
3188 configure_info = hcamcorder->conf_main;
3190 if (configure_info->info[conf_category]) {
3194 int count = configure_info->info[conf_category]->count;
3195 conf_info *info = configure_info->info[conf_category];
3197 _mmcam_dbg_log("count[%d], info[%p]", count, info);
3199 if (count <= 0 || !info) {
3203 arr = (int*) g_malloc0(count * sizeof(int));
3205 for (i = 0 ; i < count ; i++) {
3206 if (info->detail_info[i] == NULL) {
3210 name = ((type_element*)(info->detail_info[i]))->name;
3211 fmt = _mmcamcorder_get_format(handle, conf_category, name);
3213 arr[total_count++] = fmt;
3216 _mmcam_dbg_log("name:%s, fmt:%d", name, fmt);