diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-24 01:08:10 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-24 01:08:10 -0400 |
| commit | a748c660cb3b20fba0f141025a41afa4426a935c (patch) | |
| tree | beb1c7b0ace7a697f53253ecba2471039842c452 /MediaBrowser.Dlna | |
| parent | 0ab3a1bf8e437591e8f949ed198f33b95522c703 (diff) | |
updated dlna profiles
Diffstat (limited to 'MediaBrowser.Dlna')
28 files changed, 301 insertions, 38 deletions
diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs index 27aae7d9c1..4209e0f156 100644 --- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs +++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs @@ -9,7 +9,6 @@ using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; using System; -using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Xml; @@ -47,6 +46,12 @@ namespace MediaBrowser.Dlna.Didl didl.SetAttribute("xmlns:dlna", NS_DLNA); didl.SetAttribute("xmlns:upnp", NS_UPNP); //didl.SetAttribute("xmlns:sec", NS_SEC); + + foreach (var att in _profile.ContentDirectoryRootAttributes) + { + didl.SetAttribute(att.Name, att.Value); + } + result.AppendChild(didl); result.DocumentElement.AppendChild(GetItemElement(result, item, deviceId, filter)); @@ -130,7 +135,7 @@ namespace MediaBrowser.Dlna.Didl } } - var totalBitrate = streamInfo.TotalOutputBitrate; + var totalBitrate = streamInfo.TargetTotalBitrate; var targetSampleRate = streamInfo.TargetAudioSampleRate; var targetChannels = streamInfo.TargetAudioChannels; @@ -162,7 +167,18 @@ namespace MediaBrowser.Dlna.Didl var mediaProfile = _profile.GetVideoMediaProfile(streamInfo.Container, streamInfo.AudioCodec, - streamInfo.VideoCodec); + streamInfo.VideoCodec, + streamInfo.TargetAudioBitrate, + targetChannels, + targetWidth, + targetHeight, + streamInfo.TargetVideoBitDepth, + streamInfo.TargetVideoBitrate, + streamInfo.TargetVideoProfile, + streamInfo.TargetVideoLevel, + streamInfo.TargetFramerate, + streamInfo.TargetPacketLength, + streamInfo.TargetTimestamp); var filename = url.Substring(0, url.IndexOf('?')); @@ -175,10 +191,17 @@ namespace MediaBrowser.Dlna.Didl streamInfo.AudioCodec, targetWidth, targetHeight, - totalBitrate, + streamInfo.TargetVideoBitDepth, + streamInfo.TargetVideoBitrate, + streamInfo.TargetAudioChannels, + streamInfo.TargetAudioBitrate, streamInfo.TargetTimestamp, streamInfo.IsDirectStream, streamInfo.RunTimeTicks, + streamInfo.TargetVideoProfile, + streamInfo.TargetVideoLevel, + streamInfo.TargetFramerate, + streamInfo.TargetPacketLength, streamInfo.TranscodeSeekInfo); res.SetAttribute("protocolInfo", String.Format( @@ -248,7 +271,9 @@ namespace MediaBrowser.Dlna.Didl } var mediaProfile = _profile.GetAudioMediaProfile(streamInfo.Container, - streamInfo.AudioCodec); + streamInfo.AudioCodec, + targetChannels, + targetAudioBitrate); var filename = url.Substring(0, url.IndexOf('?')); @@ -541,15 +566,12 @@ namespace MediaBrowser.Dlna.Didl var width = albumartUrlInfo.Width; var height = albumartUrlInfo.Height; - var mediaProfile = new MediaFormatProfileResolver().ResolveImageFormat("jpg", width, height); - - var orgPn = mediaProfile.HasValue ? "DLNA.ORG_PN=:" + mediaProfile.Value + ";" : string.Empty; + var contentFeatures = new ContentFeatureBuilder(_profile).BuildImageHeader("jpg", width, height); - res.SetAttribute("protocolInfo", string.Format( - "http-get:*:{1}:{0}DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS={2}", - orgPn, + res.SetAttribute("protocolInfo", String.Format( + "http-get:*:{0}:{1}", "image/jpeg", - DlnaMaps.DefaultStreaming + contentFeatures )); if (width.HasValue && height.HasValue) diff --git a/MediaBrowser.Dlna/PlayTo/DlnaController.cs b/MediaBrowser.Dlna/PlayTo/DlnaController.cs index 28fc4474e9..6b6152d85a 100644 --- a/MediaBrowser.Dlna/PlayTo/DlnaController.cs +++ b/MediaBrowser.Dlna/PlayTo/DlnaController.cs @@ -428,10 +428,17 @@ namespace MediaBrowser.Dlna.PlayTo streamInfo.AudioCodec, streamInfo.TargetWidth, streamInfo.TargetHeight, - streamInfo.TotalOutputBitrate, + streamInfo.TargetVideoBitDepth, + streamInfo.TargetVideoBitrate, + streamInfo.TargetAudioChannels, + streamInfo.TargetAudioBitrate, streamInfo.TargetTimestamp, streamInfo.IsDirectStream, streamInfo.RunTimeTicks, + streamInfo.TargetVideoProfile, + streamInfo.TargetVideoLevel, + streamInfo.TargetFramerate, + streamInfo.TargetPacketLength, streamInfo.TranscodeSeekInfo); } diff --git a/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs b/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs index 178207fc6a..2968bcd5fa 100644 --- a/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs +++ b/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs @@ -1,6 +1,5 @@ -using System.Xml.Serialization; -using MediaBrowser.Controller.Dlna; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dlna; +using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles { @@ -27,6 +26,15 @@ namespace MediaBrowser.Dlna.Profiles } }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:pv", + Value = "http://www.pv.com/pvns/" + } + }; + TimelineOffsetSeconds = 10; TranscodingProfiles = new[] diff --git a/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs b/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs index 9b113b6c66..69203f3425 100644 --- a/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs +++ b/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs @@ -17,6 +17,15 @@ namespace MediaBrowser.Dlna.Profiles ModelUrl = "samsung.com" }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:sec", + Value = "http://www.sec.co.kr/" + } + }; + TranscodingProfiles = new[] { new TranscodingProfile diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs index 833f623bf4..bc6ac98ca5 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs @@ -18,6 +18,15 @@ namespace MediaBrowser.Dlna.Profiles ModelNumber = "BDP-2013" }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:av", + Value = "urn:schemas-sony-com:av" + } + }; + ModelName = "Windows Media Player Sharing"; ModelNumber = "3.0"; Manufacturer = "Microsoft Corporation"; diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs index 970c57319a..bb5a109da2 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs @@ -33,6 +33,15 @@ namespace MediaBrowser.Dlna.Profiles } }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:av", + Value = "urn:schemas-sony-com:av" + } + }; + ModelName = "Windows Media Player Sharing"; ModelNumber = "3.0"; Manufacturer = "Microsoft Corporation"; diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs index 6639e18763..d3c0ae7a78 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -27,6 +27,15 @@ namespace MediaBrowser.Dlna.Profiles } }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:av", + Value = "urn:schemas-sony-com:av" + } + }; + ModelName = "Windows Media Player Sharing"; ModelNumber = "3.0"; ModelUrl = "http://www.microsoft.com/"; @@ -99,7 +108,23 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "192" + }, + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.VideoTimestamp, + Value = "Valid" + } + } }, new ResponseProfile @@ -109,7 +134,17 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "188" + } + } }, new ResponseProfile diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs index 8665b892ab..65a3cdb0dc 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs @@ -1,6 +1,5 @@ -using System.Xml.Serialization; -using MediaBrowser.Controller.Dlna; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dlna; +using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles { @@ -27,6 +26,15 @@ namespace MediaBrowser.Dlna.Profiles } }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:av", + Value = "urn:schemas-sony-com:av" + } + }; + ModelName = "Windows Media Player Sharing"; ModelNumber = "3.0"; ModelUrl = "http://www.microsoft.com/"; @@ -141,7 +149,23 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "192" + }, + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.VideoTimestamp, + Value = "Valid" + } + } }, new ResponseProfile @@ -151,7 +175,17 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "188" + } + } }, new ResponseProfile diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs index 5becc6752a..5a818d0adc 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs @@ -27,6 +27,15 @@ namespace MediaBrowser.Dlna.Profiles } }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:av", + Value = "urn:schemas-sony-com:av" + } + }; + ModelName = "Windows Media Player Sharing"; ModelNumber = "3.0"; ModelUrl = "http://www.microsoft.com/"; @@ -129,7 +138,23 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "192" + }, + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.VideoTimestamp, + Value = "Valid" + } + } }, new ResponseProfile @@ -139,7 +164,17 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "188" + } + } }, new ResponseProfile diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs index 51ded765eb..5923bce4cf 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs @@ -26,6 +26,15 @@ namespace MediaBrowser.Dlna.Profiles } }; + ContentDirectoryRootAttributes = new[] + { + new XmlAttribute + { + Name = "xmlns:av", + Value = "urn:schemas-sony-com:av" + } + }; + ModelName = "Windows Media Player Sharing"; ModelNumber = "3.0"; ModelUrl = "http://www.microsoft.com/"; @@ -184,7 +193,23 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "192" + }, + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.VideoTimestamp, + Value = "Valid" + } + } }, new ResponseProfile @@ -194,7 +219,17 @@ namespace MediaBrowser.Dlna.Profiles 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 + Type = DlnaProfileType.Video, + + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.Equals, + Property = ProfileConditionValue.PacketLength, + Value = "188" + } + } }, new ResponseProfile diff --git a/MediaBrowser.Dlna/Profiles/Xml/Default.xml b/MediaBrowser.Dlna/Profiles/Xml/Default.xml index dcc8ede744..e9b920d171 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Default.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Default.xml @@ -22,6 +22,7 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="mp3,wma" type="Audio" /> <DirectPlayProfile container="avi,mp4" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Denon AVR.xml b/MediaBrowser.Dlna/Profiles/Xml/Denon AVR.xml index 3b7f3f74d4..7ee3abdde1 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Denon AVR.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Denon AVR.xml @@ -27,6 +27,7 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" /> </DirectPlayProfiles> diff --git a/MediaBrowser.Dlna/Profiles/Xml/LG Smart TV.xml b/MediaBrowser.Dlna/Profiles/Xml/LG Smart TV.xml index 92a107c6e4..aec6d2cc1b 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/LG Smart TV.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/LG Smart TV.xml @@ -28,6 +28,7 @@ <TimelineOffsetSeconds>10</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="mkv" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Linksys DMA2100.xml b/MediaBrowser.Dlna/Profiles/Xml/Linksys DMA2100.xml index 00d3d3a09e..a0a4f502cf 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Linksys DMA2100.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Linksys DMA2100.xml @@ -26,6 +26,7 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" /> <DirectPlayProfile container="avi,mp4,mkv,ts" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Panasonic Viera.xml b/MediaBrowser.Dlna/Profiles/Xml/Panasonic Viera.xml index dfb95c036a..4f8ae88e35 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Panasonic Viera.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Panasonic Viera.xml @@ -29,6 +29,9 @@ <TimelineOffsetSeconds>10</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:pv" value="http://www.pv.com/pvns/" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="mpeg" audioCodec="ac3,mp3" videoCodec="mpeg2video,mpeg4" type="Video" /> <DirectPlayProfile container="mkv" audioCodec="aac,ac3,mp3,pcm" videoCodec="h264" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Samsung Smart TV.xml b/MediaBrowser.Dlna/Profiles/Xml/Samsung Smart TV.xml index 4e0f5e623c..1371710cc7 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Samsung Smart TV.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Samsung Smart TV.xml @@ -26,6 +26,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:sec" value="http://www.sec.co.kr/" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="asf" audioCodec="mp3,ac3,wmav2,wmapro,wmavoice" videoCodec="h264,mpeg4,mjpeg" type="Video" /> <DirectPlayProfile container="avi" audioCodec="mp3,ac3,dca" videoCodec="h264,mpeg4,mjpeg" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml index c9463225c4..86ced11506 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml @@ -28,6 +28,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3,aac,mp3,pcm" videoCodec="mpeg1video,mpeg2video,h264" type="Video" /> <DirectPlayProfile container="mpeg" audioCodec="ac3,mp3,mp2,pcm" videoCodec="mpeg1video,mpeg2video" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player.xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player.xml index 1805d81b44..22b3b2ce50 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player.xml @@ -30,6 +30,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3,aac,mp3,pcm" videoCodec="mpeg1video,mpeg2video,h264" type="Video" /> <DirectPlayProfile container="mpeg" audioCodec="ac3,mp3,pcm" videoCodec="mpeg1video,mpeg2video" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml index 42b866bd32..40605bc4e2 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml @@ -30,6 +30,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="mp3,mp2" videoCodec="mpeg1video,mpeg2video" type="Video" /> @@ -83,10 +86,15 @@ </CodecProfiles> <ResponseProfiles> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T" mimeType="video/vnd.dlna.mpeg-tts"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="192" isRequired="true" /> + <ProfileCondition condition="Equals" property="VideoTimestamp" value="Valid" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO" mimeType="video/mpeg"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="188" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU" mimeType="video/vnd.dlna.mpeg-tts"> <Conditions /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml index 073996ccbf..561bd2c00e 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml @@ -30,6 +30,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="mp3,mp2" videoCodec="mpeg2video" type="Video" /> @@ -86,10 +89,15 @@ </CodecProfiles> <ResponseProfiles> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T" mimeType="video/vnd.dlna.mpeg-tts"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="192" isRequired="true" /> + <ProfileCondition condition="Equals" property="VideoTimestamp" value="Valid" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO" mimeType="video/mpeg"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="188" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU" mimeType="video/vnd.dlna.mpeg-tts"> <Conditions /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml index d1bf59991d..b62b60a66b 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml @@ -30,6 +30,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="mp3,mp2" videoCodec="mpeg2video" type="Video" /> @@ -69,10 +72,15 @@ </CodecProfiles> <ResponseProfiles> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T" mimeType="video/vnd.dlna.mpeg-tts"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="192" isRequired="true" /> + <ProfileCondition condition="Equals" property="VideoTimestamp" value="Valid" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO" mimeType="video/mpeg"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="188" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU" mimeType="video/vnd.dlna.mpeg-tts"> <Conditions /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml index 4dc1d9a741..ea78552c68 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml @@ -30,6 +30,9 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes> + <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> + </ContentDirectoryRootAttributes> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3,eac3,aac,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="mp3,mp2" videoCodec="mpeg2video" type="Video" /> @@ -69,10 +72,15 @@ </CodecProfiles> <ResponseProfiles> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T" mimeType="video/vnd.dlna.mpeg-tts"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="192" isRequired="true" /> + <ProfileCondition condition="Equals" property="VideoTimestamp" value="Valid" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO" mimeType="video/mpeg"> - <Conditions /> + <Conditions> + <ProfileCondition condition="Equals" property="PacketLength" value="188" isRequired="true" /> + </Conditions> </ResponseProfile> <ResponseProfile container="ts" audioCodec="ac3,aac,mp3" videoCodec="h264" type="Video" orgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU" mimeType="video/vnd.dlna.mpeg-tts"> <Conditions /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 3.xml b/MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 3.xml index fed31fec0e..f27f5aa4a6 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 3.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 3.xml @@ -30,6 +30,7 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="mp3,wma" type="Audio" /> <DirectPlayProfile container="avi,mp4" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml b/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml index 0936a6ced2..bee389b69f 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml @@ -29,6 +29,7 @@ <TimelineOffsetSeconds>5</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="avi" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" /> <DirectPlayProfile container="mpeg" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Xbox 360.xml b/MediaBrowser.Dlna/Profiles/Xml/Xbox 360.xml index cf12b26405..c72f404396 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Xbox 360.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Xbox 360.xml @@ -29,6 +29,7 @@ <TimelineOffsetSeconds>40</TimelineOffsetSeconds> <RequiresPlainVideoItems>true</RequiresPlainVideoItems> <RequiresPlainFolders>true</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" /> <DirectPlayProfile container="avi" audioCodec="aac" videoCodec="h264" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml b/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml index a1d3ed428e..c2aae9ef4b 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml @@ -27,6 +27,7 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="ts" audioCodec="ac3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" /> diff --git a/MediaBrowser.Dlna/Profiles/Xml/foobar2000.xml b/MediaBrowser.Dlna/Profiles/Xml/foobar2000.xml index 2269af5d46..a80dff73e9 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/foobar2000.xml +++ b/MediaBrowser.Dlna/Profiles/Xml/foobar2000.xml @@ -28,6 +28,7 @@ <TimelineOffsetSeconds>0</TimelineOffsetSeconds> <RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainFolders>false</RequiresPlainFolders> + <ContentDirectoryRootAttributes /> <DirectPlayProfiles> <DirectPlayProfile container="mp3,wma" type="Audio" /> <DirectPlayProfile container="avi,mp4" type="Video" /> diff --git a/MediaBrowser.Dlna/Server/ControlHandler.cs b/MediaBrowser.Dlna/Server/ControlHandler.cs index 734adf7952..b28ec010e8 100644 --- a/MediaBrowser.Dlna/Server/ControlHandler.cs +++ b/MediaBrowser.Dlna/Server/ControlHandler.cs @@ -40,6 +40,8 @@ namespace MediaBrowser.Dlna.Server private readonly DidlBuilder _didlBuilder; + private readonly DeviceProfile _profile; + public ControlHandler(ILogger logger, ILibraryManager libraryManager, DeviceProfile profile, string serverAddress, IDtoService dtoService, IImageProcessor imageProcessor, IUserDataManager userDataManager, User user, int systemUpdateId) { _logger = logger; @@ -47,6 +49,7 @@ namespace MediaBrowser.Dlna.Server _userDataManager = userDataManager; _user = user; _systemUpdateId = systemUpdateId; + _profile = profile; _didlBuilder = new DidlBuilder(profile, imageProcessor, serverAddress, dtoService); } @@ -314,7 +317,6 @@ namespace MediaBrowser.Dlna.Server // sort example: dc:title, dc:date - var provided = 0; var requested = 0; var start = 0; @@ -334,7 +336,12 @@ namespace MediaBrowser.Dlna.Server didl.SetAttribute("xmlns:dc", NS_DC); didl.SetAttribute("xmlns:dlna", NS_DLNA); didl.SetAttribute("xmlns:upnp", NS_UPNP); - //didl.SetAttribute("xmlns:sec", NS_SEC); + + foreach (var att in _profile.ContentDirectoryRootAttributes) + { + didl.SetAttribute(att.Name, att.Value); + } + result.AppendChild(didl); var folder = (Folder)GetItemFromObjectId(sparams["ContainerID"], user); @@ -352,7 +359,7 @@ namespace MediaBrowser.Dlna.Server children = children.Take(requested).ToList(); } - provided = children.Count; + var provided = children.Count; foreach (var i in children) { |
