Tizen 2.0 Release
[framework/osp/media.git] / src / FMedia_RecorderCapability.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19 * @file                 FMedia_RecorderCapability.h
20 * @brief                This header file contains the implementation header for Recorder capability.
21 *
22 */
23 #ifndef _FMEDIA_INTERNAL_RECORDER_CAPABILITY_H_
24 #define _FMEDIA_INTERNAL_RECORDER_CAPABILITY_H_
25
26 #include <recorder.h>
27 #include "FMedia_RecorderTypes.h"
28 #include "FMedia_CapabilityTypes.h"
29
30 namespace Tizen { namespace Media
31 {
32
33 typedef Tizen::Base::Object* (*_RecorderQueryFunc)(_RecorderSourceType, _QueryType, _ResultType&);
34
35 /**
36 * @class        _RecorderCapability
37 * @brief        This class is common for recorder capability.
38 *
39 */
40 class _RecorderCapability
41         : public Tizen::Base::Object
42 {
43 public:
44         /**
45         * function to get the  for specific key type
46         *
47         * @return               The list which contains the values
48         * @param[in]    key                                             camera operation query key
49         * @param[out]   itemType                                item type of returned IList
50         * @exception    E_SUCCESS                               The method is successful.
51         * @exception    E_OBJ_NOT_FOUND                 invalid key
52         *  @exception   E_SYSTEM                                A system error has occurred.
53         * @exception    E_UNSUPPORTED_OPERATION   operation not supported
54         */
55         static Tizen::Base::Collection::ArrayList* GetListN(_RecorderOperationType key, _ResultType& itemType);
56
57
58         /**
59         * function to check the feature support
60         *
61         * @return               bool
62         * @param[in]    key                                             camera operation query key
63         * @exception    E_SUCCESS                               The method is successful.
64         * @exception    E_SYSTEM                                A system error has occurred.
65         * @exception    E_OUT_OF_MEMORY                 system has no memory
66         * @exception    E_OBJ_NOT_FOUND                 invalid key
67         * @exception    E_UNSUPPORTED_OPERATION   operation not supported
68         */
69         static bool IsSupported(_RecorderOperationType key);
70
71         /**
72         * function to get the default value for a specific key
73         *
74         * @return               The object which contains the values
75         * @param[in]    key                                             Recorder operation query key
76         * @param[in]    queryType                               parameter to get the list items or default value of an attribute
77         * @param[out]   itemType                                item type of returned IList
78         * @exception    E_SUCCESS                               The method is successful.
79         * @exception    E_SYSTEM                                A system error has occurred.
80         * @exception    E_OUT_OF_MEMORY                 system has no memory
81         * @exception    E_OBJ_NOT_FOUND                 invalid key
82         * @exception    E_UNSUPPORTED_OPERATION   operation not supported
83         */
84         static Tizen::Base::Object* GetValueN(_RecorderOperationType key, _QueryType queryType, _ResultType& itemType);
85
86 private:
87         typedef struct
88         {
89                 _RecorderOperationType key;
90                 _RecorderSourceType sourceType;
91                 _RecorderQueryFunc serviceRoutine;
92         }keyServiceMap;
93
94         /**
95         *       The constructor.
96         */
97         _RecorderCapability(void);
98
99         /**
100         *       The destructor.
101         *       Resources are deallocated by this method.
102         */
103         ~_RecorderCapability(void);
104
105         /**
106         * function to get the supported Video file format
107         *
108         * @return               The object which contains the values
109         * @param[in]    sourceType                              camera type [primary/secondary]
110         * @param[in]    queryType                               parameter to get the list items or default value of an attribute
111         * @param[out]   itemType                                item type of returned IList
112         * @exception    E_SUCCESS                               The method is successful.
113         * @exception    E_SYSTEM                                A system error has occurred.
114         * @exception    E_OUT_OF_MEMORY                 system has no memory
115         * @exception    E_OBJ_NOT_FOUND                 invalid key
116         */
117         static Tizen::Base::Object* GetSupportedVideoFileFormatN(_RecorderSourceType sourceType, _QueryType queryType, _ResultType& itemType);
118
119
120         /**
121         * function to get the supported Audio file format
122         *
123         * @return               The object which contains the values
124         * @param[in]    sourceType                              camera type [primary/secondary]
125         * @param[in]    queryType                               parameter to get the list items or default value of an attribute
126         * @param[out]   itemType                                item type of returned IList
127         * @exception    E_SUCCESS                               The method is successful.
128         * @exception    E_SYSTEM                                A system error has occurred.
129         * @exception    E_OUT_OF_MEMORY                 system has no memory
130         * @exception    E_OBJ_NOT_FOUND                 invalid key
131         */
132         static Tizen::Base::Object* GetSupportedAudioFileFormatN(_RecorderSourceType sourceType, _QueryType queryType, _ResultType& itemType);
133
134
135         /**
136         * function to get the supported Audio Encoder list
137         *
138         * @return               The object which contains the values
139         * @param[in]    sourceType                              camera type [primary/secondary]
140         * @param[in]    queryType                               parameter to get the list items or default value of an attribute
141         * @param[out]   itemType                                item type of returned IList
142         * @exception    E_SUCCESS                               The method is successful.
143         * @exception    E_SYSTEM                                A system error has occurred.
144         * @exception    E_OUT_OF_MEMORY                 system has no memory
145         * @exception    E_OBJ_NOT_FOUND                 invalid key
146         */
147         static Tizen::Base::Object* GetSupportedAudioEncoderN(_RecorderSourceType sourceType, _QueryType queryType, _ResultType& itemType);
148
149         /**
150         * function to get the supported Video Encoder list
151         *
152         * @return               The object which contains the values
153         * @param[in]    sourceType                              camera type [primary/secondary]
154         * @param[in]    queryType                               parameter to get the list items or default value of an attribute
155         * @param[out]   itemType                                item type of returned IList
156         * @exception    E_SUCCESS                               The method is successful.
157         * @exception    E_SYSTEM                                A system error has occurred.
158         * @exception    E_OUT_OF_MEMORY                 system has no memory
159         * @exception    E_OBJ_NOT_FOUND                 invalid key
160         */
161         static Tizen::Base::Object* GetSupportedVideoEncoderN(_RecorderSourceType sourceType, _QueryType queryType, _ResultType& itemType);
162
163         static bool SupportedRecorderVideoFileFormatCb(recorder_file_format_e format, void *pUserData);
164         static bool SupportedRecorderAudioFileFormatCb(recorder_file_format_e format, void *pUserData);
165         static bool SupportedRecorderAudioEncoderCb(recorder_audio_codec_e codec, void *pUserData);
166         static bool SupportedRecorderVideoEncoderCb(recorder_video_codec_e codec, void *pUserData);
167
168         _RecorderCapability(const _RecorderCapability& rhs);
169         _RecorderCapability& operator =(const _RecorderCapability& rhs);
170
171         static const keyServiceMap __SERVICE_MAP[];
172 };
173
174 }}
175 #endif