]> granicus.if.org Git - handbrake/commitdiff
WinGui: Use new hb_opencl_set_enable function. #496
authorsr55 <sr55.hb@outlook.com>
Sun, 15 Jan 2017 14:31:40 +0000 (14:31 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 15 Jan 2017 14:32:16 +0000 (14:32 +0000)
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
win/CS/HandBrakeWPF/Services/Scan/LibScan.cs

index 633c4e1fb784f8b3e48ee26d2c3092fcfddbbba8..c39ad153465b1b4748abe5dabdc76001a139b42a 100644 (file)
@@ -217,11 +217,12 @@ namespace HandBrake.ApplicationServices.Interop
         /// <param name="titleIndex">\r
         /// The title index to scan (1-based, 0 for all titles).\r
         /// </param>\r
-        public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)\r
+        public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex, bool clEnabled = false)\r
         {\r
             this.previewCount = previewCount;\r
 \r
             IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path);\r
+            HBFunctions.hb_opencl_set_enable(this.hbHandle, clEnabled ? 1 : 0);\r
             HBFunctions.hb_scan(this.hbHandle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));\r
             Marshal.FreeHGlobal(pathPtr);\r
 \r
@@ -388,6 +389,7 @@ namespace HandBrake.ApplicationServices.Interop
                 NullValueHandling = NullValueHandling.Ignore,\r
             };\r
 \r
+            HBFunctions.hb_opencl_set_enable(this.hbHandle, encodeObject.Video.OpenCL ? 1 : 0);\r
             string encode = JsonConvert.SerializeObject(encodeObject, Formatting.Indented, settings);\r
             HBFunctions.hb_add_json(this.hbHandle, InteropUtilities.ToUtf8PtrFromString(encode));\r
             HBFunctions.hb_start(this.hbHandle);\r
index d844217b008e3e2ea1acd6770dd77ff8756319ba..cc3baa1191c1471173d0d8b2c90f577884ac4f04 100644 (file)
@@ -71,6 +71,9 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
         [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]\r
         public static extern void hb_dvd_set_dvdnav(int enable);\r
 \r
+        // void hb_opencl_set_enable(hb_handle_t* h, int enable_opencl);\r
+        [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_opencl_set_enable(IntPtr hbHandle, int enable);\r
 \r
         /// Return Type: void\r
         ///param0: hb_handle_t*\r
index 4b540a770f8c31a0944ea8733991acb75386f9aa..3e756d22865f4a0134cccbfd1a2a0fd9eb14d609 100644 (file)
@@ -135,7 +135,7 @@ namespace HandBrake.ApplicationServices.Interop.Interfaces
         /// <param name="titleIndex">\r
         /// The title index to scan (1-based, 0 for all titles).\r
         /// </param>\r
-        void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex);\r
+        void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex, bool clEnabled = false);\r
 \r
         /// <summary>\r
         /// Stops the current encode.\r
index bd1f4cf12974707f55eed0a980d1857cac8de821..2d875ca0c3445ad12a919f89093a76b85d6d7ffb 100644 (file)
@@ -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);