2
0

Xbox360Profile.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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 Connect";
  17. ModelNumber = "12.0";
  18. FriendlyName = "${HostName} : 1 : Windows Media Connect";
  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. Identification = new DeviceIdentification
  27. {
  28. ModelName = "Xbox 360",
  29. Headers = new[]
  30. {
  31. new HttpHeaderInfo {Name = "User-Agent", Value = "Xbox", Match = HeaderMatchType.Substring},
  32. new HttpHeaderInfo {Name = "User-Agent", Value = "Xenon", Match = HeaderMatchType.Substring}
  33. }
  34. };
  35. TranscodingProfiles = new[]
  36. {
  37. new TranscodingProfile
  38. {
  39. Container = "mp3",
  40. AudioCodec = "mp3",
  41. Type = DlnaProfileType.Audio
  42. },
  43. new TranscodingProfile
  44. {
  45. Container = "asf",
  46. VideoCodec = "wmv2",
  47. AudioCodec = "wmav2",
  48. Type = DlnaProfileType.Video,
  49. TranscodeSeekInfo = TranscodeSeekInfo.Bytes,
  50. EstimateContentLength = true
  51. },
  52. new TranscodingProfile
  53. {
  54. Container = "jpeg",
  55. Type = DlnaProfileType.Photo
  56. }
  57. };
  58. DirectPlayProfiles = new[]
  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",
  77. VideoCodec = "h264,mpeg4",
  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. ResponseProfiles = new[]
  107. {
  108. new ResponseProfile
  109. {
  110. Container = "avi",
  111. MimeType = "video/avi",
  112. Type = DlnaProfileType.Video
  113. }
  114. };
  115. ContainerProfiles = new[]
  116. {
  117. new ContainerProfile
  118. {
  119. Type = DlnaProfileType.Video,
  120. Container = "mp4,mov",
  121. Conditions = new []
  122. {
  123. new ProfileCondition
  124. {
  125. Condition = ProfileConditionType.Equals,
  126. Property = ProfileConditionValue.Has64BitOffsets,
  127. Value = "false",
  128. IsRequired = false
  129. }
  130. }
  131. },
  132. new ContainerProfile
  133. {
  134. Type = DlnaProfileType.Photo,
  135. Conditions = new []
  136. {
  137. new ProfileCondition
  138. {
  139. Condition = ProfileConditionType.LessThanEqual,
  140. Property = ProfileConditionValue.Width,
  141. Value = "1920"
  142. },
  143. new ProfileCondition
  144. {
  145. Condition = ProfileConditionType.LessThanEqual,
  146. Property = ProfileConditionValue.Height,
  147. Value = "1080"
  148. }
  149. }
  150. }
  151. };
  152. CodecProfiles = new[]
  153. {
  154. new CodecProfile
  155. {
  156. Type = CodecType.Video,
  157. Codec = "mpeg4",
  158. Conditions = new []
  159. {
  160. new ProfileCondition
  161. {
  162. Condition = ProfileConditionType.LessThanEqual,
  163. Property = ProfileConditionValue.Width,
  164. Value = "1280"
  165. },
  166. new ProfileCondition
  167. {
  168. Condition = ProfileConditionType.LessThanEqual,
  169. Property = ProfileConditionValue.Height,
  170. Value = "720"
  171. },
  172. new ProfileCondition
  173. {
  174. Condition = ProfileConditionType.LessThanEqual,
  175. Property = ProfileConditionValue.VideoFramerate,
  176. Value = "30",
  177. IsRequired = false
  178. },
  179. new ProfileCondition
  180. {
  181. Condition = ProfileConditionType.LessThanEqual,
  182. Property = ProfileConditionValue.VideoBitrate,
  183. Value = "5120000",
  184. IsRequired = false
  185. }
  186. }
  187. },
  188. new CodecProfile
  189. {
  190. Type = CodecType.Video,
  191. Codec = "h264",
  192. Conditions = new []
  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 = "41",
  211. IsRequired = false
  212. },
  213. new ProfileCondition
  214. {
  215. Condition = ProfileConditionType.LessThanEqual,
  216. Property = ProfileConditionValue.VideoBitrate,
  217. Value = "10240000",
  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.LessThanEqual,
  231. Property = ProfileConditionValue.Width,
  232. Value = "1920"
  233. },
  234. new ProfileCondition
  235. {
  236. Condition = ProfileConditionType.LessThanEqual,
  237. Property = ProfileConditionValue.Height,
  238. Value = "1080"
  239. },
  240. new ProfileCondition
  241. {
  242. Condition = ProfileConditionType.LessThanEqual,
  243. Property = ProfileConditionValue.VideoFramerate,
  244. Value = "30",
  245. IsRequired = false
  246. },
  247. new ProfileCondition
  248. {
  249. Condition = ProfileConditionType.LessThanEqual,
  250. Property = ProfileConditionValue.VideoBitrate,
  251. Value = "15360000",
  252. IsRequired = false
  253. }
  254. }
  255. },
  256. new CodecProfile
  257. {
  258. Type = CodecType.VideoAudio,
  259. Codec = "ac3,wmav2,wmapro",
  260. Conditions = new []
  261. {
  262. new ProfileCondition
  263. {
  264. Condition = ProfileConditionType.LessThanEqual,
  265. Property = ProfileConditionValue.AudioChannels,
  266. Value = "6",
  267. IsRequired = false
  268. }
  269. }
  270. },
  271. new CodecProfile
  272. {
  273. Type = CodecType.VideoAudio,
  274. Codec = "aac",
  275. Conditions = new []
  276. {
  277. new ProfileCondition
  278. {
  279. Condition = ProfileConditionType.LessThanEqual,
  280. Property = ProfileConditionValue.AudioChannels,
  281. Value = "2",
  282. IsRequired = false
  283. },
  284. new ProfileCondition
  285. {
  286. Condition = ProfileConditionType.Equals,
  287. Property = ProfileConditionValue.AudioProfile,
  288. Value = "lc",
  289. IsRequired = false
  290. }
  291. }
  292. }
  293. };
  294. }
  295. }
  296. }