DefaultProfile.cs 5.3 KB

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