Xbox360Profile.cs 11 KB

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