2
0

Xbox360Profile.cs 11 KB

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