From 1d3a364d6a80a903cfbedba655e48d9e64dda28b Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Tue, 5 Apr 2016 15:53:57 +0900 Subject: [PATCH] [Release version 0.2.16] Add code for exception handling Change-Id: I017aa4e5ee50849c6b7e5f878f889af0628152c3 Signed-off-by: Jeongmo Yang --- legacy/src/legacy_recorder.c | 21 ++++++++++++++++++++- packaging/mmsvc-recorder.spec | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/legacy/src/legacy_recorder.c b/legacy/src/legacy_recorder.c index 2d194bf..fe34a9d 100644 --- a/legacy/src/legacy_recorder.c +++ b/legacy/src/legacy_recorder.c @@ -1368,6 +1368,11 @@ int legacy_recorder_attr_set_size_limit(recorder_h recorder, int kbyte) return RECORDER_ERROR_INVALID_PARAMETER; } + if (kbyte < 0) { + LOGE("invalid kbyte %d", kbyte); + return RECORDER_ERROR_INVALID_PARAMETER; + } + ret = mm_camcorder_set_attributes(handle->mm_handle, NULL, MMCAM_TARGET_MAX_SIZE, kbyte, NULL); @@ -1386,6 +1391,11 @@ int legacy_recorder_attr_set_time_limit(recorder_h recorder, int second) return RECORDER_ERROR_INVALID_PARAMETER; } + if (second < 0) { + LOGE("invalid second %d", second); + return RECORDER_ERROR_INVALID_PARAMETER; + } + ret = mm_camcorder_set_attributes(handle->mm_handle, NULL, MMCAM_TARGET_TIME_LIMIT, second, NULL); @@ -1596,6 +1606,10 @@ int legacy_recorder_attr_set_video_encoder_bitrate(recorder_h recorder, int bitr LOGE("RECORDER_ERROR_NOT_SUPPORTED"); return RECORDER_ERROR_NOT_SUPPORTED; } + if (bitrate <= 0) { + LOGE("invalid bitrate %d", bitrate); + return RECORDER_ERROR_INVALID_PARAMETER; + } ret = mm_camcorder_set_attributes(handle->mm_handle, NULL, MMCAM_VIDEO_ENCODER_BITRATE, bitrate, @@ -1875,6 +1889,11 @@ int legacy_recorder_attr_set_recording_motion_rate(recorder_h recorder, double r LOGE("RECORDER_ERROR_NOT_SUPPORTED"); return RECORDER_ERROR_NOT_SUPPORTED; } + if (rate <= 0.0) { + LOGE("invalid rate %lf", rate); + return RECORDER_ERROR_INVALID_PARAMETER; + } + ret = mm_camcorder_set_attributes(handle->mm_handle, NULL, MMCAM_CAMERA_RECORDING_MOTION_RATE, rate, NULL); @@ -1911,7 +1930,7 @@ int legacy_recorder_attr_get_recording_motion_rate(recorder_h recorder, double * int legacy_recorder_attr_set_audio_channel(recorder_h recorder, int channel_count) { - if (channel_count < 1) { + if (channel_count < 1 || channel_count > 2) { LOGE("invalid channel %d", channel_count); return RECORDER_ERROR_INVALID_PARAMETER; } diff --git a/packaging/mmsvc-recorder.spec b/packaging/mmsvc-recorder.spec index 143ff0b..0aec6bc 100644 --- a/packaging/mmsvc-recorder.spec +++ b/packaging/mmsvc-recorder.spec @@ -1,6 +1,6 @@ Name: mmsvc-recorder Summary: A Recorder module for muse server -Version: 0.2.15 +Version: 0.2.16 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 -- 2.7.4