XboxOneProfile.cs 14 KB

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