SonyBravia2011Profile.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class SonyBravia2011Profile : DefaultProfile
  6. {
  7. public SonyBravia2011Profile()
  8. {
  9. Name = "Sony Bravia (2011)";
  10. Identification = new DeviceIdentification
  11. {
  12. FriendlyName = @"KDL-\d{2}([A-Z]X\d2\d|CX400).*",
  13. Manufacturer = "Sony",
  14. Headers = new[]
  15. {
  16. new HttpHeaderInfo
  17. {
  18. Name = "X-AV-Client-Info",
  19. Value = @".*KDL-\d{2}([A-Z]X\d2\d|CX400).*",
  20. Match = HeaderMatchType.Regex
  21. }
  22. }
  23. };
  24. AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
  25. AlbumArtPn = "JPEG_TN";
  26. ModelName = "Windows Media Player Sharing";
  27. ModelNumber = "3.0";
  28. ModelUrl = "http://www.microsoft.com/";
  29. Manufacturer = "Microsoft Corporation";
  30. ManufacturerUrl = "http://www.microsoft.com/";
  31. SonyAggregationFlags = "10";
  32. EnableSingleAlbumArtLimit = true;
  33. EnableAlbumArtInDidl = true;
  34. TranscodingProfiles = new[]
  35. {
  36. new TranscodingProfile
  37. {
  38. Container = "mp3",
  39. AudioCodec = "mp3",
  40. Type = DlnaProfileType.Audio
  41. },
  42. new TranscodingProfile
  43. {
  44. Container = "ts",
  45. VideoCodec = "h264",
  46. AudioCodec = "ac3",
  47. Type = DlnaProfileType.Video,
  48. EnableMpegtsM2TsMode = true
  49. },
  50. new TranscodingProfile
  51. {
  52. Container = "jpeg",
  53. Type = DlnaProfileType.Photo
  54. }
  55. };
  56. DirectPlayProfiles = new[]
  57. {
  58. new DirectPlayProfile
  59. {
  60. Container = "ts,mpegts",
  61. VideoCodec = "h264",
  62. AudioCodec = "ac3,aac,mp3",
  63. Type = DlnaProfileType.Video
  64. },
  65. new DirectPlayProfile
  66. {
  67. Container = "ts,mpegts",
  68. VideoCodec = "mpeg2video",
  69. AudioCodec = "mp3",
  70. Type = DlnaProfileType.Video
  71. },
  72. new DirectPlayProfile
  73. {
  74. Container = "mp4,m4v",
  75. VideoCodec = "h264,mpeg4",
  76. AudioCodec = "ac3,aac,mp3",
  77. Type = DlnaProfileType.Video
  78. },
  79. new DirectPlayProfile
  80. {
  81. Container = "mpeg",
  82. VideoCodec = "mpeg2video,mpeg1video",
  83. AudioCodec = "mp3",
  84. Type = DlnaProfileType.Video
  85. },
  86. new DirectPlayProfile
  87. {
  88. Container = "asf",
  89. VideoCodec = "wmv2,wmv3,vc1",
  90. AudioCodec = "wmav2,wmapro,wmavoice",
  91. Type = DlnaProfileType.Video
  92. },
  93. new DirectPlayProfile
  94. {
  95. Container = "mp3",
  96. AudioCodec = "mp3",
  97. Type = DlnaProfileType.Audio
  98. },
  99. new DirectPlayProfile
  100. {
  101. Container = "asf",
  102. AudioCodec = "wmav2,wmapro,wmavoice",
  103. Type = DlnaProfileType.Audio
  104. }
  105. };
  106. ContainerProfiles = new[]
  107. {
  108. new ContainerProfile
  109. {
  110. Type = DlnaProfileType.Photo,
  111. Conditions = new []
  112. {
  113. new ProfileCondition
  114. {
  115. Condition = ProfileConditionType.LessThanEqual,
  116. Property = ProfileConditionValue.Width,
  117. Value = "1920"
  118. },
  119. new ProfileCondition
  120. {
  121. Condition = ProfileConditionType.LessThanEqual,
  122. Property = ProfileConditionValue.Height,
  123. Value = "1080"
  124. }
  125. }
  126. }
  127. };
  128. ResponseProfiles = new[]
  129. {
  130. new ResponseProfile
  131. {
  132. Container = "ts,mpegts",
  133. VideoCodec="h264",
  134. AudioCodec="ac3,aac,mp3",
  135. MimeType = "video/vnd.dlna.mpeg-tts",
  136. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  137. Type = DlnaProfileType.Video,
  138. Conditions = new []
  139. {
  140. new ProfileCondition
  141. {
  142. Condition = ProfileConditionType.Equals,
  143. Property = ProfileConditionValue.PacketLength,
  144. Value = "192"
  145. },
  146. new ProfileCondition
  147. {
  148. Condition = ProfileConditionType.Equals,
  149. Property = ProfileConditionValue.VideoTimestamp,
  150. Value = "Valid"
  151. }
  152. }
  153. },
  154. new ResponseProfile
  155. {
  156. Container = "ts,mpegts",
  157. VideoCodec="h264",
  158. AudioCodec="ac3,aac,mp3",
  159. MimeType = "video/mpeg",
  160. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  161. Type = DlnaProfileType.Video,
  162. Conditions = new []
  163. {
  164. new ProfileCondition
  165. {
  166. Condition = ProfileConditionType.Equals,
  167. Property = ProfileConditionValue.PacketLength,
  168. Value = "188"
  169. }
  170. }
  171. },
  172. new ResponseProfile
  173. {
  174. Container = "ts,mpegts",
  175. VideoCodec="h264",
  176. AudioCodec="ac3,aac,mp3",
  177. MimeType = "video/vnd.dlna.mpeg-tts",
  178. OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  179. Type = DlnaProfileType.Video
  180. },
  181. new ResponseProfile
  182. {
  183. Container = "ts,mpegts",
  184. VideoCodec="mpeg2video",
  185. MimeType = "video/vnd.dlna.mpeg-tts",
  186. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  187. Type = DlnaProfileType.Video
  188. },
  189. new ResponseProfile
  190. {
  191. Container = "mpeg",
  192. VideoCodec="mpeg1video,mpeg2video",
  193. MimeType = "video/mpeg",
  194. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  195. Type = DlnaProfileType.Video
  196. },
  197. new ResponseProfile
  198. {
  199. Container = "m4v",
  200. Type = DlnaProfileType.Video,
  201. MimeType = "video/mp4"
  202. }
  203. };
  204. CodecProfiles = new[]
  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.Width,
  216. Value = "1920"
  217. },
  218. new ProfileCondition
  219. {
  220. Condition = ProfileConditionType.LessThanEqual,
  221. Property = ProfileConditionValue.Height,
  222. Value = "1080"
  223. },
  224. new ProfileCondition
  225. {
  226. Condition = ProfileConditionType.LessThanEqual,
  227. Property = ProfileConditionValue.VideoFramerate,
  228. Value = "30"
  229. },
  230. new ProfileCondition
  231. {
  232. Condition = ProfileConditionType.LessThanEqual,
  233. Property = ProfileConditionValue.VideoBitrate,
  234. Value = "20000000"
  235. },
  236. new ProfileCondition
  237. {
  238. Condition = ProfileConditionType.LessThanEqual,
  239. Property = ProfileConditionValue.VideoLevel,
  240. Value = "41"
  241. }
  242. }
  243. },
  244. new CodecProfile
  245. {
  246. Type = CodecType.Video,
  247. Codec = "mpeg2video",
  248. Conditions = new []
  249. {
  250. new ProfileCondition
  251. {
  252. Condition = ProfileConditionType.LessThanEqual,
  253. Property = ProfileConditionValue.Width,
  254. Value = "1920"
  255. },
  256. new ProfileCondition
  257. {
  258. Condition = ProfileConditionType.LessThanEqual,
  259. Property = ProfileConditionValue.Height,
  260. Value = "1080"
  261. },
  262. new ProfileCondition
  263. {
  264. Condition = ProfileConditionType.LessThanEqual,
  265. Property = ProfileConditionValue.VideoFramerate,
  266. Value = "30"
  267. },
  268. new ProfileCondition
  269. {
  270. Condition = ProfileConditionType.LessThanEqual,
  271. Property = ProfileConditionValue.VideoBitrate,
  272. Value = "20000000"
  273. }
  274. }
  275. },
  276. new CodecProfile
  277. {
  278. Type = CodecType.Video,
  279. Conditions = new []
  280. {
  281. new ProfileCondition
  282. {
  283. Condition = ProfileConditionType.LessThanEqual,
  284. Property = ProfileConditionValue.Width,
  285. Value = "1920"
  286. },
  287. new ProfileCondition
  288. {
  289. Condition = ProfileConditionType.LessThanEqual,
  290. Property = ProfileConditionValue.Height,
  291. Value = "1080"
  292. },
  293. new ProfileCondition
  294. {
  295. Condition = ProfileConditionType.LessThanEqual,
  296. Property = ProfileConditionValue.VideoFramerate,
  297. Value = "30"
  298. }
  299. }
  300. },
  301. new CodecProfile
  302. {
  303. Type = CodecType.VideoAudio,
  304. Codec = "ac3",
  305. Conditions = new []
  306. {
  307. new ProfileCondition
  308. {
  309. Condition = ProfileConditionType.LessThanEqual,
  310. Property = ProfileConditionValue.AudioChannels,
  311. Value = "6"
  312. }
  313. }
  314. },
  315. new CodecProfile
  316. {
  317. Type = CodecType.VideoAudio,
  318. Codec = "aac",
  319. Conditions = new[]
  320. {
  321. new ProfileCondition
  322. {
  323. Condition = ProfileConditionType.LessThanEqual,
  324. Property = ProfileConditionValue.AudioChannels,
  325. Value = "2"
  326. },
  327. new ProfileCondition
  328. {
  329. Condition = ProfileConditionType.NotEquals,
  330. Property = ProfileConditionValue.AudioProfile,
  331. Value = "he-aac"
  332. }
  333. }
  334. },
  335. new CodecProfile
  336. {
  337. Type = CodecType.VideoAudio,
  338. Codec = "mp3,mp2",
  339. Conditions = new []
  340. {
  341. new ProfileCondition
  342. {
  343. Condition = ProfileConditionType.LessThanEqual,
  344. Property = ProfileConditionValue.AudioChannels,
  345. Value = "2"
  346. }
  347. }
  348. }
  349. };
  350. SubtitleProfiles = new[]
  351. {
  352. new SubtitleProfile
  353. {
  354. Format = "srt",
  355. Method = SubtitleDeliveryMethod.Embed
  356. }
  357. };
  358. }
  359. }
  360. }