SonyPs4Profile.cs 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. #pragma warning disable CS1591
  2. #pragma warning disable SA1600
  3. using MediaBrowser.Model.Dlna;
  4. namespace Emby.Dlna.Profiles
  5. {
  6. [System.Xml.Serialization.XmlRoot("Profile")]
  7. public class SonyPs4Profile : DefaultProfile
  8. {
  9. public SonyPs4Profile()
  10. {
  11. Name = "Sony PlayStation 4";
  12. Identification = new DeviceIdentification
  13. {
  14. FriendlyName = "PLAYSTATION 4",
  15. Headers = new[]
  16. {
  17. new HttpHeaderInfo
  18. {
  19. Name = "User-Agent",
  20. Value = @"PLAYSTATION 4",
  21. Match = HeaderMatchType.Substring
  22. },
  23. new HttpHeaderInfo
  24. {
  25. Name = "X-AV-Client-Info",
  26. Value = @"PLAYSTATION 4",
  27. Match = HeaderMatchType.Substring
  28. }
  29. }
  30. };
  31. AlbumArtPn = "JPEG_TN";
  32. SonyAggregationFlags = "10";
  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,mpegts",
  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,mkv,m4v",
  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. // Transcoded audio won't be playable at all without this
  83. TranscodeSeekInfo = TranscodeSeekInfo.Bytes
  84. },
  85. new TranscodingProfile
  86. {
  87. Container = "ts",
  88. VideoCodec = "h264",
  89. AudioCodec = "mp3",
  90. Type = DlnaProfileType.Video
  91. },
  92. new TranscodingProfile
  93. {
  94. Container = "jpeg",
  95. Type = DlnaProfileType.Photo
  96. }
  97. };
  98. ContainerProfiles = new[]
  99. {
  100. new ContainerProfile
  101. {
  102. Type = DlnaProfileType.Photo,
  103. Conditions = new []
  104. {
  105. new ProfileCondition
  106. {
  107. Condition = ProfileConditionType.LessThanEqual,
  108. Property = ProfileConditionValue.Width,
  109. Value = "1920"
  110. },
  111. new ProfileCondition
  112. {
  113. Condition = ProfileConditionType.LessThanEqual,
  114. Property = ProfileConditionValue.Height,
  115. Value = "1080"
  116. }
  117. }
  118. }
  119. };
  120. CodecProfiles = new[]
  121. {
  122. new CodecProfile
  123. {
  124. Type = CodecType.Video,
  125. Codec = "h264",
  126. Conditions = new []
  127. {
  128. new ProfileCondition
  129. {
  130. Condition = ProfileConditionType.LessThanEqual,
  131. Property = ProfileConditionValue.Width,
  132. Value = "1920"
  133. },
  134. new ProfileCondition
  135. {
  136. Condition = ProfileConditionType.LessThanEqual,
  137. Property = ProfileConditionValue.Height,
  138. Value = "1080"
  139. },
  140. new ProfileCondition
  141. {
  142. Condition = ProfileConditionType.LessThanEqual,
  143. Property = ProfileConditionValue.VideoFramerate,
  144. Value = "30",
  145. IsRequired = false
  146. },
  147. new ProfileCondition
  148. {
  149. Condition = ProfileConditionType.LessThanEqual,
  150. Property = ProfileConditionValue.VideoBitrate,
  151. Value = "15360000",
  152. IsRequired = false
  153. },
  154. new ProfileCondition
  155. {
  156. Condition = ProfileConditionType.LessThanEqual,
  157. Property = ProfileConditionValue.VideoLevel,
  158. Value = "41",
  159. IsRequired = false
  160. }
  161. }
  162. },
  163. new CodecProfile
  164. {
  165. Type = CodecType.VideoAudio,
  166. Codec = "ac3",
  167. Conditions = new []
  168. {
  169. new ProfileCondition
  170. {
  171. Condition = ProfileConditionType.LessThanEqual,
  172. Property = ProfileConditionValue.AudioChannels,
  173. Value = "6",
  174. IsRequired = false
  175. },
  176. new ProfileCondition
  177. {
  178. Condition = ProfileConditionType.LessThanEqual,
  179. Property = ProfileConditionValue.AudioBitrate,
  180. Value = "640000",
  181. IsRequired = false
  182. }
  183. }
  184. },
  185. new CodecProfile
  186. {
  187. Type = CodecType.VideoAudio,
  188. Codec = "wmapro",
  189. Conditions = new []
  190. {
  191. new ProfileCondition
  192. {
  193. Condition = ProfileConditionType.LessThanEqual,
  194. Property = ProfileConditionValue.AudioChannels,
  195. Value = "2"
  196. }
  197. }
  198. },
  199. new CodecProfile
  200. {
  201. Type = CodecType.VideoAudio,
  202. Codec = "aac",
  203. Conditions = new []
  204. {
  205. new ProfileCondition
  206. {
  207. Condition = ProfileConditionType.NotEquals,
  208. Property = ProfileConditionValue.AudioProfile,
  209. Value = "he-aac",
  210. IsRequired = false
  211. }
  212. }
  213. }
  214. };
  215. ResponseProfiles = new[]
  216. {
  217. new ResponseProfile
  218. {
  219. Container = "mp4,mov",
  220. AudioCodec="aac",
  221. MimeType = "video/mp4",
  222. Type = DlnaProfileType.Video
  223. },
  224. new ResponseProfile
  225. {
  226. Container = "avi",
  227. MimeType = "video/divx",
  228. OrgPn="AVI",
  229. Type = DlnaProfileType.Video
  230. },
  231. new ResponseProfile
  232. {
  233. Container = "wav",
  234. MimeType = "audio/wav",
  235. Type = DlnaProfileType.Audio
  236. },
  237. new ResponseProfile
  238. {
  239. Container = "m4v",
  240. Type = DlnaProfileType.Video,
  241. MimeType = "video/mp4"
  242. }
  243. };
  244. SubtitleProfiles = new[]
  245. {
  246. new SubtitleProfile
  247. {
  248. Format = "srt",
  249. Method = SubtitleDeliveryMethod.Embed
  250. }
  251. };
  252. }
  253. }
  254. }