SonyBravia2012Profile.cs 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. [XmlRoot("Profile")]
  6. public class SonyBravia2012Profile : DefaultProfile
  7. {
  8. public SonyBravia2012Profile()
  9. {
  10. Name = "Sony Bravia (2012)";
  11. Identification = new DeviceIdentification
  12. {
  13. FriendlyName = @"KDL-\d{2}[A-Z]X\d5(\d|G).*",
  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\d5(\d|G).*",
  21. Match = HeaderMatchType.Regex
  22. }
  23. }
  24. };
  25. AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
  26. AlbumArtPn = "JPEG_TN";
  27. ModelName = "Windows Media Player Sharing";
  28. ModelNumber = "3.0";
  29. ModelUrl = "http://www.microsoft.com/";
  30. Manufacturer = "Microsoft Corporation";
  31. ManufacturerUrl = "http://www.microsoft.com/";
  32. SonyAggregationFlags = "10";
  33. EnableSingleAlbumArtLimit = true;
  34. EnableAlbumArtInDidl = true;
  35. TranscodingProfiles = new[]
  36. {
  37. new TranscodingProfile
  38. {
  39. Container = "mp3",
  40. AudioCodec = "mp3",
  41. Type = DlnaProfileType.Audio
  42. },
  43. new TranscodingProfile
  44. {
  45. Container = "ts",
  46. VideoCodec = "h264",
  47. AudioCodec = "ac3",
  48. Type = DlnaProfileType.Video,
  49. EnableMpegtsM2TsMode = true
  50. },
  51. new TranscodingProfile
  52. {
  53. Container = "jpeg",
  54. Type = DlnaProfileType.Photo
  55. }
  56. };
  57. DirectPlayProfiles = new[]
  58. {
  59. new DirectPlayProfile
  60. {
  61. Container = "ts",
  62. VideoCodec = "h264",
  63. AudioCodec = "ac3,aac,mp3",
  64. Type = DlnaProfileType.Video
  65. },
  66. new DirectPlayProfile
  67. {
  68. Container = "ts",
  69. VideoCodec = "mpeg2video",
  70. AudioCodec = "mp3,mp2",
  71. Type = DlnaProfileType.Video
  72. },
  73. new DirectPlayProfile
  74. {
  75. Container = "mp4",
  76. VideoCodec = "h264,mpeg4",
  77. AudioCodec = "ac3,aac,mp3,mp2",
  78. Type = DlnaProfileType.Video
  79. },
  80. new DirectPlayProfile
  81. {
  82. Container = "avi",
  83. VideoCodec = "mpeg4",
  84. AudioCodec = "ac3,mp3",
  85. Type = DlnaProfileType.Video
  86. },
  87. new DirectPlayProfile
  88. {
  89. Container = "mpeg",
  90. VideoCodec = "mpeg2video,mpeg1video",
  91. AudioCodec = "mp3,mp2",
  92. Type = DlnaProfileType.Video
  93. },
  94. new DirectPlayProfile
  95. {
  96. Container = "asf",
  97. VideoCodec = "wmv2,wmv3,vc1",
  98. AudioCodec = "wmav2,wmapro,wmavoice",
  99. Type = DlnaProfileType.Video
  100. },
  101. new DirectPlayProfile
  102. {
  103. Container = "mp3",
  104. AudioCodec = "mp3",
  105. Type = DlnaProfileType.Audio
  106. },
  107. new DirectPlayProfile
  108. {
  109. Container = "asf",
  110. AudioCodec = "wmav2,wmapro,wmavoice",
  111. Type = DlnaProfileType.Audio
  112. },
  113. new DirectPlayProfile
  114. {
  115. Container = "jpeg",
  116. Type = DlnaProfileType.Photo
  117. }
  118. };
  119. ResponseProfiles = new[]
  120. {
  121. new ResponseProfile
  122. {
  123. Container = "ts",
  124. VideoCodec="h264",
  125. AudioCodec="ac3,aac,mp3",
  126. MimeType = "video/vnd.dlna.mpeg-tts",
  127. OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
  128. Type = DlnaProfileType.Video,
  129. Conditions = new []
  130. {
  131. new ProfileCondition
  132. {
  133. Condition = ProfileConditionType.Equals,
  134. Property = ProfileConditionValue.PacketLength,
  135. Value = "192"
  136. },
  137. new ProfileCondition
  138. {
  139. Condition = ProfileConditionType.Equals,
  140. Property = ProfileConditionValue.VideoTimestamp,
  141. Value = "Valid"
  142. }
  143. }
  144. },
  145. new ResponseProfile
  146. {
  147. Container = "ts",
  148. VideoCodec="h264",
  149. AudioCodec="ac3,aac,mp3",
  150. MimeType = "video/mpeg",
  151. OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
  152. Type = DlnaProfileType.Video,
  153. Conditions = new []
  154. {
  155. new ProfileCondition
  156. {
  157. Condition = ProfileConditionType.Equals,
  158. Property = ProfileConditionValue.PacketLength,
  159. Value = "188"
  160. }
  161. }
  162. },
  163. new ResponseProfile
  164. {
  165. Container = "ts",
  166. VideoCodec="h264",
  167. AudioCodec="ac3,aac,mp3",
  168. MimeType = "video/vnd.dlna.mpeg-tts",
  169. OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
  170. Type = DlnaProfileType.Video
  171. },
  172. new ResponseProfile
  173. {
  174. Container = "ts",
  175. VideoCodec="mpeg2video",
  176. MimeType = "video/vnd.dlna.mpeg-tts",
  177. OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
  178. Type = DlnaProfileType.Video
  179. },
  180. new ResponseProfile
  181. {
  182. Container = "mpeg",
  183. VideoCodec="mpeg1video,mpeg2video",
  184. MimeType = "video/mpeg",
  185. OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
  186. Type = DlnaProfileType.Video
  187. }
  188. };
  189. ContainerProfiles = new[]
  190. {
  191. new ContainerProfile
  192. {
  193. Type = DlnaProfileType.Photo,
  194. Conditions = new []
  195. {
  196. new ProfileCondition
  197. {
  198. Condition = ProfileConditionType.LessThanEqual,
  199. Property = ProfileConditionValue.Width,
  200. Value = "1920"
  201. },
  202. new ProfileCondition
  203. {
  204. Condition = ProfileConditionType.LessThanEqual,
  205. Property = ProfileConditionValue.Height,
  206. Value = "1080"
  207. }
  208. }
  209. }
  210. };
  211. CodecProfiles = new[]
  212. {
  213. new CodecProfile
  214. {
  215. Type = CodecType.Video,
  216. Conditions = new[]
  217. {
  218. new ProfileCondition
  219. {
  220. Condition = ProfileConditionType.LessThanEqual,
  221. Property = ProfileConditionValue.Width,
  222. Value = "1920"
  223. },
  224. new ProfileCondition
  225. {
  226. Condition = ProfileConditionType.LessThanEqual,
  227. Property = ProfileConditionValue.Height,
  228. Value = "1080"
  229. },
  230. new ProfileCondition
  231. {
  232. Condition = ProfileConditionType.LessThanEqual,
  233. Property = ProfileConditionValue.VideoFramerate,
  234. Value = "30"
  235. }
  236. }
  237. },
  238. new CodecProfile
  239. {
  240. Type = CodecType.VideoAudio,
  241. Codec = "ac3",
  242. Conditions = new[]
  243. {
  244. new ProfileCondition
  245. {
  246. Condition = ProfileConditionType.LessThanEqual,
  247. Property = ProfileConditionValue.AudioChannels,
  248. Value = "6"
  249. }
  250. }
  251. },
  252. new CodecProfile
  253. {
  254. Type = CodecType.VideoAudio,
  255. Codec = "mp3,mp2",
  256. Conditions = new []
  257. {
  258. new ProfileCondition
  259. {
  260. Condition = ProfileConditionType.LessThanEqual,
  261. Property = ProfileConditionValue.AudioChannels,
  262. Value = "2"
  263. }
  264. }
  265. }
  266. };
  267. }
  268. }
  269. }