diff options
Diffstat (limited to 'win')
4 files changed, 33 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs index 99ab990ca..41af30f5e 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs @@ -9,9 +9,12 @@ namespace HandBrake.ApplicationServices.Utilities
{
+ using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
+ using HandBrake.Interop.HbLib;
+
using Microsoft.Win32;
/// <summary>
@@ -59,6 +62,25 @@ namespace HandBrake.ApplicationServices.Utilities }
/// <summary>
+ /// Gets a value indicating whether is qsv available.
+ /// </summary>
+ public static bool IsQsvAvailable
+ {
+ get
+ {
+ try
+ {
+ return HBFunctions.hb_qsv_available() == 1;
+ }
+ catch (Exception)
+ {
+ // Silent failure. Typically this means the dll hasn't been built with --enable-qsv
+ return false;
+ }
+ }
+ }
+
+ /// <summary>
/// Gets a value indicating whether is hsw or newer.
/// </summary>
public static bool IsHswOrNewer
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index 4afcf9b8b..861fdb82a 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -396,5 +396,9 @@ namespace HandBrake.Interop.HbLib [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level,
int width,
int height);
+
+
+ [DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_qsv_available();
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs index 412d53416..dc78ad1ca 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs @@ -1,5 +1,5 @@ // --------------------------------------------------------------------------------------------------------------------
-// <copyright file="x264QueueTooltipConverter.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="EncoderOptionsTooltipConverter.cs" company="HandBrake Project (http://handbrake.fr)">
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
// <summary>
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs index 6ec2dc964..e9fa3d7a4 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs @@ -50,11 +50,16 @@ namespace HandBrakeWPF.Converters.Video List<VideoEncoder> encoders = EnumHelper<VideoEncoder>.GetEnumList().ToList();
EncodeTask task = values[1] as EncodeTask;
- if (task != null && task.OutputFormat != OutputFormat.Mkv)
+ if (task != null && (task.OutputFormat != OutputFormat.Mkv || task.OutputFormat != OutputFormat.av_mkv))
{
encoders.Remove(VideoEncoder.Theora);
}
+ if (!SystemInfo.IsQsvAvailable)
+ {
+ encoders.Remove(VideoEncoder.QuickSync);
+ }
+
return EnumHelper<VideoEncoder>.GetEnumDisplayValuesSubset(encoders);
}
|