From: coderhyme Date: Fri, 7 Apr 2017 02:29:43 +0000 (+0900) Subject: Add FileFormatException used when a file format is wrong. X-Git-Tag: submit/trunk/20170823.075128~94^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0417aecc36cf87b34194bd632247553c5951a6aa;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add FileFormatException used when a file format is wrong. Change-Id: I218d9f9e6e17a72a6dba99ff8d98ade461f32e6c Signed-off-by: coderhyme --- diff --git a/src/Tizen.Multimedia/Common/FileFormatException.cs b/src/Tizen.Multimedia/Common/FileFormatException.cs new file mode 100644 index 0000000..e7d7d9a --- /dev/null +++ b/src/Tizen.Multimedia/Common/FileFormatException.cs @@ -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 +{ + /// + /// 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. + /// + public class FileFormatException : FormatException + { + /// + /// Initializes a new instance of the class. + /// + public FileFormatException() + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + public FileFormatException(string message) : base(message) + { + } + } +} diff --git a/src/Tizen.Multimedia/Player/PlayerError.cs b/src/Tizen.Multimedia/Player/PlayerError.cs index 34bbd22..187c8bf 100644 --- a/src/Tizen.Multimedia/Player/PlayerError.cs +++ b/src/Tizen.Multimedia/Player/PlayerError.cs @@ -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) - { - } - } /// /// The exception that is thrown when there is no available space in a buffer. /// diff --git a/src/Tizen.Multimedia/Tizen.Multimedia.csproj b/src/Tizen.Multimedia/Tizen.Multimedia.csproj index 85feb4b3..cb15a6a 100755 --- a/src/Tizen.Multimedia/Tizen.Multimedia.csproj +++ b/src/Tizen.Multimedia/Tizen.Multimedia.csproj @@ -89,6 +89,7 @@ +