diff options
author | sr55 <[email protected]> | 2014-12-18 21:30:24 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-12-18 21:30:24 +0000 |
commit | aee0ccc0e4d624f88c0d7f3effda3a8a085def74 (patch) | |
tree | 8770df03472655675facf0c8cd5e62c72c1c2f06 /win/CS/HandBrake.Interop/HandBrakeInterop | |
parent | 6dac5a9af13ffee95a448cdbe9d1971fb35d3266 (diff) |
WinGui: Update the libhb scan code to work with the updated API. See rev6602 for API changes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6608 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop')
6 files changed, 23 insertions, 51 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index 1bc9445f3..b2d20af0a 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -1166,8 +1166,8 @@ namespace HandBrake.Interop {
// CFR with "Same as Source". Use the title rate
nativeJob.cfr = 1;
- nativeJob.vrate = originalTitle.rate;
- nativeJob.vrate_base = originalTitle.rate_base;
+ nativeJob.vrate = originalTitle.vrate.num;
+ nativeJob.vrate_base = originalTitle.vrate.den;
}
else
{
@@ -1860,8 +1860,8 @@ namespace HandBrake.Interop {
TitleNumber = title.index,
Playlist = title.playlist,
- Resolution = new Size(title.width, title.height),
- ParVal = new Size(title.pixel_aspect_width, title.pixel_aspect_height),
+ Resolution = new Size(title.geometry.width, title.geometry.height),
+ ParVal = new Size(title.geometry.par.num, title.geometry.par.den),
Duration = Converters.Converters.PtsToTimeSpan(title.duration),
DurationPts = title.duration,
AutoCropDimensions = new Cropping
@@ -1871,12 +1871,12 @@ namespace HandBrake.Interop Left = title.crop[2],
Right = title.crop[3]
},
- AspectRatio = title.aspect,
+ AspectRatio = Math.Round((decimal)title.container_dar.num / title.container_dar.den, 2),
AngleCount = title.angle_count,
VideoCodecName = title.video_codec_name,
- Framerate = ((double)title.rate) / title.rate_base,
- FramerateNumerator = title.rate,
- FramerateDenominator = title.rate_base,
+ Framerate = ((double)title.vrate.num) / title.vrate.den,
+ FramerateNumerator = title.vrate.num,
+ FramerateDenominator = title.vrate.den,
Path = Encoding.UTF8.GetString(title.path).TrimEnd('\0')
};
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index 449d7f023..243632ba9 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -115,7 +115,7 @@ namespace HandBrake.Interop.HbLib public static extern void hb_set_anamorphic_size(ref hb_job_s job, ref int output_width, ref int output_height, ref int output_par_width, ref int output_par_height);
[DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size2", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_ui_geometry_s uiGeometry, ref hb_geometry_s result);
+ public static extern void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_geometry_settings_s uiGeometry, ref hb_geometry_s result);
/// Return Type: int
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs index c6bc59fb3..7814fb27b 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs @@ -60,9 +60,9 @@ namespace HandBrake.Interop.HbLib /// int
public int bitrate;
- public float quality;
+ public double quality;
- public float compression_level;
+ public double compression_level;
/// double
public double dynamic_range_compression;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_geometry.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_geometry.cs index 6a0001ff7..857b9eca0 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_geometry.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_geometry.cs @@ -38,7 +38,7 @@ namespace HandBrake.Interop.HbLib /// The hb_ui_geometry_s.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
- public struct hb_ui_geometry_s
+ public struct hb_geometry_settings_s
{
/// <summary>
/// Anamorphic mode, see job struct anamorphic
@@ -67,16 +67,6 @@ namespace HandBrake.Interop.HbLib public int[] crop;
/// <summary>
- /// destination storage width
- /// </summary>
- public int width;
-
- /// <summary>
- /// destination storage height
- /// </summary>
- public int height;
-
- /// <summary>
/// max destination storage width
/// </summary>
public int maxWidth;
@@ -89,12 +79,7 @@ namespace HandBrake.Interop.HbLib /// <summary>
/// Pixel aspect used in custom anamorphic
/// </summary>
- public hb_rational_t par;
-
- /// <summary>
- /// Display aspect used in custom anamorphic
- /// </summary>
- public hb_rational_t dar;
+ public hb_geometry_s geometry;
}
/// <summary>
@@ -104,12 +89,12 @@ namespace HandBrake.Interop.HbLib public struct hb_rational_t
{
/// <summary>
- /// The num.
+ /// The num. W
/// </summary>
public int num;
/// <summary>
- /// The den.
+ /// The den. H
/// </summary>
public int den;
}
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 a3152c4be..3e43ac2a6 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs @@ -69,35 +69,20 @@ namespace HandBrake.Interop.HbLib /// uint64_t->unsigned int
public ulong duration;
- /// double
- public double aspect;
-
- /// double
- public double container_aspect;
-
public int has_resolution_change;
- /// int
- public int width;
-
- /// int
- public int height;
+ public hb_geometry_s geometry;
- /// int
- public int pixel_aspect_width;
+ public hb_rational_t dar;
- /// int
- public int pixel_aspect_height;
+ public hb_rational_t container_dar;
public int color_prim;
public int color_transfer;
public int color_matrix;
/// int
- public int rate;
-
- /// int
- public int rate_base;
+ public hb_rational_t vrate;
/// int[4]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]
@@ -179,7 +164,9 @@ namespace HandBrake.Interop.HbLib {
HB_DVD_DEMUXER = 0,
- HB_MPEG_DEMUXER,
+ HB_TS_DEMUXER,
+
+ HB_PS_DEMUXER,
HB_NULL_DEMUXER,
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs index d722404bd..6137199d8 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs @@ -101,7 +101,7 @@ namespace HandBrake.Interop.SourceData /// <summary>
/// Gets or sets the aspect ratio of this Title
/// </summary>
- public double AspectRatio { get; set; }
+ public decimal AspectRatio { get; set; }
/// <summary>
/// Gets or sets the number of angles on the title.
|