SonyPs3Profile.cs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. [XmlRoot("Profile")]
  6. public class SonyPs3Profile : DefaultProfile
  7. {
  8. public SonyPs3Profile()
  9. {
  10. Name = "Sony PlayStation 3";
  11. Identification = new DeviceIdentification
  12. {
  13. FriendlyName = "PLAYSTATION 3",
  14. Headers = new[]
  15. {
  16. new HttpHeaderInfo
  17. {
  18. Name = "User-Agent",
  19. Value = @"PLAYSTATION 3",
  20. Match = HeaderMatchType.Substring
  21. },
  22. new HttpHeaderInfo
  23. {
  24. Name = "X-AV-Client-Info",
  25. Value = @"PLAYSTATION 3",
  26. Match = HeaderMatchType.Substring
  27. }
  28. }
  29. };
  30. AlbumArtPn = "JPEG_TN";
  31. SonyAggregationFlags = "10";
  32. XDlnaDoc = "DMS-1.50";
  33. EnableSingleAlbumArtLimit = true;
  34. DirectPlayProfiles = new[]
  35. {
  36. new DirectPlayProfile
  37. {
  38. Container = "avi",
  39. Type = DlnaProfileType.Video,
  40. VideoCodec = "mpeg4",
  41. AudioCodec = "mp2,mp3"
  42. },
  43. new DirectPlayProfile
  44. {
  45. Container = "ts",
  46. Type = DlnaProfileType.Video,
  47. VideoCodec = "mpeg1video,mpeg2video,h264",
  48. AudioCodec = "ac3,mp2,mp3,aac"
  49. },
  50. new DirectPlayProfile
  51. {
  52. Container = "mpeg",
  53. Type = DlnaProfileType.Video,
  54. VideoCodec = "mpeg1video,mpeg2video",
  55. AudioCodec = "mp2"
  56. },
  57. new DirectPlayProfile
  58. {
  59. Container = "mp4",
  60. Type = DlnaProfileType.Video,
  61. VideoCodec = "h264,mpeg4",
  62. AudioCodec = "aac,ac3"
  63. },
  64. new DirectPlayProfile
  65. {
  66. Container = "aac,mp3,wav",
  67. Type = DlnaProfileType.Audio
  68. },
  69. new DirectPlayProfile
  70. {
  71. Container = "jpeg,png,gif,bmp,tiff",
  72. Type = DlnaProfileType.Photo
  73. }
  74. };
  75. TranscodingProfiles = new[]
  76. {
  77. new TranscodingProfile
  78. {
  79. Container = "mp3",
  80. AudioCodec = "mp3",
  81. Type = DlnaProfileType.Audio
  82. },
  83. new TranscodingProfile
  84. {
  85. Container = "ts",
  86. VideoCodec = "h264",
  87. AudioCodec = "ac3,aac,mp3",
  88. Type = DlnaProfileType.Video
  89. },
  90. new TranscodingProfile
  91. {
  92. Container = "jpeg",
  93. Type = DlnaProfileType.Photo
  94. }
  95. };
  96. ContainerProfiles = new[]
  97. {
  98. new ContainerProfile
  99. {
  100. Type = DlnaProfileType.Photo,
  101. Conditions = new []
  102. {
  103. new ProfileCondition
  104. {
  105. Condition = ProfileConditionType.LessThanEqual,
  106. Property = ProfileConditionValue.Width,
  107. Value = "1920"
  108. },
  109. new ProfileCondition
  110. {
  111. Condition = ProfileConditionType.LessThanEqual,
  112. Property = ProfileConditionValue.Height,
  113. Value = "1080"
  114. }
  115. }
  116. }
  117. };
  118. CodecProfiles = new[]
  119. {
  120. new CodecProfile
  121. {
  122. Type = CodecType.Video,
  123. Codec = "h264",
  124. Conditions = new []
  125. {
  126. new ProfileCondition
  127. {
  128. Condition = ProfileConditionType.LessThanEqual,
  129. Property = ProfileConditionValue.Width,
  130. Value = "1920"
  131. },
  132. new ProfileCondition
  133. {
  134. Condition = ProfileConditionType.LessThanEqual,
  135. Property = ProfileConditionValue.Height,
  136. Value = "1080"
  137. },
  138. new ProfileCondition
  139. {
  140. Condition = ProfileConditionType.LessThanEqual,
  141. Property = ProfileConditionValue.VideoFramerate,
  142. Value = "30",
  143. IsRequired = false
  144. },
  145. new ProfileCondition
  146. {
  147. Condition = ProfileConditionType.LessThanEqual,
  148. Property = ProfileConditionValue.VideoBitrate,
  149. Value = "15360000",
  150. IsRequired = false
  151. },
  152. new ProfileCondition
  153. {
  154. Condition = ProfileConditionType.LessThanEqual,
  155. Property = ProfileConditionValue.VideoLevel,
  156. Value = "41",
  157. IsRequired = false
  158. }
  159. }
  160. },
  161. new CodecProfile
  162. {
  163. Type = CodecType.VideoAudio,
  164. Codec = "ac3",
  165. Conditions = new []
  166. {
  167. new ProfileCondition
  168. {
  169. Condition = ProfileConditionType.LessThanEqual,
  170. Property = ProfileConditionValue.AudioChannels,
  171. Value = "6",
  172. IsRequired = false
  173. },
  174. new ProfileCondition
  175. {
  176. Condition = ProfileConditionType.LessThanEqual,
  177. Property = ProfileConditionValue.AudioBitrate,
  178. Value = "640000",
  179. IsRequired = false
  180. }
  181. }
  182. },
  183. new CodecProfile
  184. {
  185. Type = CodecType.VideoAudio,
  186. Codec = "wmapro",
  187. Conditions = new []
  188. {
  189. new ProfileCondition
  190. {
  191. Condition = ProfileConditionType.LessThanEqual,
  192. Property = ProfileConditionValue.AudioChannels,
  193. Value = "2"
  194. }
  195. }
  196. },
  197. new CodecProfile
  198. {
  199. Type = CodecType.VideoAudio,
  200. Codec = "aac",
  201. Conditions = new []
  202. {
  203. new ProfileCondition
  204. {
  205. Condition = ProfileConditionType.NotEquals,
  206. Property = ProfileConditionValue.AudioProfile,
  207. Value = "he-aac",
  208. IsRequired = false
  209. }
  210. }
  211. }
  212. };
  213. ResponseProfiles = new[]
  214. {
  215. new ResponseProfile
  216. {
  217. Container = "mp4,mov",
  218. AudioCodec="aac",
  219. MimeType = "video/mp4",
  220. Type = DlnaProfileType.Video
  221. },
  222. new ResponseProfile
  223. {
  224. Container = "avi",
  225. MimeType = "video/divx",
  226. OrgPn="AVI",
  227. Type = DlnaProfileType.Video
  228. },
  229. new ResponseProfile
  230. {
  231. Container = "wav",
  232. MimeType = "audio/wav",
  233. Type = DlnaProfileType.Audio
  234. }
  235. };
  236. }
  237. }
  238. }