update dlna profiles

This commit is contained in:
Luke Pulverenti 2014-10-20 20:54:01 -04:00
parent 1292eccfb5
commit df509dedb7
27 changed files with 176 additions and 68 deletions

View File

@ -3,6 +3,7 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Dlna.Profiles;
using MediaBrowser.Dlna.Server;
using MediaBrowser.Model.Dlna;
@ -37,8 +38,6 @@ namespace MediaBrowser.Dlna
_appPaths = appPaths;
_logger = logger;
_jsonSerializer = jsonSerializer;
//DumpProfiles();
}
public IEnumerable<DeviceProfile> GetProfiles()
@ -55,44 +54,6 @@ namespace MediaBrowser.Dlna
return list;
}
private void DumpProfiles()
{
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(),
new Foobar2000Profile(),
new MediaMonkeyProfile(),
new Windows81Profile(),
//new WindowsMediaCenterProfile(),
new WindowsPhoneProfile(),
new AndroidProfile(true, true, new[]{"baseline", "constrained baseline"}),
new DirectTvProfile(),
new DishHopperJoeyProfile(),
new DefaultProfile()
};
foreach (var item in list)
{
var path = Path.Combine(_appPaths.ProgramDataPath, _fileSystem.GetValidFilename(item.Name) + ".xml");
_xmlSerializer.SerializeToFile(item, path);
}
}
private bool _extracted;
private readonly object _syncLock = new object();
private void ExtractProfilesIfNeeded()
@ -521,4 +482,66 @@ namespace MediaBrowser.Dlna
};
}
}
class DlnaProfileEntryPoint : IServerEntryPoint
{
private readonly IApplicationPaths _appPaths;
private readonly IXmlSerializer _xmlSerializer;
private readonly IFileSystem _fileSystem;
public DlnaProfileEntryPoint(IApplicationPaths appPaths, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
{
_appPaths = appPaths;
_xmlSerializer = xmlSerializer;
_fileSystem = fileSystem;
}
public void Run()
{
//DumpProfiles();
}
private void DumpProfiles()
{
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(),
new Foobar2000Profile(),
new MediaMonkeyProfile(),
new Windows81Profile(),
//new WindowsMediaCenterProfile(),
new WindowsPhoneProfile(),
new AndroidProfile(),
new DirectTvProfile(),
new DishHopperJoeyProfile(),
new DefaultProfile()
};
foreach (var item in list)
{
var path = Path.Combine(_appPaths.ProgramDataPath, _fileSystem.GetValidFilename(item.Name) + ".xml");
_xmlSerializer.SerializeToFile(item, path);
}
}
public void Dispose()
{
throw new NotImplementedException();
}
}
}

View File

@ -10,8 +10,18 @@ namespace MediaBrowser.Dlna.Profiles
public XboxOneProfile()
{
Name = "Xbox One";
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 One",

View File

@ -25,6 +25,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp4" audioCodec="aac" videoCodec="h264,mpeg4" type="Video" />
@ -36,33 +38,42 @@
</DirectPlayProfiles>
<TranscodingProfiles>
<TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" />
<TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" protocol="hls" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" videoProfile="Baseline" context="Streaming" />
<TranscodingProfile container="mp4" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" videoProfile="Baseline" context="Static" />
<TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" protocol="hls" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" videoProfile="baseline" context="Streaming" />
<TranscodingProfile container="mp4" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" videoProfile="baseline" context="Static" />
</TranscodingProfiles>
<ContainerProfiles />
<CodecProfiles>
<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="false" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
<ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
</Conditions>
</CodecProfile>
<CodecProfile type="Video">
<Conditions>
<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" />
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
<ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
</Conditions>
</CodecProfile>
<CodecProfile type="VideoAudio" codec="aac">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
</Conditions>
</CodecProfile>
<CodecProfile type="Audio" codec="aac">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
</Conditions>
</CodecProfile>
<CodecProfile type="Audio" codec="mp3">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="AudioBitrate" value="320000" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="AudioBitrate" value="320000" isRequired="false" />
</Conditions>
</CodecProfile>
</CodecProfiles>

View File

@ -25,6 +25,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,wma" type="Audio" />

View File

@ -30,6 +30,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />

View File

@ -31,6 +31,8 @@
<TimelineOffsetSeconds>10</TimelineOffsetSeconds>
<RequiresPlainVideoItems>true</RequiresPlainVideoItems>
<RequiresPlainFolders>true</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mpeg" audioCodec="mp2" videoCodec="mpeg2video" type="Video" />

View File

@ -32,6 +32,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp4,mkv,mpeg,ts" audioCodec="mp3,ac3,aac,he-aac,pcm" videoCodec="h264,mpeg2video" type="Video" />

View File

@ -31,6 +31,8 @@
<TimelineOffsetSeconds>10</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="ts" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" />

View File

@ -29,6 +29,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />

View File

@ -31,6 +31,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" />

View File

@ -32,6 +32,8 @@
<TimelineOffsetSeconds>10</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:pv" value="http://www.pv.com/pvns/" />
</XmlRootAttributes>

View File

@ -31,6 +31,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:sec" value="http://www.sec.co.kr/" />
</XmlRootAttributes>

View File

@ -31,6 +31,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

View File

@ -33,6 +33,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

View File

@ -33,6 +33,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

View File

@ -33,6 +33,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

View File

@ -33,6 +33,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

View File

@ -33,6 +33,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

View File

@ -33,6 +33,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,wma" type="Audio" />

View File

@ -32,6 +32,8 @@
<TimelineOffsetSeconds>5</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" />

View File

@ -29,6 +29,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp4,mov" audioCodec="aac,ac3,eac3,mp3,pcm" videoCodec="h264,mpeg4" type="Video" />

View File

@ -25,6 +25,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp4,mov" audioCodec="aac,mp3" videoCodec="h264" type="Video" />

View File

@ -32,6 +32,8 @@
<TimelineOffsetSeconds>40</TimelineOffsetSeconds>
<RequiresPlainVideoItems>true</RequiresPlainVideoItems>
<RequiresPlainFolders>true</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" />

File diff suppressed because one or more lines are too long

View File

@ -31,6 +31,8 @@
<TimelineOffsetSeconds>0</TimelineOffsetSeconds>
<RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" />

View File

@ -6,8 +6,14 @@ namespace MediaBrowser.Model.Dlna.Profiles
[XmlRoot("Profile")]
public class AndroidProfile : DefaultProfile
{
public AndroidProfile(bool supportsHls,
bool supportsMpegDash,
public AndroidProfile()
: this(true, true, new[] { "baseline", "constrained baseline" })
{
}
public AndroidProfile(bool supportsHls,
bool supportsMpegDash,
string[] supportedH264Profiles)
{
Name = "Android";

View File

@ -286,8 +286,14 @@ namespace MediaBrowser.WebDashboard.Api
var culture = "en-US";
await DumpHtml(creator.DashboardUIPath, path, culture, _appHost.ApplicationVersion.ToString());
var appVersion = _appHost.ApplicationVersion.ToString();
await DumpHtml(creator.DashboardUIPath, path, culture, appVersion);
await DumpJs(creator.DashboardUIPath, path, culture, appVersion);
await DumpFile("scripts/all.js", Path.Combine(path, "scripts", "all.js"), culture, appVersion).ConfigureAwait(false);
await DumpFile("css/all.css", Path.Combine(path, "css", "all.css"), culture, appVersion).ConfigureAwait(false);
return "";
}
@ -295,19 +301,27 @@ namespace MediaBrowser.WebDashboard.Api
{
foreach (var file in Directory.GetFiles(source, "*.html", SearchOption.TopDirectoryOnly))
{
await DumpHtmlFile(file, destination, culture, appVersion).ConfigureAwait(false);
var filename = Path.GetFileName(file);
await DumpFile(filename, Path.Combine(destination, filename), culture, appVersion).ConfigureAwait(false);
}
}
private async Task DumpHtmlFile(string file, string destination, string culture, string appVersion)
private async Task DumpJs(string source, string destination, string culture, string appVersion)
{
var filename = Path.GetFileName(file);
var targetPath = Path.Combine(destination, filename);
using (var stream = await GetPackageCreator().GetResource(filename, culture, appVersion).ConfigureAwait(false))
foreach (var file in Directory.GetFiles(source, "*.js", SearchOption.TopDirectoryOnly))
{
using (var fs = _fileSystem.GetFileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.Read))
var filename = Path.GetFileName(file);
await DumpFile("scripts/" + filename, Path.Combine(destination, "scripts", filename), culture, appVersion).ConfigureAwait(false);
}
}
private async Task DumpFile(string resourceVirtualPath, string destinationFilePath, string culture, string appVersion)
{
using (var stream = await GetPackageCreator().GetResource(resourceVirtualPath, culture, appVersion).ConfigureAwait(false))
{
using (var fs = _fileSystem.GetFileStream(destinationFilePath, FileMode.Create, FileAccess.Write, FileShare.Read))
{
stream.CopyTo(fs);
}