Xbox360Profile.cs 12 KB

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