summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott <[email protected]>2015-09-24 20:44:55 +0100
committerScott <[email protected]>2015-09-24 20:44:55 +0100
commite7912cc00a8aa031e494bb6f0554939059da89d3 (patch)
treef095829845df7513f4e2815b9d0ea0a150e2a6ca
parentbf85b6277de7fc00bb66cc858d880e190aba59c4 (diff)
WinGui: Enable support for H.265 QuickSync support
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs40
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs8
4 files changed, 54 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs
index 80f9e33be..0bcbc18cf 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs
@@ -45,6 +45,10 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG);
public const uint HB_ACODEC_TRUEHD_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFTRUEHD);
+ // VideoEncoders
+ public const uint HB_VCODEC_QSV_H264 = 0x0000100;
+ public const uint HB_VCODEC_QSV_H265 = 0x0000200;
+ public const uint HB_VCODEC_QSV_MASK = 0x0000F00;
// Encode state
public const int HB_STATE_IDLE = 1;
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs
index 17ed82aef..4f30b5df3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs
@@ -26,6 +26,10 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
[ShortName("qsv_h264")]
QuickSync,
+ [Display(Name = "H.265 (Intel QSV)")]
+ [ShortName("qsv_h265")]
+ QuickSyncH265,
+
[Display(Name = "MPEG-4")]
[ShortName("mpeg4")]
FFMpeg,
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
index 2055fab90..ab11d71a9 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
@@ -1,4 +1,4 @@
-// --------------------------------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SystemInfo.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>
@@ -82,6 +82,44 @@ namespace HandBrake.ApplicationServices.Utilities
}
/// <summary>
+ /// Gets a value indicating whether is qsv available.
+ /// </summary>
+ public static bool IsQsvAvailableH264
+ {
+ get
+ {
+ try
+ {
+ return HBFunctions.hb_qsv_available() == NativeConstants.HB_VCODEC_QSV_H264;
+ }
+ 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 qsv available.
+ /// </summary>
+ public static bool IsQsvAvailableH265
+ {
+ get
+ {
+ try
+ {
+ return HBFunctions.hb_qsv_available() == NativeConstants.HB_VCODEC_QSV_H265;
+ }
+ catch (Exception)
+ {
+ // Silent failure. Typically this means the dll hasn't been built with --enable-qsv
+ return false;
+ }
+ }
+ }
+
+ /// <summary>
/// Gets the get gpu driver version.
/// </summary>
public static List<string> GetGPUInfo
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
index ffe11ffef..d0ef60775 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
@@ -57,11 +57,17 @@ namespace HandBrakeWPF.Converters.Video
encoders.Remove(VideoEncoder.VP8);
}
- if (!SystemInfo.IsQsvAvailable)
+ if (!SystemInfo.IsQsvAvailableH264)
{
encoders.Remove(VideoEncoder.QuickSync);
}
+ if (!SystemInfo.IsQsvAvailableH265)
+ {
+ encoders.Remove(VideoEncoder.QuickSyncH265);
+ }
+
+
return EnumHelper<VideoEncoder>.GetEnumDisplayValuesSubset(encoders);
}