MediaStream.cs 5.0 KB

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