diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-04-16 10:59:39 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-04-16 10:59:39 -0400 |
| commit | 6bd18c6e72d1c4ba9c371d37411ebd918d8c6d9e (patch) | |
| tree | 3badd7fc5d9142725fd3209fde8132620e0ec79a /MediaBrowser.Dlna | |
| parent | c7b95a251317fdb01d160cc3dcaf5d23779437d4 (diff) | |
xbox one dlna fixes
Diffstat (limited to 'MediaBrowser.Dlna')
| -rw-r--r-- | MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Didl/DidlBuilder.cs | 50 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/MediaBrowser.Dlna.csproj | 5 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/PlayTo/PlayToController.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs | 44 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs | 44 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs | 274 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/XboxOneProfile.cs | 98 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml | 4 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml | 9 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml | 14 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml | 14 | ||||
| -rw-r--r-- | MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml | 26 |
15 files changed, 253 insertions, 358 deletions
diff --git a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs index abd649ad7b..3d7ae8cc4d 100644 --- a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs +++ b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs @@ -58,7 +58,7 @@ namespace MediaBrowser.Dlna.ContentDirectory _profile = profile; _config = config; - _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager); + _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, Logger); } protected override IEnumerable<KeyValuePair<string, string>> GetResult(string methodName, Headers methodParams) diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs index 629b95f67e..52791822bb 100644 --- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs +++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs @@ -39,8 +39,9 @@ namespace MediaBrowser.Dlna.Didl private readonly IUserDataManager _userDataManager; private readonly ILocalizationManager _localization; private readonly IMediaSourceManager _mediaSourceManager; + private readonly ILogger _logger; - public DidlBuilder(DeviceProfile profile, User user, IImageProcessor imageProcessor, string serverAddress, string accessToken, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager) + public DidlBuilder(DeviceProfile profile, User user, IImageProcessor imageProcessor, string serverAddress, string accessToken, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, ILogger logger) { _profile = profile; _imageProcessor = imageProcessor; @@ -48,6 +49,7 @@ namespace MediaBrowser.Dlna.Didl _userDataManager = userDataManager; _localization = localization; _mediaSourceManager = mediaSourceManager; + _logger = logger; _accessToken = accessToken; _user = user; } @@ -127,7 +129,7 @@ namespace MediaBrowser.Dlna.Didl { var sources = _mediaSourceManager.GetStaticMediaSources(video, true, _user).ToList(); - streamInfo = new StreamBuilder(new NullLogger()).BuildVideoItem(new VideoOptions + streamInfo = new StreamBuilder(_logger).BuildVideoItem(new VideoOptions { ItemId = GetClientId(video), MediaSources = sources, @@ -780,19 +782,33 @@ namespace MediaBrowser.Dlna.Didl var result = element.OwnerDocument; var playbackPercentage = 0; + var unplayedCount = 0; if (item is Video) { var userData = _userDataManager.GetUserDataDto(item, _user); playbackPercentage = Convert.ToInt32(userData.PlayedPercentage ?? 0); - if (playbackPercentage >= 100) + if (playbackPercentage >= 100 || userData.Played) { - playbackPercentage = 0; + playbackPercentage = 100; + } + } + else if (item is Series || item is Season || item is BoxSet) + { + var userData = _userDataManager.GetUserDataDto(item, _user); + + if (userData.Played) + { + playbackPercentage = 100; + } + else + { + unplayedCount = userData.UnplayedItemCount ?? 0; } } - var albumartUrlInfo = GetImageUrl(imageInfo, _profile.MaxAlbumArtWidth, _profile.MaxAlbumArtHeight, playbackPercentage, "jpg"); + var albumartUrlInfo = GetImageUrl(imageInfo, _profile.MaxAlbumArtWidth, _profile.MaxAlbumArtHeight, playbackPercentage, unplayedCount, "jpg"); var icon = result.CreateElement("upnp", "albumArtURI", NS_UPNP); var profile = result.CreateAttribute("dlna", "profileID", NS_DLNA); @@ -802,7 +818,7 @@ namespace MediaBrowser.Dlna.Didl element.AppendChild(icon); // TOOD: Remove these default values - var iconUrlInfo = GetImageUrl(imageInfo, _profile.MaxIconWidth ?? 48, _profile.MaxIconHeight ?? 48, playbackPercentage, "jpg"); + var iconUrlInfo = GetImageUrl(imageInfo, _profile.MaxIconWidth ?? 48, _profile.MaxIconHeight ?? 48, playbackPercentage, unplayedCount, "jpg"); icon = result.CreateElement("upnp", "icon", NS_UPNP); icon.InnerText = iconUrlInfo.Url; element.AppendChild(icon); @@ -819,15 +835,15 @@ namespace MediaBrowser.Dlna.Didl } } - AddImageResElement(item, element, 160, 160, playbackPercentage, "jpg", "JPEG_TN"); + AddImageResElement(item, element, 160, 160, playbackPercentage, unplayedCount, "jpg", "JPEG_TN"); if (!_profile.EnableSingleAlbumArtLimit) { - AddImageResElement(item, element, 4096, 4096, playbackPercentage, "jpg", "JPEG_LRG"); - AddImageResElement(item, element, 1024, 768, playbackPercentage, "jpg", "JPEG_MED"); - AddImageResElement(item, element, 640, 480, playbackPercentage, "jpg", "JPEG_SM"); - AddImageResElement(item, element, 4096, 4096, playbackPercentage, "png", "PNG_LRG"); - AddImageResElement(item, element, 160, 160, playbackPercentage, "png", "PNG_TN"); + AddImageResElement(item, element, 4096, 4096, playbackPercentage, unplayedCount, "jpg", "JPEG_LRG"); + AddImageResElement(item, element, 1024, 768, playbackPercentage, unplayedCount, "jpg", "JPEG_MED"); + AddImageResElement(item, element, 640, 480, playbackPercentage, unplayedCount, "jpg", "JPEG_SM"); + AddImageResElement(item, element, 4096, 4096, playbackPercentage, unplayedCount, "png", "PNG_LRG"); + AddImageResElement(item, element, 160, 160, playbackPercentage, unplayedCount, "png", "PNG_TN"); } } @@ -852,6 +868,7 @@ namespace MediaBrowser.Dlna.Didl int maxWidth, int maxHeight, int playbackPercentage, + int unplayedCount, string format, string org_Pn) { @@ -864,7 +881,7 @@ namespace MediaBrowser.Dlna.Didl var result = element.OwnerDocument; - var albumartUrlInfo = GetImageUrl(imageInfo, maxWidth, maxHeight, playbackPercentage, format); + var albumartUrlInfo = GetImageUrl(imageInfo, maxWidth, maxHeight, playbackPercentage, unplayedCount, format); var res = result.CreateElement(string.Empty, "res", NS_DIDL); @@ -1005,9 +1022,9 @@ namespace MediaBrowser.Dlna.Didl return id; } - private ImageUrlInfo GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, int playbackPercentage, string format) + private ImageUrlInfo GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, int playbackPercentage, int unplayedCount, string format) { - var url = string.Format("{0}/Items/{1}/Images/{2}/0/{3}/{4}/{5}/{6}/{7}", + var url = string.Format("{0}/Items/{1}/Images/{2}/0/{3}/{4}/{5}/{6}/{7}/{8}", _serverAddress, info.ItemId, info.Type, @@ -1015,7 +1032,8 @@ namespace MediaBrowser.Dlna.Didl format, maxWidth.ToString(CultureInfo.InvariantCulture), maxHeight.ToString(CultureInfo.InvariantCulture), - playbackPercentage.ToString(CultureInfo.InvariantCulture) + playbackPercentage.ToString(CultureInfo.InvariantCulture), + unplayedCount.ToString(CultureInfo.InvariantCulture) ); var width = info.Width; diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj index 2f4d444188..0cbe363982 100644 --- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj +++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj @@ -94,7 +94,6 @@ <Compile Include="PlayTo\uParserObject.cs" /> <Compile Include="Profiles\Foobar2000Profile.cs" /> <Compile Include="Profiles\MediaMonkeyProfile.cs" /> - <Compile Include="Profiles\WindowsMediaCenterProfile.cs" /> <Compile Include="ContentDirectory\ContentDirectory.cs" /> <Compile Include="ContentDirectory\ControlHandler.cs" /> <Compile Include="ContentDirectory\ServiceActionListBuilder.cs" /> @@ -167,7 +166,9 @@ <EmbeddedResource Include="Profiles\Xml\Sony Bravia %282013%29.xml" /> <EmbeddedResource Include="Profiles\Xml\Sony PlayStation 3.xml" /> <EmbeddedResource Include="Profiles\Xml\WDTV Live.xml" /> - <EmbeddedResource Include="Profiles\Xml\Xbox 360.xml" /> + <EmbeddedResource Include="Profiles\Xml\Xbox 360.xml"> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="Profiles\Xml\Xbox One.xml" /> </ItemGroup> <ItemGroup> diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.cs index 9df69b1157..66cdc51afe 100644 --- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs +++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs @@ -478,7 +478,7 @@ namespace MediaBrowser.Dlna.PlayTo playlistItem.StreamUrl = playlistItem.StreamInfo.ToDlnaUrl(_serverAddress, _accessToken); - var itemXml = new DidlBuilder(profile, user, _imageProcessor, _serverAddress, _accessToken, _userDataManager, _localization, _mediaSourceManager) + var itemXml = new DidlBuilder(profile, user, _imageProcessor, _serverAddress, _accessToken, _userDataManager, _localization, _mediaSourceManager, _logger) .GetItemDidl(item, null, _session.DeviceId, new Filter(), playlistItem.StreamInfo); playlistItem.Didl = itemXml; diff --git a/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs b/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs index 07936688d4..ab887a3bff 100644 --- a/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs +++ b/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs @@ -95,6 +95,7 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, + Codec = "h264", Conditions = new [] { new ProfileCondition @@ -138,7 +139,6 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, - Codec = "mpeg2video", Conditions = new [] { new ProfileCondition diff --git a/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs b/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs index 6cf06d41ff..883af57d29 100644 --- a/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs +++ b/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs @@ -93,8 +93,10 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, + Codec="h264", Conditions = new [] { + new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline"), new ProfileCondition { Condition = ProfileConditionType.LessThanEqual, @@ -120,10 +122,27 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, - Codec="h264", Conditions = new [] { - new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline") + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Width, + Value = "1920" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.Height, + Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.IsAnamorphic, + Value = "true", + IsRequired = false + } } }, diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs index 6f175ccd6c..46549040f3 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -209,6 +209,7 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, + Codec = "h264", Conditions = new [] { new ProfileCondition @@ -222,16 +223,7 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" - } - } - }, - - new CodecProfile - { - Type = CodecType.Video, - Codec = "h264", - Conditions = new [] - { + }, new ProfileCondition { Condition = ProfileConditionType.LessThanEqual, @@ -262,6 +254,18 @@ namespace MediaBrowser.Dlna.Profiles 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" }, @@ -276,6 +280,26 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { + Type = CodecType.Video, + 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.VideoAudio, Codec = "ac3", diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs index 32cf8b5542..d9891e87be 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs @@ -226,6 +226,7 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, + Codec = "h264", Conditions = new [] { new ProfileCondition @@ -239,16 +240,7 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" - } - } - }, - - new CodecProfile - { - Type = CodecType.Video, - Codec = "h264", - Conditions = new [] - { + }, new ProfileCondition { Condition = ProfileConditionType.LessThanEqual, @@ -279,6 +271,18 @@ namespace MediaBrowser.Dlna.Profiles 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" }, @@ -293,6 +297,26 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { + Type = CodecType.Video, + 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.VideoAudio, Codec = "ac3", diff --git a/MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs b/MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs deleted file mode 100644 index a318b193b6..0000000000 --- a/MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs +++ /dev/null @@ -1,274 +0,0 @@ -using System.Xml.Serialization; -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; - -namespace MediaBrowser.Dlna.Profiles -{ - [XmlRoot("Profile")] - public class WindowsMediaCenterProfile : DefaultProfile - { - public WindowsMediaCenterProfile() - { - Name = "Windows Media Center"; - - TranscodingProfiles = new[] - { - new TranscodingProfile - { - Container = "mp3", - AudioCodec = "mp3", - Type = DlnaProfileType.Audio - }, - new TranscodingProfile - { - Container = "asf", - VideoCodec = "msmpeg4", - AudioCodec = "wmav2", - Type = DlnaProfileType.Video - } - }; - - 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 - } - }; - - ResponseProfiles = new[] - { - new ResponseProfile - { - Container = "avi", - MimeType = "video/avi", - Type = DlnaProfileType.Video - } - }; - - ContainerProfiles = new[] - { - new ContainerProfile - { - Type = DlnaProfileType.Video, - Container = "mp4,mov", - - Conditions = new [] - { - new ProfileCondition - { - Condition = ProfileConditionType.Equals, - Property = ProfileConditionValue.Has64BitOffsets, - Value = "false", - IsRequired = false - } - } - } - }; - - CodecProfiles = new[] - { - new CodecProfile - { - Type = CodecType.Video, - 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.Video, - 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.Video, - 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.VideoAudio, - Codec = "ac3", - Conditions = new [] - { - new ProfileCondition - { - Condition = ProfileConditionType.LessThanEqual, - Property = ProfileConditionValue.AudioChannels, - Value = "6", - IsRequired = false - } - } - }, - - new CodecProfile - { - Type = CodecType.VideoAudio, - Codec = "wmav2,wmapro", - Conditions = new [] - { - new ProfileCondition - { - Condition = ProfileConditionType.LessThanEqual, - Property = ProfileConditionValue.AudioChannels, - Value = "2", - IsRequired = false - } - } - }, - - new CodecProfile - { - Type = CodecType.VideoAudio, - Codec = "aac", - Conditions = new [] - { - new ProfileCondition - { - Condition = ProfileConditionType.LessThanEqual, - Property = ProfileConditionValue.AudioChannels, - Value = "2", - 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 index 4399462cf0..3427d75f70 100644 --- a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs +++ b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs @@ -12,18 +12,27 @@ namespace MediaBrowser.Dlna.Profiles Name = "Xbox One"; TimelineOffsetSeconds = 40; - + Identification = new DeviceIdentification { - ModelName = "Xbox One", - FriendlyName = "Xbox-SystemOS", + FriendlyName = "XboxOne", Headers = new[] { - new HttpHeaderInfo {Name = "User-Agent", Value = "NSPlayer", Match = HeaderMatchType.Substring} + new HttpHeaderInfo + { + Name = "FriendlyName.DLNA.ORG", Value = "XboxOne", Match = HeaderMatchType.Substring + }, + new HttpHeaderInfo + { + Name = "User-Agent", Value = "NSPlayer/12", Match = HeaderMatchType.Substring + } } }; + var videoProfile = "high|main|baseline|constrained baseline"; + var videoLevel = "41"; + TranscodingProfiles = new[] { new TranscodingProfile @@ -43,8 +52,7 @@ namespace MediaBrowser.Dlna.Profiles Container = "ts", VideoCodec = "h264", AudioCodec = "aac", - Type = DlnaProfileType.Video, - EstimateContentLength = true + Type = DlnaProfileType.Video } }; @@ -129,6 +137,7 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { Type = CodecType.Video, + Codec = "mpeg4", Conditions = new [] { new ProfileCondition @@ -144,16 +153,7 @@ namespace MediaBrowser.Dlna.Profiles Property = ProfileConditionValue.VideoBitDepth, Value = "8", IsRequired = false - } - } - }, - - new CodecProfile - { - Type = CodecType.Video, - Codec = "mpeg4", - Conditions = new [] - { + }, new ProfileCondition { Condition = ProfileConditionType.LessThanEqual, @@ -191,6 +191,20 @@ namespace MediaBrowser.Dlna.Profiles { new ProfileCondition { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.IsAnamorphic, + Value = "true", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitDepth, + Value = "8", + IsRequired = false + }, + new ProfileCondition + { Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920" @@ -200,6 +214,20 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoLevel, + Value = videoLevel, + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.EqualsAny, + Property = ProfileConditionValue.VideoProfile, + Value = videoProfile, + IsRequired = false } } }, @@ -212,6 +240,20 @@ namespace MediaBrowser.Dlna.Profiles { new ProfileCondition { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.IsAnamorphic, + Value = "true", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitDepth, + Value = "8", + IsRequired = false + }, + new ProfileCondition + { Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Width, Value = "1920" @@ -241,6 +283,28 @@ namespace MediaBrowser.Dlna.Profiles new CodecProfile { + Type = CodecType.Video, + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.NotEquals, + Property = ProfileConditionValue.IsAnamorphic, + Value = "true", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitDepth, + Value = "8", + IsRequired = false + } + } + }, + + new CodecProfile + { Type = CodecType.VideoAudio, Codec = "ac3,wmav2,wmapro", Conditions = new [] @@ -278,7 +342,7 @@ namespace MediaBrowser.Dlna.Profiles } } }; - + ResponseProfiles = new[] { new ResponseProfile diff --git a/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml b/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml index d7ad1ac301..21f2b1ad5d 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml @@ -49,7 +49,7 @@ </TranscodingProfiles> <ContainerProfiles /> <CodecProfiles> - <CodecProfile type="Video"> + <CodecProfile type="Video" codec="h264"> <Conditions> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> @@ -58,7 +58,7 @@ <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" /> </Conditions> </CodecProfile> - <CodecProfile type="Video" codec="mpeg2video"> + <CodecProfile type="Video"> <Conditions> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml b/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml index 8470f601ac..2df2da98b6 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml @@ -44,16 +44,19 @@ </TranscodingProfiles> <ContainerProfiles /> <CodecProfiles> - <CodecProfile type="Video"> + <CodecProfile type="Video" codec="h264"> <Conditions> + <ProfileCondition condition="EqualsAny" property="VideoProfile" value="baseline|constrained baseline" isRequired="false" /> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" /> </Conditions> </CodecProfile> - <CodecProfile type="Video" codec="h264"> + <CodecProfile type="Video"> <Conditions> - <ProfileCondition condition="EqualsAny" property="VideoProfile" value="baseline|constrained baseline" isRequired="false" /> + <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> + <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> + <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" /> </Conditions> </CodecProfile> <CodecProfile type="VideoAudio" codec="aac"> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml index ba993ca3e5..19cb5670a7 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml @@ -58,14 +58,10 @@ </ContainerProfile> </ContainerProfiles> <CodecProfiles> - <CodecProfile type="Video"> + <CodecProfile type="Video" codec="h264"> <Conditions> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> - </Conditions> - </CodecProfile> - <CodecProfile type="Video" codec="h264"> - <Conditions> <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" /> @@ -73,10 +69,18 @@ </CodecProfile> <CodecProfile type="Video" codec="mpeg2video"> <Conditions> + <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> + <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" /> </Conditions> </CodecProfile> + <CodecProfile type="Video"> + <Conditions> + <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> + <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> + </Conditions> + </CodecProfile> <CodecProfile type="VideoAudio" codec="ac3"> <Conditions> <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml index 271cf1132d..78c99d3663 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml @@ -61,14 +61,10 @@ </ContainerProfile> </ContainerProfiles> <CodecProfiles> - <CodecProfile type="Video"> + <CodecProfile type="Video" codec="h264"> <Conditions> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> - </Conditions> - </CodecProfile> - <CodecProfile type="Video" codec="h264"> - <Conditions> <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" /> @@ -76,10 +72,18 @@ </CodecProfile> <CodecProfile type="Video" codec="mpeg2video"> <Conditions> + <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> + <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" /> </Conditions> </CodecProfile> + <CodecProfile type="Video"> + <Conditions> + <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> + <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> + </Conditions> + </CodecProfile> <CodecProfile type="VideoAudio" codec="ac3"> <Conditions> <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml b/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml index 2595ffbdfc..d22356646b 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml @@ -2,10 +2,10 @@ <Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>Xbox One</Name> <Identification> - <FriendlyName>Xbox-SystemOS</FriendlyName> - <ModelName>Xbox One</ModelName> + <FriendlyName>XboxOne</FriendlyName> <Headers> - <HttpHeaderInfo name="User-Agent" value="NSPlayer" match="Substring" /> + <HttpHeaderInfo name="FriendlyName.DLNA.ORG" value="XboxOne" match="Substring" /> + <HttpHeaderInfo name="User-Agent" value="NSPlayer/12" match="Substring" /> </Headers> </Identification> <FriendlyName>Emby</FriendlyName> @@ -48,7 +48,7 @@ <TranscodingProfiles> <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" /> <TranscodingProfile container="jpeg" type="Photo" videoCodec="jpeg" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" /> - <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="true" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" /> + <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" /> </TranscodingProfiles> <ContainerProfiles> <ContainerProfile type="Video" container="mp4,mov"> @@ -58,14 +58,10 @@ </ContainerProfile> </ContainerProfiles> <CodecProfiles> - <CodecProfile type="Video"> + <CodecProfile type="Video" codec="mpeg4"> <Conditions> <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" /> <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" /> - </Conditions> - </CodecProfile> - <CodecProfile type="Video" codec="mpeg4"> - <Conditions> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" /> @@ -74,18 +70,30 @@ </CodecProfile> <CodecProfile type="Video" codec="h264"> <Conditions> + <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" /> + <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" /> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> + <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" /> + <ProfileCondition condition="EqualsAny" property="VideoProfile" value="high|main|baseline|constrained baseline" isRequired="false" /> </Conditions> </CodecProfile> <CodecProfile type="Video" codec="wmv2,wmv3,vc1"> <Conditions> + <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" /> + <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" /> <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" /> <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" /> <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" /> </Conditions> </CodecProfile> + <CodecProfile type="Video"> + <Conditions> + <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" /> + <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" /> + </Conditions> + </CodecProfile> <CodecProfile type="VideoAudio" codec="ac3,wmav2,wmapro"> <Conditions> <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" /> |
