DefaultProfile.cs 5.2 KB

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