SonyBravia2010Profile.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. ModelName = "Windows Media Player Sharing";
  34. ModelNumber = "3.0";
  35. ModelUrl = "http://www.microsoft.com/";
  36. Manufacturer = "Microsoft Corporation";
  37. ManufacturerUrl = "http://www.microsoft.com/";
  38. SonyAggregationFlags = "10";
  39. ProtocolInfo =
  40. "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";
  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 = "mpeg1video,mpeg2video",
  76. AudioCodec = "mp3,mp2",
  77. Type = DlnaProfileType.Video
  78. },
  79. new DirectPlayProfile
  80. {
  81. Container = "mpeg",
  82. VideoCodec = "mpeg2video,mpeg1video",
  83. AudioCodec = "mp3,mp2",
  84. Type = DlnaProfileType.Video
  85. },
  86. new DirectPlayProfile
  87. {
  88. Container = "mp3",
  89. AudioCodec = "mp3",
  90. Type = DlnaProfileType.Audio
  91. }
  92. };
  93. ResponseProfiles = new[]
  94. {
  95. new ResponseProfile
  96. {
  97. Container = "ts",
  98. VideoCodec="h264",
  99. AudioCodec="ac3,aac,mp3",
  100. MimeType = "video/vnd.dlna.mpeg-tts",
  101. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  102. Type = DlnaProfileType.Video,
  103. Conditions = new []
  104. {
  105. new ProfileCondition
  106. {
  107. Condition = ProfileConditionType.Equals,
  108. Property = ProfileConditionValue.PacketLength,
  109. Value = "192"
  110. },
  111. new ProfileCondition
  112. {
  113. Condition = ProfileConditionType.Equals,
  114. Property = ProfileConditionValue.VideoTimestamp,
  115. Value = "Valid"
  116. }
  117. }
  118. },
  119. new ResponseProfile
  120. {
  121. Container = "ts",
  122. VideoCodec="h264",
  123. AudioCodec="ac3,aac,mp3",
  124. MimeType = "video/mpeg",
  125. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  126. Type = DlnaProfileType.Video,
  127. Conditions = new []
  128. {
  129. new ProfileCondition
  130. {
  131. Condition = ProfileConditionType.Equals,
  132. Property = ProfileConditionValue.PacketLength,
  133. Value = "188"
  134. }
  135. }
  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,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  144. Type = DlnaProfileType.Video
  145. },
  146. new ResponseProfile
  147. {
  148. Container = "ts",
  149. VideoCodec="mpeg2video",
  150. MimeType = "video/vnd.dlna.mpeg-tts",
  151. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  152. Type = DlnaProfileType.Video
  153. },
  154. new ResponseProfile
  155. {
  156. Container = "mpeg",
  157. VideoCodec="mpeg1video,mpeg2video",
  158. MimeType = "video/mpeg",
  159. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  160. Type = DlnaProfileType.Video
  161. }
  162. };
  163. ContainerProfiles = new[]
  164. {
  165. new ContainerProfile
  166. {
  167. Type = DlnaProfileType.Photo,
  168. Conditions = new []
  169. {
  170. new ProfileCondition
  171. {
  172. Condition = ProfileConditionType.LessThanEqual,
  173. Property = ProfileConditionValue.Width,
  174. Value = "1920"
  175. },
  176. new ProfileCondition
  177. {
  178. Condition = ProfileConditionType.LessThanEqual,
  179. Property = ProfileConditionValue.Height,
  180. Value = "1080"
  181. }
  182. }
  183. }
  184. };
  185. CodecProfiles = new[]
  186. {
  187. new CodecProfile
  188. {
  189. Type = CodecType.Video,
  190. Conditions = new []
  191. {
  192. new ProfileCondition
  193. {
  194. Condition = ProfileConditionType.LessThanEqual,
  195. Property = ProfileConditionValue.Width,
  196. Value = "1920"
  197. },
  198. new ProfileCondition
  199. {
  200. Condition = ProfileConditionType.LessThanEqual,
  201. Property = ProfileConditionValue.Height,
  202. Value = "1080"
  203. }
  204. }
  205. },
  206. new CodecProfile
  207. {
  208. Type = CodecType.Video,
  209. Codec = "h264",
  210. Conditions = new []
  211. {
  212. new ProfileCondition
  213. {
  214. Condition = ProfileConditionType.LessThanEqual,
  215. Property = ProfileConditionValue.VideoFramerate,
  216. Value = "30"
  217. },
  218. new ProfileCondition
  219. {
  220. Condition = ProfileConditionType.LessThanEqual,
  221. Property = ProfileConditionValue.VideoBitrate,
  222. Value = "20000000"
  223. },
  224. new ProfileCondition
  225. {
  226. Condition = ProfileConditionType.LessThanEqual,
  227. Property = ProfileConditionValue.VideoLevel,
  228. Value = "41"
  229. }
  230. }
  231. },
  232. new CodecProfile
  233. {
  234. Type = CodecType.Video,
  235. Codec = "mpeg2video",
  236. Conditions = new []
  237. {
  238. new ProfileCondition
  239. {
  240. Condition = ProfileConditionType.LessThanEqual,
  241. Property = ProfileConditionValue.VideoFramerate,
  242. Value = "30"
  243. },
  244. new ProfileCondition
  245. {
  246. Condition = ProfileConditionType.LessThanEqual,
  247. Property = ProfileConditionValue.VideoBitrate,
  248. Value = "20000000"
  249. }
  250. }
  251. },
  252. new CodecProfile
  253. {
  254. Type = CodecType.VideoAudio,
  255. Codec = "ac3",
  256. Conditions = new []
  257. {
  258. new ProfileCondition
  259. {
  260. Condition = ProfileConditionType.LessThanEqual,
  261. Property = ProfileConditionValue.AudioChannels,
  262. Value = "6"
  263. }
  264. }
  265. },
  266. new CodecProfile
  267. {
  268. Type = CodecType.VideoAudio,
  269. Codec = "aac",
  270. Conditions = new []
  271. {
  272. new ProfileCondition
  273. {
  274. Condition = ProfileConditionType.LessThanEqual,
  275. Property = ProfileConditionValue.AudioChannels,
  276. Value = "2"
  277. },
  278. new ProfileCondition
  279. {
  280. Condition = ProfileConditionType.NotEquals,
  281. Property = ProfileConditionValue.AudioProfile,
  282. Value = "he-aac"
  283. }
  284. }
  285. }
  286. };
  287. }
  288. }
  289. }