SamsungSmartTvProfile.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. using MediaBrowser.Model.Dlna;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Dlna.Profiles
  4. {
  5. [XmlRoot("Profile")]
  6. public class SamsungSmartTvProfile : DefaultProfile
  7. {
  8. public SamsungSmartTvProfile()
  9. {
  10. Name = "Samsung Smart TV";
  11. EnableAlbumArtInDidl = true;
  12. Identification = new DeviceIdentification
  13. {
  14. ModelUrl = "samsung.com",
  15. Headers = new[]
  16. {
  17. new HttpHeaderInfo
  18. {
  19. Name = "User-Agent",
  20. Value = @"SEC_",
  21. Match = HeaderMatchType.Substring
  22. }
  23. }
  24. };
  25. AddXmlRootAttribute("xmlns:sec", "http://www.sec.co.kr/");
  26. TranscodingProfiles = new[]
  27. {
  28. new TranscodingProfile
  29. {
  30. Container = "mp3",
  31. AudioCodec = "mp3",
  32. Type = DlnaProfileType.Audio
  33. },
  34. new TranscodingProfile
  35. {
  36. Container = "ts",
  37. AudioCodec = "ac3",
  38. VideoCodec = "h264",
  39. Type = DlnaProfileType.Video,
  40. EstimateContentLength = true
  41. },
  42. new TranscodingProfile
  43. {
  44. Container = "jpeg",
  45. Type = DlnaProfileType.Photo
  46. }
  47. };
  48. DirectPlayProfiles = new[]
  49. {
  50. new DirectPlayProfile
  51. {
  52. Container = "asf",
  53. VideoCodec = "h264,mpeg4,mjpeg",
  54. AudioCodec = "mp3,ac3,wmav2,wmapro,wmavoice",
  55. Type = DlnaProfileType.Video
  56. },
  57. new DirectPlayProfile
  58. {
  59. Container = "avi",
  60. VideoCodec = "h264,mpeg4,mjpeg",
  61. AudioCodec = "mp3,ac3,dca",
  62. Type = DlnaProfileType.Video
  63. },
  64. new DirectPlayProfile
  65. {
  66. Container = "mkv",
  67. VideoCodec = "h264,mpeg4,mjpeg4",
  68. AudioCodec = "mp3,ac3,dca,aac",
  69. Type = DlnaProfileType.Video
  70. },
  71. new DirectPlayProfile
  72. {
  73. Container = "mp4",
  74. VideoCodec = "h264,mpeg4",
  75. AudioCodec = "mp3,aac",
  76. Type = DlnaProfileType.Video
  77. },
  78. new DirectPlayProfile
  79. {
  80. Container = "3gp",
  81. VideoCodec = "h264,mpeg4",
  82. AudioCodec = "aac,he-aac",
  83. Type = DlnaProfileType.Video
  84. },
  85. new DirectPlayProfile
  86. {
  87. Container = "mpg,mpeg",
  88. VideoCodec = "mpeg1video,mpeg2video,h264",
  89. AudioCodec = "ac3,mp2,mp3,aac",
  90. Type = DlnaProfileType.Video
  91. },
  92. new DirectPlayProfile
  93. {
  94. Container = "vro,vob",
  95. VideoCodec = "mpeg1video,mpeg2video",
  96. AudioCodec = "ac3,mp2,mp3",
  97. Type = DlnaProfileType.Video
  98. },
  99. new DirectPlayProfile
  100. {
  101. Container = "ts",
  102. VideoCodec = "mpeg2video,h264,vc1",
  103. AudioCodec = "ac3,aac,mp3,eac3",
  104. Type = DlnaProfileType.Video
  105. },
  106. new DirectPlayProfile
  107. {
  108. Container = "asf",
  109. VideoCodec = "wmv2,wmv3",
  110. AudioCodec = "wmav2,wmavoice",
  111. Type = DlnaProfileType.Video
  112. },
  113. new DirectPlayProfile
  114. {
  115. Container = "mp3",
  116. AudioCodec = "mp3",
  117. Type = DlnaProfileType.Audio
  118. },
  119. new DirectPlayProfile
  120. {
  121. Container = "jpeg",
  122. Type = DlnaProfileType.Photo
  123. }
  124. };
  125. ContainerProfiles = new[]
  126. {
  127. new ContainerProfile
  128. {
  129. Type = DlnaProfileType.Photo,
  130. Conditions = new []
  131. {
  132. new ProfileCondition
  133. {
  134. Condition = ProfileConditionType.LessThanEqual,
  135. Property = ProfileConditionValue.Width,
  136. Value = "1920"
  137. },
  138. new ProfileCondition
  139. {
  140. Condition = ProfileConditionType.LessThanEqual,
  141. Property = ProfileConditionValue.Height,
  142. Value = "1080"
  143. }
  144. }
  145. }
  146. };
  147. CodecProfiles = new[]
  148. {
  149. new CodecProfile
  150. {
  151. Type = CodecType.Video,
  152. Codec = "mpeg2video",
  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. new ProfileCondition
  168. {
  169. Condition = ProfileConditionType.LessThanEqual,
  170. Property = ProfileConditionValue.VideoFramerate,
  171. Value = "30"
  172. },
  173. new ProfileCondition
  174. {
  175. Condition = ProfileConditionType.LessThanEqual,
  176. Property = ProfileConditionValue.VideoBitrate,
  177. Value = "30720000"
  178. }
  179. }
  180. },
  181. new CodecProfile
  182. {
  183. Type = CodecType.Video,
  184. Codec = "mpeg4",
  185. Conditions = new[]
  186. {
  187. new ProfileCondition
  188. {
  189. Condition = ProfileConditionType.LessThanEqual,
  190. Property = ProfileConditionValue.Width,
  191. Value = "1920"
  192. },
  193. new ProfileCondition
  194. {
  195. Condition = ProfileConditionType.LessThanEqual,
  196. Property = ProfileConditionValue.Height,
  197. Value = "1080"
  198. },
  199. new ProfileCondition
  200. {
  201. Condition = ProfileConditionType.LessThanEqual,
  202. Property = ProfileConditionValue.VideoFramerate,
  203. Value = "30"
  204. },
  205. new ProfileCondition
  206. {
  207. Condition = ProfileConditionType.LessThanEqual,
  208. Property = ProfileConditionValue.VideoBitrate,
  209. Value = "8192000"
  210. }
  211. }
  212. },
  213. new CodecProfile
  214. {
  215. Type = CodecType.Video,
  216. Codec = "h264",
  217. Conditions = new[]
  218. {
  219. new ProfileCondition
  220. {
  221. Condition = ProfileConditionType.LessThanEqual,
  222. Property = ProfileConditionValue.Width,
  223. Value = "1920"
  224. },
  225. new ProfileCondition
  226. {
  227. Condition = ProfileConditionType.LessThanEqual,
  228. Property = ProfileConditionValue.Height,
  229. Value = "1080"
  230. },
  231. new ProfileCondition
  232. {
  233. Condition = ProfileConditionType.LessThanEqual,
  234. Property = ProfileConditionValue.VideoFramerate,
  235. Value = "30"
  236. },
  237. new ProfileCondition
  238. {
  239. Condition = ProfileConditionType.LessThanEqual,
  240. Property = ProfileConditionValue.VideoBitrate,
  241. Value = "37500000"
  242. },
  243. new ProfileCondition
  244. {
  245. Condition = ProfileConditionType.LessThanEqual,
  246. Property = ProfileConditionValue.VideoLevel,
  247. Value = "41"
  248. }
  249. }
  250. },
  251. new CodecProfile
  252. {
  253. Type = CodecType.Video,
  254. Codec = "wmv2,wmv3,vc1",
  255. Conditions = new[]
  256. {
  257. new ProfileCondition
  258. {
  259. Condition = ProfileConditionType.LessThanEqual,
  260. Property = ProfileConditionValue.Width,
  261. Value = "1920"
  262. },
  263. new ProfileCondition
  264. {
  265. Condition = ProfileConditionType.LessThanEqual,
  266. Property = ProfileConditionValue.Height,
  267. Value = "1080"
  268. },
  269. new ProfileCondition
  270. {
  271. Condition = ProfileConditionType.LessThanEqual,
  272. Property = ProfileConditionValue.VideoFramerate,
  273. Value = "30"
  274. },
  275. new ProfileCondition
  276. {
  277. Condition = ProfileConditionType.LessThanEqual,
  278. Property = ProfileConditionValue.VideoBitrate,
  279. Value = "25600000"
  280. }
  281. }
  282. },
  283. new CodecProfile
  284. {
  285. Type = CodecType.VideoAudio,
  286. Codec = "ac3,wmav2,dca,aac,mp3",
  287. Conditions = new[]
  288. {
  289. new ProfileCondition
  290. {
  291. Condition = ProfileConditionType.LessThanEqual,
  292. Property = ProfileConditionValue.AudioChannels,
  293. Value = "6"
  294. }
  295. }
  296. }
  297. };
  298. ResponseProfiles = new[]
  299. {
  300. new ResponseProfile
  301. {
  302. Container = "avi",
  303. MimeType = "video/x-msvideo",
  304. Type = DlnaProfileType.Video
  305. },
  306. new ResponseProfile
  307. {
  308. Container = "mkv",
  309. MimeType = "video/x-mkv",
  310. Type = DlnaProfileType.Video
  311. },
  312. new ResponseProfile
  313. {
  314. Container = "flac",
  315. MimeType = "audio/x-flac",
  316. Type = DlnaProfileType.Audio
  317. }
  318. };
  319. SubtitleProfiles = new[]
  320. {
  321. new SubtitleProfile
  322. {
  323. Format = "srt",
  324. Method = SubtitleDeliveryMethod.External,
  325. DidlMode = "CaptionInfoEx"
  326. }
  327. };
  328. }
  329. }
  330. }