WindowsPhoneProfile.cs 8.6 KB

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