MediaStream.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using MediaBrowser.Model.Extensions;
  2. using System.Diagnostics;
  3. using System.Runtime.Serialization;
  4. namespace MediaBrowser.Model.Entities
  5. {
  6. /// <summary>
  7. /// Class MediaStream
  8. /// </summary>
  9. [DebuggerDisplay("StreamType = {Type}")]
  10. public class MediaStream
  11. {
  12. /// <summary>
  13. /// Gets or sets the codec.
  14. /// </summary>
  15. /// <value>The codec.</value>
  16. public string Codec { get; set; }
  17. /// <summary>
  18. /// Gets or sets the language.
  19. /// </summary>
  20. /// <value>The language.</value>
  21. public string Language { get; set; }
  22. /// <summary>
  23. /// Gets or sets a value indicating whether this instance is interlaced.
  24. /// </summary>
  25. /// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value>
  26. public bool IsInterlaced { get; set; }
  27. /// <summary>
  28. /// Gets or sets the channel layout.
  29. /// </summary>
  30. /// <value>The channel layout.</value>
  31. public string ChannelLayout { get; set; }
  32. /// <summary>
  33. /// Gets or sets the bit rate.
  34. /// </summary>
  35. /// <value>The bit rate.</value>
  36. public int? BitRate { get; set; }
  37. /// <summary>
  38. /// Gets or sets the bit depth.
  39. /// </summary>
  40. /// <value>The bit depth.</value>
  41. public int? BitDepth { get; set; }
  42. /// <summary>
  43. /// Gets or sets the length of the packet.
  44. /// </summary>
  45. /// <value>The length of the packet.</value>
  46. public int? PacketLength { get; set; }
  47. /// <summary>
  48. /// Gets or sets the channels.
  49. /// </summary>
  50. /// <value>The channels.</value>
  51. public int? Channels { get; set; }
  52. /// <summary>
  53. /// Gets or sets the sample rate.
  54. /// </summary>
  55. /// <value>The sample rate.</value>
  56. public int? SampleRate { get; set; }
  57. /// <summary>
  58. /// Gets or sets a value indicating whether this instance is default.
  59. /// </summary>
  60. /// <value><c>true</c> if this instance is default; otherwise, <c>false</c>.</value>
  61. public bool IsDefault { get; set; }
  62. /// <summary>
  63. /// Gets or sets a value indicating whether this instance is forced.
  64. /// </summary>
  65. /// <value><c>true</c> if this instance is forced; otherwise, <c>false</c>.</value>
  66. public bool IsForced { get; set; }
  67. /// <summary>
  68. /// Gets or sets the height.
  69. /// </summary>
  70. /// <value>The height.</value>
  71. public int? Height { get; set; }
  72. /// <summary>
  73. /// Gets or sets the width.
  74. /// </summary>
  75. /// <value>The width.</value>
  76. public int? Width { get; set; }
  77. /// <summary>
  78. /// Gets or sets the average frame rate.
  79. /// </summary>
  80. /// <value>The average frame rate.</value>
  81. public float? AverageFrameRate { get; set; }
  82. /// <summary>
  83. /// Gets or sets the real frame rate.
  84. /// </summary>
  85. /// <value>The real frame rate.</value>
  86. public float? RealFrameRate { get; set; }
  87. /// <summary>
  88. /// Gets or sets the profile.
  89. /// </summary>
  90. /// <value>The profile.</value>
  91. public string Profile { get; set; }
  92. /// <summary>
  93. /// Gets or sets the type.
  94. /// </summary>
  95. /// <value>The type.</value>
  96. public MediaStreamType Type { get; set; }
  97. /// <summary>
  98. /// Gets or sets the aspect ratio.
  99. /// </summary>
  100. /// <value>The aspect ratio.</value>
  101. public string AspectRatio { get; set; }
  102. /// <summary>
  103. /// Gets or sets the index.
  104. /// </summary>
  105. /// <value>The index.</value>
  106. public int Index { get; set; }
  107. /// <summary>
  108. /// Gets or sets a value indicating whether this instance is external.
  109. /// </summary>
  110. /// <value><c>true</c> if this instance is external; otherwise, <c>false</c>.</value>
  111. public bool IsExternal { get; set; }
  112. public bool IsTextSubtitleStream
  113. {
  114. get
  115. {
  116. if (Type != MediaStreamType.Subtitle) return false;
  117. string codec = Codec ?? string.Empty;
  118. return StringHelper.IndexOfIgnoreCase(codec, "pgs") == -1 &&
  119. StringHelper.IndexOfIgnoreCase(codec, "dvd") == -1;
  120. }
  121. }
  122. /// <summary>
  123. /// Gets or sets the filename.
  124. /// </summary>
  125. /// <value>The filename.</value>
  126. public string Path { get; set; }
  127. /// <summary>
  128. /// Gets or sets the pixel format.
  129. /// </summary>
  130. /// <value>The pixel format.</value>
  131. public string PixelFormat { get; set; }
  132. /// <summary>
  133. /// Gets or sets the level.
  134. /// </summary>
  135. /// <value>The level.</value>
  136. public double? Level { get; set; }
  137. /// <summary>
  138. /// Gets a value indicating whether this instance is anamorphic.
  139. /// </summary>
  140. /// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value>
  141. public bool? IsAnamorphic { get; set; }
  142. }
  143. }