WdtvLiveProfile.cs 7.5 KB

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