diff options
author | sr55 <[email protected]> | 2019-09-22 17:09:04 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-09-22 17:09:21 +0100 |
commit | 9552988c29ec0fff026528bb6501635783f5c22f (patch) | |
tree | 5c2eefeae4bd6fc5d04ff029b566a8ebbcee7cbc /win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs | |
parent | 63c732376f959699e0d199232dae8a08846f3595 (diff) |
WinGui:
- Add a non-static wrapper around HbFunctions.cs
- Add a Wrapper Provider that for now, returns only a direct in-process wrapper instance for libhb HbFunctions calls.
- Update all calls to use the new non-static wrapper provider / interface
Diffstat (limited to 'win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs')
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs b/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs index c63fde326..7ff81d407 100644 --- a/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs @@ -16,12 +16,23 @@ namespace HandBrake.Interop.Interop.Helpers using System.Text; using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; + using HandBrake.Interop.Interop.Providers; + using HandBrake.Interop.Interop.Providers.Interfaces; /// <summary> /// Helper utilities for native interop. /// </summary> internal static class InteropUtilities { + private static IHbFunctions hbFunctions; + + static InteropUtilities() + { + IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); + hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); + } + /// <summary> /// Reads the given native structure pointer. /// </summary> @@ -262,7 +273,7 @@ namespace HandBrake.Interop.Interop.Helpers // Assign the new pointer to the job pointer and tell HB to clean the job up. Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr); - HBFunctions.hb_job_close(nativeJobPtrPtr); + hbFunctions.hb_job_close(nativeJobPtrPtr); // Free the pointer we used. Marshal.FreeHGlobal(nativeJobPtrPtr); |