expand on hardware decoding options

This commit is contained in:
Luke Pulverenti 2017-08-12 15:09:13 -04:00
parent b7867214ef
commit cf350f3b7e
7 changed files with 23 additions and 72 deletions

View File

@ -1590,14 +1590,10 @@ namespace Emby.Server.Implementations
/// <returns>Task{CheckForUpdateResult}.</returns>
public override async Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
{
var cacheLength = TimeSpan.FromHours(3);
var cacheLength = TimeSpan.FromHours(1);
var updateLevel = SystemUpdateLevel;
if (updateLevel == PackageVersionClass.Beta)
{
cacheLength = TimeSpan.FromHours(1);
}
else if (updateLevel == PackageVersionClass.Dev)
if (updateLevel != PackageVersionClass.Release)
{
cacheLength = TimeSpan.FromMinutes(5);
}

View File

@ -11,9 +11,6 @@ using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.IO;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.Data
{
@ -34,31 +31,9 @@ namespace Emby.Server.Implementations.Data
_appPaths = appPaths;
}
public string Name
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
get { return "Clean Database"; }
}
public string Description
{
get { return "Deletes obsolete content from the database."; }
}
public string Category
{
get { return "Library"; }
}
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
// Ensure these objects are lazy loaded.
// Without this there is a deadlock that will need to be investigated
var rootChildren = _libraryManager.RootFolder.Children.ToList();
rootChildren = _libraryManager.GetUserRootFolder().Children.ToList();
await CleanDeadItems(cancellationToken, progress).ConfigureAwait(false);
//await _itemRepo.UpdateInheritedValues(cancellationToken).ConfigureAwait(false);
return CleanDeadItems(cancellationToken, progress);
}
private async Task CleanDeadItems(CancellationToken cancellationToken, IProgress<double> progress)
@ -98,23 +73,5 @@ namespace Emby.Server.Implementations.Data
progress.Report(100);
}
/// <summary>
/// Creates the triggers that define when the task will run
/// </summary>
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{
return new[] {
// Every so often
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
};
}
public string Key
{
get { return "CleanDatabase"; }
}
}
}

View File

@ -116,7 +116,7 @@ namespace MediaBrowser.Controller.Entities.Movies
{
if (IsLegacyBoxSet)
{
return true;
return false;
}
return false;

View File

@ -1788,8 +1788,7 @@ namespace MediaBrowser.Controller.MediaEncoding
if (videoStream != null &&
!string.IsNullOrWhiteSpace(videoStream.Codec) &&
!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) &&
encodingOptions.EnableHardwareDecoding)
!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{
if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
{
@ -1797,7 +1796,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
case "avc":
case "h264":
if (_mediaEncoder.SupportsDecoder("h264_qsv"))
if (_mediaEncoder.SupportsDecoder("h264_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
{
// qsv decoder does not support 10-bit input
if ((videoStream.BitDepth ?? 8) > 8)
@ -1807,21 +1806,21 @@ namespace MediaBrowser.Controller.MediaEncoding
return "-c:v h264_qsv ";
}
break;
//case "hevc":
//case "h265":
// if (_mediaEncoder.SupportsDecoder("hevc_qsv"))
// {
// return "-c:v hevc_qsv ";
// }
// break;
case "hevc":
case "h265":
if (_mediaEncoder.SupportsDecoder("hevc_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase))
{
return "-c:v hevc_qsv ";
}
break;
case "mpeg2video":
if (_mediaEncoder.SupportsDecoder("mpeg2_qsv"))
if (_mediaEncoder.SupportsDecoder("mpeg2_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg2_qsv ";
}
break;
case "vc1":
if (_mediaEncoder.SupportsDecoder("vc1_qsv"))
if (_mediaEncoder.SupportsDecoder("vc1_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
{
return "-c:v vc1_qsv ";
}
@ -1835,14 +1834,14 @@ namespace MediaBrowser.Controller.MediaEncoding
{
case "avc":
case "h264":
if (_mediaEncoder.SupportsDecoder("h264_cuvid"))
if (_mediaEncoder.SupportsDecoder("h264_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
{
return "-c:v h264_cuvid ";
}
break;
case "hevc":
case "h265":
if (_mediaEncoder.SupportsDecoder("hevc_cuvid"))
if (_mediaEncoder.SupportsDecoder("hevc_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase))
{
return "-c:v hevc_cuvid ";
}

View File

@ -13,9 +13,10 @@ namespace MediaBrowser.Model.Configuration
public string VaapiDevice { get; set; }
public int H264Crf { get; set; }
public string H264Preset { get; set; }
public bool EnableHardwareDecoding { get; set; }
public bool EnableHardwareEncoding { get; set; }
public string[] HardwareDecodingCodecs { get; set; }
public EncodingOptions()
{
DownMixAudioBoost = 2;
@ -24,8 +25,9 @@ namespace MediaBrowser.Model.Configuration
EncodingThreadCount = -1;
VaapiDevice = "/dev/dri/card0";
H264Crf = 23;
EnableHardwareDecoding = true;
EnableHardwareEncoding = true;
HardwareDecodingCodecs = new string[] { "h264", "mpeg2video", "vc1" };
}
}
}

View File

@ -105,12 +105,9 @@ namespace MediaBrowser.Model.Sync
public string PrimaryImageItemId { get; set; }
public string PrimaryImageTag { get; set; }
public bool EnableAutomaticResync { get; set; }
public SyncJob()
{
RequestedItemIds = new List<string>();
EnableAutomaticResync = true;
}
}
}

View File

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