Tizen Native API
7.0
|
The Attributes API provides functions for getting and setting recorder attributes.
Required Header
#include <recorder.h>
Overview
The Media Recorder API provides basic recorder attribute manipulators.
The Recorder Attributes API provides functions to set and get basic recorder attributes:
- File size limit
- Recording time limit
- Audio recording device
- Audio sample rate
- Audio encoder bit rate
- Video encoder bit rate
Each of these attributes have a get/set pair of functions. For example, recorder_attr_set_time_limit() and recorder_attr_get_time_limit(). For more detailed information and programming examples for this API, see the Multimedia Tutorial.
Related Features
This API is related with the following features:
- http://tizen.org/feature/media.audio_recording
- http://tizen.org/feature/media.video_recording
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | recorder_attr_set_size_limit (recorder_h recorder, int kbyte) |
Sets the maximum size of a recording file. | |
int | recorder_attr_get_size_limit (recorder_h recorder, int *kbyte) |
Gets the maximum size of a recording file. | |
int | recorder_attr_set_time_limit (recorder_h recorder, int second) |
Sets the time limit of a recording file. | |
int | recorder_attr_get_time_limit (recorder_h recorder, int *second) |
Gets the time limit of a recording file. | |
int | recorder_attr_set_audio_device (recorder_h recorder, recorder_audio_device_e device) |
Sets the audio device for recording. | |
int | recorder_attr_get_audio_device (recorder_h recorder, recorder_audio_device_e *device) |
Gets the audio device for recording. | |
int | recorder_attr_set_audio_samplerate (recorder_h recorder, int samplerate) |
Sets the sampling rate of an audio stream. | |
int | recorder_attr_get_audio_samplerate (recorder_h recorder, int *samplerate) |
Gets the sampling rate of an audio stream. | |
int | recorder_attr_set_audio_encoder_bitrate (recorder_h recorder, int bitrate) |
Sets the bitrate of an audio encoder. | |
int | recorder_attr_set_video_encoder_bitrate (recorder_h recorder, int bitrate) |
Sets the bitrate of a video encoder. | |
int | recorder_attr_get_audio_encoder_bitrate (recorder_h recorder, int *bitrate) |
Gets the bitrate of an audio encoder. | |
int | recorder_attr_get_video_encoder_bitrate (recorder_h recorder, int *bitrate) |
Gets the bitrate of a video encoder. | |
int | recorder_attr_set_mute (recorder_h recorder, bool enable) |
Sets the mute state of a recorder. | |
bool | recorder_attr_is_muted (recorder_h recorder) |
Gets the mute state of a recorder. | |
int | recorder_attr_set_recording_motion_rate (recorder_h recorder, double rate) |
Sets the recording motion rate. | |
int | recorder_attr_get_recording_motion_rate (recorder_h recorder, double *rate) |
Gets the recording motion rate. | |
int | recorder_attr_set_audio_channel (recorder_h recorder, int channel_count) |
Sets the number of the audio channel. | |
int | recorder_attr_get_audio_channel (recorder_h recorder, int *channel_count) |
Gets the number of the audio channel. | |
int | recorder_attr_set_orientation_tag (recorder_h recorder, recorder_rotation_e orientation) |
Sets the video orientation in a video metadata tag. | |
int | recorder_attr_get_orientation_tag (recorder_h recorder, recorder_rotation_e *orientation) |
Gets the video orientation in a video metadata tag. |
Function Documentation
int recorder_attr_get_audio_channel | ( | recorder_h | recorder, |
int * | channel_count | ||
) |
Gets the number of the audio channel.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] channel_count The number of the audio channel
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- See also:
- recorder_attr_set_audio_channel()
int recorder_attr_get_audio_device | ( | recorder_h | recorder, |
recorder_audio_device_e * | device | ||
) |
Gets the audio device for recording.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] device The type of an audio device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- See also:
- recorder_attr_set_audio_device()
int recorder_attr_get_audio_encoder_bitrate | ( | recorder_h | recorder, |
int * | bitrate | ||
) |
Gets the bitrate of an audio encoder.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] bitrate The bitrate in bits per second
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
int recorder_attr_get_audio_samplerate | ( | recorder_h | recorder, |
int * | samplerate | ||
) |
Gets the sampling rate of an audio stream.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] samplerate The sample rate in Hertz
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- See also:
- recorder_attr_set_audio_samplerate()
int recorder_attr_get_orientation_tag | ( | recorder_h | recorder, |
recorder_rotation_e * | orientation | ||
) |
Gets the video orientation in a video metadata tag.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to a media recorder [out] orientation The information of the video orientation
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- See also:
- recorder_attr_set_orientation_tag()
int recorder_attr_get_recording_motion_rate | ( | recorder_h | recorder, |
double * | rate | ||
) |
Gets the recording motion rate.
- Since :
- 2.3
- Remarks:
- This attribute is valid only in a video recorder.
If the rate bigger than0
and smaller than1
, video is recorded in a slow motion mode.
If the rate bigger than1
, video is recorded in a fast motion mode (time lapse recording). -
Audio data is not recorded.
To reset slow motion recording, set the rate to1
.
- Parameters:
-
[in] recorder The handle to the media recorder [out] rate The recording motion rate
It is computed with fps.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
int recorder_attr_get_size_limit | ( | recorder_h | recorder, |
int * | kbyte | ||
) |
Gets the maximum size of a recording file.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] kbyte The maximum size of recording file (KB)
0
means unlimited recording size.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
int recorder_attr_get_time_limit | ( | recorder_h | recorder, |
int * | second | ||
) |
Gets the time limit of a recording file.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] second The time limit of the recording file (in seconds)
0
means unlimited recording time.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
int recorder_attr_get_video_encoder_bitrate | ( | recorder_h | recorder, |
int * | bitrate | ||
) |
Gets the bitrate of a video encoder.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [out] bitrate The bitrate in bits per second
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
bool recorder_attr_is_muted | ( | recorder_h | recorder | ) |
Gets the mute state of a recorder.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Returns:
true
if the recorder is not recording any sound, otherwisefalse
if the recorder is recording
- Exceptions:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
- See also:
- recorder_attr_set_mute()
int recorder_attr_set_audio_channel | ( | recorder_h | recorder, |
int | channel_count | ||
) |
Sets the number of the audio channel.
- Since :
- 2.3
- Remarks:
- This attribute is applied only in RECORDER_STATE_CREATED state.
For mono recording, setting channel to1
.
For stereo recording, setting channel to2
.
- Parameters:
-
[in] recorder The handle to the media recorder [in] channel_count The number of the audio channel
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY (for video recorder only).
Since 2.3.1, this API also works for audio recorder when its state is RECORDER_STATE_READY.
- See also:
- recorder_attr_get_audio_channel()
int recorder_attr_set_audio_device | ( | recorder_h | recorder, |
recorder_audio_device_e | device | ||
) |
Sets the audio device for recording.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [in] device The type of an audio device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY (for video recorder only).
Since 2.3.1, this API also works for audio recorder when its state is RECORDER_STATE_READY.
- See also:
- recorder_attr_get_audio_device()
int recorder_attr_set_audio_encoder_bitrate | ( | recorder_h | recorder, |
int | bitrate | ||
) |
Sets the bitrate of an audio encoder.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [in] bitrate The bitrate (for mms : 12200[bps], normal : 288000[bps])
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY.
int recorder_attr_set_audio_samplerate | ( | recorder_h | recorder, |
int | samplerate | ||
) |
Sets the sampling rate of an audio stream.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [in] samplerate The sample rate in Hertz
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY (for video recorder only).
Since 2.3.1, this API also works for audio recorder when its state is RECORDER_STATE_READY.
- See also:
- recorder_attr_get_audio_samplerate()
int recorder_attr_set_mute | ( | recorder_h | recorder, |
bool | enable | ||
) |
Sets the mute state of a recorder.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [in] enable The mute state
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- See also:
- recorder_attr_is_muted()
int recorder_attr_set_orientation_tag | ( | recorder_h | recorder, |
recorder_rotation_e | orientation | ||
) |
Sets the video orientation in a video metadata tag.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to a media recorder [in] orientation The information of the video orientation
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- See also:
- recorder_attr_get_orientation_tag()
int recorder_attr_set_recording_motion_rate | ( | recorder_h | recorder, |
double | rate | ||
) |
Sets the recording motion rate.
- Since :
- 2.3
- Remarks:
- This attribute is valid only in a video recorder.
If the rate bigger than0
and smaller than1
, video is recorded in a slow motion mode.
If the rate bigger than1
, video is recorded in a fast motion mode (time lapse recording). -
Audio data is not recorded.
To reset slow motion recording, set the rate to1
.
- Parameters:
-
[in] recorder The handle to the media recorder [in] rate The recording motion rate
It is computed with fps. (0<rate<
slow motion,1
for1<rate
for fast motion(time lapse recording),1
to reset).
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY.
int recorder_attr_set_size_limit | ( | recorder_h | recorder, |
int | kbyte | ||
) |
Sets the maximum size of a recording file.
- Since :
- 2.3
- Remarks:
- After reaching the limitation, the recording data is discarded and not written in the recording file.
- Parameters:
-
[in] recorder The handle to the media recorder [in] kbyte The maximum size of the recording file(KB)
0
means unlimited recording size.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY.
int recorder_attr_set_time_limit | ( | recorder_h | recorder, |
int | second | ||
) |
Sets the time limit of a recording file.
- Since :
- 2.3
- Remarks:
- After reaching the limitation, the recording data is discarded and not written in the recording file.
- Parameters:
-
[in] recorder The handle to the media recorder [in] second The time limit of the recording file (in seconds)
0
means unlimited recording size.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY.
int recorder_attr_set_video_encoder_bitrate | ( | recorder_h | recorder, |
int | bitrate | ||
) |
Sets the bitrate of a video encoder.
- Since :
- 2.3
- Parameters:
-
[in] recorder The handle to the media recorder [in] bitrate The bitrate in bits per second
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RECORDER_ERROR_NONE Successful RECORDER_ERROR_INVALID_PARAMETER Invalid parameter RECORDER_ERROR_INVALID_STATE Invalid state RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted RECORDER_ERROR_NOT_SUPPORTED The feature is not supported RECORDER_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
- Precondition:
- The recorder state must be RECORDER_STATE_CREATED or RECORDER_STATE_READY.