summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Interop/Factories
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-04-01 20:08:46 +0000
committersr55 <[email protected]>2015-04-01 20:08:46 +0000
commit459e06e2e6099a882d0eff225fd36ddce02aab70 (patch)
tree3dc4e3e8e805012f9b764c777534f01efb8391fd /win/CS/HandBrake.ApplicationServices/Interop/Factories
parentc1fefaee7a3c8d4a35d1224ba19d7a7915e2e075 (diff)
WinGui: Some initial re-modelling in the JSON folder. Created a "Shared" folder which contains models that are used by anamorphic, encode and scan calls but are not different. Based on a patch by RandomEngy.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7033 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop/Factories')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs24
1 files changed, 4 insertions, 20 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs
index 2618fc4a8..abaa0fc25 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs
@@ -9,18 +9,14 @@
namespace HandBrake.ApplicationServices.Interop.Factories
{
- using System;
using System.Collections.Generic;
- using System.Runtime.InteropServices;
- using HandBrake.ApplicationServices.Interop.HbLib;
using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+ using HandBrake.ApplicationServices.Interop.Json.Shared;
using HandBrake.ApplicationServices.Interop.Model;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using Newtonsoft.Json;
-
/// <summary>
/// The anamorphic factory.
/// </summary>
@@ -49,7 +45,7 @@ namespace HandBrake.ApplicationServices.Interop.Factories
/// Keep Width or Height. (Not Display Aspect)
/// </param>
/// <returns>
- /// The <see cref="HandBrake.ApplicationServices.Interop.Json.Scan.Geometry"/>.
+ /// The <see cref="Geometry"/>.
/// </returns>
public static Geometry CreateGeometry(EncodeTask job, SourceVideoInfo title, KeepSetting keepWidthOrHeight) // Todo remove the need for these objects. Should use simpler objects.
{
@@ -58,7 +54,7 @@ namespace HandBrake.ApplicationServices.Interop.Factories
// Sanatise the Geometry First.
AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry
{
- SourceGeometry = new SourceGeometry
+ SourceGeometry = new Geometry()
{
Width = title.Resolution.Width,
Height = title.Resolution.Height,
@@ -93,19 +89,7 @@ namespace HandBrake.ApplicationServices.Interop.Factories
anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height };
}
- string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
- IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode));
- string result = Marshal.PtrToStringAnsi(json);
- AnamorphicResult resultGeometry = JsonConvert.DeserializeObject<AnamorphicResult>(result);
-
- // Setup the Destination Gemotry.
- Geometry geometry = new Geometry
- {
- Width = resultGeometry.Width,
- Height = resultGeometry.Height,
- PAR = resultGeometry.PAR
- };
- return geometry;
+ return HandBrakeUtils.GetAnamorphicSize(anamorphicGeometry);
}
}
}