summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs5
-rw-r--r--win/CS/HandBrakeWPF/Services/Scan/LibScan.cs9
3 files changed, 14 insertions, 4 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
index dda3e39c7..d3830cb36 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
@@ -268,7 +268,7 @@ namespace HandBrake.ApplicationServices.Interop
/// An image with the requested preview.
/// </returns>
[HandleProcessCorruptedStateExceptions]
- public Bitmap GetPreview(PreviewSettings settings, int previewNumber)
+ public Bitmap GetPreview(PreviewSettings settings, int previewNumber, int deinterlace)
{
SourceTitle title = this.Titles.TitleList.FirstOrDefault(t => t.Index == settings.TitleNumber);
@@ -293,7 +293,7 @@ namespace HandBrake.ApplicationServices.Interop
};
// Fetch the image data from LibHb
- IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.hbHandle, settings.TitleNumber, previewNumber, ref uiGeometry, 0);
+ IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.hbHandle, settings.TitleNumber, previewNumber, ref uiGeometry, deinterlace);
hb_image_s image = InteropUtilities.ToStructureFromPtr<hb_image_s>(resultingImageStuct);
// Copy the filled image buffer to a managed array.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
index d0338aea5..acc182205 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs
@@ -97,10 +97,13 @@ namespace HandBrake.ApplicationServices.Interop.Interfaces
/// <param name="previewNumber">
/// The index of the preview to get (0-based).
/// </param>
+ /// <param name="deinterlace">
+ /// Enable basic deinterlace of preview images. 1 = on. 0 = off.
+ /// </param>
/// <returns>
/// An image with the requested preview.
/// </returns>
- Bitmap GetPreview(PreviewSettings job, int previewNumber);
+ Bitmap GetPreview(PreviewSettings job, int previewNumber, int deinterlace);
/// <summary>
/// Pauses the current encode.
diff --git a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
index de104924f..287732224 100644
--- a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
+++ b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
@@ -19,6 +19,7 @@ namespace HandBrakeWPF.Services.Scan
using HandBrake.ApplicationServices.Interop.Interfaces;
using HandBrake.ApplicationServices.Interop.Json.Scan;
using HandBrake.ApplicationServices.Interop.Model;
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrake.ApplicationServices.Interop.Model.Preview;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Logging;
@@ -206,7 +207,13 @@ namespace HandBrakeWPF.Services.Scan
PixelAspectY = job.PixelAspectY
};
- bitmapImage = BitmapUtilities.ConvertToBitmapImage(this.instance.GetPreview(settings, preview));
+ int deinterlaceOn = 0;
+ if (job.DeinterlaceFilter != DeinterlaceFilter.Off)
+ {
+ deinterlaceOn = 1;
+ }
+
+ bitmapImage = BitmapUtilities.ConvertToBitmapImage(this.instance.GetPreview(settings, preview, deinterlaceOn));
}
catch (AccessViolationException e)
{