2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.Threading;
18 using Tizen.Internals.Errors;
20 namespace Tizen.Multimedia
25 /// <seealso cref="Player.ErrorOccurred"/>
26 /// <seealso cref="PlayerErrorOccurredEventArgs"/>
27 /// <since_tizen> 3 </since_tizen>
28 public enum PlayerError
31 /// File does not exists.
33 NoSuchFile = ErrorCode.NoSuchFile,
38 InternalError = ErrorCode.InvalidOperation,
43 NoSpaceOnDevice = PlayerErrorCode.NoSpaceOnDevice,
46 /// Not enough buffer.
48 BufferSpace = ErrorCode.BufferSpace,
51 /// <see cref="Player.SetPlayPositionAsync(int, bool)"/> failed.
53 SeekFailed = PlayerErrorCode.SeekFailed,
58 InvalidState = PlayerErrorCode.InvalidState,
61 /// Not supported file.
63 NotSupportedFile = PlayerErrorCode.NotSupportedFile,
68 InvalidUri = PlayerErrorCode.InvalidUri,
71 /// Connection to service failed.
73 ConnectionFailed = PlayerErrorCode.ConnectionFailed,
76 /// Not permitted DRM.
78 DrmNotPermitted = PlayerErrorCode.DrmNotPermitted,
81 /// Service disconnected.
83 ServiceDisconnected = PlayerErrorCode.ServiceDisconnected,
86 /// Not supported audio codec.
88 /// <since_tizen> 4 </since_tizen>
89 AudioCodecNotSupported = PlayerErrorCode.NotSupportedAudioCodec,
92 /// Not supported video codec.
94 /// <since_tizen> 4 </since_tizen>
95 VideoCodecNotSupported = PlayerErrorCode.NotSupportedVideoCodec,
98 /// Not supported subtitle file.
100 SubtitleNotSupported = PlayerErrorCode.NotSupportedSubtitle,
104 /// Specifies states that a <see cref="Player"/> can have.
106 /// <since_tizen> 3 </since_tizen>
107 public enum PlayerState
110 /// Initial state, unprepared.
112 /// <seealso cref="Player.Unprepare"/>
118 /// <seealso cref="Player.PrepareAsync()"/>
119 /// <seealso cref="Player.PrepareAsync(CancellationToken)"/>
125 /// <seealso cref="Player.Start"/>
129 /// Paused while playing media.
131 /// <seealso cref="Player.Pause"/>
135 /// Preparation in progress.
137 /// <remarks>In this state, other methods and properties cannot be set.</remarks>
138 /// <seealso cref="Player.PrepareAsync()"/>
139 /// <seealso cref="Player.PrepareAsync(CancellationToken)"/>
143 internal static class PlayerStateExtensions
145 internal static bool IsAnyOf(this PlayerState thisState, params PlayerState[] states)
147 return Array.IndexOf(states, thisState) != -1;
152 /// Specifies audio latency modes for <see cref="Player"/>.
154 /// <seealso cref="Player.AudioLatencyMode"/>
155 /// <since_tizen> 3 </since_tizen>
156 public enum AudioLatencyMode
159 /// Low audio latency mode.
164 /// Middle audio latency mode.
169 /// High audio latency mode.
175 /// Specifies display modes for <see cref="Player"/>.
177 /// <seealso cref="PlayerDisplaySettings.Mode"/>
178 /// <since_tizen> 3 </since_tizen>
179 public enum PlayerDisplayMode
197 /// Cropped full-screen.
202 /// Original size (if surface size is larger than video size(width/height)) or
203 /// letter box (if video size(width/height) is larger than surface size).
208 /// Region of interest.
210 /// <seealso cref="PlayerDisplaySettings.SetRoi(Rectangle)"/>
214 internal enum StreamType
217 /// Audio element stream type.
222 /// Video element stream type.
233 /// Specifies the streaming buffer status.
235 /// <seealso cref="MediaStreamConfiguration.BufferStatusChanged"/>
236 /// <seealso cref="MediaStreamBufferStatusChangedEventArgs"/>
237 /// <since_tizen> 3 </since_tizen>
238 public enum MediaStreamBufferStatus
252 /// Specifies the reason for the playback interruption.
254 /// <seealso cref="Player.PlaybackInterrupted"/>
255 /// <since_tizen> 3 </since_tizen>
256 public enum PlaybackInterruptionReason
259 /// Interrupted by a resource conflict and the <see cref="Player"/> will be unprepared automatically.
265 /// Specifies keys for the metadata.
267 /// <seealso cref="StreamInfo.GetMetadata(StreamMetadataKey)"/>
268 /// <since_tizen> 3 </since_tizen>
269 public enum StreamMetadataKey
303 /// Enumeration of audio extract option.
305 /// <seealso cref="Player.EnableExportingAudioData"/>
306 /// <since_tizen> 6 </since_tizen>
307 public enum PlayerAudioExtractOption
310 /// Sync multi-channel audio stream with the playback clock.
315 /// No sync with the playback clock.
317 NoSyncWithClock = 0x01,
320 /// Splits one interleaved multi-channel audio stream into several mono audio streams.
325 /// Doesn't sync with clock and doesn't split multi-channel audio stream into several mono audio streams.
327 NoSyncAndDeinterleave = 0x03,
332 /// Specifies the types of a codec for <see cref="Player"/>.
334 /// <seealso cref="Player.AudioCodecType"/>
335 /// <since_tizen> 6 </since_tizen>
336 public enum CodecType
339 /// An optional flag for using the H/W codec.
344 /// An optional flag for using the S/W codec