2.0 init
[framework/api/recorder.git] / include / 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
18
19 #ifndef __TIZEN_MULTIMEDIA_RECORDER_H__
20 #define __TIZEN_MULTIMEDIA_RECORDER_H__
21 #include <tizen.h>
22 #include <camera.h>
23 #include <audio_io.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #define RECORDER_ERROR_CLASS        TIZEN_ERROR_MULTIMEDIA_CLASS | 0x10
30
31
32 /**
33  * @file recorder.h
34  * @brief This file contains the Recorder API.
35  */
36
37 /**
38  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
39  * @{
40  */
41
42 /**
43  * @brief The handle to media recorder
44  */
45 typedef struct recorder_s *recorder_h;
46
47 /**
48  * @brief  Enumerations of error code for the media recorder.
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_e;
61
62 /**
63  * @brief Enumerations for camera states.
64  */
65 typedef enum
66 {
67         RECORDER_STATE_NONE,                            /**< Recorder is not created */
68         RECORDER_STATE_CREATED,                         /**< Recorder is created, but not prepared*/
69         RECORDER_STATE_READY,                       /**< Recorder is ready to record\n  In case of video recorder, preview display will be shown */
70         RECORDER_STATE_RECORDING,               /**< Recorder is recording media*/
71         RECORDER_STATE_PAUSED,                      /**< Recorder is paused while recording media*/
72 } recorder_state_e;
73
74 /**
75  * @brief Enumerations of recording limitation.
76  */
77 typedef enum
78 {
79         RECORDER_RECORDING_LIMIT_TIME,                  /**< Time limit (second) of recording file */
80         RECORDER_RECORDING_LIMIT_SIZE,                  /**< Size limit (kilo bytes [KB]) of recording file */
81         RECORDER_RECORDING_LIMIT_FREE_SPACE,    /**< No free space in storage  */
82 } recorder_recording_limit_type_e;
83
84 /**
85  * @brief Enumerations of file container format.
86  */
87 typedef enum
88 {
89         RECORDER_FILE_FORMAT_3GP,                     /**< 3GP file format */
90         RECORDER_FILE_FORMAT_MP4,                     /**< MP4 file format */
91         RECORDER_FILE_FORMAT_AMR,                     /**< AMR file format */
92         RECORDER_FILE_FORMAT_ADTS,                   /**< ADTS file format */
93         RECORDER_FILE_FORMAT_WAV,                    /**< WAV file format */
94 } recorder_file_format_e;
95
96
97 /**
98  * @brief Enumerations of audio codec.
99  */
100 typedef enum
101 {
102         RECORDER_AUDIO_CODEC_DISABLE = -1, /**< Disable audio track */
103         RECORDER_AUDIO_CODEC_AMR = 0,                   /**< AMR codec */
104         RECORDER_AUDIO_CODEC_AAC,                       /**< AAC codec */
105         RECORDER_AUDIO_CODEC_VORBIS,    /**< Vorbis codec */
106         RECORDER_AUDIO_CODEC_PCM                        /**< PCM codec */
107 } recorder_audio_codec_e;
108
109 /**
110  * @brief Enumerations of video codec.
111  */
112 typedef enum
113 {
114         RECORDER_VIDEO_CODEC_H263,                      /**< H263 codec */
115         RECORDER_VIDEO_CODEC_H264,                      /**< H264 codec */
116         RECORDER_VIDEO_CODEC_MPEG4,             /**< MPEG4 codec */
117         RECORDER_VIDEO_CODEC_THEORA             /**< Theora codec */
118 } recorder_video_codec_e;
119
120 /**
121  * @brief Enumerations of audio capture devices.
122  */
123 typedef enum
124 {
125         RECORDER_AUDIO_DEVICE_MIC,      /**< Mic device */
126         RECORDER_AUDIO_DEVICE_MODEM,    /**< Modem */
127 } recorder_audio_device_e;
128
129 /**
130  * @brief Enumerations of the recorder rotation type.
131  */
132 typedef enum
133 {
134         RECORDER_ROTATION_NONE, /**< No rotation */
135         RECORDER_ROTATION_90,           /**< 90 degree rotation */
136         RECORDER_ROTATION_180,  /**< 180 degree rotation */
137         RECORDER_ROTATION_270,  /**< 270 degree rotation */
138 } recorder_rotation_e;
139
140 /**
141  * @brief Enumerations of the recorder policy.
142  */
143 typedef enum
144 {
145         RECORDER_POLICY_NONE = 0, /**< None */
146         RECORDER_POLICY_SOUND, /**< Sound policy */
147         RECORDER_POLICY_SECURITY /**< Security policy */
148 } recorder_policy_e;
149
150 /**
151  * @}
152 */
153
154 /**
155  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
156  * @{
157  */
158
159 /**
160  * @brief  The callback function called when limitation error occurs while recording.
161  * @details The callback function is possible to receive three types of limits: time, size and no-space.
162  * @remarks After called it, recording data is discarded and not written in recording file. Also the state of recorder is not changed.
163  * @param[in] type              The limitation type
164  * @param[in] user_data The user data passed from the callback registration function
165  * @pre It is required to register a callback using recorder_set_recording_limit_reached_cb()
166  * @see recorder_set_recording_status_cb()
167  * @see recorder_set_recording_limit_reached_cb()
168  * @see recorder_unset_recording_limit_reached_cb()
169  */
170 typedef void (*recorder_recording_limit_reached_cb)(recorder_recording_limit_type_e type, void *user_data);
171
172
173 /**
174  * @brief  Callback function to indicate recording status
175  * @remarks This callback function is repeatedly invoked during #RECORDER_STATE_RECORDING state
176  * @param[in] elapsed_time      The time of recording (milliseconds)
177  * @param[in] file_size The size of recording file (KB)
178  * @param[in] user_data The user data passed from the callback registration function
179  * @pre recorder_start() will cause this callback if you register this callback using recorder_set_recording_status_cb()
180  * @see recorder_set_recording_status_cb()
181  * @see recorder_unset_recording_status_cb()
182  * @see recorder_start()
183  */
184 typedef void (*recorder_recording_status_cb)(int elapsed_time, int file_size, void *user_data);
185
186
187 /**
188  * @brief  Called when the record state has changed.
189  * @param[in] previous  The previous state of recorder
190  * @param[in] current   The current state of recorder
191  * @param[in] by_policy     @c true if the state is changed by policy, otherwise @c false
192  * @param[in] user_data The user data passed from the callback registration function
193  * @pre This function is required to register a callback using recorder_set_state_changed_cb()
194  * @see recorder_set_state_changed_cb()
195  * @see recorder_prepare()
196  * @see recorder_unprepare()
197  * @see recorder_start()
198  * @see recorder_pause()
199  * @see recorder_commit()
200  * @see recorder_cancel()
201  */
202 typedef void (*recorder_state_changed_cb)(recorder_state_e previous , recorder_state_e current , bool by_policy, void *user_data);
203
204 /**
205  * @brief       Called when the recorder interrupted by policy
206  *
207  * @param[in] policy                    The policy that interrupting the recorder
208  * @param[in] previous      The previous state of the recorder
209  * @param[in] current       The current state of the recorder
210  * @param[in] user_data     The user data passed from the callback registration function
211  * @see recorder_set_interrupted_cb()
212  */
213 typedef void (*recorder_interrupted_cb)(recorder_policy_e policy, recorder_state_e previous, recorder_state_e current, void *user_data);
214
215 /**
216  * @brief Called when audio stream data was delivering just before storing in record file.
217  * @remarks
218  * The callback function holds the same buffer that will be recorded.\n
219  * So if an user change the buffer, the result file will has the buffer.\n
220  * The callback is called via internal thread of Frameworks. so don't be invoke UI API, recorder_unprepare(), recorder_commit() and recorder_cancel() in callback.
221  *
222  * @param[in] stream The audio stream data
223  * @param[in] size The size of stream data
224  * @param[in] format The audio format
225  * @param[in] channel The number of channel
226  * @param[in] timestamp The timestamp of stream buffer( in msec )
227  * @param[in] user_data The user data passed from the callback registration function
228  *
229  * @see recorder_set_audio_stream_cb()
230  */
231 typedef void (*recorder_audio_stream_cb)(void* stream, int size, audio_sample_type_e format, int channel, unsigned int timestamp, void *user_data);
232
233 /**
234  * @brief       Called when the error occurred.
235  *
236  * @remarks
237  * This callback inform critical error situation.\n
238  * When invoked this callback, user should release the resource and terminate application.\n
239  * These error code will be occurred\n
240  * #RECORDER_ERROR_DEVICE\n
241  * #RECORDER_ERROR_INVALID_OPERATION\n
242  * #RECORDER_ERROR_OUT_OF_MEMORY\n
243  *
244  * @param[in] error             The error code
245  * @param[in] current_state     The current state of the recorder
246  * @param[in] user_data         The user data passed from the callback registration function
247  *
248  * @pre This callback function is invoked if you register this callback using recorder_set_error_cb().
249  * @see recorder_set_error_cb()
250  * @see recorder_unset_error_cb()
251  */
252 typedef void (*recorder_error_cb)(recorder_error_e error, recorder_state_e current_state, void *user_data);
253
254
255  /**
256  * @}
257 */
258
259 /**
260  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
261  * @{
262  */
263
264 /**
265  * @brief Gets called iteratively to notify you of supported file formats. 
266  * @param[in] format   The format of recording files
267  * @param[in] user_data The user data passed from the foreach function
268  * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
269  * @pre recorder_foreach_supported_file_format() will invoke this callback.
270  * @see recorder_foreach_supported_file_format()
271  */
272 typedef bool (*recorder_supported_file_format_cb)(recorder_file_format_e format, void *user_data);
273
274
275 /**
276  * @brief  Gets called iteratively to notify you of supported audio encoders.
277  * @param[in] codec     The codec of audio encoder.
278  * @param[in] user_data The user data passed from the foreach function
279  * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
280  * @pre recorder_foreach_supported_audio_encoder() will invoke this callback.
281  * @see recorder_foreach_supported_audio_encoder()
282  */
283 typedef bool (*recorder_supported_audio_encoder_cb)(recorder_audio_codec_e codec, void *user_data);
284
285
286 /**
287  * @brief  Gets called iteratively to notify you of supported video encoders.
288  * @param[in] codec     The codec of video encoder.
289  * @param[in] user_data The user data passed from the foreach function
290  * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
291  * @pre recorder_foreach_supported_video_encoder() will invoke this callback.
292  * @see recorder_foreach_supported_video_encoder()
293  */
294 typedef bool (*recorder_supported_video_encoder_cb)(recorder_video_codec_e codec, void *user_data);
295
296 /**
297  * @}
298 */
299
300 /**
301  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
302  * @{
303  */
304
305 /**
306  * @brief  Creates a recorder handle to record a video.
307  * @param[in]   camera  The handle to camera
308  * @param[out]  recorder        A handle to recorder
309  * @remarks @a recorder must be released with recorder_destroy() by you.\n
310  * The @a camera handle can not be used for capturing images until @record is deleted by recorder_destroy().  
311  * @return      0 on success, otherwise a negative error value.
312  * @retval #RECORDER_ERROR_NONE Successful
313  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
314  * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
315  * @retval #RECORDER_ERROR_SOUND_POLICY Sound policy error
316  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
317  * @pre Camera handle's state must be #CAMERA_STATE_CREATED by camera_create() or camera_stop_preview().
318  * @post The recorder state will be #RECORDER_STATE_CREATED.
319  * @see camera_create()
320  * @see camera_stop_preview()
321  * @see recorder_destroy()
322  */
323 int recorder_create_videorecorder(camera_h camera, recorder_h *recorder);
324
325
326 /**
327  * @brief  Creates a recorder handle to record an audio.
328  * @remarks @a recorder must be released with recorder_destroy() by you 
329  * @param[out]  recorder        A handle to  recorder
330  * @return      0 on success, otherwise a negative error value.
331  * @retval #RECORDER_ERROR_NONE Successful
332  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
333  * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
334  * @retval #RECORDER_ERROR_SOUND_POLICY Sound policy error
335  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
336  * @post The recorder state will be #RECORDER_STATE_CREATED.
337  * @see recorder_destroy()
338  */
339 int recorder_create_audiorecorder(recorder_h *recorder);
340
341
342 /**
343  * @brief  Destroys the recorder handle
344  * @remarks     Video recorder's camera handle is not release by this function.
345  * @param[in]   recorder    The handle to media recorder
346  * @return      0 on success, otherwise a negative error value.
347  * @retval #RECORDER_ERROR_NONE Successful
348  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
349  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
350  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
351  * @pre  The recorder state should be #RECORDER_STATE_CREATED
352  * @post The recorder state will be #RECORDER_STATE_NONE.
353  * @see camera_destroy()
354  * @see recorder_create_videorecorder()
355  * @see recorder_create_audiorecorder()
356  */
357 int recorder_destroy(recorder_h recorder);
358
359
360 /**
361  * @brief  Prepares the media recorder for recording
362  * @remarks     Before calling the function, it is required to set audio encoder (recorder_set_audio_encoder()),
363  * video encoder(recorder_set_video_encoder()), file format (recorder_set_file_format()) with proper value.
364  * @param[in]   recorder        The handle to media recorder
365  * @return      0 on success, otherwise a negative error value.
366  * @retval #RECORDER_ERROR_NONE Successful
367  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
368  * @retval #RECORDER_ERROR_SOUND_POLICY Sound policy error
369  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
370  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
371  * @pre  The recorder state should be #RECORDER_STATE_CREATED by recorder_create_videorecorder(), recorder_create_audiorecorder() or recorder_unprepare().
372  * @post The recorder state will be #RECORDER_STATE_READY.
373  * @post        If recorder handle is created by recorder_create_videorecorder(), it's camera state will be changed to #CAMERA_STATE_PREVIEW.
374  * @see recorder_create_videorecorder()
375  * @see recorder_create_audiorecorder() 
376  * @see recorder_unprepare()
377  * @see recorder_set_audio_encoder()
378  * @see         recorder_set_video_encoder()
379  * @see         recorder_set_file_format()
380  */
381 int recorder_prepare(recorder_h recorder);
382
383
384 /**
385  * @brief  Reset the media recorder.
386  * @param[in]   recorder    The handle to media recorder
387  * @return      0 on success, otherwise a negative error value.
388  * @retval #RECORDER_ERROR_NONE Successful
389  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
390  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
391  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
392  * @pre  The recorder state should be #RECORDER_STATE_READY by recorder_prepare(), recorder_cancel(),or recorder_commit().
393  * @post The recorder state will be #RECORDER_STATE_CREATED.
394  * @post        If recorder handle is created by recorder_create_videorecorder(), it's camera state will be changed to #CAMERA_STATE_CREATED.
395  * @see recorder_prepare()
396  * @see recorder_cancel()
397  * @see recorder_commit()
398  */
399 int recorder_unprepare(recorder_h recorder);
400
401
402 /**
403  * @brief  Starts recording
404  * @remarks If file path has been set to existing file, this file is removed automatically and updated by new one.
405  * @param[in]   recorder        The handle to media recorder
406  * @return      0 on success, otherwise a negative error value.
407  * @retval #RECORDER_ERROR_NONE Successful
408  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
409  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
410  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
411  * @pre The recorder state must be #RECORDER_STATE_READY by recorder_prepare() or #RECORDER_STATE_PAUSED by recorder_pause()
412  * @post The recorder state will be #RECORDER_STATE_RECORDING.
413  * @see recorder_pause()
414  * @see         recorder_commit()
415  * @see         recorder_cancel()
416  * @see         recorder_set_audio_encoder()
417  * @see         recorder_set_filename()
418  * @see         recorder_set_file_format()
419  * @see recorder_recording_status_cb()
420  */
421 int recorder_start(recorder_h recorder);
422
423
424 /**
425  * @brief  Pauses recording
426  * @remarks     Recording can be resumed with recorder_start().
427  * @param[in]   recorder        The handle to media recorder
428  * @return      0 on success, otherwise a negative error value.
429  * @retval #RECORDER_ERROR_NONE Successful
430  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
431  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
432  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
433  * @pre The recorder state must be #RECORDER_STATE_RECORDING
434  * @post The recorder state will be #RECORDER_STATE_PAUSED.
435  * @see recorder_pause()
436  * @see recorder_commit()
437  * @see recorder_cancel()
438  */
439 int recorder_pause(recorder_h recorder);
440
441
442 /**
443  * @brief  Stops recording and saving the result
444  * @param   [in]        recorder        The handle to media recorder
445  * @return      0 on success, otherwise a negative error value.
446  * @retval #RECORDER_ERROR_NONE Successful
447  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
448  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
449  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
450  * @pre The recorder state must be #RECORDER_STATE_RECORDING by recorder_start() or #RECORDER_STATE_PAUSED by recorder_pause()
451  * @post The recorder state will be #RECORDER_STATE_READY.
452  * @see recorder_pause()
453  * @see recorder_cancel()
454  * @see recorder_set_filename()
455  * @see recorder_start()
456  */
457 int recorder_commit(recorder_h recorder);
458
459
460 /**
461  * @brief  Cancels recording.
462  * @detail The recording data is discarded and not written in recording file.
463  * @param[in]   recorder    The handle to media recorder
464  * @return      0 on success, otherwise a negative error value
465  * @retval #RECORDER_ERROR_NONE Successful
466  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
467  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
468  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
469  * @pre The recorder state must be #RECORDER_STATE_RECORDING by recorder_start() or #RECORDER_STATE_PAUSED by recorder_pause()
470  * @post The recorder state will be #RECORDER_STATE_READY.
471  * @see recorder_pause()
472  * @see recorder_commit()
473  * @see recorder_cancel()
474  * @see recorder_start()
475  */
476 int recorder_cancel(recorder_h recorder);
477
478
479 /**
480  * @brief Gets the recorder's current state.
481  * @param[in]  recorder The handle to the recorder.
482  * @param[out]  state  The current state of the recorder
483  * @return  0 on success, otherwise a negative error value.
484  * @retval #RECORDER_ERROR_NONE Successful
485  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
486  */
487 int recorder_get_state(recorder_h recorder, recorder_state_e *state);
488
489 /**
490  * @brief Gets the peak audio input level that was sampled since the last call to this function.
491  * @remarks 0 dB indicates maximum input level, -300dB indicates minimum input level
492  * @param[in]  recorder The handle to the recorder.
493  * @param[out]  level  The audio input level in dB
494  * @return  0 on success, otherwise a negative error value.
495  * @retval #RECORDER_ERROR_NONE Successful
496  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
497  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
498  * @pre The recorder state must be #RECORDER_STATE_RECORDING or #RECORDER_STATE_PAUSED
499  */
500 int recorder_get_audio_level(recorder_h recorder, double *dB);
501
502 /**
503  * @brief  Sets the file path to record
504  * @details This function sets file path which defines where newly recorder data should be stored. 
505  * @remarks     If there is already exists same file in file system, then old file will be overwritten.
506  * @param[in]   recorder        The handle to media recorder
507  * @param[in]   path The recording file path
508  * @return      0 on success, otherwise a negative error value.
509  * @retval #RECORDER_ERROR_NONE Successful
510  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
511  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
512  * @pre The recorder state must be #RECORDER_STATE_CREATED by recorder_create() or recorder_unprepare()
513  * @see recorder_get_filename()
514  */
515 int recorder_set_filename(recorder_h recorder, const char *path);
516
517
518 /**
519  * @brief  Gets the file path to record
520  * @remarks  @a path must be released with @c free() by you.
521  * @param[in]   recorder    The handle to media recorder
522  * @param[out]  path    The recording file path
523  * @return      0 on success, otherwise a negative error value.
524  * @retval #RECORDER_ERROR_NONE Successful
525  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
526  * @see recorder_set_filename()
527  */
528 int recorder_get_filename(recorder_h recorder, char **path);
529
530
531 /**
532  * @brief  Sets the file format for recording media stream
533  * @param[in] recorder The handle to media recorder
534  * @param[in] format   The media file format
535  * @return      0 on success, otherwise a negative error value.
536  * @retval #RECORDER_ERROR_NONE Successful
537  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
538  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
539  * @pre The recorder state must be #RECORDER_STATE_CREATED
540  * @see recorder_get_file_format()
541  * @see recorder_foreach_supported_file_format()
542  */
543 int recorder_set_file_format(recorder_h recorder, recorder_file_format_e format);
544
545
546 /**
547  * @brief  Gets the file format for recording media stream
548  * @param [in] recorder The handle to media recorder
549  * @param [in] format   The media file format
550  * @return      0 on success, otherwise a negative error value.
551  * @retval #RECORDER_ERROR_NONE Successful
552  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
553  * @see recorder_set_file_format()
554  * @see recorder_foreach_supported_file_format()
555  */
556 int recorder_get_file_format(recorder_h recorder, recorder_file_format_e *format);
557
558
559  /**
560  * @}
561 */
562
563 /**
564  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
565  * @{
566  */
567
568 /**
569  * @brief  Retrieves all supported file formats by invoking a specific callback for each supported file format
570  * @param[in] recorder  The handle to media recorder
571  * @param[in] callback The iteration callback
572  * @param[in] user_data The user data to be passed to the callback function
573  * @return      0 on success, otherwise a negative error value.
574  * @retval #RECORDER_ERROR_NONE Successful
575  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
576  * @post  recorder_supported_file_format_cb() will be invoked
577  * @see recorder_get_file_format()
578  * @see recorder_set_file_format()
579  * @see recorder_supported_file_format_cb()
580  */
581 int recorder_foreach_supported_file_format(recorder_h recorder, recorder_supported_file_format_cb callback, void *user_data);
582
583 /**
584  * @}
585 */
586
587 /**
588  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
589  * @{
590  */
591
592 /**
593  * @brief  Sets the audio codec for encoding audio stream
594  * @remarks You can get available audio encoders by using recorder_foreach_supported_audio_encoder().\n
595  * if set to RECORDER_AUDIO_CODEC_DISABLE, audio track is not created in recording files.
596  * @param[in] recorder The handle to media recorder
597  * @param[in] codec    The audio codec
598  * @return      0 on success, otherwise a negative error value.
599  * @retval #RECORDER_ERROR_NONE Successful
600  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
601  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
602  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
603  * @see recorder_get_audio_encoder()
604  * @see recorder_foreach_supported_audio_encoder()
605  */
606 int recorder_set_audio_encoder(recorder_h recorder, recorder_audio_codec_e codec);
607
608
609 /**
610  * @brief  Gets the audio codec for encoding audio stream
611  * @param [in] recorder The handle to media recorder
612  * @param [out] codec   The audio codec
613  * @return      0 on success, otherwise a negative error value.
614  * @retval #RECORDER_ERROR_NONE Successful
615  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
616  * @see recorder_set_audio_encoder()
617  * @see recorder_foreach_supported_audio_encoder()
618  */
619 int recorder_get_audio_encoder(recorder_h recorder, recorder_audio_codec_e *codec);
620
621  /**
622  * @}
623 */
624
625 /**
626  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
627  * @{
628  */
629
630 /**
631  * @brief  Retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder.
632  * @param[in] recorder  The handle to media recorder
633  * @param[in] callback  The iteration callback
634  * @param[in] user_data The user data to be passed to the callback function
635  * @return      0 on success, otherwise a negative error value.
636  * @retval #RECORDER_ERROR_NONE Successful
637  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
638  * @post  recorder_supported_audio_encoder_cb() will be invoked
639  * @see recorder_set_audio_encoder()
640  * @see recorder_get_audio_encoder()
641  * @see recorder_supported_audio_encoder_cb()
642  */
643 int recorder_foreach_supported_audio_encoder(recorder_h recorder, recorder_supported_audio_encoder_cb callback, void *user_data);
644
645 /**
646  * @}
647 */
648
649 /**
650  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
651  * @{
652  */
653
654 /**
655  * @brief  Sets the video codec for encoding video stream.
656  * @remarks You can get available video encoders by using recorder_foreach_supported_video_encoder().
657  * @param[in] recorder The handle to media recorder
658  * @param[in] codec    The video codec
659  * @return      0 on success, otherwise a negative error value.
660  * @retval #RECORDER_ERROR_NONE Successful
661  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
662  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
663  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
664  * @see recorder_get_video_encoder()
665  * @see recorder_foreach_supported_video_encoder()
666  */
667 int recorder_set_video_encoder(recorder_h recorder, recorder_video_codec_e codec);
668
669
670 /**
671  * @brief  Gets the video codec for encoding video stream.
672  * @param[in] recorder The handle to media recorder
673  * @param[out] codec   The video codec
674  * @return      0 on success, otherwise a negative error value.
675  * @retval #RECORDER_ERROR_NONE Successful
676  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
677  * @see recorder_set_video_encoder()
678  * @see recorder_foreach_supported_video_encoder()
679  */
680 int recorder_get_video_encoder(recorder_h recorder, recorder_video_codec_e *codec);
681
682 /**
683  * @}
684 */
685
686 /**
687  * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
688  * @{
689  */
690
691 /**
692  * @brief  Retrieves all supported video encoders by invoking a specific callback for each supported video encoder.
693  * @param[in] recorder  The handle to media recorder
694  * @param[in] callback  The iteration callback
695  * @param[in] user_data The user data to be passed to the callback function
696  * @return      0 on success, otherwise a negative error value.
697  * @retval #RECORDER_ERROR_NONE Successful
698  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
699  * @post  recorder_supported_video_encoder_cb() will be invoked
700  * @see recorder_set_video_encoder()
701  * @see recorder_get_video_encoder()
702  * @see recorder_supported_video_encoder_cb()
703  */
704 int recorder_foreach_supported_video_encoder(recorder_h recorder, recorder_supported_video_encoder_cb callback, void *user_data);
705
706  /**
707  * @}
708 */
709
710 /**
711  * @addtogroup CAPI_MEDIA_RECORDER_MODULE
712  * @{
713  */
714
715 /**
716  * @brief  Registers the callback function that will be invoked when the recorder state changes.
717  * @param[in] recorder  The handle to the recorder.
718  * @param[in] callback  The function pointer of user callback
719  * @param[in] user_data The user data to be passed to the callback function
720  * @return      0 on success, otherwise a negative error value.
721  * @retval #RECORDER_ERROR_NONE Successful
722  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
723  * @post  recorder_state_changed_cb() will be invoked
724  * @see recorder_unset_state_changed_cb()
725  * @see recorder_state_changed_cb()
726  */
727 int recorder_set_state_changed_cb(recorder_h recorder, recorder_state_changed_cb callback, void *user_data);
728
729
730 /**
731  * @brief  Unregisters the callback function.
732  * @param[in]  recorder The handle to the recorder.
733  * @return      0 on success, otherwise a negative error value.
734  * @retval #RECORDER_ERROR_NONE Successful
735  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
736  * @see recorder_set_state_changed_cb()
737  */
738 int recorder_unset_state_changed_cb(recorder_h recorder);
739
740 /**
741  * @brief       Registers a callback function to be called when recorder interrupted by policy.
742  *
743  * @param[in] recorder  The handle to the recorder
744  * @param[in] callback    The callback function to register
745  * @param[in] user_data   The user data to be passed to the callback function
746  *
747  * @return        0 on success, otherwise a negative error value.
748  * @retval    #RECORDER_ERROR_NONE Successful
749  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
750  *
751  * @see recorder_unset_interrupted_cb()
752  * @see recorder_interrupted_cb()
753  */
754 int recorder_set_interrupted_cb(recorder_h recorder, recorder_interrupted_cb callback,
755             void *user_data);
756
757 /**
758  * @brief       Unregisters the callback function.
759  *
760  * @param[in]   recorder        The handle to the recorder
761  * @return        0 on success, otherwise a negative error value.
762  * @retval    #RECORDER_ERROR_NONE Successful
763  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
764  *
765  * @see     recorder_set_interrupted_cb()
766  */
767 int recorder_unset_interrupted_cb(recorder_h recorder);
768
769 /**
770  * @brief       Registers a callback function to be called when audio stream data was delivering
771  *
772  * @remarks
773  * This callback function holds the same buffer that will be recorded.\n
774  * So if an user change the buffer, the result file will has the buffer.\n
775  * The callback is called via internal thread of Frameworks. so don't be invoke UI API, recorder_unprepare(), recorder_commit() and recorder_cancel() in callback.\n
776  * This callback function to be called in RECORDER_STATE_RECORDING and RECORDER_STATE_PAUSE state.
777  *
778  * @param[in] recorder  The handle to the recorder
779  * @param[in] callback    The callback function to register
780  * @param[in] user_data   The user data to be passed to the callback function
781  *
782  * @return        0 on success, otherwise a negative error value.
783  * @retval    #RECORDER_ERROR_NONE Successful
784  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
785  * @pre         The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
786  *
787  * @see recorder_unset_audio_stream_cb()
788  * @see recorder_audio_stream_cb()
789  */
790 int recorder_set_audio_stream_cb(recorder_h recorder, recorder_audio_stream_cb callback, void* user_data);
791
792 /**
793  * @brief       Unregisters the callback function.
794  *
795  * @param[in]   recorder        The handle to the recorder
796  * @return        0 on success, otherwise a negative error value.
797  * @retval    #RECORDER_ERROR_NONE Successful
798  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
799  *
800  * @see     recorder_set_audio_stream_cb()
801  */
802 int recorder_unset_audio_stream_cb(recorder_h recorder);
803
804
805 /**
806  * @brief  Registers a callback function to be invoked when the recording information changes.
807  * @param[in]   recorder    The handle to media recorder
808  * @param[in]   callback        The function pointer of user callback
809  * @param[in]   user_data       The user data to be passed to the callback function
810  * @return      0 on success, otherwise a negative error value.
811  * @retval #RECORDER_ERROR_NONE Successful
812  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
813  * @post  recorder_recording_status_cb() will be invoked
814  * @see recorder_unset_recording_status_cb()
815  * @see recorder_recording_status_cb()
816  */
817 int recorder_set_recording_status_cb(recorder_h recorder, recorder_recording_status_cb callback, void *user_data);
818
819
820 /**
821  * @brief Unregisters the callback function.
822  * @param[in]   recorder    The handle to media recorder
823  * @return      0 on success, otherwise a negative error value.
824  * @retval #RECORDER_ERROR_NONE Successful
825  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
826  * @see recorder_set_recording_status_cb()
827  */
828 int recorder_unset_recording_status_cb(recorder_h recorder);
829
830
831 /**
832  * @brief  Registers the callback function to run when reached recording limit.
833  * @param[in]   recorder        The handle to media recorder
834  * @param[in]   callback        The function pointer of user callback
835  * @param[in]   user_data       The user data to be passed to the callback function
836  * @return      0 on success, otherwise a negative error value.
837  * @retval #RECORDER_ERROR_NONE Successful
838  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
839  * @post  recorder_recording_limit_reached_cb() will be invoked
840  * @see recorder_unset_recording_limit_reached_cb()
841  * @see recorder_attr_set_size_limit()
842  * @see recorder_attr_set_time_limit()
843  * @see recorder_recording_limit_reached_cb()
844  */
845 int recorder_set_recording_limit_reached_cb(recorder_h recorder, recorder_recording_limit_reached_cb callback, void *user_data);
846
847
848 /**
849  * @brief  Unregisters the callback function.
850  * @param[in]   recorder        The handle to media recorder
851  * @return      0 on success, otherwise a negative error value.
852  * @retval #RECORDER_ERROR_NONE Successful
853  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
854  * @see recorder_set_recording_limit_reached_cb()
855  */
856 int recorder_unset_recording_limit_reached_cb(recorder_h recorder);
857
858
859 /**
860  * @brief       Registers a callback function to be called when an asynchronous operation error occurred.
861  *
862  * @remarks
863  * This callback inform critical error situation.\n
864  * When invoked this callback, user should release the resource and terminate application.\n
865  * These error code will be occurred\n
866  * #RECORDER_ERROR_DEVICE\n
867  * #RECORDER_ERROR_INVALID_OPERATION\n
868  * #RECORDER_ERROR_OUT_OF_MEMORY\n
869  *
870  * @param[in]   recorder        The handle to the recorder
871  * @param[in]   callback        The callback function to register
872  * @param[in]   user_data       The user data to be passed to the callback function
873  * @return        0 on success, otherwise a negative error value.
874  * @retval    #RECORDER_ERROR_NONE Successful
875  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
876  * @post        This function will invoke recorder_error_cb() when an asynchronous operation error occur.
877  *
878  * @see recorder_unset_error_cb()
879  * @see recorder_error_cb()
880  */
881 int recorder_set_error_cb(recorder_h recorder, recorder_error_cb callback, void *user_data);
882
883
884 /**
885  * @brief       Unregisters the callback function.
886  *
887  * @param[in]   recorder        The handle to the recorder
888  * @return        0 on success, otherwise a negative error value.
889  * @retval    #RECORDER_ERROR_NONE Successful
890  * @retval    #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
891  *
892  * @see recorder_set_error_cb()
893  */
894 int recorder_unset_error_cb(recorder_h recorder);
895
896
897 /**
898  * @}
899  */
900
901 /**
902  * @addtogroup CAPI_MEDIA_RECORDER_ATTRIBUTES_MODULE
903  * @{
904  */
905
906
907 /**
908  * @brief  Sets maximum size of recording file.
909  * @remarks     After reached limitation, recording data is discarded and not written in recording file.
910  * @param[in] recorder The handle to media recorder
911  * @param[in] kbyte The maximum size of recording file(KB)\n @c 0 means unlimited recording size.
912  * @return      0 on success, otherwise a negative error value.
913  * @retval #RECORDER_ERROR_NONE Successful
914  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
915  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
916  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
917  * @see recorder_attr_get_size_limit()
918  * @see recorder_attr_set_time_limit()
919  */
920 int recorder_attr_set_size_limit(recorder_h recorder, int kbyte);
921
922
923 /**
924  * @brief  Gets the maximum size of recording file.
925  * @param[in] recorder The handle to media recorder
926  * @param[out] kbyte   The maximum size of recording file (KB)\n @c 0 means unlimited recording size
927  * @return      0 on success, otherwise a negative error value.
928  * @retval #RECORDER_ERROR_NONE Successful
929  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
930  * @see recorder_attr_set_size_limit()
931  * @see recorder_attr_get_time_limit()
932  */
933 int recorder_attr_get_size_limit(recorder_h recorder, int *kbyte);
934
935
936 /**
937  * @brief  Sets time limit of recording file.
938  * @remarks     After reached limitation, recording data is discarded and not written in recording file.
939  * @param[in] recorder The handle to media recorder
940  * @param[in] second   The time limit of recording file (in seconds) \n @c 0 means unlimited recording size
941  * @return      0 on success, otherwise a negative error value.
942  * @retval #RECORDER_ERROR_NONE Successful
943  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
944  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
945  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
946  * @see recorder_attr_get_time_limit()
947  * @see recorder_attr_set_size_limit()
948  */
949 int recorder_attr_set_time_limit(recorder_h recorder, int second);
950
951
952 /**
953  * @brief  Gets the time limit of recording file
954  * @param[in] recorder  The handle to media recorder
955  * @param[out] second   The time limit of recording file (in seconds)\n  @c 0 means unlimited recording time.
956  * @return      0 on success, otherwise a negative error value.
957  * @retval #RECORDER_ERROR_NONE Successful
958  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
959  * @see recorder_attr_set_time_limit()
960  * @see recorder_attr_get_size_limit()
961  */
962 int recorder_attr_get_time_limit(recorder_h recorder, int *second);
963
964
965 /**
966  * @brief  Sets audio device for recording.
967  * @param[in] recorder The handle to media recorder
968  * @param[in] device   The type of audio device
969  * @return      0 on success, otherwise a negative error value.
970  * @retval #RECORDER_ERROR_NONE Successful
971  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
972  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
973  * @pre The recorder state must be #RECORDER_STATE_CREATED
974  * @see recorder_attr_get_audio_device()
975  */
976 int recorder_attr_set_audio_device(recorder_h recorder, recorder_audio_device_e device);
977
978
979 /**
980  * @brief Gets the audio device for recording.
981  * @param[in] recorder  The handle to media recorder
982  * @param[out] device The type of audio device
983  * @return      0 on success, otherwise a negative error value.
984  * @retval #RECORDER_ERROR_NONE Successful
985  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
986  * @see recorder_attr_set_audio_device()
987  */
988 int recorder_attr_get_audio_device(recorder_h recorder, recorder_audio_device_e *device);
989
990
991 /**
992  * @brief  Sets sampling rate of audio stream.
993  * @param[in] recorder  The handle to media recorder
994  * @param[in] samplerate The sample rate in Hertz
995  * @return      0 on success, otherwise a negative error value.
996  * @retval #RECORDER_ERROR_NONE Successful
997  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
998  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
999  * @pre The recorder state must be #RECORDER_STATE_CREATED
1000  * @see recorder_attr_get_audio_samplerate()
1001  */
1002 int recorder_attr_set_audio_samplerate(recorder_h recorder, int samplerate);
1003
1004
1005 /**
1006  * @brief  Gets the sampling rate of audio stream.
1007  * @param[in] recorder The handle to media recorder
1008  * @param[out] samplerate  The sample rate in Hertz
1009  * @return      0 on success, otherwise a negative error value.
1010  * @retval #RECORDER_ERROR_NONE Successful
1011  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1012  * @see recorder_attr_set_audio_samplerate()
1013  */
1014 int recorder_attr_get_audio_samplerate(recorder_h recorder, int *samplerate);
1015
1016
1017 /**
1018  * @brief  Sets the bitrate of audio encoder.
1019  * @param[in] recorder  The handle to media recorder
1020  * @param[in] bitrate   The bitrate (for mms : 12200[bps], normal : 288000[bps])
1021  * @return      0 on success, otherwise a negative error value.
1022  * @retval #RECORDER_ERROR_NONE Successful
1023  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1024  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1025  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
1026  * @see recorder_attr_get_audio_encoder_bitrate()
1027  */
1028 int recorder_attr_set_audio_encoder_bitrate(recorder_h recorder, int bitrate);
1029
1030
1031 /**
1032  * @brief  Sets bitrate of video encoder.
1033  * @param[in] recorder  The handle to media recorder
1034  * @param[in] bitrate   The bitrate in bits per second
1035  * @return      0 on success, otherwise a negative error value.
1036  * @retval #RECORDER_ERROR_NONE Successful
1037  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1038  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1039  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
1040  * @see recorder_attr_get_video_encoder_bitrate()
1041  */
1042 int recorder_attr_set_video_encoder_bitrate(recorder_h recorder, int bitrate);
1043
1044
1045 /**
1046  * @brief  Gets the bitrate of audio encoder.
1047  * @param[in] recorder  The handle to media recorder
1048  * @param[out] bitrate  The bitrate in bits per second
1049  * @return      0 on success, otherwise a negative error value.
1050  * @retval #RECORDER_ERROR_NONE Successful
1051  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1052  * @see recorder_attr_set_audio_encoder_bitrate()
1053  */
1054 int recorder_attr_get_audio_encoder_bitrate(recorder_h recorder, int *bitrate);
1055
1056
1057 /**
1058  * @brief  Gets the bitrate of video encoder.
1059  * @param[in] recorder The handle to media recorder
1060  * @param[out] bitrate The bitrate in bits per second
1061  * @return      0 on success, otherwise a negative error value.
1062  * @retval #RECORDER_ERROR_NONE Successful
1063  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1064  * @see recorder_attr_set_audio_encoder_bitrate()
1065  */
1066 int recorder_attr_get_video_encoder_bitrate(recorder_h recorder, int *bitrate);
1067
1068
1069
1070 /**
1071  * @brief  Sets the mute state of recorder
1072  * @param[in] recorder The handle to media recorder
1073  * @param[in] enable The mute state
1074  * @return      0 on success, otherwise a negative error value.
1075  * @retval #RECORDER_ERROR_NONE Successful
1076  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1077  * @see recorder_attr_is_muted()
1078  */
1079 int recorder_attr_set_mute(recorder_h recorder, bool enable);
1080
1081 /**
1082  * @brief  Gets the mute state of recorder
1083  * @param[in] recorder The handle to media recorder
1084  * @return      true if the recorder is not recording any sound,\nelse false
1085  * @see recorder_attr_set_mute()
1086  */
1087 bool recorder_attr_is_muted(recorder_h recorder);
1088
1089 /**
1090  * @brief  Sets recording motion rate
1091  * @remarks
1092  * This attribute is valid only in video recorder.\n
1093  * If the rate bigger than 0 and smaller than 1, video is recorded slow motion mode.\n
1094  * If the rate bigger than 1, video is recorded fast motion mode(time lapse recording).
1095  * Audio data is not recorded.\n
1096  * To reset slow motion recording, setting rate to 1.
1097  * @param[in] recorder The handle to media recorder
1098  * @param[in] rate The recording motion rate. it is computed with fps. (0<rate<1 for slow motion, 1<rate for fast motion(time lapse recording), 1 to reset )
1099  * @return      0 on success, otherwise a negative error value.
1100  * @retval #RECORDER_ERROR_NONE Successful
1101  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1102  * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
1103  * @see recorder_attr_get_recording_motion_rate()
1104  */
1105 int recorder_attr_set_recording_motion_rate(recorder_h recorder , double rate);
1106
1107 /**
1108  * @brief  Gets the recording motion rate
1109  * @remarks
1110  * This attribute is valid only in video recorder.\n
1111  * If the rate bigger than 0 and smaller than 1, video is recorded slow motion mode.\n
1112  * If the rate bigger than 1, video is recorded fast motion mode(time lapse recording).
1113  * Audio data is not recorded.\n
1114  * To reset slow motion recording, setting rate to 1.
1115  * @param[in] recorder The handle to media recorder
1116  * @param[out] rate The recording motion rate. it is computed with fps.
1117  * @return      0 on success, otherwise a negative error value.
1118  * @retval #RECORDER_ERROR_NONE Successful
1119  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1120  * @see recorder_attr_set_recording_motion_rate()
1121  */
1122 int recorder_attr_get_recording_motion_rate(recorder_h recorder , double *rate);
1123
1124 __attribute__ ((deprecated)) int recorder_attr_set_slow_motion_rate(recorder_h recorder , double rate);
1125 __attribute__ ((deprecated)) int recorder_attr_get_slow_motion_rate(recorder_h recorder , double *rate);
1126
1127 /**
1128  * @brief  Sets the numer of audio channel.
1129  * @remarks This attribute is applied only in RECORDER_STATE_CREATED state.\n
1130  * For mono recording, setting channel to 1.\n
1131  * For stereo recording, setting channel to 2.
1132  * @param[in] recorder  The handle to media recorder
1133  * @param[in] channel_count The number of audio channel
1134  * @return      0 on success, otherwise a negative error value.
1135  * @retval #RECORDER_ERROR_NONE Successful
1136  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1137  * @pre The recorder state must be #RECORDER_STATE_CREATED
1138  * @see recorder_attr_get_audio_channel()
1139  */
1140 int recorder_attr_set_audio_channel(recorder_h recorder, int channel_count);
1141
1142 /**
1143  * @brief  Gets the numer of audio channel.
1144  * @param[in] recorder  The handle to media recorder
1145  * @param[out] channel_count The number of audio channel
1146  * @return      0 on success, otherwise a negative error value.
1147  * @retval #RECORDER_ERROR_NONE Successful
1148  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1149  * @see recorder_attr_set_audio_channel()
1150  */
1151 int recorder_attr_get_audio_channel(recorder_h recorder, int *channel_count);
1152
1153 /**
1154  * @brief Sets the orientation of video recording data
1155  * @remarks
1156  * This attribute is valid only in video recorder.\n
1157  * @param[in] recorder  The handle to media recorder
1158  * @param[in] orientation The orientation of video recording data
1159  * @return      0 on success, otherwise a negative error value.
1160  * @retval #RECORDER_ERROR_NONE Successful
1161  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1162  * @see recorder_attr_get_recording_orientation()
1163  */
1164 int recorder_attr_set_recording_orientation(recorder_h recorder, recorder_rotation_e orientation);
1165
1166 /**
1167  * @brief Gets the orientation of video recording data
1168  * @remarks
1169  * This attribute is valid only in video recorder.\n
1170  * @param[in] recorder  The handle to media recorder
1171  * @param[out] orientation The orientation of video recording data
1172  * @return      0 on success, otherwise a negative error value.
1173  * @retval #RECORDER_ERROR_NONE Successful
1174  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1175  * @see recorder_attr_set_recording_orientation()
1176  */
1177 int recorder_attr_get_recording_orientation(recorder_h recorder, recorder_rotation_e *orientation);
1178
1179 /**
1180  * @}
1181  */
1182
1183 #ifdef __cplusplus
1184 }
1185 #endif
1186
1187 #endif /* __TIZEN_MULTIMEDIA_RECORDER_H__ */
1188