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 Tizen.Internals.Errors;
19 namespace Tizen.Multimedia
24 /// <seealso cref="Player.ErrorOccurred"/>
25 /// <seealso cref="PlayerErrorOccurredEventArgs"/>
26 /// <since_tizen> 3 </since_tizen>
27 public enum PlayerError
30 /// File does not exists.
32 NoSuchFile = ErrorCode.NoSuchFile,
37 InternalError = ErrorCode.InvalidOperation,
42 NoSpaceOnDevice = PlayerErrorCode.NoSpaceOnDevice,
45 /// Not enough buffer.
47 BufferSpace = ErrorCode.BufferSpace,
50 /// <see cref="Player.SetPlayPositionAsync(int, bool)"/> failed.
52 SeekFailed = PlayerErrorCode.SeekFailed,
57 InvalidState = PlayerErrorCode.InvalidState,
60 /// Not supported file.
62 NotSupportedFile = PlayerErrorCode.NotSupportedFile,
67 InvalidUri = PlayerErrorCode.InvalidUri,
70 /// Connection to service failed.
72 ConnectionFailed = PlayerErrorCode.ConnectionFailed,
75 /// Not permitted DRM.
77 DrmNotPermitted = PlayerErrorCode.DrmNotPermitted,
80 /// Service disconnected.
82 ServiceDisconnected = PlayerErrorCode.ServiceDisconnected,
85 /// Not supported audio codec.
87 /// <since_tizen> 4 </since_tizen>
88 AudioCodecNotSupported = PlayerErrorCode.NotSupportedAudioCodec,
91 /// Not supported video codec.
93 /// <since_tizen> 4 </since_tizen>
94 VideoCodecNotSupported = PlayerErrorCode.NotSupportedVideoCodec,
97 /// Not supported subtitle file.
99 SubtitleNotSupported = PlayerErrorCode.NotSupportedSubtitle,
103 /// Specifies states that a <see cref="Player"/> can have.
105 /// <since_tizen> 3 </since_tizen>
106 public enum PlayerState
109 /// Initial state, unprepared.
111 /// <seealso cref="Player.Unprepare"/>
117 /// <seealso cref="Player.PrepareAsync"/>
123 /// <seealso cref="Player.Start"/>
127 /// Paused while playing media.
129 /// <seealso cref="Player.Pause"/>
133 /// Preparation in progress.
135 /// <remarks>In this state, other methods and properties cannot be set.</remarks>
136 /// <seealso cref="Player.PrepareAsync"/>/>
140 internal static class PlayerStateExtensions
142 internal static bool IsAnyOf(this PlayerState thisState, params PlayerState[] states)
144 return Array.IndexOf(states, thisState) != -1;
149 /// Specifies audio latency modes for <see cref="Player"/>.
151 /// <seealso cref="Player.AudioLatencyMode"/>
152 /// <since_tizen> 3 </since_tizen>
153 public enum AudioLatencyMode
156 /// Low audio latency mode.
161 /// Middle audio latency mode.
166 /// High audio latency mode.
172 /// Specifies display modes for <see cref="Player"/>.
174 /// <seealso cref="PlayerDisplaySettings.Mode"/>
175 /// <since_tizen> 3 </since_tizen>
176 public enum PlayerDisplayMode
194 /// Cropped full-screen.
199 /// Original size (if surface size is larger than video size(width/height)) or
200 /// letter box (if video size(width/height) is larger than surface size).
205 /// Region of interest.
207 /// <seealso cref="PlayerDisplaySettings.SetRoi(Rectangle)"/>
211 internal enum StreamType
214 /// Audio element stream type.
219 /// Video element stream type.
230 /// Specifies the streaming buffer status.
232 /// <seealso cref="MediaStreamConfiguration.BufferStatusChanged"/>
233 /// <seealso cref="MediaStreamBufferStatusChangedEventArgs"/>
234 /// <since_tizen> 3 </since_tizen>
235 public enum MediaStreamBufferStatus
249 /// Specifies the reason for the playback interruption.
251 /// <seealso cref="Player.PlaybackInterrupted"/>
252 /// <since_tizen> 3 </since_tizen>
253 public enum PlaybackInterruptionReason
256 /// Interrupted by a resource conflict and the <see cref="Player"/> will be unprepared automatically.
262 /// Specifies keys for the metadata.
264 /// <seealso cref="StreamInfo.GetMetadata(StreamMetadataKey)"/>
265 /// <since_tizen> 3 </since_tizen>
266 public enum StreamMetadataKey
300 /// Enumeration of audio extract option.
302 /// <seealso cref="Player.EnableExportingAudioData"/>
303 /// <since_tizen> 6 </since_tizen>
304 public enum PlayerAudioExtractOption
307 /// Sync multi-channel audio stream with the playback clock.
312 /// No sync with the playback clock.
314 NoSyncWithClock = 0x01,
317 /// Splits one interleaved multi-channel audio stream into several mono audio streams.
322 /// Doesn't sync with clock and doesn't split multi-channel audio stream into several mono audio streams.
324 NoSyncAndDeinterleave = 0x03,
329 /// Specifies the types of a codec for <see cref="Player"/>.
331 /// <seealso cref="Player.AudioCodecType"/>
332 /// <since_tizen> 6 </since_tizen>
333 public enum CodecType
336 /// An optional flag for using the H/W codec.
341 /// An optional flag for using the S/W codec