WdtvLiveProfile.cs 8.4 KB

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