diff options
| author | 7illusions <z@7illusions.com> | 2014-03-24 07:56:48 +0100 |
|---|---|---|
| committer | 7illusions <z@7illusions.com> | 2014-03-24 07:56:48 +0100 |
| commit | b50cac02492b55db230889d44e79142c0605d835 (patch) | |
| tree | ba87ee5708350d7a52aa7c38c3145492836576db /MediaBrowser.Dlna | |
| parent | f3e992b82be4b23e33e6130d1495f2b5203d0576 (diff) | |
| parent | 787f5e8382af65279dfc05e0b23ac9ec874c80ad (diff) | |
Merge pull request #1 from MediaBrowser/master
Sync
Diffstat (limited to 'MediaBrowser.Dlna')
24 files changed, 3277 insertions, 1056 deletions
diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.cs index ec2a09c52e..8b8644bee0 100644 --- a/MediaBrowser.Dlna/DlnaManager.cs +++ b/MediaBrowser.Dlna/DlnaManager.cs @@ -1,6 +1,7 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.IO; using MediaBrowser.Controller.Dlna; +using MediaBrowser.Dlna.Profiles; using MediaBrowser.Model.Serialization; using System.Collections.Generic; using System.Linq; @@ -13,993 +14,42 @@ namespace MediaBrowser.Dlna private IApplicationPaths _appPaths; private readonly IXmlSerializer _xmlSerializer; private readonly IFileSystem _fileSystem; + private readonly IJsonSerializer _jsonSerializer; - public DlnaManager(IXmlSerializer xmlSerializer, IFileSystem fileSystem) + public DlnaManager(IXmlSerializer xmlSerializer, IFileSystem fileSystem, IJsonSerializer jsonSerializer) { _xmlSerializer = xmlSerializer; _fileSystem = fileSystem; + _jsonSerializer = jsonSerializer; - //GetProfiles(); + GetProfiles(); } public IEnumerable<DeviceProfile> GetProfiles() { - var list = new List<DeviceProfile>(); - - list.Add(new DeviceProfile - { - Name = "Samsung TV (B Series)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = "^TV$", - ModelNumber = @"1\.0", - ModelName = "Samsung DTV DMR" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio, - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio, - }, - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"mp4"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/x-msvideo", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="mkv", - MimeType = "video/x-mkv", - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Samsung TV (E/F-series)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"(^\[TV\][A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung|(^\[TV\]Samsung [A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)", - ModelNumber = @"(1\.0)|(AllShare1\.0)" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"mp4"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/x-msvideo", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="mkv", - MimeType = "video/x-mkv", - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Samsung TV (C/D-series)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"(^TV-\d{2}C\d{3}.*)|(^\[TV\][A-Z]{2}\d{2}(D)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung", - ModelNumber = @"(1\.0)|(AllShare1\.0)" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"mp4"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/x-msvideo", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="mkv", - MimeType = "video/x-mkv", - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Xbox 360", - ClientType = "DLNA", - - ModelName = "Windows Media Player Sharing", - ModelNumber = "12.0", - ModelUrl = "http://www.microsoft.com/", - Manufacturer = "Microsoft Corporation", - ManufacturerUrl = "http://www.microsoft.com/", - XDlnaDoc = "DMS-1.50", - - TimelineOffsetSeconds = 40, - RequiresPlainFolders = true, - RequiresPlainVideoItems = true, - - Identification = new DeviceIdentification - { - ModelName = "Xbox 360", - - Headers = new List<HttpHeaderInfo> - { - new HttpHeaderInfo{ Name="User-Agent", Value="Xbox", Match= HeaderMatchType.Substring}, - new HttpHeaderInfo{ Name="User-Agent", Value="Xenon", Match= HeaderMatchType.Substring} - } - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - AudioCodec = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "asf", - VideoCodec = "wmv2", - AudioCodec = "wmav2", - Type = DlnaProfileType.Video, - TranscodeSeekInfo = TranscodeSeekInfo.Bytes, - EstimateContentLength = true, - - Settings = new List<TranscodingSetting> - { - new TranscodingSetting { Name = TranscodingSettingType.MaxAudioChannels, Value = "6" }, - new TranscodingSetting{ Name = TranscodingSettingType.VideoLevel, Value = "3"}, - new TranscodingSetting{ Name = TranscodingSettingType.VideoProfile, Value = "baseline"} - } - }, - new TranscodingProfile - { - Container = "jpeg", - Type = DlnaProfileType.Photo - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"avi"}, - VideoCodec = "mpeg4", - AudioCodec = "ac3,mp3", - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - VideoCodec = "h264", - AudioCodec = "aac", - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"mp4", "mov"}, - VideoCodec = "h264,mpeg4", - AudioCodec = "aac,ac3", - Type = DlnaProfileType.Video, - - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Has64BitOffsets, Value = "false", IsRequired=false} - } - }, - new DirectPlayProfile - { - Containers = new[]{"asf"}, - VideoCodec = "wmv2,wmv3,vc1", - AudioCodec = "wmav2,wmapro", - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"asf"}, - AudioCodec = "wmav2,wmapro,wmavoice", - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - AudioCodec = "mp3", - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"jpeg"}, - Type = DlnaProfileType.Photo, - - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080"} - } - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/avi", - Type = DlnaProfileType.Video - } - }, - - CodecProfiles = new[] - { - new CodecProfile - { - Type = CodecType.VideoCodec, - Codec = "mpeg4", - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1280"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "720"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoFramerate, Value = "30", IsRequired=false}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoBitrate, Value = "5120000", IsRequired=false} - } - }, - - new CodecProfile - { - Type = CodecType.VideoCodec, - Codec = "h264", - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoLevel, Value = "41", IsRequired=false}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoBitrate, Value = "10240000", IsRequired=false} - } - }, - - new CodecProfile - { - Type = CodecType.VideoCodec, - Codec = "wmv2,wmv3,vc1", - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoFramerate, Value = "30", IsRequired=false}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoBitrate, Value = "15360000", IsRequired=false} - } - }, - - new CodecProfile - { - Type = CodecType.VideoAudioCodec, - Codec = "ac3,wmav2,wmapro", - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.AudioChannels, Value = "6", IsRequired=false} - } - }, - - new CodecProfile - { - Type = CodecType.VideoAudioCodec, - Codec = "aac", - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.AudioChannels, Value = "6", IsRequired=false}, - new ProfileCondition{ Condition = ProfileConditionType.Equals, Property = ProfileConditionValue.AudioProfile, Value = "lc", IsRequired=false} - } - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Xbox One", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - ModelName = "Xbox One", - FriendlyName = "Xbox-SystemOS" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/x-msvideo", - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Sony Bravia (2012)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"BRAVIA KDL-\d{2}[A-Z]X\d5(\d|G).*" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"asf"}, - Type = DlnaProfileType.Audio - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/avi", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="asf", - MimeType = "video/x-ms-wmv", - Type = DlnaProfileType.Audio - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Sony Bravia (2013)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"BRAVIA (KDL-\d{2}W[689]\d{2}A.*)|(KD-\d{2}X9\d{3}A.*)" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"wma"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"mp4"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/avi", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="mp4", - MimeType = "video/mp4", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="ts", - MimeType = "video/mpeg", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="wma", - MimeType = "video/x-ms-wma", - Type = DlnaProfileType.Audio - } - } - }); - - list.Add(new DeviceProfile - { - //Panasonic Viera (2011|2012) Without AVI Support - Name = "Panasonic Viera E/S/ST/VT (2011)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"(VIERA (E|S)T?(3|5)0?.*)|(VIERA VT30.*)", - Manufacturer = "Panasonic" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - //Panasonic Viera (2011|2012) With AVI Support - Name = "Panasonic Viera G/GT/DT/UT/VT (2011/2012)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"(VIERA (G|D|U)T?(3|5)0?.*)|(VIERA VT50.*)", - Manufacturer = "Panasonic" - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - Type = DlnaProfileType.Audio - }, - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video - }, - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/divx", - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Philips (2010-)", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = ".*PHILIPS.*", - ModelName = "WD TV HD Live" - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3", "wma"}, - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video - }, - - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="avi", - MimeType = "video/avi", - Type = DlnaProfileType.Video - }, - - new MediaProfile - { - Container ="mkv", - MimeType = "video/x-matroska", - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "WDTV Live", - ClientType = "DLNA", - - TimelineOffsetSeconds = 5, - - Identification = new DeviceIdentification - { - ModelName = "WD TV HD Live", - - Headers = new List<HttpHeaderInfo> - { - new HttpHeaderInfo{ Name="User-Agent", Value="alphanetworks", Match= HeaderMatchType.Substring}, - new HttpHeaderInfo{ Name="User-Agent", Value="ALPHA Networks", Match= HeaderMatchType.Substring} - } - }, - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - Type = DlnaProfileType.Audio, - AudioCodec = "mp3" - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video, - VideoCodec = "h264", - AudioCodec = "aac", - - Settings = new List<TranscodingSetting> - { - new TranscodingSetting{ Name = TranscodingSettingType.VideoLevel, Value = "3"}, - new TranscodingSetting{ Name = TranscodingSettingType.VideoProfile, Value = "baseline"} - } - }, - new TranscodingProfile - { - Container = "jpeg", - Type = DlnaProfileType.Photo - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"avi"}, - Type = DlnaProfileType.Video, - VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1", - AudioCodec = "ac3,dca,mp2,mp3,pcm" - }, - - new DirectPlayProfile - { - Containers = new[]{"mpeg"}, - Type = DlnaProfileType.Video, - VideoCodec = "mpeg1video,mpeg2video", - AudioCodec = "ac3,dca,mp2,mp3,pcm" - }, - - new DirectPlayProfile - { - Containers = new[]{"mkv"}, - Type = DlnaProfileType.Video, - VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1", - AudioCodec = "ac3,dca,aac,mp2,mp3,pcm" - }, - - new DirectPlayProfile - { - Containers = new[]{"ts"}, - Type = DlnaProfileType.Video, - VideoCodec = "mpeg1video,mpeg2video,h264,vc1", - AudioCodec = "ac3,dca,mp2,mp3" - }, - - new DirectPlayProfile - { - Containers = new[]{"mp4", "mov"}, - Type = DlnaProfileType.Video, - VideoCodec = "h264,mpeg4", - AudioCodec = "ac3,aac,mp2,mp3" - }, - - new DirectPlayProfile - { - Containers = new[]{"asf"}, - Type = DlnaProfileType.Video, - VideoCodec = "vc1", - AudioCodec = "wmav2,wmapro" - }, - - new DirectPlayProfile - { - Containers = new[]{"asf"}, - Type = DlnaProfileType.Video, - VideoCodec = "mpeg2video", - AudioCodec = "mp2,ac3" - }, - - new DirectPlayProfile - { - Containers = new[]{"mp3"}, - AudioCodec = "mp2,mp3", - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"mp4"}, - AudioCodec = "mp4", - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"flac"}, - AudioCodec = "flac", - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"asf"}, - AudioCodec = "wmav2,wmapro,wmavoice", - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"ogg"}, - AudioCodec = "vorbis", - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Type = DlnaProfileType.Photo, - - Containers = new[]{"jpeg", "png", "gif", "bmp", "tiff"}, - - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080"} - } - } - }, - - MediaProfiles = new[] - { - new MediaProfile - { - Container ="ts", - OrgPn = "MPEG_TS_SD_NA", - Type = DlnaProfileType.Video - } - }, - - CodecProfiles = new[] - { - new CodecProfile - { - Type = CodecType.VideoCodec, - Codec= "h264", - - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080"}, - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.VideoLevel, Value = "41"} - } - }, - - new CodecProfile - { - Type = CodecType.VideoAudioCodec, - Codec= "aac", - - Conditions = new List<ProfileCondition> - { - new ProfileCondition{ Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.AudioChannels, Value = "2"} - } - } - } - }); - - list.Add(new DeviceProfile - { - // Linksys DMA2100us does not need any transcoding of the formats we support statically - Name = "Linksys DMA2100", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - ModelName = "DMA2100us" - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3", "flac", "m4a", "wma"}, - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"avi", "mp4", "mkv", "ts"}, - Type = DlnaProfileType.Video - } - } - }); - - list.Add(new DeviceProfile - { - Name = "Denon AVR", - ClientType = "DLNA", - - Identification = new DeviceIdentification - { - FriendlyName = @"Denon:\[AVR:.*", - Manufacturer = "Denon" - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3", "flac", "m4a", "wma"}, - Type = DlnaProfileType.Audio - }, - } - }); + var list = new List<DeviceProfile> + { + new SamsungSmartTvProfile(), + new Xbox360Profile(), + new XboxOneProfile(), + new SonyPs3Profile(), + new SonyBravia2010Profile(), + new SonyBravia2011Profile(), + new SonyBravia2012Profile(), + new SonyBravia2013Profile(), + new SonyBlurayPlayer2013Profile(), + new SonyBlurayPlayerProfile(), + new PanasonicVieraProfile(), + new WdtvLiveProfile(), + new DenonAvrProfile(), + new LinksysDMA2100Profile(), + new LgTvProfile() + }; foreach (var item in list) { - //_xmlSerializer.SerializeToFile(item, "d:\\" + _fileSystem.GetValidFilename(item.Name)); + //_xmlSerializer.SerializeToFile(item, "d:\\" + _fileSystem.GetValidFilename(item.Name) + ".xml"); + //_jsonSerializer.SerializeToFile(item, "d:\\" + _fileSystem.GetValidFilename(item.Name) + ".json"); } return list; @@ -1007,45 +57,7 @@ namespace MediaBrowser.Dlna public DeviceProfile GetDefaultProfile() { - return new DeviceProfile - { - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - AudioCodec = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "ts", - Type = DlnaProfileType.Video, - AudioCodec = "aac", - VideoCodec = "h264", - Settings = new List<TranscodingSetting> - { - new TranscodingSetting{ Name = TranscodingSettingType.VideoLevel, Value = "3"}, - new TranscodingSetting{ Name = TranscodingSettingType.VideoProfile, Value = "baseline"} - } - } - }, - - DirectPlayProfiles = new[] - { - new DirectPlayProfile - { - Containers = new[]{"mp3", "wma"}, - Type = DlnaProfileType.Audio - }, - - new DirectPlayProfile - { - Containers = new[]{"avi", "mp4"}, - Type = DlnaProfileType.Video - } - } - }; + return new DefaultProfile(); } public DeviceProfile GetProfile(DeviceIdentification deviceInfo) diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj index 800fb1b236..4eb305e0f9 100644 --- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj +++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj @@ -81,6 +81,22 @@ <Compile Include="PlayTo\uIcon.cs" /> <Compile Include="PlayTo\uParser.cs" /> <Compile Include="PlayTo\uPnpNamespaces.cs" /> + <Compile Include="Profiles\DefaultProfile.cs" /> + <Compile Include="Profiles\DenonAvrProfile.cs" /> + <Compile Include="Profiles\LgTvProfile.cs" /> + <Compile Include="Profiles\LinksysDMA2100Profile.cs" /> + <Compile Include="Profiles\PanasonicVieraProfile.cs" /> + <Compile Include="Profiles\SamsungSmartTvProfile.cs" /> + <Compile Include="Profiles\SonyBlurayPlayer2013Profile.cs" /> + <Compile Include="Profiles\SonyBlurayPlayerProfile.cs" /> + <Compile Include="Profiles\SonyBravia2010Profile.cs" /> + <Compile Include="Profiles\SonyBravia2011Profile.cs" /> + <Compile Include="Profiles\SonyBravia2012Profile.cs" /> + <Compile Include="Profiles\SonyBravia2013Profile.cs" /> + <Compile Include="Profiles\SonyPs3Profile.cs" /> + <Compile Include="Profiles\WdtvLiveProfile.cs" /> + <Compile Include="Profiles\Xbox360Profile.cs" /> + <Compile Include="Profiles\XboxOneProfile.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> diff --git a/MediaBrowser.Dlna/PlayTo/DlnaController.cs b/MediaBrowser.Dlna/PlayTo/DlnaController.cs index 4f9c92da52..ecda07f0bc 100644 --- a/MediaBrowser.Dlna/PlayTo/DlnaController.cs +++ b/MediaBrowser.Dlna/PlayTo/DlnaController.cs @@ -399,8 +399,11 @@ namespace MediaBrowser.Dlna.PlayTo var deviceInfo = _device.Properties; - var playlistItem = GetPlaylistItem(item, streams, _dlnaManager.GetProfile(deviceInfo.ToDeviceIdentification())); + var profile = _dlnaManager.GetProfile(deviceInfo.ToDeviceIdentification()); + + var playlistItem = GetPlaylistItem(item, streams, profile); playlistItem.StartPositionTicks = startPostionTicks; + playlistItem.DeviceProfileName = profile.Name; if (playlistItem.MediaType == DlnaProfileType.Audio) { diff --git a/MediaBrowser.Dlna/PlayTo/PlayToManager.cs b/MediaBrowser.Dlna/PlayTo/PlayToManager.cs index d02da303b6..ca76116feb 100644 --- a/MediaBrowser.Dlna/PlayTo/PlayToManager.cs +++ b/MediaBrowser.Dlna/PlayTo/PlayToManager.cs @@ -7,6 +7,7 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Session; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; +using MediaBrowser.Model.Session; using System; using System.Collections.Concurrent; using System.Linq; @@ -16,7 +17,6 @@ using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Model.Session; namespace MediaBrowser.Dlna.PlayTo { @@ -54,10 +54,8 @@ namespace MediaBrowser.Dlna.PlayTo _config = config; } - public async void Start() + public void Start() { - _logger.Log(LogSeverity.Info, "PlayTo-Manager starting"); - _locations = new ConcurrentDictionary<string, DateTime>(); foreach (var network in NetworkInterface.GetAllNetworkInterfaces()) @@ -73,7 +71,7 @@ namespace MediaBrowser.Dlna.PlayTo IPAddress localIp = null; - foreach (UnicastIPAddressInformation ipInfo in network.GetIPProperties().UnicastAddresses) + foreach (var ipInfo in network.GetIPProperties().UnicastAddresses) { if (ipInfo.Address.AddressFamily == AddressFamily.InterNetwork) { @@ -95,8 +93,6 @@ namespace MediaBrowser.Dlna.PlayTo { _logger.ErrorException("Failed to Initilize Socket", e); } - - await Task.Delay(100).ConfigureAwait(false); } } @@ -139,7 +135,7 @@ namespace MediaBrowser.Dlna.PlayTo _logger.Info("SSDP listener - Task completed"); } - catch (OperationCanceledException c) + catch (OperationCanceledException) { } catch (Exception e) @@ -158,7 +154,7 @@ namespace MediaBrowser.Dlna.PlayTo { await CreateController(uri).ConfigureAwait(false); } - catch (OperationCanceledException c) + catch (OperationCanceledException) { } catch (Exception ex) @@ -180,10 +176,12 @@ namespace MediaBrowser.Dlna.PlayTo { socket.SendTo(request, new IPEndPoint(IPAddress.Parse("239.255.255.250"), 1900)); - await Task.Delay(10000).ConfigureAwait(false); + var delay = _config.Configuration.DlnaOptions.ClientDiscoveryIntervalSeconds * 1000; + + await Task.Delay(delay).ConfigureAwait(false); } } - catch (OperationCanceledException c) + catch (OperationCanceledException) { } catch (Exception ex) diff --git a/MediaBrowser.Dlna/PlayTo/PlaylistItem.cs b/MediaBrowser.Dlna/PlayTo/PlaylistItem.cs index 77b9085f75..3992fbfbf5 100644 --- a/MediaBrowser.Dlna/PlayTo/PlaylistItem.cs +++ b/MediaBrowser.Dlna/PlayTo/PlaylistItem.cs @@ -32,6 +32,8 @@ namespace MediaBrowser.Dlna.PlayTo public int? AudioStreamIndex { get; set; } public int? SubtitleStreamIndex { get; set; } + + public string DeviceProfileName { get; set; } public PlaylistItem() { diff --git a/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs b/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs index 8655e58da0..e4c49a224c 100644 --- a/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs +++ b/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs @@ -47,6 +47,7 @@ namespace MediaBrowser.Dlna.PlayTo playlistItem.Transcode = true; playlistItem.TranscodingSettings = transcodingProfile.Settings.ToList(); playlistItem.Container = "." + transcodingProfile.Container.TrimStart('.'); + playlistItem.AudioCodec = transcodingProfile.AudioCodec; } return playlistItem; @@ -118,6 +119,8 @@ namespace MediaBrowser.Dlna.PlayTo playlistItem.Transcode = true; playlistItem.TranscodingSettings = transcodingProfile.Settings.ToList(); playlistItem.Container = "." + transcodingProfile.Container.TrimStart('.'); + playlistItem.AudioCodec = transcodingProfile.AudioCodec.Split(',').FirstOrDefault(); + playlistItem.VideoCodec = transcodingProfile.VideoCodec; } return playlistItem; @@ -127,22 +130,16 @@ namespace MediaBrowser.Dlna.PlayTo { var mediaPath = item.Path; - if (profile.Containers.Length > 0) + if (profile.Container.Length > 0) { // Check container type var mediaContainer = Path.GetExtension(mediaPath); - if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) + if (!profile.GetContainers().Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) { return false; } } - // Check additional conditions - if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, null, null))) - { - return false; - } - return true; } @@ -150,22 +147,16 @@ namespace MediaBrowser.Dlna.PlayTo { var mediaPath = item.Path; - if (profile.Containers.Length > 0) + if (profile.Container.Length > 0) { // Check container type var mediaContainer = Path.GetExtension(mediaPath); - if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) + if (!profile.GetContainers().Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) { return false; } } - // Check additional conditions - if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, null, audioStream))) - { - return false; - } - return true; } @@ -178,11 +169,11 @@ namespace MediaBrowser.Dlna.PlayTo var mediaPath = item.Path; - if (profile.Containers.Length > 0) + if (profile.Container.Length > 0) { // Check container type var mediaContainer = Path.GetExtension(mediaPath); - if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) + if (!profile.GetContainers().Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) { return false; } @@ -210,12 +201,6 @@ namespace MediaBrowser.Dlna.PlayTo } } - // Check additional conditions - if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, videoStream, audioStream))) - { - return false; - } - return true; } @@ -266,6 +251,11 @@ namespace MediaBrowser.Dlna.PlayTo /// <exception cref="System.InvalidOperationException">Unexpected ProfileConditionType</exception> private bool IsConditionSatisfied(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream) { + if (condition.Property == ProfileConditionValue.Has64BitOffsets) + { + // TODO: Determine how to evaluate this + } + if (condition.Property == ProfileConditionValue.VideoProfile) { var profile = videoStream == null ? null : videoStream.Profile; @@ -361,6 +351,12 @@ namespace MediaBrowser.Dlna.PlayTo return videoStream == null ? null : videoStream.Width; case ProfileConditionValue.VideoLevel: return videoStream == null ? null : ConvertToLong(videoStream.Level); + case ProfileConditionValue.VideoPacketLength: + // TODO: Determine how to get this + return null; + case ProfileConditionValue.VideoTimestamp: + // TODO: Determine how to get this + return null; default: throw new InvalidOperationException("Unexpected Property"); } diff --git a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs index 7a4928e5ca..f540a80041 100644 --- a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs +++ b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs @@ -49,7 +49,7 @@ namespace MediaBrowser.Dlna.PlayTo { Url = url.ToString(), UserAgent = USERAGENT, - LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging + LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging }; options.RequestHeaders["HOST"] = ip + ":" + port; @@ -88,7 +88,7 @@ namespace MediaBrowser.Dlna.PlayTo { Url = url.ToString(), UserAgent = USERAGENT, - LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging + LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging }; options.RequestHeaders["FriendlyName.DLNA.ORG"] = FriendlyName; @@ -112,7 +112,7 @@ namespace MediaBrowser.Dlna.PlayTo { Url = url.ToString(), UserAgent = USERAGENT, - LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging + LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging }; options.RequestHeaders["SOAPAction"] = soapAction; diff --git a/MediaBrowser.Dlna/PlayTo/StreamHelper.cs b/MediaBrowser.Dlna/PlayTo/StreamHelper.cs index 2a8e2d6170..6cd66c16ae 100644 --- a/MediaBrowser.Dlna/PlayTo/StreamHelper.cs +++ b/MediaBrowser.Dlna/PlayTo/StreamHelper.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Dlna.PlayTo /// <returns>System.String.</returns> internal static string GetAudioUrl(DeviceInfo deviceProperties, PlaylistItem item, List<MediaStream> streams, string serverAddress) { - var dlnaCommand = BuildDlnaUrl(item.MediaSourceId, deviceProperties.UUID, !item.Transcode, null, item.AudioCodec, item.AudioStreamIndex, item.SubtitleStreamIndex, null, 128000, item.StartPositionTicks, item.TranscodingSettings); + var dlnaCommand = BuildDlnaUrl(item.DeviceProfileName, item.MediaSourceId, deviceProperties.UUID, !item.Transcode, null, item.AudioCodec, item.AudioStreamIndex, item.SubtitleStreamIndex, null, 128000, item.StartPositionTicks, item.TranscodingSettings); return string.Format("{0}/audio/{1}/stream{2}?{3}", serverAddress, item.ItemId, "." + item.Container.TrimStart('.'), dlnaCommand); } @@ -33,7 +33,7 @@ namespace MediaBrowser.Dlna.PlayTo /// <returns>The url to send to the device</returns> internal static string GetVideoUrl(DeviceInfo deviceProperties, PlaylistItem item, List<MediaStream> streams, string serverAddress) { - var dlnaCommand = BuildDlnaUrl(item.MediaSourceId, deviceProperties.UUID, !item.Transcode, item.VideoCodec, item.AudioCodec, item.AudioStreamIndex, item.SubtitleStreamIndex, 1500000, 128000, item.StartPositionTicks, item.TranscodingSettings); + var dlnaCommand = BuildDlnaUrl(item.DeviceProfileName, item.MediaSourceId, deviceProperties.UUID, !item.Transcode, item.VideoCodec, item.AudioCodec, item.AudioStreamIndex, item.SubtitleStreamIndex, 1500000, 128000, item.StartPositionTicks, item.TranscodingSettings); return string.Format("{0}/Videos/{1}/stream{2}?{3}", serverAddress, item.ItemId, item.Container, dlnaCommand); } @@ -41,7 +41,7 @@ namespace MediaBrowser.Dlna.PlayTo /// <summary> /// Builds the dlna URL. /// </summary> - private static string BuildDlnaUrl(string mediaSourceId, string deviceID, bool isStatic, string videoCodec, string audioCodec, int? audiostreamIndex, int? subtitleIndex, int? videoBitrate, int? audioBitrate, long? startPositionTicks, List<TranscodingSetting> settings) + private static string BuildDlnaUrl(string deviceProfileName, string mediaSourceId, string deviceID, bool isStatic, string videoCodec, string audioCodec, int? audiostreamIndex, int? subtitleIndex, int? videoBitrate, int? audioBitrate, long? startPositionTicks, List<TranscodingSetting> settings) { var profile = settings.Where(i => i.Name == TranscodingSettingType.VideoProfile).Select(i => i.Value).FirstOrDefault(); var videoLevel = settings.Where(i => i.Name == TranscodingSettingType.VideoLevel).Select(i => i.Value).FirstOrDefault(); @@ -51,6 +51,7 @@ namespace MediaBrowser.Dlna.PlayTo var list = new List<string> { + deviceProfileName ?? string.Empty, deviceID ?? string.Empty, mediaSourceId ?? string.Empty, isStatic.ToString().ToLower(), diff --git a/MediaBrowser.Dlna/Profiles/DefaultProfile.cs b/MediaBrowser.Dlna/Profiles/DefaultProfile.cs new file mode 100644 index 0000000000..a1c6612753 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/DefaultProfile.cs @@ -0,0 +1,59 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class DefaultProfile : DeviceProfile + { + public DefaultProfile() + { + ProtocolInfo = "DLNA"; + + ClientType = "DLNA"; + Manufacturer = "Media Browser"; + ModelDescription = "Media Browser"; + ModelName = "Media Browser"; + ModelNumber = "Media Browser"; + ModelUrl = "http://mediabrowser3.com/"; + ManufacturerUrl = "http://mediabrowser3.com/"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + + new TranscodingProfile + { + Container = "ts", + Type = DlnaProfileType.Video, + AudioCodec = "aac", + VideoCodec = "h264", + + Settings = new [] + { + new TranscodingSetting {Name = TranscodingSettingType.VideoLevel, Value = "3"}, + new TranscodingSetting {Name = TranscodingSettingType.VideoProfile, Value = "baseline"} + } + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "mp3,wma", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "avi,mp4", + Type = DlnaProfileType.Video + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs b/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs new file mode 100644 index 0000000000..cca6ab6bb7 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs @@ -0,0 +1,27 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class DenonAvrProfile : DefaultProfile + { + public DenonAvrProfile() + { + Name = "Denon AVR"; + + Identification = new DeviceIdentification + { + FriendlyName = @"Denon:\[AVR:.*", + Manufacturer = "Denon" + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "mp3,flac,m4a,wma", + Type = DlnaProfileType.Audio + }, + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/LgTvProfile.cs b/MediaBrowser.Dlna/Profiles/LgTvProfile.cs new file mode 100644 index 0000000000..ec20c9df84 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/LgTvProfile.cs @@ -0,0 +1,192 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class LgTvProfile : DefaultProfile + { + public LgTvProfile() + { + Name = "LG Smart TV"; + + TimelineOffsetSeconds = 10; + + Identification = new DeviceIdentification + { + FriendlyName = @"LG.*", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "User-Agent", + Value = "LG", + Match = HeaderMatchType.Substring + } + } + }; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + AudioCodec = "ac3", + VideoCodec = "h264", + Type = DlnaProfileType.Video + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "aac,ac3,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mkv", + VideoCodec = "h264", + AudioCodec = "aac,ac3,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "h264,mpeg4", + AudioCodec = "aac,ac3,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "mpeg4", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3,aac,mp3", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs b/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs new file mode 100644 index 0000000000..e7086c2052 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs @@ -0,0 +1,33 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class LinksysDMA2100Profile : DefaultProfile + { + public LinksysDMA2100Profile() + { + // Linksys DMA2100us does not need any transcoding of the formats we support statically + Name = "Linksys DMA2100"; + + Identification = new DeviceIdentification + { + ModelName = "DMA2100us" + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "mp3,flac,m4a,wma", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "avi,mp4,mkv,ts", + Type = DlnaProfileType.Video + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs b/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs new file mode 100644 index 0000000000..6755c06809 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs @@ -0,0 +1,186 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class PanasonicVieraProfile : DefaultProfile + { + public PanasonicVieraProfile() + { + Name = "Panasonic Viera"; + + Identification = new DeviceIdentification + { + FriendlyName = @"VIERA", + Manufacturer = "Panasonic", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "User-Agent", + Value = "Panasonic MIL DLNA", + Match = HeaderMatchType.Substring + } + } + }; + + TimelineOffsetSeconds = 10; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + AudioCodec = "ac3", + VideoCodec = "h264", + Type = DlnaProfileType.Video + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg2video,mpeg4", + AudioCodec = "ac3,mp3", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "mkv", + VideoCodec = "h264", + AudioCodec = "aac,ac3,mp3,pcm", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "aac,mp3", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "h264", + AudioCodec = "aac,ac3,mp3,pcm", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "mov", + VideoCodec = "h264", + AudioCodec = "aac,pcm", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mpeg4", + AudioCodec = "pcm", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "flv", + VideoCodec = "h264", + AudioCodec = "aac", + Type = DlnaProfileType.Video + }, + + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "mp4", + AudioCodec = "aac", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitDepth, + Value = "8", + IsRequired = false + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs b/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs new file mode 100644 index 0000000000..fa6b1201ab --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs @@ -0,0 +1,315 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SamsungSmartTvProfile : DefaultProfile + { + public SamsungSmartTvProfile() + { + Name = "Samsung Smart TV"; + + SupportsAlbumArtInDidl = true; + + Identification = new DeviceIdentification + { + ModelUrl = "samsung.com" + }; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + AudioCodec = "ac3", + VideoCodec = "h264", + Type = DlnaProfileType.Video + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "asf", + VideoCodec = "h264,mpeg4,mjpeg", + AudioCodec = "mp3,ac3,wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "h264,mpeg4,mjpeg", + AudioCodec = "mp3,ac3,dca", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mkv", + VideoCodec = "h264,mpeg4,mjpeg4", + AudioCodec = "mp3,ac3,dca,aac", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "h264,mpeg4", + AudioCodec = "mp3,aac", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "3gpp", + VideoCodec = "h264,mpeg4", + AudioCodec = "aac,he-aac", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpg,mpeg", + VideoCodec = "mpeg1video,mpeg2video,h264", + AudioCodec = "ac3,mp2,mp3,aac", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "vro,vob", + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "ac3,mp2,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg2video,h264,vc1", + AudioCodec = "ac3,aac,mp3,eac3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "asf", + VideoCodec = "wmv2,wmv3", + AudioCodec = "wmav2,wmavoice", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "mpeg2video", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "30720000" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "mpeg4", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "8192000" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "37500000" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "wmv2,wmv3,vc1", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "25600000" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3,wmav2,dca,aac,mp3", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6" + } + } + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "mkv", + MimeType = "video/x-mkv", + Type = DlnaProfileType.Video + } + }; + + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs new file mode 100644 index 0000000000..49aa47027a --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs @@ -0,0 +1,180 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBlurayPlayer2013Profile : DefaultProfile + { + public SonyBlurayPlayer2013Profile() + { + Identification = new DeviceIdentification + { + FriendlyName = @"Blu-ray Disc Player", + Manufacturer = "Sony", + ModelNumber = "BDP-2013" + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + Manufacturer = "Microsoft Corporation"; + + ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3", + Type = DlnaProfileType.Video + }, + + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg1video,mpeg2video,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "ac3,mp3,mp2,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,aac,pcm,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mkv", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,dca,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "mp4", + AudioCodec = "aac", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + } + } + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs new file mode 100644 index 0000000000..5121726706 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs @@ -0,0 +1,261 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBlurayPlayerProfile : DefaultProfile + { + public SonyBlurayPlayerProfile() + { + Identification = new DeviceIdentification + { + FriendlyName = @"Blu-ray Disc Player", + Manufacturer = "Sony", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @"(Blu-ray Disc Player|Home Theater System|Home Theatre System|Media Player)", + Match = HeaderMatchType.Regex + }, + + new HttpHeaderInfo + { + Name = "X-AV-Physical-Unit-Info", + Value = @"(Blu-ray Disc Player|Home Theater System|Home Theatre System|Media Player)", + Match = HeaderMatchType.Regex + } + } + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + Manufacturer = "Microsoft Corporation"; + + ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + + new TranscodingProfile + { + Container = "ts", + VideoCodec = "mpeg2video", + AudioCodec = "ac3", + Type = DlnaProfileType.Video + }, + + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg1video,mpeg2video,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "ac3,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi,mp4", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "15360000", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2", + IsRequired = false + } + } + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + VideoCodec = "h264,mpeg4,vc1", + AudioCodec = "ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "avi", + MimeType = "video/mpeg", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mkv", + MimeType = "video/vnd.dlna.mpeg-tts", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "ts", + MimeType = "video/vnd.dlna.mpeg-tts", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mp4", + MimeType = "video/mpeg", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mpeg", + MimeType = "video/mpeg", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mp3", + MimeType = "audio/mpeg", + Type = DlnaProfileType.Audio + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs new file mode 100644 index 0000000000..042cc0a965 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -0,0 +1,286 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBravia2010Profile : DefaultProfile + { + public SonyBravia2010Profile() + { + Name = "Sony Bravia (2010)"; + + Identification = new DeviceIdentification + { + FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*", + Manufacturer = "Sony", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @".*KDL-\d{2}[EHLNPB]X\d[01]\d.*", + Match = HeaderMatchType.Regex + } + } + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + ModelUrl = "http://www.microsoft.com/"; + Manufacturer = "Microsoft Corporation"; + ManufacturerUrl = "http://www.microsoft.com/"; + SonyAggregationFlags = "10"; + ProtocolInfo = + "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac", + Type = DlnaProfileType.Video, + EnableMpegtsM2TsMode = true + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg2video,mpeg1video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"}, + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/mpeg", + OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="mpeg2video", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mpeg", + VideoCodec="mpeg1video,mpeg2video", + MimeType = "video/mpeg", + OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL", + Type = DlnaProfileType.Video + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "20000000" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "mpeg2video", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "20000000" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2" + }, + new ProfileCondition + { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.AudioProfile, + Value = "he-aac" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs new file mode 100644 index 0000000000..401c40c362 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs @@ -0,0 +1,304 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBravia2011Profile : DefaultProfile + { + public SonyBravia2011Profile() + { + Name = "Sony Bravia (2011)"; + + Identification = new DeviceIdentification + { + FriendlyName = @"KDL-\d{2}([A-Z]X\d2\d|CX400).*", + Manufacturer = "Sony", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @".*KDL-\d{2}([A-Z]X\d2\d|CX400).*", + Match = HeaderMatchType.Regex + } + } + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + ModelUrl = "http://www.microsoft.com/"; + Manufacturer = "Microsoft Corporation"; + ManufacturerUrl = "http://www.microsoft.com/"; + SonyAggregationFlags = "10"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac", + Type = DlnaProfileType.Video, + EnableMpegtsM2TsMode = true + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg2video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "h264,mpeg4", + AudioCodec = "ac3,aac,mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg2video,mpeg1video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "asf", + VideoCodec = "wmv2,wmv3,vc1", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"}, + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/mpeg", + OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="mpeg2video", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mpeg", + VideoCodec="mpeg1video,mpeg2video", + MimeType = "video/mpeg", + OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL", + Type = DlnaProfileType.Video + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "20000000" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "mpeg2video", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "20000000" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2" + }, + new ProfileCondition + { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.AudioProfile, + Value = "he-aac" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs new file mode 100644 index 0000000000..2d24c406e3 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs @@ -0,0 +1,246 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBravia2012Profile : DefaultProfile + { + public SonyBravia2012Profile() + { + Name = "Sony Bravia (2012)"; + + Identification = new DeviceIdentification + { + FriendlyName = @"KDL-\d{2}[A-Z]X\d5(\d|G).*", + Manufacturer = "Sony", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @".*KDL-\d{2}[A-Z]X\d5(\d|G).*", + Match = HeaderMatchType.Regex + } + } + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + ModelUrl = "http://www.microsoft.com/"; + Manufacturer = "Microsoft Corporation"; + ManufacturerUrl = "http://www.microsoft.com/"; + SonyAggregationFlags = "10"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac", + Type = DlnaProfileType.Video, + EnableMpegtsM2TsMode = true + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg2video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "h264,mpeg4", + AudioCodec = "ac3,aac,mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mpeg4", + AudioCodec = "ac3,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg2video,mpeg1video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "asf", + VideoCodec = "wmv2,wmv3,vc1", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"}, + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/mpeg", + OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="mpeg2video", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mpeg", + VideoCodec="mpeg1video,mpeg2video", + MimeType = "video/mpeg", + OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL", + Type = DlnaProfileType.Video + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + + Conditions = new[] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs new file mode 100644 index 0000000000..10f7129581 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs @@ -0,0 +1,264 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBravia2013Profile : DefaultProfile + { + public SonyBravia2013Profile() + { + Name = "Sony Bravia (2013)"; + + Identification = new DeviceIdentification + { + FriendlyName = @"KDL-\d{2}[WR][5689]\d{2}A.*", + Manufacturer = "Sony", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @".*KDL-\d{2}[WR][5689]\d{2}A.*", + Match = HeaderMatchType.Regex + } + } + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + ModelUrl = "http://www.microsoft.com/"; + Manufacturer = "Microsoft Corporation"; + ManufacturerUrl = "http://www.microsoft.com/"; + SonyAggregationFlags = "10"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,aac", + Type = DlnaProfileType.Video, + EnableMpegtsM2TsMode = true + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3,eac3,aac,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg2video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "h264,mpeg4", + AudioCodec = "ac3,eac3,aac,mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mov", + VideoCodec = "h264,mpeg4,mjpeg", + AudioCodec = "ac3,eac3,aac,mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mkv", + VideoCodec = "h264,mpeg4,vp8", + AudioCodec = "ac3,eac3,aac,mp3,mp2,pcm,vorbis", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mpeg4", + AudioCodec = "ac3,eac3,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mjpeg", + AudioCodec = "pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg2video,mpeg1video", + AudioCodec = "mp3,mp2", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "asf", + VideoCodec = "wmv2,wmv3,vc1", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "mp4", + AudioCodec = "aac", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "wav", + AudioCodec = "pcm", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"}, + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/mpeg", + OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO", + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"} + } + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="h264", + AudioCodec="ac3,aac,mp3", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "ts", + VideoCodec="mpeg2video", + MimeType = "video/vnd.dlna.mpeg-tts", + OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mpeg", + VideoCodec="mpeg1video,mpeg2video", + MimeType = "video/mpeg", + OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL", + Type = DlnaProfileType.Video + } + }; + + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs b/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs new file mode 100644 index 0000000000..e5fc1ed073 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs @@ -0,0 +1,233 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyPs3Profile : DefaultProfile + { + public SonyPs3Profile() + { + Name = "Sony Bravia (2010)"; + + Identification = new DeviceIdentification + { + Headers = new[] + { + new HttpHeaderInfo + { + Name = "User-Agent", + Value = @"PLAYSTATION 3", + Match = HeaderMatchType.Substring + }, + + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @"PLAYSTATION 3", + Match = HeaderMatchType.Substring + } + } + }; + + SonyAggregationFlags = "10"; + XDlnaDoc = "DMS-1.50"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "mp3", + Type = DlnaProfileType.Video + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "15360000", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + }, + + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioBitrate, + Value = "640000", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "wmapro", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.AudioProfile, + Value = "he-aac", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2" + }, + new ProfileCondition + { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.AudioProfile, + Value = "he-aac" + } + } + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "mp4,mov", + AudioCodec="aac", + MimeType = "video/mp4", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "avi", + MimeType = "video/divx", + OrgPn="AVI", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "wav", + MimeType = "audio/wav", + Type = DlnaProfileType.Audio + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs b/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs new file mode 100644 index 0000000000..52d4a5f291 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs @@ -0,0 +1,241 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class WdtvLiveProfile : DefaultProfile + { + public WdtvLiveProfile() + { + Name = "WDTV Live"; + + TimelineOffsetSeconds = 5; + IgnoreTranscodeByteRangeRequests = true; + + Identification = new DeviceIdentification + { + ModelName = "WD TV HD Live", + + Headers = new [] + { + new HttpHeaderInfo {Name = "User-Agent", Value = "alphanetworks", Match = HeaderMatchType.Substring}, + new HttpHeaderInfo + { + Name = "User-Agent", + Value = "ALPHA Networks", + Match = HeaderMatchType.Substring + } + } + }; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + Type = DlnaProfileType.Audio, + AudioCodec = "mp3" + }, + new TranscodingProfile + { + Container = "ts", + Type = DlnaProfileType.Video, + VideoCodec = "h264", + AudioCodec = "aac", + + Settings = new [] + { + new TranscodingSetting {Name = TranscodingSettingType.VideoLevel, Value = "3"}, + new TranscodingSetting {Name = TranscodingSettingType.VideoProfile, Value = "baseline"} + } + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "avi", + Type = DlnaProfileType.Video, + VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1", + AudioCodec = "ac3,dca,mp2,mp3,pcm" + }, + + new DirectPlayProfile + { + Container = "mpeg", + Type = DlnaProfileType.Video, + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "ac3,dca,mp2,mp3,pcm" + }, + + new DirectPlayProfile + { + Container = "mkv", + Type = DlnaProfileType.Video, + VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1", + AudioCodec = "ac3,dca,aac,mp2,mp3,pcm" + }, + + new DirectPlayProfile + { + Container = "ts", + Type = DlnaProfileType.Video, + VideoCodec = "mpeg1video,mpeg2video,h264,vc1", + AudioCodec = "ac3,dca,mp2,mp3" + }, + + new DirectPlayProfile + { + Container = "mp4,mov", + Type = DlnaProfileType.Video, + VideoCodec = "h264,mpeg4", + AudioCodec = "ac3,aac,mp2,mp3" + }, + + new DirectPlayProfile + { + Container = "asf", + Type = DlnaProfileType.Video, + VideoCodec = "vc1", + AudioCodec = "wmav2,wmapro" + }, + + new DirectPlayProfile + { + Container = "asf", + Type = DlnaProfileType.Video, + VideoCodec = "mpeg2video", + AudioCodec = "mp2,ac3" + }, + + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp2,mp3", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "mp4", + AudioCodec = "mp4", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "flac", + AudioCodec = "flac", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Container = "ogg", + AudioCodec = "vorbis", + Type = DlnaProfileType.Audio + }, + + new DirectPlayProfile + { + Type = DlnaProfileType.Photo, + + Container = "jpeg,png,gif,bmp,tiff" + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + OrgPn = "MPEG_TS_SD_NA", + Type = DlnaProfileType.Video + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41" + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs b/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs new file mode 100644 index 0000000000..7216457a3f --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs @@ -0,0 +1,312 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class Xbox360Profile : DefaultProfile + { + public Xbox360Profile() + { + Name = "Xbox 360"; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "12.0"; + ModelUrl = "http://www.microsoft.com/"; + Manufacturer = "Microsoft Corporation"; + ManufacturerUrl = "http://www.microsoft.com/"; + XDlnaDoc = "DMS-1.50"; + + TimelineOffsetSeconds = 40; + RequiresPlainFolders = true; + RequiresPlainVideoItems = true; + + Identification = new DeviceIdentification + { + ModelName = "Xbox 360", + + Headers = new [] + { + new HttpHeaderInfo {Name = "User-Agent", Value = "Xbox", Match = HeaderMatchType.Substring}, + new HttpHeaderInfo {Name = "User-Agent", Value = "Xenon", Match = HeaderMatchType.Substring} + } + }; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "asf", + VideoCodec = "wmv2", + AudioCodec = "wmav2", + Type = DlnaProfileType.Video, + TranscodeSeekInfo = TranscodeSeekInfo.Bytes, + EstimateContentLength = true, + + Settings = new [] + { + new TranscodingSetting {Name = TranscodingSettingType.MaxAudioChannels, Value = "6"}, + new TranscodingSetting {Name = TranscodingSettingType.VideoLevel, Value = "3"}, + new TranscodingSetting {Name = TranscodingSettingType.VideoProfile, Value = "baseline"} + } + }, + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mpeg4", + AudioCodec = "ac3,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "h264", + AudioCodec = "aac", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4,mov", + VideoCodec = "h264,mpeg4", + AudioCodec = "aac,ac3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "asf", + VideoCodec = "wmv2,wmv3,vc1", + AudioCodec = "wmav2,wmapro", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "avi", + MimeType = "video/avi", + Type = DlnaProfileType.Video + } + }; + + ContainerProfiles = new[] + { + new ContainerProfile + { + Type = DlnaProfileType.Video, + Container = "mp4,mov", + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Has64BitOffsets, + Value = "false", + IsRequired = false + } + } + }, + + new ContainerProfile + { + Type = DlnaProfileType.Photo, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + } + } + } + }; + + CodecProfiles = new[] + { + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "mpeg4", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1280" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "720" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "5120000", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "h264", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = "41", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "10240000", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoCodec, + Codec = "wmv2,wmv3,vc1", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "15360000", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3,wmav2,wmapro", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.AudioProfile, + Value = "lc", + IsRequired = false + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs new file mode 100644 index 0000000000..0daa5d7a2a --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs @@ -0,0 +1,54 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class XboxOneProfile : DefaultProfile + { + public XboxOneProfile() + { + Name = "Xbox One"; + + Identification = new DeviceIdentification + { + ModelName = "Xbox One", + FriendlyName = "Xbox-SystemOS" + }; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "aac", + Type = DlnaProfileType.Video + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "mp3,wma", + Type = DlnaProfileType.Audio + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "avi", + MimeType = "video/x-msvideo", + Type = DlnaProfileType.Video + } + }; + } + } +} |
