SonyBravia2011Profile.cs 13 KB

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