diff options
author | randomengy <[email protected]> | 2012-11-21 08:28:09 +0000 |
---|---|---|
committer | randomengy <[email protected]> | 2012-11-21 08:28:09 +0000 |
commit | 8612b1b6ab0a60a9b9cca384ca62f8a12d3cbb5b (patch) | |
tree | c868d25085153b896465a47d36ab4783593c30ba /win | |
parent | b1a9af3d8f002d2e43fc7cbaf968137c0fe36dfb (diff) |
Interop: Updated to support removal of title->job. Removed some obsolete properties on EncodingProfile, changed x264 Tunes to be a collection and replaced CustomCropping bool with CroppingType enum. Another fix to make sure Loose/Strict anamorphic get the correct PAR values.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5072 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
11 files changed, 177 insertions, 98 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index 6249c7f86..4b54674b6 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -233,31 +233,29 @@ namespace HandBrake.Interop /// <returns>An image with the requested preview.</returns>
public BitmapImage GetPreview(EncodeJob job, int previewNumber)
{
- hb_title_s title = this.GetOriginalTitle(job.Title);
+ IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, job.Title);
+ var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);
- hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(title.job);
List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);
// There are some problems with getting previews with deinterlacing. Disabling for now.
nativeJob.deinterlace = 0;
- // Create a new job pointer from our modified job object
- IntPtr newJob = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_job_s)));
- Marshal.StructureToPtr(nativeJob, newJob, false);
- allocatedMemory.Add(newJob);
-
int outputWidth = nativeJob.width;
int outputHeight = nativeJob.height;
int imageBufferSize = outputWidth * outputHeight * 4;
IntPtr nativeBuffer = Marshal.AllocHGlobal(imageBufferSize);
allocatedMemory.Add(nativeBuffer);
- HBFunctions.hb_set_job(this.hbHandle, job.Title, ref nativeJob);
- HBFunctions.hb_get_preview(this.hbHandle, ref title, previewNumber, nativeBuffer);
+ HBFunctions.hb_get_preview(this.hbHandle, ref nativeJob, previewNumber, nativeBuffer);
+
+ // We've used the job to get the preview. Clean up the job.
+ InteropUtilities.CloseJob(nativeJobPtr);
// Copy the filled image buffer to a managed array.
byte[] managedBuffer = new byte[imageBufferSize];
Marshal.Copy(nativeBuffer, managedBuffer, 0, imageBufferSize);
+ // We've copied the data out of unmanaged memory. Clean up that memory now.
InteropUtilities.FreeMemory(allocatedMemory);
var bitmap = new System.Drawing.Bitmap(outputWidth, outputHeight);
@@ -401,11 +399,16 @@ namespace HandBrake.Interop /// for calculating bitrate when the target size would be wrong.</param>
public void StartEncode(EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds)
{
+ EncodingProfile profile = job.EncodingProfile;
this.currentJob = job;
- hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.GetOriginalTitle(job.Title).job);
+
+ IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, job.Title);
+ var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);
+
+ //hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.GetOriginalTitle(job.Title).job);
this.encodeAllocatedMemory = this.ApplyJob(ref nativeJob, job, preview, previewNumber, previewSeconds, overallSelectedLengthSeconds);
- if (!preview && job.EncodingProfile.IncludeChapterMarkers)
+ if (!preview && profile.IncludeChapterMarkers)
{
Title title = this.GetTitle(job.Title);
int numChapters = title.Chapters.Count;
@@ -439,25 +442,25 @@ namespace HandBrake.Interop }
}
- string x264Options = job.EncodingProfile.X264Options ?? string.Empty;
+ string x264Options = profile.X264Options ?? string.Empty;
IntPtr originalX264Options = Marshal.StringToHGlobalAnsi(x264Options);
this.encodeAllocatedMemory.Add(originalX264Options);
- if (!string.IsNullOrEmpty(job.EncodingProfile.X264Profile))
+ if (!string.IsNullOrEmpty(profile.X264Profile))
{
- nativeJob.x264_profile = Marshal.StringToHGlobalAnsi(job.EncodingProfile.X264Profile);
+ nativeJob.x264_profile = Marshal.StringToHGlobalAnsi(profile.X264Profile);
this.encodeAllocatedMemory.Add(nativeJob.x264_profile);
}
- if (!string.IsNullOrEmpty(job.EncodingProfile.X264Preset))
+ if (!string.IsNullOrEmpty(profile.X264Preset))
{
- nativeJob.x264_preset = Marshal.StringToHGlobalAnsi(job.EncodingProfile.X264Preset);
+ nativeJob.x264_preset = Marshal.StringToHGlobalAnsi(profile.X264Preset);
this.encodeAllocatedMemory.Add(nativeJob.x264_preset);
}
- if (!string.IsNullOrEmpty(job.EncodingProfile.X264Tune))
+ if (profile.X264Tunes != null && profile.X264Tunes.Count > 0)
{
- nativeJob.x264_tune = Marshal.StringToHGlobalAnsi(job.EncodingProfile.X264Tune);
+ nativeJob.x264_tune = Marshal.StringToHGlobalAnsi(string.Join(",", profile.X264Tunes));
this.encodeAllocatedMemory.Add(nativeJob.x264_tune);
}
@@ -519,6 +522,9 @@ namespace HandBrake.Interop HBFunctions.hb_start(this.hbHandle);
+ // Should be safe to clean up the job we started with; a copy is in the queue now.
+ InteropUtilities.CloseJob(nativeJobPtr);
+
this.encodePollTimer = new System.Timers.Timer();
this.encodePollTimer.Interval = EncodePollIntervalMs;
@@ -577,9 +583,10 @@ namespace HandBrake.Interop /// <param name="parHeight">The pixel aspect Y number.</param>
public void GetSize(EncodeJob job, out int width, out int height, out int parWidth, out int parHeight)
{
+ Title title = this.GetTitle(job.Title);
+
if (job.EncodingProfile.Anamorphic == Anamorphic.None)
{
- Title title = this.GetTitle(job.Title);
Size storageDimensions = CalculateNonAnamorphicOutput(job.EncodingProfile, title);
width = storageDimensions.Width;
@@ -591,22 +598,24 @@ namespace HandBrake.Interop return;
}
- var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.GetOriginalTitle(job.Title).job);
- List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);
+ IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, job.Title);
+ var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);
- int refWidth = 0;
- int refHeight = 0;
- int refParWidth = 0;
- int refParHeight = 0;
- HBFunctions.hb_set_anamorphic_size(ref nativeJob, ref refWidth, ref refHeight, ref refParWidth, ref refParHeight);
+ List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);
InteropUtilities.FreeMemory(allocatedMemory);
- width = refWidth;
- height = refHeight;
- parWidth = refParWidth;
- parHeight = refParHeight;
+ InteropUtilities.CloseJob(nativeJobPtr);
+
+ // During the ApplyJob call, it modified nativeJob to have the correct width, height and PAR.
+ // We use those for the size.
+ width = nativeJob.width;
+ height = nativeJob.height;
+ parWidth = nativeJob.anamorphic.par_width;
+ parHeight = nativeJob.anamorphic.par_height;
}
+
+
/// <summary>
/// Frees any resources associated with this object.
/// </summary>
@@ -649,13 +658,17 @@ namespace HandBrake.Interop int height = profile.Height;
Cropping crop;
- if (profile.CustomCropping)
- {
- crop = profile.Cropping;
- }
- else
+ switch (profile.CroppingType)
{
- crop = title.AutoCropDimensions;
+ case CroppingType.Automatic:
+ crop = title.AutoCropDimensions;
+ break;
+ case CroppingType.Custom:
+ crop = profile.Cropping;
+ break;
+ default:
+ crop = new Cropping();
+ break;
}
sourceWidth -= crop.Left;
@@ -771,8 +784,9 @@ namespace HandBrake.Interop {
this.titles = new List<Title>();
- IntPtr listPtr = HBFunctions.hb_get_titles(this.hbHandle);
- this.originalTitles = InteropUtilities.ConvertList<hb_title_s>(listPtr);
+ IntPtr titleSetPtr = HBFunctions.hb_get_title_set(this.hbHandle);
+ hb_title_set_s titleSet = InteropUtilities.ReadStructure<hb_title_set_s>(titleSetPtr);
+ this.originalTitles = InteropUtilities.ConvertList<hb_title_s>(titleSet.list_title);
foreach (hb_title_s title in this.originalTitles)
{
@@ -782,8 +796,7 @@ namespace HandBrake.Interop if (this.originalTitles.Count > 0)
{
- var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.originalTitles[0].job);
- this.featureTitle = nativeJob.feature;
+ this.featureTitle = titleSet.feature;
}
else
{
@@ -977,16 +990,7 @@ namespace HandBrake.Interop nativeJob.chapter_markers = profile.IncludeChapterMarkers ? 1 : 0;
- Cropping crop;
-
- if (profile.CustomCropping)
- {
- crop = profile.Cropping;
- }
- else
- {
- crop = title.AutoCropDimensions;
- }
+ Cropping crop = GetCropping(profile, title);
nativeJob.crop[0] = crop.Top;
nativeJob.crop[1] = crop.Bottom;
@@ -1190,6 +1194,9 @@ namespace HandBrake.Interop break;
case Anamorphic.Strict:
nativeJob.anamorphic.mode = 1;
+
+ nativeJob.anamorphic.par_width = title.ParVal.Width;
+ nativeJob.anamorphic.par_height = title.ParVal.Height;
break;
case Anamorphic.Loose:
nativeJob.anamorphic.mode = 2;
@@ -1200,6 +1207,8 @@ namespace HandBrake.Interop nativeJob.maxWidth = profile.MaxWidth;
+ nativeJob.anamorphic.par_width = title.ParVal.Width;
+ nativeJob.anamorphic.par_height = title.ParVal.Height;
break;
case Anamorphic.Custom:
nativeJob.anamorphic.mode = 3;
@@ -1763,5 +1772,29 @@ namespace HandBrake.Interop return newTitle;
}
+
+ /// <summary>
+ /// Gets the cropping to use for the given encoding profile and title.
+ /// </summary>
+ /// <param name="profile">The encoding profile to use.</param>
+ /// <param name="title">The title being encoded.</param>
+ /// <returns>The cropping to use for the encode.</returns>
+ private static Cropping GetCropping(EncodingProfile profile, Title title)
+ {
+ Cropping crop;
+ switch (profile.CroppingType)
+ {
+ case CroppingType.Automatic:
+ crop = title.AutoCropDimensions;
+ break;
+ case CroppingType.Custom:
+ crop = profile.Cropping;
+ break;
+ default:
+ crop = new Cropping();
+ break;
+ }
+ return crop;
+ }
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj index 07503ded8..3fbeace49 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj @@ -150,6 +150,7 @@ <Compile Include="Model\Encoders.cs" />
<Compile Include="Model\Encoding\Anamorphic.cs" />
<Compile Include="Model\Encoding\AudioEncodeRateType.cs" />
+ <Compile Include="Model\Encoding\CroppingType.cs" />
<Compile Include="Model\Encoding\HBAudioEncoder.cs" />
<Compile Include="Model\Encoding\AudioEncoder.cs" />
<Compile Include="Model\Encoding\AudioEncoding.cs" />
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index e5d26e324..f033dc448 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -103,7 +103,7 @@ namespace HandBrake.Interop.HbLib ///param2: int
///param3: uint8_t*
[DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_get_preview(IntPtr hbHandle, ref hb_title_s title, int preview, IntPtr buffer);
+ public static extern void hb_get_preview(IntPtr hbHandle, ref hb_job_s title, int preview, IntPtr buffer);
/// Return Type: void
@@ -296,11 +296,11 @@ namespace HandBrake.Interop.HbLib ///hb_title_set_t * hb_get_title_set( hb_handle_t * );
[DllImport("hb.dll", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)]
- public static extern hb_title_set_s hb_get_title_set(IntPtr hbHandle);
+ public static extern IntPtr hb_get_title_set(IntPtr hbHandle);
///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index );
[DllImport("hb.dll", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)]
- public static extern hb_job_s hb_job_init_by_index(IntPtr hbHandle, int title_index);
+ public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index);
///hb_job_t * hb_job_init( hb_title_t * title );
[DllImport("hb.dll", EntryPoint = "hb_job_init", CallingConvention = CallingConvention.Cdecl)]
@@ -312,7 +312,7 @@ namespace HandBrake.Interop.HbLib ///void hb_job_close( hb_job_t ** job );
[DllImport("hb.dll", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_job_close(ref hb_job_s job);
+ public static extern void hb_job_close(IntPtr job);
///void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts );
[DllImport("hb.dll", EntryPoint = "hb_job_set_advanced_opts", CallingConvention = CallingConvention.Cdecl)]
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs index 36820c0c4..fd464b7c8 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs @@ -98,39 +98,48 @@ namespace HandBrake.Interop.HbLib [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct hb_metadata_s
{
- /// char[255]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string name;
- /// char[255]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string artist;
- /// char[255]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string composer;
- /// char[255]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string release_date;
- /// char[1024]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string comment;
- /// char[255]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string album;
- /// char[255]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string album_artist;
+
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string genre;
- /// uint32_t->unsigned int
- public uint coverart_size;
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string description;
+
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string long_description;
/// uint8_t*
- public IntPtr coverart;
+ public IntPtr list_coverart;
}
[StructLayout(LayoutKind.Sequential)]
@@ -398,16 +407,6 @@ namespace HandBrake.Interop.HbLib public uint x;
}
- [StructLayout(LayoutKind.Sequential)]
- public struct hb_title_set_s
- {
- ///hb_list_t *
- public hb_list_s list_title;
-
- // int
- public int feature;
- }
-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LoggingCallback(string message);
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_chapter_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_chapter_s.cs index 616b46013..fa3c63a8c 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_chapter_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_chapter_s.cs @@ -10,9 +10,9 @@ namespace HandBrake.Interop.HbLib
{
- using System.Runtime.InteropServices;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct hb_chapter_s
{
/// int
@@ -51,8 +51,8 @@ namespace HandBrake.Interop.HbLib /// uint64_t->unsigned int
public ulong duration;
- /// char[1024]
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
+ /// char *
+ [MarshalAs(UnmanagedType.LPStr)]
public string title;
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs index cb70f83ef..d4c95d904 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs @@ -114,6 +114,8 @@ namespace HandBrake.Interop.HbLib /// int
public int color_matrix;
+ public IntPtr list_chapter;
+
/// hb_list_t*
public IntPtr list_audio;
@@ -123,6 +125,10 @@ namespace HandBrake.Interop.HbLib /// hb_list_t*
public IntPtr list_subtitle;
+ public IntPtr list_attachment;
+
+ public IntPtr metadata;
+
/// int
public int mux;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs index f6d9c0ffd..136c2df74 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs @@ -160,6 +160,16 @@ namespace HandBrake.Interop.HbLib public uint flags;
}
+ [StructLayout(LayoutKind.Sequential)]
+ public struct hb_title_set_s
+ {
+ ///hb_list_t *
+ public IntPtr list_title;
+
+ // int
+ public int feature;
+ }
+
public enum hb_title_type_anon
{
HB_DVD_TYPE,
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs index 3a7f1c01e..db72feac5 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs @@ -163,6 +163,23 @@ namespace HandBrake.Interop }
/// <summary>
+ /// Closes the given job.
+ /// </summary>
+ /// <param name="nativeJobPtr">The pointer to the job.</param>
+ public static void CloseJob(IntPtr nativeJobPtr)
+ {
+ // Create a point to the job pointer first.
+ IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
+
+ // 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);
+
+ // Free the pointer we used.
+ Marshal.FreeHGlobal(nativeJobPtrPtr);
+ }
+
+ /// <summary>
/// Frees all the memory locations in the given list.
/// </summary>
/// <param name="memoryList">The list of memory locations to free.</param>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/CroppingType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/CroppingType.cs new file mode 100644 index 000000000..64f68a476 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/CroppingType.cs @@ -0,0 +1,18 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="CroppingType.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>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.Interop.Model.Encoding
+{
+ /// <summary>
+ /// The type of cropping to apply.
+ /// </summary>
+ public enum CroppingType
+ {
+ Automatic,
+ None,
+ Custom
+ }
+}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs index f5326e89b..6d2aafec3 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs @@ -32,7 +32,7 @@ namespace HandBrake.Interop.Model.Encoding public int Height { get; set; }
public int MaxWidth { get; set; }
public int MaxHeight { get; set; }
- public bool CustomCropping { get; set; }
+ public CroppingType CroppingType { get; set; }
public Cropping Cropping { get; set; }
public Anamorphic Anamorphic { get; set; }
public bool UseDisplayWidth { get; set; }
@@ -57,7 +57,8 @@ namespace HandBrake.Interop.Model.Encoding public string X264Options { get; set; }
public string X264Profile { get; set; }
public string X264Preset { get; set; }
- public string X264Tune { get; set; }
+
+ public List<string> X264Tunes { get; set; }
public string H264Level { get; set; }
public VideoEncodeRateType VideoEncodeRateType { get; set; }
public double Quality { get; set; }
@@ -68,15 +69,12 @@ namespace HandBrake.Interop.Model.Encoding public double Framerate { get; set; }
public bool ConstantFramerate { get; set; }
- [Obsolete("This setting is obsolete. Use Framerate and ConstantFramerate instead.")]
- public bool PeakFramerate { get; set; }
-
public List<AudioEncoding> AudioEncodings { get; set; }
public string AudioEncoderFallback { get; set; }
public EncodingProfile Clone()
{
- EncodingProfile profile = new EncodingProfile
+ var profile = new EncodingProfile
{
OutputFormat = this.OutputFormat,
PreferredExtension = this.PreferredExtension,
@@ -89,7 +87,7 @@ namespace HandBrake.Interop.Model.Encoding Height = this.Height,
MaxWidth = this.MaxWidth,
MaxHeight = this.MaxHeight,
- CustomCropping = this.CustomCropping,
+ CroppingType = this.CroppingType,
Cropping = this.Cropping.Clone(),
Anamorphic = this.Anamorphic,
UseDisplayWidth = this.UseDisplayWidth,
@@ -114,7 +112,7 @@ namespace HandBrake.Interop.Model.Encoding X264Options = this.X264Options,
X264Profile = this.X264Profile,
X264Preset = this.X264Preset,
- X264Tune = this.X264Tune,
+ X264Tunes = this.X264Tunes,
H264Level = this.H264Level,
VideoEncodeRateType = this.VideoEncodeRateType,
Quality = this.Quality,
@@ -124,9 +122,6 @@ namespace HandBrake.Interop.Model.Encoding TurboFirstPass = this.TurboFirstPass,
Framerate = this.Framerate,
ConstantFramerate = this.ConstantFramerate,
-#pragma warning disable 612,618
- PeakFramerate = this.PeakFramerate,
-#pragma warning restore 612,618
AudioEncodings = new List<AudioEncoding>(this.AudioEncodings)
};
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs index 076afdeb3..395fe9363 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.31.0.0")]
-[assembly: AssemblyFileVersion("1.31.0.0")]
+[assembly: AssemblyVersion("1.32.0.0")]
+[assembly: AssemblyFileVersion("1.32.0.0")]
|