#include <fcntl.h>
-#define LOWSET_DECIBEL -300.0
int __convert_streamrecorder_error_code(const char *func, int code)
{
int _streamrecorder_set_videosource_buffer(streamrecorder_h recorder)
{
int ret = STREAMRECORDER_ERROR_NONE;
- if (recorder == NULL)
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
int _streamrecorder_set_audiosource_buffer(streamrecorder_h recorder)
{
int ret = STREAMRECORDER_ERROR_NONE;
- if (recorder == NULL)
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
streamrecorder_s *handle;
handle = (streamrecorder_s *) recorder;
int ret = STREAMRECORDER_ERROR_NONE;
MMStreamRecorderStateType srstate;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (state == NULL) {
LOGE("NULL pointer state");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
-
ret = mm_streamrecorder_get_state(handle->mm_handle, &srstate);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
streamrecorder_s *handle = NULL;
int ret = MM_ERROR_NONE;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
handle = (streamrecorder_s *)recorder;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
ret = streamrecorder_get_state(recorder, &state);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
ret = streamrecorder_get_state(recorder, &state);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
ret = streamrecorder_get_state(recorder, &state);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
ret = streamrecorder_get_state(recorder, &state);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
ret = streamrecorder_get_state(recorder, &state);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
ret = streamrecorder_get_state(recorder, &state);
if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
ret = mm_streamrecorder_set_attributes(handle->mm_handle, NULL,
MMSTR_VIDEO_FRAMERATE, framerate,
NULL);
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (framerate == NULL)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
- if (handle == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
streamrecorder_get_state(recorder, &state);
if (state > STREAMRECORDER_STATE_CREATED) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (!handle) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
-
if (!width || !height) {
LOGE("NULL pointer width = [%p], height = [%p]", width, height);
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s * handle = (streamrecorder_s *)recorder;
- if (!handle) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
-
if (!foreach_cb) {
LOGE("NULL pointer callback");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (filename == NULL) {
LOGE("filename is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int record_filename_size;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (filename == NULL) {
LOGE("filename is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
MM_FILE_FORMAT_AAC, /* STREAMRECORDER_FILE_FORMAT_ADTS */
MM_FILE_FORMAT_WAV, /* STREAMRECORDER_FILE_FORMAT_WAV */
};
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (format > STREAMRECORDER_FILE_FORMAT_WAV) {
LOGE("invalid format %d", format);
streamrecorder_s *handle = (streamrecorder_s *)recorder;
int mm_format;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (format == NULL) {
LOGE("format is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
int format;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (foreach_cb == NULL) {
LOGE("NULL pointer foreach_cb");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (kbyte < 0)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("NULL pointer handle");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (second < 0)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
MM_AUDIO_CODEC_WAVE /* STREAMRECORDER_AUDIO_CODEC_PCM */
};
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (codec > STREAMRECORDER_AUDIO_CODEC_PCM) {
LOGE("invalid parameter : codec %d", codec);
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int audio_enable = 0;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (codec == NULL) {
LOGE("codec is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
};
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (handle == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
-
if (codec > STREAMRECORDER_VIDEO_CODEC_MPEG4) {
LOGE("invalid codec %d", codec);
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int video_enable = 0;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (handle == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (codec == NULL) {
LOGE("codec is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (handle == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (bitrate < 0) {
LOGE("Invalid bitrate %d", bitrate);
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (kbyte == NULL) {
LOGE("Size limit is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (second == NULL) {
LOGE("Time limit is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (samplerate == NULL) {
LOGE("samplerate is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (bitrate == NULL) {
LOGE("bitrate is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (handle == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
-
if (bitrate == NULL)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int codec;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (foreach_cb == NULL) {
LOGE("foreach_cb is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int codec;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (handle == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (foreach_cb == NULL) {
LOGE("foreach_cb is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (recorder == NULL) {
- LOGE("handle is NULL");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
if (channel_count == NULL) {
LOGE("channel_count is NULL");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;