summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Encode
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-03-02 20:37:03 +0000
committersr55 <[email protected]>2016-03-02 20:37:03 +0000
commit6f51a235c3a44830a1ecd4cf4077f55dfe421ab1 (patch)
tree45a870eb763f7c88c274752c29646e9fa664f231 /win/CS/HandBrakeWPF/Services/Encode
parent8ec0816076e94468541b418d4439d00554a39c30 (diff)
WinGui: Updating the code to handle Deinterlace / Decomb / Rotation options for j45's latest change. Thanks John for the patch.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Encode')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs46
1 files changed, 9 insertions, 37 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
index 62a3faf81..be1b5e4c6 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
@@ -410,50 +410,20 @@ namespace HandBrakeWPF.Services.Encode.Factories
// Deinterlace
if (job.DeinterlaceFilter == DeinterlaceFilter.Deinterlace)
{
- string options;
- if (job.Deinterlace == Deinterlace.Fast)
- {
- options = "0";
- }
- else if (job.Deinterlace == Deinterlace.Slow)
- {
- options = "1";
- }
- else if (job.Deinterlace == Deinterlace.Slower)
- {
- options = "3";
- }
- else if (job.Deinterlace == Deinterlace.Bob)
- {
- options = "15";
- }
- else
- {
- options = job.CustomDeinterlace;
- }
+ IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)hb_filter_ids.HB_FILTER_DEINTERLACE, EnumHelper<Deinterlace>.GetShortName(job.Deinterlace), job.CustomDeinterlace);
+ string settings = Marshal.PtrToStringAnsi(settingsPtr);
- Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_DEINTERLACE, Settings = options };
+ Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_DEINTERLACE, Settings = settings };
filter.FilterList.Add(filterItem);
}
// Decomb
if (job.DeinterlaceFilter == DeinterlaceFilter.Decomb)
{
- string options;
- if (job.Decomb == Decomb.Fast)
- {
- options = "7:2:6:9:1:80";
- }
- else if (job.Decomb == Decomb.Bob)
- {
- options = "455";
- }
- else
- {
- options = job.CustomDecomb;
- }
+ IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)hb_filter_ids.HB_FILTER_DECOMB, EnumHelper<Decomb>.GetShortName(job.Decomb), job.CustomDecomb);
+ string settings = Marshal.PtrToStringAnsi(settingsPtr);
- Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_DECOMB, Settings = options };
+ Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_DECOMB, Settings = settings };
filter.FilterList.Add(filterItem);
}
@@ -512,7 +482,9 @@ namespace HandBrakeWPF.Services.Encode.Factories
// Rotate
if (job.Rotation != 0 || job.FlipVideo)
{
- Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_ROTATE, Settings = string.Format("{0}:{1}", job.Rotation, job.FlipVideo ? "1" : "0") };
+ IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)hb_filter_ids.HB_FILTER_ROTATE, string.Format("{0}:{1}", job.Rotation, job.FlipVideo ? "1" : "0"), string.Empty);
+ string settings = Marshal.PtrToStringAnsi(settingsPtr);
+ Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_ROTATE, Settings = settings };
filter.FilterList.Add(filterItem);
}