WdtvLiveProfile.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. using MediaBrowser.Model.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. },
  42. new TranscodingProfile
  43. {
  44. Container = "jpeg",
  45. Type = DlnaProfileType.Photo
  46. }
  47. };
  48. DirectPlayProfiles = new[]
  49. {
  50. new DirectPlayProfile
  51. {
  52. Container = "avi",
  53. Type = DlnaProfileType.Video,
  54. VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
  55. AudioCodec = "ac3,dca,mp2,mp3,pcm"
  56. },
  57. new DirectPlayProfile
  58. {
  59. Container = "mpeg",
  60. Type = DlnaProfileType.Video,
  61. VideoCodec = "mpeg1video,mpeg2video",
  62. AudioCodec = "ac3,dca,mp2,mp3,pcm"
  63. },
  64. new DirectPlayProfile
  65. {
  66. Container = "mkv",
  67. Type = DlnaProfileType.Video,
  68. VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
  69. AudioCodec = "ac3,dca,aac,mp2,mp3,pcm"
  70. },
  71. new DirectPlayProfile
  72. {
  73. Container = "ts",
  74. Type = DlnaProfileType.Video,
  75. VideoCodec = "mpeg1video,mpeg2video,h264,vc1",
  76. AudioCodec = "ac3,dca,mp2,mp3,aac"
  77. },
  78. new DirectPlayProfile
  79. {
  80. Container = "mp4,mov",
  81. Type = DlnaProfileType.Video,
  82. VideoCodec = "h264,mpeg4",
  83. AudioCodec = "ac3,aac,mp2,mp3"
  84. },
  85. new DirectPlayProfile
  86. {
  87. Container = "asf",
  88. Type = DlnaProfileType.Video,
  89. VideoCodec = "vc1",
  90. AudioCodec = "wmav2,wmapro"
  91. },
  92. new DirectPlayProfile
  93. {
  94. Container = "asf",
  95. Type = DlnaProfileType.Video,
  96. VideoCodec = "mpeg2video",
  97. AudioCodec = "mp2,ac3"
  98. },
  99. new DirectPlayProfile
  100. {
  101. Container = "mp3",
  102. AudioCodec = "mp2,mp3",
  103. Type = DlnaProfileType.Audio
  104. },
  105. new DirectPlayProfile
  106. {
  107. Container = "mp4",
  108. AudioCodec = "mp4",
  109. Type = DlnaProfileType.Audio
  110. },
  111. new DirectPlayProfile
  112. {
  113. Container = "flac",
  114. AudioCodec = "flac",
  115. Type = DlnaProfileType.Audio
  116. },
  117. new DirectPlayProfile
  118. {
  119. Container = "asf",
  120. AudioCodec = "wmav2,wmapro,wmavoice",
  121. Type = DlnaProfileType.Audio
  122. },
  123. new DirectPlayProfile
  124. {
  125. Container = "ogg",
  126. AudioCodec = "vorbis",
  127. Type = DlnaProfileType.Audio
  128. },
  129. new DirectPlayProfile
  130. {
  131. Type = DlnaProfileType.Photo,
  132. Container = "jpeg,png,gif,bmp,tiff"
  133. }
  134. };
  135. ResponseProfiles = new[]
  136. {
  137. new ResponseProfile
  138. {
  139. Container = "ts",
  140. OrgPn = "MPEG_TS_SD_NA",
  141. Type = DlnaProfileType.Video
  142. }
  143. };
  144. ContainerProfiles = new[]
  145. {
  146. new ContainerProfile
  147. {
  148. Type = DlnaProfileType.Photo,
  149. Conditions = new []
  150. {
  151. new ProfileCondition
  152. {
  153. Condition = ProfileConditionType.LessThanEqual,
  154. Property = ProfileConditionValue.Width,
  155. Value = "1920"
  156. },
  157. new ProfileCondition
  158. {
  159. Condition = ProfileConditionType.LessThanEqual,
  160. Property = ProfileConditionValue.Height,
  161. Value = "1080"
  162. }
  163. }
  164. }
  165. };
  166. CodecProfiles = new[]
  167. {
  168. new CodecProfile
  169. {
  170. Type = CodecType.Video,
  171. Codec = "h264",
  172. Conditions = new []
  173. {
  174. new ProfileCondition
  175. {
  176. Condition = ProfileConditionType.LessThanEqual,
  177. Property = ProfileConditionValue.Width,
  178. Value = "1920"
  179. },
  180. new ProfileCondition
  181. {
  182. Condition = ProfileConditionType.LessThanEqual,
  183. Property = ProfileConditionValue.Height,
  184. Value = "1080"
  185. },
  186. new ProfileCondition
  187. {
  188. Condition = ProfileConditionType.LessThanEqual,
  189. Property = ProfileConditionValue.VideoLevel,
  190. Value = "41"
  191. }
  192. }
  193. },
  194. new CodecProfile
  195. {
  196. Type = CodecType.VideoAudio,
  197. Codec = "aac",
  198. Conditions = new []
  199. {
  200. new ProfileCondition
  201. {
  202. Condition = ProfileConditionType.LessThanEqual,
  203. Property = ProfileConditionValue.AudioChannels,
  204. Value = "2"
  205. }
  206. }
  207. }
  208. };
  209. }
  210. }
  211. }