SonyBravia2011Profile.cs 13 KB

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