[Multimedia] Modified a constructor of the Display class not to check the raw video...
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.MediaPlayer / Player / PlayerEnums.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 using System;
17 using Tizen.Internals.Errors;
18
19 namespace Tizen.Multimedia
20 {
21     /// <summary>
22     /// Specifies errors.
23     /// </summary>
24     /// <seealso cref="Player.ErrorOccurred"/>
25     /// <seealso cref="PlayerErrorOccurredEventArgs"/>
26     /// <since_tizen> 3 </since_tizen>
27     public enum PlayerError
28     {
29         /// <summary>
30         /// File does not exists.
31         /// </summary>
32         NoSuchFile = ErrorCode.NoSuchFile,
33
34         /// <summary>
35         /// Internal error.
36         /// </summary>
37         InternalError = ErrorCode.InvalidOperation,
38
39         /// <summary>
40         /// No space.
41         /// </summary>
42         NoSpaceOnDevice = PlayerErrorCode.NoSpaceOnDevice,
43
44         /// <summary>
45         /// Not enough buffer.
46         /// </summary>
47         BufferSpace = ErrorCode.BufferSpace,
48
49         /// <summary>
50         /// <see cref="Player.SetPlayPositionAsync(int, bool)"/> failed.
51         /// </summary>
52         SeekFailed = PlayerErrorCode.SeekFailed,
53
54         /// <summary>
55         /// Invalid state.
56         /// </summary>
57         InvalidState = PlayerErrorCode.InvalidState,
58
59         /// <summary>
60         /// Not supported file.
61         /// </summary>
62         NotSupportedFile = PlayerErrorCode.NotSupportedFile,
63
64         /// <summary>
65         /// Invalid uri.
66         /// </summary>
67         InvalidUri = PlayerErrorCode.InvalidUri,
68
69         /// <summary>
70         /// Connection to service failed.
71         /// </summary>
72         ConnectionFailed = PlayerErrorCode.ConnectionFailed,
73
74         /// <summary>
75         /// Not permitted DRM.
76         /// </summary>
77         DrmNotPermitted = PlayerErrorCode.DrmNotPermitted,
78
79         /// <summary>
80         /// Service disconnected.
81         /// </summary>
82         ServiceDisconnected = PlayerErrorCode.ServiceDisconnected,
83
84         /// <summary>
85         /// Not supported audio codec.
86         /// </summary>
87         /// <since_tizen> 4 </since_tizen>
88         AudioCodecNotSupported = PlayerErrorCode.NotSupportedAudioCodec,
89
90         /// <summary>
91         /// Not supported video codec.
92         /// </summary>
93         /// <since_tizen> 4 </since_tizen>
94         VideoCodecNotSupported = PlayerErrorCode.NotSupportedVideoCodec,
95
96         /// <summary>
97         /// Not supported subtitle file.
98         /// </summary>
99         SubtitleNotSupported = PlayerErrorCode.NotSupportedSubtitle,
100     }
101
102     /// <summary>
103     /// Specifies states that a <see cref="Player"/> can have.
104     /// </summary>
105     /// <since_tizen> 3 </since_tizen>
106     public enum PlayerState
107     {
108         /// <summary>
109         /// Initial state, unprepared.
110         /// </summary>
111         /// <seealso cref="Player.Unprepare"/>
112         Idle = 1,
113
114         /// <summary>
115         /// Prepared.
116         /// </summary>
117         /// <seealso cref="Player.PrepareAsync"/>
118         Ready,
119
120         /// <summary>
121         /// Playing.
122         /// </summary>
123         /// <seealso cref="Player.Start"/>
124         Playing,
125
126         /// <summary>
127         /// Paused while playing media.
128         /// </summary>
129         /// <seealso cref="Player.Pause"/>
130         Paused,
131
132         /// <summary>
133         /// Preparation in progress.
134         /// </summary>
135         /// <seealso cref="Player.PrepareAsync"/>/>
136         Preparing,
137     }
138
139     internal static class PlayerStateExtensions
140     {
141         internal static bool IsAnyOf(this PlayerState thisState, params PlayerState[] states)
142         {
143             return Array.IndexOf(states, thisState) != -1;
144         }
145     }
146
147     /// <summary>
148     /// Specifies audio latency modes for <see cref="Player"/>.
149     /// </summary>
150     /// <seealso cref="Player.AudioLatencyMode"/>
151     /// <since_tizen> 3 </since_tizen>
152     public enum AudioLatencyMode
153     {
154         /// <summary>
155         /// Low audio latency mode.
156         /// </summary>
157         Low,
158
159         /// <summary>
160         ///  Middle audio latency mode.
161         /// </summary>
162         Mid,
163
164         /// <summary>
165         /// High audio latency mode.
166         /// </summary>
167         High,
168     }
169
170     /// <summary>
171     /// Specifies display modes for <see cref="Player"/>.
172     /// </summary>
173     /// <seealso cref="PlayerDisplaySettings.Mode"/>
174     /// <since_tizen> 3 </since_tizen>
175     public enum PlayerDisplayMode
176     {
177         /// <summary>
178         /// Letter box.
179         /// </summary>
180         LetterBox,
181
182         /// <summary>
183         /// Original size.
184         /// </summary>
185         OriginalSize,
186
187         /// <summary>
188         /// Full-screen.
189         /// </summary>
190         FullScreen,
191
192         /// <summary>
193         /// Cropped full-screen.
194         /// </summary>
195         CroppedFull,
196
197         /// <summary>
198         /// Original size (if surface size is larger than video size(width/height)) or
199         /// letter box (if video size(width/height) is larger than surface size).
200         /// </summary>
201         OriginalOrFull,
202
203         /// <summary>
204         /// Region of interest.
205         /// </summary>
206         /// <seealso cref="PlayerDisplaySettings.SetRoi(Rectangle)"/>
207         Roi
208     }
209
210     internal enum StreamType
211     {
212         /// <summary>
213         ///  Audio element stream type.
214         /// </summary>
215         Audio = 1,
216
217         /// <summary>
218         /// Video element stream type.
219         /// </summary>
220         Video,
221
222         /// <summary>
223         /// Text type.
224         /// </summary>
225         Text
226     }
227
228     /// <summary>
229     /// Specifies the streaming buffer status.
230     /// </summary>
231     /// <seealso cref="MediaStreamConfiguration.BufferStatusChanged"/>
232     /// <seealso cref="MediaStreamBufferStatusChangedEventArgs"/>
233     /// <since_tizen> 3 </since_tizen>
234     public enum MediaStreamBufferStatus
235     {
236         /// <summary>
237         /// Underrun.
238         /// </summary>
239         Underrun,
240
241         /// <summary>
242         ///  Completed.
243         /// </summary>
244         Overflow,
245     }
246
247     /// <summary>
248     /// Specifies the reason for the playback interruption.
249     /// </summary>
250     /// <seealso cref="Player.PlaybackInterrupted"/>
251     /// <since_tizen> 3 </since_tizen>
252     public enum PlaybackInterruptionReason
253     {
254         /// <summary>
255         /// Interrupted by a resource conflict and the <see cref="Player"/> will be unprepared automatically.
256         /// </summary>
257         ResourceConflict = 4
258     }
259
260     /// <summary>
261     /// Specifies keys for the metadata.
262     /// </summary>
263     /// <seealso cref="StreamInfo.GetMetadata(StreamMetadataKey)"/>
264     /// <since_tizen> 3 </since_tizen>
265     public enum StreamMetadataKey
266     {
267         /// <summary>
268         /// Album.
269         /// </summary>
270         Album,
271
272         /// <summary>
273         /// Artists.
274         /// </summary>
275         Artist,
276
277         /// <summary>
278         /// Author.
279         /// </summary>
280         Author,
281
282         /// <summary>
283         /// Genre.
284         /// </summary>
285         Genre,
286
287         /// <summary>
288         /// Title.
289         /// </summary>
290         Title,
291
292         /// <summary>
293         /// Year.
294         /// </summary>
295         Year
296     }
297 }