diff options
author | sr55 <[email protected]> | 2015-01-04 19:51:59 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-04 19:51:59 +0000 |
commit | 7856f5760bda5c33e86ad48c78bcc473f9597f96 (patch) | |
tree | c92c90fc8515db249dbd6b0569360f124e7f98a1 /win/CS | |
parent | 207a1c9599e13f9790a70b4784d290899d45bab8 (diff) |
WinGui: Further fixes to libhb json encoding. FPS and Anamorphic should now work.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6684 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
9 files changed, 294 insertions, 111 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index 6ae5d1f60..0da939e19 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -217,7 +217,13 @@ namespace HandBrake.ApplicationServices.Services.Encode throw new Exception("Unable to get title for encoding. Encode Failed.");
}
- Interop.Model.Scan.Title scannedTitle = new Interop.Model.Scan.Title { Resolution = new Size(title.Resolution.Width, title.Resolution.Height), ParVal = new Size(title.ParVal.Width, title.ParVal.Height) };
+ Interop.Model.Scan.Title scannedTitle = new Interop.Model.Scan.Title
+ {
+ Resolution = new Size(title.Resolution.Width, title.Resolution.Height),
+ ParVal = new Size(title.ParVal.Width, title.ParVal.Height),
+ FramerateDenominator = title.FramerateDenominator,
+ FramerateNumerator = title.FramerateNumerator,
+ };
// TODO fix this tempory hack to pass in the required title information into the factory.
instance.StartEncode(encodeJob, scannedTitle, job.Configuration.PreviewScanCount);
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index d857e75f5..d72b07cbd 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -486,7 +486,9 @@ namespace HandBrake.ApplicationServices.Services.Scan Fps = title.Framerate,
SourceName = title.Path,
MainTitle = title.TitleNumber == featureTitle,
- Playlist = title.InputType == InputType.Bluray ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null
+ Playlist = title.InputType == InputType.Bluray ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null,
+ FramerateNumerator = title.FramerateNumerator,
+ FramerateDenominator = title.FramerateDenominator
};
foreach (Interop.Model.Scan.Chapter chapter in title.Chapters)
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs index 2757fe093..9dce3858a 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs @@ -100,6 +100,16 @@ namespace HandBrake.ApplicationServices.Services.Scan.Model public double Fps { get; set; }
/// <summary>
+ /// Gets or sets the video frame rate numerator.
+ /// </summary>
+ public int FramerateNumerator { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video frame rate denominator.
+ /// </summary>
+ public int FramerateDenominator { get; set; }
+
+ /// <summary>
/// Gets or sets a value indicating whether this is a MainTitle.
/// </summary>
public bool MainTitle { get; set; }
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs index 970fb5c97..236cac712 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs @@ -175,6 +175,7 @@ namespace HandBrake.ApplicationServices.Utilities // Video Settings
profile.Framerate = work.Framerate.HasValue ? work.Framerate.Value : 0;
profile.ConstantFramerate = work.FramerateMode == FramerateMode.CFR;
+ profile.PeakFramerate = work.FramerateMode == FramerateMode.PFR;
profile.Quality = work.Quality.HasValue ? work.Quality.Value : 0;
profile.VideoBitrate = work.VideoBitrate.HasValue ? work.VideoBitrate.Value : 0;
profile.VideoEncodeRateType = work.VideoEncodeRateType;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters/Converters.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters/Converters.cs index a0fc06409..100ea1554 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters/Converters.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters/Converters.cs @@ -17,7 +17,6 @@ namespace HandBrake.Interop.Converters using HandBrake.Interop.Helpers;
using HandBrake.Interop.Model;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Scan;
/// <summary>
/// Converters for various encoding values.
@@ -68,15 +67,19 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts a native HB encoder structure to an Encoder model.
/// </summary>
- /// <param name="encoder">The structure to convert.</param>
- /// <returns>The converted model.</returns>
+ /// <param name="encoder">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted model.
+ /// </returns>
public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)
{
return new HBVideoEncoder
{
- Id = encoder.codec,
- ShortName = encoder.short_name,
- DisplayName = encoder.name,
+ Id = encoder.codec,
+ ShortName = encoder.short_name,
+ DisplayName = encoder.name,
CompatibleContainers = encoder.muxers
};
}
@@ -84,19 +87,23 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts a native HB encoder structure to an Encoder model.
/// </summary>
- /// <param name="encoder">The structure to convert.</param>
- /// <returns>The converted model.</returns>
+ /// <param name="encoder">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted model.
+ /// </returns>
public static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)
{
var result = new HBAudioEncoder
{
- Id = encoder.codec,
- ShortName = encoder.short_name,
- DisplayName = encoder.name,
- CompatibleContainers = encoder.muxers,
- QualityLimits = Encoders.GetAudioQualityLimits(encoder.codec),
- DefaultQuality = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
- CompressionLimits = Encoders.GetAudioCompressionLimits(encoder.codec),
+ Id = encoder.codec,
+ ShortName = encoder.short_name,
+ DisplayName = encoder.name,
+ CompatibleContainers = encoder.muxers,
+ QualityLimits = Encoders.GetAudioQualityLimits(encoder.codec),
+ DefaultQuality = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
+ CompressionLimits = Encoders.GetAudioCompressionLimits(encoder.codec),
DefaultCompression =
HBFunctions.hb_audio_compression_get_default((uint)encoder.codec)
};
@@ -107,13 +114,17 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts a native HB rate structure to an HBRate object.
/// </summary>
- /// <param name="rate">The structure to convert.</param>
- /// <returns>The converted rate object.</returns>
+ /// <param name="rate">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted rate object.
+ /// </returns>
public static HBRate NativeToRate(hb_rate_s rate)
{
return new HBRate
{
- Name = rate.name,
+ Name = rate.name,
Rate = rate.rate
};
}
@@ -121,14 +132,18 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts a native HB mixdown structure to a Mixdown model.
/// </summary>
- /// <param name="mixdown">The structure to convert.</param>
- /// <returns>The converted model.</returns>
+ /// <param name="mixdown">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted model.
+ /// </returns>
public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown)
{
return new HBMixdown
{
- Id = mixdown.amixdown,
- ShortName = mixdown.short_name,
+ Id = mixdown.amixdown,
+ ShortName = mixdown.short_name,
DisplayName = mixdown.name
};
}
@@ -136,15 +151,19 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts a native HB container structure into an HBContainer object.
/// </summary>
- /// <param name="container">The structure to convert.</param>
- /// <returns>The converted structure.</returns>
+ /// <param name="container">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted structure.
+ /// </returns>
public static HBContainer NativeToContainer(hb_container_s container)
{
return new HBContainer
{
- DisplayName = container.name,
- ShortName = container.short_name,
- DefaultExtension = container.default_extension,
+ DisplayName = container.name,
+ ShortName = container.short_name,
+ DefaultExtension = container.default_extension,
Id = container.format
};
}
@@ -152,16 +171,20 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts a native language structure to a Language object.
/// </summary>
- /// <param name="language">The structure to convert.</param>
- /// <returns>The converted structure.</returns>
+ /// <param name="language">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted structure.
+ /// </returns>
public static Language NativeToLanguage(iso639_lang_t language)
{
string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name);
string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name);
return new Language
{
- Code = language.iso639_2,
- EnglishName = englishName,
+ Code = language.iso639_2,
+ EnglishName = englishName,
NativeName = nativeName
};
}
@@ -169,8 +192,12 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here.
/// </summary>
- /// <param name="pts">The PTS to convert.</param>
- /// <returns>The timespan for it.</returns>
+ /// <param name="pts">
+ /// The PTS to convert.
+ /// </param>
+ /// <returns>
+ /// The timespan for it.
+ /// </returns>
public static TimeSpan PtsToTimeSpan(ulong pts)
{
return TimeSpan.FromTicks((long)((pts * 10000000) / 90000));
@@ -179,8 +206,12 @@ namespace HandBrake.Interop.Converters /// <summary>
/// Converts the PTS amount to seconds.
/// </summary>
- /// <param name="pts">The PTS to convert.</param>
- /// <returns>The corresponding number of seconds.</returns>
+ /// <param name="pts">
+ /// The PTS to convert.
+ /// </param>
+ /// <returns>
+ /// The corresponding number of seconds.
+ /// </returns>
public static double PtsToSeconds(ulong pts)
{
return (double)pts / 90000;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index 8eafea9f2..d3bbb19f8 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -213,8 +213,10 @@ namespace HandBrake.Interop.HbLib public static extern int hb_subtitle_can_pass(int source, int mux);
+ // int hb_video_framerate_get_from_name(const char *name)
+ [DllImport("hb.dll", EntryPoint = "hb_video_framerate_get_from_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_video_framerate_get_from_name(IntPtr name);
-//int hb_video_framerate_get_from_name(const char *name);
//const char* hb_video_framerate_get_name(int framerate);
//const char* hb_video_framerate_sanitize_name(const char *name);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs index 0c074262d..9393b0e16 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs @@ -11,6 +11,7 @@ namespace HandBrake.Interop.Json.Factories {
using System;
using System.Collections.Generic;
+ using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
@@ -50,7 +51,7 @@ namespace HandBrake.Interop.Json.Factories Audio = CreateAudio(job),
Destination = CreateDestination(job),
Filter = CreateFilter(job, title),
- PAR = CreatePAR(job),
+ PAR = CreatePAR(job, title),
MetaData = CreateMetaData(job),
Source = CreateSource(job),
Subtitle = CreateSubtitle(job),
@@ -131,12 +132,16 @@ namespace HandBrake.Interop.Json.Factories /// <param name="job">
/// The Job
/// </param>
+ /// <param name="title">
+ /// The title.
+ /// </param>
/// <returns>
/// The produced PAR object.
/// </returns>
- private static PAR CreatePAR(EncodeJob job)
+ private static PAR CreatePAR(EncodeJob job, Title title)
{
- return new PAR { Num = job.EncodingProfile.PixelAspectX, Den = job.EncodingProfile.PixelAspectY };
+ Geometry resultGeometry = AnamorphicFactory.CreateGeometry(job, title, AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH);
+ return new PAR { Num = resultGeometry.PAR.Num, Den = resultGeometry.PAR.Den };
}
/// <summary>
@@ -360,8 +365,28 @@ namespace HandBrake.Interop.Json.Factories filter.FilterList.Add(filterItem);
}
- // VFR / CFR TODO Setup the framerate shaper.
- FilterList framerateShaper = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_VFR, Settings = string.Empty };
+ // VFR / CFR
+ int fm = job.EncodingProfile.ConstantFramerate ? 1 : job.EncodingProfile.PeakFramerate ? 2 : 0;
+ IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.EncodingProfile.Framerate.ToString(CultureInfo.InvariantCulture));
+ int vrate = HBFunctions.hb_video_framerate_get_from_name(frameratePrt);
+
+ int num;
+ int den;
+ if (vrate > 0)
+ {
+ num = 27000000;
+ den = vrate;
+ }
+ else
+ {
+ // cfr or pfr flag with no rate specified implies use the title rate.
+ num = title.FramerateNumerator;
+ den = title.FramerateDenominator;
+ }
+
+ string framerateString = string.Format("{0}:{1}:{2}", fm, num, den); // filter_cfr, filter_vrate.num, filter_vrate.den
+
+ FilterList framerateShaper = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_VFR, Settings = framerateString };
filter.FilterList.Add(framerateShaper);
// Deblock
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs index 036617ce0..8a4c737f0 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs @@ -9,15 +9,14 @@ namespace HandBrake.Interop.Model
{
- using System;
- using System.Collections.Generic;
- using System.Linq;
+ using System.Collections.Generic;
+ using System.Linq;
- using HandBrake.Interop.Converters;
- using HandBrake.Interop.HbLib;
- using HandBrake.Interop.Helpers;
- using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Scan;
+ using HandBrake.Interop.Converters;
+ using HandBrake.Interop.HbLib;
+ using HandBrake.Interop.Helpers;
+ using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Scan;
/// <summary>
/// The encoders.
@@ -193,8 +192,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the audio encoder with the specified short name.
/// </summary>
- /// <param name="shortName">The name of the audio encoder.</param>
- /// <returns>The requested audio encoder.</returns>
+ /// <param name="shortName">
+ /// The name of the audio encoder.
+ /// </param>
+ /// <returns>
+ /// The requested audio encoder.
+ /// </returns>
public static HBAudioEncoder GetAudioEncoder(string shortName)
{
return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName);
@@ -203,8 +206,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the audio encoder with the specified codec ID.
/// </summary>
- /// <param name="codecId">The ID of the audio encoder.</param>
- /// <returns>The requested audio encoder.</returns>
+ /// <param name="codecId">
+ /// The ID of the audio encoder.
+ /// </param>
+ /// <returns>
+ /// The requested audio encoder.
+ /// </returns>
public static HBAudioEncoder GetAudioEncoder(int codecId)
{
return AudioEncoders.SingleOrDefault(e => e.Id == codecId);
@@ -213,8 +220,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the video encoder with the specified short name.
/// </summary>
- /// <param name="shortName">The name of the video encoder.</param>
- /// <returns>The requested video encoder.</returns>
+ /// <param name="shortName">
+ /// The name of the video encoder.
+ /// </param>
+ /// <returns>
+ /// The requested video encoder.
+ /// </returns>
public static HBVideoEncoder GetVideoEncoder(string shortName)
{
return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName);
@@ -223,8 +234,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the mixdown with the specified short name.
/// </summary>
- /// <param name="shortName">The name of the mixdown.</param>
- /// <returns>The requested mixdown.</returns>
+ /// <param name="shortName">
+ /// The name of the mixdown.
+ /// </param>
+ /// <returns>
+ /// The requested mixdown.
+ /// </returns>
public static HBMixdown GetMixdown(string shortName)
{
return Mixdowns.SingleOrDefault(m => m.ShortName == shortName);
@@ -233,8 +248,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the container with the specified short name.
/// </summary>
- /// <param name="shortName">The name of the container.</param>
- /// <returns>The requested container.</returns>
+ /// <param name="shortName">
+ /// The name of the container.
+ /// </param>
+ /// <returns>
+ /// The requested container.
+ /// </returns>
public static HBContainer GetContainer(string shortName)
{
return Containers.SingleOrDefault(c => c.ShortName == shortName);
@@ -243,10 +262,18 @@ namespace HandBrake.Interop.Model /// <summary>
/// Determines if the given encoder is compatible with the given track.
/// </summary>
- /// <param name="track">The audio track to examine.</param>
- /// <param name="encoder">The encoder to examine.</param>
- /// <returns>True if the given encoder is comatible with the given audio track.</returns>
- /// <remarks>Only works with passthrough encoders.</remarks>
+ /// <param name="track">
+ /// The audio track to examine.
+ /// </param>
+ /// <param name="encoder">
+ /// The encoder to examine.
+ /// </param>
+ /// <returns>
+ /// True if the given encoder is comatible with the given audio track.
+ /// </returns>
+ /// <remarks>
+ /// Only works with passthrough encoders.
+ /// </remarks>
public static bool AudioEncoderIsCompatible(AudioTrack track, HBAudioEncoder encoder)
{
return (track.CodecId & encoder.Id) > 0;
@@ -255,9 +282,15 @@ namespace HandBrake.Interop.Model /// <summary>
/// Determines if the given mixdown supports the given channel layout.
/// </summary>
- /// <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>
+ /// <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)
{
return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0;
@@ -266,9 +299,15 @@ namespace HandBrake.Interop.Model /// <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>
+ /// <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;
@@ -277,9 +316,15 @@ namespace HandBrake.Interop.Model /// <summary>
/// Determines if DRC can be applied to the given track with the given encoder.
/// </summary>
- /// <param name="track">The track to apply DRC to.</param>
- /// <param name="encoder">The encoder to use for DRC.</param>
- /// <returns>True if DRC can be applied to the track with the given encoder.</returns>
+ /// <param name="track">
+ /// The track to apply DRC to.
+ /// </param>
+ /// <param name="encoder">
+ /// The encoder to use for DRC.
+ /// </param>
+ /// <returns>
+ /// True if DRC can be applied to the track with the given encoder.
+ /// </returns>
public static bool CanApplyDrc(AudioTrack track, HBAudioEncoder encoder)
{
return HBFunctions.hb_audio_can_apply_drc(track.CodecId, track.CodecParam, encoder.Id) > 0;
@@ -288,8 +333,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Determines if the given input audio codec can be passed through.
/// </summary>
- /// <param name="codecId">The input codec to consider.</param>
- /// <returns>True if the codec can be passed through.</returns>
+ /// <param name="codecId">
+ /// The input codec to consider.
+ /// </param>
+ /// <returns>
+ /// True if the codec can be passed through.
+ /// </returns>
public static bool CanPassthroughAudio(int codecId)
{
return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0;
@@ -298,10 +347,18 @@ namespace HandBrake.Interop.Model /// <summary>
/// Sanitizes a mixdown given the output codec and input channel layout.
/// </summary>
- /// <param name="mixdown">The desired mixdown.</param>
- /// <param name="encoder">The output encoder to be used.</param>
- /// <param name="layout">The input channel layout.</param>
- /// <returns>A sanitized mixdown value.</returns>
+ /// <param name="mixdown">
+ /// The desired mixdown.
+ /// </param>
+ /// <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, ulong layout)
{
int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id);
@@ -311,9 +368,15 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the default mixdown for the given audio encoder and channel layout.
/// </summary>
- /// <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>
+ /// <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, ulong layout)
{
int defaultMixdown = HBFunctions.hb_mixdown_get_default((uint)encoder.Id, layout);
@@ -323,10 +386,18 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the bitrate limits for the given audio codec, sample rate and mixdown.
/// </summary>
- /// <param name="encoder">The audio encoder used.</param>
- /// <param name="sampleRate">The sample rate used (Hz).</param>
- /// <param name="mixdown">The mixdown used.</param>
- /// <returns>Limits on the audio bitrate for the given settings.</returns>
+ /// <param name="encoder">
+ /// The audio encoder used.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The sample rate used (Hz).
+ /// </param>
+ /// <param name="mixdown">
+ /// The mixdown used.
+ /// </param>
+ /// <returns>
+ /// Limits on the audio bitrate for the given settings.
+ /// </returns>
public static BitrateLimits GetBitrateLimits(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
{
int low = 0;
@@ -340,8 +411,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the video quality limits for the given video codec.
/// </summary>
- /// <param name="encoder">The video encoder to check.</param>
- /// <returns>Limits on the video quality for the encoder.</returns>
+ /// <param name="encoder">
+ /// The video encoder to check.
+ /// </param>
+ /// <returns>
+ /// Limits on the video quality for the encoder.
+ /// </returns>
public static VideoQualityLimits GetVideoQualityLimits(HBVideoEncoder encoder)
{
float low = 0;
@@ -353,9 +428,9 @@ namespace HandBrake.Interop.Model return new VideoQualityLimits
{
- Low = low,
- High = high,
- Granularity = granularity,
+ Low = low,
+ High = high,
+ Granularity = granularity,
Ascending = direction == 0
};
}
@@ -363,11 +438,21 @@ namespace HandBrake.Interop.Model /// <summary>
/// Sanitizes an audio bitrate given the output codec, sample rate and mixdown.
/// </summary>
- /// <param name="audioBitrate">The desired audio bitrate.</param>
- /// <param name="encoder">The output encoder to be used.</param>
- /// <param name="sampleRate">The output sample rate to be used.</param>
- /// <param name="mixdown">The mixdown to be used.</param>
- /// <returns>A sanitized audio bitrate.</returns>
+ /// <param name="audioBitrate">
+ /// The desired audio bitrate.
+ /// </param>
+ /// <param name="encoder">
+ /// The output encoder to be used.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The output sample rate to be used.
+ /// </param>
+ /// <param name="mixdown">
+ /// The mixdown to be used.
+ /// </param>
+ /// <returns>
+ /// A sanitized audio bitrate.
+ /// </returns>
public static int SanitizeAudioBitrate(int audioBitrate, HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
{
return HBFunctions.hb_audio_bitrate_get_best((uint)encoder.Id, audioBitrate, sampleRate, mixdown.Id);
@@ -376,10 +461,18 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets the default audio bitrate for the given parameters.
/// </summary>
- /// <param name="encoder">The encoder to use.</param>
- /// <param name="sampleRate">The sample rate to use.</param>
- /// <param name="mixdown">The mixdown to use.</param>
- /// <returns>The default bitrate for these parameters.</returns>
+ /// <param name="encoder">
+ /// The encoder to use.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The sample rate to use.
+ /// </param>
+ /// <param name="mixdown">
+ /// The mixdown to use.
+ /// </param>
+ /// <returns>
+ /// The default bitrate for these parameters.
+ /// </returns>
public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
{
return HBFunctions.hb_audio_bitrate_get_default((uint) encoder.Id, sampleRate, mixdown.Id);
@@ -388,8 +481,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets limits on audio quality for a given encoder.
/// </summary>
- /// <param name="encoderId">The audio encoder ID.</param>
- /// <returns>Limits on the audio quality for the given encoder.</returns>
+ /// <param name="encoderId">
+ /// The audio encoder ID.
+ /// </param>
+ /// <returns>
+ /// Limits on the audio quality for the given encoder.
+ /// </returns>
internal static RangeLimits GetAudioQualityLimits(int encoderId)
{
float low = 0, high = 0, granularity = 0;
@@ -398,9 +495,9 @@ namespace HandBrake.Interop.Model return new RangeLimits
{
- Low = low,
- High = high,
- Granularity = granularity,
+ Low = low,
+ High = high,
+ Granularity = granularity,
Ascending = direction == 0
};
}
@@ -408,8 +505,12 @@ namespace HandBrake.Interop.Model /// <summary>
/// Gets limits on audio compression for a given encoder.
/// </summary>
- /// <param name="encoderId">The audio encoder ID.</param>
- /// <returns>Limits on the audio compression for the given encoder.</returns>
+ /// <param name="encoderId">
+ /// The audio encoder ID.
+ /// </param>
+ /// <returns>
+ /// Limits on the audio compression for the given encoder.
+ /// </returns>
internal static RangeLimits GetAudioCompressionLimits(int encoderId)
{
float low = 0, high = 0, granularity = 0;
@@ -418,9 +519,9 @@ namespace HandBrake.Interop.Model return new RangeLimits
{
- Low = low,
- High = high,
- Granularity = granularity,
+ Low = low,
+ High = high,
+ Granularity = granularity,
Ascending = direction == 0
};
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs index 82cbe55b1..581b9364a 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs @@ -287,6 +287,11 @@ namespace HandBrake.Interop.Model.Encoding /// Gets or sets a value indicating whether constant framerate.
/// </summary>
public bool ConstantFramerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether peak framerate.
+ /// </summary>
+ public bool PeakFramerate { get; set; }
#endregion
#region Audio
|