diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
3 files changed, 7 insertions, 2 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.
|