Xbox360Profile.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. using MediaBrowser.Model.Dlna.Profiles;
  4. namespace MediaBrowser.Dlna.Profiles
  5. {
  6. /// <summary>
  7. /// Good info on xbox 360 requirements: https://code.google.com/p/jems/wiki/XBox360Notes
  8. /// </summary>
  9. [XmlRoot("Profile")]
  10. public class Xbox360Profile : DefaultProfile
  11. {
  12. public Xbox360Profile()
  13. {
  14. Name = "Xbox 360";
  15. // Required according to above
  16. ModelName = "Windows Media Player Sharing";
  17. ModelNumber = "12.0";
  18. FriendlyName = "${HostName} : 1";
  19. ModelUrl = "http://www.microsoft.com/";
  20. Manufacturer = "Microsoft Corporation";
  21. ManufacturerUrl = "http://www.microsoft.com/";
  22. XDlnaDoc = "DMS-1.50";
  23. TimelineOffsetSeconds = 40;
  24. RequiresPlainFolders = true;
  25. RequiresPlainVideoItems = true;
  26. EnableMSMediaReceiverRegistrar = true;
  27. Identification = new DeviceIdentification
  28. {
  29. ModelName = "Xbox 360",
  30. Headers = new[]
  31. {
  32. new HttpHeaderInfo {Name = "User-Agent", Value = "Xbox", Match = HeaderMatchType.Substring},
  33. new HttpHeaderInfo {Name = "User-Agent", Value = "Xenon", Match = HeaderMatchType.Substring}
  34. }
  35. };
  36. TranscodingProfiles = new[]
  37. {
  38. new TranscodingProfile
  39. {
  40. Container = "mp3",
  41. AudioCodec = "mp3",
  42. Type = DlnaProfileType.Audio
  43. },
  44. new TranscodingProfile
  45. {
  46. Container = "asf",
  47. VideoCodec = "wmv2",
  48. AudioCodec = "wmav2",
  49. Type = DlnaProfileType.Video,
  50. TranscodeSeekInfo = TranscodeSeekInfo.Bytes,
  51. EstimateContentLength = true
  52. },
  53. new TranscodingProfile
  54. {
  55. Container = "jpeg",
  56. Type = DlnaProfileType.Photo
  57. }
  58. };
  59. DirectPlayProfiles = new[]
  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",
  78. VideoCodec = "h264,mpeg4",
  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. ResponseProfiles = new[]
  108. {
  109. new ResponseProfile
  110. {
  111. Container = "avi",
  112. MimeType = "video/avi",
  113. Type = DlnaProfileType.Video
  114. }
  115. };
  116. ContainerProfiles = new[]
  117. {
  118. new ContainerProfile
  119. {
  120. Type = DlnaProfileType.Video,
  121. Container = "mp4,mov",
  122. Conditions = new []
  123. {
  124. new ProfileCondition
  125. {
  126. Condition = ProfileConditionType.Equals,
  127. Property = ProfileConditionValue.Has64BitOffsets,
  128. Value = "false",
  129. IsRequired = false
  130. }
  131. }
  132. },
  133. new ContainerProfile
  134. {
  135. Type = DlnaProfileType.Photo,
  136. Conditions = new []
  137. {
  138. new ProfileCondition
  139. {
  140. Condition = ProfileConditionType.LessThanEqual,
  141. Property = ProfileConditionValue.Width,
  142. Value = "1920"
  143. },
  144. new ProfileCondition
  145. {
  146. Condition = ProfileConditionType.LessThanEqual,
  147. Property = ProfileConditionValue.Height,
  148. Value = "1080"
  149. }
  150. }
  151. }
  152. };
  153. CodecProfiles = new[]
  154. {
  155. new CodecProfile
  156. {
  157. Type = CodecType.Video,
  158. Codec = "mpeg4",
  159. Conditions = new []
  160. {
  161. new ProfileCondition
  162. {
  163. Condition = ProfileConditionType.LessThanEqual,
  164. Property = ProfileConditionValue.Width,
  165. Value = "1280"
  166. },
  167. new ProfileCondition
  168. {
  169. Condition = ProfileConditionType.LessThanEqual,
  170. Property = ProfileConditionValue.Height,
  171. Value = "720"
  172. },
  173. new ProfileCondition
  174. {
  175. Condition = ProfileConditionType.LessThanEqual,
  176. Property = ProfileConditionValue.VideoFramerate,
  177. Value = "30",
  178. IsRequired = false
  179. },
  180. new ProfileCondition
  181. {
  182. Condition = ProfileConditionType.LessThanEqual,
  183. Property = ProfileConditionValue.VideoBitrate,
  184. Value = "5120000",
  185. IsRequired = false
  186. }
  187. }
  188. },
  189. new CodecProfile
  190. {
  191. Type = CodecType.Video,
  192. Codec = "h264",
  193. Conditions = new []
  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 = "41",
  212. IsRequired = false
  213. },
  214. new ProfileCondition
  215. {
  216. Condition = ProfileConditionType.LessThanEqual,
  217. Property = ProfileConditionValue.VideoBitrate,
  218. Value = "10240000",
  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.LessThanEqual,
  232. Property = ProfileConditionValue.Width,
  233. Value = "1920"
  234. },
  235. new ProfileCondition
  236. {
  237. Condition = ProfileConditionType.LessThanEqual,
  238. Property = ProfileConditionValue.Height,
  239. Value = "1080"
  240. },
  241. new ProfileCondition
  242. {
  243. Condition = ProfileConditionType.LessThanEqual,
  244. Property = ProfileConditionValue.VideoFramerate,
  245. Value = "30",
  246. IsRequired = false
  247. },
  248. new ProfileCondition
  249. {
  250. Condition = ProfileConditionType.LessThanEqual,
  251. Property = ProfileConditionValue.VideoBitrate,
  252. Value = "15360000",
  253. IsRequired = false
  254. }
  255. }
  256. },
  257. new CodecProfile
  258. {
  259. Type = CodecType.VideoAudio,
  260. Codec = "ac3,wmav2,wmapro",
  261. Conditions = new []
  262. {
  263. new ProfileCondition
  264. {
  265. Condition = ProfileConditionType.LessThanEqual,
  266. Property = ProfileConditionValue.AudioChannels,
  267. Value = "6",
  268. IsRequired = false
  269. }
  270. }
  271. },
  272. new CodecProfile
  273. {
  274. Type = CodecType.VideoAudio,
  275. Codec = "aac",
  276. Conditions = new []
  277. {
  278. new ProfileCondition
  279. {
  280. Condition = ProfileConditionType.LessThanEqual,
  281. Property = ProfileConditionValue.AudioChannels,
  282. Value = "2",
  283. IsRequired = false
  284. },
  285. new ProfileCondition
  286. {
  287. Condition = ProfileConditionType.Equals,
  288. Property = ProfileConditionValue.AudioProfile,
  289. Value = "lc",
  290. IsRequired = false
  291. }
  292. }
  293. }
  294. };
  295. }
  296. }
  297. }