WdtvLiveProfile.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. using MediaBrowser.Controller.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. [XmlRoot("Profile")]
  6. public class WdtvLiveProfile : DefaultProfile
  7. {
  8. public WdtvLiveProfile()
  9. {
  10. Name = "WDTV Live";
  11. TimelineOffsetSeconds = 5;
  12. IgnoreTranscodeByteRangeRequests = true;
  13. Identification = new DeviceIdentification
  14. {
  15. ModelName = "WD TV HD Live",
  16. Headers = new []
  17. {
  18. new HttpHeaderInfo {Name = "User-Agent", Value = "alphanetworks", Match = HeaderMatchType.Substring},
  19. new HttpHeaderInfo
  20. {
  21. Name = "User-Agent",
  22. Value = "ALPHA Networks",
  23. Match = HeaderMatchType.Substring
  24. }
  25. }
  26. };
  27. TranscodingProfiles = new[]
  28. {
  29. new TranscodingProfile
  30. {
  31. Container = "mp3",
  32. Type = DlnaProfileType.Audio,
  33. AudioCodec = "mp3"
  34. },
  35. new TranscodingProfile
  36. {
  37. Container = "ts",
  38. Type = DlnaProfileType.Video,
  39. VideoCodec = "h264",
  40. AudioCodec = "aac",
  41. Settings = new []
  42. {
  43. new TranscodingSetting {Name = TranscodingSettingType.VideoProfile, Value = "baseline"}
  44. }
  45. },
  46. new TranscodingProfile
  47. {
  48. Container = "jpeg",
  49. Type = DlnaProfileType.Photo
  50. }
  51. };
  52. DirectPlayProfiles = new[]
  53. {
  54. new DirectPlayProfile
  55. {
  56. Container = "avi",
  57. Type = DlnaProfileType.Video,
  58. VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
  59. AudioCodec = "ac3,dca,mp2,mp3,pcm"
  60. },
  61. new DirectPlayProfile
  62. {
  63. Container = "mpeg",
  64. Type = DlnaProfileType.Video,
  65. VideoCodec = "mpeg1video,mpeg2video",
  66. AudioCodec = "ac3,dca,mp2,mp3,pcm"
  67. },
  68. new DirectPlayProfile
  69. {
  70. Container = "mkv",
  71. Type = DlnaProfileType.Video,
  72. VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
  73. AudioCodec = "ac3,dca,aac,mp2,mp3,pcm"
  74. },
  75. new DirectPlayProfile
  76. {
  77. Container = "ts",
  78. Type = DlnaProfileType.Video,
  79. VideoCodec = "mpeg1video,mpeg2video,h264,vc1",
  80. AudioCodec = "ac3,dca,mp2,mp3"
  81. },
  82. new DirectPlayProfile
  83. {
  84. Container = "mp4,mov",
  85. Type = DlnaProfileType.Video,
  86. VideoCodec = "h264,mpeg4",
  87. AudioCodec = "ac3,aac,mp2,mp3"
  88. },
  89. new DirectPlayProfile
  90. {
  91. Container = "asf",
  92. Type = DlnaProfileType.Video,
  93. VideoCodec = "vc1",
  94. AudioCodec = "wmav2,wmapro"
  95. },
  96. new DirectPlayProfile
  97. {
  98. Container = "asf",
  99. Type = DlnaProfileType.Video,
  100. VideoCodec = "mpeg2video",
  101. AudioCodec = "mp2,ac3"
  102. },
  103. new DirectPlayProfile
  104. {
  105. Container = "mp3",
  106. AudioCodec = "mp2,mp3",
  107. Type = DlnaProfileType.Audio
  108. },
  109. new DirectPlayProfile
  110. {
  111. Container = "mp4",
  112. AudioCodec = "mp4",
  113. Type = DlnaProfileType.Audio
  114. },
  115. new DirectPlayProfile
  116. {
  117. Container = "flac",
  118. AudioCodec = "flac",
  119. Type = DlnaProfileType.Audio
  120. },
  121. new DirectPlayProfile
  122. {
  123. Container = "asf",
  124. AudioCodec = "wmav2,wmapro,wmavoice",
  125. Type = DlnaProfileType.Audio
  126. },
  127. new DirectPlayProfile
  128. {
  129. Container = "ogg",
  130. AudioCodec = "vorbis",
  131. Type = DlnaProfileType.Audio
  132. },
  133. new DirectPlayProfile
  134. {
  135. Type = DlnaProfileType.Photo,
  136. Container = "jpeg,png,gif,bmp,tiff"
  137. }
  138. };
  139. MediaProfiles = new[]
  140. {
  141. new MediaProfile
  142. {
  143. Container = "ts",
  144. OrgPn = "MPEG_TS_SD_NA",
  145. Type = DlnaProfileType.Video
  146. }
  147. };
  148. ContainerProfiles = new[]
  149. {
  150. new ContainerProfile
  151. {
  152. Type = DlnaProfileType.Photo,
  153. Conditions = new []
  154. {
  155. new ProfileCondition
  156. {
  157. Condition = ProfileConditionType.LessThanEqual,
  158. Property = ProfileConditionValue.Width,
  159. Value = "1920"
  160. },
  161. new ProfileCondition
  162. {
  163. Condition = ProfileConditionType.LessThanEqual,
  164. Property = ProfileConditionValue.Height,
  165. Value = "1080"
  166. }
  167. }
  168. }
  169. };
  170. CodecProfiles = new[]
  171. {
  172. new CodecProfile
  173. {
  174. Type = CodecType.VideoCodec,
  175. Codec = "h264",
  176. Conditions = new []
  177. {
  178. new ProfileCondition
  179. {
  180. Condition = ProfileConditionType.LessThanEqual,
  181. Property = ProfileConditionValue.Width,
  182. Value = "1920"
  183. },
  184. new ProfileCondition
  185. {
  186. Condition = ProfileConditionType.LessThanEqual,
  187. Property = ProfileConditionValue.Height,
  188. Value = "1080"
  189. },
  190. new ProfileCondition
  191. {
  192. Condition = ProfileConditionType.LessThanEqual,
  193. Property = ProfileConditionValue.VideoLevel,
  194. Value = "41"
  195. }
  196. }
  197. },
  198. new CodecProfile
  199. {
  200. Type = CodecType.VideoAudioCodec,
  201. Codec = "aac",
  202. Conditions = new []
  203. {
  204. new ProfileCondition
  205. {
  206. Condition = ProfileConditionType.LessThanEqual,
  207. Property = ProfileConditionValue.AudioChannels,
  208. Value = "2"
  209. }
  210. }
  211. }
  212. };
  213. }
  214. }
  215. }