123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- using MediaBrowser.Model.Extensions;
- using System.Diagnostics;
- namespace MediaBrowser.Model.Entities
- {
- /// <summary>
- /// Class MediaStream
- /// </summary>
- [DebuggerDisplay("StreamType = {Type}")]
- public class MediaStream
- {
- /// <summary>
- /// Gets or sets the codec.
- /// </summary>
- /// <value>The codec.</value>
- public string Codec { get; set; }
- /// <summary>
- /// Gets or sets the language.
- /// </summary>
- /// <value>The language.</value>
- public string Language { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this instance is interlaced.
- /// </summary>
- /// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value>
- public bool IsInterlaced { get; set; }
- /// <summary>
- /// Gets or sets the channel layout.
- /// </summary>
- /// <value>The channel layout.</value>
- public string ChannelLayout { get; set; }
- /// <summary>
- /// Gets or sets the bit rate.
- /// </summary>
- /// <value>The bit rate.</value>
- public int? BitRate { get; set; }
- /// <summary>
- /// Gets or sets the bit depth.
- /// </summary>
- /// <value>The bit depth.</value>
- public int? BitDepth { get; set; }
- /// <summary>
- /// Gets or sets the reference frames.
- /// </summary>
- /// <value>The reference frames.</value>
- public int? RefFrames { get; set; }
-
- /// <summary>
- /// Gets or sets the length of the packet.
- /// </summary>
- /// <value>The length of the packet.</value>
- public int? PacketLength { get; set; }
- /// <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; }
- /// <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; }
- public bool IsTextSubtitleStream
- {
- get
- {
- if (Type != MediaStreamType.Subtitle) return false;
- string codec = Codec ?? string.Empty;
- // sub = external .sub file
- return StringHelper.IndexOfIgnoreCase(codec, "pgs") == -1 &&
- StringHelper.IndexOfIgnoreCase(codec, "dvd") == -1 &&
- !StringHelper.EqualsIgnoreCase(codec, "sub");
- }
- }
- /// <summary>
- /// Gets or sets the filename.
- /// </summary>
- /// <value>The filename.</value>
- public string Path { get; set; }
- /// <summary>
- /// Gets or sets the pixel format.
- /// </summary>
- /// <value>The pixel format.</value>
- public string PixelFormat { get; set; }
- /// <summary>
- /// Gets or sets the level.
- /// </summary>
- /// <value>The level.</value>
- public double? Level { get; set; }
- /// <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; }
- /// <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; }
- }
- }
|