Tizen Native API
3.0
|
The Attributes API provides functions to fetch StreamRecorder attributes.
Required Header
#include <streamrecorder.h>
Overview
The StreamRecorder Attributes API provides functions to get/set basic StreamRecorder attributes.
With the StreamRecorder Attributes API you are able to set and get StreamRecorder attributes like:
- File name
- File format
- Audio encoder
- Video encoder
- Recording size limit
- Recording time limit
- Audio samplerate
- Audio encoder bitrate
- Video encoder bitrate
- Audio channel
Functions | |
int | streamrecorder_set_filename (streamrecorder_h recorder, const char *path) |
Sets the file path to record. | |
int | streamrecorder_get_filename (streamrecorder_h recorder, char **path) |
Gets the file path to record. | |
int | streamrecorder_set_file_format (streamrecorder_h recorder, streamrecorder_file_format_e format) |
Sets the file format for recording media stream. | |
int | streamrecorder_get_file_format (streamrecorder_h recorder, streamrecorder_file_format_e *format) |
Gets the file format for recording media stream. | |
int | streamrecorder_set_audio_encoder (streamrecorder_h recorder, streamrecorder_audio_codec_e codec) |
Sets the audio codec for encoding an audio stream. | |
int | streamrecorder_get_audio_encoder (streamrecorder_h recorder, streamrecorder_audio_codec_e *codec) |
Gets the audio codec for encoding an audio stream. | |
int | streamrecorder_set_video_resolution (streamrecorder_h recorder, int width, int height) |
Sets the resolution of the video recording. | |
int | streamrecorder_get_video_resolution (streamrecorder_h recorder, int *width, int *height) |
Gets the resolution of the video recording. | |
int | streamrecorder_set_video_encoder (streamrecorder_h recorder, streamrecorder_video_codec_e codec) |
Sets the video codec for encoding video stream. | |
int | streamrecorder_get_video_encoder (streamrecorder_h recorder, streamrecorder_video_codec_e *codec) |
Gets the video codec for encoding video stream. | |
int | streamrecorder_set_video_framerate (streamrecorder_h recorder, int framerate) |
Sets the recording frame rate. | |
int | streamrecorder_get_video_framerate (streamrecorder_h recorder, int *framerate) |
Gets the recording frame rate. | |
int | streamrecorder_set_video_source_format (streamrecorder_h recorder, streamrecorder_video_source_format_e format) |
Sets the video source format. | |
int | streamrecorder_get_video_source_format (streamrecorder_h recorder, streamrecorder_video_source_format_e *format) |
Gets the video source format. | |
int | streamrecorder_set_recording_limit (streamrecorder_h recorder, streamrecorder_recording_limit_type_e type, int limit) |
Sets the maximum size of a recording file. | |
int | streamrecorder_get_recording_limit (streamrecorder_h recorder, streamrecorder_recording_limit_type_e type, int *limit) |
Gets the maximum size of a recording file. | |
int | streamrecorder_set_audio_samplerate (streamrecorder_h recorder, int samplerate) |
Sets the sampling rate of an audio stream. | |
int | streamrecorder_get_audio_samplerate (streamrecorder_h recorder, int *samplerate) |
Gets the sampling rate of an audio stream. | |
int | streamrecorder_set_audio_encoder_bitrate (streamrecorder_h recorder, int bitrate) |
Sets the bitrate of an audio encoder. | |
int | streamrecorder_set_video_encoder_bitrate (streamrecorder_h recorder, int bitrate) |
Sets the bitrate of a video encoder. | |
int | streamrecorder_get_audio_encoder_bitrate (streamrecorder_h recorder, int *bitrate) |
Gets the bitrate of an audio encoder. | |
int | streamrecorder_get_video_encoder_bitrate (streamrecorder_h recorder, int *bitrate) |
Gets the bitrate of a video encoder. | |
int | streamrecorder_set_audio_channel (streamrecorder_h recorder, int channel_count) |
Sets the number of the audio channel. | |
int | streamrecorder_get_audio_channel (streamrecorder_h recorder, int *channel_count) |
Gets the number of the audio channel. |
Function Documentation
int streamrecorder_get_audio_channel | ( | streamrecorder_h | recorder, |
int * | channel_count | ||
) |
Gets the number of the audio channel.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] channel_count The number of the audio channel
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
- See also:
- streamrecorder_set_audio_channel()
int streamrecorder_get_audio_encoder | ( | streamrecorder_h | recorder, |
streamrecorder_audio_codec_e * | codec | ||
) |
Gets the audio codec for encoding an audio stream.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] codec The audio codec
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_NOT_SUPPORTED The feature is not supported
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_audio_encoder_bitrate | ( | streamrecorder_h | recorder, |
int * | bitrate | ||
) |
Gets the bitrate of an audio encoder.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] bitrate The bitrate in bits per second
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_audio_samplerate | ( | streamrecorder_h | recorder, |
int * | samplerate | ||
) |
Gets the sampling rate of an audio stream.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] samplerate The sample rate in Hertz
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_file_format | ( | streamrecorder_h | recorder, |
streamrecorder_file_format_e * | format | ||
) |
Gets the file format for recording media stream.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] format The media file format
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_filename | ( | streamrecorder_h | recorder, |
char ** | path | ||
) |
Gets the file path to record.
- Since :
- 3.0
- Remarks:
- You must release path using free().
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] path The recording file path
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter streamrecorder_enable_source_buffer() should be invoked before this function.
- See also:
- streamrecorder_set_filename()
int streamrecorder_get_recording_limit | ( | streamrecorder_h | recorder, |
streamrecorder_recording_limit_type_e | type, | ||
int * | limit | ||
) |
Gets the maximum size of a recording file.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] type The recording limit type [out] limit If limit type is STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, the limit value is the maximum size of the recording file(KB),
otherwise limit value is the maximum time of the recording file (in seconds)
0
means unlimited recording size or time.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
- See also:
- streamrecorder_set_recording_limit()
int streamrecorder_get_video_encoder | ( | streamrecorder_h | recorder, |
streamrecorder_video_codec_e * | codec | ||
) |
Gets the video codec for encoding video stream.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] codec The video codec
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_NOT_SUPPORTED The feature is not supported
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_video_encoder_bitrate | ( | streamrecorder_h | recorder, |
int * | bitrate | ||
) |
Gets the bitrate of a video encoder.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] bitrate The bitrate in bits per second
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_video_framerate | ( | streamrecorder_h | recorder, |
int * | framerate | ||
) |
Gets the recording frame rate.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the camera [out] framerate The frame rate for recording that already is set
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- streamrecorder_set_video_framerate()
int streamrecorder_get_video_resolution | ( | streamrecorder_h | recorder, |
int * | width, | ||
int * | height | ||
) |
Gets the resolution of the video recording.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] width The video width [out] height The video height
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_NOT_SUPPORTED The feature is not supported
- Precondition:
- The streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_get_video_source_format | ( | streamrecorder_h | recorder, |
streamrecorder_video_source_format_e * | format | ||
) |
Gets the video source format.
- Since :
- 3.0
- Remarks:
- This function should be called before prepared state.
- Parameters:
-
[in] recorder The handle to the streamrecorder [out] format The color type of video source that already is set
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter
int streamrecorder_set_audio_channel | ( | streamrecorder_h | recorder, |
int | channel_count | ||
) |
Sets the number of the audio channel.
- Since :
- 3.0
- Remarks:
- This attribute is applied only in STREAMRECORDER_STATE_CREATED state.
For mono recording, setting channel to1
.
For stereo recording, setting channel to2
.
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] channel_count The number of the audio channel
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
- See also:
- streamrecorder_get_audio_channel()
int streamrecorder_set_audio_encoder | ( | streamrecorder_h | recorder, |
streamrecorder_audio_codec_e | codec | ||
) |
Sets the audio codec for encoding an audio stream.
- Since :
- 3.0
- Remarks:
- You can get available audio encoders by using streamrecorder_foreach_supported_audio_encoder().
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] codec The audio codec
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state STREAMRECORDER_ERROR_NOT_SUPPORTED The feature is not supported STREAMRECORDER_ERROR_INVALID_OPERATION Invalid operation
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_audio_encoder_bitrate | ( | streamrecorder_h | recorder, |
int | bitrate | ||
) |
Sets the bitrate of an audio encoder.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] bitrate The bitrate (for mms : 12200[bps], normal : 288000[bps])
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_audio_samplerate | ( | streamrecorder_h | recorder, |
int | samplerate | ||
) |
Sets the sampling rate of an audio stream.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] samplerate The sample rate in Hertz
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_file_format | ( | streamrecorder_h | recorder, |
streamrecorder_file_format_e | format | ||
) |
Sets the file format for recording media stream.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] format The media file format
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state STREAMRECORDER_ERROR_INVALID_OPERATION Invalid operation
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_filename | ( | streamrecorder_h | recorder, |
const char * | path | ||
) |
Sets the file path to record.
This function sets file path which defines where newly recorded data should be stored.
- Since :
- 3.0
- Remarks:
- If the same file already exists in the file system, then old file will be overwritten.
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] path The recording file path
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
- See also:
- streamrecorder_get_filename()
int streamrecorder_set_recording_limit | ( | streamrecorder_h | recorder, |
streamrecorder_recording_limit_type_e | type, | ||
int | limit | ||
) |
Sets the maximum size of a recording file.
- Since :
- 3.0
- Remarks:
- After reaching the limitation, the recording data is discarded and not written in the recording file.
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] type The recording limit type [in] limit If limit type is STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, the limit value is the maximum size of the recording file(KB),
otherwise limit value is the maximum time of the recording file (in seconds)
0
means unlimited recording size or time.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
- See also:
- streamrecorder_get_recording_limit()
int streamrecorder_set_video_encoder | ( | streamrecorder_h | recorder, |
streamrecorder_video_codec_e | codec | ||
) |
Sets the video codec for encoding video stream.
- Since :
- 3.0
- Remarks:
- You can get available video encoders by using recorder_foreach_supported_video_encoder().
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] codec The video codec
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state STREAMRECORDER_ERROR_NOT_SUPPORTED The feature is not supported
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_video_encoder_bitrate | ( | streamrecorder_h | recorder, |
int | bitrate | ||
) |
Sets the bitrate of a video encoder.
- Since :
- 3.0
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] bitrate The bitrate in bits per second
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_video_framerate | ( | streamrecorder_h | recorder, |
int | framerate | ||
) |
Sets the recording frame rate.
- Since :
- 3.0
- Remarks:
- This function should be called before prepared state.
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] framerate The frame rate for recording
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state
- See also:
- streamrecorder_get_video_framerate()
int streamrecorder_set_video_resolution | ( | streamrecorder_h | recorder, |
int | width, | ||
int | height | ||
) |
Sets the resolution of the video recording.
- Since :
- 3.0
- Remarks:
- This function should be called before recording (streamrecorder_start()).
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] width The input width [in] height The input height
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state STREAMRECORDER_ERROR_NOT_SUPPORTED The feature is not supported
- Precondition:
- The streamrecorder state must be STREAMRECORDER_STATE_CREATED.
streamrecorder_enable_source_buffer() should be invoked before this function.
int streamrecorder_set_video_source_format | ( | streamrecorder_h | recorder, |
streamrecorder_video_source_format_e | format | ||
) |
Sets the video source format.
- Since :
- 3.0
- Remarks:
- This function should be called before prepared state.
- Parameters:
-
[in] recorder The handle to the streamrecorder [in] format The color type of video source
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
STREAMRECORDER_ERROR_NONE Successful STREAMRECORDER_ERROR_INVALID_PARAMETER Invalid parameter STREAMRECORDER_ERROR_INVALID_STATE Invalid state