diff options
Diffstat (limited to 'win/CS/HandBrake.Interop/Interop')
100 files changed, 441 insertions, 1214 deletions
diff --git a/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs index 303995194..bad483d78 100644 --- a/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="EncodeProgressEventArgs.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="EncodeProgressEventArgs.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs index 2359fff5d..22f74b0b3 100644 --- a/win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="MessageLoggedEventArgs.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="MessageLoggedEventArgs.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs index 8e87552a2..274210a9b 100644 --- a/win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="ScanProgressEventArgs.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="ScanProgressEventArgs.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs index a1d0207f3..24be1337b 100644 --- a/win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs +++ b/win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="AnamorphicFactory.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="AnamorphicFactory.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs index 83390faa0..dd2c64dd7 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakeEncoderHelpers.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakeEncoderHelpers.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -14,19 +14,12 @@ namespace HandBrake.Interop.Interop using System.Linq; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Model; using HandBrake.Interop.Interop.Model.Encoding; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; - /// <summary> - /// The encoders. - /// </summary> public static class HandBrakeEncoderHelpers { - private static IHbFunctions hbFunctions; private static List<HBAudioEncoder> audioEncoders; private static List<HBVideoEncoder> videoEncoders; private static List<HBRate> videoFramerates; @@ -40,9 +33,6 @@ namespace HandBrake.Interop.Interop /// </summary> static HandBrakeEncoderHelpers() { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - if (!HandBrakeUtils.IsInitialised()) { throw new Exception("Please Initialise with HandBrakeUtils.EnsureGlobalInit before using!"); @@ -58,7 +48,7 @@ namespace HandBrake.Interop.Interop { if (audioEncoders == null) { - audioEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBAudioEncoder>(hbFunctions.hb_audio_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToAudioEncoder); + audioEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBAudioEncoder>(HBFunctions.hb_audio_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToAudioEncoder); } return audioEncoders; @@ -74,7 +64,7 @@ namespace HandBrake.Interop.Interop { if (videoEncoders == null) { - videoEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBVideoEncoder>(hbFunctions.hb_video_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToVideoEncoder); + videoEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBVideoEncoder>(HBFunctions.hb_video_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToVideoEncoder); } return videoEncoders; @@ -90,7 +80,7 @@ namespace HandBrake.Interop.Interop { if (videoFramerates == null) { - videoFramerates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(hbFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); + videoFramerates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); } return videoFramerates; @@ -106,7 +96,7 @@ namespace HandBrake.Interop.Interop { if (mixdowns == null) { - mixdowns = InteropUtilities.ToListFromIterator<hb_mixdown_s, HBMixdown>(hbFunctions.hb_mixdown_get_next, HandBrakeUnitConversionHelpers.NativeToMixdown); + mixdowns = InteropUtilities.ToListFromIterator<hb_mixdown_s, HBMixdown>(HBFunctions.hb_mixdown_get_next, HandBrakeUnitConversionHelpers.NativeToMixdown); } return mixdowns; @@ -122,7 +112,7 @@ namespace HandBrake.Interop.Interop { if (audioBitrates == null) { - audioBitrates = InteropUtilities.ToListFromIterator<hb_rate_s, int>(hbFunctions.hb_audio_bitrate_get_next, b => b.rate); + audioBitrates = InteropUtilities.ToListFromIterator<hb_rate_s, int>(HBFunctions.hb_audio_bitrate_get_next, b => b.rate); } return audioBitrates; @@ -138,7 +128,7 @@ namespace HandBrake.Interop.Interop { if (audioSampleRates == null) { - audioSampleRates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(hbFunctions.hb_audio_samplerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); + audioSampleRates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_audio_samplerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); } return audioSampleRates; @@ -154,7 +144,7 @@ namespace HandBrake.Interop.Interop { if (containers == null) { - containers = InteropUtilities.ToListFromIterator<hb_container_s, HBContainer>(hbFunctions.hb_container_get_next, HandBrakeUnitConversionHelpers.NativeToContainer); + containers = InteropUtilities.ToListFromIterator<hb_container_s, HBContainer>(HBFunctions.hb_container_get_next, HandBrakeUnitConversionHelpers.NativeToContainer); } return containers; @@ -168,7 +158,7 @@ namespace HandBrake.Interop.Interop { get { - return hbFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.IMPORTSRT) > 0; + return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.IMPORTSRT) > 0; } } @@ -179,7 +169,7 @@ namespace HandBrake.Interop.Interop { get { - return hbFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.IMPORTSSA) > 0; + return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.IMPORTSSA) > 0; } } @@ -281,7 +271,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool SubtitleCanSetForcedOnly(int source) { - return hbFunctions.hb_subtitle_can_force(source) > 0; + return HBFunctions.hb_subtitle_can_force(source) > 0; } /// <summary> @@ -295,7 +285,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool SubtitleCanBurn(int source) { - return hbFunctions.hb_subtitle_can_burn(source) > 0; + return HBFunctions.hb_subtitle_can_burn(source) > 0; } /// <summary> @@ -312,7 +302,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool SubtitleCanPassthrough(int subtitleSourceType, int muxer) { - return hbFunctions.hb_subtitle_can_pass(subtitleSourceType, muxer) > 0; + return HBFunctions.hb_subtitle_can_pass(subtitleSourceType, muxer) > 0; } /// <summary> @@ -360,7 +350,7 @@ namespace HandBrake.Interop.Interop /// The encoder to examine. /// </param> /// <returns> - /// True if the given encoder is comatible with the given audio track. + /// True if the given encoder is compatible with the given audio track. /// </returns> /// <remarks> /// Only works with passthrough encoders. @@ -384,7 +374,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout) { - return hbFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0; + return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0; } /// <summary> @@ -401,7 +391,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder) { - return hbFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint)encoder.Id) > 0; + return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint)encoder.Id) > 0; } /// <summary> @@ -417,12 +407,15 @@ namespace HandBrake.Interop.Interop /// <returns>True if available.</returns> public static bool MixdownIsSupported(HBMixdown mixdown, HBAudioEncoder encoder, long channelLayout) { - return hbFunctions.hb_mixdown_is_supported(mixdown.Id, (uint)encoder.Id, (uint)channelLayout) > 0; + return HBFunctions.hb_mixdown_is_supported(mixdown.Id, (uint)encoder.Id, (uint)channelLayout) > 0; } /// <summary> /// Determines if DRC can be applied to the given track with the given encoder. /// </summary> + /// <param name="handle"> + /// The handle. + /// </param> /// <param name="trackNumber"> /// The track Number. /// </param> @@ -437,7 +430,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool CanApplyDrc(IntPtr handle, int trackNumber, HBAudioEncoder encoder, int title) { - return hbFunctions.hb_audio_can_apply_drc2(handle, title, trackNumber, encoder.Id) > 0; + return HBFunctions.hb_audio_can_apply_drc2(handle, title, trackNumber, encoder.Id) > 0; } /// <summary> @@ -476,7 +469,7 @@ namespace HandBrake.Interop.Interop return null; } - int sanitizedMixdown = hbFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id); + int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id); if (sanitizedMixdown != -1) { return Mixdowns.Single(m => m.Id == sanitizedMixdown); @@ -499,7 +492,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, ulong layout) { - int defaultMixdown = hbFunctions.hb_mixdown_get_default((uint)encoder.Id, layout); + int defaultMixdown = HBFunctions.hb_mixdown_get_default((uint)encoder.Id, layout); return Mixdowns.Single(m => m.Id == defaultMixdown); } @@ -511,7 +504,7 @@ namespace HandBrake.Interop.Interop /// <returns>The sanitized sample rate.</returns> public static int SanitizeSampleRate(HBAudioEncoder encoder, int sampleRate) { - return hbFunctions.hb_audio_samplerate_find_closest(sampleRate, (uint)encoder.Id); + return HBFunctions.hb_audio_samplerate_find_closest(sampleRate, (uint)encoder.Id); } /// <summary> @@ -534,7 +527,7 @@ namespace HandBrake.Interop.Interop int low = 0; int high = 0; - hbFunctions.hb_audio_bitrate_get_limits((uint)encoder.Id, sampleRate, mixdown.Id, ref low, ref high); + HBFunctions.hb_audio_bitrate_get_limits((uint)encoder.Id, sampleRate, mixdown.Id, ref low, ref high); return new BitrateLimits(low, high); } @@ -555,7 +548,7 @@ namespace HandBrake.Interop.Interop float granularity = 0; int direction = 0; - hbFunctions.hb_video_quality_get_limits((uint)encoder.Id, ref low, ref high, ref granularity, ref direction); + HBFunctions.hb_video_quality_get_limits((uint)encoder.Id, ref low, ref high, ref granularity, ref direction); return new VideoQualityLimits(low, high, granularity, direction == 0); } @@ -580,7 +573,7 @@ namespace HandBrake.Interop.Interop /// </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); + return HBFunctions.hb_audio_bitrate_get_best((uint)encoder.Id, audioBitrate, sampleRate, mixdown.Id); } /// <summary> @@ -600,7 +593,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) { - return hbFunctions.hb_audio_bitrate_get_default((uint)encoder.Id, sampleRate, mixdown.Id); + return HBFunctions.hb_audio_bitrate_get_default((uint)encoder.Id, sampleRate, mixdown.Id); } /// <summary> @@ -616,7 +609,7 @@ namespace HandBrake.Interop.Interop { float low = 0, high = 0, granularity = 0; int direction = 0; - hbFunctions.hb_audio_quality_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); + HBFunctions.hb_audio_quality_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); return new RangeLimits(direction == 0, granularity, high, low); } @@ -634,7 +627,7 @@ namespace HandBrake.Interop.Interop { float low = 0, high = 0, granularity = 0; int direction = 0; - hbFunctions.hb_audio_compression_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); + HBFunctions.hb_audio_compression_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); return new RangeLimits(direction == 0, granularity, high, low); } @@ -650,7 +643,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static double GetDefaultQuality(HBAudioEncoder encoder) { - return hbFunctions.hb_audio_quality_get_default((uint)encoder.Id); + return HBFunctions.hb_audio_quality_get_default((uint)encoder.Id); } /// <summary> @@ -664,7 +657,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static double GetDefaultAudioCompression(HBAudioEncoder encoder) { - return hbFunctions.hb_audio_compression_get_default((uint)encoder.Id); + return HBFunctions.hb_audio_compression_get_default((uint)encoder.Id); } public static uint BuildCopyMask(bool audioAllowMP3Pass, bool audioAllowAACPass, bool audioAllowAC3Pass, bool audioAllowDTSPass, bool audioAllowDTSHDPass, bool audioAllowEac3Pass, bool audioAllowFlacPass, bool audioAllowTruehdPass) @@ -713,5 +706,14 @@ namespace HandBrake.Interop.Interop return mask; } + + public static List<int> GetQsvAdaptorList() + { + IntPtr gpuListPtr = HBFunctions.hb_qsv_adapters_list(); + + List<int> gpuList = InteropUtilities.ToListFromHandBrakeList<int>(gpuListPtr); + + return gpuList; + } } } diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs index c398f2f0a..878b56512 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakeFilterHelpers.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakeFilterHelpers.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -15,12 +15,9 @@ namespace HandBrake.Interop.Interop using System.Runtime.InteropServices; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Json.Filters; using HandBrake.Interop.Interop.Model.Encoding; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; using Newtonsoft.Json; @@ -29,14 +26,6 @@ namespace HandBrake.Interop.Interop /// </summary> public class HandBrakeFilterHelpers { - private static IHbFunctions hbFunctions; - - static HandBrakeFilterHelpers() - { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - } - /// <summary> /// The get filter presets. /// </summary> @@ -48,7 +37,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static List<HBPresetTune> GetFilterPresets(int filter) { - IntPtr ptr = hbFunctions.hb_filter_get_presets_json(filter); + IntPtr ptr = HBFunctions.hb_filter_get_presets_json(filter); string result = Marshal.PtrToStringAnsi(ptr); List<PresetTune> list = JsonConvert.DeserializeObject<List<PresetTune>>(result); @@ -66,7 +55,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static List<HBPresetTune> GetFilterTunes(int filter) { - IntPtr ptr = hbFunctions.hb_filter_get_tunes_json(filter); + IntPtr ptr = HBFunctions.hb_filter_get_tunes_json(filter); string result = Marshal.PtrToStringAnsi(ptr); List<PresetTune> list = JsonConvert.DeserializeObject<List<PresetTune>>(result); @@ -80,7 +69,7 @@ namespace HandBrake.Interop.Interop /// <returns>The list of keys for custom settings for the filter.</returns> public static List<string> GetFilterKeys(int filter) { - IntPtr ptr = hbFunctions.hb_filter_get_keys(filter); + IntPtr ptr = HBFunctions.hb_filter_get_keys(filter); return InteropUtilities.ToStringListFromArrayPtr(ptr); } @@ -107,9 +96,16 @@ namespace HandBrake.Interop.Interop return new Dictionary<string, string>(); } - IntPtr ptr = hbFunctions.hb_generate_filter_settings_json(filter, presetName, null, null); + IntPtr ptr = HBFunctions.hb_generate_filter_settings_json(filter, presetName, null, null); string result = Marshal.PtrToStringAnsi(ptr); return JsonConvert.DeserializeObject<Dictionary<string, string>>(result); } + + public static string GenerateFilterSettingJson(int filterId, string preset, string tune, string custom) + { + IntPtr result = HBFunctions.hb_generate_filter_settings_json(filterId, preset, tune, custom); + string unparsedJson = Marshal.PtrToStringAnsi(result); + return unparsedJson; + } } } diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs index 5d4dd98ac..c9ee15cb8 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs @@ -13,7 +13,6 @@ namespace HandBrake.Interop.Interop using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Timers; @@ -21,7 +20,6 @@ namespace HandBrake.Interop.Interop using HandBrake.Interop.Interop.EventArgs; using HandBrake.Interop.Interop.Factories; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Interfaces; using HandBrake.Interop.Interop.Json.Encode; @@ -29,14 +27,11 @@ namespace HandBrake.Interop.Interop using HandBrake.Interop.Interop.Json.State; using HandBrake.Interop.Interop.Model.Encoding; using HandBrake.Interop.Interop.Model.Preview; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; using Newtonsoft.Json; public class HandBrakeInstance : IHandBrakeInstance, IDisposable { - private IHbFunctions hbFunctions; private const double ScanPollIntervalMs = 250; private const double EncodePollIntervalMs = 250; private Timer scanPollTimer; @@ -74,7 +69,6 @@ namespace HandBrake.Interop.Interop /// </summary> public event EventHandler<EncodeCompletedEventArgs> EncodeCompleted; - /// <summary> /// Gets the number of previews created during scan. /// </summary> @@ -98,12 +92,12 @@ namespace HandBrake.Interop.Interop /// <summary> /// Gets the HandBrake version string. /// </summary> - public string Version => Marshal.PtrToStringAnsi(hbFunctions.hb_get_version(this.Handle)); + public string Version => Marshal.PtrToStringAnsi(HBFunctions.hb_get_version(this.Handle)); /// <summary> /// Gets the HandBrake build number. /// </summary> - public int Build => hbFunctions.hb_get_build(this.Handle); + public int Build => HBFunctions.hb_get_build(this.Handle); public bool IsRemoteInstance => false; @@ -123,13 +117,10 @@ namespace HandBrake.Interop.Interop /// </param> public void Initialize(int verbosity, bool noHardware) { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - HandBrakeUtils.EnsureGlobalInit(noHardware); HandBrakeUtils.RegisterLogger(); - this.Handle = hbFunctions.hb_init(verbosity, update_check: 0); + this.Handle = HBFunctions.hb_init(verbosity, update_check: 0); } /// <summary> @@ -152,7 +143,7 @@ namespace HandBrake.Interop.Interop this.PreviewCount = previewCount; IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path); - hbFunctions.hb_scan(this.Handle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000)); + HBFunctions.hb_scan(this.Handle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000)); Marshal.FreeHGlobal(pathPtr); this.scanPollTimer = new Timer(); @@ -181,7 +172,7 @@ namespace HandBrake.Interop.Interop public void StopScan() { this.scanPollTimer.Stop(); - hbFunctions.hb_scan_stop(this.Handle); + HBFunctions.hb_scan_stop(this.Handle); } /// <summary> @@ -226,7 +217,7 @@ namespace HandBrake.Interop.Interop }; // Fetch the image data from LibHb - IntPtr resultingImageStuct = hbFunctions.hb_get_preview2(this.Handle, settings.TitleNumber, previewNumber, ref uiGeometry, deinterlace ? 1 : 0); + IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.Handle, settings.TitleNumber, previewNumber, ref uiGeometry, deinterlace ? 1 : 0); hb_image_s image = InteropUtilities.ToStructureFromPtr<hb_image_s>(resultingImageStuct); // Copy the filled image buffer to a managed array. @@ -242,7 +233,7 @@ namespace HandBrake.Interop.Interop // Close the image so we don't leak memory. IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); Marshal.WriteIntPtr(nativeJobPtrPtr, resultingImageStuct); - hbFunctions.hb_image_close(nativeJobPtrPtr); + HBFunctions.hb_image_close(nativeJobPtrPtr); Marshal.FreeHGlobal(nativeJobPtrPtr); return preview; @@ -257,7 +248,7 @@ namespace HandBrake.Interop.Interop /// <returns>True if DRC can be applied to the track with the given encoder.</returns> public bool CanApplyDrc(int trackNumber, HBAudioEncoder encoder, int title) { - return hbFunctions.hb_audio_can_apply_drc2(this.Handle, title, trackNumber, encoder.Id) > 0; + return HBFunctions.hb_audio_can_apply_drc2(this.Handle, title, trackNumber, encoder.Id) > 0; } /// <summary> @@ -285,8 +276,8 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] public void StartEncode(string encodeJson) { - hbFunctions.hb_add_json(this.Handle, InteropUtilities.ToUtf8PtrFromString(encodeJson)); - hbFunctions.hb_start(this.Handle); + HBFunctions.hb_add_json(this.Handle, InteropUtilities.ToUtf8PtrFromString(encodeJson)); + HBFunctions.hb_start(this.Handle); this.encodePollTimer = new Timer(); this.encodePollTimer.Interval = EncodePollIntervalMs; @@ -311,7 +302,7 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] public void PauseEncode() { - hbFunctions.hb_pause(this.Handle); + HBFunctions.hb_pause(this.Handle); } /// <summary> @@ -320,7 +311,7 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] public void ResumeEncode() { - hbFunctions.hb_resume(this.Handle); + HBFunctions.hb_resume(this.Handle); } /// <summary> @@ -329,20 +320,20 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] public void StopEncode() { - hbFunctions.hb_stop(this.Handle); + HBFunctions.hb_stop(this.Handle); // Also remove all jobs from the queue (in case we stopped a 2-pass encode) var currentJobs = new List<IntPtr>(); - int jobs = hbFunctions.hb_count(this.Handle); + int jobs = HBFunctions.hb_count(this.Handle); for (int i = 0; i < jobs; i++) { - currentJobs.Add(hbFunctions.hb_job(this.Handle, 0)); + currentJobs.Add(HBFunctions.hb_job(this.Handle, 0)); } foreach (IntPtr job in currentJobs) { - hbFunctions.hb_rem(this.Handle, job); + HBFunctions.hb_rem(this.Handle, job); } } @@ -355,7 +346,7 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] public JsonState GetEncodeProgress() { - IntPtr json = hbFunctions.hb_get_state_json(this.Handle); + IntPtr json = HBFunctions.hb_get_state_json(this.Handle); string statusJson = Marshal.PtrToStringAnsi(json); JsonState state = JsonConvert.DeserializeObject<JsonState>(statusJson); @@ -403,7 +394,7 @@ namespace HandBrake.Interop.Interop // Free unmanaged objects. IntPtr handlePtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); Marshal.WriteIntPtr(handlePtr, this.Handle); - hbFunctions.hb_close(handlePtr); + HBFunctions.hb_close(handlePtr); Marshal.FreeHGlobal(handlePtr); this.disposed = true; @@ -415,7 +406,7 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] private void PollScanProgress() { - IntPtr json = hbFunctions.hb_get_state_json(this.Handle); + IntPtr json = HBFunctions.hb_get_state_json(this.Handle); string statusJson = Marshal.PtrToStringAnsi(json); JsonState state = null; if (!string.IsNullOrEmpty(statusJson)) @@ -436,7 +427,7 @@ namespace HandBrake.Interop.Interop { this.scanPollTimer.Stop(); - var jsonMsg = hbFunctions.hb_get_title_set_json(this.Handle); + var jsonMsg = HBFunctions.hb_get_title_set_json(this.Handle); this.TitlesJson = InteropUtilities.ToStringFromUtf8Ptr(jsonMsg); if (!string.IsNullOrEmpty(this.TitlesJson)) @@ -461,7 +452,7 @@ namespace HandBrake.Interop.Interop [HandleProcessCorruptedStateExceptions] private void PollEncodeProgress() { - IntPtr json = hbFunctions.hb_get_state_json(this.Handle); + IntPtr json = HBFunctions.hb_get_state_json(this.Handle); string statusJson = Marshal.PtrToStringAnsi(json); JsonState state = JsonConvert.DeserializeObject<JsonState>(statusJson); diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs index b96a38c72..32970ecba 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakeLanguagesHelper.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakeLanguagesHelper.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -12,11 +12,8 @@ namespace HandBrake.Interop.Interop using System.Collections.Generic; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Model; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; /// <summary> /// Contains utilities for converting language codes. @@ -25,14 +22,6 @@ namespace HandBrake.Interop.Interop { private static IList<Language> allLanguages; - private static IHbFunctions hbFunctions; - - static HandBrakeLanguagesHelper() - { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - } - /// <summary> /// Gets a list of all languages. /// </summary> @@ -42,7 +31,7 @@ namespace HandBrake.Interop.Interop { return allLanguages ?? (allLanguages = - InteropUtilities.ToListFromIterator<iso639_lang_t, Language>(hbFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); + InteropUtilities.ToListFromIterator<iso639_lang_t, Language>(HBFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); } } @@ -53,7 +42,7 @@ namespace HandBrake.Interop.Interop /// <returns>Object that describes the language.</returns> public static Language Get(string code) { - iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(hbFunctions.lang_for_code2(code)); + iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(HBFunctions.lang_for_code2(code)); return HandBrakeUnitConversionHelpers.NativeToLanguage(language); } } diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakePictureHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakePictureHelpers.cs new file mode 100644 index 000000000..03b410a8e --- /dev/null +++ b/win/CS/HandBrake.Interop/Interop/HandBrakePictureHelpers.cs @@ -0,0 +1,25 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="HandBrakePictureHelpers.cs" company="HandBrake Project (https://handbrake.fr)"> +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// </copyright> +// <summary> +// Defines the HandBrakePictureHelpers type. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using HandBrake.Interop.Interop.HbLib; + + public class HandBrakePictureHelpers + { + public static hb_geometry_s GetAnamorphicSizes(hb_geometry_s sourceGeometry, hb_geometry_settings_s uiGeometry) + { + hb_geometry_s geometry = new hb_geometry_s(); + + HBFunctions.hb_set_anamorphic_size2(ref sourceGeometry, ref uiGeometry, ref geometry); + + return geometry; + } + } +} diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs b/win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs index 38a5ee3d6..c16cf9a59 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakePresetService.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakePresetService.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -14,12 +14,10 @@ namespace HandBrake.Interop.Interop using System.IO; using System.Runtime.InteropServices; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; + using HandBrake.Interop.Interop.HbLib; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Json.Presets; using HandBrake.Interop.Interop.Model; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; using Newtonsoft.Json; @@ -28,14 +26,6 @@ namespace HandBrake.Interop.Interop /// </summary> public class HandBrakePresetService { - private static IHbFunctions hbFunctions; - - static HandBrakePresetService() - { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - } - /// <summary> /// The get built in presets. /// Requires an hb_init to have been invoked. @@ -45,7 +35,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static IList<HBPresetCategory> GetBuiltInPresets() { - IntPtr presets = hbFunctions.hb_presets_builtin_get_json(); + IntPtr presets = HBFunctions.hb_presets_builtin_get_json(); string presetJson = Marshal.PtrToStringAnsi(presets); IList<HBPresetCategory> presetList = JsonConvert.DeserializeObject<IList<HBPresetCategory>>(presetJson); @@ -63,7 +53,7 @@ namespace HandBrake.Interop.Interop /// </returns> public static PresetTransportContainer GetPresetsFromFile(string filename) { - IntPtr presetStringPointer = hbFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename)); + IntPtr presetStringPointer = HBFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename)); string presetJson = Marshal.PtrToStringAnsi(presetStringPointer); if (!string.IsNullOrEmpty(presetJson)) @@ -106,7 +96,7 @@ namespace HandBrake.Interop.Interop IntPtr minor = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int))); IntPtr micro = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int))); - hbFunctions.hb_presets_current_version(major, minor, micro); + HBFunctions.hb_presets_current_version(major, minor, micro); int majorVersion = Marshal.ReadInt32(major); int minorVersion = Marshal.ReadInt32(minor); diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeSubtitleHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeSubtitleHelpers.cs new file mode 100644 index 000000000..48a8f32c4 --- /dev/null +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeSubtitleHelpers.cs @@ -0,0 +1,26 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="HandBrakeSubtitleHelpers.cs" company="HandBrake Project (https://handbrake.fr)"> +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// </copyright> +// <summary> +// Defines the HandBrakeSubtitleHelpers type. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using HandBrake.Interop.Interop.HbLib; + + public class HandBrakeSubtitleHelpers + { + public static int CheckCanForceSubtitle(int source) + { + return HBFunctions.hb_subtitle_can_force(source); + } + + public static int CheckCanBurnSubtitle(int source) + { + return HBFunctions.hb_subtitle_can_burn(source); + } + } +} diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs index db2ea9990..698bce11a 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakeUnitConversionHelpers.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakeUnitConversionHelpers.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -12,25 +12,18 @@ namespace HandBrake.Interop.Interop using System; using System.Collections.Generic; using System.Globalization; + using System.Runtime.InteropServices; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Model; using HandBrake.Interop.Interop.Model.Encoding; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; /// <summary> /// Converters for various encoding values. /// </summary> public static class HandBrakeUnitConversionHelpers { - private static IHbFunctions hbFunctions; - - /// <summary> - /// Video Frame Rates - /// </summary> private static readonly Dictionary<double, int> VideoRates; /// <summary> @@ -38,9 +31,6 @@ namespace HandBrake.Interop.Interop /// </summary> static HandBrakeUnitConversionHelpers() { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - if (!HandBrakeUtils.IsInitialised()) { throw new Exception("Please Initialise with HandBrakeUtils.EnsureGlobalInit before using!"); @@ -74,6 +64,41 @@ namespace HandBrake.Interop.Interop return VideoRates[framerate]; } + + public static int GetFramerateFromName(string name) + { + IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(name); + + return HBFunctions.hb_video_framerate_get_from_name(frameratePrt); + } + + /// <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> + public static TimeSpan PtsToTimeSpan(ulong pts) + { + return TimeSpan.FromTicks((long)((pts * 10000000) / 90000)); + } + + /// <summary> + /// Converts the PTS amount to seconds. + /// </summary> + /// <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; + } /// <summary> /// Converts a native HB encoder structure to an Encoder model. @@ -103,8 +128,8 @@ namespace HandBrake.Interop.Interop var result = new HBAudioEncoder( encoder.muxers, HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec), - hbFunctions.hb_audio_compression_get_default((uint)encoder.codec), - hbFunctions.hb_audio_quality_get_default((uint)encoder.codec), + HBFunctions.hb_audio_compression_get_default((uint)encoder.codec), + HBFunctions.hb_audio_quality_get_default((uint)encoder.codec), encoder.name, encoder.codec, HandBrakeEncoderHelpers.GetAudioQualityLimits(encoder.codec), @@ -170,33 +195,5 @@ namespace HandBrake.Interop.Interop string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name); return new Language(englishName, nativeName, language.iso639_2); } - - /// <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> - public static TimeSpan PtsToTimeSpan(ulong pts) - { - return TimeSpan.FromTicks((long)((pts * 10000000) / 90000)); - } - - /// <summary> - /// Converts the PTS amount to seconds. - /// </summary> - /// <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/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs index aab7d220e..df58e197f 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakeUtils.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakeUtils.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -11,18 +11,13 @@ namespace HandBrake.Interop.Interop { using System; using System.Collections.Generic; - using System.Linq.Expressions; - using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using HandBrake.Interop.Interop.EventArgs; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Json.Anamorphic; using HandBrake.Interop.Interop.Json.Shared; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; using Newtonsoft.Json; @@ -59,17 +54,12 @@ namespace HandBrake.Interop.Interop /// </summary> public static event EventHandler<MessageLoggedEventArgs> ErrorLogged; - private static IHbFunctions hbFunctions; - - static HandBrakeUtils() - { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - } - /// <summary> /// Ensures the HB global initialize method has been called. /// </summary> + /// <param name="initNoHardwareMode"> + /// Init without hardware encoders. + /// </param> public static void EnsureGlobalInit(bool initNoHardwareMode) { if (!globalInitialized) @@ -79,7 +69,7 @@ namespace HandBrake.Interop.Interop if (initNoHardwareMode) { initNoHardware = true; - if (hbFunctions.hb_global_init_no_hardware() == -1) + if (HBFunctions.hb_global_init_no_hardware() == -1) { throw new InvalidOperationException("HB global init failed."); } @@ -99,7 +89,7 @@ namespace HandBrake.Interop.Interop // Try without Hardware support. Bad drivers can sometimes cause issues. if (!initSuccess) { - if (hbFunctions.hb_global_init_no_hardware() == -1) + if (HBFunctions.hb_global_init_no_hardware() == -1) { throw new InvalidOperationException("HB global init failed."); } @@ -117,7 +107,7 @@ namespace HandBrake.Interop.Interop /// </param> public static void SetDvdNav(bool enableDvdNav) { - hbFunctions.hb_dvd_set_dvdnav(enableDvdNav ? 1 : 0); + HBFunctions.hb_dvd_set_dvdnav(enableDvdNav ? 1 : 0); } /// <summary> @@ -125,7 +115,7 @@ namespace HandBrake.Interop.Interop /// </summary> public static void DisposeGlobal() { - hbFunctions.hb_global_close(); + HBFunctions.hb_global_close(); } /// <summary> @@ -139,8 +129,8 @@ namespace HandBrake.Interop.Interop // Keep the callback as a member to prevent it from being garbage collected. loggingCallback = LoggingHandler; errorCallback = ErrorHandler; - hbFunctions.hb_register_logger(loggingCallback); - hbFunctions.hb_register_error_handler(errorCallback); + HBFunctions.hb_register_logger(loggingCallback); + HBFunctions.hb_register_error_handler(errorCallback); } } @@ -192,7 +182,7 @@ namespace HandBrake.Interop.Interop public static string SanitizeX264OptName(string name) { IntPtr namePtr = Marshal.StringToHGlobalAnsi(name); - string sanitizedName = Marshal.PtrToStringAnsi(hbFunctions.hb_x264_encopt_name(namePtr)); + string sanitizedName = Marshal.PtrToStringAnsi(HBFunctions.hb_x264_encopt_name(namePtr)); Marshal.FreeHGlobal(namePtr); return sanitizedName; } @@ -226,14 +216,14 @@ namespace HandBrake.Interop.Interop /// </returns> public static bool IsH264LevelValid(string level, int width, int height, int fpsNumerator, int fpsDenominator, bool interlaced, bool fakeInterlaced) { - return hbFunctions.hb_check_h264_level( - level, - width, - height, - fpsNumerator, - fpsDenominator, - interlaced ? 1 : 0, - fakeInterlaced ? 1 : 0) == 0; + return HBFunctions.hb_check_h264_level( + level, + width, + height, + fpsNumerator, + fpsDenominator, + interlaced ? 1 : 0, + fakeInterlaced ? 1 : 0) == 0; } /// <summary> @@ -282,7 +272,7 @@ namespace HandBrake.Interop.Interop throw new ArgumentException("height must be positive."); } - IntPtr ptr = hbFunctions.hb_x264_param_unparse( + IntPtr ptr = HBFunctions.hb_x264_param_unparse( 8, preset, string.Join(",", tunes), @@ -305,7 +295,7 @@ namespace HandBrake.Interop.Interop 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)); + IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode)); string result = Marshal.PtrToStringAnsi(json); return JsonConvert.DeserializeObject<Geometry>(result); } @@ -370,7 +360,7 @@ namespace HandBrake.Interop.Interop { try { - if (hbFunctions.hb_global_init() == -1) + if (HBFunctions.hb_global_init() == -1) { throw new InvalidOperationException("HB global init failed."); } diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs b/win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs index 33d3f0bca..ba5b1befb 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBDelegates.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBDelegates.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs index c3b99c735..6f55ff9d5 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBFunctions.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBFunctions.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -307,5 +307,8 @@ namespace HandBrake.Interop.Interop.HbLib [DllImport("hb", EntryPoint = "qsv_hardware_generation", CallingConvention = CallingConvention.Cdecl)] public static extern int qsv_hardware_generation(int cpu_platform); + + [DllImport("hb", EntryPoint = "hb_qsv_adapters_list", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_qsv_adapters_list(); } } diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs b/win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs index b0e5d876d..d7a50b7b1 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="NativeConstants.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="NativeConstants.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/Wrappers/HbFunctionsDirect.cs b/win/CS/HandBrake.Interop/Interop/HbLib/Wrappers/HbFunctionsDirect.cs deleted file mode 100644 index 7a892dc22..000000000 --- a/win/CS/HandBrake.Interop/Interop/HbLib/Wrappers/HbFunctionsDirect.cs +++ /dev/null @@ -1,511 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="IHbFunctions.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// An interface to access the native libhb functions without using static methods. -// </summary> -// <auto-generated> Disable Stylecop Warnings for this file </auto-generated> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.Interop.HbLib.Wrappers -{ - using System; - using System.Runtime.InteropServices; - - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; - - public class HbFunctionsDirect : IHbFunctions - { - public void hb_register_logger(LoggingCallback callback) - { - HBFunctions.hb_register_logger(callback); - } - - public void hb_register_error_handler(LoggingCallback callback) - { - HBFunctions.hb_register_error_handler(callback); - } - - public int hb_global_init() - { - return HBFunctions.hb_global_init(); - } - - public int hb_global_init_no_hardware() - { - return HBFunctions.hb_global_init_no_hardware(); - } - - public IntPtr hb_init(int verbose, int update_check) - { - return HBFunctions.hb_init(verbose, update_check); - } - - public IntPtr hb_init_dl(int verbose, int update_check) - { - return HBFunctions.hb_init_dl(verbose, update_check); - } - - public IntPtr hb_get_version(IntPtr hbHandle) - { - return HBFunctions.hb_get_version(hbHandle); - } - - public int hb_get_build(IntPtr hbHandle) - { - return HBFunctions.hb_get_build(hbHandle); - } - - public IntPtr hb_dvd_name(IntPtr path) - { - return HBFunctions.hb_dvd_name(path); - } - - public void hb_dvd_set_dvdnav(int enable) - { - HBFunctions.hb_dvd_set_dvdnav(enable); - } - - public void hb_scan(IntPtr hbHandle, IntPtr path, int title_index, int preview_count, int store_previews, ulong min_duration) - { - HBFunctions.hb_scan(hbHandle, path, title_index, preview_count, store_previews, min_duration); - } - - public void hb_scan_stop(IntPtr hbHandle) - { - HBFunctions.hb_scan_stop(hbHandle); - } - - public IntPtr hb_get_titles(IntPtr hbHandle) - { - return HBFunctions.hb_get_titles(hbHandle); - } - - public void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_geometry_settings_s uiGeometry, ref hb_geometry_s result) - { - HBFunctions.hb_set_anamorphic_size2(ref sourceGeometry, ref uiGeometry, ref result); - } - - public int hb_count(IntPtr hbHandle) - { - return HBFunctions.hb_count(hbHandle); - } - - public IntPtr hb_job(IntPtr hbHandle, int jobIndex) - { - return HBFunctions.hb_job(hbHandle, jobIndex); - } - - public void hb_rem(IntPtr hbHandle, IntPtr job) - { - HBFunctions.hb_rem(hbHandle, job); - } - - public void hb_start(IntPtr hbHandle) - { - HBFunctions.hb_start(hbHandle); - } - - public void hb_pause(IntPtr hbHandle) - { - HBFunctions.hb_pause(hbHandle); - } - - public void hb_resume(IntPtr hbHandle) - { - HBFunctions.hb_resume(hbHandle); - } - - public void hb_stop(IntPtr hbHandle) - { - HBFunctions.hb_stop(hbHandle); - } - - public void hb_close(IntPtr hbHandle) - { - HBFunctions.hb_close(hbHandle); - } - - public void hb_global_close() - { - HBFunctions.hb_global_close(); - } - - public IntPtr hb_list_init() - { - return HBFunctions.hb_list_init(); - } - - public int hb_list_count(IntPtr listPtr) - { - return HBFunctions.hb_list_count(listPtr); - } - - public void hb_list_add(IntPtr listPtr, IntPtr item) - { - HBFunctions.hb_list_add(listPtr, item); - } - - public void hb_list_insert(IntPtr listPtr, int pos, IntPtr item) - { - HBFunctions.hb_list_insert(listPtr, pos, item); - } - - public void hb_list_rem(IntPtr listPtr, IntPtr item) - { - HBFunctions.hb_list_rem(listPtr, item); - } - - public IntPtr hb_list_item(IntPtr listPtr, int itemIndex) - { - return HBFunctions.hb_list_item(listPtr, itemIndex); - } - - public void hb_list_close(IntPtr listPtrPtr) - { - HBFunctions.hb_list_close(listPtrPtr); - } - - public int hb_subtitle_can_force(int source) - { - return HBFunctions.hb_subtitle_can_force(source); - } - - public int hb_subtitle_can_burn(int source) - { - return HBFunctions.hb_subtitle_can_burn(source); - } - - public int hb_subtitle_can_pass(int source, int mux) - { - return HBFunctions.hb_subtitle_can_pass(source, mux); - } - - public int hb_video_framerate_get_from_name(IntPtr name) - { - return HBFunctions.hb_video_framerate_get_from_name(name); - } - - public IntPtr hb_video_framerate_get_next(IntPtr last) - { - return HBFunctions.hb_video_framerate_get_next(last); - } - - public IntPtr hb_audio_samplerate_get_next(IntPtr last) - { - return HBFunctions.hb_audio_samplerate_get_next(last); - } - - public int hb_audio_samplerate_find_closest(int samplerate, uint codec) - { - return HBFunctions.hb_audio_samplerate_find_closest(samplerate, codec); - } - - public int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown) - { - return HBFunctions.hb_audio_bitrate_get_best(codec, bitrate, samplerate, mixdown); - } - - public int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown) - { - return HBFunctions.hb_audio_bitrate_get_default(codec, samplerate, mixdown); - } - - public int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high) - { - return HBFunctions.hb_audio_bitrate_get_limits(codec, samplerate, mixdown, ref low, ref high); - } - - public IntPtr hb_audio_bitrate_get_next(IntPtr last) - { - return HBFunctions.hb_audio_bitrate_get_next(last); - } - - public void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction) - { - HBFunctions.hb_video_quality_get_limits(codec, ref low, ref high, ref granularity, ref direction); - } - - public IntPtr hb_video_quality_get_name(uint codec) - { - return HBFunctions.hb_video_quality_get_name(codec); - } - - public void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction) - { - HBFunctions.hb_audio_quality_get_limits(codec, ref low, ref high, ref granularity, ref direction); - } - - public float hb_audio_quality_get_default(uint codec) - { - return HBFunctions.hb_audio_quality_get_default(codec); - } - - public void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction) - { - HBFunctions.hb_audio_compression_get_limits(codec, ref low, ref high, ref granularity, ref direction); - } - - public float hb_audio_compression_get_default(uint codec) - { - return HBFunctions.hb_audio_compression_get_default(codec); - } - - public int hb_audio_can_apply_drc2(IntPtr handle, int title_index, int audio_index, int encoder) - { - return HBFunctions.hb_audio_can_apply_drc2(handle, title_index, audio_index, encoder); - } - - public int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout) - { - return HBFunctions.hb_mixdown_is_supported(mixdown, codec, layout); - } - - public int hb_mixdown_has_codec_support(int mixdown, uint codec) - { - return HBFunctions.hb_mixdown_has_codec_support(mixdown, codec); - } - - public int hb_mixdown_has_remix_support(int mixdown, ulong layout) - { - return HBFunctions.hb_mixdown_has_remix_support(mixdown, layout); - } - - public int hb_mixdown_get_best(uint codec, ulong layout, int mixdown) - { - return HBFunctions.hb_mixdown_get_best(codec, layout, mixdown); - } - - public int hb_mixdown_get_default(uint codec, ulong layout) - { - return HBFunctions.hb_mixdown_get_default(codec, layout); - } - - public IntPtr hb_mixdown_get_next(IntPtr last) - { - return HBFunctions.hb_mixdown_get_next(last); - } - - public IntPtr hb_video_encoder_get_next(IntPtr last) - { - return HBFunctions.hb_video_encoder_get_next(last); - } - - public IntPtr hb_audio_encoder_get_next(IntPtr last) - { - return HBFunctions.hb_audio_encoder_get_next(last); - } - - public IntPtr hb_container_get_next(IntPtr last) - { - return HBFunctions.hb_container_get_next(last); - } - - public IntPtr hb_video_encoder_get_presets(int encoder) - { - return HBFunctions.hb_video_encoder_get_presets(encoder); - } - - public IntPtr hb_video_encoder_get_tunes(int encoder) - { - return HBFunctions.hb_video_encoder_get_tunes(encoder); - } - - public IntPtr hb_video_encoder_get_profiles(int encoder) - { - return HBFunctions.hb_video_encoder_get_profiles(encoder); - } - - public IntPtr hb_video_encoder_get_levels(int encoder) - { - return HBFunctions.hb_video_encoder_get_levels(encoder); - } - - public IntPtr lang_get_next(IntPtr last) - { - return HBFunctions.lang_get_next(last); - } - - public IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2) - { - return HBFunctions.lang_for_code2(code2); - } - - public void hb_job_close(IntPtr job) - { - HBFunctions.hb_job_close(job); - } - - public IntPtr hb_filter_get_keys(int filter_id) - { - return HBFunctions.hb_filter_get_keys(filter_id); - } - - public IntPtr hb_x264_encopt_name(IntPtr name) - { - return HBFunctions.hb_x264_encopt_name(name); - } - - public int hb_check_h264_level( - [In] [MarshalAs(UnmanagedType.LPStr)] string level, - int width, - int height, - int fps_num, - int fps_den, - int interlaced, - int fake_interlaced) - { - return HBFunctions.hb_check_h264_level( - level, - width, - height, - fps_num, - fps_den, - interlaced, - fake_interlaced); - } - - public IntPtr hb_x264_param_unparse( - int bit_depth, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile, - [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level, - int width, - int height) - { - return HBFunctions.hb_x264_param_unparse( - bit_depth, - x264_preset, - x264_tune, - x264_encopts, - x264_profile, - h264_level, - width, - height); - } - - public int hb_qsv_available() - { - return HBFunctions.hb_qsv_available(); - } - - public int hb_vce_h264_available() - { - return HBFunctions.hb_vce_h264_available(); - } - - public int hb_vce_h265_available() - { - return HBFunctions.hb_vce_h265_available(); - } - - public int hb_nvenc_h264_available() - { - return HBFunctions.hb_nvenc_h264_available(); - } - - public int hb_nvenc_h265_available() - { - return HBFunctions.hb_nvenc_h265_available(); - } - - public IntPtr hb_get_preview2(IntPtr hbHandle, int title_idx, int preview_idx, ref hb_geometry_settings_s geo, int deinterlace) - { - return HBFunctions.hb_get_preview2(hbHandle, title_idx, preview_idx, ref geo, deinterlace); - } - - public IntPtr hb_image_close(IntPtr image) - { - return HBFunctions.hb_image_close(image); - } - - /* JSON API */ - - public IntPtr hb_get_title_set_json(IntPtr hbHandle) - { - return HBFunctions.hb_get_title_set_json(hbHandle); - } - - public IntPtr hb_job_init_json(IntPtr hbHandle, int title_index) - { - return HBFunctions.hb_job_init_json(hbHandle, title_index); - } - - public IntPtr hb_json_to_job(IntPtr hbHandle, IntPtr json_job) - { - return HBFunctions.hb_json_to_job(hbHandle, json_job); - } - - public int hb_add_json(IntPtr hbHandle, IntPtr json_job) - { - return HBFunctions.hb_add_json(hbHandle, json_job); - } - - public IntPtr hb_set_anamorphic_size_json(IntPtr json_param) - { - return HBFunctions.hb_set_anamorphic_size_json(json_param); - } - - public IntPtr hb_get_state_json(IntPtr hbHandle) - { - return HBFunctions.hb_get_state_json(hbHandle); - } - - public IntPtr hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, ref hb_geometry_settings_s settings) - { - return HBFunctions.hb_get_preview_params_json(title_idx, preview_idx, deinterlace, ref settings); - } - - public void hb_presets_builtin_init() - { - HBFunctions.hb_presets_builtin_init(); - } - - public IntPtr hb_presets_builtin_get_json() - { - return HBFunctions.hb_presets_builtin_get_json(); - } - - public IntPtr hb_presets_read_file_json(IntPtr filename) - { - return HBFunctions.hb_presets_read_file_json(filename); - } - - public IntPtr hb_presets_current_version(IntPtr major, IntPtr minor, IntPtr micro) - { - return HBFunctions.hb_presets_current_version(major, minor, micro); - } - - public IntPtr hb_generate_filter_settings_json( - int filter_id, - [In] [MarshalAs(UnmanagedType.LPStr)] string preset, - [In] [MarshalAs(UnmanagedType.LPStr)] string tune, - [In] [MarshalAs(UnmanagedType.LPStr)] string custom) - { - return HBFunctions.hb_generate_filter_settings_json(filter_id, preset, tune, custom); - } - - public IntPtr hb_filter_get_presets_json(int filter_id) - { - return HBFunctions.hb_filter_get_presets_json(filter_id); - } - - public IntPtr hb_filter_get_tunes_json(int filter_id) - { - return HBFunctions.hb_filter_get_tunes_json(filter_id); - } - - public int hb_get_cpu_platform() - { - return HBFunctions.hb_get_cpu_platform(); - } - - public int qsv_hardware_generation(int cpu_platform) - { - return HBFunctions.qsv_hardware_generation(cpu_platform); - } - } -} diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/Wrappers/Interfaces/IHbFunctions.cs b/win/CS/HandBrake.Interop/Interop/HbLib/Wrappers/Interfaces/IHbFunctions.cs deleted file mode 100644 index 01c8e614b..000000000 --- a/win/CS/HandBrake.Interop/Interop/HbLib/Wrappers/Interfaces/IHbFunctions.cs +++ /dev/null @@ -1,219 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="IHbFunctions.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// An interface to access the native libhb functions without using static methods. -// </summary> -// <auto-generated> Disable Stylecop Warnings for this file </auto-generated> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces -{ - using System; - using System.Runtime.InteropServices; - - public interface IHbFunctions - { - void hb_register_logger(LoggingCallback callback); - - void hb_register_error_handler(LoggingCallback callback); - - int hb_global_init(); - - int hb_global_init_no_hardware(); - - IntPtr hb_init(int verbose, int update_check); - - IntPtr hb_init_dl(int verbose, int update_check); - - IntPtr hb_get_version(IntPtr hbHandle); - - int hb_get_build(IntPtr hbHandle); - - IntPtr hb_dvd_name(IntPtr path); - - void hb_dvd_set_dvdnav(int enable); - - void hb_scan(IntPtr hbHandle, IntPtr path, int title_index, int preview_count, int store_previews, ulong min_duration); - - void hb_scan_stop(IntPtr hbHandle); - - IntPtr hb_get_titles(IntPtr hbHandle); - - void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_geometry_settings_s uiGeometry, ref hb_geometry_s result); - - int hb_count(IntPtr hbHandle); - - IntPtr hb_job(IntPtr hbHandle, int jobIndex); - - void hb_rem(IntPtr hbHandle, IntPtr job); - - void hb_start(IntPtr hbHandle); - - void hb_pause(IntPtr hbHandle); - - void hb_resume(IntPtr hbHandle); - - void hb_stop(IntPtr hbHandle); - - void hb_close(IntPtr hbHandle); - - void hb_global_close(); - - IntPtr hb_list_init(); - - int hb_list_count(IntPtr listPtr); - - void hb_list_add(IntPtr listPtr, IntPtr item); - - void hb_list_insert(IntPtr listPtr, int pos, IntPtr item); - - void hb_list_rem(IntPtr listPtr, IntPtr item); - - IntPtr hb_list_item(IntPtr listPtr, int itemIndex); - - void hb_list_close(IntPtr listPtrPtr); - - int hb_subtitle_can_force(int source); - - int hb_subtitle_can_burn(int source); - - int hb_subtitle_can_pass(int source, int mux); - - int hb_video_framerate_get_from_name(IntPtr name); - - IntPtr hb_video_framerate_get_next(IntPtr last); - - IntPtr hb_audio_samplerate_get_next(IntPtr last); - - int hb_audio_samplerate_find_closest(int samplerate, uint codec); - - int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown); - - int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown); - - int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high); - - IntPtr hb_audio_bitrate_get_next(IntPtr last); - - void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); - - IntPtr hb_video_quality_get_name(uint codec); - - void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); - - float hb_audio_quality_get_default(uint codec); - - void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); - - float hb_audio_compression_get_default(uint codec); - - int hb_audio_can_apply_drc2(IntPtr handle, int title_index, int audio_index, int encoder); - - int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout); - - int hb_mixdown_has_codec_support(int mixdown, uint codec); - - int hb_mixdown_has_remix_support(int mixdown, ulong layout); - - int hb_mixdown_get_best(uint codec, ulong layout, int mixdown); - - int hb_mixdown_get_default(uint codec, ulong layout); - - IntPtr hb_mixdown_get_next(IntPtr last); - - IntPtr hb_video_encoder_get_next(IntPtr last); - - IntPtr hb_audio_encoder_get_next(IntPtr last); - - IntPtr hb_container_get_next(IntPtr last); - - IntPtr hb_video_encoder_get_presets(int encoder); - - IntPtr hb_video_encoder_get_tunes(int encoder); - - IntPtr hb_video_encoder_get_profiles(int encoder); - - IntPtr hb_video_encoder_get_levels(int encoder); - - IntPtr lang_get_next(IntPtr last); - - IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2); - - void hb_job_close(IntPtr job); - - IntPtr hb_filter_get_keys(int filter_id); - - IntPtr hb_x264_encopt_name(IntPtr name); - - int hb_check_h264_level( - [In] [MarshalAs(UnmanagedType.LPStr)] string level, - int width, - int height, - int fps_num, - int fps_den, - int interlaced, - int fake_interlaced); - - IntPtr hb_x264_param_unparse( - int bit_depth, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile, - [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level, - int width, - int height); - - int hb_qsv_available(); - - int hb_vce_h264_available(); - - int hb_vce_h265_available(); - - int hb_nvenc_h264_available(); - - int hb_nvenc_h265_available(); - - IntPtr hb_get_preview2(IntPtr hbHandle, int title_idx, int preview_idx, ref hb_geometry_settings_s geo, int deinterlace); - - IntPtr hb_image_close(IntPtr image); - - IntPtr hb_get_title_set_json(IntPtr hbHandle); - - IntPtr hb_job_init_json(IntPtr hbHandle, int title_index); - - IntPtr hb_json_to_job(IntPtr hbHandle, IntPtr json_job); - - int hb_add_json(IntPtr hbHandle, IntPtr json_job); - - IntPtr hb_set_anamorphic_size_json(IntPtr json_param); - - IntPtr hb_get_state_json(IntPtr hbHandle); - - IntPtr hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, ref hb_geometry_settings_s settings); - - void hb_presets_builtin_init(); - - IntPtr hb_presets_builtin_get_json(); - - IntPtr hb_presets_read_file_json(IntPtr filename); - - IntPtr hb_presets_current_version(IntPtr major, IntPtr minor, IntPtr micro); - - IntPtr hb_generate_filter_settings_json( - int filter_id, - [In] [MarshalAs(UnmanagedType.LPStr)] string preset, - [In] [MarshalAs(UnmanagedType.LPStr)] string tune, - [In] [MarshalAs(UnmanagedType.LPStr)] string custom); - - IntPtr hb_filter_get_presets_json(int filter_id); - - IntPtr hb_filter_get_tunes_json(int filter_id); - - int hb_get_cpu_platform(); - - int qsv_hardware_generation(int cpu_platform); - } -} diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs index 949f7d694..46594c2ee 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_job_s.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_job_s.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs index 2611cab47..bee01327a 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_container_s.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_container_s.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated>Disable Stylecop Warnings for this file</auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs index 54c5b182f..226870122 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_encoder_s.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_encoder_s.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated>Disable Stylecop Warnings for this file</auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs index f0c996ca8..493c716f5 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs @@ -1,10 +1,11 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_error_code.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_error_code.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> // Defines the hb_error_code type. // </summary> +// <auto-generated> Disable Stylecop. HandBrake internal object. </auto-generated> // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.Interop.Interop.HbLib diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs index 7b962d28b..0bd958f15 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_filter_ids.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_filter_ids.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated> Disable Stylecop Warnings for this file </auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs index c665a5306..54063032a 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_geometry.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_geometry.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs index 9edf733af..5e2dc9443 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_image_s.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_image_s.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs index 06fb6af6b..b269b24c1 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_mixdown_s.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_mixdown_s.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated>Disable Stylecop Warnings for this file</auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs index f10c320ce..563930471 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_rate_s.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_rate_s.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated>Disable Stylecop Warnings for this file</auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs index f51de960f..c8fa3d5ce 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="hb_subtitle.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="hb_subtitle.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated> Disable Stylecop Warnings for this file </auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs b/win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs index 8a9d8ab64..35dae2add 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="iso639_lang_t.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="iso639_lang_t.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <auto-generated>Disable Stylecop Warnings for this file</auto-generated> diff --git a/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs b/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs index 7ff81d407..25eb8caf2 100644 --- a/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="InteropUtilities.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="InteropUtilities.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -16,23 +16,12 @@ namespace HandBrake.Interop.Interop.Helpers using System.Text; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; /// <summary> /// Helper utilities for native interop. /// </summary> internal static class InteropUtilities { - private static IHbFunctions hbFunctions; - - static InteropUtilities() - { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - } - /// <summary> /// Reads the given native structure pointer. /// </summary> @@ -273,7 +262,7 @@ namespace HandBrake.Interop.Interop.Helpers // Assign the new pointer to the job pointer and tell HB to clean the job up. Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr); - hbFunctions.hb_job_close(nativeJobPtrPtr); + HBFunctions.hb_job_close(nativeJobPtrPtr); // Free the pointer we used. Marshal.FreeHGlobal(nativeJobPtrPtr); diff --git a/win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs b/win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs index b63789943..0eee0884b 100644 --- a/win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="NativeList.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="NativeList.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -15,16 +15,16 @@ namespace HandBrake.Interop.Interop.Helpers using System.Runtime.InteropServices; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; /// <summary> /// Represents a HandBrake style native list. /// </summary> internal class NativeList : IDisposable { - private static IHbFunctions hbFunctions; + /// <summary> + /// The list of native memory locations allocated for this list. + /// </summary> + private readonly List<IntPtr> allocatedMemory = new List<IntPtr>(); /// <summary> /// Initializes a new instance of the NativeList class. @@ -33,14 +33,7 @@ namespace HandBrake.Interop.Interop.Helpers public NativeList(IntPtr listPtr) { this.Ptr = listPtr; - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); } - - /// <summary> - /// The list of native memory locations allocated for this list. - /// </summary> - private readonly List<IntPtr> allocatedMemory = new List<IntPtr>(); /// <summary> /// Gets the pointer to the native list. @@ -55,7 +48,7 @@ namespace HandBrake.Interop.Interop.Helpers get { Debug.WriteLine("Got a Zero Pointer in the NativeList"); - return this.Ptr == IntPtr.Zero ? 0 : hbFunctions.hb_list_count(this.Ptr); + return this.Ptr == IntPtr.Zero ? 0 : HBFunctions.hb_list_count(this.Ptr); } } @@ -71,12 +64,25 @@ namespace HandBrake.Interop.Interop.Helpers } /// <summary> + /// Gets an item out of the list. + /// </summary> + /// <param name="i">Index in the list.</param> + /// <returns>The item at that index in the list.</returns> + public IntPtr this[int i] + { + get + { + return HBFunctions.hb_list_item(this.Ptr, i); + } + } + + /// <summary> /// Adds an item to the end of the list. /// </summary> /// <param name="item">The item to add.</param> public void Add(IntPtr item) { - hbFunctions.hb_list_add(this.Ptr, item); + HBFunctions.hb_list_add(this.Ptr, item); } /// <summary> @@ -86,7 +92,7 @@ namespace HandBrake.Interop.Interop.Helpers /// <param name="item">The item to insert.</param> public void Insert(int position, IntPtr item) { - hbFunctions.hb_list_insert(this.Ptr, position, item); + HBFunctions.hb_list_insert(this.Ptr, position, item); } /// <summary> @@ -95,20 +101,7 @@ namespace HandBrake.Interop.Interop.Helpers /// <param name="item">The item to remove.</param> public void Remove(IntPtr item) { - hbFunctions.hb_list_rem(this.Ptr, item); - } - - /// <summary> - /// Gets an item out of the list. - /// </summary> - /// <param name="i">Index in the list.</param> - /// <returns>The item at that index in the list.</returns> - public IntPtr this[int i] - { - get - { - return hbFunctions.hb_list_item(this.Ptr, i); - } + HBFunctions.hb_list_rem(this.Ptr, item); } /// <summary> @@ -118,7 +111,7 @@ namespace HandBrake.Interop.Interop.Helpers { IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); Marshal.WriteIntPtr(listPtrPtr, this.Ptr); - hbFunctions.hb_list_close(listPtrPtr); + HBFunctions.hb_list_close(listPtrPtr); Marshal.FreeHGlobal(listPtrPtr); } @@ -128,8 +121,7 @@ namespace HandBrake.Interop.Interop.Helpers /// <returns>The created list.</returns> public static NativeList CreateList() { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - return new NativeList(hbFunctionsProvider.GetHbFunctionsWrapper().hb_list_init()); + return new NativeList(HBFunctions.hb_list_init()); } } } diff --git a/win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs b/win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs index 369216023..3a7f4fe40 100644 --- a/win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Utilities.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Utilities.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs b/win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs index 193769090..284cde4d6 100644 --- a/win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="IHandBrakeInstance.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="IHandBrakeInstance.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs index 6f6714caa..088272ca3 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="AnamorphicGeometry.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="AnamorphicGeometry.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs index 99f38439b..ce48ac273 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="DestSettings.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="DestSettings.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs index 59ddd0481..1407454c8 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Audio.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Audio.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs index 51989132a..0a38d33c4 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="AudioTrack.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="AudioTrack.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs index ae8924e5d..879b0180d 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Chapter.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Chapter.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs index ab822c33a..960ce796b 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Destination.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Destination.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs index 9cd5161ac..ae73a8ebd 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Filter.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Filter.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs index 9c664cfa5..b00b5e643 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Filters.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Filters.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs index fa3d26c26..5a27cd9dc 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="JsonEncodeObject.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="JsonEncodeObject.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs index b399880a5..28ec7e38a 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Metadata.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Metadata.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs index 2dc833375..d979fd70e 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Mp4Options.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Mp4Options.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs index 33ed05dc5..614ab27bd 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="QSV.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="QSV.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs index 2327e359f..7a55ade81 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Range.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Range.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs index 7f156c0c6..7727b99dc 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Source.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Source.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs index 8399daa69..6cbf61c16 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SRT.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SubImport.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs index 28558f48b..7143fb9d2 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SubtitleSearch.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SubtitleSearch.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs index 4e0d79857..5bba4b981 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SubtitleTrack.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SubtitleTrack.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs index 8c565d185..ef62774d0 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Subtitles.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Subtitles.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs index 12525c3e5..56af62869 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Video.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Video.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs b/win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs index ad7648901..6c79e30a7 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="PresetTune.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="PresetTune.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs index 49f875de9..a69c2a3bb 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="AudioList.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="AudioList.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs index bf49020d4..5753cf573 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBPreset.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBPreset.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -119,7 +119,9 @@ namespace HandBrake.Interop.Interop.Json.Presets public int PictureDARWidth { get; set; } public string PictureDeblockPreset { get; set; } + public string PictureDeblockTune { get; set; } + public string PictureDeblockCustom { get; set; } /// <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPresetCategory.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPresetCategory.cs index 90f80cd09..e240c9031 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPresetCategory.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPresetCategory.cs @@ -11,34 +11,16 @@ namespace HandBrake.Interop.Interop.Json.Presets { using System.Collections.Generic; - /// <summary> - /// The preset category. - /// </summary> public class HBPresetCategory { - /// <summary> - /// Gets or sets the children array. - /// </summary> public List<HBPreset> ChildrenArray { get; set; } - /// <summary> - /// Gets or sets a value indicating whether folder. - /// </summary> public bool Folder { get; set; } - /// <summary> - /// Gets or sets the preset name. - /// </summary> public string PresetName { get; set; } - /// <summary> - /// Description for the preset group. - /// </summary> public string PresetDescription { get; set; } - /// <summary> - /// Gets or sets the type. - /// </summary> public int Type { get; set; } } }
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs b/win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs index e7a1da64e..b59ca331f 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Task.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Task.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs index 96c6b9065..a8126180c 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="AudioAttributes.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="AudioAttributes.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -12,10 +12,15 @@ namespace HandBrake.Interop.Interop.Json.Scan public class AudioAttributes { public bool AltCommentary { get; set; } + public bool Commentary { get; set; } + public bool Default { get; set; } + public bool Normal { get; set; } + public bool Secondary { get; set; } + public bool VisuallyImpaired { get; set; } } } diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs index 65af225c7..14f732504 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Color.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Color.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs index 533ec05ae..bac455658 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Duration.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Duration.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs index 04fa33c37..f15fc30c0 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="FrameRate.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="FrameRate.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs index cc19e4923..2584ffee9 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="JsonScanObject.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="JsonScanObject.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs index bab5a79de..720b2d400 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs @@ -1,69 +1,69 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceAudioTrack.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// An audio track from the source video. -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.Interop.Json.Scan -{ - /// <summary> - /// An audio track from the source video. - /// </summary> - public class SourceAudioTrack +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceAudioTrack.cs" company="HandBrake Project (https://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// An audio track from the source video.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.Interop.Interop.Json.Scan
+{
+ /// <summary>
+ /// An audio track from the source video.
+ /// </summary>
+ public class SourceAudioTrack
{
/// <summary>
/// Gets or sets the track number (1-based).
/// </summary>
public int TrackNumber { get; set; }
- - /// <summary> - /// Gets or sets the bit rate. - /// </summary> - public int BitRate { get; set; } - - /// <summary> - /// Gets or sets the channel layout. - /// </summary> - public long ChannelLayout { get; set; } - - /// <summary> - /// Gets or sets the description. - /// </summary> - public string Description { get; set; } - - /// <summary> - /// Gets or sets the language. - /// </summary> - public string Language { get; set; } - - /// <summary> - /// Gets or sets the language code. - /// </summary> - public string LanguageCode { get; set; } - - /// <summary> - /// Gets or sets the sample rate. - /// </summary> - public int SampleRate { get; set; } - - /// <summary> - /// Gets or sets the codec. - /// </summary> - public int Codec { get; set; } - - public string CodecName { get; set; } - - public long LFECount { get; set; } - - public string ChannelLayoutName { get; set; } - - public int ChannelCount { get; set; } - - public AudioAttributes Attributes { get; set; } - - public string Name { get; set; } - } +
+ /// <summary>
+ /// Gets or sets the bit rate.
+ /// </summary>
+ public int BitRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the channel layout.
+ /// </summary>
+ public long ChannelLayout { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language.
+ /// </summary>
+ public string Language { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language code.
+ /// </summary>
+ public string LanguageCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sample rate.
+ /// </summary>
+ public int SampleRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the codec.
+ /// </summary>
+ public int Codec { get; set; }
+
+ public string CodecName { get; set; }
+
+ public long LFECount { get; set; }
+
+ public string ChannelLayoutName { get; set; }
+
+ public int ChannelCount { get; set; }
+
+ public AudioAttributes Attributes { get; set; }
+
+ public string Name { get; set; }
+ }
}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs index 02e83fe1d..7fd73de13 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceChapter.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SourceChapter.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs index e41cd1689..8eff6eecf 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceMetadata.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SourceMetadata.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -15,14 +15,23 @@ namespace HandBrake.Interop.Interop.Json.Scan public class SourceMetadata { public string Name { get; set; } + public string Artist { get; set; } + public string Composer { get; set; } + public string Comment { get; set; } + public string Genre { get; set; } + public string Album { get; set; } + public string AlbumArtist { get; set; } + public string Description { get; set; } + public string LongDescription { get; set; } + public string ReleaseDate { get; set; } } }
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs index 4fd5232ff..f133d250d 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceTitle.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SourceTitle.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs index 07ac8b032..1cc2eaec4 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SubtitleAttributes.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SubtitleAttributes.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -15,15 +15,25 @@ namespace HandBrake.Interop.Interop.Json.Scan { [JsonProperty(PropertyName = "4By3")] public bool FourByThree { get; set; } + public bool Children { get; set; } + public bool ClosedCaption { get; set; } + public bool Commentary { get; set; } + public bool Default { get; set; } + public bool Forced { get; set; } + public bool Large { get; set; } + public bool Letterbox { get; set; } + public bool Normal { get; set; } + public bool PanScan { get; set; } + public bool Wide { get; set; } } } diff --git a/win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs b/win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs index 5632b3736..376a6829b 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Geometry.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Geometry.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs b/win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs index 075c26672..5269e8a71 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="PAR.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="PAR.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs b/win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs index 4f3cfb22d..32c0db443 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Scanning.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Scanning.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs b/win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs index 5d0f5f92f..26d9b86e4 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="TaskState.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="TaskState.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -13,6 +13,8 @@ namespace HandBrake.Interop.Interop.Json.State public class TaskState { + private static readonly Dictionary<string, TaskState> TaskStates = new Dictionary<string, TaskState>(); + public static TaskState Idle = new TaskState("IDLE"); public static TaskState Scanning = new TaskState("SCANNING"); public static TaskState ScanDone = new TaskState("SCANDONE"); @@ -23,19 +25,17 @@ namespace HandBrake.Interop.Interop.Json.State public static TaskState Muxing = new TaskState("MUXING"); public static TaskState Unknown = new TaskState("UNKNOWN"); - private static readonly Dictionary<string, TaskState> taskStates = new Dictionary<string, TaskState>(); - static TaskState() { - taskStates.Add("IDLE", Idle); - taskStates.Add("SCANNING", Scanning); - taskStates.Add("SCANDONE", ScanDone); - taskStates.Add("WORKING", Working); - taskStates.Add("PAUSED", Paused); - taskStates.Add("SEARCHING", Searching); - taskStates.Add("WORKDONE", WorkDone); - taskStates.Add("MUXING", Muxing); - taskStates.Add("UNKNOWN", Unknown); + TaskStates.Add("IDLE", Idle); + TaskStates.Add("SCANNING", Scanning); + TaskStates.Add("SCANDONE", ScanDone); + TaskStates.Add("WORKING", Working); + TaskStates.Add("PAUSED", Paused); + TaskStates.Add("SEARCHING", Searching); + TaskStates.Add("WORKDONE", WorkDone); + TaskStates.Add("MUXING", Muxing); + TaskStates.Add("UNKNOWN", Unknown); } public TaskState(string code) @@ -47,8 +47,7 @@ namespace HandBrake.Interop.Interop.Json.State public static TaskState FromRepositoryValue(string code) { - TaskState state = null; - if (taskStates.TryGetValue(code, out state)) + if (TaskStates.TryGetValue(code, out TaskState state)) { return state; } diff --git a/win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs b/win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs index aa821f286..6d27b58da 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="WorkDone.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="WorkDone.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs b/win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs index 91ee98356..89e0aa960 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="BitrateLimits.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="BitrateLimits.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Cropping.cs b/win/CS/HandBrake.Interop/Interop/Model/Cropping.cs index 63a1b176a..bae0473c8 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Cropping.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Cropping.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Cropping.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Cropping.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -25,15 +25,15 @@ namespace HandBrake.Interop.Interop.Model /// Initializes a new instance of the <see cref="Cropping"/> class. /// Copy Constructor /// </summary> - /// <param name="croping"> - /// The croping. + /// <param name="cropping"> + /// The cropping. /// </param> - public Cropping(Cropping croping) + public Cropping(Cropping cropping) { - this.Top = croping.Top; - this.Bottom = croping.Bottom; - this.Left = croping.Left; - this.Right = croping.Right; + this.Top = cropping.Top; + this.Bottom = cropping.Bottom; + this.Left = cropping.Left; + this.Right = cropping.Right; } /// <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs index f98875a16..e6b68fc1e 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Anamorphic.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Anamorphic.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs index 922cdbc24..595375a50 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="CombDetect.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="CombDetect.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs index 9ceeb6132..ce7c5c5c2 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Container.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Container.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs index 1ebc03cc6..4b6c60ceb 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="DeinterlaceFilter.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="DeinterlaceFilter.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs index fb6440188..62592f0dc 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Denoise.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Denoise.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs index 0aeebdd7c..1f63d4ee1 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Detelecine.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Detelecine.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs index 4e4f241df..ae1d4b700 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBAudioEncoder.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBAudioEncoder.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs index 487e90362..3580cd726 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBContainer.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBContainer.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs index a96724c31..3130829f6 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBMixdown.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBMixdown.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs index 8f62b30ac..3fd59bcbf 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs @@ -1,9 +1,9 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBPresetTune.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBPresetTune.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> -// An object represetning the key and name of a Filter Preset or Tune option. +// An object represetning the key and name of a Filter Preset or Tune option. // </summary> // -------------------------------------------------------------------------------------------------------------------- @@ -27,9 +27,21 @@ namespace HandBrake.Interop.Interop.Model.Encoding public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; + if (ReferenceEquals(null, obj)) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != this.GetType()) + { + return false; + } + return this.Equals((HBPresetTune)obj); } diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs index ecebb0526..8116cfe30 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBRate.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBRate.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs index e60ed2668..da0c4ca73 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HBVideoEncoder.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HBVideoEncoder.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -12,18 +12,10 @@ namespace HandBrake.Interop.Interop.Model.Encoding using System.Collections.Generic; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; - /// <summary> - /// The hb video encoder. - /// </summary> public class HBVideoEncoder { - private IHbFunctions hbFunctions; - /// <summary> /// Initializes a new instance of the <see cref="HBVideoEncoder"/> class. /// </summary> @@ -41,9 +33,6 @@ namespace HandBrake.Interop.Interop.Model.Encoding /// </param> public HBVideoEncoder(int compatibleContainers, string displayName, int id, string shortName) { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - this.CompatibleContainers = compatibleContainers; this.DisplayName = displayName; this.Id = id; @@ -77,7 +66,7 @@ namespace HandBrake.Interop.Interop.Model.Encoding { get { - return InteropUtilities.ToStringListFromArrayPtr(hbFunctions.hb_video_encoder_get_presets(this.Id)); + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id)); } } @@ -88,7 +77,7 @@ namespace HandBrake.Interop.Interop.Model.Encoding { get { - return InteropUtilities.ToStringListFromArrayPtr(hbFunctions.hb_video_encoder_get_tunes(this.Id)); + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id)); } } @@ -99,7 +88,7 @@ namespace HandBrake.Interop.Interop.Model.Encoding { get { - return InteropUtilities.ToStringListFromArrayPtr(hbFunctions.hb_video_encoder_get_profiles(this.Id)); + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id)); } } @@ -110,7 +99,7 @@ namespace HandBrake.Interop.Interop.Model.Encoding { get { - return InteropUtilities.ToStringListFromArrayPtr(hbFunctions.hb_video_encoder_get_levels(this.Id)); + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id)); } } } diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs index 2c0d85b9d..566344fed 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="PictureRotation.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="PictureRotation.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs index 8c1d32174..029ee7295 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="ScaleMethod.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="ScaleMethod.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs index 5924604fe..1f2b93ce4 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Sharpen.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Sharpen.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs index 461b3931d..2ccec4bca 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="VideoEncodeRateType.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="VideoEncodeRateType.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Language.cs b/win/CS/HandBrake.Interop/Interop/Model/Language.cs index 5564a434e..5ca0ca0e6 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Language.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Language.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Language.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Language.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/PresetVersion.cs b/win/CS/HandBrake.Interop/Interop/Model/PresetVersion.cs index dbe5578f8..4fe0225b3 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/PresetVersion.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/PresetVersion.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="PresetVersion.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="PresetVersion.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> @@ -19,7 +19,9 @@ namespace HandBrake.Interop.Interop.Model } public int Major { get; } + public int Minor { get; } + public int Micro { get; } } } diff --git a/win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs b/win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs index beebc12f5..d09d05eda 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="PreviewSettings.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="PreviewSettings.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs b/win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs index 8768d0054..f833b7479 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="RawPreviewData.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="RawPreviewData.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- @@ -18,9 +18,13 @@ namespace HandBrake.Interop.Interop.Model.Preview } public byte[] RawBitmapData { get; } + public int StrideWidth { get; } + public int StrideHeight { get; } + public int Width { get; } + public int Height { get; } } } diff --git a/win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs b/win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs index 3a05f8e38..e8102eb42 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="RangeLimits.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="RangeLimits.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/Size.cs b/win/CS/HandBrake.Interop/Interop/Model/Size.cs index 6113b8bcf..e8f4d28bc 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/Size.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Size.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="Size.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="Size.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs b/win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs index 23b43df79..5b5972015 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceVideoInfo.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="SourceVideoInfo.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs b/win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs index 64fbd6f4f..6387763da 100644 --- a/win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="VideoQualityLimits.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="VideoQualityLimits.cs" company="HandBrake Project (https://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> diff --git a/win/CS/HandBrake.Interop/Interop/Providers/HbFunctionsProvider.cs b/win/CS/HandBrake.Interop/Interop/Providers/HbFunctionsProvider.cs deleted file mode 100644 index 3b964ff8c..000000000 --- a/win/CS/HandBrake.Interop/Interop/Providers/HbFunctionsProvider.cs +++ /dev/null @@ -1,30 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HbFunctionsProvider.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// Provides an instance of IHbFunctions for use by the GUI. -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.Interop.Providers -{ - using HandBrake.Interop.Interop.HbLib.Wrappers; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; - using HandBrake.Interop.Interop.Providers.Interfaces; - - public class HbFunctionsProvider : IHbFunctionsProvider - { - private static IHbFunctions hbFunctions; - - public IHbFunctions GetHbFunctionsWrapper() - { - if (hbFunctions == null) - { - hbFunctions = new HbFunctionsDirect(); - } - - return hbFunctions; - } - } -} diff --git a/win/CS/HandBrake.Interop/Interop/Providers/Interfaces/IHbFunctionsProvider.cs b/win/CS/HandBrake.Interop/Interop/Providers/Interfaces/IHbFunctionsProvider.cs deleted file mode 100644 index f64f54594..000000000 --- a/win/CS/HandBrake.Interop/Interop/Providers/Interfaces/IHbFunctionsProvider.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="IHbFunctionsProvider.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// Provides an instance of IHbFunctions for use by the GUI. -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.Interop.Providers.Interfaces -{ - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; - - public interface IHbFunctionsProvider - { - IHbFunctions GetHbFunctionsWrapper(); - } -}
\ No newline at end of file |