SonyBravia2012Profile.cs 9.2 KB

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