Merge pull request #2742 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-07-02 15:01:08 -04:00 committed by GitHub
commit d199052e10
21 changed files with 71 additions and 48 deletions

View File

@ -183,8 +183,8 @@ namespace Emby.Drawing.Skia
} }
} }
private string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" }; private static string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" };
private SKBitmap Decode(string path, bool forceCleanBitmap, out SKCodecOrigin origin) internal static SKBitmap Decode(string path, bool forceCleanBitmap, out SKCodecOrigin origin)
{ {
var requiresTransparencyHack = TransparentImageTypes.Contains(Path.GetExtension(path) ?? string.Empty); var requiresTransparencyHack = TransparentImageTypes.Contains(Path.GetExtension(path) ?? string.Empty);

View File

@ -82,7 +82,8 @@ namespace Emby.Drawing.Skia
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
using (var currentBitmap = SKBitmap.Decode(paths[imageIndex])) SKCodecOrigin origin;
using (var currentBitmap = SkiaEncoder.Decode(paths[imageIndex], false, out origin))
{ {
// resize to the same aspect as the original // resize to the same aspect as the original
int iWidth = (int)Math.Abs(iHeight * currentBitmap.Width / currentBitmap.Height); int iWidth = (int)Math.Abs(iHeight * currentBitmap.Width / currentBitmap.Height);
@ -163,7 +164,8 @@ namespace Emby.Drawing.Skia
{ {
for (var y = 0; y < 2; y++) for (var y = 0; y < 2; y++)
{ {
using (var currentBitmap = SKBitmap.Decode(paths[imageIndex])) SKCodecOrigin origin;
using (var currentBitmap = SkiaEncoder.Decode(paths[imageIndex], false, out origin))
{ {
using (var resizedBitmap = new SKBitmap(cellWidth, cellHeight, currentBitmap.ColorType, currentBitmap.AlphaType)) using (var resizedBitmap = new SKBitmap(cellWidth, cellHeight, currentBitmap.ColorType, currentBitmap.AlphaType))
{ {

View File

@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Channels
return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>()); return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
} }
public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken) public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -17,7 +17,7 @@ using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.Data namespace Emby.Server.Implementations.Data
{ {
public class CleanDatabaseScheduledTask : IScheduledTask public class CleanDatabaseScheduledTask : ILibraryPostScanTask
{ {
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IItemRepository _itemRepo; private readonly IItemRepository _itemRepo;
@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.Data
get { return "Library"; } get { return "Library"; }
} }
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress) public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{ {
// Ensure these objects are lazy loaded. // Ensure these objects are lazy loaded.
// Without this there is a deadlock that will need to be investigated // Without this there is a deadlock that will need to be investigated

View File

@ -307,7 +307,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL"> <Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll</HintPath> <HintPath>..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />

View File

@ -371,7 +371,7 @@ namespace Emby.Server.Implementations.Library
var tuple = GetProvider(request.OpenToken); var tuple = GetProvider(request.OpenToken);
var provider = tuple.Item1; var provider = tuple.Item1;
var mediaSourceTuple = await provider.OpenMediaSource(tuple.Item2, cancellationToken).ConfigureAwait(false); var mediaSourceTuple = await provider.OpenMediaSource(tuple.Item2, request.AllowMediaProbe, cancellationToken).ConfigureAwait(false);
var mediaSource = mediaSourceTuple.Item1; var mediaSource = mediaSourceTuple.Item1;

View File

@ -16,8 +16,8 @@ namespace Emby.Server.Implementations.LiveTv
private readonly IMediaEncoder _mediaEncoder; private readonly IMediaEncoder _mediaEncoder;
private readonly ILogger _logger; private readonly ILogger _logger;
const int ProbeAnalyzeDurationMs = 2000; const int ProbeAnalyzeDurationMs = 3000;
const int PlaybackAnalyzeDurationMs = 2000; const int PlaybackAnalyzeDurationMs = 3000;
public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger) public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger)
{ {

View File

@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.LiveTv
return list; return list;
} }
public async Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken) public async Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken)
{ {
MediaSourceInfo stream = null; MediaSourceInfo stream = null;
const bool isAudio = false; const bool isAudio = false;
@ -140,7 +140,7 @@ namespace Emby.Server.Implementations.LiveTv
try try
{ {
if (!stream.SupportsProbing || stream.MediaStreams.Any(i => i.Index != -1)) if (!allowLiveStreamProbe || !stream.SupportsProbing || stream.MediaStreams.Any(i => i.Index != -1))
{ {
AddMediaInfo(stream, isAudio, cancellationToken); AddMediaInfo(stream, isAudio, cancellationToken);
} }

View File

@ -3,5 +3,5 @@
<package id="Emby.XmlTv" version="1.0.9" targetFramework="net46" /> <package id="Emby.XmlTv" version="1.0.9" targetFramework="net46" />
<package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" /> <package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" />
<package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" /> <package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" />
<package id="SQLitePCLRaw.core" version="1.1.6" targetFramework="net46" /> <package id="SQLitePCLRaw.core" version="1.1.7" targetFramework="net46" />
</packages> </packages>

View File

@ -134,7 +134,7 @@ namespace MediaBrowser.Api.Playback
SetDeviceSpecificData(item, result.MediaSource, profile, authInfo, request.MaxStreamingBitrate, SetDeviceSpecificData(item, result.MediaSource, profile, authInfo, request.MaxStreamingBitrate,
request.StartTimeTicks ?? 0, result.MediaSource.Id, request.AudioStreamIndex, request.StartTimeTicks ?? 0, result.MediaSource.Id, request.AudioStreamIndex,
request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, true, true, true); request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, request.EnableDirectPlay, true, request.EnableDirectStream, true, true, true);
} }
else else
{ {
@ -176,7 +176,7 @@ namespace MediaBrowser.Api.Playback
{ {
var mediaSourceId = request.MediaSourceId; var mediaSourceId = request.MediaSourceId;
SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy); SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, true, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy);
} }
if (request.AutoOpenLiveStream) if (request.AutoOpenLiveStream)
@ -191,7 +191,6 @@ namespace MediaBrowser.Api.Playback
DeviceProfile = request.DeviceProfile, DeviceProfile = request.DeviceProfile,
EnableDirectPlay = request.EnableDirectPlay, EnableDirectPlay = request.EnableDirectPlay,
EnableDirectStream = request.EnableDirectStream, EnableDirectStream = request.EnableDirectStream,
ForceDirectPlayRemoteMediaSource = request.ForceDirectPlayRemoteMediaSource,
ItemId = request.Id, ItemId = request.Id,
MaxAudioChannels = request.MaxAudioChannels, MaxAudioChannels = request.MaxAudioChannels,
MaxStreamingBitrate = request.MaxStreamingBitrate, MaxStreamingBitrate = request.MaxStreamingBitrate,
@ -199,7 +198,8 @@ namespace MediaBrowser.Api.Playback
StartTimeTicks = request.StartTimeTicks, StartTimeTicks = request.StartTimeTicks,
SubtitleStreamIndex = request.SubtitleStreamIndex, SubtitleStreamIndex = request.SubtitleStreamIndex,
UserId = request.UserId, UserId = request.UserId,
OpenToken = mediaSource.OpenToken OpenToken = mediaSource.OpenToken,
AllowMediaProbe = request.AllowMediaProbe
}).ConfigureAwait(false); }).ConfigureAwait(false);

View File

@ -20,10 +20,7 @@ namespace MediaBrowser.Controller.Library
/// <summary> /// <summary>
/// Opens the media source. /// Opens the media source.
/// </summary> /// </summary>
/// <param name="openToken">The open token.</param> Task<Tuple<MediaSourceInfo,IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken);
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;MediaSourceInfo&gt;.</returns>
Task<Tuple<MediaSourceInfo,IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Closes the media source. /// Closes the media source.

View File

@ -17,13 +17,13 @@ namespace MediaBrowser.Model.MediaInfo
public bool EnableDirectPlay { get; set; } public bool EnableDirectPlay { get; set; }
public bool EnableDirectStream { get; set; } public bool EnableDirectStream { get; set; }
public bool ForceDirectPlayRemoteMediaSource { get; set; } public bool AllowMediaProbe { get; set; }
public LiveStreamRequest() public LiveStreamRequest()
{ {
ForceDirectPlayRemoteMediaSource = true;
EnableDirectPlay = true; EnableDirectPlay = true;
EnableDirectStream = true; EnableDirectStream = true;
AllowMediaProbe = true;
} }
public LiveStreamRequest(AudioOptions options) public LiveStreamRequest(AudioOptions options)

View File

@ -27,19 +27,19 @@ namespace MediaBrowser.Model.MediaInfo
public bool EnableDirectPlay { get; set; } public bool EnableDirectPlay { get; set; }
public bool EnableDirectStream { get; set; } public bool EnableDirectStream { get; set; }
public bool EnableTranscoding { get; set; } public bool EnableTranscoding { get; set; }
public bool ForceDirectPlayRemoteMediaSource { get; set; }
public bool AllowVideoStreamCopy { get; set; } public bool AllowVideoStreamCopy { get; set; }
public bool AllowAudioStreamCopy { get; set; } public bool AllowAudioStreamCopy { get; set; }
public bool AutoOpenLiveStream { get; set; } public bool AutoOpenLiveStream { get; set; }
public bool AllowMediaProbe { get; set; }
public PlaybackInfoRequest() public PlaybackInfoRequest()
{ {
ForceDirectPlayRemoteMediaSource = true;
EnableDirectPlay = true; EnableDirectPlay = true;
EnableDirectStream = true; EnableDirectStream = true;
EnableTranscoding = true; EnableTranscoding = true;
AllowVideoStreamCopy = true; AllowVideoStreamCopy = true;
AllowAudioStreamCopy = true; AllowAudioStreamCopy = true;
AllowMediaProbe = true;
} }
} }
} }

View File

@ -71,11 +71,11 @@
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL"> <Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll</HintPath> <HintPath>..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL"> <Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.6\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath> <HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.7\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />

View File

@ -6,6 +6,6 @@
<package id="SharpCompress" version="0.14.0" targetFramework="net46" /> <package id="SharpCompress" version="0.14.0" targetFramework="net46" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" /> <package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
<package id="SkiaSharp" version="1.58.0" targetFramework="net46" /> <package id="SkiaSharp" version="1.58.0" targetFramework="net46" />
<package id="SQLitePCLRaw.core" version="1.1.6" targetFramework="net46" /> <package id="SQLitePCLRaw.core" version="1.1.7" targetFramework="net46" />
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.6" targetFramework="net46" /> <package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.7" targetFramework="net46" />
</packages> </packages>

View File

@ -770,16 +770,39 @@ namespace MediaBrowser.ServerApplication
try try
{ {
var subkey = Environment.Is64BitProcess RegistryKey key;
? "SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64"
: "SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86";
using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default) if (Environment.Is64BitProcess)
.OpenSubKey(subkey))
{ {
if (ndpKey != null && ndpKey.GetValue("Version") != null) key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
.OpenSubKey("SOFTWARE\\Classes\\Installer\\Dependencies\\{d992c12e-cab2-426f-bde3-fb8c53950b0d}");
if (key == null)
{ {
var installedVersion = ((string)ndpKey.GetValue("Version")).TrimStart('v'); key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
.OpenSubKey("SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64");
}
}
else
{
key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
.OpenSubKey("SOFTWARE\\Classes\\Installer\\Dependencies\\{e2803110-78b3-4664-a479-3611a381656a}");
if (key == null)
{
key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
.OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86");
}
}
if (key != null)
{
using (key)
{
var version = key.GetValue("Version");
if (version != null)
{
var installedVersion = ((string)version).TrimStart('v');
if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase)) if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase))
{ {
return; return;
@ -787,6 +810,7 @@ namespace MediaBrowser.ServerApplication
} }
} }
} }
}
catch (Exception ex) catch (Exception ex)
{ {
logger.ErrorException("Error getting .NET Framework version", ex); logger.ErrorException("Error getting .NET Framework version", ex);

View File

@ -92,11 +92,11 @@
<HintPath>..\packages\SkiaSharp.1.58.0\lib\net45\SkiaSharp.dll</HintPath> <HintPath>..\packages\SkiaSharp.1.58.0\lib\net45\SkiaSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL"> <Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll</HintPath> <HintPath>..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL"> <Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.6\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath> <HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.7\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />

View File

@ -5,6 +5,6 @@
<package id="SharpCompress" version="0.14.0" targetFramework="net462" /> <package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net462" /> <package id="SimpleInjector" version="4.0.8" targetFramework="net462" />
<package id="SkiaSharp" version="1.58.0" targetFramework="net462" /> <package id="SkiaSharp" version="1.58.0" targetFramework="net462" />
<package id="SQLitePCLRaw.core" version="1.1.6" targetFramework="net462" /> <package id="SQLitePCLRaw.core" version="1.1.7" targetFramework="net462" />
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.6" targetFramework="net462" /> <package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.7" targetFramework="net462" />
</packages> </packages>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.704</version> <version>3.0.705</version>
<title>Emby.Common</title> <title>Emby.Common</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.704</version> <version>3.0.705</version>
<title>Emby.Server.Core</title> <title>Emby.Server.Core</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description> <description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright> <copyright>Copyright © Emby 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.704" /> <dependency id="MediaBrowser.Common" version="3.0.705" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

View File

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.22.1")] [assembly: AssemblyVersion("3.2.22.2")]