Xbox360Profile.cs 11 KB

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