fix double free
[platform/core/multimedia/libmm-streamrecorder.git] / src / include / mm_streamrecorder_ini.h
1 /*
2  * libmm-streamrecorder
3  *
4  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Hyuntae Kim <ht1211.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __MM_STREAMRECORDER_INI_H__
23 #define __MM_STREAMRECORDER_INI_H__
24
25 #include <glib.h>
26 #include "mm_debug.h"
27 #include "mm_streamrecorder.h"
28 #include "mm_streamrecorder_util.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define MM_STREAMRECORDER_INI_DEFAULT_PATH      SYSCONFDIR"/multimedia/mmfw_streamrecorder.ini"
35
36 #define STREAMRECORDER_INI_MAX_STRLEN   256
37 #define STREAMRECORDER_INI_MAX_ELEMENT  10
38 #define STREAMRECORDER_ATTRIBUTE_NUM_MAX 8
39
40 enum keyword_type {
41         KEYWORD_VIDEO_WIDTH,
42         KEYWORD_VIDEO_HEIGHT,
43         KEYWORD_AUDIO_ENCODERS,
44         KEYWORD_VIDEO_ENCODERS,
45         KEYWORD_FILE_FORMATS,
46 };
47
48 typedef struct __mm_streamrecorder_ini {
49         /* general */
50         gboolean encsink_src_islive;
51         guint retrial_count;
52         guint minimum_frame;
53         guint convert_output_buffer_num;
54         guint reset_pause_time;
55         guint screen_record;
56
57         /*encodebin */
58         guint encsink_bin_profile;
59         gboolean encsink_bin_auto_audio_resample;
60         gboolean encsink_bin_auto_colorspace;
61         gboolean encsink_bin_auto_audio_convert;
62         gboolean encsink_bin_use_video_toggle;
63
64         /* pipeline */
65         gchar name_of_encsink_src[STREAMRECORDER_INI_MAX_STRLEN];
66         gchar name_of_audio_src[STREAMRECORDER_INI_MAX_STRLEN];
67         gchar h264_video_encoder[STREAMRECORDER_INI_MAX_STRLEN];
68         gchar h263_video_encoder[STREAMRECORDER_INI_MAX_STRLEN];
69         gchar mpeg4_video_encoder[STREAMRECORDER_INI_MAX_STRLEN];
70         gchar name_of_encsink_bin_audio_encoder[STREAMRECORDER_INI_MAX_STRLEN];
71         gchar name_of_encsink_bin_video_converter[STREAMRECORDER_INI_MAX_STRLEN];
72         gchar encsink_bin_use_parser[STREAMRECORDER_INI_MAX_STRLEN];
73         gchar name_of_encsink_bin_3GPMUXER[STREAMRECORDER_INI_MAX_STRLEN];
74         gchar name_of_encsink_bin_MP4MUXER[STREAMRECORDER_INI_MAX_STRLEN];
75         gchar name_of_encsink_sink[STREAMRECORDER_INI_MAX_STRLEN];
76
77         /* audio parameter */
78         guint audio_frame_minimum_space;
79         guint audio_frame_wait_time;
80
81         /* video parameter */
82         guint video_frame_wait_time;
83
84         /*list attributed*/
85         gint supported_video_width[STREAMRECORDER_ATTRIBUTE_NUM_MAX];
86         gint supported_video_height[STREAMRECORDER_ATTRIBUTE_NUM_MAX];
87         gchar supported_audio_encoders[STREAMRECORDER_ATTRIBUTE_NUM_MAX][STREAMRECORDER_INI_MAX_STRLEN];
88         gchar supported_video_encoders[STREAMRECORDER_ATTRIBUTE_NUM_MAX][STREAMRECORDER_INI_MAX_STRLEN];
89         gchar supported_file_formats[STREAMRECORDER_ATTRIBUTE_NUM_MAX][STREAMRECORDER_INI_MAX_STRLEN];
90
91 } mm_streamrecorder_ini_t;
92
93 /*Default sink ini values*/
94 /* General*/
95 #define DEFAULT_ENCSINK_SRC_IS_LIVE  FALSE
96 #define DEFAULT_RETRIAL_COUNT 10
97 #define DEFAULT_MINIMUM_FRAME  5
98 #define DEFAULT_CONVERT_OUTPUT_BUFFER_NUM 6
99 #define DEFAULT_RESET_PAUSE_TIME 0
100 #define DEFAULT_SCREEN_RECORD 1
101
102 /*encodebin*/
103 #define DEFAULT_ENCSINK_BIN_PROFILE 0
104 #define DEFAULT_ENCSINK_BIN_AUTO_AUDIO_RESAMPLE FALSE
105 #define DEFAULT_ENCSINK_BIN_AUTO_COLORSPACE TRUE
106 #define DEFAULT_ENCSINK_BIN_AUTO_CONVERT TRUE
107 #define DEFAULT_ENCSINK_BIN_USE_VIDEO_TOGGLE FALSE
108
109 /* Pipeline */
110 #define DEFAULT_VIDEO_SOURCE "appsrc"
111 #define DEFAULT_AUDIO_SRC "pulsesrc"
112 #define DEFAULT_NAME_OF_H264_VIDEO_ENCODER "omx_h264enc"
113 #define DEFAULT_NAME_OF_H263_VIDEO_ENCODER "avenc_h263p"
114 #define DEFAULT_NAME_OF_MPEG4_VIDEO_ENCODER "avenc_mpeg4"
115 #define DEFAULT_NAME_OF_AUDIO_ENCODER "avenc_aac"
116 #define DEFAULT_USE_PARSER ""
117 #define DEFAULT_NAME_OF_3GP_MUXER "avmux_3gp"
118 #define DEFAULT_NAME_OF_MP4_MUXER "avmux_mp4"
119 #define DEFAULT_NAME_OF_VIDEO_CONVERTER "videoconvet"
120 #define DEFAULT_NAME_OF_BIN_SINK "filesink"
121
122 /*audio param*/
123 #define DEFAULT_AUDIO_FRAME_MINIMUM_SPACE 102400
124 #define DEFAULT_AUDIO_FRAME_WAIT_TIME 20000
125
126 /*video param*/
127 #define DEFAULT_VIDEO_FRAME_WAIT_TIME  200000
128
129 /*supported attribute*/
130 #define DEFAULT_SUPPORTED_WIDTH ""
131 #define DEFAULT_SUPPORTED_HEIGHT ""
132 #define DEFAULT_SUPPORTED_AUDIO_ENCODERS ""
133 #define DEFAULT_SUPPORTED_VIDEO_ENCODERS ""
134 #define DEFAULT_SUPPORTED_FILE_FORMATS ""
135
136 int _mm_streamrecorder_ini_load(mm_streamrecorder_ini_t * ini);
137 int _mm_streamrecorder_ini_unload(mm_streamrecorder_ini_t * ini);
138
139 #ifdef __cplusplus
140 }
141 #endif
142 #endif