Add FileFormatException used when a file format is wrong.
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 7 Apr 2017 02:29:43 +0000 (11:29 +0900)
committercoderhyme <jhyo.kim@samsung.com>
Fri, 12 May 2017 06:03:15 +0000 (15:03 +0900)
Change-Id: I218d9f9e6e17a72a6dba99ff8d98ade461f32e6c
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia/Common/FileFormatException.cs [new file with mode: 0644]
src/Tizen.Multimedia/Player/PlayerError.cs
src/Tizen.Multimedia/Tizen.Multimedia.csproj

diff --git a/src/Tizen.Multimedia/Common/FileFormatException.cs b/src/Tizen.Multimedia/Common/FileFormatException.cs
new file mode 100644 (file)
index 0000000..e7d7d9a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.Multimedia
+{
+    /// <summary>
+    /// The exception that is thrown when an input file or a data stream that is supposed to conform
+    /// to a certain file format specification is malformed.
+    /// </summary>
+    public class FileFormatException : FormatException
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="FileFormatException"/> class.
+        /// </summary>
+        public FileFormatException()
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="FileFormatException"/> class with a specified error message.
+        /// </summary>
+        public FileFormatException(string message) : base(message)
+        {
+        }
+    }
+}
index 34bbd22..187c8bf 100644 (file)
@@ -77,6 +77,8 @@ namespace Tizen.Multimedia
                     throw new UnauthorizedAccessException(msg);
 
                 case PlayerErrorCode.NotSupportedFile:
+                    throw new FileFormatException(msg);
+
                 case PlayerErrorCode.FeatureNotSupported:
                     throw new NotSupportedException(msg);
 
@@ -103,12 +105,6 @@ namespace Tizen.Multimedia
         }
     }
 
-    internal static class PlayerErrorConverter
-    {
-        internal static void ThrowIfError(int errorCode, string errorMessage)
-        {
-        }
-    }
     /// <summary>
     /// The exception that is thrown when there is no available space in a buffer.
     /// </summary>
index 85feb4b..cb15a6a 100755 (executable)
@@ -89,6 +89,7 @@
     <Compile Include="Camera\SinglePlane.cs" />
     <Compile Include="Camera\TriplePlane.cs" />
     <Compile Include="Common\Display.cs" />
+    <Compile Include="Common\FileFormatException.cs" />
     <Compile Include="Common\IBufferOwner.cs" />
     <Compile Include="Common\IMediaBuffer.cs" />
     <Compile Include="Common\MultimediaDebug.cs" />