Release 4.0.0-preview1-00201
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia / Common / CodecNotSupportedException.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18
19 namespace Tizen.Multimedia
20 {
21     /// <summary>
22     /// Specifies whether a codec is an audio codec or a video codec.
23     /// </summary>
24     public enum CodecKind
25     {
26         /// <summary>
27         /// Audio codec.
28         /// </summary>
29         Audio,
30
31         /// <summary>
32         /// Video codec.
33         /// </summary>
34         Video
35     }
36
37     /// <summary>
38     /// The exception that is thrown when the codec for an input file or a data stream is not supported
39     /// or the input is malformed.
40     /// </summary>
41     public class CodecNotSupportedException : InvalidOperationException
42     {
43         /// <summary>
44         /// Initializes a new instance of the <see cref="CodecNotSupportedException"/> class
45         /// with <see cref="CodecKind"/> indicating which codec is not supported.
46         /// </summary>
47         public CodecNotSupportedException(CodecKind kind)
48         {
49             CodecKind = kind;
50         }
51
52         /// <summary>
53         /// Initializes a new instance of the <see cref="CodecNotSupportedException"/> class with
54         /// <see cref="CodecKind"/> indicating which codec is not supported and a specified error message.
55         /// </summary>
56         public CodecNotSupportedException(CodecKind kind, string message) : base(message)
57         {
58             CodecKind = kind;
59         }
60
61         /// <summary>
62         /// Gets the <see cref="CodecKind"/> of the exception.
63         /// </summary>
64         public CodecKind CodecKind { get; }
65     }
66 }