[MediaTool] Add missed exception for bitDepth (#1051)
authorhsgwon <haesu.gwon@samsung.com>
Wed, 2 Oct 2019 07:54:00 +0000 (16:54 +0900)
committerGitHub <noreply@github.com>
Wed, 2 Oct 2019 07:54:00 +0000 (16:54 +0900)
* [MediaTool] Add missed exception for bitDepth

src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs

index e75bc2e..845f3f7 100644 (file)
@@ -106,7 +106,8 @@ namespace Tizen.Multimedia
         ///     <see cref="MediaFormatAudioChannelPosition.Mono"/> or <see cref="MediaFormatAudioChannelPosition.None"/> is set with another channel position.
         /// </exception>
         /// <exception cref="ArgumentOutOfRangeException">
-        ///     <paramref name="channel"/>, <paramref name="sampleRate"/>, <paramref name="bit"/>, or <paramref name="bitRate"/> is less than zero.
+        ///     <paramref name="channel"/>, <paramref name="sampleRate"/>, <paramref name="bit"/>, or <paramref name="bitRate"/>,
+        ///     <paramref name="bitDepth"/> is less than zero.
         /// </exception>
         /// <since_tizen> 6 </since_tizen>
         public AudioMediaFormat(MediaFormatAudioMimeType mimeType,
@@ -150,7 +151,8 @@ namespace Tizen.Multimedia
         ///     <see cref="MediaFormatAudioChannelPosition.Mono"/> or <see cref="MediaFormatAudioChannelPosition.None"/> is set with another channel position.
         /// </exception>
         /// <exception cref="ArgumentOutOfRangeException">
-        ///     <paramref name="channel"/>, <paramref name="sampleRate"/>, <paramref name="bit"/>, or <paramref name="bitRate"/> is less than zero.
+        ///     <paramref name="channel"/>, <paramref name="sampleRate"/>, <paramref name="bit"/>, or <paramref name="bitRate"/>,
+        ///     <paramref name="bitDepth"/> is less than zero.
         /// </exception>
         /// <since_tizen> 6 </since_tizen>
         public AudioMediaFormat(MediaFormatAudioMimeType mimeType,
@@ -179,6 +181,11 @@ namespace Tizen.Multimedia
                 throw new ArgumentOutOfRangeException(nameof(bitRate), bitRate,
                     "Bit rate value can't be negative.");
             }
+            if (bitDepth < 0)
+            {
+                throw new ArgumentOutOfRangeException(nameof(bitDepth), bitDepth,
+                    "Bit depth value can't be negative.");
+            }
 
             ValidationUtil.ValidateEnum(typeof(MediaFormatAacType), aacType, nameof(aacType));