SonyBravia2010Profile.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class SonyBravia2010Profile : DefaultProfile
  6. {
  7. public SonyBravia2010Profile()
  8. {
  9. Name = "Sony Bravia (2010)";
  10. Identification = new DeviceIdentification
  11. {
  12. FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*",
  13. Manufacturer = "Sony",
  14. Headers = new[]
  15. {
  16. new HttpHeaderInfo
  17. {
  18. Name = "X-AV-Client-Info",
  19. Value = @".*KDL-\d{2}[EHLNPB]X\d[01]\d.*",
  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. ProtocolInfo =
  33. "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";
  34. EnableSingleAlbumArtLimit = true;
  35. EnableAlbumArtInDidl = true;
  36. TranscodingProfiles = new[]
  37. {
  38. new TranscodingProfile
  39. {
  40. Container = "mp3",
  41. AudioCodec = "mp3",
  42. Type = DlnaProfileType.Audio
  43. },
  44. new TranscodingProfile
  45. {
  46. Container = "ts",
  47. VideoCodec = "h264",
  48. AudioCodec = "ac3",
  49. Type = DlnaProfileType.Video,
  50. EnableMpegtsM2TsMode = true
  51. },
  52. new TranscodingProfile
  53. {
  54. Container = "jpeg",
  55. Type = DlnaProfileType.Photo
  56. }
  57. };
  58. DirectPlayProfiles = new[]
  59. {
  60. new DirectPlayProfile
  61. {
  62. Container = "ts,mpegts",
  63. VideoCodec = "h264",
  64. AudioCodec = "ac3,aac,mp3",
  65. Type = DlnaProfileType.Video
  66. },
  67. new DirectPlayProfile
  68. {
  69. Container = "ts,mpegts",
  70. VideoCodec = "mpeg1video,mpeg2video",
  71. AudioCodec = "mp3,mp2",
  72. Type = DlnaProfileType.Video
  73. },
  74. new DirectPlayProfile
  75. {
  76. Container = "mpeg",
  77. VideoCodec = "mpeg2video,mpeg1video",
  78. AudioCodec = "mp3,mp2",
  79. Type = DlnaProfileType.Video
  80. },
  81. new DirectPlayProfile
  82. {
  83. Container = "mp3",
  84. AudioCodec = "mp3",
  85. Type = DlnaProfileType.Audio
  86. }
  87. };
  88. ResponseProfiles = new[]
  89. {
  90. new ResponseProfile
  91. {
  92. Container = "ts,mpegts",
  93. VideoCodec="h264",
  94. AudioCodec="ac3,aac,mp3",
  95. MimeType = "video/vnd.dlna.mpeg-tts",
  96. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  97. Type = DlnaProfileType.Video,
  98. Conditions = new []
  99. {
  100. new ProfileCondition
  101. {
  102. Condition = ProfileConditionType.Equals,
  103. Property = ProfileConditionValue.PacketLength,
  104. Value = "192"
  105. },
  106. new ProfileCondition
  107. {
  108. Condition = ProfileConditionType.Equals,
  109. Property = ProfileConditionValue.VideoTimestamp,
  110. Value = "Valid"
  111. }
  112. }
  113. },
  114. new ResponseProfile
  115. {
  116. Container = "ts,mpegts",
  117. VideoCodec="h264",
  118. AudioCodec="ac3,aac,mp3",
  119. MimeType = "video/mpeg",
  120. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  121. Type = DlnaProfileType.Video,
  122. Conditions = new []
  123. {
  124. new ProfileCondition
  125. {
  126. Condition = ProfileConditionType.Equals,
  127. Property = ProfileConditionValue.PacketLength,
  128. Value = "188"
  129. }
  130. }
  131. },
  132. new ResponseProfile
  133. {
  134. Container = "ts,mpegts",
  135. VideoCodec="h264",
  136. AudioCodec="ac3,aac,mp3",
  137. MimeType = "video/vnd.dlna.mpeg-tts",
  138. OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  139. Type = DlnaProfileType.Video
  140. },
  141. new ResponseProfile
  142. {
  143. Container = "ts,mpegts",
  144. VideoCodec="mpeg2video",
  145. MimeType = "video/vnd.dlna.mpeg-tts",
  146. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  147. Type = DlnaProfileType.Video
  148. },
  149. new ResponseProfile
  150. {
  151. Container = "mpeg",
  152. VideoCodec="mpeg1video,mpeg2video",
  153. MimeType = "video/mpeg",
  154. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  155. Type = DlnaProfileType.Video
  156. }
  157. };
  158. ContainerProfiles = new[]
  159. {
  160. new ContainerProfile
  161. {
  162. Type = DlnaProfileType.Photo,
  163. Conditions = new []
  164. {
  165. new ProfileCondition
  166. {
  167. Condition = ProfileConditionType.LessThanEqual,
  168. Property = ProfileConditionValue.Width,
  169. Value = "1920"
  170. },
  171. new ProfileCondition
  172. {
  173. Condition = ProfileConditionType.LessThanEqual,
  174. Property = ProfileConditionValue.Height,
  175. Value = "1080"
  176. }
  177. }
  178. }
  179. };
  180. CodecProfiles = new[]
  181. {
  182. new CodecProfile
  183. {
  184. Type = CodecType.Video,
  185. Codec = "h264",
  186. Conditions = new []
  187. {
  188. new ProfileCondition
  189. {
  190. Condition = ProfileConditionType.LessThanEqual,
  191. Property = ProfileConditionValue.Width,
  192. Value = "1920"
  193. },
  194. new ProfileCondition
  195. {
  196. Condition = ProfileConditionType.LessThanEqual,
  197. Property = ProfileConditionValue.Height,
  198. Value = "1080"
  199. },
  200. new ProfileCondition
  201. {
  202. Condition = ProfileConditionType.LessThanEqual,
  203. Property = ProfileConditionValue.VideoFramerate,
  204. Value = "30"
  205. },
  206. new ProfileCondition
  207. {
  208. Condition = ProfileConditionType.LessThanEqual,
  209. Property = ProfileConditionValue.VideoBitrate,
  210. Value = "20000000"
  211. },
  212. new ProfileCondition
  213. {
  214. Condition = ProfileConditionType.LessThanEqual,
  215. Property = ProfileConditionValue.VideoLevel,
  216. Value = "41"
  217. }
  218. }
  219. },
  220. new CodecProfile
  221. {
  222. Type = CodecType.Video,
  223. Codec = "mpeg2video",
  224. Conditions = new []
  225. {
  226. new ProfileCondition
  227. {
  228. Condition = ProfileConditionType.LessThanEqual,
  229. Property = ProfileConditionValue.Width,
  230. Value = "1920"
  231. },
  232. new ProfileCondition
  233. {
  234. Condition = ProfileConditionType.LessThanEqual,
  235. Property = ProfileConditionValue.Height,
  236. Value = "1080"
  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.Video,
  255. Conditions = new []
  256. {
  257. new ProfileCondition
  258. {
  259. Condition = ProfileConditionType.LessThanEqual,
  260. Property = ProfileConditionValue.Width,
  261. Value = "1920"
  262. },
  263. new ProfileCondition
  264. {
  265. Condition = ProfileConditionType.LessThanEqual,
  266. Property = ProfileConditionValue.Height,
  267. Value = "1080"
  268. },
  269. new ProfileCondition
  270. {
  271. Condition = ProfileConditionType.LessThanEqual,
  272. Property = ProfileConditionValue.VideoFramerate,
  273. Value = "30"
  274. }
  275. }
  276. },
  277. new CodecProfile
  278. {
  279. Type = CodecType.VideoAudio,
  280. Codec = "ac3",
  281. Conditions = new []
  282. {
  283. new ProfileCondition
  284. {
  285. Condition = ProfileConditionType.LessThanEqual,
  286. Property = ProfileConditionValue.AudioChannels,
  287. Value = "6"
  288. }
  289. }
  290. },
  291. new CodecProfile
  292. {
  293. Type = CodecType.VideoAudio,
  294. Codec = "aac",
  295. Conditions = new []
  296. {
  297. new ProfileCondition
  298. {
  299. Condition = ProfileConditionType.LessThanEqual,
  300. Property = ProfileConditionValue.AudioChannels,
  301. Value = "2"
  302. },
  303. new ProfileCondition
  304. {
  305. Condition = ProfileConditionType.NotEquals,
  306. Property = ProfileConditionValue.AudioProfile,
  307. Value = "he-aac"
  308. }
  309. }
  310. },
  311. new CodecProfile
  312. {
  313. Type = CodecType.VideoAudio,
  314. Codec = "mp3,mp2",
  315. Conditions = new []
  316. {
  317. new ProfileCondition
  318. {
  319. Condition = ProfileConditionType.LessThanEqual,
  320. Property = ProfileConditionValue.AudioChannels,
  321. Value = "2"
  322. }
  323. }
  324. }
  325. };
  326. SubtitleProfiles = new[]
  327. {
  328. new SubtitleProfile
  329. {
  330. Format = "srt",
  331. Method = SubtitleDeliveryMethod.Embed
  332. }
  333. };
  334. }
  335. }
  336. }