Xbox360Profile.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. /// <summary>
  6. /// Good info on xbox 360 requirements: https://code.google.com/p/jems/wiki/XBox360Notes
  7. /// </summary>
  8. [XmlRoot("Profile")]
  9. public class Xbox360Profile : DefaultProfile
  10. {
  11. public Xbox360Profile()
  12. {
  13. Name = "Xbox 360";
  14. // Required according to above
  15. ModelName = "Windows Media Player Sharing";
  16. ModelNumber = "12.0";
  17. FriendlyName = "${HostName}: 1";
  18. ModelUrl = "http://go.microsoft.com/fwlink/?LinkId=105926";
  19. Manufacturer = "Microsoft Corporation";
  20. ManufacturerUrl = "http://www.microsoft.com";
  21. XDlnaDoc = "DMS-1.50";
  22. ModelDescription = "Emby : UPnP Media Server";
  23. TimelineOffsetSeconds = 40;
  24. RequiresPlainFolders = true;
  25. RequiresPlainVideoItems = true;
  26. EnableMSMediaReceiverRegistrar = true;
  27. EnableDlnaProtocol = false;
  28. Identification = new DeviceIdentification
  29. {
  30. ModelName = "Xbox 360",
  31. Headers = new[]
  32. {
  33. new HttpHeaderInfo {Name = "User-Agent", Value = "Xbox", Match = HeaderMatchType.Substring},
  34. new HttpHeaderInfo {Name = "User-Agent", Value = "Xenon", Match = HeaderMatchType.Substring}
  35. }
  36. };
  37. TranscodingProfiles = new[]
  38. {
  39. new TranscodingProfile
  40. {
  41. Container = "mp3",
  42. AudioCodec = "mp3",
  43. Type = DlnaProfileType.Audio
  44. },
  45. new TranscodingProfile
  46. {
  47. Container = "asf",
  48. VideoCodec = "wmv2",
  49. AudioCodec = "wmav2",
  50. Type = DlnaProfileType.Video,
  51. TranscodeSeekInfo = TranscodeSeekInfo.Bytes,
  52. EstimateContentLength = true
  53. },
  54. new TranscodingProfile
  55. {
  56. Container = "jpeg",
  57. Type = DlnaProfileType.Photo
  58. }
  59. };
  60. DirectPlayProfiles = new[]
  61. {
  62. new DirectPlayProfile
  63. {
  64. Container = "avi",
  65. VideoCodec = "mpeg4",
  66. AudioCodec = "ac3,mp3",
  67. Type = DlnaProfileType.Video
  68. },
  69. new DirectPlayProfile
  70. {
  71. Container = "avi",
  72. VideoCodec = "h264",
  73. AudioCodec = "aac",
  74. Type = DlnaProfileType.Video
  75. },
  76. new DirectPlayProfile
  77. {
  78. Container = "mp4,mov",
  79. VideoCodec = "h264,mpeg4",
  80. AudioCodec = "aac,ac3",
  81. Type = DlnaProfileType.Video
  82. },
  83. new DirectPlayProfile
  84. {
  85. Container = "asf",
  86. VideoCodec = "wmv2,wmv3,vc1",
  87. AudioCodec = "wmav2,wmapro",
  88. Type = DlnaProfileType.Video
  89. },
  90. new DirectPlayProfile
  91. {
  92. Container = "asf",
  93. AudioCodec = "wmav2,wmapro,wmavoice",
  94. Type = DlnaProfileType.Audio
  95. },
  96. new DirectPlayProfile
  97. {
  98. Container = "mp3",
  99. AudioCodec = "mp3",
  100. Type = DlnaProfileType.Audio
  101. },
  102. new DirectPlayProfile
  103. {
  104. Container = "jpeg",
  105. Type = DlnaProfileType.Photo
  106. }
  107. };
  108. ResponseProfiles = new[]
  109. {
  110. new ResponseProfile
  111. {
  112. Container = "avi",
  113. MimeType = "video/avi",
  114. Type = DlnaProfileType.Video
  115. }
  116. };
  117. ContainerProfiles = new[]
  118. {
  119. new ContainerProfile
  120. {
  121. Type = DlnaProfileType.Video,
  122. Container = "mp4,mov",
  123. Conditions = new []
  124. {
  125. new ProfileCondition
  126. {
  127. Condition = ProfileConditionType.Equals,
  128. Property = ProfileConditionValue.Has64BitOffsets,
  129. Value = "false",
  130. IsRequired = false
  131. }
  132. }
  133. },
  134. new ContainerProfile
  135. {
  136. Type = DlnaProfileType.Photo,
  137. Conditions = new []
  138. {
  139. new ProfileCondition
  140. {
  141. Condition = ProfileConditionType.LessThanEqual,
  142. Property = ProfileConditionValue.Width,
  143. Value = "1920"
  144. },
  145. new ProfileCondition
  146. {
  147. Condition = ProfileConditionType.LessThanEqual,
  148. Property = ProfileConditionValue.Height,
  149. Value = "1080"
  150. }
  151. }
  152. }
  153. };
  154. CodecProfiles = new[]
  155. {
  156. new CodecProfile
  157. {
  158. Type = CodecType.Video,
  159. Codec = "mpeg4",
  160. Conditions = new []
  161. {
  162. new ProfileCondition
  163. {
  164. Condition = ProfileConditionType.LessThanEqual,
  165. Property = ProfileConditionValue.Width,
  166. Value = "1280"
  167. },
  168. new ProfileCondition
  169. {
  170. Condition = ProfileConditionType.LessThanEqual,
  171. Property = ProfileConditionValue.Height,
  172. Value = "720"
  173. },
  174. new ProfileCondition
  175. {
  176. Condition = ProfileConditionType.LessThanEqual,
  177. Property = ProfileConditionValue.VideoFramerate,
  178. Value = "30",
  179. IsRequired = false
  180. },
  181. new ProfileCondition
  182. {
  183. Condition = ProfileConditionType.LessThanEqual,
  184. Property = ProfileConditionValue.VideoBitrate,
  185. Value = "5120000",
  186. IsRequired = false
  187. }
  188. }
  189. },
  190. new CodecProfile
  191. {
  192. Type = CodecType.Video,
  193. Codec = "h264",
  194. Conditions = new []
  195. {
  196. new ProfileCondition
  197. {
  198. Condition = ProfileConditionType.LessThanEqual,
  199. Property = ProfileConditionValue.Width,
  200. Value = "1920"
  201. },
  202. new ProfileCondition
  203. {
  204. Condition = ProfileConditionType.LessThanEqual,
  205. Property = ProfileConditionValue.Height,
  206. Value = "1080"
  207. },
  208. new ProfileCondition
  209. {
  210. Condition = ProfileConditionType.LessThanEqual,
  211. Property = ProfileConditionValue.VideoLevel,
  212. Value = "41",
  213. IsRequired = false
  214. },
  215. new ProfileCondition
  216. {
  217. Condition = ProfileConditionType.LessThanEqual,
  218. Property = ProfileConditionValue.VideoBitrate,
  219. Value = "10240000",
  220. IsRequired = false
  221. }
  222. }
  223. },
  224. new CodecProfile
  225. {
  226. Type = CodecType.Video,
  227. Codec = "wmv2,wmv3,vc1",
  228. Conditions = new []
  229. {
  230. new ProfileCondition
  231. {
  232. Condition = ProfileConditionType.LessThanEqual,
  233. Property = ProfileConditionValue.Width,
  234. Value = "1920"
  235. },
  236. new ProfileCondition
  237. {
  238. Condition = ProfileConditionType.LessThanEqual,
  239. Property = ProfileConditionValue.Height,
  240. Value = "1080"
  241. },
  242. new ProfileCondition
  243. {
  244. Condition = ProfileConditionType.LessThanEqual,
  245. Property = ProfileConditionValue.VideoFramerate,
  246. Value = "30",
  247. IsRequired = false
  248. },
  249. new ProfileCondition
  250. {
  251. Condition = ProfileConditionType.LessThanEqual,
  252. Property = ProfileConditionValue.VideoBitrate,
  253. Value = "15360000",
  254. IsRequired = false
  255. }
  256. }
  257. },
  258. new CodecProfile
  259. {
  260. Type = CodecType.VideoAudio,
  261. Codec = "ac3,wmav2,wmapro",
  262. Conditions = new []
  263. {
  264. new ProfileCondition
  265. {
  266. Condition = ProfileConditionType.LessThanEqual,
  267. Property = ProfileConditionValue.AudioChannels,
  268. Value = "6",
  269. IsRequired = false
  270. }
  271. }
  272. },
  273. new CodecProfile
  274. {
  275. Type = CodecType.VideoAudio,
  276. Codec = "aac",
  277. Conditions = new []
  278. {
  279. new ProfileCondition
  280. {
  281. Condition = ProfileConditionType.LessThanEqual,
  282. Property = ProfileConditionValue.AudioChannels,
  283. Value = "2",
  284. IsRequired = false
  285. },
  286. new ProfileCondition
  287. {
  288. Condition = ProfileConditionType.Equals,
  289. Property = ProfileConditionValue.AudioProfile,
  290. Value = "lc",
  291. IsRequired = false
  292. }
  293. }
  294. }
  295. };
  296. }
  297. }
  298. }