diff options
author | sr55 <[email protected]> | 2015-04-01 20:08:46 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-04-01 20:08:46 +0000 |
commit | 459e06e2e6099a882d0eff225fd36ddce02aab70 (patch) | |
tree | 3dc4e3e8e805012f9b764c777534f01efb8391fd /win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs | |
parent | c1fefaee7a3c8d4a35d1224ba19d7a7915e2e075 (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/HandBrakeUtils.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs index 577fbf0e6..098646ddd 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs @@ -16,6 +16,10 @@ namespace HandBrake.ApplicationServices.Interop using HandBrake.ApplicationServices.Interop.EventArgs;
using HandBrake.ApplicationServices.Interop.HbLib;
+ using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+ using HandBrake.ApplicationServices.Interop.Json.Shared;
+
+ using Newtonsoft.Json;
/// <summary>
/// HandBrake Interop Utilities
@@ -292,6 +296,19 @@ namespace HandBrake.ApplicationServices.Interop }
/// <summary>
+ /// Gets the final size and PAR of the video, given anamorphic inputs.
+ /// </summary>
+ /// <param name="anamorphicGeometry">Anamorphic inputs.</param>
+ /// <returns>The final size and PAR of the video.</returns>
+ public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry)
+ {
+ 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);
+ return JsonConvert.DeserializeObject<Geometry>(result);
+ }
+
+ /// <summary>
/// Sends the message logged event to any registered listeners.
/// </summary>
/// <param name="message">
|