diff options
author | randomengy <[email protected]> | 2013-09-14 18:13:52 +0000 |
---|---|---|
committer | randomengy <[email protected]> | 2013-09-14 18:13:52 +0000 |
commit | df38b4e3b51cd16e1ef7c559717a578852877456 (patch) | |
tree | 826193d6858fbbc2eec6f70009083b98c7d14098 /win/CS/HandBrake.Interop/HandBrakeInterop/Model | |
parent | 1e73f743a8463ef70126d7b6b094f6ccc74c971e (diff) |
Interop: Various fixes/improvements
* Exposed container list and changing compatible containers from an enum to an int to allow pulling the container list dynamically.
* Removed a few unused and out-of-date functions and structs.
* Updated a few structs to better track with the QSV changes.
* Added a method to create a pointer to a UTF-8 encoded string.
* Dither now is chosen automatically rather than turned off, which helps with FDK AAC.
* Fixed unicode custom chapter names.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5782 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/Model')
5 files changed, 56 insertions, 3 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs index e8d546237..cb70f21d0 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs @@ -38,11 +38,16 @@ namespace HandBrake.Interop.Model private static List<HBRate> videoFramerates;
/// <summary>
- /// The mixdowns.
+ /// List of HandBrake mixdowns.
/// </summary>
private static List<HBMixdown> mixdowns;
/// <summary>
+ /// List of HandBrake containers.
+ /// </summary>
+ private static List<HBContainer> containers;
+
+ /// <summary>
/// The audio bitrates.
/// </summary>
private static List<int> audioBitrates;
@@ -154,6 +159,22 @@ namespace HandBrake.Interop.Model return audioSampleRates;
}
+ }
+
+ /// <summary>
+ /// Gets a list of supported containers.
+ /// </summary>
+ public static List<HBContainer> Containers
+ {
+ get
+ {
+ if (containers == null)
+ {
+ containers = InteropUtilities.GetListFromIterator<hb_container_s, HBContainer>(HBFunctions.hb_container_get_next, Converters.NativeToContainer);
+ }
+
+ return containers;
+ }
}
/// <summary>
@@ -187,6 +208,16 @@ namespace HandBrake.Interop.Model }
/// <summary>
+ /// Gets the container with the specified short name.
+ /// </summary>
+ /// <param name="shortName">The name of the container.</param>
+ /// <returns>The requested container.</returns>
+ public static HBContainer GetContainer(string shortName)
+ {
+ return Containers.SingleOrDefault(c => c.ShortName == shortName);
+ }
+
+ /// <summary>
/// Determines if the given encoder is compatible with the given track.
/// </summary>
/// <param name="track">The audio track to examine.</param>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs index 2863d3b48..bd25944f2 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs @@ -21,7 +21,10 @@ namespace HandBrake.Interop.Model.Encoding this.Cropping = new Cropping();
}
+ [Obsolete("Use ContainerName instead.")]
public Container OutputFormat { get; set; }
+
+ public string ContainerName { get; set; }
public OutputExtension PreferredExtension { get; set; }
public bool IncludeChapterMarkers { get; set; }
public bool LargeFile { get; set; }
@@ -77,6 +80,7 @@ namespace HandBrake.Interop.Model.Encoding var profile = new EncodingProfile
{
OutputFormat = this.OutputFormat,
+ ContainerName = this.ContainerName,
PreferredExtension = this.PreferredExtension,
IncludeChapterMarkers = this.IncludeChapterMarkers,
LargeFile = this.LargeFile,
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs index 19645a70b..a3a95ab33 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs @@ -16,7 +16,7 @@ namespace HandBrake.Interop.Model.Encoding public int Id { get; set; } - public Container CompatibleContainers { get; set; } + public int CompatibleContainers { get; set; } public bool SupportsQuality { diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBContainer.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBContainer.cs new file mode 100644 index 000000000..136006075 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBContainer.cs @@ -0,0 +1,18 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HandBrake.Interop.Model.Encoding
+{
+ public class HBContainer
+ {
+ public string ShortName { get; set; }
+
+ public string DisplayName { get; set; }
+
+ public string DefaultExtension { get; set; }
+
+ public int Id { get; set; }
+ }
+}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs index 9e04252aa..6bc04a5be 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs @@ -14,6 +14,6 @@ namespace HandBrake.Interop.Model.Encoding public int Id { get; set; } - public Container CompatibleContainers { get; set; } + public int CompatibleContainers { get; set; } } } |