XboxOneProfile.cs 14 KB

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