summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeokHoon Lee <andy.shlee@samsung.com>2017-09-12 13:39:55 +0900
committerSeokHoon Lee <andy.shlee@samsung.com>2017-09-12 13:40:13 +0900
commit4e11d2b688925d3351fb8085e34701e0c7aa62b9 (patch)
tree21c450bd1ac6ad60d6b94b61e4e2de1d4107de35
parent452c7f33a67c0fc8a43d0cd98aa8fb4470e9451d (diff)
downloadmediastreamrecorder-4e11d2b688925d3351fb8085e34701e0c7aa62b9.tar.gz
mediastreamrecorder-4e11d2b688925d3351fb8085e34701e0c7aa62b9.tar.bz2
mediastreamrecorder-4e11d2b688925d3351fb8085e34701e0c7aa62b9.zip
Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com> Change-Id: I744f9650278cb359610af54191cda5c1e5fb4553
-rw-r--r--include/streamrecorder.h2
-rw-r--r--packaging/capi-media-streamrecorder.spec2
-rw-r--r--src/streamrecorder.c3
-rw-r--r--src/streamrecorder_private.c72
-rw-r--r--test/streamrecorder_test.c6
5 files changed, 32 insertions, 53 deletions
diff --git a/include/streamrecorder.h b/include/streamrecorder.h
index 209cd21..ecaea62 100644
--- a/include/streamrecorder.h
+++ b/include/streamrecorder.h
@@ -940,7 +940,7 @@ int streamrecorder_foreach_supported_video_encoder(streamrecorder_h recorder, st
* @see streamrecorder_supported_video_resolution_cb()
*/
int streamrecorder_foreach_supported_video_resolution(streamrecorder_h recorder,
- streamrecorder_supported_video_resolution_cb foreach_cb, void *user_data);
+ streamrecorder_supported_video_resolution_cb foreach_cb, void *user_data);
/**
* @}
diff --git a/packaging/capi-media-streamrecorder.spec b/packaging/capi-media-streamrecorder.spec
index 88e17e4..c8207c6 100644
--- a/packaging/capi-media-streamrecorder.spec
+++ b/packaging/capi-media-streamrecorder.spec
@@ -1,6 +1,6 @@
Name: capi-media-streamrecorder
Summary: A Streamrecorder library in Tizen Native API
-Version: 0.0.15
+Version: 0.0.16
Release: 0
Group: Multimedia/Other
License: Apache-2.0
diff --git a/src/streamrecorder.c b/src/streamrecorder.c
index 5cf10f2..c7b2803 100644
--- a/src/streamrecorder.c
+++ b/src/streamrecorder.c
@@ -927,9 +927,8 @@ static int __mm_streamrecorder_msg_cb(int message, void *param, void *user_data)
((streamrecorder_recording_limit_reached_cb)handle->user_cb[_STREAMRECORDER_EVENT_TYPE_RECORDING_LIMITED])(type, handle->user_data[_STREAMRECORDER_EVENT_TYPE_RECORDING_LIMITED]);
break;
case MM_MESSAGE_STREAMRECORDER_RECORDING_STATUS:
- if (handle->user_cb[_STREAMRECORDER_EVENT_TYPE_RECORDING_STATUS]) {
+ if (handle->user_cb[_STREAMRECORDER_EVENT_TYPE_RECORDING_STATUS])
((streamrecorder_recording_status_cb)handle->user_cb[_STREAMRECORDER_EVENT_TYPE_RECORDING_STATUS])(m->recording_status.elapsed, m->recording_status.filesize, handle->user_data[_STREAMRECORDER_EVENT_TYPE_RECORDING_STATUS]);
- }
break;
case MM_MESSAGE_STREAMRECORDER_VIDEO_CAPTURED:
diff --git a/src/streamrecorder_private.c b/src/streamrecorder_private.c
index 54444fc..49255aa 100644
--- a/src/streamrecorder_private.c
+++ b/src/streamrecorder_private.c
@@ -151,11 +151,8 @@ static int _streamrecorder_check_and_set_attribute(streamrecorder_h recorder, co
attribute_name, set_value,
NULL);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
LOGE("set [%s] failed 0x%x", attribute_name, ret);
- }
-
-
return __convert_streamrecorder_error_code(attribute_name, ret);
}
@@ -218,9 +215,9 @@ int _streamrecorder_get_state(streamrecorder_h recorder, streamrecorder_state_e
ret = mm_streamrecorder_get_state(handle->mm_handle, &srstate);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
+
*state = __streamrecorder_state_convert((void *)srstate);
return STREAMRECORDER_ERROR_NONE;
@@ -270,9 +267,8 @@ int _streamrecorder_prepare(streamrecorder_h recorder)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
}
ret = streamrecorder_get_state(recorder, &state);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
if (state != STREAMRECORDER_STATE_CREATED) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
@@ -300,9 +296,8 @@ int _streamrecorder_unprepare(streamrecorder_h recorder)
}
ret = streamrecorder_get_state(recorder, &state);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
if (state != STREAMRECORDER_STATE_PREPARED) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
@@ -310,9 +305,9 @@ int _streamrecorder_unprepare(streamrecorder_h recorder)
}
ret = mm_streamrecorder_unrealize(handle->mm_handle);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
LOGE("stramrecorder_unrealize fail");
- }
+
return __convert_streamrecorder_error_code(__func__, ret);
}
@@ -328,9 +323,8 @@ int _streamrecorder_start(streamrecorder_h recorder)
}
ret = streamrecorder_get_state(recorder, &state);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
if (!(state == STREAMRECORDER_STATE_PREPARED || state == STREAMRECORDER_STATE_PAUSED)) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
@@ -352,9 +346,8 @@ int _streamrecorder_pause(streamrecorder_h recorder)
}
ret = streamrecorder_get_state(recorder, &state);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
if (state != STREAMRECORDER_STATE_RECORDING) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
@@ -377,9 +370,8 @@ int _streamrecorder_commit(streamrecorder_h recorder)
}
ret = streamrecorder_get_state(recorder, &state);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
if (!(state == STREAMRECORDER_STATE_RECORDING || state == STREAMRECORDER_STATE_PAUSED)) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
@@ -401,9 +393,8 @@ int _streamrecorder_cancel(streamrecorder_h recorder)
}
ret = streamrecorder_get_state(recorder, &state);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
if (!(state == STREAMRECORDER_STATE_RECORDING || state == STREAMRECORDER_STATE_PAUSED)) {
LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state);
@@ -441,9 +432,8 @@ int _streamrecorder_get_video_framerate(streamrecorder_h recorder, int *framerat
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
}
- if (framerate == NULL) {
+ if (framerate == NULL)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
ret = mm_streamrecorder_get_attributes(handle->mm_handle, NULL,
MMSTR_VIDEO_FRAMERATE, framerate,
@@ -469,9 +459,8 @@ int _streamrecorder_get_video_source_format(streamrecorder_h recorder, int *form
int ret = MM_ERROR_NONE;
streamrecorder_s *handle = (streamrecorder_s *)recorder;
- if (format == NULL) {
+ if (format == NULL)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
ret = mm_streamrecorder_get_attributes(handle->mm_handle, NULL,
MMSTR_VIDEO_SOURCE_FORMAT, format,
@@ -496,9 +485,8 @@ int _streamrecorder_set_video_resolution(streamrecorder_h recorder, int width, i
return STREAMRECORDER_ERROR_INVALID_STATE;
}
- if (width == 0 || height == 0) {
+ if (width == 0 || height == 0)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
ret = mm_streamrecorder_set_attributes(handle->mm_handle, NULL,
MMSTR_VIDEO_RESOLUTION_WIDTH, width,
@@ -553,13 +541,12 @@ int _streamrecorder_foreach_supported_video_resolution(streamrecorder_h recorder
ret = mm_streamrecorder_get_attribute_info(handle->mm_handle, MMSTR_VIDEO_RESOLUTION_WIDTH, &video_width);
ret |= mm_streamrecorder_get_attribute_info(handle->mm_handle, MMSTR_VIDEO_RESOLUTION_HEIGHT, &video_height);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
+
for (i = 0 ; i < video_width.int_array.count ; i++) {
- if (!foreach_cb(video_width.int_array.array[i], video_height.int_array.array[i], user_data)) {
+ if (!foreach_cb(video_width.int_array.array[i], video_height.int_array.array[i], user_data))
break;
- }
}
return STREAMRECORDER_ERROR_NONE;
@@ -733,9 +720,8 @@ int _streamrecorder_foreach_supported_file_format(streamrecorder_h recorder, str
break;
}
- if (format != -1 && !foreach_cb(format, user_data)) {
+ if (format != -1 && !foreach_cb(format, user_data))
break;
- }
}
return STREAMRECORDER_ERROR_NONE;
@@ -751,9 +737,8 @@ int _streamrecorder_set_size_limit(streamrecorder_h recorder, int kbyte)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
}
- if (kbyte < 0) {
+ if (kbyte < 0)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
ret = mm_streamrecorder_set_attributes(handle->mm_handle, NULL,
MMSTR_TARGET_MAX_SIZE, kbyte,
@@ -771,9 +756,8 @@ int _streamrecorder_set_time_limit(streamrecorder_h recorder, int second)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
}
- if (second < 0) {
+ if (second < 0)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
ret = mm_streamrecorder_set_attributes(handle->mm_handle, NULL,
MMSTR_TARGET_TIME_LIMIT, second,
@@ -1047,9 +1031,9 @@ int _streamrecorder_get_video_encoder_bitrate(streamrecorder_h recorder, int *bi
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
}
- if (bitrate == NULL) {
+ if (bitrate == NULL)
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
+
ret = mm_streamrecorder_get_attributes(handle->mm_handle, NULL,
MMSTR_VIDEO_BITRATE, bitrate,
NULL);
@@ -1074,9 +1058,8 @@ int _streamrecorder_foreach_supported_audio_encoder(streamrecorder_h recorder, s
MMStreamRecorderAttrsInfo info;
ret = mm_streamrecorder_get_attribute_info(handle->mm_handle, MMSTR_AUDIO_ENCODER, &info);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
for (i = 0 ; i < info.int_array.count ; i++) {
switch (info.int_array.array[i]) {
@@ -1093,9 +1076,8 @@ int _streamrecorder_foreach_supported_audio_encoder(streamrecorder_h recorder, s
codec = -1;
break;
}
- if (codec != -1 && !foreach_cb(codec, user_data)) {
+ if (codec != -1 && !foreach_cb(codec, user_data))
break;
- }
}
return STREAMRECORDER_ERROR_NONE;
@@ -1120,9 +1102,8 @@ int _streamrecorder_foreach_supported_video_encoder(streamrecorder_h recorder, s
MMStreamRecorderAttrsInfo info;
ret = mm_streamrecorder_get_attribute_info(handle->mm_handle, MMSTR_VIDEO_ENCODER, &info);
- if (ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE)
return __convert_streamrecorder_error_code(__func__, ret);
- }
for (i = 0 ; i < info.int_array.count ; i++) {
switch (info.int_array.array[i]) {
@@ -1137,9 +1118,8 @@ int _streamrecorder_foreach_supported_video_encoder(streamrecorder_h recorder, s
break;
}
- if (codec != -1 && !foreach_cb(codec, user_data)) {
+ if (codec != -1 && !foreach_cb(codec, user_data))
break;
- }
}
return STREAMRECORDER_ERROR_NONE;
diff --git a/test/streamrecorder_test.c b/test/streamrecorder_test.c
index 1224dd1..a349ca6 100644
--- a/test/streamrecorder_test.c
+++ b/test/streamrecorder_test.c
@@ -234,11 +234,11 @@ media_packet_h streamrecorder_make_media_packet(int video, void *data, int size)
}
if (video) {
- if (hmstreamrecorder->mode == MODE_LIVE_BUFFER_NV12_VIDEO_SW) {
+ if (hmstreamrecorder->mode == MODE_LIVE_BUFFER_NV12_VIDEO_SW)
media_format_set_video_mime(output_fmt, MEDIA_FORMAT_NV12);
- } else if (hmstreamrecorder->mode == MODE_LIVE_BUFFER_I420_VIDEO) {
+ else if (hmstreamrecorder->mode == MODE_LIVE_BUFFER_I420_VIDEO)
media_format_set_video_mime(output_fmt, MEDIA_FORMAT_I420);
- }
+
media_format_set_video_width(output_fmt, 1280);
media_format_set_video_height(output_fmt, 720);
media_format_set_video_frame_rate(output_fmt, 30);