SonyBravia2010Profile.cs 11 KB

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