LgTvProfile.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. using MediaBrowser.Model.Dlna;
  2. namespace Emby.Dlna.Profiles
  3. {
  4. [System.Xml.Serialization.XmlRoot("Profile")]
  5. public class LgTvProfile : DefaultProfile
  6. {
  7. public LgTvProfile()
  8. {
  9. Name = "LG Smart TV";
  10. TimelineOffsetSeconds = 10;
  11. Identification = new DeviceIdentification
  12. {
  13. FriendlyName = @"LG.*",
  14. Headers = new[]
  15. {
  16. new HttpHeaderInfo
  17. {
  18. Name = "User-Agent",
  19. Value = "LG",
  20. Match = HeaderMatchType.Substring
  21. }
  22. }
  23. };
  24. TranscodingProfiles = new[]
  25. {
  26. new TranscodingProfile
  27. {
  28. Container = "mp3",
  29. AudioCodec = "mp3",
  30. Type = DlnaProfileType.Audio
  31. },
  32. new TranscodingProfile
  33. {
  34. Container = "ts",
  35. AudioCodec = "ac3,aac,mp3",
  36. VideoCodec = "h264",
  37. Type = DlnaProfileType.Video
  38. },
  39. new TranscodingProfile
  40. {
  41. Container = "jpeg",
  42. Type = DlnaProfileType.Photo
  43. }
  44. };
  45. DirectPlayProfiles = new[]
  46. {
  47. new DirectPlayProfile
  48. {
  49. Container = "ts,mpegts,avi,mkv,m2ts",
  50. VideoCodec = "h264",
  51. AudioCodec = "aac,ac3,eac3,mp3,dca,dts",
  52. Type = DlnaProfileType.Video
  53. },
  54. new DirectPlayProfile
  55. {
  56. Container = "mp4,m4v",
  57. VideoCodec = "h264,mpeg4",
  58. AudioCodec = "aac,ac3,eac3,mp3,dca,dts",
  59. Type = DlnaProfileType.Video
  60. },
  61. new DirectPlayProfile
  62. {
  63. Container = "mp3",
  64. Type = DlnaProfileType.Audio
  65. },
  66. new DirectPlayProfile
  67. {
  68. Container = "jpeg",
  69. Type = DlnaProfileType.Photo
  70. }
  71. };
  72. ContainerProfiles = new[]
  73. {
  74. new ContainerProfile
  75. {
  76. Type = DlnaProfileType.Photo,
  77. Conditions = new []
  78. {
  79. new ProfileCondition
  80. {
  81. Condition = ProfileConditionType.LessThanEqual,
  82. Property = ProfileConditionValue.Width,
  83. Value = "1920"
  84. },
  85. new ProfileCondition
  86. {
  87. Condition = ProfileConditionType.LessThanEqual,
  88. Property = ProfileConditionValue.Height,
  89. Value = "1080"
  90. }
  91. }
  92. }
  93. };
  94. CodecProfiles = new[]
  95. {
  96. new CodecProfile
  97. {
  98. Type = CodecType.Video,
  99. Codec = "mpeg4",
  100. Conditions = new[]
  101. {
  102. new ProfileCondition
  103. {
  104. Condition = ProfileConditionType.LessThanEqual,
  105. Property = ProfileConditionValue.Width,
  106. Value = "1920"
  107. },
  108. new ProfileCondition
  109. {
  110. Condition = ProfileConditionType.LessThanEqual,
  111. Property = ProfileConditionValue.Height,
  112. Value = "1080"
  113. },
  114. new ProfileCondition
  115. {
  116. Condition = ProfileConditionType.LessThanEqual,
  117. Property = ProfileConditionValue.VideoFramerate,
  118. Value = "30"
  119. }
  120. }
  121. },
  122. new CodecProfile
  123. {
  124. Type = CodecType.Video,
  125. Codec = "h264",
  126. Conditions = new[]
  127. {
  128. new ProfileCondition
  129. {
  130. Condition = ProfileConditionType.LessThanEqual,
  131. Property = ProfileConditionValue.Width,
  132. Value = "1920"
  133. },
  134. new ProfileCondition
  135. {
  136. Condition = ProfileConditionType.LessThanEqual,
  137. Property = ProfileConditionValue.Height,
  138. Value = "1080"
  139. },
  140. new ProfileCondition
  141. {
  142. Condition = ProfileConditionType.LessThanEqual,
  143. Property = ProfileConditionValue.VideoLevel,
  144. Value = "41"
  145. }
  146. }
  147. },
  148. new CodecProfile
  149. {
  150. Type = CodecType.VideoAudio,
  151. Codec = "ac3,eac3,aac,mp3",
  152. Conditions = new[]
  153. {
  154. new ProfileCondition
  155. {
  156. Condition = ProfileConditionType.LessThanEqual,
  157. Property = ProfileConditionValue.AudioChannels,
  158. Value = "6"
  159. }
  160. }
  161. }
  162. };
  163. SubtitleProfiles = new[]
  164. {
  165. new SubtitleProfile
  166. {
  167. Format = "srt",
  168. Method = SubtitleDeliveryMethod.Embed
  169. },
  170. new SubtitleProfile
  171. {
  172. Format = "srt",
  173. Method = SubtitleDeliveryMethod.External
  174. }
  175. };
  176. ResponseProfiles = new ResponseProfile[]
  177. {
  178. new ResponseProfile
  179. {
  180. Container = "m4v",
  181. Type = DlnaProfileType.Video,
  182. MimeType = "video/mp4"
  183. },
  184. new ResponseProfile
  185. {
  186. Container = "ts,mpegts",
  187. Type = DlnaProfileType.Video,
  188. MimeType = "video/mpeg"
  189. }
  190. };
  191. }
  192. }
  193. }