SonyBravia2012Profile.cs 9.3 KB

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