jellyfin-server/Emby.Dlna/Profiles/DefaultProfile.cs

180 lines
5.2 KiB
C#
Raw Normal View History

#pragma warning disable CS1591
using System.Linq;
2019-01-13 19:16:19 +00:00
using MediaBrowser.Model.Dlna;
2016-10-29 22:22:20 +00:00
2016-10-29 22:34:54 +00:00
namespace Emby.Dlna.Profiles
2016-10-29 22:22:20 +00:00
{
2018-09-12 17:26:21 +00:00
[System.Xml.Serialization.XmlRoot("Profile")]
2016-10-29 22:22:20 +00:00
public class DefaultProfile : DeviceProfile
{
public DefaultProfile()
{
Name = "Generic Device";
2018-09-12 17:26:21 +00:00
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:*";
2016-10-29 22:22:20 +00:00
2018-12-13 09:18:29 +00:00
Manufacturer = "Jellyfin";
2018-09-12 17:26:21 +00:00
ModelDescription = "UPnP/AV 1.0 Compliant Media Server";
2018-12-13 19:10:22 +00:00
ModelName = "Jellyfin Server";
2018-09-12 17:26:21 +00:00
ModelNumber = "01";
ModelUrl = "https://github.com/jellyfin/jellyfin";
ManufacturerUrl = "https://github.com/jellyfin/jellyfin";
2016-10-29 22:22:20 +00:00
AlbumArtPn = "JPEG_SM";
MaxAlbumArtHeight = 480;
MaxAlbumArtWidth = 480;
MaxIconWidth = 48;
MaxIconHeight = 48;
2018-09-12 17:26:21 +00:00
MaxStreamingBitrate = 140000000;
MaxStaticBitrate = 140000000;
2016-10-29 22:22:20 +00:00
MusicStreamingTranscodingBitrate = 192000;
EnableAlbumArtInDidl = false;
TranscodingProfiles = new[]
{
new TranscodingProfile
{
Container = "mp3",
AudioCodec = "mp3",
Type = DlnaProfileType.Audio
},
new TranscodingProfile
{
Container = "ts",
Type = DlnaProfileType.Video,
AudioCodec = "aac",
VideoCodec = "h264"
},
new TranscodingProfile
{
Container = "jpeg",
Type = DlnaProfileType.Photo
}
};
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
// play all
Container = "",
2016-10-29 22:22:20 +00:00
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
// play all
Container = "",
2016-10-29 22:22:20 +00:00
Type = DlnaProfileType.Audio
}
};
SubtitleProfiles = new[]
{
new SubtitleProfile
{
Format = "srt",
2017-05-12 18:09:42 +00:00
Method = SubtitleDeliveryMethod.External,
2017-03-07 18:27:56 +00:00
},
new SubtitleProfile
{
2017-05-12 18:09:42 +00:00
Format = "sub",
2017-03-07 18:27:56 +00:00
Method = SubtitleDeliveryMethod.External,
2017-05-12 18:09:42 +00:00
},
new SubtitleProfile
{
Format = "srt",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "ass",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "ssa",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "smi",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "dvdsub",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "pgs",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "pgssub",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "sub",
Method = SubtitleDeliveryMethod.Embed
2017-05-31 19:21:32 +00:00
},
new SubtitleProfile
{
Format = "subrip",
Method = SubtitleDeliveryMethod.Embed
},
new SubtitleProfile
{
Format = "vtt",
Method = SubtitleDeliveryMethod.Embed
2016-10-29 22:22:20 +00:00
}
};
ResponseProfiles = new[]
{
new ResponseProfile
{
Container = "m4v",
Type = DlnaProfileType.Video,
MimeType = "video/mp4"
}
};
}
public void AddXmlRootAttribute(string name, string value)
{
var atts = XmlRootAttributes ?? new XmlAttribute[] { };
2017-08-09 21:08:01 +00:00
var list = atts.ToList();
2016-10-29 22:22:20 +00:00
list.Add(new XmlAttribute
{
Name = name,
Value = value
});
2018-12-28 15:48:26 +00:00
XmlRootAttributes = list.ToArray();
2016-10-29 22:22:20 +00:00
}
}
}