SonyBravia2010Profile.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. [XmlRoot("Profile")]
  6. public class SonyBravia2010Profile : DefaultProfile
  7. {
  8. public SonyBravia2010Profile()
  9. {
  10. Name = "Sony Bravia (2010)";
  11. Identification = new DeviceIdentification
  12. {
  13. FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*",
  14. Manufacturer = "Sony",
  15. Headers = new[]
  16. {
  17. new HttpHeaderInfo
  18. {
  19. Name = "X-AV-Client-Info",
  20. Value = @".*KDL-\d{2}[EHLNPB]X\d[01]\d.*",
  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. ProtocolInfo =
  41. "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
  42. EnableSingleAlbumArtLimit = true;
  43. TranscodingProfiles = new[]
  44. {
  45. new TranscodingProfile
  46. {
  47. Container = "mp3",
  48. AudioCodec = "mp3",
  49. Type = DlnaProfileType.Audio
  50. },
  51. new TranscodingProfile
  52. {
  53. Container = "ts",
  54. VideoCodec = "h264",
  55. AudioCodec = "ac3,aac",
  56. Type = DlnaProfileType.Video,
  57. EnableMpegtsM2TsMode = true
  58. },
  59. new TranscodingProfile
  60. {
  61. Container = "jpeg",
  62. Type = DlnaProfileType.Photo
  63. }
  64. };
  65. DirectPlayProfiles = new[]
  66. {
  67. new DirectPlayProfile
  68. {
  69. Container = "ts",
  70. VideoCodec = "h264",
  71. AudioCodec = "ac3,aac,mp3",
  72. Type = DlnaProfileType.Video
  73. },
  74. new DirectPlayProfile
  75. {
  76. Container = "ts",
  77. VideoCodec = "mpeg1video,mpeg2video",
  78. AudioCodec = "mp3,mp2",
  79. Type = DlnaProfileType.Video
  80. },
  81. new DirectPlayProfile
  82. {
  83. Container = "mpeg",
  84. VideoCodec = "mpeg2video,mpeg1video",
  85. AudioCodec = "mp3,mp2",
  86. Type = DlnaProfileType.Video
  87. },
  88. new DirectPlayProfile
  89. {
  90. Container = "mp3",
  91. AudioCodec = "mp3",
  92. Type = DlnaProfileType.Audio
  93. }
  94. };
  95. ResponseProfiles = new[]
  96. {
  97. new ResponseProfile
  98. {
  99. Container = "ts",
  100. VideoCodec="h264",
  101. AudioCodec="ac3,aac,mp3",
  102. MimeType = "video/vnd.dlna.mpeg-tts",
  103. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  104. Type = DlnaProfileType.Video,
  105. Conditions = new []
  106. {
  107. new ProfileCondition
  108. {
  109. Condition = ProfileConditionType.Equals,
  110. Property = ProfileConditionValue.PacketLength,
  111. Value = "192"
  112. },
  113. new ProfileCondition
  114. {
  115. Condition = ProfileConditionType.Equals,
  116. Property = ProfileConditionValue.VideoTimestamp,
  117. Value = "Valid"
  118. }
  119. }
  120. },
  121. new ResponseProfile
  122. {
  123. Container = "ts",
  124. VideoCodec="h264",
  125. AudioCodec="ac3,aac,mp3",
  126. MimeType = "video/mpeg",
  127. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  128. Type = DlnaProfileType.Video,
  129. Conditions = new []
  130. {
  131. new ProfileCondition
  132. {
  133. Condition = ProfileConditionType.Equals,
  134. Property = ProfileConditionValue.PacketLength,
  135. Value = "188"
  136. }
  137. }
  138. },
  139. new ResponseProfile
  140. {
  141. Container = "ts",
  142. VideoCodec="h264",
  143. AudioCodec="ac3,aac,mp3",
  144. MimeType = "video/vnd.dlna.mpeg-tts",
  145. OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  146. Type = DlnaProfileType.Video
  147. },
  148. new ResponseProfile
  149. {
  150. Container = "ts",
  151. VideoCodec="mpeg2video",
  152. MimeType = "video/vnd.dlna.mpeg-tts",
  153. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  154. Type = DlnaProfileType.Video
  155. },
  156. new ResponseProfile
  157. {
  158. Container = "mpeg",
  159. VideoCodec="mpeg1video,mpeg2video",
  160. MimeType = "video/mpeg",
  161. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  162. Type = DlnaProfileType.Video
  163. }
  164. };
  165. ContainerProfiles = new[]
  166. {
  167. new ContainerProfile
  168. {
  169. Type = DlnaProfileType.Photo,
  170. Conditions = new []
  171. {
  172. new ProfileCondition
  173. {
  174. Condition = ProfileConditionType.LessThanEqual,
  175. Property = ProfileConditionValue.Width,
  176. Value = "1920"
  177. },
  178. new ProfileCondition
  179. {
  180. Condition = ProfileConditionType.LessThanEqual,
  181. Property = ProfileConditionValue.Height,
  182. Value = "1080"
  183. }
  184. }
  185. }
  186. };
  187. CodecProfiles = new[]
  188. {
  189. new CodecProfile
  190. {
  191. Type = CodecType.Video,
  192. Codec = "h264",
  193. Conditions = new []
  194. {
  195. new ProfileCondition
  196. {
  197. Condition = ProfileConditionType.LessThanEqual,
  198. Property = ProfileConditionValue.Width,
  199. Value = "1920"
  200. },
  201. new ProfileCondition
  202. {
  203. Condition = ProfileConditionType.LessThanEqual,
  204. Property = ProfileConditionValue.Height,
  205. Value = "1080"
  206. },
  207. new ProfileCondition
  208. {
  209. Condition = ProfileConditionType.LessThanEqual,
  210. Property = ProfileConditionValue.VideoFramerate,
  211. Value = "30"
  212. },
  213. new ProfileCondition
  214. {
  215. Condition = ProfileConditionType.LessThanEqual,
  216. Property = ProfileConditionValue.VideoBitrate,
  217. Value = "20000000"
  218. },
  219. new ProfileCondition
  220. {
  221. Condition = ProfileConditionType.LessThanEqual,
  222. Property = ProfileConditionValue.VideoLevel,
  223. Value = "41"
  224. }
  225. }
  226. },
  227. new CodecProfile
  228. {
  229. Type = CodecType.Video,
  230. Codec = "mpeg2video",
  231. Conditions = new []
  232. {
  233. new ProfileCondition
  234. {
  235. Condition = ProfileConditionType.LessThanEqual,
  236. Property = ProfileConditionValue.Width,
  237. Value = "1920"
  238. },
  239. new ProfileCondition
  240. {
  241. Condition = ProfileConditionType.LessThanEqual,
  242. Property = ProfileConditionValue.Height,
  243. Value = "1080"
  244. },
  245. new ProfileCondition
  246. {
  247. Condition = ProfileConditionType.LessThanEqual,
  248. Property = ProfileConditionValue.VideoFramerate,
  249. Value = "30"
  250. },
  251. new ProfileCondition
  252. {
  253. Condition = ProfileConditionType.LessThanEqual,
  254. Property = ProfileConditionValue.VideoBitrate,
  255. Value = "20000000"
  256. }
  257. }
  258. },
  259. new CodecProfile
  260. {
  261. Type = CodecType.Video,
  262. Conditions = new []
  263. {
  264. new ProfileCondition
  265. {
  266. Condition = ProfileConditionType.LessThanEqual,
  267. Property = ProfileConditionValue.Width,
  268. Value = "1920"
  269. },
  270. new ProfileCondition
  271. {
  272. Condition = ProfileConditionType.LessThanEqual,
  273. Property = ProfileConditionValue.Height,
  274. Value = "1080"
  275. }
  276. }
  277. },
  278. new CodecProfile
  279. {
  280. Type = CodecType.VideoAudio,
  281. Codec = "ac3",
  282. Conditions = new []
  283. {
  284. new ProfileCondition
  285. {
  286. Condition = ProfileConditionType.LessThanEqual,
  287. Property = ProfileConditionValue.AudioChannels,
  288. Value = "6"
  289. }
  290. }
  291. },
  292. new CodecProfile
  293. {
  294. Type = CodecType.VideoAudio,
  295. Codec = "aac",
  296. Conditions = new []
  297. {
  298. new ProfileCondition
  299. {
  300. Condition = ProfileConditionType.LessThanEqual,
  301. Property = ProfileConditionValue.AudioChannels,
  302. Value = "2"
  303. },
  304. new ProfileCondition
  305. {
  306. Condition = ProfileConditionType.NotEquals,
  307. Property = ProfileConditionValue.AudioProfile,
  308. Value = "he-aac"
  309. }
  310. }
  311. }
  312. };
  313. }
  314. }
  315. }