[Release version 0.2.16] Add code for exception handling 33/64733/1 accepted/tizen/common/20160406.144521 accepted/tizen/ivi/20160406.073630 accepted/tizen/mobile/20160406.073532 accepted/tizen/tv/20160406.073553 accepted/tizen/wearable/20160406.073608 submit/tizen/20160406.043753
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 5 Apr 2016 06:53:57 +0000 (15:53 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 5 Apr 2016 06:53:57 +0000 (15:53 +0900)
Change-Id: I017aa4e5ee50849c6b7e5f878f889af0628152c3
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/src/legacy_recorder.c
packaging/mmsvc-recorder.spec

index 2d194bf..fe34a9d 100644 (file)
@@ -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;
        }
index 143ff0b..0aec6bc 100644 (file)
@@ -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