SonyPs3Profile.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. using System.Xml.Serialization;
  2. using MediaBrowser.Controller.Dlna;
  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. SonyAggregationFlags = "10";
  31. XDlnaDoc = "DMS-1.50";
  32. TranscodingProfiles = new[]
  33. {
  34. new TranscodingProfile
  35. {
  36. Container = "mp3",
  37. AudioCodec = "mp3",
  38. Type = DlnaProfileType.Audio
  39. },
  40. new TranscodingProfile
  41. {
  42. Container = "ts",
  43. VideoCodec = "h264",
  44. AudioCodec = "mp3",
  45. Type = DlnaProfileType.Video
  46. },
  47. new TranscodingProfile
  48. {
  49. Container = "jpeg",
  50. Type = DlnaProfileType.Photo
  51. }
  52. };
  53. ContainerProfiles = new[]
  54. {
  55. new ContainerProfile
  56. {
  57. Type = DlnaProfileType.Photo,
  58. Conditions = new []
  59. {
  60. new ProfileCondition
  61. {
  62. Condition = ProfileConditionType.LessThanEqual,
  63. Property = ProfileConditionValue.Width,
  64. Value = "1920"
  65. },
  66. new ProfileCondition
  67. {
  68. Condition = ProfileConditionType.LessThanEqual,
  69. Property = ProfileConditionValue.Height,
  70. Value = "1080"
  71. }
  72. }
  73. }
  74. };
  75. CodecProfiles = new[]
  76. {
  77. new CodecProfile
  78. {
  79. Type = CodecType.Video,
  80. Codec = "h264",
  81. Conditions = new []
  82. {
  83. new ProfileCondition
  84. {
  85. Condition = ProfileConditionType.LessThanEqual,
  86. Property = ProfileConditionValue.Width,
  87. Value = "1920"
  88. },
  89. new ProfileCondition
  90. {
  91. Condition = ProfileConditionType.LessThanEqual,
  92. Property = ProfileConditionValue.Height,
  93. Value = "1080"
  94. },
  95. new ProfileCondition
  96. {
  97. Condition = ProfileConditionType.LessThanEqual,
  98. Property = ProfileConditionValue.VideoFramerate,
  99. Value = "30",
  100. IsRequired = false
  101. },
  102. new ProfileCondition
  103. {
  104. Condition = ProfileConditionType.LessThanEqual,
  105. Property = ProfileConditionValue.VideoBitrate,
  106. Value = "15360000",
  107. IsRequired = false
  108. },
  109. new ProfileCondition
  110. {
  111. Condition = ProfileConditionType.LessThanEqual,
  112. Property = ProfileConditionValue.VideoLevel,
  113. Value = "41",
  114. IsRequired = false
  115. }
  116. }
  117. },
  118. new CodecProfile
  119. {
  120. Type = CodecType.VideoAudio,
  121. Codec = "ac3",
  122. Conditions = new []
  123. {
  124. new ProfileCondition
  125. {
  126. Condition = ProfileConditionType.LessThanEqual,
  127. Property = ProfileConditionValue.AudioChannels,
  128. Value = "6",
  129. IsRequired = false
  130. },
  131. new ProfileCondition
  132. {
  133. Condition = ProfileConditionType.LessThanEqual,
  134. Property = ProfileConditionValue.AudioBitrate,
  135. Value = "640000",
  136. IsRequired = false
  137. }
  138. }
  139. },
  140. new CodecProfile
  141. {
  142. Type = CodecType.VideoAudio,
  143. Codec = "wmapro",
  144. Conditions = new []
  145. {
  146. new ProfileCondition
  147. {
  148. Condition = ProfileConditionType.LessThanEqual,
  149. Property = ProfileConditionValue.AudioChannels,
  150. Value = "2"
  151. }
  152. }
  153. },
  154. new CodecProfile
  155. {
  156. Type = CodecType.VideoAudio,
  157. Codec = "aac",
  158. Conditions = new []
  159. {
  160. new ProfileCondition
  161. {
  162. Condition = ProfileConditionType.NotEquals,
  163. Property = ProfileConditionValue.AudioProfile,
  164. Value = "he-aac",
  165. IsRequired = false
  166. }
  167. }
  168. },
  169. new CodecProfile
  170. {
  171. Type = CodecType.VideoAudio,
  172. Codec = "aac",
  173. Conditions = new []
  174. {
  175. new ProfileCondition
  176. {
  177. Condition = ProfileConditionType.LessThanEqual,
  178. Property = ProfileConditionValue.AudioChannels,
  179. Value = "2"
  180. },
  181. new ProfileCondition
  182. {
  183. Condition = ProfileConditionType.NotEquals,
  184. Property = ProfileConditionValue.AudioProfile,
  185. Value = "he-aac"
  186. }
  187. }
  188. }
  189. };
  190. MediaProfiles = new[]
  191. {
  192. new MediaProfile
  193. {
  194. Container = "mp4,mov",
  195. AudioCodec="aac",
  196. MimeType = "video/mp4",
  197. Type = DlnaProfileType.Video
  198. },
  199. new MediaProfile
  200. {
  201. Container = "avi",
  202. MimeType = "video/divx",
  203. OrgPn="AVI",
  204. Type = DlnaProfileType.Video
  205. },
  206. new MediaProfile
  207. {
  208. Container = "wav",
  209. MimeType = "audio/wav",
  210. Type = DlnaProfileType.Audio
  211. }
  212. };
  213. }
  214. }
  215. }