SonyBravia2014Profile.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class SonyBravia2014Profile : DefaultProfile
  6. {
  7. public SonyBravia2014Profile()
  8. {
  9. Name = "Sony Bravia (2014)";
  10. Identification = new DeviceIdentification
  11. {
  12. FriendlyName = @"(KDL-\d{2}W[5-9]\d{2}B|KDL-\d{2}R480|XBR-\d{2}X[89]\d{2}B|KD-\d{2}[SX][89]\d{3}B).*",
  13. Manufacturer = "Sony",
  14. Headers = new[]
  15. {
  16. new HttpHeaderInfo
  17. {
  18. Name = "X-AV-Client-Info",
  19. Value = @".*(KDL-\d{2}W[5-9]\d{2}B|KDL-\d{2}R480|XBR-\d{2}X[89]\d{2}B|KD-\d{2}[SX][89]\d{3}B).*",
  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. Type = DlnaProfileType.Audio
  40. },
  41. new TranscodingProfile
  42. {
  43. Container = "ts",
  44. VideoCodec = "h264",
  45. AudioCodec = "ac3",
  46. Type = DlnaProfileType.Video,
  47. EnableMpegtsM2TsMode = true
  48. },
  49. new TranscodingProfile
  50. {
  51. Container = "jpeg",
  52. Type = DlnaProfileType.Photo
  53. }
  54. };
  55. DirectPlayProfiles = new[]
  56. {
  57. new DirectPlayProfile
  58. {
  59. Container = "ts,mpegts",
  60. VideoCodec = "h264",
  61. AudioCodec = "ac3,eac3,aac,mp3",
  62. Type = DlnaProfileType.Video
  63. },
  64. new DirectPlayProfile
  65. {
  66. Container = "ts,mpegts",
  67. VideoCodec = "mpeg2video",
  68. AudioCodec = "mp3,mp2",
  69. Type = DlnaProfileType.Video
  70. },
  71. new DirectPlayProfile
  72. {
  73. Container = "mp4,m4v",
  74. VideoCodec = "h264,mpeg4",
  75. AudioCodec = "ac3,eac3,aac,mp3,mp2",
  76. Type = DlnaProfileType.Video
  77. },
  78. new DirectPlayProfile
  79. {
  80. Container = "mov",
  81. VideoCodec = "h264,mpeg4,mjpeg",
  82. AudioCodec = "ac3,eac3,aac,mp3,mp2",
  83. Type = DlnaProfileType.Video
  84. },
  85. new DirectPlayProfile
  86. {
  87. Container = "mkv",
  88. VideoCodec = "h264,mpeg4,vp8",
  89. AudioCodec = "ac3,eac3,aac,mp3,mp2,pcm,vorbis",
  90. Type = DlnaProfileType.Video
  91. },
  92. new DirectPlayProfile
  93. {
  94. Container = "avi",
  95. VideoCodec = "mpeg4",
  96. AudioCodec = "ac3,eac3,mp3",
  97. Type = DlnaProfileType.Video
  98. },
  99. new DirectPlayProfile
  100. {
  101. Container = "avi",
  102. VideoCodec = "mjpeg",
  103. AudioCodec = "pcm",
  104. Type = DlnaProfileType.Video
  105. },
  106. new DirectPlayProfile
  107. {
  108. Container = "mpeg",
  109. VideoCodec = "mpeg2video,mpeg1video",
  110. AudioCodec = "mp3,mp2",
  111. Type = DlnaProfileType.Video
  112. },
  113. new DirectPlayProfile
  114. {
  115. Container = "asf",
  116. VideoCodec = "wmv2,wmv3,vc1",
  117. AudioCodec = "wmav2,wmapro,wmavoice",
  118. Type = DlnaProfileType.Video
  119. },
  120. new DirectPlayProfile
  121. {
  122. Container = "mp3",
  123. AudioCodec = "mp3",
  124. Type = DlnaProfileType.Audio
  125. },
  126. new DirectPlayProfile
  127. {
  128. Container = "mp4",
  129. AudioCodec = "aac",
  130. Type = DlnaProfileType.Audio
  131. },
  132. new DirectPlayProfile
  133. {
  134. Container = "wav",
  135. AudioCodec = "pcm",
  136. Type = DlnaProfileType.Audio
  137. },
  138. new DirectPlayProfile
  139. {
  140. Container = "asf",
  141. AudioCodec = "wmav2,wmapro,wmavoice",
  142. Type = DlnaProfileType.Audio
  143. },
  144. new DirectPlayProfile
  145. {
  146. Container = "jpeg",
  147. Type = DlnaProfileType.Photo
  148. }
  149. };
  150. ContainerProfiles = new[]
  151. {
  152. new ContainerProfile
  153. {
  154. Type = DlnaProfileType.Photo,
  155. Conditions = new []
  156. {
  157. new ProfileCondition
  158. {
  159. Condition = ProfileConditionType.LessThanEqual,
  160. Property = ProfileConditionValue.Width,
  161. Value = "1920"
  162. },
  163. new ProfileCondition
  164. {
  165. Condition = ProfileConditionType.LessThanEqual,
  166. Property = ProfileConditionValue.Height,
  167. Value = "1080"
  168. }
  169. }
  170. }
  171. };
  172. ResponseProfiles = new[]
  173. {
  174. new ResponseProfile
  175. {
  176. Container = "ts,mpegts",
  177. VideoCodec="h264",
  178. AudioCodec="ac3,aac,mp3",
  179. MimeType = "video/vnd.dlna.mpeg-tts",
  180. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  181. Type = DlnaProfileType.Video,
  182. Conditions = new []
  183. {
  184. new ProfileCondition
  185. {
  186. Condition = ProfileConditionType.Equals,
  187. Property = ProfileConditionValue.PacketLength,
  188. Value = "192"
  189. },
  190. new ProfileCondition
  191. {
  192. Condition = ProfileConditionType.Equals,
  193. Property = ProfileConditionValue.VideoTimestamp,
  194. Value = "Valid"
  195. }
  196. }
  197. },
  198. new ResponseProfile
  199. {
  200. Container = "ts,mpegts",
  201. VideoCodec="h264",
  202. AudioCodec="ac3,aac,mp3",
  203. MimeType = "video/mpeg",
  204. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  205. Type = DlnaProfileType.Video,
  206. Conditions = new []
  207. {
  208. new ProfileCondition
  209. {
  210. Condition = ProfileConditionType.Equals,
  211. Property = ProfileConditionValue.PacketLength,
  212. Value = "188"
  213. }
  214. }
  215. },
  216. new ResponseProfile
  217. {
  218. Container = "ts,mpegts",
  219. VideoCodec="h264",
  220. AudioCodec="ac3,aac,mp3",
  221. MimeType = "video/vnd.dlna.mpeg-tts",
  222. OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  223. Type = DlnaProfileType.Video
  224. },
  225. new ResponseProfile
  226. {
  227. Container = "ts,mpegts",
  228. VideoCodec="mpeg2video",
  229. MimeType = "video/vnd.dlna.mpeg-tts",
  230. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  231. Type = DlnaProfileType.Video
  232. },
  233. new ResponseProfile
  234. {
  235. Container = "mpeg",
  236. VideoCodec="mpeg1video,mpeg2video",
  237. MimeType = "video/mpeg",
  238. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  239. Type = DlnaProfileType.Video
  240. },
  241. new ResponseProfile
  242. {
  243. Container = "m4v",
  244. Type = DlnaProfileType.Video,
  245. MimeType = "video/mp4"
  246. }
  247. };
  248. CodecProfiles = new[]
  249. {
  250. new CodecProfile
  251. {
  252. Type = CodecType.Video,
  253. Conditions = new []
  254. {
  255. new ProfileCondition
  256. {
  257. Condition = ProfileConditionType.LessThanEqual,
  258. Property = ProfileConditionValue.Width,
  259. Value = "1920"
  260. },
  261. new ProfileCondition
  262. {
  263. Condition = ProfileConditionType.LessThanEqual,
  264. Property = ProfileConditionValue.Height,
  265. Value = "1080"
  266. },
  267. new ProfileCondition
  268. {
  269. Condition = ProfileConditionType.LessThanEqual,
  270. Property = ProfileConditionValue.VideoFramerate,
  271. Value = "30"
  272. }
  273. }
  274. },
  275. new CodecProfile
  276. {
  277. Type = CodecType.VideoAudio,
  278. Codec = "mp3,mp2",
  279. Conditions = new []
  280. {
  281. new ProfileCondition
  282. {
  283. Condition = ProfileConditionType.LessThanEqual,
  284. Property = ProfileConditionValue.AudioChannels,
  285. Value = "2"
  286. }
  287. }
  288. }
  289. };
  290. SubtitleProfiles = new[]
  291. {
  292. new SubtitleProfile
  293. {
  294. Format = "srt",
  295. Method = SubtitleDeliveryMethod.Embed
  296. }
  297. };
  298. }
  299. }
  300. }