summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop/HandBrakeInterop/Model
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/Model')
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs37
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Decomb.cs6
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Deinterlace.cs2
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs5
4 files changed, 28 insertions, 22 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs
index 5f894dda2..a5406a70a 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs
@@ -148,25 +148,26 @@ namespace HandBrake.Interop.Model
}
/// <summary>
- /// Finds the highest possible mixdown for a given audio encoder.
+ /// Determines if the given mixdown supports the given channel layout.
/// </summary>
- /// <param name="audioEncoder">The audio encoder in question.</param>
- /// <returns>The highest possible mixdown for that audio encoder.</returns>
- public static int GetMaxMixdownIndex(HBAudioEncoder audioEncoder)
+ /// <param name="mixdown">The mixdown to evaluate.</param>
+ /// <param name="layout">The channel layout to evaluate.</param>
+ /// <returns>True if the mixdown supports the given channel layout.</returns>
+ public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout)
{
- // To find best case scenario, pass in highest number of channels and 6-channel discrete mixdown.
- int maxMixdownId = HBFunctions.hb_get_best_mixdown((uint)audioEncoder.Id, NativeConstants.HB_INPUT_CH_LAYOUT_3F4R | NativeConstants.HB_INPUT_CH_LAYOUT_HAS_LFE, NativeConstants.HB_AMIXDOWN_6CH);
-
- for (int i = 0; i < Mixdowns.Count; i++)
- {
- if (Mixdowns[i].Id == maxMixdownId)
- {
- return i;
- }
- }
+ return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0;
+ }
- return -1;
- }
+ /// <summary>
+ /// Determines if the given encoder supports the given mixdown.
+ /// </summary>
+ /// <param name="mixdown">The mixdown to evaluate.</param>
+ /// <param name="encoder">The encoder to evaluate.</param>
+ /// <returns>True if the encoder supports the mixdown.</returns>
+ public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder)
+ {
+ return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint) encoder.Id) > 0;
+ }
/// <summary>
/// Sanitizes a mixdown given the output codec and input channel layout.
@@ -175,7 +176,7 @@ namespace HandBrake.Interop.Model
/// <param name="encoder">The output encoder to be used.</param>
/// <param name="layout">The input channel layout.</param>
/// <returns>A sanitized mixdown value.</returns>
- public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, int layout)
+ public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, ulong layout)
{
int sanitizedMixdown = HBFunctions.hb_get_best_mixdown((uint)encoder.Id, layout, mixdown.Id);
return Mixdowns.Single(m => m.Id == sanitizedMixdown);
@@ -187,7 +188,7 @@ namespace HandBrake.Interop.Model
/// <param name="encoder">The output codec to be used.</param>
/// <param name="layout">The input channel layout.</param>
/// <returns>The default mixdown for the given codec and channel layout.</returns>
- public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, int layout)
+ public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, ulong layout)
{
int defaultMixdown = HBFunctions.hb_get_default_mixdown((uint)encoder.Id, layout);
return Mixdowns.Single(m => m.Id == defaultMixdown);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Decomb.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Decomb.cs
index 2e98daf4a..7b03410d0 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Decomb.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Decomb.cs
@@ -13,8 +13,8 @@ namespace HandBrake.Interop.Model.Encoding
{
Off = 0,
Default,
- Custom,
- Bob,
- Fast
+ Fast,
+ Bob,
+ Custom
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Deinterlace.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Deinterlace.cs
index 5d51fe6d5..91d828576 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Deinterlace.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Deinterlace.cs
@@ -15,7 +15,7 @@ namespace HandBrake.Interop.Model.Encoding
Fast,
Slow,
Slower,
- Bob,
+ Bob,
Custom
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
index 25da728ef..952d9509a 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
@@ -9,6 +9,7 @@
namespace HandBrake.Interop.Model.Encoding
{
+ using System;
using System.Collections.Generic;
using HandBrake.Interop.Model;
@@ -64,6 +65,9 @@ namespace HandBrake.Interop.Model.Encoding
public bool TwoPass { get; set; }
public bool TurboFirstPass { get; set; }
public double Framerate { get; set; }
+ public bool ConstantFramerate { get; set; }
+
+ [Obsolete("This setting is obsolete. Use Framerate and ConstantFramerate instead.")]
public bool PeakFramerate { get; set; }
public List<AudioEncoding> AudioEncodings { get; set; }
@@ -117,6 +121,7 @@ namespace HandBrake.Interop.Model.Encoding
TwoPass = this.TwoPass,
TurboFirstPass = this.TurboFirstPass,
Framerate = this.Framerate,
+ ConstantFramerate = this.ConstantFramerate,
PeakFramerate = this.PeakFramerate,
AudioEncodings = new List<AudioEncoding>(this.AudioEncodings)