DefaultProfile.cs 5.2 KB

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