SonyBravia2011Profile.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. [XmlRoot("Profile")]
  6. public class SonyBravia2011Profile : DefaultProfile
  7. {
  8. public SonyBravia2011Profile()
  9. {
  10. Name = "Sony Bravia (2011)";
  11. Identification = new DeviceIdentification
  12. {
  13. FriendlyName = @"KDL-\d{2}([A-Z]X\d2\d|CX400).*",
  14. Manufacturer = "Sony",
  15. Headers = new[]
  16. {
  17. new HttpHeaderInfo
  18. {
  19. Name = "X-AV-Client-Info",
  20. Value = @".*KDL-\d{2}([A-Z]X\d2\d|CX400).*",
  21. Match = HeaderMatchType.Regex
  22. }
  23. }
  24. };
  25. AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
  26. AlbumArtPn = "JPEG_TN";
  27. ModelName = "Windows Media Player Sharing";
  28. ModelNumber = "3.0";
  29. ModelUrl = "http://www.microsoft.com/";
  30. Manufacturer = "Microsoft Corporation";
  31. ManufacturerUrl = "http://www.microsoft.com/";
  32. SonyAggregationFlags = "10";
  33. EnableSingleAlbumArtLimit = true;
  34. EnableAlbumArtInDidl = true;
  35. TranscodingProfiles = new[]
  36. {
  37. new TranscodingProfile
  38. {
  39. Container = "mp3",
  40. AudioCodec = "mp3",
  41. Type = DlnaProfileType.Audio
  42. },
  43. new TranscodingProfile
  44. {
  45. Container = "ts",
  46. VideoCodec = "h264",
  47. AudioCodec = "ac3",
  48. Type = DlnaProfileType.Video,
  49. EnableMpegtsM2TsMode = true
  50. },
  51. new TranscodingProfile
  52. {
  53. Container = "jpeg",
  54. Type = DlnaProfileType.Photo
  55. }
  56. };
  57. DirectPlayProfiles = new[]
  58. {
  59. new DirectPlayProfile
  60. {
  61. Container = "ts",
  62. VideoCodec = "h264",
  63. AudioCodec = "ac3,aac,mp3",
  64. Type = DlnaProfileType.Video
  65. },
  66. new DirectPlayProfile
  67. {
  68. Container = "ts",
  69. VideoCodec = "mpeg2video",
  70. AudioCodec = "mp3",
  71. Type = DlnaProfileType.Video
  72. },
  73. new DirectPlayProfile
  74. {
  75. Container = "mp4",
  76. VideoCodec = "h264,mpeg4",
  77. AudioCodec = "ac3,aac,mp3",
  78. Type = DlnaProfileType.Video
  79. },
  80. new DirectPlayProfile
  81. {
  82. Container = "mpeg",
  83. VideoCodec = "mpeg2video,mpeg1video",
  84. AudioCodec = "mp3",
  85. Type = DlnaProfileType.Video
  86. },
  87. new DirectPlayProfile
  88. {
  89. Container = "asf",
  90. VideoCodec = "wmv2,wmv3,vc1",
  91. AudioCodec = "wmav2,wmapro,wmavoice",
  92. Type = DlnaProfileType.Video
  93. },
  94. new DirectPlayProfile
  95. {
  96. Container = "mp3",
  97. AudioCodec = "mp3",
  98. Type = DlnaProfileType.Audio
  99. },
  100. new DirectPlayProfile
  101. {
  102. Container = "asf",
  103. AudioCodec = "wmav2,wmapro,wmavoice",
  104. Type = DlnaProfileType.Audio
  105. }
  106. };
  107. ContainerProfiles = new[]
  108. {
  109. new ContainerProfile
  110. {
  111. Type = DlnaProfileType.Photo,
  112. Conditions = new []
  113. {
  114. new ProfileCondition
  115. {
  116. Condition = ProfileConditionType.LessThanEqual,
  117. Property = ProfileConditionValue.Width,
  118. Value = "1920"
  119. },
  120. new ProfileCondition
  121. {
  122. Condition = ProfileConditionType.LessThanEqual,
  123. Property = ProfileConditionValue.Height,
  124. Value = "1080"
  125. }
  126. }
  127. }
  128. };
  129. ResponseProfiles = new[]
  130. {
  131. new ResponseProfile
  132. {
  133. Container = "ts",
  134. VideoCodec="h264",
  135. AudioCodec="ac3,aac,mp3",
  136. MimeType = "video/vnd.dlna.mpeg-tts",
  137. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  138. Type = DlnaProfileType.Video,
  139. Conditions = new []
  140. {
  141. new ProfileCondition
  142. {
  143. Condition = ProfileConditionType.Equals,
  144. Property = ProfileConditionValue.PacketLength,
  145. Value = "192"
  146. },
  147. new ProfileCondition
  148. {
  149. Condition = ProfileConditionType.Equals,
  150. Property = ProfileConditionValue.VideoTimestamp,
  151. Value = "Valid"
  152. }
  153. }
  154. },
  155. new ResponseProfile
  156. {
  157. Container = "ts",
  158. VideoCodec="h264",
  159. AudioCodec="ac3,aac,mp3",
  160. MimeType = "video/mpeg",
  161. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  162. Type = DlnaProfileType.Video,
  163. Conditions = new []
  164. {
  165. new ProfileCondition
  166. {
  167. Condition = ProfileConditionType.Equals,
  168. Property = ProfileConditionValue.PacketLength,
  169. Value = "188"
  170. }
  171. }
  172. },
  173. new ResponseProfile
  174. {
  175. Container = "ts",
  176. VideoCodec="h264",
  177. AudioCodec="ac3,aac,mp3",
  178. MimeType = "video/vnd.dlna.mpeg-tts",
  179. OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  180. Type = DlnaProfileType.Video
  181. },
  182. new ResponseProfile
  183. {
  184. Container = "ts",
  185. VideoCodec="mpeg2video",
  186. MimeType = "video/vnd.dlna.mpeg-tts",
  187. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  188. Type = DlnaProfileType.Video
  189. },
  190. new ResponseProfile
  191. {
  192. Container = "mpeg",
  193. VideoCodec="mpeg1video,mpeg2video",
  194. MimeType = "video/mpeg",
  195. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  196. Type = DlnaProfileType.Video
  197. }
  198. };
  199. CodecProfiles = new[]
  200. {
  201. new CodecProfile
  202. {
  203. Type = CodecType.Video,
  204. Codec = "h264",
  205. Conditions = new []
  206. {
  207. new ProfileCondition
  208. {
  209. Condition = ProfileConditionType.LessThanEqual,
  210. Property = ProfileConditionValue.Width,
  211. Value = "1920"
  212. },
  213. new ProfileCondition
  214. {
  215. Condition = ProfileConditionType.LessThanEqual,
  216. Property = ProfileConditionValue.Height,
  217. Value = "1080"
  218. },
  219. new ProfileCondition
  220. {
  221. Condition = ProfileConditionType.LessThanEqual,
  222. Property = ProfileConditionValue.VideoFramerate,
  223. Value = "30"
  224. },
  225. new ProfileCondition
  226. {
  227. Condition = ProfileConditionType.LessThanEqual,
  228. Property = ProfileConditionValue.VideoBitrate,
  229. Value = "20000000"
  230. },
  231. new ProfileCondition
  232. {
  233. Condition = ProfileConditionType.LessThanEqual,
  234. Property = ProfileConditionValue.VideoLevel,
  235. Value = "41"
  236. }
  237. }
  238. },
  239. new CodecProfile
  240. {
  241. Type = CodecType.Video,
  242. Codec = "mpeg2video",
  243. Conditions = new []
  244. {
  245. new ProfileCondition
  246. {
  247. Condition = ProfileConditionType.LessThanEqual,
  248. Property = ProfileConditionValue.Width,
  249. Value = "1920"
  250. },
  251. new ProfileCondition
  252. {
  253. Condition = ProfileConditionType.LessThanEqual,
  254. Property = ProfileConditionValue.Height,
  255. Value = "1080"
  256. },
  257. new ProfileCondition
  258. {
  259. Condition = ProfileConditionType.LessThanEqual,
  260. Property = ProfileConditionValue.VideoFramerate,
  261. Value = "30"
  262. },
  263. new ProfileCondition
  264. {
  265. Condition = ProfileConditionType.LessThanEqual,
  266. Property = ProfileConditionValue.VideoBitrate,
  267. Value = "20000000"
  268. }
  269. }
  270. },
  271. new CodecProfile
  272. {
  273. Type = CodecType.Video,
  274. Conditions = new []
  275. {
  276. new ProfileCondition
  277. {
  278. Condition = ProfileConditionType.LessThanEqual,
  279. Property = ProfileConditionValue.Width,
  280. Value = "1920"
  281. },
  282. new ProfileCondition
  283. {
  284. Condition = ProfileConditionType.LessThanEqual,
  285. Property = ProfileConditionValue.Height,
  286. Value = "1080"
  287. },
  288. new ProfileCondition
  289. {
  290. Condition = ProfileConditionType.LessThanEqual,
  291. Property = ProfileConditionValue.VideoFramerate,
  292. Value = "30"
  293. }
  294. }
  295. },
  296. new CodecProfile
  297. {
  298. Type = CodecType.VideoAudio,
  299. Codec = "ac3",
  300. Conditions = new []
  301. {
  302. new ProfileCondition
  303. {
  304. Condition = ProfileConditionType.LessThanEqual,
  305. Property = ProfileConditionValue.AudioChannels,
  306. Value = "6"
  307. }
  308. }
  309. },
  310. new CodecProfile
  311. {
  312. Type = CodecType.VideoAudio,
  313. Codec = "aac",
  314. Conditions = new[]
  315. {
  316. new ProfileCondition
  317. {
  318. Condition = ProfileConditionType.LessThanEqual,
  319. Property = ProfileConditionValue.AudioChannels,
  320. Value = "2"
  321. },
  322. new ProfileCondition
  323. {
  324. Condition = ProfileConditionType.NotEquals,
  325. Property = ProfileConditionValue.AudioProfile,
  326. Value = "he-aac"
  327. }
  328. }
  329. },
  330. new CodecProfile
  331. {
  332. Type = CodecType.VideoAudio,
  333. Codec = "mp3,mp2",
  334. Conditions = new []
  335. {
  336. new ProfileCondition
  337. {
  338. Condition = ProfileConditionType.LessThanEqual,
  339. Property = ProfileConditionValue.AudioChannels,
  340. Value = "2"
  341. }
  342. }
  343. }
  344. };
  345. }
  346. }
  347. }