summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs35
5 files changed, 64 insertions, 8 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
index 477392a05..bbfed6f4e 100644
--- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
+++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
@@ -97,6 +97,7 @@
<Compile Include="Isolation\BackgroundServiceConnector.cs" />
<Compile Include="Isolation\IsolatedEncodeService.cs" />
<Compile Include="LibHb\AudioVideoHelpers.cs" />
+ <Compile Include="Model\VideoScaler.cs" />
<Compile Include="Services\Interfaces\IEncodeServiceWrapper.cs" />
<Compile Include="Services\Interfaces\IHbServiceCallback.cs" />
<Compile Include="Services\Interfaces\IServerService.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs
new file mode 100644
index 000000000..9772494cf
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs
@@ -0,0 +1,28 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="VideoScaler.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>
+// The different scaling modes available in HandBrake
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The different scaling modes available in HandBrake
+ /// </summary>
+ public enum VideoScaler
+ {
+ [Display(Name = "Lanczos")]
+ Lanczos = 0,
+
+ // [Display(Name = "Bicubic")]
+ // Bicubic,
+
+ [Display(Name = "Bicubic (OpenCL)")]
+ BicubicCl,
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
index 959ab1b1b..58f67401e 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
@@ -324,7 +324,9 @@ namespace HandBrake.ApplicationServices.Services.Base
userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding));
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva),
+ userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode) == VideoScaler.BicubicCl);
this.logBuffer = new StringBuilder();
this.logBuffer.AppendLine(String.Format("CLI Query: {0}", query));
this.logBuffer.AppendLine(String.Format("User Query: {0}", encodeQueueTask.CustomQuery));
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
index 9e95b31cd..5ad95d08e 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
@@ -143,7 +143,9 @@ namespace HandBrake.ApplicationServices.Services
userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding));
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva),
+ userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode) == VideoScaler.BicubicCl);
ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, query)
{
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index 92cbdf4aa..9b007a618 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -46,10 +46,16 @@ namespace HandBrake.ApplicationServices.Utilities
/// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
+ /// <param name="enableHwd">
+ /// The enable Hwd.
+ /// </param>
+ /// <param name="enableOpenCL">
+ /// The enable Open CL.
+ /// </param>
/// <returns>
/// A Cli Query
/// </returns>
- public static string GenerateQuery(EncodeTask task, int previewScanCount, int verbosity, bool disableLibDvdNav, bool disableQsvDecode)
+ public static string GenerateQuery(EncodeTask task, int previewScanCount, int verbosity, bool disableLibDvdNav, bool disableQsvDecode, bool enableHwd, bool enableOpenCL)
{
if (string.IsNullOrEmpty(task.Source))
{
@@ -59,7 +65,7 @@ namespace HandBrake.ApplicationServices.Utilities
string query = string.Empty;
query += SourceQuery(task, null, null, previewScanCount);
query += DestinationQuery(task);
- query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode);
+ query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode, enableHwd, enableOpenCL);
return query;
}
@@ -96,7 +102,7 @@ namespace HandBrake.ApplicationServices.Utilities
string query = string.Empty;
query += SourceQuery(task, duration, startAtPreview, previewScanCount);
query += DestinationQuery(task);
- query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode);
+ query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode, false, false);
return query;
}
@@ -121,10 +127,16 @@ namespace HandBrake.ApplicationServices.Utilities
/// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
+ /// <param name="enableHwd">
+ /// The enable Hwd.
+ /// </param>
+ /// <param name="enableOpenCL">
+ /// The enable Open CL.
+ /// </param>
/// <returns>
/// The CLI query for the Tabbed section of the main window UI
/// </returns>
- private static string GenerateTabbedComponentsQuery(EncodeTask task, bool enableFilters, int verbosity, bool disableLibDvdNav, bool disableQsvDecode)
+ private static string GenerateTabbedComponentsQuery(EncodeTask task, bool enableFilters, int verbosity, bool disableLibDvdNav, bool disableQsvDecode, bool enableHwd, bool enableOpenCL)
{
string query = string.Empty;
@@ -154,7 +166,7 @@ namespace HandBrake.ApplicationServices.Utilities
query += AdvancedQuery(task);
// Extra Settings
- query += ExtraSettings(verbosity, disableLibDvdNav, disableQsvDecode);
+ query += ExtraSettings(verbosity, disableLibDvdNav, disableQsvDecode, enableHwd, enableOpenCL);
return query;
}
@@ -1024,10 +1036,16 @@ namespace HandBrake.ApplicationServices.Utilities
/// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
+ /// <param name="enableHwd">
+ /// The enable Hwd.
+ /// </param>
+ /// <param name="enableOpenCL">
+ /// The enable Open CL.
+ /// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
- private static string ExtraSettings(int verbosity, bool disableLibdvdNav, bool disableQsvDecode)
+ private static string ExtraSettings(int verbosity, bool disableLibdvdNav, bool disableQsvDecode, bool enableHwd, bool enableOpenCL)
{
string query = string.Empty;
@@ -1041,6 +1059,11 @@ namespace HandBrake.ApplicationServices.Utilities
if (disableQsvDecode)
query += " --disable-qsv-decoding";
+ if (enableOpenCL)
+ query += " -P ";
+
+ if (enableHwd)
+ query += " -U ";
return query;
}