SonyPs4Profile.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class SonyPs4Profile : DefaultProfile
  6. {
  7. public SonyPs4Profile()
  8. {
  9. Name = "Sony PlayStation 4";
  10. Identification = new DeviceIdentification
  11. {
  12. FriendlyName = "PLAYSTATION 4",
  13. Headers = new[]
  14. {
  15. new HttpHeaderInfo
  16. {
  17. Name = "User-Agent",
  18. Value = @"PLAYSTATION 4",
  19. Match = HeaderMatchType.Substring
  20. },
  21. new HttpHeaderInfo
  22. {
  23. Name = "X-AV-Client-Info",
  24. Value = @"PLAYSTATION 4",
  25. Match = HeaderMatchType.Substring
  26. }
  27. }
  28. };
  29. AlbumArtPn = "JPEG_TN";
  30. SonyAggregationFlags = "10";
  31. EnableSingleAlbumArtLimit = true;
  32. DirectPlayProfiles = new[]
  33. {
  34. new DirectPlayProfile
  35. {
  36. Container = "avi",
  37. Type = DlnaProfileType.Video,
  38. VideoCodec = "mpeg4",
  39. AudioCodec = "mp2,mp3"
  40. },
  41. new DirectPlayProfile
  42. {
  43. Container = "ts,mpegts",
  44. Type = DlnaProfileType.Video,
  45. VideoCodec = "mpeg1video,mpeg2video,h264",
  46. AudioCodec = "ac3,mp2,mp3,aac"
  47. },
  48. new DirectPlayProfile
  49. {
  50. Container = "mpeg",
  51. Type = DlnaProfileType.Video,
  52. VideoCodec = "mpeg1video,mpeg2video",
  53. AudioCodec = "mp2"
  54. },
  55. new DirectPlayProfile
  56. {
  57. Container = "mp4,mkv,m4v",
  58. Type = DlnaProfileType.Video,
  59. VideoCodec = "h264,mpeg4",
  60. AudioCodec = "aac,ac3"
  61. },
  62. new DirectPlayProfile
  63. {
  64. Container = "aac,mp3,wav",
  65. Type = DlnaProfileType.Audio
  66. },
  67. new DirectPlayProfile
  68. {
  69. Container = "jpeg,png,gif,bmp,tiff",
  70. Type = DlnaProfileType.Photo
  71. }
  72. };
  73. TranscodingProfiles = new[]
  74. {
  75. new TranscodingProfile
  76. {
  77. Container = "mp3",
  78. AudioCodec = "mp3",
  79. Type = DlnaProfileType.Audio,
  80. // Transcoded audio won't be playable at all without this
  81. TranscodeSeekInfo = TranscodeSeekInfo.Bytes
  82. },
  83. new TranscodingProfile
  84. {
  85. Container = "ts",
  86. VideoCodec = "h264",
  87. AudioCodec = "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. new ResponseProfile
  236. {
  237. Container = "m4v",
  238. Type = DlnaProfileType.Video,
  239. MimeType = "video/mp4"
  240. }
  241. };
  242. SubtitleProfiles = new[]
  243. {
  244. new SubtitleProfile
  245. {
  246. Format = "srt",
  247. Method = SubtitleDeliveryMethod.Embed
  248. }
  249. };
  250. }
  251. }
  252. }