XboxOneProfile.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. #pragma warning disable CS1591
  2. #pragma warning disable SA1600
  3. using MediaBrowser.Model.Dlna;
  4. namespace Emby.Dlna.Profiles
  5. {
  6. [System.Xml.Serialization.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. Headers = new[]
  17. {
  18. new HttpHeaderInfo
  19. {
  20. Name = "FriendlyName.DLNA.ORG", Value = "XboxOne", Match = HeaderMatchType.Substring
  21. },
  22. new HttpHeaderInfo
  23. {
  24. Name = "User-Agent", Value = "NSPlayer/12", Match = HeaderMatchType.Substring
  25. }
  26. }
  27. };
  28. var videoProfile = "high|main|baseline|constrained baseline";
  29. var videoLevel = "41";
  30. TranscodingProfiles = new[]
  31. {
  32. new TranscodingProfile
  33. {
  34. Container = "mp3",
  35. AudioCodec = "mp3",
  36. Type = DlnaProfileType.Audio
  37. },
  38. new TranscodingProfile
  39. {
  40. Container = "jpeg",
  41. VideoCodec = "jpeg",
  42. Type = DlnaProfileType.Photo
  43. },
  44. new TranscodingProfile
  45. {
  46. Container = "ts",
  47. VideoCodec = "h264",
  48. AudioCodec = "aac",
  49. Type = DlnaProfileType.Video
  50. }
  51. };
  52. DirectPlayProfiles = new[]
  53. {
  54. new DirectPlayProfile
  55. {
  56. Container = "ts,mpegts",
  57. VideoCodec = "h264,mpeg2video,hevc",
  58. AudioCodec = "ac3,aac,mp3",
  59. Type = DlnaProfileType.Video
  60. },
  61. new DirectPlayProfile
  62. {
  63. Container = "avi",
  64. VideoCodec = "mpeg4",
  65. AudioCodec = "ac3,mp3",
  66. Type = DlnaProfileType.Video
  67. },
  68. new DirectPlayProfile
  69. {
  70. Container = "avi",
  71. VideoCodec = "h264",
  72. AudioCodec = "aac",
  73. Type = DlnaProfileType.Video
  74. },
  75. new DirectPlayProfile
  76. {
  77. Container = "mp4,mov,mkv,m4v",
  78. VideoCodec = "h264,mpeg4,mpeg2video,hevc",
  79. AudioCodec = "aac,ac3",
  80. Type = DlnaProfileType.Video
  81. },
  82. new DirectPlayProfile
  83. {
  84. Container = "asf",
  85. VideoCodec = "wmv2,wmv3,vc1",
  86. AudioCodec = "wmav2,wmapro",
  87. Type = DlnaProfileType.Video
  88. },
  89. new DirectPlayProfile
  90. {
  91. Container = "asf",
  92. AudioCodec = "wmav2,wmapro,wmavoice",
  93. Type = DlnaProfileType.Audio
  94. },
  95. new DirectPlayProfile
  96. {
  97. Container = "mp3",
  98. AudioCodec = "mp3",
  99. Type = DlnaProfileType.Audio
  100. },
  101. new DirectPlayProfile
  102. {
  103. Container = "jpeg",
  104. Type = DlnaProfileType.Photo
  105. }
  106. };
  107. ContainerProfiles = new[]
  108. {
  109. new ContainerProfile
  110. {
  111. Type = DlnaProfileType.Video,
  112. Container = "mp4,mov",
  113. Conditions = new []
  114. {
  115. new ProfileCondition
  116. {
  117. Condition = ProfileConditionType.Equals,
  118. Property = ProfileConditionValue.Has64BitOffsets,
  119. Value = "false",
  120. IsRequired = false
  121. }
  122. }
  123. }
  124. };
  125. CodecProfiles = new[]
  126. {
  127. new CodecProfile
  128. {
  129. Type = CodecType.Video,
  130. Codec = "mpeg4",
  131. Conditions = new []
  132. {
  133. new ProfileCondition
  134. {
  135. Condition = ProfileConditionType.NotEquals,
  136. Property = ProfileConditionValue.IsAnamorphic,
  137. Value = "true",
  138. IsRequired = false
  139. },
  140. new ProfileCondition
  141. {
  142. Condition = ProfileConditionType.LessThanEqual,
  143. Property = ProfileConditionValue.VideoBitDepth,
  144. Value = "8",
  145. IsRequired = false
  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.NotEquals,
  184. Property = ProfileConditionValue.IsAnamorphic,
  185. Value = "true",
  186. IsRequired = false
  187. },
  188. new ProfileCondition
  189. {
  190. Condition = ProfileConditionType.LessThanEqual,
  191. Property = ProfileConditionValue.VideoBitDepth,
  192. Value = "8",
  193. IsRequired = false
  194. },
  195. new ProfileCondition
  196. {
  197. Condition = ProfileConditionType.LessThanEqual,
  198. Property = ProfileConditionValue.Width,
  199. Value = "1920"
  200. },
  201. new ProfileCondition
  202. {
  203. Condition = ProfileConditionType.LessThanEqual,
  204. Property = ProfileConditionValue.Height,
  205. Value = "1080"
  206. },
  207. new ProfileCondition
  208. {
  209. Condition = ProfileConditionType.LessThanEqual,
  210. Property = ProfileConditionValue.VideoLevel,
  211. Value = videoLevel,
  212. IsRequired = false
  213. },
  214. new ProfileCondition
  215. {
  216. Condition = ProfileConditionType.EqualsAny,
  217. Property = ProfileConditionValue.VideoProfile,
  218. Value = videoProfile,
  219. IsRequired = false
  220. }
  221. }
  222. },
  223. new CodecProfile
  224. {
  225. Type = CodecType.Video,
  226. Codec = "wmv2,wmv3,vc1",
  227. Conditions = new []
  228. {
  229. new ProfileCondition
  230. {
  231. Condition = ProfileConditionType.NotEquals,
  232. Property = ProfileConditionValue.IsAnamorphic,
  233. Value = "true",
  234. IsRequired = false
  235. },
  236. new ProfileCondition
  237. {
  238. Condition = ProfileConditionType.LessThanEqual,
  239. Property = ProfileConditionValue.VideoBitDepth,
  240. Value = "8",
  241. IsRequired = false
  242. },
  243. new ProfileCondition
  244. {
  245. Condition = ProfileConditionType.LessThanEqual,
  246. Property = ProfileConditionValue.Width,
  247. Value = "1920"
  248. },
  249. new ProfileCondition
  250. {
  251. Condition = ProfileConditionType.LessThanEqual,
  252. Property = ProfileConditionValue.Height,
  253. Value = "1080"
  254. },
  255. new ProfileCondition
  256. {
  257. Condition = ProfileConditionType.LessThanEqual,
  258. Property = ProfileConditionValue.VideoFramerate,
  259. Value = "30",
  260. IsRequired = false
  261. },
  262. new ProfileCondition
  263. {
  264. Condition = ProfileConditionType.LessThanEqual,
  265. Property = ProfileConditionValue.VideoBitrate,
  266. Value = "15360000",
  267. IsRequired = false
  268. }
  269. }
  270. },
  271. new CodecProfile
  272. {
  273. Type = CodecType.Video,
  274. Conditions = new []
  275. {
  276. new ProfileCondition
  277. {
  278. Condition = ProfileConditionType.NotEquals,
  279. Property = ProfileConditionValue.IsAnamorphic,
  280. Value = "true",
  281. IsRequired = false
  282. },
  283. new ProfileCondition
  284. {
  285. Condition = ProfileConditionType.LessThanEqual,
  286. Property = ProfileConditionValue.VideoBitDepth,
  287. Value = "8",
  288. IsRequired = false
  289. }
  290. }
  291. },
  292. new CodecProfile
  293. {
  294. Type = CodecType.VideoAudio,
  295. Codec = "ac3,wmav2,wmapro",
  296. Conditions = new []
  297. {
  298. new ProfileCondition
  299. {
  300. Condition = ProfileConditionType.LessThanEqual,
  301. Property = ProfileConditionValue.AudioChannels,
  302. Value = "6",
  303. IsRequired = false
  304. }
  305. }
  306. },
  307. new CodecProfile
  308. {
  309. Type = CodecType.VideoAudio,
  310. Codec = "aac",
  311. Conditions = new []
  312. {
  313. new ProfileCondition
  314. {
  315. Condition = ProfileConditionType.LessThanEqual,
  316. Property = ProfileConditionValue.AudioChannels,
  317. Value = "2",
  318. IsRequired = false
  319. },
  320. new ProfileCondition
  321. {
  322. Condition = ProfileConditionType.Equals,
  323. Property = ProfileConditionValue.AudioProfile,
  324. Value = "lc",
  325. IsRequired = false
  326. }
  327. }
  328. }
  329. };
  330. ResponseProfiles = new[]
  331. {
  332. new ResponseProfile
  333. {
  334. Container = "avi",
  335. MimeType = "video/avi",
  336. Type = DlnaProfileType.Video
  337. },
  338. new ResponseProfile
  339. {
  340. Container = "m4v",
  341. Type = DlnaProfileType.Video,
  342. MimeType = "video/mp4"
  343. }
  344. };
  345. SubtitleProfiles = new[]
  346. {
  347. new SubtitleProfile
  348. {
  349. Format = "srt",
  350. Method = SubtitleDeliveryMethod.Embed
  351. }
  352. };
  353. }
  354. }
  355. }