PopcornHourProfile.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class PopcornHourProfile : DefaultProfile
  6. {
  7. public PopcornHourProfile()
  8. {
  9. Name = "Popcorn Hour";
  10. TranscodingProfiles = new[]
  11. {
  12. new TranscodingProfile
  13. {
  14. Container = "mp3",
  15. AudioCodec = "mp3",
  16. Type = DlnaProfileType.Audio
  17. },
  18. new TranscodingProfile
  19. {
  20. Container = "mp4",
  21. Type = DlnaProfileType.Video,
  22. AudioCodec = "aac",
  23. VideoCodec = "h264"
  24. },
  25. new TranscodingProfile
  26. {
  27. Container = "jpeg",
  28. Type = DlnaProfileType.Photo
  29. }
  30. };
  31. DirectPlayProfiles = new[]
  32. {
  33. new DirectPlayProfile
  34. {
  35. Container = "mp4,mov,m4v",
  36. Type = DlnaProfileType.Video,
  37. VideoCodec = "h264,mpeg4",
  38. AudioCodec = "aac"
  39. },
  40. new DirectPlayProfile
  41. {
  42. Container = "ts,mpegts",
  43. Type = DlnaProfileType.Video,
  44. VideoCodec = "h264",
  45. AudioCodec = "aac,ac3,eac3,mp3,mp2,pcm"
  46. },
  47. new DirectPlayProfile
  48. {
  49. Container = "asf,wmv",
  50. Type = DlnaProfileType.Video,
  51. VideoCodec = "wmv3,vc1",
  52. AudioCodec = "wmav2,wmapro"
  53. },
  54. new DirectPlayProfile
  55. {
  56. Container = "avi",
  57. Type = DlnaProfileType.Video,
  58. VideoCodec = "mpeg4,msmpeg4",
  59. AudioCodec = "mp3,ac3,eac3,mp2,pcm"
  60. },
  61. new DirectPlayProfile
  62. {
  63. Container = "mkv",
  64. Type = DlnaProfileType.Video,
  65. VideoCodec = "h264",
  66. AudioCodec = "aac,mp3,ac3,eac3,mp2,pcm"
  67. },
  68. new DirectPlayProfile
  69. {
  70. Container = "aac,mp3,flac,ogg,wma,wav",
  71. Type = DlnaProfileType.Audio
  72. },
  73. new DirectPlayProfile
  74. {
  75. Container = "jpeg,gif,bmp,png",
  76. Type = DlnaProfileType.Photo
  77. }
  78. };
  79. CodecProfiles = new[]
  80. {
  81. new CodecProfile
  82. {
  83. Type = CodecType.Video,
  84. Codec="h264",
  85. Conditions = new []
  86. {
  87. new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline"),
  88. new ProfileCondition
  89. {
  90. Condition = ProfileConditionType.LessThanEqual,
  91. Property = ProfileConditionValue.Width,
  92. Value = "1920"
  93. },
  94. new ProfileCondition
  95. {
  96. Condition = ProfileConditionType.LessThanEqual,
  97. Property = ProfileConditionValue.Height,
  98. Value = "1080"
  99. },
  100. new ProfileCondition
  101. {
  102. Condition = ProfileConditionType.NotEquals,
  103. Property = ProfileConditionValue.IsAnamorphic,
  104. Value = "true",
  105. IsRequired = false
  106. }
  107. }
  108. },
  109. new CodecProfile
  110. {
  111. Type = CodecType.Video,
  112. Conditions = new []
  113. {
  114. new ProfileCondition
  115. {
  116. Condition = ProfileConditionType.LessThanEqual,
  117. Property = ProfileConditionValue.Width,
  118. Value = "1920"
  119. },
  120. new ProfileCondition
  121. {
  122. Condition = ProfileConditionType.LessThanEqual,
  123. Property = ProfileConditionValue.Height,
  124. Value = "1080"
  125. },
  126. new ProfileCondition
  127. {
  128. Condition = ProfileConditionType.NotEquals,
  129. Property = ProfileConditionValue.IsAnamorphic,
  130. Value = "true",
  131. IsRequired = false
  132. }
  133. }
  134. },
  135. new CodecProfile
  136. {
  137. Type = CodecType.VideoAudio,
  138. Codec = "aac",
  139. Conditions = new []
  140. {
  141. new ProfileCondition
  142. {
  143. Condition = ProfileConditionType.LessThanEqual,
  144. Property = ProfileConditionValue.AudioChannels,
  145. Value = "2",
  146. IsRequired = false
  147. }
  148. }
  149. },
  150. new CodecProfile
  151. {
  152. Type = CodecType.Audio,
  153. Codec = "aac",
  154. Conditions = new []
  155. {
  156. new ProfileCondition
  157. {
  158. Condition = ProfileConditionType.LessThanEqual,
  159. Property = ProfileConditionValue.AudioChannels,
  160. Value = "2",
  161. IsRequired = false
  162. }
  163. }
  164. },
  165. new CodecProfile
  166. {
  167. Type = CodecType.Audio,
  168. Codec = "mp3",
  169. Conditions = new []
  170. {
  171. new ProfileCondition
  172. {
  173. Condition = ProfileConditionType.LessThanEqual,
  174. Property = ProfileConditionValue.AudioChannels,
  175. Value = "2",
  176. IsRequired = false
  177. },
  178. new ProfileCondition
  179. {
  180. Condition = ProfileConditionType.LessThanEqual,
  181. Property = ProfileConditionValue.AudioBitrate,
  182. Value = "320000",
  183. IsRequired = false
  184. }
  185. }
  186. }
  187. };
  188. ResponseProfiles = new ResponseProfile[]
  189. {
  190. new ResponseProfile
  191. {
  192. Container = "m4v",
  193. Type = DlnaProfileType.Video,
  194. MimeType = "video/mp4"
  195. }
  196. };
  197. SubtitleProfiles = new[]
  198. {
  199. new SubtitleProfile
  200. {
  201. Format = "srt",
  202. Method = SubtitleDeliveryMethod.Embed
  203. }
  204. };
  205. }
  206. }
  207. }