]> granicus.if.org Git - handbrake/commitdiff
Interop: Updated to support removal of title->job. Removed some obsolete properties...
authorrandomengy <david.rickard@gmail.com>
Wed, 21 Nov 2012 08:28:09 +0000 (08:28 +0000)
committerrandomengy <david.rickard@gmail.com>
Wed, 21 Nov 2012 08:28:09 +0000 (08:28 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5072 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_chapter_s.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs
win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/CroppingType.cs [new file with mode: 0644]
win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs

index 6249c7f86f6e504d21b3e2996f79af31a8bb2cbf..4b54674b6539c2ca2876e88943b729b19704d530 100644 (file)
@@ -233,31 +233,29 @@ namespace HandBrake.Interop
                /// <returns>An image with the requested preview.</returns>\r
                public BitmapImage GetPreview(EncodeJob job, int previewNumber)\r
                {\r
-                       hb_title_s title = this.GetOriginalTitle(job.Title);\r
+                       IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, job.Title);\r
+                       var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);\r
 \r
-                       hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(title.job);\r
                        List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);\r
                        \r
                        // There are some problems with getting previews with deinterlacing. Disabling for now.\r
                        nativeJob.deinterlace = 0;\r
 \r
-                       // Create a new job pointer from our modified job object\r
-                       IntPtr newJob = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_job_s)));\r
-                       Marshal.StructureToPtr(nativeJob, newJob, false);\r
-                       allocatedMemory.Add(newJob);\r
-\r
                        int outputWidth = nativeJob.width;\r
                        int outputHeight = nativeJob.height;\r
                        int imageBufferSize = outputWidth * outputHeight * 4;\r
                        IntPtr nativeBuffer = Marshal.AllocHGlobal(imageBufferSize);\r
                        allocatedMemory.Add(nativeBuffer);\r
-                       HBFunctions.hb_set_job(this.hbHandle, job.Title, ref nativeJob);\r
-                       HBFunctions.hb_get_preview(this.hbHandle, ref title, previewNumber, nativeBuffer);\r
+                       HBFunctions.hb_get_preview(this.hbHandle, ref nativeJob, previewNumber, nativeBuffer);\r
+\r
+                       // We've used the job to get the preview. Clean up the job.\r
+                       InteropUtilities.CloseJob(nativeJobPtr);\r
 \r
                        // Copy the filled image buffer to a managed array.\r
                        byte[] managedBuffer = new byte[imageBufferSize];\r
                        Marshal.Copy(nativeBuffer, managedBuffer, 0, imageBufferSize);\r
 \r
+                       // We've copied the data out of unmanaged memory. Clean up that memory now.\r
                        InteropUtilities.FreeMemory(allocatedMemory);\r
 \r
                        var bitmap = new System.Drawing.Bitmap(outputWidth, outputHeight);\r
@@ -401,11 +399,16 @@ namespace HandBrake.Interop
                /// for calculating bitrate when the target size would be wrong.</param>\r
                public void StartEncode(EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds)\r
                {\r
+                       EncodingProfile profile = job.EncodingProfile;\r
                        this.currentJob = job;\r
-                       hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.GetOriginalTitle(job.Title).job);\r
+\r
+                       IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, job.Title);\r
+                       var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);\r
+\r
+                       //hb_job_s nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.GetOriginalTitle(job.Title).job);\r
                        this.encodeAllocatedMemory = this.ApplyJob(ref nativeJob, job, preview, previewNumber, previewSeconds, overallSelectedLengthSeconds);\r
 \r
-                       if (!preview && job.EncodingProfile.IncludeChapterMarkers)\r
+                       if (!preview && profile.IncludeChapterMarkers)\r
                        {\r
                                Title title = this.GetTitle(job.Title);\r
                                int numChapters = title.Chapters.Count;\r
@@ -439,25 +442,25 @@ namespace HandBrake.Interop
                                }\r
                        }\r
 \r
-                       string x264Options = job.EncodingProfile.X264Options ?? string.Empty;\r
+                       string x264Options = profile.X264Options ?? string.Empty;\r
                        IntPtr originalX264Options = Marshal.StringToHGlobalAnsi(x264Options);\r
                        this.encodeAllocatedMemory.Add(originalX264Options);\r
 \r
-                       if (!string.IsNullOrEmpty(job.EncodingProfile.X264Profile))\r
+                       if (!string.IsNullOrEmpty(profile.X264Profile))\r
                        {\r
-                               nativeJob.x264_profile = Marshal.StringToHGlobalAnsi(job.EncodingProfile.X264Profile);\r
+                               nativeJob.x264_profile = Marshal.StringToHGlobalAnsi(profile.X264Profile);\r
                                this.encodeAllocatedMemory.Add(nativeJob.x264_profile);\r
                        }\r
 \r
-                       if (!string.IsNullOrEmpty(job.EncodingProfile.X264Preset))\r
+                       if (!string.IsNullOrEmpty(profile.X264Preset))\r
                        {\r
-                               nativeJob.x264_preset = Marshal.StringToHGlobalAnsi(job.EncodingProfile.X264Preset);\r
+                               nativeJob.x264_preset = Marshal.StringToHGlobalAnsi(profile.X264Preset);\r
                                this.encodeAllocatedMemory.Add(nativeJob.x264_preset);\r
                        }\r
 \r
-                       if (!string.IsNullOrEmpty(job.EncodingProfile.X264Tune))\r
+                       if (profile.X264Tunes != null && profile.X264Tunes.Count > 0)\r
                        {\r
-                               nativeJob.x264_tune = Marshal.StringToHGlobalAnsi(job.EncodingProfile.X264Tune);\r
+                               nativeJob.x264_tune = Marshal.StringToHGlobalAnsi(string.Join(",", profile.X264Tunes));\r
                                this.encodeAllocatedMemory.Add(nativeJob.x264_tune);\r
                        }\r
 \r
@@ -519,6 +522,9 @@ namespace HandBrake.Interop
 \r
                        HBFunctions.hb_start(this.hbHandle);\r
 \r
+                       // Should be safe to clean up the job we started with; a copy is in the queue now.\r
+                       InteropUtilities.CloseJob(nativeJobPtr);\r
+\r
                        this.encodePollTimer = new System.Timers.Timer();\r
                        this.encodePollTimer.Interval = EncodePollIntervalMs;\r
 \r
@@ -577,9 +583,10 @@ namespace HandBrake.Interop
                /// <param name="parHeight">The pixel aspect Y number.</param>\r
                public void GetSize(EncodeJob job, out int width, out int height, out int parWidth, out int parHeight)\r
                {\r
+                       Title title = this.GetTitle(job.Title);\r
+\r
                        if (job.EncodingProfile.Anamorphic == Anamorphic.None)\r
                        {\r
-                               Title title = this.GetTitle(job.Title);\r
                                Size storageDimensions = CalculateNonAnamorphicOutput(job.EncodingProfile, title);\r
 \r
                                width = storageDimensions.Width;\r
@@ -591,22 +598,24 @@ namespace HandBrake.Interop
                                return;\r
                        }\r
 \r
-                       var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.GetOriginalTitle(job.Title).job);\r
-                       List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);\r
+                       IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, job.Title);\r
+                       var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);\r
 \r
-                       int refWidth = 0;\r
-                       int refHeight = 0;\r
-                       int refParWidth = 0;\r
-                       int refParHeight = 0;\r
-                       HBFunctions.hb_set_anamorphic_size(ref nativeJob, ref refWidth, ref refHeight, ref refParWidth, ref refParHeight);\r
+                       List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);\r
                        InteropUtilities.FreeMemory(allocatedMemory);\r
 \r
-                       width = refWidth;\r
-                       height = refHeight;\r
-                       parWidth = refParWidth;\r
-                       parHeight = refParHeight;\r
+                       InteropUtilities.CloseJob(nativeJobPtr);\r
+\r
+                       // During the ApplyJob call, it modified nativeJob to have the correct width, height and PAR.\r
+                       // We use those for the size.\r
+                       width = nativeJob.width;\r
+                       height = nativeJob.height;\r
+                       parWidth = nativeJob.anamorphic.par_width;\r
+                       parHeight = nativeJob.anamorphic.par_height;\r
                }\r
 \r
+\r
+\r
                /// <summary>\r
                /// Frees any resources associated with this object.\r
                /// </summary>\r
@@ -649,13 +658,17 @@ namespace HandBrake.Interop
                        int height = profile.Height;\r
 \r
                        Cropping crop;\r
-                       if (profile.CustomCropping)\r
-                       {\r
-                               crop = profile.Cropping;\r
-                       }\r
-                       else\r
+                       switch (profile.CroppingType)\r
                        {\r
-                               crop = title.AutoCropDimensions;\r
+                               case CroppingType.Automatic:\r
+                                       crop = title.AutoCropDimensions;\r
+                                       break;\r
+                               case CroppingType.Custom:\r
+                                       crop = profile.Cropping;\r
+                                       break;\r
+                               default:\r
+                                       crop = new Cropping();\r
+                                       break;\r
                        }\r
 \r
                        sourceWidth -= crop.Left;\r
@@ -771,8 +784,9 @@ namespace HandBrake.Interop
                        {\r
                                this.titles = new List<Title>();\r
 \r
-                               IntPtr listPtr = HBFunctions.hb_get_titles(this.hbHandle);\r
-                               this.originalTitles = InteropUtilities.ConvertList<hb_title_s>(listPtr);\r
+                               IntPtr titleSetPtr = HBFunctions.hb_get_title_set(this.hbHandle);\r
+                               hb_title_set_s titleSet = InteropUtilities.ReadStructure<hb_title_set_s>(titleSetPtr);\r
+                               this.originalTitles = InteropUtilities.ConvertList<hb_title_s>(titleSet.list_title);\r
 \r
                                foreach (hb_title_s title in this.originalTitles)\r
                                {\r
@@ -782,8 +796,7 @@ namespace HandBrake.Interop
 \r
                                if (this.originalTitles.Count > 0)\r
                                {\r
-                                       var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(this.originalTitles[0].job);\r
-                                       this.featureTitle = nativeJob.feature;\r
+                                       this.featureTitle = titleSet.feature;\r
                                }\r
                                else\r
                                {\r
@@ -977,16 +990,7 @@ namespace HandBrake.Interop
 \r
                        nativeJob.chapter_markers = profile.IncludeChapterMarkers ? 1 : 0;\r
 \r
-                       Cropping crop;\r
-\r
-                       if (profile.CustomCropping)\r
-                       {\r
-                               crop = profile.Cropping;\r
-                       }\r
-                       else\r
-                       {\r
-                               crop = title.AutoCropDimensions;\r
-                       }\r
+                       Cropping crop = GetCropping(profile, title);\r
 \r
                        nativeJob.crop[0] = crop.Top;\r
                        nativeJob.crop[1] = crop.Bottom;\r
@@ -1190,6 +1194,9 @@ namespace HandBrake.Interop
                                        break;\r
                                case Anamorphic.Strict:\r
                                        nativeJob.anamorphic.mode = 1;\r
+\r
+                                       nativeJob.anamorphic.par_width = title.ParVal.Width;\r
+                                       nativeJob.anamorphic.par_height = title.ParVal.Height;\r
                                        break;\r
                                case Anamorphic.Loose:\r
                                        nativeJob.anamorphic.mode = 2;\r
@@ -1200,6 +1207,8 @@ namespace HandBrake.Interop
 \r
                                        nativeJob.maxWidth = profile.MaxWidth;\r
 \r
+                                       nativeJob.anamorphic.par_width = title.ParVal.Width;\r
+                                       nativeJob.anamorphic.par_height = title.ParVal.Height;\r
                                        break;\r
                                case Anamorphic.Custom:\r
                                        nativeJob.anamorphic.mode = 3;\r
@@ -1763,5 +1772,29 @@ namespace HandBrake.Interop
 \r
                        return newTitle;\r
                }\r
+\r
+               /// <summary>\r
+               /// Gets the cropping to use for the given encoding profile and title.\r
+               /// </summary>\r
+               /// <param name="profile">The encoding profile to use.</param>\r
+               /// <param name="title">The title being encoded.</param>\r
+               /// <returns>The cropping to use for the encode.</returns>\r
+               private static Cropping GetCropping(EncodingProfile profile, Title title)\r
+               {\r
+                       Cropping crop;\r
+                       switch (profile.CroppingType)\r
+                       {\r
+                               case CroppingType.Automatic:\r
+                                       crop = title.AutoCropDimensions;\r
+                                       break;\r
+                               case CroppingType.Custom:\r
+                                       crop = profile.Cropping;\r
+                                       break;\r
+                               default:\r
+                                       crop = new Cropping();\r
+                                       break;\r
+                       }\r
+                       return crop;\r
+               }\r
        }\r
 }\r
index 07503ded8c3ff55711a827a9f962418fce38a46c..3fbeace49a9a05d1a37629aa2546147572444447 100644 (file)
     <Compile Include="Model\Encoders.cs" />\r
     <Compile Include="Model\Encoding\Anamorphic.cs" />\r
     <Compile Include="Model\Encoding\AudioEncodeRateType.cs" />\r
+    <Compile Include="Model\Encoding\CroppingType.cs" />\r
     <Compile Include="Model\Encoding\HBAudioEncoder.cs" />\r
     <Compile Include="Model\Encoding\AudioEncoder.cs" />\r
     <Compile Include="Model\Encoding\AudioEncoding.cs" />\r
index e5d26e324aa34a9b78f634e2ba20903bcba2d53b..f033dc4488e7247483d0ab8fb746cc0299f81c14 100644 (file)
@@ -103,7 +103,7 @@ namespace HandBrake.Interop.HbLib
                ///param2: int\r
                ///param3: uint8_t*\r
                [DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]\r
-               public static extern void hb_get_preview(IntPtr hbHandle, ref hb_title_s title, int preview, IntPtr buffer);\r
+               public static extern void hb_get_preview(IntPtr hbHandle, ref hb_job_s title, int preview, IntPtr buffer);\r
 \r
 \r
                /// Return Type: void\r
@@ -296,11 +296,11 @@ namespace HandBrake.Interop.HbLib
 \r
                ///hb_title_set_t  * hb_get_title_set( hb_handle_t * );\r
                [DllImport("hb.dll", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)]\r
-               public static extern hb_title_set_s hb_get_title_set(IntPtr hbHandle);\r
+               public static extern IntPtr hb_get_title_set(IntPtr hbHandle);\r
 \r
                ///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index );\r
                [DllImport("hb.dll", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)]\r
-               public static extern hb_job_s hb_job_init_by_index(IntPtr hbHandle, int title_index);\r
+               public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index);\r
 \r
                ///hb_job_t * hb_job_init( hb_title_t * title );\r
                [DllImport("hb.dll", EntryPoint = "hb_job_init", CallingConvention = CallingConvention.Cdecl)]\r
@@ -312,7 +312,7 @@ namespace HandBrake.Interop.HbLib
 \r
                ///void hb_job_close( hb_job_t ** job );\r
                [DllImport("hb.dll", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)]\r
-               public static extern void hb_job_close(ref hb_job_s job);\r
+               public static extern void hb_job_close(IntPtr job);\r
 \r
                ///void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts );\r
                [DllImport("hb.dll", EntryPoint = "hb_job_set_advanced_opts", CallingConvention = CallingConvention.Cdecl)]\r
index 36820c0c4d38a4fc579f09aa62a6e372beb30133..fd464b7c8885f99b2419041486926cfeb42b3a38 100644 (file)
@@ -98,39 +98,48 @@ namespace HandBrake.Interop.HbLib
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
        public struct hb_metadata_s\r
        {\r
-               /// char[255]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string name;\r
 \r
-               /// char[255]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string artist;\r
 \r
-               /// char[255]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string composer;\r
 \r
-               /// char[255]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string release_date;\r
 \r
-               /// char[1024]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string comment;\r
 \r
-               /// char[255]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string album;\r
 \r
-               /// char[255]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
+               public string album_artist;\r
+\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string genre;\r
 \r
-               /// uint32_t->unsigned int\r
-               public uint coverart_size;\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
+               public string description;\r
+\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
+               public string long_description;\r
 \r
                /// uint8_t*\r
-               public IntPtr coverart;\r
+               public IntPtr list_coverart;\r
        }\r
 \r
        [StructLayout(LayoutKind.Sequential)]\r
@@ -398,16 +407,6 @@ namespace HandBrake.Interop.HbLib
                public uint x;\r
        }\r
 \r
-    [StructLayout(LayoutKind.Sequential)]\r
-    public struct hb_title_set_s\r
-    {\r
-        ///hb_list_t   *\r
-        public hb_list_s list_title;\r
-\r
-        // int\r
-        public int feature;\r
-    }\r
-\r
        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\r
        public delegate void LoggingCallback(string message);\r
 }\r
index 616b46013e86072458a92eee852f74619c0e060e..fa3c63a8c2bf51187a95d76be06cd0d4a2fc6da2 100644 (file)
@@ -10,9 +10,9 @@
 \r
 namespace HandBrake.Interop.HbLib\r
 {\r
-    using System.Runtime.InteropServices;\r
+       using System.Runtime.InteropServices;\r
 \r
-    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+       [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
        public struct hb_chapter_s\r
        {\r
                /// int\r
@@ -51,8 +51,8 @@ namespace HandBrake.Interop.HbLib
                /// uint64_t->unsigned int\r
                public ulong duration;\r
 \r
-               /// char[1024]\r
-               [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+               /// char *\r
+               [MarshalAs(UnmanagedType.LPStr)]\r
                public string title;\r
        }\r
 }\r
index cb70f83efcdee39ab02e2a997cdf5c2124a43bb7..d4c95d90481a0f2927564440e26cb083e51ca0b1 100644 (file)
@@ -114,6 +114,8 @@ namespace HandBrake.Interop.HbLib
                /// int\r
                public int color_matrix;\r
 \r
+               public IntPtr list_chapter;\r
+\r
                /// hb_list_t*\r
                public IntPtr list_audio;\r
 \r
@@ -123,6 +125,10 @@ namespace HandBrake.Interop.HbLib
                /// hb_list_t*\r
                public IntPtr list_subtitle;\r
 \r
+               public IntPtr list_attachment;\r
+\r
+               public IntPtr metadata;\r
+\r
                /// int\r
                public int mux;\r
 \r
index f6d9c0ffd36cf80d970e09dd9302be970294e963..136c2df7477710ae01bf74d23d525605a4737053 100644 (file)
@@ -160,6 +160,16 @@ namespace HandBrake.Interop.HbLib
                public uint flags;\r
        }\r
 \r
+       [StructLayout(LayoutKind.Sequential)]\r
+       public struct hb_title_set_s\r
+       {\r
+               ///hb_list_t   *\r
+               public IntPtr list_title;\r
+\r
+               // int\r
+               public int feature;\r
+       }\r
+\r
        public enum hb_title_type_anon\r
        {\r
                HB_DVD_TYPE,\r
index 3a7f1c01e4acd7938277385b4dfd95398d6c2e8f..db72feac51b9452920f55941bbe80e30bc439909 100644 (file)
@@ -162,6 +162,23 @@ namespace HandBrake.Interop
                        return returnList;\r
                }\r
 \r
+               /// <summary>\r
+               /// Closes the given job.\r
+               /// </summary>\r
+               /// <param name="nativeJobPtr">The pointer to the job.</param>\r
+               public static void CloseJob(IntPtr nativeJobPtr)\r
+               {\r
+                       // Create a point to the job pointer first.\r
+                       IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));\r
+\r
+                       // Assign the new pointer to the job pointer and tell HB to clean the job up.\r
+                       Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr);\r
+                       HBFunctions.hb_job_close(nativeJobPtrPtr);\r
+\r
+                       // Free the pointer we used.\r
+                       Marshal.FreeHGlobal(nativeJobPtrPtr);\r
+               }\r
+\r
                /// <summary>\r
                /// Frees all the memory locations in the given list.\r
                /// </summary>\r
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 (file)
index 0000000..64f68a4
--- /dev/null
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="CroppingType.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrake.Interop.Model.Encoding\r
+{\r
+       /// <summary>\r
+       /// The type of cropping to apply.\r
+       /// </summary>\r
+       public enum CroppingType\r
+       {\r
+               Automatic,\r
+               None,\r
+               Custom\r
+       }\r
+}\r
index f5326e89ba9c65f70694162b8cadd7fad1619454..6d2aafec327e6851e01ac7dd2a3a244f22250a6e 100644 (file)
@@ -32,7 +32,7 @@ namespace HandBrake.Interop.Model.Encoding
                public int Height { get; set; }\r
                public int MaxWidth { get; set; }\r
                public int MaxHeight { get; set; }\r
-               public bool CustomCropping { get; set; }\r
+               public CroppingType CroppingType { get; set; }\r
                public Cropping Cropping { get; set; }\r
                public Anamorphic Anamorphic { get; set; }\r
                public bool UseDisplayWidth { get; set; }\r
@@ -57,7 +57,8 @@ namespace HandBrake.Interop.Model.Encoding
                public string X264Options { get; set; }\r
                public string X264Profile { get; set; }\r
                public string X264Preset { get; set; }\r
-               public string X264Tune { get; set; }\r
+\r
+               public List<string> X264Tunes { get; set; }\r
                public string H264Level { get; set; }\r
                public VideoEncodeRateType VideoEncodeRateType { get; set; }\r
                public double Quality { get; set; }\r
@@ -68,15 +69,12 @@ namespace HandBrake.Interop.Model.Encoding
                public double Framerate { get; set; }\r
                public bool ConstantFramerate { get; set; }\r
 \r
-               [Obsolete("This setting is obsolete. Use Framerate and ConstantFramerate instead.")]\r
-               public bool PeakFramerate { get; set; }\r
-\r
                public List<AudioEncoding> AudioEncodings { get; set; }\r
                public string AudioEncoderFallback { get; set; }\r
 \r
                public EncodingProfile Clone()\r
                {\r
-                       EncodingProfile profile = new EncodingProfile\r
+                       var profile = new EncodingProfile\r
                        {\r
                                OutputFormat = this.OutputFormat,\r
                                PreferredExtension = this.PreferredExtension,\r
@@ -89,7 +87,7 @@ namespace HandBrake.Interop.Model.Encoding
                                Height = this.Height,\r
                                MaxWidth = this.MaxWidth,\r
                                MaxHeight = this.MaxHeight,\r
-                               CustomCropping = this.CustomCropping,\r
+                               CroppingType = this.CroppingType,\r
                                Cropping = this.Cropping.Clone(),\r
                                Anamorphic = this.Anamorphic,\r
                                UseDisplayWidth = this.UseDisplayWidth,\r
@@ -114,7 +112,7 @@ namespace HandBrake.Interop.Model.Encoding
                                X264Options = this.X264Options,\r
                                X264Profile = this.X264Profile,\r
                                X264Preset = this.X264Preset,\r
-                               X264Tune = this.X264Tune,\r
+                               X264Tunes = this.X264Tunes,\r
                                H264Level = this.H264Level,\r
                                VideoEncodeRateType = this.VideoEncodeRateType,\r
                                Quality = this.Quality,\r
@@ -124,9 +122,6 @@ namespace HandBrake.Interop.Model.Encoding
                                TurboFirstPass = this.TurboFirstPass,\r
                                Framerate = this.Framerate,\r
                                ConstantFramerate = this.ConstantFramerate,\r
-#pragma warning disable 612,618\r
-                               PeakFramerate = this.PeakFramerate,\r
-#pragma warning restore 612,618\r
 \r
                                AudioEncodings = new List<AudioEncoding>(this.AudioEncodings)\r
                        };\r
index 076afdeb397b9df87fbaa408a29729fbd4716c32..395fe93637198081feb00ce794d83de31cd0f14a 100644 (file)
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers \r
 // by using the '*' as shown below:\r
 // [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("1.31.0.0")]\r
-[assembly: AssemblyFileVersion("1.31.0.0")]\r
+[assembly: AssemblyVersion("1.32.0.0")]\r
+[assembly: AssemblyFileVersion("1.32.0.0")]\r