DefaultProfile.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using System.Linq;
  2. using MediaBrowser.Model.Dlna;
  3. namespace Emby.Dlna.Profiles
  4. {
  5. [System.Xml.Serialization.XmlRoot("Profile")]
  6. public class DefaultProfile : DeviceProfile
  7. {
  8. public DefaultProfile()
  9. {
  10. Name = "Generic Device";
  11. ProtocolInfo = "http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:*";
  12. Manufacturer = "Jellyfin";
  13. ModelDescription = "UPnP/AV 1.0 Compliant Media Server";
  14. ModelName = "Jellyfin Server";
  15. ModelNumber = "01";
  16. ModelUrl = "https://github.com/jellyfin/jellyfin";
  17. ManufacturerUrl = "https://github.com/jellyfin/jellyfin";
  18. AlbumArtPn = "JPEG_SM";
  19. MaxAlbumArtHeight = 480;
  20. MaxAlbumArtWidth = 480;
  21. MaxIconWidth = 48;
  22. MaxIconHeight = 48;
  23. MaxStreamingBitrate = 140000000;
  24. MaxStaticBitrate = 140000000;
  25. MusicStreamingTranscodingBitrate = 192000;
  26. EnableAlbumArtInDidl = false;
  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. Type = DlnaProfileType.Video,
  39. AudioCodec = "aac",
  40. VideoCodec = "h264"
  41. },
  42. new TranscodingProfile
  43. {
  44. Container = "jpeg",
  45. Type = DlnaProfileType.Photo
  46. }
  47. };
  48. DirectPlayProfiles = new[]
  49. {
  50. new DirectPlayProfile
  51. {
  52. // play all
  53. Container = "",
  54. Type = DlnaProfileType.Video
  55. },
  56. new DirectPlayProfile
  57. {
  58. // play all
  59. Container = "",
  60. Type = DlnaProfileType.Audio
  61. }
  62. };
  63. SubtitleProfiles = new[]
  64. {
  65. new SubtitleProfile
  66. {
  67. Format = "srt",
  68. Method = SubtitleDeliveryMethod.External,
  69. },
  70. new SubtitleProfile
  71. {
  72. Format = "sub",
  73. Method = SubtitleDeliveryMethod.External,
  74. },
  75. new SubtitleProfile
  76. {
  77. Format = "srt",
  78. Method = SubtitleDeliveryMethod.Embed
  79. },
  80. new SubtitleProfile
  81. {
  82. Format = "ass",
  83. Method = SubtitleDeliveryMethod.Embed
  84. },
  85. new SubtitleProfile
  86. {
  87. Format = "ssa",
  88. Method = SubtitleDeliveryMethod.Embed
  89. },
  90. new SubtitleProfile
  91. {
  92. Format = "smi",
  93. Method = SubtitleDeliveryMethod.Embed
  94. },
  95. new SubtitleProfile
  96. {
  97. Format = "dvdsub",
  98. Method = SubtitleDeliveryMethod.Embed
  99. },
  100. new SubtitleProfile
  101. {
  102. Format = "pgs",
  103. Method = SubtitleDeliveryMethod.Embed
  104. },
  105. new SubtitleProfile
  106. {
  107. Format = "pgssub",
  108. Method = SubtitleDeliveryMethod.Embed
  109. },
  110. new SubtitleProfile
  111. {
  112. Format = "sub",
  113. Method = SubtitleDeliveryMethod.Embed
  114. },
  115. new SubtitleProfile
  116. {
  117. Format = "subrip",
  118. Method = SubtitleDeliveryMethod.Embed
  119. },
  120. new SubtitleProfile
  121. {
  122. Format = "vtt",
  123. Method = SubtitleDeliveryMethod.Embed
  124. }
  125. };
  126. ResponseProfiles = new[]
  127. {
  128. new ResponseProfile
  129. {
  130. Container = "m4v",
  131. Type = DlnaProfileType.Video,
  132. MimeType = "video/mp4"
  133. }
  134. };
  135. }
  136. public void AddXmlRootAttribute(string name, string value)
  137. {
  138. var atts = XmlRootAttributes ?? new XmlAttribute[] { };
  139. var list = atts.ToList();
  140. list.Add(new XmlAttribute
  141. {
  142. Name = name,
  143. Value = value
  144. });
  145. XmlRootAttributes = list.ToArray();
  146. }
  147. }
  148. }