2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_MULTIMEDIA_RECORDER_H__
18 #define __TIZEN_MULTIMEDIA_RECORDER_H__
22 #include <sound_manager.h>
28 #define RECORDER_ERROR_CLASS TIZEN_ERROR_RECORDER | 0x10
32 * @brief This file contains the Recorder API.
37 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
42 * @brief The Media recorder handle.
45 typedef struct recorder_s *recorder_h;
48 * @brief Enumeration for error code of the media recorder.
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_SECURITY_RESTRICTED = RECORDER_ERROR_CLASS | 0x07, /**< Restricted by security system policy */
59 RECORDER_ERROR_ESD = RECORDER_ERROR_CLASS | 0x0a, /**< ESD situation */
60 RECORDER_ERROR_OUT_OF_STORAGE = RECORDER_ERROR_CLASS | 0x0b, /**< Out of storage */
61 RECORDER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< The access to the resources can not be granted */
62 RECORDER_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< The feature is not supported */
63 RECORDER_ERROR_RESOURCE_CONFLICT = RECORDER_ERROR_CLASS | 0x0c, /**< Blocked by resource conflict (Since 3.0) */
64 RECORDER_ERROR_SERVICE_DISCONNECTED = RECORDER_ERROR_CLASS | 0x0d, /**< Socket connection lost (Since 3.0) */
68 * @brief Enumeration for recorder states.
72 RECORDER_STATE_NONE, /**< Recorder is not created */
73 RECORDER_STATE_CREATED, /**< Recorder is created, but not prepared */
74 RECORDER_STATE_READY, /**< Recorder is ready to record \n In case of video recorder, preview display will be shown */
75 RECORDER_STATE_RECORDING, /**< Recorder is recording media */
76 RECORDER_STATE_PAUSED, /**< Recorder is paused while recording media */
80 * @brief Enumeration for the recording limit.
84 RECORDER_RECORDING_LIMIT_TIME, /**< Time limit (second) of recording file */
85 RECORDER_RECORDING_LIMIT_SIZE, /**< Size limit (kilo bytes [KB]) of recording file */
86 RECORDER_RECORDING_LIMIT_FREE_SPACE, /**< No free space in storage */
87 } recorder_recording_limit_type_e;
90 * @brief Enumeration for the file container format.
94 RECORDER_FILE_FORMAT_3GP, /**< 3GP file format */
95 RECORDER_FILE_FORMAT_MP4, /**< MP4 file format */
96 RECORDER_FILE_FORMAT_AMR, /**< AMR file format */
97 RECORDER_FILE_FORMAT_ADTS, /**< ADTS file format */
98 RECORDER_FILE_FORMAT_WAV, /**< WAV file format */
99 RECORDER_FILE_FORMAT_OGG, /**< OGG file format */
100 RECORDER_FILE_FORMAT_M2TS /**< MPEG2-TransportStream file format (Since 3.0) */
101 } recorder_file_format_e;
104 * @brief Enumeration for the audio codec.
108 RECORDER_AUDIO_CODEC_DISABLE = -1, /**< Disable audio track */
109 RECORDER_AUDIO_CODEC_AMR = 0, /**< AMR codec */
110 RECORDER_AUDIO_CODEC_AAC, /**< AAC codec */
111 RECORDER_AUDIO_CODEC_VORBIS, /**< Vorbis codec */
112 RECORDER_AUDIO_CODEC_PCM, /**< PCM codec */
113 RECORDER_AUDIO_CODEC_MP3 /**< MP3 codec (Since 3.0) */
114 } recorder_audio_codec_e;
117 * @brief Enumeration for the video codec.
121 RECORDER_VIDEO_CODEC_H263, /**< H263 codec */
122 RECORDER_VIDEO_CODEC_H264, /**< H264 codec */
123 RECORDER_VIDEO_CODEC_MPEG4, /**< MPEG4 codec */
124 RECORDER_VIDEO_CODEC_THEORA /**< Theora codec */
125 } recorder_video_codec_e;
128 * @brief Enumeration for audio capture devices.
132 RECORDER_AUDIO_DEVICE_MIC, /**< Mic device */
133 RECORDER_AUDIO_DEVICE_MODEM, /**< Modem */
134 } recorder_audio_device_e;
137 * @brief Enumeration for the recorder rotation type.
141 RECORDER_ROTATION_NONE, /**< No rotation */
142 RECORDER_ROTATION_90, /**< 90 degree rotation */
143 RECORDER_ROTATION_180, /**< 180 degree rotation */
144 RECORDER_ROTATION_270, /**< 270 degree rotation */
145 } recorder_rotation_e;
148 * @brief Enumeration for the recorder policy.
152 RECORDER_POLICY_NONE = 0, /**< None */
153 RECORDER_POLICY_SECURITY = 4, /**< Security policy */
154 RECORDER_POLICY_RESOURCE_CONFLICT /**< Resource conflict (Since 3.0) */
158 * @brief Enumeration for the recorder type.
162 RECORDER_TYPE_AUDIO = 0, /**< Audio only recorder */
163 RECORDER_TYPE_VIDEO /**< Video recorder (audio is optional) */
167 * @brief Enumeration for the recorder device state.
171 RECORDER_DEVICE_STATE_IDLE = 0, /**< No recording in progress */
172 RECORDER_DEVICE_STATE_RECORDING, /**< Now recording */
173 RECORDER_DEVICE_STATE_PAUSED /**< All recordings are paused */
174 } recorder_device_state_e;
177 * @brief The structure type to contain video stream data.
180 typedef camera_preview_data_s recorder_video_data_s;
187 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
192 * @brief Called when limitation error occurs while recording.
193 * @details The callback function is possible to receive three types of limits: time, size and no-space.
195 * @remarks After being called, recording data is discarded and not written in the recording file. Also the state of recorder is not changed.
196 * @param[in] type The imitation type
197 * @param[in] user_data The user data passed from the callback registration function
198 * @pre You have to register a callback using recorder_set_recording_limit_reached_cb().
199 * @see recorder_set_recording_status_cb()
200 * @see recorder_set_recording_limit_reached_cb()
201 * @see recorder_unset_recording_limit_reached_cb()
203 typedef void (*recorder_recording_limit_reached_cb)(recorder_recording_limit_type_e type, void *user_data);
206 * @brief Called to indicate the recording status.
208 * @remarks This callback function is repeatedly invoked during the #RECORDER_STATE_RECORDING state.
209 * @param[in] elapsed_time The time of the recording (milliseconds)
210 * @param[in] file_size The size of the recording file (KB)
211 * @param[in] user_data The user data passed from the callback registration function
212 * @pre recorder_start() will invoke this callback if you register it using recorder_set_recording_status_cb().
213 * @see recorder_set_recording_status_cb()
214 * @see recorder_unset_recording_status_cb()
215 * @see recorder_start()
217 typedef void (*recorder_recording_status_cb)(unsigned long long elapsed_time, unsigned long long file_size, void *user_data);
220 * @brief Called when the record state is changed.
222 * @param[in] previous The previous state of the recorder
223 * @param[in] current The current state of the recorder
224 * @param[in] by_policy @c true if the state is changed by policy, otherwise @c false if the state is not changed
225 * @param[in] user_data The user data passed from the callback registration function
226 * @pre This function is required to register a callback using recorder_set_state_changed_cb().
227 * @see recorder_set_state_changed_cb()
228 * @see recorder_prepare()
229 * @see recorder_unprepare()
230 * @see recorder_start()
231 * @see recorder_pause()
232 * @see recorder_commit()
233 * @see recorder_cancel()
235 typedef void (*recorder_state_changed_cb)(recorder_state_e previous , recorder_state_e current , bool by_policy, void *user_data);
238 * @brief Called when the recorder device state is changed.
240 * @param[in] type The recorder type
241 * @param[in] state The state of the recorder device
242 * @param[in] user_data The user data passed from the callback registration function
243 * @see recorder_add_device_state_changed_cb()
245 typedef void (*recorder_device_state_changed_cb)(recorder_type_e type, recorder_device_state_e state, void *user_data);
248 * @brief Called when the recorder is interrupted by a policy.
250 * @remarks This callback is called after interrupt handling is completed.
251 * @param[in] policy The policy that interrupted the recorder
252 * @param[in] previous The previous state of the recorder
253 * @param[in] current The current state of the recorder
254 * @param[in] user_data The user data passed from the callback registration function
255 * @see recorder_set_interrupted_cb()
257 typedef void (*recorder_interrupted_cb)(recorder_policy_e policy, recorder_state_e previous, recorder_state_e current, void *user_data);
260 * @brief Called when the recorder interrupt is started by a policy.
262 * @remarks This callback is called before interrupt handling is started.
263 * @param[in] policy The policy that is interrupting the recorder
264 * @param[in] state The current state of the recorder
265 * @param[in] user_data The user data passed from the callback registration function
266 * @see recorder_set_interrupt_started_cb()
268 typedef void (*recorder_interrupt_started_cb)(recorder_policy_e policy, recorder_state_e state, void *user_data);
271 * @brief Called when audio stream data was being delivered just before storing in the recorded file.
273 * @remarks The callback function holds the same buffer that will be recorded. \n
274 * So if the user changes the buffer, the result file will contain the buffer.
275 * @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.
276 * @param[in] stream The audio stream data
277 * @param[in] size The size of the stream data
278 * @param[in] format The audio format
279 * @param[in] channel The number of the channel
280 * @param[in] timestamp The timestamp of the stream buffer (in msec)
281 * @param[in] user_data The user data passed from the callback registration function
282 * @see recorder_set_audio_stream_cb()
284 typedef void (*recorder_audio_stream_cb)(void *stream, int size, audio_sample_type_e format, int channel, unsigned int timestamp, void *user_data);
287 * @brief Called when muxed stream data is delivered just before writing to the file.
289 * @remarks This callback receives the data that will be recorded, \n
290 * but any changes to this data will not affect the recorded file. \n
291 * The @a stream should not be freed and it's valid only in the callback. To use outside the callback, make a copy.
292 * @param[in] stream The muxed stream data
293 * @param[in] size The size of the stream data
294 * @param[in] offset The offset of the stream data
295 * @param[in] user_data The user data passed from the callback registration function
296 * @see recorder_set_muxed_stream_cb()
298 typedef void (*recorder_muxed_stream_cb)(void *stream, int size, unsigned long long offset, void *user_data);
301 * @brief Called when each video frame is delivered before encoding, \n
302 * and it will be encoded if the application returns @c true, otherwise dropped.
305 * @remarks This function is issued in the context of internal framework so the UI update code should not be directly invoked.
306 * @remarks The @a frame should not be released and it's available until the callback returns.
308 * @param[in] frame The reference pointer to video stream data
309 * @param[in] user_data The user data passed from the callback registration function
310 * @see recorder_set_video_encode_decision_cb()
312 typedef bool (*recorder_video_encode_decision_cb)(recorder_video_data_s *frame, void *user_data);
315 * @brief Called once for each supported video resolution.
317 * @param[in] width The video image width
318 * @param[in] height The video image height
319 * @param[in] user_data The user data passed from the foreach function
320 * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
321 * @pre recorder_foreach_supported_video_resolution() will invoke this callback.
322 * @see recorder_foreach_supported_video_resolution()
324 typedef bool (*recorder_supported_video_resolution_cb)(int width, int height, void *user_data);
327 * @brief Called when the error occurred.
329 * @remarks This callback informs about the critical error situation. \n
330 * When being invoked, user should release the resource and terminate the application. \n
331 * This error code will be reported.
332 * #RECORDER_ERROR_DEVICE \n
333 * #RECORDER_ERROR_INVALID_OPERATION \n
334 * #RECORDER_ERROR_OUT_OF_MEMORY.
335 * @param[in] error The error code
336 * @param[in] current_state The current state of the recorder
337 * @param[in] user_data The user data passed from the callback registration function
338 * @pre This callback function is invoked if you register this callback using recorder_set_error_cb().
339 * @see recorder_set_error_cb()
340 * @see recorder_unset_error_cb()
342 typedef void (*recorder_error_cb)(recorder_error_e error, recorder_state_e current_state, void *user_data);
349 * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
354 * @brief Called iteratively to notify about the supported file formats.
356 * @param[in] format The format of recording files
357 * @param[in] user_data The user data passed from the foreach function
358 * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
359 * @pre recorder_foreach_supported_file_format() will invoke this callback.
360 * @see recorder_foreach_supported_file_format()
362 typedef bool (*recorder_supported_file_format_cb)(recorder_file_format_e format, void *user_data);
365 * @brief Called iteratively to notify about the supported audio encoders.
367 * @param[in] codec The codec of audio encoder
368 * @param[in] user_data The user data passed from the foreach function
369 * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
370 * @pre recorder_foreach_supported_audio_encoder() will invoke this callback.
371 * @see recorder_foreach_supported_audio_encoder()
373 typedef bool (*recorder_supported_audio_encoder_cb)(recorder_audio_codec_e codec, void *user_data);
376 * @brief Called iteratively to notify about the supported video encoders.
378 * @param[in] codec The codec of video encoder
379 * @param[in] user_data The user data passed from the foreach function
380 * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
381 * @pre recorder_foreach_supported_video_encoder() will invoke this callback.
382 * @see recorder_foreach_supported_video_encoder()
384 typedef bool (*recorder_supported_video_encoder_cb)(recorder_video_codec_e codec, void *user_data);
391 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
396 * @brief Creates a recorder handle to record a video.
398 * @remarks You must release @a recorder using recorder_destroy(). \n
399 * The @a camera handle also could be used for capturing images. \n
400 * If the camera state was #CAMERA_STATE_CREATED, the preview format will be changed to the recommended preview format for recording.
401 * @remarks The created recorder state will be different according to camera state : \n
402 * #CAMERA_STATE_CREATED -> #RECORDER_STATE_CREATED\n
403 * #CAMERA_STATE_PREVIEW -> #RECORDER_STATE_READY\n
404 * #CAMERA_STATE_CAPTURED -> #RECORDER_STATE_READY
405 * @remarks The privilege %http://tizen.org/privilege/recorder is not required since 4.0,\n
406 * but it is required in all earlier versions.
407 * @remarks Since 4.0, It's related to the following feature: %http://tizen.org/feature/media.video_recording \n
408 * instead of using %http://tizen.org/feature/microphone
409 * @param[in] camera The handle to the camera
410 * @param[out] recorder A handle to the recorder
411 * @return @c 0 on success, otherwise a negative error value
412 * @retval #RECORDER_ERROR_NONE Successful
413 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
414 * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
415 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
416 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
417 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
418 * @see camera_create()
419 * @see camera_stop_preview()
420 * @see recorder_destroy()
422 int recorder_create_videorecorder(camera_h camera, recorder_h *recorder);
425 * @brief Creates a recorder handle to record an audio.
427 * @remarks You must release @a recorder using recorder_destroy().
428 * @remarks The privilege %http://tizen.org/privilege/recorder is not required since 4.0,\n
429 * but it is required in all earlier versions.
430 * @remarks Since 4.0, It's related to the following feature: %http://tizen.org/feature/media.audio_recording \n
431 * instead of using %http://tizen.org/feature/microphone
432 * @param[out] recorder A handle to the recorder
433 * @return @c 0 on success, otherwise a negative error value
434 * @retval #RECORDER_ERROR_NONE Successful
435 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
436 * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
437 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
438 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
439 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
440 * @post The recorder state will be #RECORDER_STATE_CREATED.
441 * @see recorder_destroy()
443 int recorder_create_audiorecorder(recorder_h *recorder);
447 * @brief Destroys the recorder handle.
449 * @remarks The video recorder's camera handle is not released by this function.
450 * @param[in] recorder The handle to the media recorder
451 * @return @c 0 on success, otherwise a negative error value
452 * @retval #RECORDER_ERROR_NONE Successful
453 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
454 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
455 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
456 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
457 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
458 * @pre The recorder state should be #RECORDER_STATE_CREATED.
459 * @post The recorder state will be #RECORDER_STATE_NONE.
460 * @see camera_destroy()
461 * @see recorder_create_videorecorder()
462 * @see recorder_create_audiorecorder()
464 int recorder_destroy(recorder_h recorder);
467 * @brief Prepares the media recorder for recording.
469 * @remarks Before calling the function, it is required to properly set audio encoder (recorder_set_audio_encoder()),
470 * video encoder(recorder_set_video_encoder()) and file format (recorder_set_file_format()).
471 * @param[in] recorder The handle to the media recorder
472 * @return @c 0 on success, otherwise a negative error value
473 * @retval #RECORDER_ERROR_NONE Successful
474 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
475 * @retval #RECORDER_ERROR_RESOURCE_CONFLICT Resource conflict error
476 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
477 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
478 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
479 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
480 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
481 * @pre The recorder state should be #RECORDER_STATE_CREATED by recorder_create_videorecorder(), recorder_create_audiorecorder() or recorder_unprepare().
482 * @post The recorder state will be #RECORDER_STATE_READY.
483 * @post If recorder handle is created by recorder_create_videorecorder(), the camera state will be changed to #CAMERA_STATE_PREVIEW.
484 * @see recorder_create_videorecorder()
485 * @see recorder_create_audiorecorder()
486 * @see recorder_unprepare()
487 * @see recorder_set_audio_encoder()
488 * @see recorder_set_video_encoder()
489 * @see recorder_set_file_format()
491 int recorder_prepare(recorder_h recorder);
494 * @brief Resets the media recorder.
496 * @param[in] recorder The handle to the media recorder
497 * @return @c 0 on success, otherwise a negative error value
498 * @retval #RECORDER_ERROR_NONE Successful
499 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
500 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
501 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
502 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
503 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
504 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
505 * @pre The recorder state should be #RECORDER_STATE_READY set by recorder_prepare(), recorder_cancel() or recorder_commit().
506 * @post The recorder state will be #RECORDER_STATE_CREATED.
507 * @post If the recorder handle is created by recorder_create_videorecorder(), camera state will be changed to #CAMERA_STATE_CREATED.
508 * @see recorder_prepare()
509 * @see recorder_cancel()
510 * @see recorder_commit()
512 int recorder_unprepare(recorder_h recorder);
515 * @brief Starts the recording.
518 * @privilege %http://tizen.org/privilege/recorder
519 * @remarks If file path has been set to an existing file, this file is removed automatically and updated by new one. \n
520 * In the video recorder, some preview format does not support record mode. It will return #RECORDER_ERROR_INVALID_OPERATION error. \n
521 * You should use default preview format or #CAMERA_PIXEL_FORMAT_NV12 in the record mode. \n
522 * When you want to record audio or video file, you need to add privilege according to rules below additionally. \n
523 * If you want to save contents to internal storage, you should add mediastorage privilege. \n
524 * If you want to save contents to external storage, you should add externalstorage privilege. \n
525 * The filename should be set before this function is invoked.
526 * @param[in] recorder The handle to the media recorder
527 * @return @c 0 on success, otherwise a negative error value
528 * @retval #RECORDER_ERROR_NONE Successful
529 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
530 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
531 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
532 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
533 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
534 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
535 * @pre The recorder state must be #RECORDER_STATE_READY by recorder_prepare() or #RECORDER_STATE_PAUSED by recorder_pause(). \n
536 * The filename should be set by recorder_set_filename().
537 * @post The recorder state will be #RECORDER_STATE_RECORDING.
538 * @see recorder_pause()
539 * @see recorder_commit()
540 * @see recorder_cancel()
541 * @see recorder_set_audio_encoder()
542 * @see recorder_set_filename()
543 * @see recorder_set_file_format()
544 * @see recorder_recording_status_cb()
545 * @see recorder_set_filename()
547 int recorder_start(recorder_h recorder);
550 * @brief Pauses the recording.
553 * @privilege %http://tizen.org/privilege/recorder
554 * @remarks Recording can be resumed with recorder_start().
555 * @param[in] recorder The handle to the media recorder
556 * @return @c 0 on success, otherwise a negative error value
557 * @retval #RECORDER_ERROR_NONE Successful
558 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
559 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
560 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
561 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
562 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
563 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
564 * @pre The recorder state must be #RECORDER_STATE_RECORDING.
565 * @post The recorder state will be #RECORDER_STATE_PAUSED.
566 * @see recorder_start()
567 * @see recorder_commit()
568 * @see recorder_cancel()
570 int recorder_pause(recorder_h recorder);
573 * @brief Stops recording and saves the result.
576 * @privilege %http://tizen.org/privilege/recorder
577 * @remarks When you want to record audio or video file, you need to add privilege according to rules below additionally. \n
578 * If you want to save contents to internal storage, you should add mediastorage privilege. \n
579 * If you want to save contents to external storage, you should add externalstorage privilege.
580 * @param[in] recorder The handle to the media recorder
581 * @return @c 0 on success, otherwise a negative error value
582 * @retval #RECORDER_ERROR_NONE Successful
583 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
584 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
585 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
586 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
587 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
588 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
589 * @pre The recorder state must be #RECORDER_STATE_RECORDING set by recorder_start() or #RECORDER_STATE_PAUSED by recorder_pause().
590 * @post The recorder state will be #RECORDER_STATE_READY.
591 * @see recorder_pause()
592 * @see recorder_cancel()
593 * @see recorder_set_filename()
594 * @see recorder_start()
596 int recorder_commit(recorder_h recorder);
599 * @brief Cancels the recording.
600 * @details The recording data is discarded and not written in the recording file.
603 * @privilege %http://tizen.org/privilege/recorder
604 * @remarks When you want to record audio or video file, you need to add privilege according to rules below additionally. \n
605 * If you want to save contents to internal storage, you should add mediastorage privilege. \n
606 * If you want to save contents to external storage, you should add externalstorage privilege.
607 * @param[in] recorder The handle to the media recorder
608 * @return @c 0 on success, otherwise a negative error value
609 * @retval #RECORDER_ERROR_NONE Successful
610 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
611 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
612 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
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 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
616 * @pre The recorder state must be #RECORDER_STATE_RECORDING set by recorder_start() or #RECORDER_STATE_PAUSED by recorder_pause().
617 * @post The recorder state will be #RECORDER_STATE_READY.
618 * @see recorder_pause()
619 * @see recorder_commit()
620 * @see recorder_cancel()
621 * @see recorder_start()
623 int recorder_cancel(recorder_h recorder);
626 * @brief Gets the recorder's current state.
628 * @param[in] recorder The handle to the media recorder
629 * @param[out] state The current state of the recorder
630 * @return @c 0 on success, otherwise a negative error value
631 * @retval #RECORDER_ERROR_NONE Successful
632 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
633 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
634 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
635 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
637 int recorder_get_state(recorder_h recorder, recorder_state_e *state);
640 * @brief Gets the peak audio input level that was sampled since the last call to this function.
642 * @remarks @c 0 dB indicates maximum input level, @c -300 dB indicates minimum input level.
643 * @param[in] recorder The handle to the media recorder
644 * @param[out] dB The audio input level in dB
645 * @return @c 0 on success, otherwise a negative error value
646 * @retval #RECORDER_ERROR_NONE Successful
647 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
648 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
649 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
650 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
651 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
652 * @pre The recorder state must be #RECORDER_STATE_RECORDING or #RECORDER_STATE_PAUSED.
654 int recorder_get_audio_level(recorder_h recorder, double *dB);
657 * @brief Sets the file path to record.
658 * @details This function sets file path which defines where newly recorded data should be stored.
660 * @remarks If the same file already exists in the file system, then old file will be overwritten.
661 * @param[in] recorder The handle to the media recorder
662 * @param[in] path The recording file path
663 * @return @c 0 on success, otherwise a negative error value
664 * @retval #RECORDER_ERROR_NONE Successful
665 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
666 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
667 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
668 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
669 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
670 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
671 * @see recorder_get_filename()
673 int recorder_set_filename(recorder_h recorder, const char *path);
676 * @brief Gets the file path to record.
678 * @remarks You must release @a path using free().
679 * @param[in] recorder The handle to the media recorder
680 * @param[out] path The recording file path
681 * @return @c 0 on success, otherwise a negative error value
682 * @retval #RECORDER_ERROR_NONE Successful
683 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
684 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
685 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
686 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
687 * @see recorder_set_filename()
689 int recorder_get_filename(recorder_h recorder, char **path);
692 * @brief Sets the file format for recording media stream.
694 * @remarks Since 2.3.1, it could be returned #RECORDER_ERROR_INVALID_OPERATION \n
695 * when it's audio recorder and its state is #RECORDER_STATE_READY \n
696 * because of checking codec compatibility with current encoder.
697 * @param[in] recorder The handle to the media recorder
698 * @param[in] format The media file format
699 * @return @c 0 on success, otherwise a negative error value
700 * @retval #RECORDER_ERROR_NONE Successful
701 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
702 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
703 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
704 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
705 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation (Since 2.3.1)
706 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
707 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
708 * Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
709 * @see recorder_get_file_format()
710 * @see recorder_foreach_supported_file_format()
712 int recorder_set_file_format(recorder_h recorder, recorder_file_format_e format);
716 * @brief Gets the file format for recording media stream.
718 * @param[in] recorder The handle to the media recorder
719 * @param[out] format The media file format
720 * @return @c 0 on success, otherwise a negative error value
721 * @retval #RECORDER_ERROR_NONE Successful
722 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
723 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
724 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
725 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
726 * @see recorder_set_file_format()
727 * @see recorder_foreach_supported_file_format()
729 int recorder_get_file_format(recorder_h recorder, recorder_file_format_e *format);
733 * @brief Sets the recorder's sound manager stream information.
735 * @remarks You can set sound stream information including audio routing.
736 * For more details, please refer to @ref CAPI_MEDIA_SOUND_MANAGER_MODULE
737 * @param[in] recorder The handle to the media recorder
738 * @param[in] stream_info The sound manager info
739 * @return @c 0 on success, otherwise a negative error value
740 * @retval #RECORDER_ERROR_NONE Successful
741 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
742 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
743 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
744 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY
745 * @see #sound_stream_info_h
746 * @see sound_manager_create_stream_information()
747 * @see sound_manager_destroy_stream_information()
749 int recorder_set_sound_stream_info(recorder_h recorder, sound_stream_info_h stream_info);
757 * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
762 * @brief Retrieves all supported file formats by invoking a specific callback for each supported file format.
764 * @param[in] recorder The handle to the media recorder
765 * @param[in] callback The iteration callback
766 * @param[in] user_data The user data to be passed to the callback function
767 * @return @c 0 on success, otherwise a negative error value
768 * @retval #RECORDER_ERROR_NONE Successful
769 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
770 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
771 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
772 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
773 * @post recorder_supported_file_format_cb() will be invoked.
774 * @see recorder_get_file_format()
775 * @see recorder_set_file_format()
776 * @see recorder_supported_file_format_cb()
778 int recorder_foreach_supported_file_format(recorder_h recorder, recorder_supported_file_format_cb callback, void *user_data);
785 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
790 * @brief Sets the audio codec for encoding an audio stream.
792 * @remarks You can get available audio encoders by using recorder_foreach_supported_audio_encoder(). \n
793 * If set to #RECORDER_AUDIO_CODEC_DISABLE, the audio track is not created in recording files.\n
794 * Since 2.3.1, it could be returned #RECORDER_ERROR_INVALID_OPERATION \n
795 * when it's audio recorder and its state is #RECORDER_STATE_READY \n
796 * because of checking codec compatibility with current file format.
797 * @param[in] recorder The handle to the media recorder
798 * @param[in] codec The audio codec
799 * @return @c 0 on success, otherwise a negative error value
800 * @retval #RECORDER_ERROR_NONE Successful
801 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
802 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
803 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
804 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
805 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation (Since 2.3.1)
806 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
807 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
808 * @see recorder_get_audio_encoder()
809 * @see recorder_foreach_supported_audio_encoder()
811 int recorder_set_audio_encoder(recorder_h recorder, recorder_audio_codec_e codec);
814 * @brief Gets the audio codec for encoding an audio stream.
816 * @param[in] recorder The handle to the media recorder
817 * @param[out] codec The audio codec
818 * @return @c 0 on success, otherwise a negative error value
819 * @retval #RECORDER_ERROR_NONE Successful
820 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
821 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
822 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
823 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
824 * @see recorder_set_audio_encoder()
825 * @see recorder_foreach_supported_audio_encoder()
827 int recorder_get_audio_encoder(recorder_h recorder, recorder_audio_codec_e *codec);
834 * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
839 * @brief Retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder.
841 * @param[in] recorder The handle to the media recorder
842 * @param[in] callback The iteration callback
843 * @param[in] user_data The user data to be passed to the callback function
844 * @return @c 0 on success, otherwise a negative error value
845 * @retval #RECORDER_ERROR_NONE Successful
846 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
847 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
848 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
849 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
850 * @post recorder_supported_audio_encoder_cb() will be invoked.
851 * @see recorder_set_audio_encoder()
852 * @see recorder_get_audio_encoder()
853 * @see recorder_supported_audio_encoder_cb()
855 int recorder_foreach_supported_audio_encoder(recorder_h recorder, recorder_supported_audio_encoder_cb callback, void *user_data);
862 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
867 * @brief Sets the resolution of the video recording.
869 * @remarks This function should be called before recording (recorder_start()).
870 * @param[in] recorder The handle to the media recorder
871 * @param[in] width The video width
872 * @param[in] height The video height
873 * @return @c 0 on success, otherwise a negative error value
874 * @retval #RECORDER_ERROR_NONE Successful
875 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
876 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
877 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
878 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
879 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
880 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
881 * @see recorder_start()
882 * @see recorder_get_video_resolution()
883 * @see recorder_foreach_supported_video_resolution()
885 int recorder_set_video_resolution(recorder_h recorder, int width, int height);
888 * @brief Gets the resolution of the video recording.
890 * @param[in] recorder The handle to the media recorder
891 * @param[out] width The video width
892 * @param[out] height The video height
893 * @return @c 0 on success, otherwise a negative error value
894 * @retval #RECORDER_ERROR_NONE Successful
895 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
896 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
897 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
898 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
899 * @see recorder_set_video_resolution()
900 * @see recorder_foreach_supported_video_resolution()
902 int recorder_get_video_resolution(recorder_h recorder, int *width, int *height);
909 * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
914 * @brief Retrieves all supported video resolutions by invoking callback function once for each supported video resolution.
916 * @param[in] recorder The handle to the media recorder
917 * @param[in] foreach_cb The callback function to be invoked
918 * @param[in] user_data The user data to be passed to the callback function
919 * @return @c 0 on success, otherwise a negative error value
920 * @retval #RECORDER_ERROR_NONE Successful
921 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
922 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
923 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
924 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
925 * @post This function invokes recorder_supported_video_resolution_cb() repeatedly to retrieve each supported video resolution.
926 * @see recorder_set_video_resolution()
927 * @see recorder_get_video_resolution()
928 * @see recorder_supported_video_resolution_cb()
930 int recorder_foreach_supported_video_resolution(recorder_h recorder, recorder_supported_video_resolution_cb foreach_cb, void *user_data);
937 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
942 * @brief Sets the video codec for encoding video stream.
944 * @remarks You can get available video encoders by using recorder_foreach_supported_video_encoder().
945 * @param[in] recorder The handle to the media recorder
946 * @param[in] codec The video codec
947 * @return @c 0 on success, otherwise a negative error value
948 * @retval #RECORDER_ERROR_NONE Successful
949 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
950 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
951 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
952 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
953 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
954 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
955 * @see recorder_get_video_encoder()
956 * @see recorder_foreach_supported_video_encoder()
958 int recorder_set_video_encoder(recorder_h recorder, recorder_video_codec_e codec);
961 * @brief Gets the video codec for encoding video stream.
963 * @param[in] recorder The handle to the media recorder
964 * @param[out] codec The video codec
965 * @return @c 0 on success, otherwise a negative error value
966 * @retval #RECORDER_ERROR_NONE Successful
967 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
968 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
969 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
970 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
971 * @see recorder_set_video_encoder()
972 * @see recorder_foreach_supported_video_encoder()
974 int recorder_get_video_encoder(recorder_h recorder, recorder_video_codec_e *codec);
981 * @addtogroup CAPI_MEDIA_RECORDER_CAPABILITY_MODULE
986 * @brief Retrieves all supported video encoders by invoking a specific callback for each supported video encoder.
988 * @param[in] recorder The handle to the media recorder
989 * @param[in] callback The iteration callback
990 * @param[in] user_data The user data to be passed to the callback function
991 * @return @c 0 on success, otherwise a negative error value
992 * @retval #RECORDER_ERROR_NONE Successful
993 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
994 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
995 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
996 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
997 * @post recorder_supported_video_encoder_cb() will be invoked.
998 * @see recorder_set_video_encoder()
999 * @see recorder_get_video_encoder()
1000 * @see recorder_supported_video_encoder_cb()
1002 int recorder_foreach_supported_video_encoder(recorder_h recorder, recorder_supported_video_encoder_cb callback, void *user_data);
1009 * @addtogroup CAPI_MEDIA_RECORDER_MODULE
1014 * @brief Registers the callback function that will be invoked when the recorder state changes.
1016 * @param[in] recorder The handle to the media recorder
1017 * @param[in] callback The function pointer of user callback
1018 * @param[in] user_data The user data to be passed to the callback function
1019 * @return @c 0 on success, otherwise a negative error value
1020 * @retval #RECORDER_ERROR_NONE Successful
1021 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1022 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1023 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1024 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1025 * @post recorder_state_changed_cb() will be invoked.
1026 * @see recorder_unset_state_changed_cb()
1027 * @see recorder_state_changed_cb()
1029 int recorder_set_state_changed_cb(recorder_h recorder, recorder_state_changed_cb callback, void *user_data);
1032 * @brief Unregisters the callback function.
1034 * @param[in] recorder The handle to the media recorder
1035 * @return @c 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_PERMISSION_DENIED The access to the resources can not be granted
1039 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1040 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1041 * @see recorder_set_state_changed_cb()
1043 int recorder_unset_state_changed_cb(recorder_h recorder);
1046 * @brief Registers a callback function to be called when the media recorder is interrupted according to a policy.
1048 * @param[in] recorder The handle to the media recorder
1049 * @param[in] callback The callback function to register
1050 * @param[in] user_data The user data to be passed to the callback function
1051 * @return @c 0 on success, otherwise a negative error value
1052 * @retval #RECORDER_ERROR_NONE Successful
1053 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1054 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1055 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1056 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1057 * @see recorder_unset_interrupted_cb()
1058 * @see recorder_interrupted_cb()
1060 int recorder_set_interrupted_cb(recorder_h recorder, recorder_interrupted_cb callback, void *user_data);
1063 * @brief Unregisters the callback function.
1065 * @param[in] recorder The handle to the media recorder
1066 * @return @c 0 on success, otherwise a negative error value
1067 * @retval #RECORDER_ERROR_NONE Successful
1068 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1069 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1070 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1071 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1072 * @see recorder_set_interrupted_cb()
1074 int recorder_unset_interrupted_cb(recorder_h recorder);
1077 * @brief Registers a callback function to be called when the media recorder interrupt is started according to a policy.
1079 * @param[in] recorder The handle to the media recorder
1080 * @param[in] callback The callback function to register
1081 * @param[in] user_data The user data to be passed to the callback function
1082 * @return @c 0 on success, otherwise a negative error value
1083 * @retval #RECORDER_ERROR_NONE Successful
1084 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1085 * @see recorder_unset_interrupt_started_cb()
1086 * @see recorder_interrupt_started_cb()
1088 int recorder_set_interrupt_started_cb(recorder_h recorder, recorder_interrupt_started_cb callback, void *user_data);
1091 * @brief Unregisters the callback function.
1093 * @param[in] recorder The handle to the media recorder
1094 * @return @c 0 on success, otherwise a negative error value
1095 * @retval #RECORDER_ERROR_NONE Successful
1096 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1097 * @see recorder_set_interrupt_started_cb()
1099 int recorder_unset_interrupt_started_cb(recorder_h recorder);
1102 * @brief Registers a callback function to be called when audio stream data is being delivered.
1104 * @remarks This callback function holds the same buffer that will be recorded. \n
1105 * Therefore if an user changes the buffer, the result file will have the buffer. \n
1106 * @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.\n
1107 * This callback function to be called in #RECORDER_STATE_RECORDING and #RECORDER_STATE_PAUSED state.
1109 * @param[in] recorder The handle to the recorder
1110 * @param[in] callback The callback function to register
1111 * @param[in] user_data The user data to be passed to the callback function
1112 * @return @c 0 on success, otherwise a negative error value
1113 * @retval #RECORDER_ERROR_NONE Successful
1114 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1115 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1116 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1117 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1118 * @pre The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
1119 * @see recorder_unset_audio_stream_cb()
1120 * @see recorder_audio_stream_cb()
1122 int recorder_set_audio_stream_cb(recorder_h recorder, recorder_audio_stream_cb callback, void *user_data);
1125 * @brief Unregisters the callback function.
1127 * @param[in] recorder The handle to the media recorder
1128 * @return @c 0 on success, otherwise a negative error value
1129 * @retval #RECORDER_ERROR_NONE Successful
1130 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1131 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1132 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1133 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1134 * @see recorder_set_audio_stream_cb()
1136 int recorder_unset_audio_stream_cb(recorder_h recorder);
1139 * @brief Registers a callback function to be called when muxed stream data is delivered.
1141 * @remarks This callback receives the data that will be recorded, \n
1142 * but any changes to this data will not affect the recorded file.
1143 * @param[in] recorder The handle to the recorder
1144 * @param[in] callback The callback function to register
1145 * @param[in] user_data The user data to be passed to the callback function
1146 * @return @c 0 on success, otherwise a negative error value
1147 * @retval #RECORDER_ERROR_NONE Successful
1148 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1149 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
1150 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1151 * @pre The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
1152 * @see recorder_unset_muxed_stream_cb()
1153 * @see recorder_muxed_stream_cb()
1155 int recorder_set_muxed_stream_cb(recorder_h recorder, recorder_muxed_stream_cb callback, void *user_data);
1158 * @brief Unregisters the callback function.
1160 * @param[in] recorder The handle to the media recorder
1161 * @return @c 0 on success, otherwise a negative error value
1162 * @retval #RECORDER_ERROR_NONE Successful
1163 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1164 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
1165 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1166 * @pre The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
1167 * @see recorder_set_muxed_stream_cb()
1169 int recorder_unset_muxed_stream_cb(recorder_h recorder);
1172 * @brief Registers a callback function to be called when each video frame is delivered before encoding.
1174 * @remarks The audio stream will be disabled by force if @a callback is set.
1175 * @param[in] recorder The handle to the recorder
1176 * @param[in] callback The callback function to register
1177 * @param[in] user_data The user data to be passed to the callback function
1178 * @return @c 0 on success, otherwise a negative error value
1179 * @retval #RECORDER_ERROR_NONE Successful
1180 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1181 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
1182 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1183 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1184 * @pre The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
1185 * @post The @a callback will be invoked when each video frame is delivered before encoding, \n
1186 * and it will be encoded if the @a callback returns @c true, otherwise dropped.
1187 * @see recorder_unset_video_encode_decision_cb()
1188 * @see recorder_video_encode_decision_cb()
1190 int recorder_set_video_encode_decision_cb(recorder_h recorder, recorder_video_encode_decision_cb callback, void *user_data);
1193 * @brief Unregisters the callback function.
1195 * @param[in] recorder The handle to the media recorder
1196 * @return @c 0 on success, otherwise a negative error value
1197 * @retval #RECORDER_ERROR_NONE Successful
1198 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1199 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
1200 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1201 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1202 * @pre The recorder state should be #RECORDER_STATE_READY or #RECORDER_STATE_CREATED.
1203 * @see recorder_set_video_encode_decision_cb()
1205 int recorder_unset_video_encode_decision_cb(recorder_h recorder);
1208 * @brief Registers a callback function to be invoked when the recording information changes.
1210 * @param[in] recorder The handle to the media recorder
1211 * @param[in] callback The function pointer of user callback
1212 * @param[in] user_data The user data to be passed to the callback function
1213 * @return @c 0 on success, otherwise a negative error value
1214 * @retval #RECORDER_ERROR_NONE Successful
1215 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1216 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1217 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1218 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1219 * @post recorder_recording_status_cb() will be invoked.
1220 * @see recorder_unset_recording_status_cb()
1221 * @see recorder_recording_status_cb()
1223 int recorder_set_recording_status_cb(recorder_h recorder, recorder_recording_status_cb callback, void *user_data);
1226 * @brief Unregisters the callback function.
1228 * @param[in] recorder The handle to the media recorder
1229 * @return @c 0 on success, otherwise a negative error value
1230 * @retval #RECORDER_ERROR_NONE Successful
1231 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1232 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1233 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1234 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1235 * @see recorder_set_recording_status_cb()
1237 int recorder_unset_recording_status_cb(recorder_h recorder);
1240 * @brief Registers the callback function to be run when reached the recording limit.
1242 * @param[in] recorder The handle to media recorder
1243 * @param[in] callback The function pointer of user callback
1244 * @param[in] user_data The user data to be passed to the callback function
1245 * @return @c 0 on success, otherwise a negative error value
1246 * @retval #RECORDER_ERROR_NONE Successful
1247 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1248 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1249 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1250 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1251 * @post recorder_recording_limit_reached_cb() will be invoked.
1252 * @see recorder_unset_recording_limit_reached_cb()
1253 * @see recorder_attr_set_size_limit()
1254 * @see recorder_attr_set_time_limit()
1255 * @see recorder_recording_limit_reached_cb()
1257 int recorder_set_recording_limit_reached_cb(recorder_h recorder, recorder_recording_limit_reached_cb callback, void *user_data);
1260 * @brief Unregisters the callback function.
1262 * @param[in] recorder The handle to the media recorder
1263 * @return @c 0 on success, otherwise a negative error value
1264 * @retval #RECORDER_ERROR_NONE Successful
1265 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1266 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1267 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1268 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1269 * @see recorder_set_recording_limit_reached_cb()
1271 int recorder_unset_recording_limit_reached_cb(recorder_h recorder);
1274 * @brief Registers a callback function to be called when an asynchronous operation error occurred.
1276 * @remarks This callback informs critical error situation.\n
1277 * When this callback is invoked, user should release the resource and terminate the application. \n
1278 * These error codes will occur. \n
1279 * #RECORDER_ERROR_DEVICE \n
1280 * #RECORDER_ERROR_INVALID_OPERATION \n
1281 * #RECORDER_ERROR_OUT_OF_MEMORY
1282 * @param[in] recorder The handle to the recorder
1283 * @param[in] callback The callback function to register
1284 * @param[in] user_data The user data to be passed to the callback function
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 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1291 * @post This function will invoke recorder_error_cb() when an asynchronous operation error occur.
1292 * @see recorder_unset_error_cb()
1293 * @see recorder_error_cb()
1295 int recorder_set_error_cb(recorder_h recorder, recorder_error_cb callback, void *user_data);
1299 * @brief Unregisters the callback function.
1301 * @param[in] recorder The handle to the recorder
1302 * @return @c on success, otherwise a negative error value
1303 * @retval #RECORDER_ERROR_NONE Successful
1304 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1305 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1306 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1307 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1308 * @see recorder_set_error_cb()
1310 int recorder_unset_error_cb(recorder_h recorder);
1314 * @brief Gets the state of recorder device.
1316 * @param[in] type The recorder type
1317 * @param[out] state The current state of the device
1318 * @return @c 0 on success, otherwise a negative error value
1319 * @retval #RECORDER_ERROR_NONE Successful
1320 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1321 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
1322 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1324 int recorder_get_device_state(recorder_type_e type, recorder_device_state_e *state);
1327 * @brief Registers a callback function to be called when the recorder device state changes.
1329 * @param[in] callback The callback function to register
1330 * @param[in] user_data The user data to be passed to the callback function
1331 * @param[out] cb_id The id of the registered callback
1332 * @return @c 0 on success, otherwise a negative error value
1333 * @retval #RECORDER_ERROR_NONE Successful
1334 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1335 * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
1336 * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
1337 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1338 * @post This function will invoke recorder_device_state_changed_cb() when the recorder device's state changes.
1339 * @see recorder_remove_device_state_changed_cb()
1340 * @see recorder_device_state_changed_cb()
1342 int recorder_add_device_state_changed_cb(recorder_device_state_changed_cb callback, void *user_data, int *cb_id);
1345 * @brief Unregisters a callback function.
1347 * @param[in] cb_id The id of the registered callback
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_INVALID_OPERATION Invalid operation
1352 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1353 * @see recorder_add_device_state_changed_cb()
1355 int recorder_remove_device_state_changed_cb(int cb_id);
1362 * @addtogroup CAPI_MEDIA_RECORDER_ATTRIBUTES_MODULE
1368 * @brief Sets the maximum size of a recording file.
1370 * @remarks After reaching the limitation, the recording data is discarded and not written in the recording file.
1371 * @param[in] recorder The handle to the media recorder
1372 * @param[in] kbyte The maximum size of the recording file(KB) \n
1373 * @c 0 means unlimited recording size.
1374 * @return @c 0 on success, otherwise a negative error value
1375 * @retval #RECORDER_ERROR_NONE Successful
1376 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1377 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1378 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1379 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1380 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1381 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1382 * @see recorder_attr_get_size_limit()
1383 * @see recorder_attr_set_time_limit()
1385 int recorder_attr_set_size_limit(recorder_h recorder, int kbyte);
1388 * @brief Gets the maximum size of a recording file.
1390 * @param[in] recorder The handle to the media recorder
1391 * @param[out] kbyte The maximum size of recording file (KB) \n
1392 * @c 0 means unlimited recording size.
1393 * @return @c 0 on success, otherwise a negative error value
1394 * @retval #RECORDER_ERROR_NONE Successful
1395 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1396 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1397 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1398 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1399 * @see recorder_attr_set_size_limit()
1400 * @see recorder_attr_get_time_limit()
1402 int recorder_attr_get_size_limit(recorder_h recorder, int *kbyte);
1405 * @brief Sets the time limit of a recording file.
1407 * @remarks After reaching the limitation, the recording data is discarded and not written in the recording file.
1408 * @param[in] recorder The handle to the media recorder
1409 * @param[in] second The time limit of the recording file (in seconds) \n
1410 * @c 0 means unlimited recording size.
1411 * @return @c 0 on success, otherwise a negative error value
1412 * @retval #RECORDER_ERROR_NONE Successful
1413 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1414 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1415 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1416 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1417 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1418 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1419 * @see recorder_attr_get_time_limit()
1420 * @see recorder_attr_set_size_limit()
1422 int recorder_attr_set_time_limit(recorder_h recorder, int second);
1426 * @brief Gets the time limit of a recording file.
1428 * @param[in] recorder The handle to the media recorder
1429 * @param[out] second The time limit of the recording file (in seconds) \n
1430 * @c 0 means unlimited recording time.
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 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1437 * @see recorder_attr_set_time_limit()
1438 * @see recorder_attr_get_size_limit()
1440 int recorder_attr_get_time_limit(recorder_h recorder, int *second);
1443 * @brief Sets the audio device for recording.
1445 * @param[in] recorder The handle to the media recorder
1446 * @param[in] device The type of an audio device
1447 * @return @c 0 on success, otherwise a negative error value
1448 * @retval #RECORDER_ERROR_NONE Successful
1449 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1450 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1451 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1452 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1453 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1454 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
1455 * Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
1456 * @see recorder_attr_get_audio_device()
1458 int recorder_attr_set_audio_device(recorder_h recorder, recorder_audio_device_e device);
1461 * @brief Gets the audio device for recording.
1463 * @param[in] recorder The handle to the media recorder
1464 * @param[out] device The type of an audio device
1465 * @return @c 0 on success, otherwise a negative error value
1466 * @retval #RECORDER_ERROR_NONE Successful
1467 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1468 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1469 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1470 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1471 * @see recorder_attr_set_audio_device()
1473 int recorder_attr_get_audio_device(recorder_h recorder, recorder_audio_device_e *device);
1476 * @brief Sets the sampling rate of an audio stream.
1478 * @param[in] recorder The handle to the media recorder
1479 * @param[in] samplerate The sample rate in Hertz
1480 * @return @c 0 on success, otherwise a negative error value
1481 * @retval #RECORDER_ERROR_NONE Successful
1482 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1483 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1484 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1485 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1486 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1487 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
1488 * Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
1489 * @see recorder_attr_get_audio_samplerate()
1491 int recorder_attr_set_audio_samplerate(recorder_h recorder, int samplerate);
1494 * @brief Gets the sampling rate of an audio stream.
1496 * @param[in] recorder The handle to the media recorder
1497 * @param[out] samplerate The sample rate in Hertz
1498 * @return @c 0 on success, otherwise a negative error value
1499 * @retval #RECORDER_ERROR_NONE Successful
1500 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1501 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1502 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1503 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1504 * @see recorder_attr_set_audio_samplerate()
1506 int recorder_attr_get_audio_samplerate(recorder_h recorder, int *samplerate);
1509 * @brief Sets the bitrate of an audio encoder.
1511 * @param[in] recorder The handle to the media recorder
1512 * @param[in] bitrate The bitrate (for mms : 12200[bps], normal : 288000[bps])
1513 * @return @c 0 on success, otherwise a negative error value
1514 * @retval #RECORDER_ERROR_NONE Successful
1515 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1516 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1517 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1518 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1519 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1520 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1521 * @see recorder_attr_get_audio_encoder_bitrate()
1523 int recorder_attr_set_audio_encoder_bitrate(recorder_h recorder, int bitrate);
1526 * @brief Sets the bitrate of a video encoder.
1528 * @param[in] recorder The handle to the media recorder
1529 * @param[in] bitrate The bitrate in bits per second
1530 * @return @c 0 on success, otherwise a negative error value
1531 * @retval #RECORDER_ERROR_NONE Successful
1532 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1533 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1534 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1535 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1536 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1537 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1538 * @see recorder_attr_get_video_encoder_bitrate()
1540 int recorder_attr_set_video_encoder_bitrate(recorder_h recorder, int bitrate);
1543 * @brief Gets the bitrate of an audio encoder.
1545 * @param[in] recorder The handle to the media recorder
1546 * @param[out] bitrate The bitrate in bits per second
1547 * @return @c 0 on success, otherwise a negative error value
1548 * @retval #RECORDER_ERROR_NONE Successful
1549 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1550 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1551 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1552 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1553 * @see recorder_attr_set_audio_encoder_bitrate()
1555 int recorder_attr_get_audio_encoder_bitrate(recorder_h recorder, int *bitrate);
1558 * @brief Gets the bitrate of a video encoder.
1560 * @param[in] recorder The handle to the media recorder
1561 * @param[out] bitrate The bitrate in bits per second
1562 * @return @c 0 on success, otherwise a negative error value
1563 * @retval #RECORDER_ERROR_NONE Successful
1564 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1565 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1566 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1567 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1568 * @see recorder_attr_set_audio_encoder_bitrate()
1570 int recorder_attr_get_video_encoder_bitrate(recorder_h recorder, int *bitrate);
1573 * @brief Sets the mute state of a recorder.
1575 * @param[in] recorder The handle to the media recorder
1576 * @param[in] enable The mute state
1577 * @return @c 0 on success, otherwise a negative error value
1578 * @retval #RECORDER_ERROR_NONE Successful
1579 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1580 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1581 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1582 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1583 * @see recorder_attr_is_muted()
1585 int recorder_attr_set_mute(recorder_h recorder, bool enable);
1588 * @brief Gets the mute state of a recorder.
1590 * @param[in] recorder The handle to the media recorder
1591 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1592 * @return @c true if the recorder is not recording any sound,
1593 * otherwise @c false if the recorder is recording
1594 * @exception #RECORDER_ERROR_NONE Successful
1595 * @exception #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1596 * @exception #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1597 * @exception #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1598 * @see recorder_attr_set_mute()
1600 bool recorder_attr_is_muted(recorder_h recorder);
1603 * @brief Sets the recording motion rate.
1605 * @remarks This attribute is valid only in a video recorder. \n
1606 * If the rate bigger than @c 0 and smaller than @c 1, video is recorded in a slow motion mode. \n
1607 * If the rate bigger than @c 1, video is recorded in a fast motion mode (time lapse recording).
1608 * @remarks Audio data is not recorded. \n
1609 * To reset slow motion recording, set the rate to @c 1.
1610 * @param[in] recorder The handle to the media recorder
1611 * @param[in] rate The recording motion rate \n
1612 * 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).
1613 * @return @c 0 on success, otherwise a negative error value
1614 * @retval #RECORDER_ERROR_NONE Successful
1615 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1616 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1617 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1618 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1619 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1620 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
1621 * @see recorder_attr_get_recording_motion_rate()
1623 int recorder_attr_set_recording_motion_rate(recorder_h recorder , double rate);
1626 * @brief Gets the recording motion rate.
1628 * @remarks This attribute is valid only in a video recorder. \n
1629 * If the rate bigger than @c 0 and smaller than @c 1, video is recorded in a slow motion mode. \n
1630 * If the rate bigger than @c 1, video is recorded in a fast motion mode (time lapse recording).
1631 * @remarks Audio data is not recorded. \n
1632 * To reset slow motion recording, set the rate to @c 1.
1633 * @param[in] recorder The handle to the media recorder
1634 * @param[out] rate The recording motion rate \n
1635 * It is computed with fps.
1636 * @return @c 0 on success, otherwise a negative error value
1637 * @retval #RECORDER_ERROR_NONE Successful
1638 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1639 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1640 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1641 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1642 * @see recorder_attr_set_recording_motion_rate()
1644 int recorder_attr_get_recording_motion_rate(recorder_h recorder , double *rate);
1647 * @brief Sets the number of the audio channel.
1649 * @remarks This attribute is applied only in #RECORDER_STATE_CREATED state. \n
1650 * For mono recording, setting channel to @c 1. \n
1651 * For stereo recording, setting channel to @c 2.
1652 * @param[in] recorder The handle to the media recorder
1653 * @param[in] channel_count The number of the audio channel
1654 * @return @c 0 on success, otherwise a negative error value
1655 * @retval #RECORDER_ERROR_NONE Successful
1656 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1657 * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
1658 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1659 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1660 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1661 * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY (for video recorder only).\n
1662 * Since 2.3.1, this API also works for audio recorder when its state is #RECORDER_STATE_READY.
1663 * @see recorder_attr_get_audio_channel()
1665 int recorder_attr_set_audio_channel(recorder_h recorder, int channel_count);
1668 * @brief Gets the number of the audio channel.
1670 * @param[in] recorder The handle to the media recorder
1671 * @param[out] channel_count The number of the audio channel
1672 * @return @c 0 on success, otherwise a negative error value
1673 * @retval #RECORDER_ERROR_NONE Successful
1674 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1675 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1676 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1677 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1678 * @see recorder_attr_set_audio_channel()
1680 int recorder_attr_get_audio_channel(recorder_h recorder, int *channel_count);
1684 * @brief Sets the video orientation in a video metadata tag.
1686 * @param[in] recorder The handle to a media recorder
1687 * @param[in] orientation The information of the video orientation
1688 * @return @c 0 on success, otherwise a negative error value
1689 * @retval #RECORDER_ERROR_NONE Successful
1690 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1691 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1692 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1693 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1694 * @see recorder_attr_get_orientation_tag()
1696 int recorder_attr_set_orientation_tag(recorder_h recorder, recorder_rotation_e orientation);
1699 * @brief Gets the video orientation in a video metadata tag.
1701 * @param[in] recorder The handle to a media recorder
1702 * @param[out] orientation The information of the video orientation
1703 * @return @c 0 on success, otherwise a negative error value
1704 * @retval #RECORDER_ERROR_NONE Successful
1705 * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
1706 * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
1707 * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
1708 * @retval #RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
1709 * @see recorder_attr_set_orientation_tag()
1711 int recorder_attr_get_orientation_tag(recorder_h recorder, recorder_rotation_e *orientation);
1721 #endif /* __TIZEN_MULTIMEDIA_RECORDER_H__ */