SamsungSmartTvProfile.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class SamsungSmartTvProfile : DefaultProfile
  6. {
  7. public SamsungSmartTvProfile()
  8. {
  9. Name = "Samsung Smart TV";
  10. EnableAlbumArtInDidl = true;
  11. // Without this, older samsungs fail to browse
  12. EnableSingleAlbumArtLimit = true;
  13. Identification = new DeviceIdentification
  14. {
  15. ModelUrl = "samsung.com",
  16. Headers = new[]
  17. {
  18. new HttpHeaderInfo
  19. {
  20. Name = "User-Agent",
  21. Value = @"SEC_",
  22. Match = HeaderMatchType.Substring
  23. }
  24. }
  25. };
  26. AddXmlRootAttribute("xmlns:sec", "http://www.sec.co.kr/");
  27. TranscodingProfiles = new[]
  28. {
  29. new TranscodingProfile
  30. {
  31. Container = "mp3",
  32. AudioCodec = "mp3",
  33. Type = DlnaProfileType.Audio
  34. },
  35. new TranscodingProfile
  36. {
  37. Container = "ts",
  38. AudioCodec = "ac3",
  39. VideoCodec = "h264",
  40. Type = DlnaProfileType.Video,
  41. EstimateContentLength = false
  42. },
  43. new TranscodingProfile
  44. {
  45. Container = "jpeg",
  46. Type = DlnaProfileType.Photo
  47. }
  48. };
  49. DirectPlayProfiles = new[]
  50. {
  51. new DirectPlayProfile
  52. {
  53. Container = "asf",
  54. VideoCodec = "h264,mpeg4,mjpeg",
  55. AudioCodec = "mp3,ac3,wmav2,wmapro,wmavoice",
  56. Type = DlnaProfileType.Video
  57. },
  58. new DirectPlayProfile
  59. {
  60. Container = "avi",
  61. VideoCodec = "h264,mpeg4,mjpeg",
  62. AudioCodec = "mp3,ac3,dca,dts",
  63. Type = DlnaProfileType.Video
  64. },
  65. new DirectPlayProfile
  66. {
  67. Container = "mkv",
  68. VideoCodec = "h264,mpeg4,mjpeg4",
  69. AudioCodec = "mp3,ac3,dca,aac,dts",
  70. Type = DlnaProfileType.Video
  71. },
  72. new DirectPlayProfile
  73. {
  74. Container = "mp4,m4v",
  75. VideoCodec = "h264,mpeg4",
  76. AudioCodec = "mp3,aac",
  77. Type = DlnaProfileType.Video
  78. },
  79. new DirectPlayProfile
  80. {
  81. Container = "3gp",
  82. VideoCodec = "h264,mpeg4",
  83. AudioCodec = "aac,he-aac",
  84. Type = DlnaProfileType.Video
  85. },
  86. new DirectPlayProfile
  87. {
  88. Container = "mpg,mpeg",
  89. VideoCodec = "mpeg1video,mpeg2video,h264",
  90. AudioCodec = "ac3,mp2,mp3,aac",
  91. Type = DlnaProfileType.Video
  92. },
  93. new DirectPlayProfile
  94. {
  95. Container = "vro,vob",
  96. VideoCodec = "mpeg1video,mpeg2video",
  97. AudioCodec = "ac3,mp2,mp3",
  98. Type = DlnaProfileType.Video
  99. },
  100. new DirectPlayProfile
  101. {
  102. Container = "ts",
  103. VideoCodec = "mpeg2video,h264,vc1",
  104. AudioCodec = "ac3,aac,mp3,eac3",
  105. Type = DlnaProfileType.Video
  106. },
  107. new DirectPlayProfile
  108. {
  109. Container = "asf",
  110. VideoCodec = "wmv2,wmv3",
  111. AudioCodec = "wmav2,wmavoice",
  112. Type = DlnaProfileType.Video
  113. },
  114. new DirectPlayProfile
  115. {
  116. Container = "mp3,flac",
  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 = "wmav2,dca,aac,mp3,dts",
  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. new ResponseProfile
  319. {
  320. Container = "m4v",
  321. Type = DlnaProfileType.Video,
  322. MimeType = "video/mp4"
  323. }
  324. };
  325. SubtitleProfiles = new[]
  326. {
  327. new SubtitleProfile
  328. {
  329. Format = "srt",
  330. Method = SubtitleDeliveryMethod.Embed
  331. },
  332. new SubtitleProfile
  333. {
  334. Format = "srt",
  335. Method = SubtitleDeliveryMethod.External,
  336. DidlMode = "CaptionInfoEx"
  337. }
  338. };
  339. }
  340. }
  341. }