SonyBravia2011Profile.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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 SonyBravia2011Profile : DefaultProfile
  8. {
  9. public SonyBravia2011Profile()
  10. {
  11. Name = "Sony Bravia (2011)";
  12. Identification = new DeviceIdentification
  13. {
  14. FriendlyName = @"KDL-\d{2}([A-Z]X\d2\d|CX400).*",
  15. Manufacturer = "Sony",
  16. Headers = new[]
  17. {
  18. new HttpHeaderInfo
  19. {
  20. Name = "X-AV-Client-Info",
  21. Value = @".*KDL-\d{2}([A-Z]X\d2\d|CX400).*",
  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. 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. Conditions = new []
  211. {
  212. new ProfileCondition
  213. {
  214. Condition = ProfileConditionType.LessThanEqual,
  215. Property = ProfileConditionValue.Width,
  216. Value = "1920"
  217. },
  218. new ProfileCondition
  219. {
  220. Condition = ProfileConditionType.LessThanEqual,
  221. Property = ProfileConditionValue.Height,
  222. Value = "1080"
  223. }
  224. }
  225. },
  226. new CodecProfile
  227. {
  228. Type = CodecType.Video,
  229. Codec = "h264",
  230. Conditions = new []
  231. {
  232. new ProfileCondition
  233. {
  234. Condition = ProfileConditionType.LessThanEqual,
  235. Property = ProfileConditionValue.VideoFramerate,
  236. Value = "30"
  237. },
  238. new ProfileCondition
  239. {
  240. Condition = ProfileConditionType.LessThanEqual,
  241. Property = ProfileConditionValue.VideoBitrate,
  242. Value = "20000000"
  243. },
  244. new ProfileCondition
  245. {
  246. Condition = ProfileConditionType.LessThanEqual,
  247. Property = ProfileConditionValue.VideoLevel,
  248. Value = "41"
  249. }
  250. }
  251. },
  252. new CodecProfile
  253. {
  254. Type = CodecType.Video,
  255. Codec = "mpeg2video",
  256. Conditions = new []
  257. {
  258. new ProfileCondition
  259. {
  260. Condition = ProfileConditionType.LessThanEqual,
  261. Property = ProfileConditionValue.VideoFramerate,
  262. Value = "30"
  263. },
  264. new ProfileCondition
  265. {
  266. Condition = ProfileConditionType.LessThanEqual,
  267. Property = ProfileConditionValue.VideoBitrate,
  268. Value = "20000000"
  269. }
  270. }
  271. },
  272. new CodecProfile
  273. {
  274. Type = CodecType.VideoAudio,
  275. Codec = "ac3",
  276. Conditions = new []
  277. {
  278. new ProfileCondition
  279. {
  280. Condition = ProfileConditionType.LessThanEqual,
  281. Property = ProfileConditionValue.AudioChannels,
  282. Value = "6"
  283. }
  284. }
  285. },
  286. new CodecProfile
  287. {
  288. Type = CodecType.VideoAudio,
  289. Codec = "aac",
  290. Conditions = new[]
  291. {
  292. new ProfileCondition
  293. {
  294. Condition = ProfileConditionType.LessThanEqual,
  295. Property = ProfileConditionValue.AudioChannels,
  296. Value = "2"
  297. },
  298. new ProfileCondition
  299. {
  300. Condition = ProfileConditionType.NotEquals,
  301. Property = ProfileConditionValue.AudioProfile,
  302. Value = "he-aac"
  303. }
  304. }
  305. }
  306. };
  307. }
  308. }
  309. }