SonyPs4Profile.cs 9.1 KB

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