summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-01-15 14:31:40 +0000
committersr55 <[email protected]>2017-01-15 14:31:53 +0000
commitd90706da2eed392b6d5c26171bdde0e5425be9c0 (patch)
tree0e12221663343a98ee1c033134ac2d564ecb405f /win/CS
parentc72b80dcb7cb063b40c43a47761ba2919ef85c46 (diff)
WinGui: Use new hb_opencl_set_enable function. #496
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs3
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs2
-rw-r--r--win/CS/HandBrakeWPF/Services/Scan/LibScan.cs2
4 files changed, 8 insertions, 3 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
index 633c4e1fb..c39ad1534 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
@@ -217,11 +217,12 @@ namespace HandBrake.ApplicationServices.Interop
/// <param name="titleIndex">
/// The title index to scan (1-based, 0 for all titles).
/// </param>
- public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)
+ public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex, bool clEnabled = false)
{
this.previewCount = previewCount;
IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path);
+ HBFunctions.hb_opencl_set_enable(this.hbHandle, clEnabled ? 1 : 0);
HBFunctions.hb_scan(this.hbHandle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));
Marshal.FreeHGlobal(pathPtr);
@@ -388,6 +389,7 @@ namespace HandBrake.ApplicationServices.Interop
NullValueHandling = NullValueHandling.Ignore,
};
+ HBFunctions.hb_opencl_set_enable(this.hbHandle, encodeObject.Video.OpenCL ? 1 : 0);
string encode = JsonConvert.SerializeObject(encodeObject, Formatting.Indented, settings);
HBFunctions.hb_add_json(this.hbHandle, InteropUtilities.ToUtf8PtrFromString(encode));
HBFunctions.hb_start(this.hbHandle);
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
index d844217b0..cc3baa119 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
@@ -71,6 +71,9 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
[DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_dvd_set_dvdnav(int enable);
+ // void hb_opencl_set_enable(hb_handle_t* h, int enable_opencl);
+ [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_opencl_set_enable(IntPtr hbHandle, int enable);
/// Return Type: void
///param0: hb_handle_t*
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
index 4b540a770..3e756d228 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
@@ -135,7 +135,7 @@ namespace HandBrake.ApplicationServices.Interop.Interfaces
/// <param name="titleIndex">
/// The title index to scan (1-based, 0 for all titles).
/// </param>
- void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex);
+ void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex, bool clEnabled = false);
/// <summary>
/// Stops the current encode.
diff --git a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
index bd1f4cf12..2d875ca0c 100644
--- a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
+++ b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
@@ -245,7 +245,7 @@ namespace HandBrakeWPF.Services.Scan
HandBrakeUtils.SetDvdNav(!configuraiton.IsDvdNavDisabled);
this.ServiceLogMessage("Starting Scan ...");
- this.instance.StartScan(sourcePath.ToString(), previewCount, minDuration, title != 0 ? title : 0);
+ this.instance.StartScan(sourcePath.ToString(), previewCount, minDuration, title != 0 ? title : 0, configuraiton.ScalingMode == VideoScaler.BicubicCl);
if (this.ScanStarted != null)
this.ScanStarted(this, System.EventArgs.Empty);