XboxOneProfile.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. using MediaBrowser.Model.Dlna;
  2. using MediaBrowser.Model.Dlna.Profiles;
  3. using System.Xml.Serialization;
  4. namespace MediaBrowser.Dlna.Profiles
  5. {
  6. [XmlRoot("Profile")]
  7. public class XboxOneProfile : DefaultProfile
  8. {
  9. public XboxOneProfile()
  10. {
  11. Name = "Xbox One";
  12. TimelineOffsetSeconds = 40;
  13. Identification = new DeviceIdentification
  14. {
  15. ModelName = "Xbox One",
  16. FriendlyName = "Xbox-SystemOS",
  17. Headers = new[]
  18. {
  19. new HttpHeaderInfo {Name = "User-Agent", Value = "NSPlayer", Match = HeaderMatchType.Substring}
  20. }
  21. };
  22. TranscodingProfiles = new[]
  23. {
  24. new TranscodingProfile
  25. {
  26. Container = "mp3",
  27. AudioCodec = "mp3",
  28. Type = DlnaProfileType.Audio
  29. },
  30. new TranscodingProfile
  31. {
  32. Container = "jpeg",
  33. VideoCodec = "jpeg",
  34. Type = DlnaProfileType.Photo
  35. },
  36. new TranscodingProfile
  37. {
  38. Container = "ts",
  39. VideoCodec = "h264",
  40. AudioCodec = "aac",
  41. Type = DlnaProfileType.Video,
  42. EstimateContentLength = true
  43. }
  44. };
  45. DirectPlayProfiles = new[]
  46. {
  47. new DirectPlayProfile
  48. {
  49. Container = "ts",
  50. VideoCodec = "h264",
  51. AudioCodec = "ac3",
  52. Type = DlnaProfileType.Video
  53. },
  54. new DirectPlayProfile
  55. {
  56. Container = "avi",
  57. VideoCodec = "mpeg4",
  58. AudioCodec = "ac3,mp3",
  59. Type = DlnaProfileType.Video
  60. },
  61. new DirectPlayProfile
  62. {
  63. Container = "avi",
  64. VideoCodec = "h264",
  65. AudioCodec = "aac",
  66. Type = DlnaProfileType.Video
  67. },
  68. new DirectPlayProfile
  69. {
  70. Container = "mp4,mov,mkv",
  71. VideoCodec = "h264,mpeg4",
  72. AudioCodec = "aac,ac3",
  73. Type = DlnaProfileType.Video
  74. },
  75. new DirectPlayProfile
  76. {
  77. Container = "asf",
  78. VideoCodec = "wmv2,wmv3,vc1",
  79. AudioCodec = "wmav2,wmapro",
  80. Type = DlnaProfileType.Video
  81. },
  82. new DirectPlayProfile
  83. {
  84. Container = "asf",
  85. AudioCodec = "wmav2,wmapro,wmavoice",
  86. Type = DlnaProfileType.Audio
  87. },
  88. new DirectPlayProfile
  89. {
  90. Container = "mp3",
  91. AudioCodec = "mp3",
  92. Type = DlnaProfileType.Audio
  93. },
  94. new DirectPlayProfile
  95. {
  96. Container = "jpeg",
  97. Type = DlnaProfileType.Photo
  98. }
  99. };
  100. ContainerProfiles = new[]
  101. {
  102. new ContainerProfile
  103. {
  104. Type = DlnaProfileType.Video,
  105. Container = "mp4,mov",
  106. Conditions = new []
  107. {
  108. new ProfileCondition
  109. {
  110. Condition = ProfileConditionType.Equals,
  111. Property = ProfileConditionValue.Has64BitOffsets,
  112. Value = "false",
  113. IsRequired = false
  114. }
  115. }
  116. }
  117. };
  118. CodecProfiles = new[]
  119. {
  120. new CodecProfile
  121. {
  122. Type = CodecType.Video,
  123. Conditions = new []
  124. {
  125. new ProfileCondition
  126. {
  127. Condition = ProfileConditionType.NotEquals,
  128. Property = ProfileConditionValue.IsAnamorphic,
  129. Value = "true",
  130. IsRequired = false
  131. },
  132. new ProfileCondition
  133. {
  134. Condition = ProfileConditionType.LessThanEqual,
  135. Property = ProfileConditionValue.VideoBitDepth,
  136. Value = "8",
  137. IsRequired = false
  138. }
  139. }
  140. },
  141. new CodecProfile
  142. {
  143. Type = CodecType.Video,
  144. Codec = "mpeg4",
  145. Conditions = new []
  146. {
  147. new ProfileCondition
  148. {
  149. Condition = ProfileConditionType.LessThanEqual,
  150. Property = ProfileConditionValue.Width,
  151. Value = "1920"
  152. },
  153. new ProfileCondition
  154. {
  155. Condition = ProfileConditionType.LessThanEqual,
  156. Property = ProfileConditionValue.Height,
  157. Value = "1080"
  158. },
  159. new ProfileCondition
  160. {
  161. Condition = ProfileConditionType.LessThanEqual,
  162. Property = ProfileConditionValue.VideoFramerate,
  163. Value = "30",
  164. IsRequired = false
  165. },
  166. new ProfileCondition
  167. {
  168. Condition = ProfileConditionType.LessThanEqual,
  169. Property = ProfileConditionValue.VideoBitrate,
  170. Value = "5120000",
  171. IsRequired = false
  172. }
  173. }
  174. },
  175. new CodecProfile
  176. {
  177. Type = CodecType.Video,
  178. Codec = "h264",
  179. Conditions = new []
  180. {
  181. new ProfileCondition
  182. {
  183. Condition = ProfileConditionType.LessThanEqual,
  184. Property = ProfileConditionValue.Width,
  185. Value = "1920"
  186. },
  187. new ProfileCondition
  188. {
  189. Condition = ProfileConditionType.LessThanEqual,
  190. Property = ProfileConditionValue.Height,
  191. Value = "1080"
  192. }
  193. }
  194. },
  195. new CodecProfile
  196. {
  197. Type = CodecType.Video,
  198. Codec = "wmv2,wmv3,vc1",
  199. Conditions = new []
  200. {
  201. new ProfileCondition
  202. {
  203. Condition = ProfileConditionType.LessThanEqual,
  204. Property = ProfileConditionValue.Width,
  205. Value = "1920"
  206. },
  207. new ProfileCondition
  208. {
  209. Condition = ProfileConditionType.LessThanEqual,
  210. Property = ProfileConditionValue.Height,
  211. Value = "1080"
  212. },
  213. new ProfileCondition
  214. {
  215. Condition = ProfileConditionType.LessThanEqual,
  216. Property = ProfileConditionValue.VideoFramerate,
  217. Value = "30",
  218. IsRequired = false
  219. },
  220. new ProfileCondition
  221. {
  222. Condition = ProfileConditionType.LessThanEqual,
  223. Property = ProfileConditionValue.VideoBitrate,
  224. Value = "15360000",
  225. IsRequired = false
  226. }
  227. }
  228. },
  229. new CodecProfile
  230. {
  231. Type = CodecType.VideoAudio,
  232. Codec = "ac3,wmav2,wmapro",
  233. Conditions = new []
  234. {
  235. new ProfileCondition
  236. {
  237. Condition = ProfileConditionType.LessThanEqual,
  238. Property = ProfileConditionValue.AudioChannels,
  239. Value = "6",
  240. IsRequired = false
  241. }
  242. }
  243. },
  244. new CodecProfile
  245. {
  246. Type = CodecType.VideoAudio,
  247. Codec = "aac",
  248. Conditions = new []
  249. {
  250. new ProfileCondition
  251. {
  252. Condition = ProfileConditionType.LessThanEqual,
  253. Property = ProfileConditionValue.AudioChannels,
  254. Value = "2",
  255. IsRequired = false
  256. },
  257. new ProfileCondition
  258. {
  259. Condition = ProfileConditionType.Equals,
  260. Property = ProfileConditionValue.AudioProfile,
  261. Value = "lc",
  262. IsRequired = false
  263. }
  264. }
  265. }
  266. };
  267. ResponseProfiles = new[]
  268. {
  269. new ResponseProfile
  270. {
  271. Container = "avi",
  272. MimeType = "video/avi",
  273. Type = DlnaProfileType.Video
  274. }
  275. };
  276. }
  277. }
  278. }