SonyBravia2011Profile.cs 12 KB

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