fix double free
[platform/core/multimedia/libmm-streamrecorder.git] / src / include / mm_streamrecorder_audio.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_AUDIO_H__
23 #define __MM_STREAMRECORDER_AUDIO_H__
24
25 /*=======================================================================================
26 | INCLUDE FILES                                                                         |
27 ========================================================================================*/
28 #include <glib.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /*=======================================================================================
35 | STRUCTURE DEFINITIONS                                                                 |
36 ========================================================================================*/
37 /**
38  * MMStreamRecorder information for audio mode
39  */
40 typedef struct {
41         int iAudioEncoder;          /**<Encoder */
42         int iSamplingRate;          /**< Sampling rate */
43         int iBitDepth;              /**< Bit depth */
44         int iBitrate;               /**< audio bitrate */
45         int iChannels;              /**< audio channels */
46         gboolean b_commiting;       /**< Is it commiting now? */
47         gboolean bMuxing;           /**< whether muxing */
48         guint64 filesize;           /**< current recorded file size */
49         guint64 max_size;           /**< max recording size */
50         guint64 max_time;           /**< max recording time */
51         int audio_encode_depth;     /**< audio depth */
52         guint64 audio_frame_count;  /**< current audio frame */
53 } _MMStreamRecorderAudioInfo;
54
55 /**
56 * Enumerations for AMR bitrate
57 */
58 typedef enum _MMStreamRecorderAMRBitRate {
59         MM_STREAMRECORDER_MR475,    /**< MR475 : 4.75 kbit/s */
60         MM_STREAMRECORDER_MR515,    /**< MR515 : 5.15 kbit/s */
61         MM_STREAMRECORDER_MR59,     /**< MR59 : 5.90 kbit/s */
62         MM_STREAMRECORDER_MR67,     /**< MR67 : 6.70 kbit/s */
63         MM_STREAMRECORDER_MR74,     /**< MR74 : 7.40 kbit/s */
64         MM_STREAMRECORDER_MR795,    /**< MR795 : 7.95 kbit/s */
65         MM_STREAMRECORDER_MR102,    /**< MR102 : 10.20 kbit/s */
66         MM_STREAMRECORDER_MR122,    /**< MR122 : 12.20 kbit/s */
67         MM_STREAMRECORDER_MRDTX     /**< MRDTX */
68 } MMStreamRecorderAMRBitRate;
69
70 /*=======================================================================================
71 | GLOBAL FUNCTION PROTOTYPES                                                            |
72 ========================================================================================*/
73
74 int _mmstreamrecorder_check_audiocodec_fileformat_compatibility(unsigned int audio_codec, unsigned int file_format);
75
76 int _mmstreamrecorder_get_amrnb_bitrate_mode(int bitrate);
77
78 #ifdef __cplusplus
79 }
80 #endif
81 #endif /* __MM_STREAMRECORDER_AUDIO_H__ */