e603008c56b100cd119c740f8de51a267057f2e0
[platform/core/multimedia/mmsvc-recorder.git] / legacy / include / legacy_recorder.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __TIZEN_MULTIMEDIA_RECORDER_H__
18 #define __TIZEN_MULTIMEDIA_RECORDER_H__
19 #include <tizen.h>
20 #include <legacy_camera.h>
21 #include <audio_io.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #define RECORDER_ERROR_CLASS        TIZEN_ERROR_RECORDER | 0x10
28
29 /**
30  * @file recorder.h
31  * @brief This file contains the Recorder API.
32  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
33  */
34
35 /**
36  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
37  * @{
38  */
39
40 /**
41  * @brief The Media recorder handle.
42  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
43  */
44 typedef struct recorder_s *recorder_h;
45
46 /**
47  * @brief Enumeration for error code of the media recorder.
48  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
49  */
50 typedef enum
51 {
52         RECORDER_ERROR_NONE                  = TIZEN_ERROR_NONE,                /**< Successful */
53         RECORDER_ERROR_INVALID_PARAMETER     = TIZEN_ERROR_INVALID_PARAMETER,   /**< Invalid parameter */
54         RECORDER_ERROR_INVALID_STATE         = RECORDER_ERROR_CLASS | 0x02,     /**< Invalid state */
55         RECORDER_ERROR_OUT_OF_MEMORY         = TIZEN_ERROR_OUT_OF_MEMORY ,      /**< Out of memory */
56         RECORDER_ERROR_DEVICE                = RECORDER_ERROR_CLASS | 0x04,     /**< Device error */
57         RECORDER_ERROR_INVALID_OPERATION     = TIZEN_ERROR_INVALID_OPERATION,   /**< Internal error */
58         RECORDER_ERROR_SOUND_POLICY          = RECORDER_ERROR_CLASS | 0x06,     /**< Blocked by Audio Session Manager */
59         RECORDER_ERROR_SECURITY_RESTRICTED   = RECORDER_ERROR_CLASS | 0x07,     /**< Restricted by security system policy */
60         RECORDER_ERROR_SOUND_POLICY_BY_CALL  = RECORDER_ERROR_CLASS | 0x08,     /**< Blocked by Audio Session Manager - CALL */
61         RECORDER_ERROR_SOUND_POLICY_BY_ALARM = RECORDER_ERROR_CLASS | 0x09,     /**< Blocked by Audio Session Manager - ALARM */
62         RECORDER_ERROR_ESD                   = RECORDER_ERROR_CLASS | 0x0a,     /**< ESD situation */
63         RECORDER_ERROR_OUT_OF_STORAGE        = RECORDER_ERROR_CLASS | 0x0b,     /**< Out of storage */
64         RECORDER_ERROR_PERMISSION_DENIED     = TIZEN_ERROR_PERMISSION_DENIED,   /**< The access to the resources can not be granted */
65         RECORDER_ERROR_NOT_SUPPORTED         = TIZEN_ERROR_NOT_SUPPORTED,       /**< The feature is not supported */
66 } recorder_error_e;
67
68 /**
69  * @brief Enumeration for recorder states.
70  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
71  */
72 typedef enum
73 {
74         RECORDER_STATE_NONE,      /**< Recorder is not created */
75         RECORDER_STATE_CREATED,   /**< Recorder is created, but not prepared */
76         RECORDER_STATE_READY,     /**< Recorder is ready to record \n In case of video recorder, preview display will be shown */
77         RECORDER_STATE_RECORDING, /**< Recorder is recording media */
78         RECORDER_STATE_PAUSED,    /**< Recorder is paused while recording media */
79 } recorder_state_e;
80
81 /**
82  * @brief Enumeration for the recording limit.
83  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
84  */
85 typedef enum
86 {
87         RECORDER_RECORDING_LIMIT_TIME,        /**< Time limit (second) of recording file */
88         RECORDER_RECORDING_LIMIT_SIZE,        /**< Size limit (kilo bytes [KB]) of recording file */
89         RECORDER_RECORDING_LIMIT_FREE_SPACE,  /**< No free space in storage */
90 } recorder_recording_limit_type_e;
91
92 /**
93  * @brief Enumeration for the file container format.
94  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
95  */
96 typedef enum
97 {
98         RECORDER_FILE_FORMAT_3GP,    /**< 3GP file format */
99         RECORDER_FILE_FORMAT_MP4,    /**< MP4 file format */
100         RECORDER_FILE_FORMAT_AMR,    /**< AMR file format */
101         RECORDER_FILE_FORMAT_ADTS,   /**< ADTS file format */
102         RECORDER_FILE_FORMAT_WAV,    /**< WAV file format */
103         RECORDER_FILE_FORMAT_OGG,    /**< OGG file format */
104 } recorder_file_format_e;
105
106 /**
107  * @brief Enumeration for the audio codec.
108  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
109  */
110 typedef enum
111 {
112         RECORDER_AUDIO_CODEC_DISABLE = -1, /**< Disable audio track */
113         RECORDER_AUDIO_CODEC_AMR = 0,      /**< AMR codec */
114         RECORDER_AUDIO_CODEC_AAC,          /**< AAC codec */
115         RECORDER_AUDIO_CODEC_VORBIS,       /**< Vorbis codec */
116         RECORDER_AUDIO_CODEC_PCM           /**< PCM codec */
117 } recorder_audio_codec_e;
118
119 /**
120  * @brief Enumeration for the video codec.
121  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
122  */
123 typedef enum
124 {
125         RECORDER_VIDEO_CODEC_H263,    /**< H263 codec */
126         RECORDER_VIDEO_CODEC_H264,    /**< H264 codec */
127         RECORDER_VIDEO_CODEC_MPEG4,   /**< MPEG4 codec */
128         RECORDER_VIDEO_CODEC_THEORA   /**< Theora codec */
129 } recorder_video_codec_e;
130
131 /**
132  * @brief Enumeration for audio capture devices.
133  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
134  */
135 typedef enum
136 {
137         RECORDER_AUDIO_DEVICE_MIC,      /**< Mic device */
138         RECORDER_AUDIO_DEVICE_MODEM,    /**< Modem */
139 } recorder_audio_device_e;
140
141 /**
142  * @brief Enumeration for the recorder rotation type.
143  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
144  */
145 typedef enum
146 {
147         RECORDER_ROTATION_NONE, /**< No rotation */
148         RECORDER_ROTATION_90,   /**< 90 degree rotation */
149         RECORDER_ROTATION_180,  /**< 180 degree rotation */
150         RECORDER_ROTATION_270,  /**< 270 degree rotation */
151 } recorder_rotation_e;
152
153 /**
154  * @brief Enumeration for the recorder policy.
155  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
156  */
157 typedef enum
158 {
159         RECORDER_POLICY_NONE = 0,       /**< None */
160         RECORDER_POLICY_SOUND,          /**< Sound policy */
161         RECORDER_POLICY_SOUND_BY_CALL,  /**< Sound policy by CALL */
162         RECORDER_POLICY_SOUND_BY_ALARM, /**< Sound policy by ALARM */
163         RECORDER_POLICY_SECURITY        /**< Security policy */
164 } recorder_policy_e;
165
166 /**
167  * @}
168 */
169
170 /**
171  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
172  * @{
173  */
174
175 /**
176  * @brief Called when limitation error occurs while recording.
177  * @details The callback function is possible to receive three types of limits: time, size and no-space.
178  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
179  * @remarks After being called, recording data is discarded and not written in the recording file. Also the state of recorder is not changed.
180  * @param[in] type The imitation type
181  * @param[in] user_data The user data passed from the callback registration function
182  * @pre You have to register a callback using recorder_set_recording_limit_reached_cb().
183  * @see recorder_set_recording_status_cb()
184  * @see recorder_set_recording_limit_reached_cb()
185  * @see recorder_unset_recording_limit_reached_cb()
186  */
187 typedef void (*recorder_recording_limit_reached_cb)(recorder_recording_limit_type_e type, void *user_data);
188
189 /**
190  * @brief Called to indicate the recording status.
191  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
192  * @remarks This callback function is repeatedly invoked during the #RECORDER_STATE_RECORDING state.
193  * @param[in] elapsed_time  The time of the recording (milliseconds)
194  * @param[in] file_size     The size of the recording file (KB)
195  * @param[in] user_data     The user data passed from the callback registration function
196  * @pre recorder_start() will invoke this callback if you register it using recorder_set_recording_status_cb().
197  * @see recorder_set_recording_status_cb()
198  * @see recorder_unset_recording_status_cb()
199  * @see recorder_start()
200  */
201 typedef void (*recorder_recording_status_cb)(unsigned long long elapsed_time, unsigned long long file_size, void *user_data);
202
203 /**
204  * @brief Called when the record state is changed.
205  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
206  * @param[in] previous  The previous state of the recorder
207  * @param[in] current   The current state of the recorder
208  * @param[in] by_policy     @c true if the state is changed by policy, otherwise @c false if the state is not changed
209  * @param[in] user_data The user data passed from the callback registration function
210  * @pre This function is required to register a callback using recorder_set_state_changed_cb().
211  * @see recorder_set_state_changed_cb()
212  * @see recorder_prepare()
213  * @see recorder_unprepare()
214  * @see recorder_start()
215  * @see recorder_pause()
216  * @see recorder_commit()
217  * @see recorder_cancel()
218  */
219 typedef void (*recorder_state_changed_cb)(recorder_state_e previous , recorder_state_e current , bool by_policy, void *user_data);
220
221 /**
222  * @brief Called when the recorder is interrupted by a policy.
223  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
224  * @param[in] policy        The policy that is interrupting the recorder
225  * @param[in] previous      The previous state of the recorder
226  * @param[in] current       The current state of the recorder
227  * @param[in] user_data     The user data passed from the callback registration function
228  * @see recorder_set_interrupted_cb()
229  */
230 typedef void (*recorder_interrupted_cb)(recorder_policy_e policy, recorder_state_e previous, recorder_state_e current, void *user_data);
231
232 /**
233  * @brief Called when audio stream data was being delivered just before storing in the recorded file.
234  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
235  * @remarks The callback function holds the same buffer that will be recorded. \n
236  *          So if the user changes the buffer, the result file will contain the buffer.
237  * @remarks The callback is called via internal thread of Frameworks, therefore do not invoke UI API, recorder_unprepare(), recorder_commit() and recorder_cancel() in callback.
238  * @param[in] stream The audio stream data
239  * @param[in] size The size of the stream data
240  * @param[in] format The audio format
241  * @param[in] channel The number of the channel
242  * @param[in] timestamp The timestamp of the stream buffer (in msec)
243  * @param[in] user_data The user data passed from the callback registration function
244  * @see recorder_set_audio_stream_cb()
245  */
246 typedef void (*recorder_audio_stream_cb)(void* stream, int size, audio_sample_type_e format, int channel, unsigned int timestamp, void *user_data);
247
248 /**
249  * @brief Called once for each supported video resolution.
250  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
251  * @param[in] width         The video image width
252  * @param[in] height        The video image height
253  * @param[in] user_data     The user data passed from the foreach function
254  * @return    @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
255  * @pre recorder_foreach_supported_video_resolution() will invoke this callback.
256  * @see recorder_foreach_supported_video_resolution()
257  */
258 typedef bool (*recorder_supported_video_resolution_cb)(int width, int height, void *user_data);
259
260 /**
261  * @brief Called when the error occurred.
262  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
263  * @remarks This callback informs about the critical error situation. \n
264  *          When being invoked, user should release the resource and terminate the application. \n
265  *          This error code will be reported.
266  *          #RECORDER_ERROR_DEVICE \n
267  *          #RECORDER_ERROR_INVALID_OPERATION \n
268  *          #RECORDER_ERROR_OUT_OF_MEMORY.
269  * @param[in] error          The error code
270  * @param[in] current_state  The current state of the recorder
271  * @param[in] user_data      The user data passed from the callback registration function
272  * @pre This callback function is invoked if you register this callback using recorder_set_error_cb().
273  * @see recorder_set_error_cb()
274  * @see recorder_unset_error_cb()
275  */
276 typedef void (*recorder_error_cb)(recorder_error_e error, recorder_state_e current_state, void *user_data);
277
278  /**
279  * @}
280 */
281
282 /**
283  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
284  * @{
285  */
286
287 /**
288  * @brief Called iteratively to notify about the supported file formats.
289  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
290  * @param[in] format   The format of recording files
291  * @param[in] user_data The user data passed from the foreach function
292  * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
293  * @pre recorder_foreach_supported_file_format() will invoke this callback.
294  * @see recorder_foreach_supported_file_format()
295  */
296 typedef bool (*recorder_supported_file_format_cb)(recorder_file_format_e format, void *user_data);
297
298 /**
299  * @brief Called iteratively to notify about the supported audio encoders.
300  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
301  * @param[in] codec     The codec of audio encoder
302  * @param[in] user_data The user data passed from the foreach function
303  * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
304  * @pre recorder_foreach_supported_audio_encoder() will invoke this callback.
305  * @see recorder_foreach_supported_audio_encoder()
306  */
307 typedef bool (*recorder_supported_audio_encoder_cb)(recorder_audio_codec_e codec, void *user_data);
308
309 /**
310  * @brief Called iteratively to notify about the supported video encoders.
311  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
312  * @param[in] codec     The codec of video encoder
313  * @param[in] user_data The user data passed from the foreach function
314  * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
315  * @pre recorder_foreach_supported_video_encoder() will invoke this callback.
316  * @see recorder_foreach_supported_video_encoder()
317  */
318 typedef bool (*recorder_supported_video_encoder_cb)(recorder_video_codec_e codec, void *user_data);
319
320 /**
321  * @}
322 */
323
324 /**
325  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
326  * @{
327  */
328
329 /**
330  * @brief Creates a recorder handle to record a video.
331  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
332  * @privlevel public
333  * @privilege %http://tizen.org/privilege/recorder
334  * @remarks You must release @a recorder using recorder_destroy(). \n
335  * The @a camera handle also could be used for capturing images. \n
336  * If the camera state was #CAMERA_STATE_CREATED, the preview format will be changed to the recommended preview format for recording.
337  * @remarks The created recorder state will be different according to camera state : \n
338  * #CAMERA_STATE_CREATED -> #RECORDER_STATE_CREATED\n
339  * #CAMERA_STATE_PREVIEW -> #RECORDER_STATE_READY\n
340  * #CAMERA_STATE_CAPTURED -> #RECORDER_STATE_READY
341  * @param[in]   camera  The handle to the camera
342  * @param[out]  recorder        A handle to the recorder
343  * @return @c 0 on success, otherwise a negative error value
344  * @retval #RECORDER_ERROR_NONE Successful
345  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
346  * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
347  * @retval #RECORDER_ERROR_SOUND_POLICY Sound policy error
348  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
349  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
350  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
351  * @see camera_create()
352  * @see camera_stop_preview()
353  * @see recorder_destroy()
354  */
355 int legacy_recorder_create_videorecorder(camera_h camera, recorder_h *recorder);
356
357 /**
358  * @brief Creates a recorder handle to record an audio.
359  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
360  * @privlevel public
361  * @privilege %http://tizen.org/privilege/recorder
362  * @remarks You must release @a recorder using recorder_destroy().
363  * @param[out]  recorder  A handle to the recorder
364  * @return @c 0 on success, otherwise a negative error value
365  * @retval #RECORDER_ERROR_NONE Successful
366  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
367  * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
368  * @retval #RECORDER_ERROR_SOUND_POLICY Sound policy error
369  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
370  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
371  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
372  * @post The recorder state will be #RECORDER_STATE_CREATED.
373  * @see recorder_destroy()
374  */
375 int legacy_recorder_create_audiorecorder(recorder_h *recorder);
376
377
378 /**
379  * @brief Destroys the recorder handle.
380  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
381  * @privlevel public
382  * @privilege %http://tizen.org/privilege/recorder
383  * @remarks The video recorder's camera handle is not released by this function.
384  * @param[in]   recorder    The handle to the media recorder
385  * @return @c 0 on success, otherwise a negative error value
386  * @retval #RECORDER_ERROR_NONE Successful
387  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
388  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
389  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
390  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
391  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
392  * @pre  The recorder state should be #RECORDER_STATE_CREATED.
393  * @post The recorder state will be #RECORDER_STATE_NONE.
394  * @see camera_destroy()
395  * @see recorder_create_videorecorder()
396  * @see recorder_create_audiorecorder()
397  */
398 int legacy_recorder_destroy(recorder_h recorder);
399
400 /**
401  * @brief Prepares the media recorder for recording.
402  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
403  * @privlevel public
404  * @privilege %http://tizen.org/privilege/recorder
405  * @remarks Before calling the function, it is required to properly set audio encoder (recorder_set_audio_encoder()),
406  *          video encoder(recorder_set_video_encoder()) and file format (recorder_set_file_format()).
407  * @param[in]   recorder  The handle to the media recorder
408  * @return @c 0 on success, otherwise a negative error value
409  * @retval #RECORDER_ERROR_NONE Successful
410  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
411  * @retval #RECORDER_ERROR_SOUND_POLICY Sound policy error
412  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
413  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
414  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
415  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
416  * @pre  The recorder state should be #RECORDER_STATE_CREATED by legacy_recorder_create_videorecorder(), legacy_recorder_create_audiorecorder() or legacy_recorder_unprepare().
417  * @post The recorder state will be #RECORDER_STATE_READY.
418  * @post If recorder handle is created by legacy_recorder_create_videorecorder(), the camera state will be changed to #CAMERA_STATE_PREVIEW.
419  * @see recorder_create_videorecorder()
420  * @see recorder_create_audiorecorder()
421  * @see recorder_unprepare()
422  * @see recorder_set_audio_encoder()
423  * @see recorder_set_video_encoder()
424  * @see recorder_set_file_format()
425  */
426 int legacy_recorder_prepare(recorder_h recorder);
427
428 /**
429  * @brief Resets the media recorder.
430  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
431  * @privlevel public
432  * @privilege %http://tizen.org/privilege/recorder
433  * @param[in]  recorder  The handle to the media recorder
434  * @return @c 0 on success, otherwise a negative error value
435  * @retval #RECORDER_ERROR_NONE Successful
436  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
437  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
438  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
439  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
440  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
441  * @pre  The recorder state should be #RECORDER_STATE_READY set by legacy_recorder_prepare(), legacy_recorder_cancel() or legacy_recorder_commit().
442  * @post The recorder state will be #RECORDER_STATE_CREATED.
443  * @post If the recorder handle is created by legacy_recorder_create_videorecorder(), camera state will be changed to #CAMERA_STATE_CREATED.
444  * @see recorder_prepare()
445  * @see recorder_cancel()
446  * @see recorder_commit()
447  */
448 int legacy_recorder_unprepare(recorder_h recorder);
449
450 /**
451  * @brief Starts the recording.
452  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
453  * @privlevel public
454  * @privilege %http://tizen.org/privilege/recorder
455  * @remarks If file path has been set to an existing file, this file is removed automatically and updated by new one. \n
456  *          In the video recorder, some preview format does not support record mode. It will return #RECORDER_ERROR_INVALID_OPERATION error. \n
457  *          You should use default preview format or #CAMERA_PIXEL_FORMAT_NV12 in the record mode. \n
458  *          When you want to record audio or video file, you need to add privilege according to rules below additionally. \n
459  *          If you want to save contents to internal storage, you should add mediastorage privilege. \n
460  *          If you want to save contents to external storage, you should add externalstorage privilege. \n
461  *          The filename should be set before this function is invoked.
462  * @param[in]  recorder  The handle to the media recorder
463  * @return @c 0 on success, otherwise a negative error value
464  * @retval #RECORDER_ERROR_NONE Successful
465  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
466  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
467  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
468  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
469  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
470  * @pre The recorder state must be #RECORDER_STATE_READY by legacy_recorder_prepare() or #RECORDER_STATE_PAUSED by legacy_recorder_pause(). \n
471  *      The filename should be set by legacy_recorder_set_filename().
472  * @post The recorder state will be #RECORDER_STATE_RECORDING.
473  * @see recorder_pause()
474  * @see recorder_commit()
475  * @see recorder_cancel()
476  * @see recorder_set_audio_encoder()
477  * @see recorder_set_filename()
478  * @see recorder_set_file_format()
479  * @see recorder_recording_status_cb()
480  * @see recorder_set_filename()
481  */
482 int legacy_recorder_start(recorder_h recorder);
483
484 /**
485  * @brief Pauses the recording.
486  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
487  * @privlevel public
488  * @privilege %http://tizen.org/privilege/recorder
489  * @remarks Recording can be resumed with legacy_recorder_start().
490  * @param[in]  recorder  The handle to the media recorder
491  * @return @c 0 on success, otherwise a negative error value
492  * @retval #RECORDER_ERROR_NONE Successful
493  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
494  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
495  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
496  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
497  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
498  * @pre The recorder state must be #RECORDER_STATE_RECORDING.
499  * @post The recorder state will be #RECORDER_STATE_PAUSED.
500  * @see legacy_recorder_pause()
501  * @see legacy_recorder_commit()
502  * @see legacy_recorder_cancel()
503  */
504 int legacy_recorder_pause(recorder_h recorder);
505
506 /**
507  * @brief Stops recording and saves the result.
508  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
509  * @privlevel public
510  * @privilege %http://tizen.org/privilege/recorder
511  * @remarks When you want to record audio or video file, you need to add privilege according to rules below additionally. \n
512  *          If you want to save contents to internal storage, you should add mediastorage privilege. \n
513  *          If you want to save contents to external storage, you should add externalstorage privilege.
514  * @param[in]  recorder  The handle to the media recorder
515  * @return @c 0 on success, otherwise a negative error value
516  * @retval #RECORDER_ERROR_NONE Successful
517  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
518  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
519  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
520  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
521  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
522  * @pre The recorder state must be #RECORDER_STATE_RECORDING set by legacy_recorder_start() or #RECORDER_STATE_PAUSED by legacy_recorder_pause().
523  * @post The recorder state will be #RECORDER_STATE_READY.
524  * @see legacy_recorder_pause()
525  * @see legacy_recorder_cancel()
526  * @see legacy_recorder_set_filename()
527  * @see recorder_start()
528  */
529 int legacy_recorder_commit(recorder_h recorder);
530
531 /**
532  * @brief Cancels the recording.
533  * @details The recording data is discarded and not written in the recording file.
534  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
535  * @privlevel public
536  * @privilege %http://tizen.org/privilege/recorder
537  * @remarks When you want to record audio or video file, you need to add privilege according to rules below additionally. \n
538  *          If you want to save contents to internal storage, you should add mediastorage privilege. \n
539  *          If you want to save contents to external storage, you should add externalstorage privilege.
540  * @param[in]  recorder  The handle to the media recorder
541  * @return @c 0 on success, otherwise a negative error value
542  * @retval #RECORDER_ERROR_NONE Successful
543  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
544  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
545  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
546  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
547  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
548  * @pre The recorder state must be #RECORDER_STATE_RECORDING set by legacy_recorder_start() or #RECORDER_STATE_PAUSED by legacy_recorder_pause().
549  * @post The recorder state will be #RECORDER_STATE_READY.
550  * @see legacy_recorder_pause()
551  * @see legacy_recorder_commit()
552  * @see legacy_recorder_cancel()
553  * @see legacy_recorder_start()
554  */
555 int legacy_recorder_cancel(recorder_h recorder);
556
557 /**
558  * @brief Gets the recorder's current state.
559  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
560  * @param[in]  recorder The handle to the media recorder
561  * @param[out]  state  The current state of the recorder
562  * @return  @c 0 on success, otherwise a negative error value
563  * @retval #RECORDER_ERROR_NONE Successful
564  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
565  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
566  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
567  */
568 int legacy_recorder_get_state(recorder_h recorder, recorder_state_e *state);
569
570 /**
571  * @brief Gets the peak audio input level that was sampled since the last call to this function.
572  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
573  * @remarks @c 0 dB indicates maximum input level, @c -300 dB indicates minimum input level.
574  * @param[in]  recorder The handle to the media recorder
575  * @param[out] dB  The audio input level in dB
576  * @return  @c 0 on success, otherwise a negative error value
577  * @retval #RECORDER_ERROR_NONE Successful
578  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
579  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
580  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
581  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
582  * @pre The recorder state must be #RECORDER_STATE_RECORDING or #RECORDER_STATE_PAUSED.
583  */
584 int legacy_recorder_get_audio_level(recorder_h recorder, double *dB);
585
586 /**
587  * @brief Sets the file path to record.
588  * @details This function sets file path which defines where newly recorded data should be stored.
589  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
590  * @remarks If the same file already exists in the file system, then old file will be overwritten.
591  * @param[in]   recorder        The handle to the media recorder
592  * @param[in]   path The recording file path
593  * @return @c 0 on success, otherwise a negative error value
594  * @retval #RECORDER_ERROR_NONE Successful
595  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
596  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
597  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
598  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
599  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
600  * @see recorder_get_filename()
601  */
602 int legacy_recorder_set_filename(recorder_h recorder, const char *path);
603
604 /**
605  * @brief Gets the file path to record.
606  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
607  * @remarks You must release @a path using free().
608  * @param[in]   recorder    The handle to the media recorder
609  * @param[out]  path    The recording file path
610  * @return @c 0 on success, otherwise a negative error value
611  * @retval #RECORDER_ERROR_NONE Successful
612  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
613  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
614  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
615  * @see recorder_set_filename()
616  */
617 int legacy_recorder_get_filename(recorder_h recorder, char **path);
618
619 /**
620  * @brief Sets the file format for recording media stream.
621  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
622  * @remarks Since 2.3.1, it could be returned #RECORDER_ERROR_INVALID_OPERATION \n
623  *          when it's audio recorder and its state is #RECORDER_STATE_READY \n
624  *          because of checking codec compatibility with current encoder.
625  * @param[in] recorder The handle to the media recorder
626  * @param[in] format   The media file format
627  * @return @c 0 on success, otherwise a negative error value
628  * @retval #RECORDER_ERROR_NONE Successful
629  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
630  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
631  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
632  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
633  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation (Since 2.3.1)
634  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
635  *      Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
636  * @see legacy_recorder_get_file_format()
637  * @see legacy_recorder_foreach_supported_file_format()
638  */
639 int legacy_recorder_set_file_format(recorder_h recorder, recorder_file_format_e format);
640
641
642 /**
643  * @brief Gets the file format for recording media stream.
644  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
645  * @param[in] recorder The handle to the media recorder
646  * @param[out] format   The media file format
647  * @return @c 0 on success, otherwise a negative error value
648  * @retval #RECORDER_ERROR_NONE Successful
649  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
650  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
651  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
652  * @see legacy_recorder_set_file_format()
653  * @see legacy_recorder_foreach_supported_file_format()
654  */
655 int legacy_recorder_get_file_format(recorder_h recorder, recorder_file_format_e *format);
656
657
658  /**
659  * @}
660 */
661
662 /**
663  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
664  * @{
665  */
666
667 /**
668  * @brief Retrieves all supported file formats by invoking a specific callback for each supported file format.
669  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
670  * @param[in] recorder  The handle to the media recorder
671  * @param[in] callback The iteration callback
672  * @param[in] user_data The user data to be passed to the callback function
673  * @return @c 0 on success, otherwise a negative error value
674  * @retval #RECORDER_ERROR_NONE Successful
675  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
676  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
677  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
678  * @post  legacy_recorder_supported_file_format_cb() will be invoked.
679  * @see legacy_recorder_get_file_format()
680  * @see legacy_recorder_set_file_format()
681  * @see legacy_recorder_supported_file_format_cb()
682  */
683 int legacy_recorder_foreach_supported_file_format(recorder_h recorder, recorder_supported_file_format_cb callback, void *user_data);
684
685 /**
686  * @}
687 */
688
689 /**
690  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
691  * @{
692  */
693
694 /**
695  * @brief Sets the audio codec for encoding an audio stream.
696  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
697  * @remarks You can get available audio encoders by using recorder_foreach_supported_audio_encoder(). \n
698  *          If set to #RECORDER_AUDIO_CODEC_DISABLE, the audio track is not created in recording files.\n
699  *          Since 2.3.1, it could be returned #RECORDER_ERROR_INVALID_OPERATION \n
700  *          when it's audio recorder and its state is #RECORDER_STATE_READY \n
701  *          because of checking codec compatibility with current file format.
702  * @param[in] recorder The handle to the media recorder
703  * @param[in] codec    The audio codec
704  * @return @c 0 on success, otherwise a negative error value
705  * @retval #RECORDER_ERROR_NONE Successful
706  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
707  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
708  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
709  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
710  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation (Since 2.3.1)
711  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
712  * @see recorder_get_audio_encoder()
713  * @see legacy_recorder_foreach_supported_audio_encoder()
714  */
715 int legacy_recorder_set_audio_encoder(recorder_h recorder, recorder_audio_codec_e codec);
716
717 /**
718  * @brief Gets the audio codec for encoding an audio stream.
719  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
720  * @param[in] recorder The handle to the media recorder
721  * @param[out] codec   The audio codec
722  * @return @c 0 on success, otherwise a negative error value
723  * @retval #RECORDER_ERROR_NONE Successful
724  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
725  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
726  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
727  * @see recorder_set_audio_encoder()
728  * @see legacy_recorder_foreach_supported_audio_encoder()
729  */
730 int legacy_recorder_get_audio_encoder(recorder_h recorder, recorder_audio_codec_e *codec);
731
732  /**
733  * @}
734 */
735
736 /**
737  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
738  * @{
739  */
740
741 /**
742  * @brief Retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder.
743  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
744  * @param[in] recorder  The handle to the media recorder
745  * @param[in] callback  The iteration callback
746  * @param[in] user_data The user data to be passed to the callback function
747  * @return @c 0 on success, otherwise a negative error value
748  * @retval #RECORDER_ERROR_NONE Successful
749  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
750  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
751  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
752  * @post  legacy_recorder_supported_audio_encoder_cb() will be invoked.
753  * @see recorder_set_audio_encoder()
754  * @see recorder_get_audio_encoder()
755  * @see recorder_supported_audio_encoder_cb()
756  */
757 int legacy_recorder_foreach_supported_audio_encoder(recorder_h recorder, recorder_supported_audio_encoder_cb callback, void *user_data);
758
759 /**
760  * @}
761 */
762
763 /**
764  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
765  * @{
766  */
767
768 /**
769  * @brief Sets the resolution of the video recording.
770  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
771  * @remarks This function should be called before recording (recorder_start()).
772  * @param[in] recorder  The handle to the media recorder
773  * @param[in] width     The preview width
774  * @param[in] height    The preview height
775  * @return @c 0 on success, otherwise a negative error value
776  * @retval #RECORDER_ERROR_NONE Successful
777  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
778  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
779  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
780  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
781  * @pre    The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
782  * @see recorder_start()
783  * @see recorder_get_video_resolution()
784  * @see recorder_foreach_supported_video_resolution()
785  */
786 int legacy_recorder_set_video_resolution(recorder_h recorder, int width, int height);
787
788 /**
789  * @brief Gets the resolution of the video recording.
790  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
791  * @param[in] recorder  The handle to the media recorder
792  * @param[out] width    The video width
793  * @param[out] height   The video height
794  * @return @c 0 on success, otherwise a negative error value
795  * @retval #RECORDER_ERROR_NONE Successful
796  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
797  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
798  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
799  * @see recorder_set_video_resolution()
800  * @see recorder_foreach_supported_video_resolution()
801  */
802 int legacy_recorder_get_video_resolution(recorder_h recorder, int *width, int *height);
803
804 /**
805  * @}
806 */
807
808 /**
809  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
810  * @{
811  */
812
813 /**
814  * @brief Retrieves all supported video resolutions by invoking callback function once for each supported video resolution.
815  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
816  * @param[in] recorder  The handle to the media recorder
817  * @param[in] foreach_cb        The callback function to be invoked
818  * @param[in] user_data The user data to be passed to the callback function
819  * @return @c 0 on success, otherwise a negative error value
820  * @retval #RECORDER_ERROR_NONE Successful
821  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
822  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
823  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
824  * @post        This function invokes legacy_recorder_supported_video_resolution_cb() repeatedly to retrieve each supported video resolution.
825  * @see recorder_set_video_resolution()
826  * @see recorder_get_video_resolution()
827  * @see recorder_supported_video_resolution_cb()
828  */
829 int legacy_recorder_foreach_supported_video_resolution(recorder_h recorder,
830                                                 recorder_supported_video_resolution_cb foreach_cb, void *user_data);
831
832 /**
833  * @}
834 */
835
836 /**
837  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
838  * @{
839  */
840
841 /**
842  * @brief Sets the video codec for encoding video stream.
843  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
844  * @remarks You can get available video encoders by using recorder_foreach_supported_video_encoder().
845  * @param[in] recorder The handle to the media recorder
846  * @param[in] codec    The video codec
847  * @return @c 0 on success, otherwise a negative error value
848  * @retval #RECORDER_ERROR_NONE Successful
849  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
850  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
851  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
852  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
853  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
854  * @see recorder_get_video_encoder()
855  * @see legacy_recorder_foreach_supported_video_encoder()
856  */
857 int legacy_recorder_set_video_encoder(recorder_h recorder, recorder_video_codec_e codec);
858
859 /**
860  * @brief Gets the video codec for encoding video stream.
861  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
862  * @param[in] recorder The handle to the media recorder
863  * @param[out] codec   The video codec
864  * @return @c 0 on success, otherwise a negative error value
865  * @retval #RECORDER_ERROR_NONE Successful
866  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
867  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
868  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
869  * @see legacy_recorder_set_video_encoder()
870  * @see legacy_recorder_foreach_supported_video_encoder()
871  */
872 int legacy_recorder_get_video_encoder(recorder_h recorder, recorder_video_codec_e *codec);
873
874 /**
875  * @}
876 */
877
878 /**
879  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
880  * @{
881  */
882
883 /**
884  * @brief Retrieves all supported video encoders by invoking a specific callback for each supported video encoder.
885  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
886  * @param[in] recorder  The handle to the media recorder
887  * @param[in] callback  The iteration callback
888  * @param[in] user_data The user data to be passed to the callback function
889  * @return @c 0 on success, otherwise a negative error value
890  * @retval #RECORDER_ERROR_NONE Successful
891  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
892  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
893  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
894  * @post  legacy_recorder_supported_video_encoder_cb() will be invoked.
895  * @see legacy_recorder_set_video_encoder()
896  * @see legacy_recorder_get_video_encoder()
897  * @see recorder_supported_video_encoder_cb()
898  */
899 int legacy_recorder_foreach_supported_video_encoder(recorder_h recorder, recorder_supported_video_encoder_cb callback, void *user_data);
900
901  /**
902  * @}
903 */
904
905 /**
906  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
907  * @{
908  */
909
910 /**
911  * @brief Registers the callback function that will be invoked when the recorder state changes.
912  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
913  * @param[in] recorder  The handle to the media recorder
914  * @param[in] callback  The function pointer of user callback
915  * @param[in] user_data The user data to be passed to the callback function
916  * @return @c 0 on success, otherwise a negative error value
917  * @retval #RECORDER_ERROR_NONE Successful
918  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
919  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
920  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
921  * @post  legacy_recorder_state_changed_cb() will be invoked.
922  * @see legacy_recorder_unset_state_changed_cb()
923  * @see legacy_recorder_state_changed_cb()
924  */
925 int legacy_recorder_set_state_changed_cb(recorder_h recorder, recorder_state_changed_cb callback, void *user_data);
926
927 /**
928  * @brief Unregisters the callback function.
929  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
930  * @param[in]  recorder The handle to the media recorder
931  * @return @c 0 on success, otherwise a negative error value
932  * @retval #RECORDER_ERROR_NONE Successful
933  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
934  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
935  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
936  * @see legacy_recorder_set_state_changed_cb()
937  */
938 int legacy_recorder_unset_state_changed_cb(recorder_h recorder);
939
940 /**
941  * @brief Registers a callback function to be called when the media recorder is interrupted according to a policy.
942  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
943  * @param[in] recorder  The handle to the media recorder
944  * @param[in] callback    The callback function to register
945  * @param[in] user_data   The user data to be passed to the callback function
946  * @return @c 0 on success, otherwise a negative error value
947  * @retval #RECORDER_ERROR_NONE Successful
948  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
949  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
950  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
951  * @see recorder_unset_interrupted_cb()
952  * @see recorder_interrupted_cb()
953  */
954 int legacy_recorder_set_interrupted_cb(recorder_h recorder, recorder_interrupted_cb callback,
955             void *user_data);
956
957 /**
958  * @brief Unregisters the callback function.
959  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
960  * @param[in]   recorder        The handle to the media recorder
961  * @return @c 0 on success, otherwise a negative error value
962  * @retval #RECORDER_ERROR_NONE Successful
963  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
964  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
965  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
966  * @see recorder_set_interrupted_cb()
967  */
968 int legacy_recorder_unset_interrupted_cb(recorder_h recorder);
969
970 /**
971  * @brief Registers a callback function to be called when audio stream data is being delivered.
972  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
973  * @remarks This callback function holds the same buffer that will be recorded. \n
974  *          Therefore if an user changes the buffer, the result file will have the buffer. \n
975  * @remarks The callback is called via internal thread of Frameworks. Therefore do not invoke UI API, legacy_recorder_unprepare(), legacy_recorder_commit() and legacy_recorder_cancel() in callback.\n
976  *          This callback function to be called in #RECORDER_STATE_RECORDING and #RECORDER_STATE_PAUSED state.
977  *
978  * @param[in] recorder    The handle to the recorder
979  * @param[in] callback    The callback function to register
980  * @param[in] user_data   The user data to be passed to the callback function
981  * @return @c 0 on success, otherwise a negative error value
982  * @retval #RECORDER_ERROR_NONE Successful
983  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
984  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
985  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
986  * @pre The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
987  * @see recorder_unset_audio_stream_cb()
988  * @see recorder_audio_stream_cb()
989  */
990 int legacy_recorder_set_audio_stream_cb(recorder_h recorder, recorder_audio_stream_cb callback, void* user_data);
991
992 /**
993  * @brief Unregisters the callback function.
994  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
995  * @param[in]   recorder        The handle to the media recorder
996  * @return @c 0 on success, otherwise a negative error value
997  * @retval #RECORDER_ERROR_NONE Successful
998  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
999  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1000  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1001  * @see     legacy_recorder_set_audio_stream_cb()
1002  */
1003 int legacy_recorder_unset_audio_stream_cb(recorder_h recorder);
1004
1005 /**
1006  * @brief Registers a callback function to be invoked when the recording information changes.
1007  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1008  * @param[in]  recorder   The handle to the media recorder
1009  * @param[in]  callback   The function pointer of user callback
1010  * @param[in]  user_data  The user data to be passed to the callback function
1011  * @return @c 0 on success, otherwise a negative error value
1012  * @retval #RECORDER_ERROR_NONE Successful
1013  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1014  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1015  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1016  * @post  legacy_recorder_recording_status_cb() will be invoked.
1017  * @see recorder_unset_recording_status_cb()
1018  * @see recorder_recording_status_cb()
1019  */
1020 int legacy_recorder_set_recording_status_cb(recorder_h recorder, recorder_recording_status_cb callback, void *user_data);
1021
1022 /**
1023  * @brief Unregisters the callback function.
1024  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1025  * @param[in]  recorder    The handle to the media recorder
1026  * @return @c 0 on success, otherwise a negative error value
1027  * @retval #RECORDER_ERROR_NONE Successful
1028  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1029  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1030  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1031  * @see recorder_set_recording_status_cb()
1032  */
1033 int legacy_recorder_unset_recording_status_cb(recorder_h recorder);
1034
1035 /**
1036  * @brief Registers the callback function to be run when reached the recording limit.
1037  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1038  * @param[in]   recorder        The handle to media recorder
1039  * @param[in]   callback        The function pointer of user callback
1040  * @param[in]   user_data       The user data to be passed to the callback function
1041  * @return @c 0 on success, otherwise a negative error value
1042  * @retval #RECORDER_ERROR_NONE Successful
1043  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1044  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1045  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1046  * @post  legacy_recorder_recording_limit_reached_cb() will be invoked.
1047  * @see recorder_unset_recording_limit_reached_cb()
1048  * @see recorder_attr_set_size_limit()
1049  * @see recorder_attr_set_time_limit()
1050  * @see recorder_recording_limit_reached_cb()
1051  */
1052 int legacy_recorder_set_recording_limit_reached_cb(recorder_h recorder, recorder_recording_limit_reached_cb callback, void *user_data);
1053
1054 /**
1055  * @brief Unregisters the callback function.
1056  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1057  * @param[in]  recorder  The handle to the media recorder
1058  * @return @c 0 on success, otherwise a negative error value
1059  * @retval #RECORDER_ERROR_NONE Successful
1060  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1061  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1062  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1063  * @see recorder_set_recording_limit_reached_cb()
1064  */
1065 int legacy_recorder_unset_recording_limit_reached_cb(recorder_h recorder);
1066
1067 /**
1068  * @brief Registers a callback function to be called when an asynchronous operation error occurred.
1069  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1070  * @remarks This callback informs critical error situation.\n
1071  *          When this callback is invoked, user should release the resource and terminate the application. \n
1072  *          These error codes will occur. \n
1073  *          #RECORDER_ERROR_DEVICE \n
1074  *          #RECORDER_ERROR_INVALID_OPERATION \n
1075  *          #RECORDER_ERROR_OUT_OF_MEMORY
1076  * @param[in]   recorder        The handle to the recorder
1077  * @param[in]   callback        The callback function to register
1078  * @param[in]   user_data       The user data to be passed to the callback function
1079  * @return  @c 0 on success, otherwise a negative error value
1080  * @retval #RECORDER_ERROR_NONE Successful
1081  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1082  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1083  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1084  * @post        This function will invoke legacy_recorder_error_cb() when an asynchronous operation error occur.
1085  * @see recorder_unset_error_cb()
1086  * @see recorder_error_cb()
1087  */
1088 int legacy_recorder_set_error_cb(recorder_h recorder, recorder_error_cb callback, void *user_data);
1089
1090
1091 /**
1092  * @brief Unregisters the callback function.
1093  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1094  * @param[in]   recorder        The handle to the recorder
1095  * @return  @c on success, otherwise a negative error value
1096  * @retval    #RECORDER_ERROR_NONE Successful
1097  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1098  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1099  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1100  * @see recorder_set_error_cb()
1101  */
1102 int legacy_recorder_unset_error_cb(recorder_h recorder);
1103
1104
1105 /**
1106  * @}
1107  */
1108
1109 /**
1110  * @addtogroup CAPI_MEDIA_RECORDER_ATTRIBUTES_MODULE
1111  * @{
1112  */
1113
1114
1115 /**
1116  * @brief Sets the maximum size of a recording file.
1117  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1118  * @remarks After reaching the limitation, the recording data is discarded and not written in the recording file.
1119  * @param[in] recorder The handle to the media recorder
1120  * @param[in] kbyte    The maximum size of the recording file(KB) \n
1121  *                     @c 0 means unlimited recording size.
1122  * @return @c 0 on success, otherwise a negative error value
1123  * @retval #RECORDER_ERROR_NONE Successful
1124  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1125  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1126  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1127  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1128  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1129  * @see recorder_attr_get_size_limit()
1130  * @see recorder_attr_set_time_limit()
1131  */
1132 int legacy_recorder_attr_set_size_limit(recorder_h recorder, int kbyte);
1133
1134 /**
1135  * @brief Gets the maximum size of a recording file.
1136  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1137  * @param[in]  recorder The handle to the media recorder
1138  * @param[out] kbyte    The maximum size of recording file (KB) \n
1139  *                      @c 0 means unlimited recording size.
1140  * @return @c 0 on success, otherwise a negative error value
1141  * @retval #RECORDER_ERROR_NONE Successful
1142  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1143  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1144  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1145  * @see recorder_attr_set_size_limit()
1146  * @see recorder_attr_get_time_limit()
1147  */
1148 int legacy_recorder_attr_get_size_limit(recorder_h recorder, int *kbyte);
1149
1150 /**
1151  * @brief Sets the time limit of a recording file.
1152  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1153  * @remarks After reaching the limitation, the recording data is discarded and not written in the recording file.
1154  * @param[in] recorder The handle to the media recorder
1155  * @param[in] second   The time limit of the recording file (in seconds) \n
1156  *                     @c 0 means unlimited recording size.
1157  * @return @c 0 on success, otherwise a negative error value
1158  * @retval #RECORDER_ERROR_NONE Successful
1159  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1160  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1161  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1162  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1163  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1164  * @see recorder_attr_get_time_limit()
1165  * @see recorder_attr_set_size_limit()
1166  */
1167 int legacy_recorder_attr_set_time_limit(recorder_h recorder, int second);
1168
1169
1170 /**
1171  * @brief Gets the time limit of a recording file.
1172  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1173  * @param[in]  recorder  The handle to the media recorder
1174  * @param[out] second    The time limit of the recording file (in seconds) \n
1175  *                       @c 0 means unlimited recording time.
1176  * @return @c 0 on success, otherwise a negative error value
1177  * @retval #RECORDER_ERROR_NONE Successful
1178  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1179  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1180  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1181  * @see recorder_attr_set_time_limit()
1182  * @see recorder_attr_get_size_limit()
1183  */
1184 int legacy_recorder_attr_get_time_limit(recorder_h recorder, int *second);
1185
1186 /**
1187  * @brief Sets the audio device for recording.
1188  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1189  * @param[in] recorder The handle to the media recorder
1190  * @param[in] device   The type of an audio device
1191  * @return @c 0 on success, otherwise a negative error value
1192  * @retval #RECORDER_ERROR_NONE Successful
1193  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1194  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1195  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1196  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1197  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
1198  *      Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
1199  * @see recorder_attr_get_audio_device()
1200  */
1201 int legacy_recorder_attr_set_audio_device(recorder_h recorder, recorder_audio_device_e device);
1202
1203 /**
1204  * @brief Gets the audio device for recording.
1205  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1206  * @param[in] recorder  The handle to the media recorder
1207  * @param[out] device The type of an audio device
1208  * @return @c 0 on success, otherwise a negative error value
1209  * @retval #RECORDER_ERROR_NONE Successful
1210  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1211  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1212  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1213  * @see recorder_attr_set_audio_device()
1214  */
1215 int legacy_recorder_attr_get_audio_device(recorder_h recorder, recorder_audio_device_e *device);
1216
1217 /**
1218  * @brief Sets the sampling rate of an audio stream.
1219  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1220  * @param[in] recorder    The handle to the media recorder
1221  * @param[in] samplerate The sample rate in Hertz
1222  * @return @c 0 on success, otherwise a negative error value
1223  * @retval #RECORDER_ERROR_NONE Successful
1224  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1225  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1226  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1227  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1228  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
1229  *      Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
1230  * @see recorder_attr_get_audio_samplerate()
1231  */
1232 int legacy_recorder_attr_set_audio_samplerate(recorder_h recorder, int samplerate);
1233
1234 /**
1235  * @brief Gets the sampling rate of an audio stream.
1236  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1237  * @param[in]  recorder    The handle to the media recorder
1238  * @param[out] samplerate  The sample rate in Hertz
1239  * @return @c 0 on success, otherwise a negative error value
1240  * @retval #RECORDER_ERROR_NONE Successful
1241  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1242  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1243  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1244  * @see recorder_attr_set_audio_samplerate()
1245  */
1246 int legacy_recorder_attr_get_audio_samplerate(recorder_h recorder, int *samplerate);
1247
1248 /**
1249  * @brief Sets the bitrate of an audio encoder.
1250  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1251  * @param[in] recorder  The handle to the media recorder
1252  * @param[in] bitrate   The bitrate (for mms : 12200[bps], normal : 288000[bps])
1253  * @return @c 0 on success, otherwise a negative error value
1254  * @retval #RECORDER_ERROR_NONE Successful
1255  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1256  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1257  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1258  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1259  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1260  * @see recorder_attr_get_audio_encoder_bitrate()
1261  */
1262 int legacy_recorder_attr_set_audio_encoder_bitrate(recorder_h recorder, int bitrate);
1263
1264 /**
1265  * @brief Sets the bitrate of a video encoder.
1266  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1267  * @param[in] recorder  The handle to the media recorder
1268  * @param[in] bitrate   The bitrate in bits per second
1269  * @return @c 0 on success, otherwise a negative error value
1270  * @retval #RECORDER_ERROR_NONE Successful
1271  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1272  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1273  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1274  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1275  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1276  * @see recorder_attr_get_video_encoder_bitrate()
1277  */
1278 int legacy_recorder_attr_set_video_encoder_bitrate(recorder_h recorder, int bitrate);
1279
1280 /**
1281  * @brief Gets the bitrate of an audio encoder.
1282  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1283  * @param[in]  recorder  The handle to the media recorder
1284  * @param[out] bitrate   The bitrate in bits per second
1285  * @return @c 0 on success, otherwise a negative error value
1286  * @retval #RECORDER_ERROR_NONE Successful
1287  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1288  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1289  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1290  * @see recorder_attr_set_audio_encoder_bitrate()
1291  */
1292 int legacy_recorder_attr_get_audio_encoder_bitrate(recorder_h recorder, int *bitrate);
1293
1294 /**
1295  * @brief Gets the bitrate of a video encoder.
1296  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1297  * @param[in]  recorder  The handle to the media recorder
1298  * @param[out] bitrate   The bitrate in bits per second
1299  * @return @c 0 on success, otherwise a negative error value
1300  * @retval #RECORDER_ERROR_NONE Successful
1301  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1302  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1303  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1304  * @see recorder_attr_set_audio_encoder_bitrate()
1305  */
1306 int legacy_recorder_attr_get_video_encoder_bitrate(recorder_h recorder, int *bitrate);
1307
1308 /**
1309  * @brief Sets the mute state of a recorder.
1310  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1311  * @param[in] recorder  The handle to the media recorder
1312  * @param[in] enable The mute state
1313  * @return @c 0 on success, otherwise a negative error value
1314  * @retval #RECORDER_ERROR_NONE Successful
1315  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1316  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1317  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1318  * @see recorder_attr_is_muted()
1319  */
1320 int legacy_recorder_attr_set_mute(recorder_h recorder, bool enable);
1321
1322 /**
1323  * @brief Gets the mute state of a recorder.
1324  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1325  * @param[in] recorder The handle to the media recorder
1326  * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1327  * @return  @c true if the recorder is not recording any sound,
1328  *          otherwise @c false if the recorder is recording
1329  * @exception #RECORDER_ERROR_NONE Successful
1330  * @exception #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1331  * @exception #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1332  * @exception #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1333  * @see recorder_attr_set_mute()
1334  */
1335 bool legacy_recorder_attr_is_muted(recorder_h recorder);
1336
1337 /**
1338  * @brief Sets the recording motion rate.
1339  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1340  * @remarks This attribute is valid only in a video recorder. \n
1341  *          If the rate bigger than @c 0 and smaller than @c 1, video is recorded in a slow motion mode. \n
1342  *          If the rate bigger than @c 1, video is recorded in a fast motion mode (time lapse recording).
1343  * @remarks Audio data is not recorded. \n
1344  *          To reset slow motion recording, set the rate to @c 1.
1345  * @param[in] recorder The handle to the media recorder
1346  * @param[in] rate     The recording motion rate \n
1347  *                     It is computed with fps. (@c 0<rate<@c 1 for slow motion, @c 1<rate for fast motion(time lapse recording), @c 1 to reset).
1348  * @return @c 0 on success, otherwise a negative error value
1349  * @retval #RECORDER_ERROR_NONE Successful
1350  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1351  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1352  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1353  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1354  * @see recorder_attr_get_recording_motion_rate()
1355  */
1356 int legacy_recorder_attr_set_recording_motion_rate(recorder_h recorder , double rate);
1357
1358 /**
1359  * @brief Gets the recording motion rate.
1360  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1361  * @remarks This attribute is valid only in a video recorder. \n
1362  *          If the rate bigger than @c 0 and smaller than @c 1, video is recorded in a slow motion mode. \n
1363  *          If the rate bigger than @c 1, video is recorded in a fast motion mode (time lapse recording).
1364  * @remarks Audio data is not recorded. \n
1365  *          To reset slow motion recording, set the rate to @c 1.
1366  * @param[in]  recorder The handle to the media recorder
1367  * @param[out] rate     The recording motion rate \n
1368  *                      It is computed with fps.
1369  * @return @c 0 on success, otherwise a negative error value
1370  * @retval #RECORDER_ERROR_NONE Successful
1371  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1372  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1373  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1374  * @see recorder_attr_set_recording_motion_rate()
1375  */
1376 int legacy_recorder_attr_get_recording_motion_rate(recorder_h recorder , double *rate);
1377
1378 /**
1379  * @brief Sets the number of the audio channel.
1380  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1381  * @remarks This attribute is applied only in RECORDER_STATE_CREATED state. \n
1382  *          For mono recording, setting channel to @c 1. \n
1383  *          For stereo recording, setting channel to @c 2.
1384  * @param[in] recorder       The handle to the media recorder
1385  * @param[in] channel_count  The number of the audio channel
1386  * @return @c 0 on success, otherwise a negative error value
1387  * @retval #RECORDER_ERROR_NONE Successful
1388  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1389  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1390  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1391  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
1392  *      Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
1393  * @see recorder_attr_get_audio_channel()
1394  */
1395 int legacy_recorder_attr_set_audio_channel(recorder_h recorder, int channel_count);
1396
1397 /**
1398  * @brief Gets the number of the audio channel.
1399  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1400  * @param[in] recorder  The handle to the media recorder
1401  * @param[out] channel_count  The number of the audio channel
1402  * @return @c 0 on success, otherwise a negative error value
1403  * @retval #RECORDER_ERROR_NONE Successful
1404  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1405  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1406  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1407  * @see recorder_attr_set_audio_channel()
1408  */
1409 int legacy_recorder_attr_get_audio_channel(recorder_h recorder, int *channel_count);
1410
1411
1412 /**
1413  * @brief Sets the video orientation in a video metadata tag.
1414  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1415  * @param[in]   recorder        The handle to a media recorder
1416  * @param[in]   orientation     The information of the video orientation
1417  * @return @c 0 on success, otherwise a negative error value
1418  * @retval #RECORDER_ERROR_NONE Successful
1419  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1420  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1421  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1422  * @see recorder_attr_get_orientation_tag()
1423  */
1424 int legacy_recorder_attr_set_orientation_tag(recorder_h recorder,  recorder_rotation_e orientation);
1425
1426 /**
1427  * @brief Gets the video orientation in a video metadata tag.
1428  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1429  * @param[in]   recorder        The handle to a media recorder
1430  * @param[out]  orientation     The information of the video orientation
1431  * @return  @c 0 on success, otherwise a negative error value
1432  * @retval #RECORDER_ERROR_NONE Successful
1433  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1434  * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1435  * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1436  * @see recorder_attr_set_orientation_tag()
1437  */
1438 int legacy_recorder_attr_get_orientation_tag(recorder_h recorder, recorder_rotation_e *orientation);
1439
1440 /**
1441  * @}
1442  */
1443
1444 #ifdef __cplusplus
1445 }
1446 #endif
1447
1448 #endif /* __TIZEN_MULTIMEDIA_RECORDER_H__ */
1449