Xbox360Profile.cs 11 KB

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