WdtvLiveProfile.cs 7.5 KB

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