DrmFutureUse = PlayerErrorCode.DrmFutureUse,
DrmNotPermitted = PlayerErrorCode.DrmNotPermitted,
ResourceLimit = PlayerErrorCode.ResourceLimit,
- ServiceDisconnected = PlayerErrorCode.ServiceDisconnected
+ ServiceDisconnected = PlayerErrorCode.ServiceDisconnected,
+ SubtitleNotSupported = PlayerErrorCode.NotSupportedSubtitle,
}
/// <summary>
DrmFutureUse = PlayerErrorClass | 0x0a,
DrmNotPermitted = PlayerErrorClass | 0x0b,
ResourceLimit = PlayerErrorClass | 0x0c,
- ServiceDisconnected = PlayerErrorClass | 0x0d
+ ServiceDisconnected = PlayerErrorClass | 0x0d,
+ NotSupportedAudioCodec = PlayerErrorClass | 0x0e,
+ NotSupportedVideoCodec = PlayerErrorClass | 0x0f,
+ NotSupportedSubtitle = PlayerErrorClass | 0x10
}
internal static class PlayerErrorCodeExtensions
case PlayerErrorCode.ResourceLimit:
throw new ResouceLimitException(msg);
+
+ case PlayerErrorCode.NotSupportedAudioCodec:
+ throw new CodecNotSupportedException(CodecKind.Audio);
+
+ case PlayerErrorCode.NotSupportedVideoCodec:
+ throw new CodecNotSupportedException(CodecKind.Video);
+
}
throw new Exception(msg);
--- /dev/null
+/*
+ * 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
+{
+ /// <summary>
+ /// Specifies whether a codec is audio codec or video codec.
+ /// </summary>
+ public enum CodecKind
+ {
+ /// <summary>
+ /// Audio codec
+ /// </summary>
+ Audio,
+
+ /// <summary>
+ /// Video codec
+ /// </summary>
+ Video
+ }
+
+ /// <summary>
+ /// The exception that is thrown when the codec for an input file or a data stream is not supported
+ /// or the input is malformed.
+ /// </summary>
+ public class CodecNotSupportedException : InvalidOperationException
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="CodecNotSupportedException"/> class
+ /// with <see cref="CodecKind"/> indicating which codec is not supported.
+ /// </summary>
+ public CodecNotSupportedException(CodecKind kind)
+ {
+ CodecKind = kind;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="CodecNotSupportedException"/> class with
+ /// <see cref="CodecKind"/> indicating which codec is not supported and a specified error message.
+ /// </summary>
+ public CodecNotSupportedException(CodecKind kind, string message) : base(message)
+ {
+ CodecKind = kind;
+ }
+
+ /// <summary>
+ /// Gets the <see cref="CodecKind"/> of the exception.
+ /// </summary>
+ public CodecKind CodecKind { get; }
+ }
+}