2015-08-27 08:58:07 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
using MediaBrowser.Model.Dlna;
|
2015-03-30 12:57:37 -07:00
|
|
|
|
using MediaBrowser.Model.Extensions;
|
2014-05-08 21:38:12 -07:00
|
|
|
|
using System.Diagnostics;
|
2014-01-11 23:31:21 -07:00
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
namespace MediaBrowser.Model.Entities
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class MediaStream
|
|
|
|
|
/// </summary>
|
2014-01-12 02:31:24 -07:00
|
|
|
|
[DebuggerDisplay("StreamType = {Type}")]
|
2013-02-20 18:33:05 -07:00
|
|
|
|
public class MediaStream
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the codec.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The codec.</value>
|
|
|
|
|
public string Codec { get; set; }
|
|
|
|
|
|
2015-10-19 09:05:03 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the codec tag.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The codec tag.</value>
|
|
|
|
|
public string CodecTag { get; set; }
|
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the language.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The language.</value>
|
|
|
|
|
public string Language { get; set; }
|
|
|
|
|
|
2016-01-13 14:21:39 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the comment.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The comment.</value>
|
|
|
|
|
public string Comment { get; set; }
|
|
|
|
|
|
2013-04-18 12:57:28 -07:00
|
|
|
|
/// <summary>
|
2013-12-05 20:39:44 -07:00
|
|
|
|
/// Gets or sets a value indicating whether this instance is interlaced.
|
2013-04-18 12:57:28 -07:00
|
|
|
|
/// </summary>
|
2013-12-05 20:39:44 -07:00
|
|
|
|
/// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool IsInterlaced { get; set; }
|
2013-11-12 09:08:23 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the channel layout.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The channel layout.</value>
|
|
|
|
|
public string ChannelLayout { get; set; }
|
2014-06-22 09:25:47 -07:00
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the bit rate.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The bit rate.</value>
|
|
|
|
|
public int? BitRate { get; set; }
|
|
|
|
|
|
2014-04-23 22:08:10 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the bit depth.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The bit depth.</value>
|
|
|
|
|
public int? BitDepth { get; set; }
|
|
|
|
|
|
2014-09-08 18:15:31 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the reference frames.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The reference frames.</value>
|
|
|
|
|
public int? RefFrames { get; set; }
|
2015-02-07 14:03:09 -07:00
|
|
|
|
|
2014-04-23 22:08:10 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the length of the packet.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The length of the packet.</value>
|
|
|
|
|
public int? PacketLength { get; set; }
|
2015-04-10 12:08:09 -07:00
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the channels.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The channels.</value>
|
|
|
|
|
public int? Channels { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the sample rate.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The sample rate.</value>
|
|
|
|
|
public int? SampleRate { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether this instance is default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if this instance is default; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool IsDefault { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether this instance is forced.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if this instance is forced; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool IsForced { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the height.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The height.</value>
|
|
|
|
|
public int? Height { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the width.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The width.</value>
|
|
|
|
|
public int? Width { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the average frame rate.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The average frame rate.</value>
|
|
|
|
|
public float? AverageFrameRate { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the real frame rate.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The real frame rate.</value>
|
|
|
|
|
public float? RealFrameRate { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the profile.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The profile.</value>
|
|
|
|
|
public string Profile { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the type.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The type.</value>
|
|
|
|
|
public MediaStreamType Type { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the aspect ratio.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The aspect ratio.</value>
|
|
|
|
|
public string AspectRatio { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the index.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The index.</value>
|
|
|
|
|
public int Index { get; set; }
|
|
|
|
|
|
2015-03-31 09:24:16 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the score.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The score.</value>
|
|
|
|
|
public int? Score { get; set; }
|
2015-04-01 19:47:59 -07:00
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether this instance is external.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if this instance is external; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool IsExternal { get; set; }
|
|
|
|
|
|
2015-03-30 12:57:37 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the method.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The method.</value>
|
|
|
|
|
public SubtitleDeliveryMethod? DeliveryMethod { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the delivery URL.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The delivery URL.</value>
|
|
|
|
|
public string DeliveryUrl { get; set; }
|
2015-04-01 19:47:59 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether this instance is external URL.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>null</c> if [is external URL] contains no value, <c>true</c> if [is external URL]; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool? IsExternalUrl { get; set; }
|
2015-03-30 12:57:37 -07:00
|
|
|
|
|
2014-06-11 13:57:18 -07:00
|
|
|
|
public bool IsTextSubtitleStream
|
2014-05-08 21:38:12 -07:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-06-11 13:57:18 -07:00
|
|
|
|
if (Type != MediaStreamType.Subtitle) return false;
|
2014-05-08 21:38:12 -07:00
|
|
|
|
|
2015-03-28 13:22:27 -07:00
|
|
|
|
if (string.IsNullOrEmpty(Codec) && !IsExternal)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-02 11:14:02 -07:00
|
|
|
|
return IsTextFormat(Codec);
|
2014-05-08 21:38:12 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-02 11:14:02 -07:00
|
|
|
|
public static bool IsTextFormat(string format)
|
|
|
|
|
{
|
|
|
|
|
string codec = format ?? string.Empty;
|
|
|
|
|
|
|
|
|
|
// sub = external .sub file
|
|
|
|
|
|
|
|
|
|
return StringHelper.IndexOfIgnoreCase(codec, "pgs") == -1 &&
|
|
|
|
|
StringHelper.IndexOfIgnoreCase(codec, "dvd") == -1 &&
|
|
|
|
|
!StringHelper.EqualsIgnoreCase(codec, "sub");
|
|
|
|
|
}
|
2014-06-11 13:57:18 -07:00
|
|
|
|
|
2015-02-07 14:03:09 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether [supports external stream].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if [supports external stream]; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool SupportsExternalStream { get; set; }
|
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the filename.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The filename.</value>
|
|
|
|
|
public string Path { get; set; }
|
2013-04-03 05:03:37 -07:00
|
|
|
|
|
2015-03-27 19:19:20 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the external identifier.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The external identifier.</value>
|
|
|
|
|
public string ExternalId { get; set; }
|
|
|
|
|
|
2013-04-03 05:03:37 -07:00
|
|
|
|
/// <summary>
|
2014-03-26 12:21:29 -07:00
|
|
|
|
/// Gets or sets the pixel format.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The pixel format.</value>
|
|
|
|
|
public string PixelFormat { get; set; }
|
2014-06-22 09:25:47 -07:00
|
|
|
|
|
2014-03-26 12:21:29 -07:00
|
|
|
|
/// <summary>
|
2013-04-03 05:03:37 -07:00
|
|
|
|
/// Gets or sets the level.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The level.</value>
|
2013-04-03 15:45:04 -07:00
|
|
|
|
public double? Level { get; set; }
|
2014-06-22 09:25:47 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether this instance is anamorphic.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool? IsAnamorphic { get; set; }
|
2014-10-22 21:26:01 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether this instance is cabac.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>null</c> if [is cabac] contains no value, <c>true</c> if [is cabac]; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool? IsCabac { get; set; }
|
2013-02-20 18:33:05 -07:00
|
|
|
|
}
|
|
|
|
|
}
|