summaryrefslogtreecommitdiffstats
path: root/win/C#/interop/HandBrakeInstance.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/interop/HandBrakeInstance.cs')
-rw-r--r--win/C#/interop/HandBrakeInstance.cs20
1 files changed, 12 insertions, 8 deletions
diff --git a/win/C#/interop/HandBrakeInstance.cs b/win/C#/interop/HandBrakeInstance.cs
index c9d1e1a45..c50fc043b 100644
--- a/win/C#/interop/HandBrakeInstance.cs
+++ b/win/C#/interop/HandBrakeInstance.cs
@@ -1,16 +1,15 @@
-namespace HandBrake.Interop
+using HandBrake.Interop.Model;
+using HandBrake.Interop.Model.Encoding;
+using HandBrake.Interop.SourceData;
+
+namespace HandBrake.Interop
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
- using System.Text;
- using System.Timers;
- using System.Threading;
using System.Windows.Media.Imaging;
- using HandBrake.SourceData;
- using HandBrake.Interop;
/// <summary>
/// A wrapper for a HandBrake instance.
@@ -137,7 +136,7 @@
HbLib.hb_register_error_handler(errorCallback);
}
- this.hbHandle = HbLib.hb_init(verbosity, update_check: 0);
+ this.hbHandle = HbLib.hb_init(verbosity, 0);
}
/// <summary>
@@ -252,7 +251,7 @@
for (int i = 0; i < nativeJob.height; i++)
{
Marshal.Copy(managedBuffer, i * nativeJob.width * 4, ptr, nativeJob.width * 4);
- ptr = IntPtr.Add(ptr, bitmapData.Stride);
+ ptr = AddOffset(ptr, bitmapData.Stride);
}
bitmap.UnlockBits(bitmapData);
@@ -273,6 +272,11 @@
}
}
+ public static IntPtr AddOffset(IntPtr src, int offset)
+ {
+ return new IntPtr(src.ToInt64() + offset);
+ }
+
/// <summary>
/// Starts an encode with the given job.
/// </summary>