summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop/HandBrakeInterop
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop')
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs44
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs83
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj1
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs41
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs102
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs8
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs47
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs33
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs4
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs2
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBContainer.cs18
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs2
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs4
13 files changed, 211 insertions, 178 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs
index 1369b32c1..21fb68425 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs
@@ -148,25 +148,13 @@ namespace HandBrake.Interop
/// <returns>The converted model.</returns>
public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)
{
- var result = new HBVideoEncoder
+ return new HBVideoEncoder
{
Id = encoder.codec,
ShortName = encoder.short_name,
DisplayName = encoder.name,
- CompatibleContainers = Container.None
+ CompatibleContainers = encoder.muxers
};
-
- if ((encoder.muxers & NativeConstants.HB_MUX_MKV) > 0)
- {
- result.CompatibleContainers = result.CompatibleContainers | Container.Mkv;
- }
-
- if ((encoder.muxers & NativeConstants.HB_MUX_MP4) > 0)
- {
- result.CompatibleContainers = result.CompatibleContainers | Container.Mp4;
- }
-
- return result;
}
/// <summary>
@@ -181,19 +169,9 @@ namespace HandBrake.Interop
Id = encoder.codec,
ShortName = encoder.short_name,
DisplayName = encoder.name,
- CompatibleContainers = Container.None
+ CompatibleContainers = encoder.muxers
};
- if ((encoder.muxers & NativeConstants.HB_MUX_MKV) > 0)
- {
- result.CompatibleContainers = result.CompatibleContainers | Container.Mkv;
- }
-
- if ((encoder.muxers & NativeConstants.HB_MUX_MP4) > 0)
- {
- result.CompatibleContainers = result.CompatibleContainers | Container.Mp4;
- }
-
result.QualityLimits = Encoders.GetAudioQualityLimits(encoder.codec);
result.DefaultQuality = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec);
result.CompressionLimits = Encoders.GetAudioCompressionLimits(encoder.codec);
@@ -232,6 +210,22 @@ namespace HandBrake.Interop
}
/// <summary>
+ /// Converts a native HB container structure into an HBContainer object.
+ /// </summary>
+ /// <param name="container">The structure to convert.</param>
+ /// <returns>The converted structure.</returns>
+ public static HBContainer NativeToContainer(hb_container_s container)
+ {
+ return new HBContainer
+ {
+ DisplayName = container.name,
+ ShortName = container.short_name,
+ DefaultExtension = container.default_extension,
+ Id = container.format
+ };
+ }
+
+ /// <summary>
/// Converts a native language structure to a Language object.
/// </summary>
/// <param name="language">The structure to convert.</param>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
index 86faa7b5d..62b3ea389 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
@@ -15,6 +15,7 @@ namespace HandBrake.Interop
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
+ using System.Text;
using System.Windows.Media.Imaging;
using HandBrake.Interop.EventArgs;
@@ -188,16 +189,12 @@ namespace HandBrake.Interop
this.StartScan(path, previewCount, minDuration, 0);
}
- /// <summary>
- /// The start scan.
- /// </summary>
- /// <param name="path">
- /// The path.
- /// </param>
- /// <param name="previewCount">
- /// The preview count.
- /// </param>
- public void StartScan(string path, int previewCount)
+ /// <summary>
+ /// Starts a scan for the given input path.
+ /// </summary>
+ /// <param name="path">The path of the video to scan.</param>
+ /// <param name="previewCount">The number of preview images to generate for each title while scanning.</param>
+ public void StartScan(string path, int previewCount)
{
this.StartScan(path, previewCount, TimeSpan.FromSeconds(10), 0);
}
@@ -206,34 +203,36 @@ namespace HandBrake.Interop
/// Starts a scan of the given path.
/// </summary>
/// <param name="path">The path of the video to scan.</param>
- /// <param name="previewCount">The number of previews to make on each title.</param>
+ /// <param name="previewCount">The number of preview images to generate for each title while scanning.</param>
/// <param name="titleIndex">The title index to scan (1-based, 0 for all titles).</param>
public void StartScan(string path, int previewCount, int titleIndex)
{
this.StartScan(path, previewCount, TimeSpan.Zero, titleIndex);
}
- /// <summary>
- /// Starts a scan of the given path.
- /// </summary>
- /// <param name="path">The path of the video to scan.</param>
- /// <param name="previewCount">The number of previews to make on each title.</param>
- /// <param name="minDuration">The minimum duration of a title to show up on the scan.</param>
- /// <param name="titleIndex">The title index to scan (1-based, 0 for all titles).</param>
- public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)
- {
- this.previewCount = previewCount;
- HBFunctions.hb_scan(this.hbHandle, path, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));
- this.scanPollTimer = new System.Timers.Timer();
- this.scanPollTimer.Interval = ScanPollIntervalMs;
-
- // Lambda notation used to make sure we can view any JIT exceptions the method throws
- this.scanPollTimer.Elapsed += (o, e) =>
- {
- this.PollScanProgress();
- };
- this.scanPollTimer.Start();
- }
+ /// <summary>
+ /// Starts a scan of the given path.
+ /// </summary>
+ /// <param name="path">The path of the video to scan.</param>
+ /// <param name="previewCount">The number of previews to make on each title.</param>
+ /// <param name="minDuration">The minimum duration of a title to show up on the scan.</param>
+ /// <param name="titleIndex">The title index to scan (1-based, 0 for all titles).</param>
+ public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)
+ {
+ this.previewCount = previewCount;
+
+ HBFunctions.hb_scan(this.hbHandle, path, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));
+
+ this.scanPollTimer = new System.Timers.Timer();
+ this.scanPollTimer.Interval = ScanPollIntervalMs;
+
+ // Lambda notation used to make sure we can view any JIT exceptions the method throws
+ this.scanPollTimer.Elapsed += (o, e) =>
+ {
+ this.PollScanProgress();
+ };
+ this.scanPollTimer.Start();
+ }
/// <summary>
@@ -1015,7 +1014,9 @@ namespace HandBrake.Interop
{
if (i < nativeChapters.Count && i < job.CustomChapterNames.Count)
{
- HBFunctions.hb_chapter_set_title(nativeChapters[i], job.CustomChapterNames[i]);
+ IntPtr chapterNamePtr = InteropUtilities.CreateUtf8Ptr(job.CustomChapterNames[i]);
+ HBFunctions.hb_chapter_set_title__ptr(nativeChapters[i], chapterNamePtr);
+ Marshal.FreeHGlobal(chapterNamePtr);
}
}
}
@@ -1463,13 +1464,20 @@ namespace HandBrake.Interop
// Construct final filter list
nativeJob.list_filter = this.ConvertFilterListToNative(filterList, allocatedMemory).ListPtr;
+#pragma warning disable 612, 618
if (profile.OutputFormat == Container.Mp4)
{
- nativeJob.mux = NativeConstants.HB_MUX_MP4;
+ nativeJob.mux = HBFunctions.hb_container_get_from_name("av_mp4");
}
- else
+ else if (profile.OutputFormat == Container.Mkv)
+ {
+ nativeJob.mux = HBFunctions.hb_container_get_from_name("av_mkv");
+ }
+#pragma warning restore 612, 618
+
+ if (profile.ContainerName != null)
{
- nativeJob.mux = NativeConstants.HB_MUX_MKV;
+ nativeJob.mux = HBFunctions.hb_container_get_from_name(profile.ContainerName);
}
nativeJob.file = job.OutputPath;
@@ -1662,6 +1670,7 @@ namespace HandBrake.Interop
nativeAudio.config.output.codec = (uint)encoder.Id;
nativeAudio.config.output.compression_level = -1;
nativeAudio.config.output.samplerate = nativeAudio.config.input.samplerate;
+ nativeAudio.config.output.dither_method = -1;
if (!encoder.IsPassthrough)
{
@@ -1748,7 +1757,7 @@ namespace HandBrake.Interop
Framerate = ((double)title.rate) / title.rate_base,
FramerateNumerator = title.rate,
FramerateDenominator = title.rate_base,
- Path = title.path
+ Path = title.path
};
switch (title.type)
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
index 047a172e6..26575f285 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
@@ -160,6 +160,7 @@
<Compile Include="Model\Encoding\Denoise.cs" />
<Compile Include="Model\Encoding\Detelecine.cs" />
<Compile Include="Model\Encoding\EncodingProfile.cs" />
+ <Compile Include="Model\Encoding\HBContainer.cs" />
<Compile Include="Model\Encoding\HBMixdown.cs" />
<Compile Include="Model\Encoding\HBRate.cs" />
<Compile Include="Model\Encoding\HBVideoEncoder.cs" />
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
index 68f7d0177..c1a463037 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
@@ -86,20 +86,6 @@ namespace HandBrake.Interop.HbLib
[DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_get_titles(IntPtr hbHandle);
-
- /// Return Type: int
- ///buf: hb_buffer_t*
- ///width: int
- ///height: int
- ///color_equal: int
- ///color_diff: int
- ///threshold: int
- ///prog_equal: int
- ///prog_diff: int
- ///prog_threshold: int
- [DllImport("hb.dll", EntryPoint = "hb_detect_comb", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_detect_comb(ref hb_buffer_s buf, int width, int height, int color_equal, int color_diff, int threshold, int prog_equal, int prog_diff, int prog_threshold);
-
/// Return Type: void
///param0: hb_handle_t*
///param1: hb_title_t*
@@ -327,6 +313,19 @@ namespace HandBrake.Interop.HbLib
[DllImport("hb.dll", EntryPoint = "hb_audio_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_encoder_get_next(IntPtr last);
+//int hb_container_get_from_name(const char *name);
+//int hb_container_get_from_extension(const char *extension); // not really a container name
+//const char* hb_container_get_name(int format);
+//const char* hb_container_get_short_name(int format);
+//const char* hb_container_get_default_extension(int format);
+//const char* hb_container_sanitize_name(const char *name);
+
+ [DllImport("hb.dll", EntryPoint = "hb_container_get_from_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_container_get_from_name([In] [MarshalAs(UnmanagedType.LPStr)] string name);
+
+ [DllImport("hb.dll", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_container_get_next(IntPtr last);
+
[DllImport("hb.dll", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr lang_get_next(IntPtr last);
@@ -373,6 +372,10 @@ namespace HandBrake.Interop.HbLib
[DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_chapter_set_title(IntPtr chapter, [In] [MarshalAs(UnmanagedType.LPStr)] string title);
+ ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
+ [DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_chapter_set_title__ptr(IntPtr chapter, IntPtr title);
+
/// void hb_add_filter( hb_job_t * job, hb_filter_object_t * filter, const char * settings );
[DllImport("hb.dll", EntryPoint = "hb_add_filter", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_add_filter(ref hb_job_s job, ref hb_filter_object_s filter, IntPtr settings);
@@ -398,10 +401,10 @@ namespace HandBrake.Interop.HbLib
int height);
- [DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_qsv_available();
-
- [DllImport("hb.dll", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_qsv_info_init();
+ [DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_qsv_available();
+
+ [DllImport("hb.dll", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_qsv_info_init();
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs
index aef4c5a69..18d73c721 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs
@@ -94,6 +94,15 @@ namespace HandBrake.Interop.HbLib
}
[StructLayout(LayoutKind.Sequential)]
+ public struct qsv_enc_info_s
+ {
+ public int pic_struct;
+ public int align_width;
+ public int align_height;
+ public int is_init_done;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
public struct hb_encoder_s
{
[MarshalAs(UnmanagedType.LPStr)]
@@ -107,6 +116,21 @@ namespace HandBrake.Interop.HbLib
public int muxers;
}
+ [StructLayout(LayoutKind.Sequential)]
+ public struct hb_container_s
+ {
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string name;
+
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string short_name;
+
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string default_extension;
+
+ public int format;
+ }
+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct hb_metadata_s
{
@@ -266,84 +290,6 @@ namespace HandBrake.Interop.HbLib
{
}
- // Only called by detect_comb at the moment
- [StructLayout(LayoutKind.Sequential)]
- public struct hb_buffer_s
- {
- /// int
- public int size;
-
- /// int
- public int alloc;
-
- /// uint8_t*
- [MarshalAs(UnmanagedType.LPStr)]
- public string data;
-
- /// int
- public int cur;
-
- /// int64_t->int
- public long sequence;
-
- public hb_buffer_type_anon type;
-
- /// int
- public int id;
-
- /// int64_t->int
- public long start;
-
- /// int64_t->int
- public long stop;
-
- public long pcr;
-
- public byte discontinuity;
-
- /// int
- public int new_chap;
-
- /// uint8_t->unsigned char
- public byte frametype;
-
- // Given uint by default, probably should be ushort?
- /// uint16_t->unsigned int
- public uint flags;
-
- /// int64_t->int
- public long renderOffset;
-
- /// int
- public int x;
-
- /// int
- public int y;
-
- /// int
- public int width;
-
- /// int
- public int height;
-
- /// hb_buffer_t*
- public IntPtr sub;
-
- /// hb_buffer_t*
- public IntPtr next;
- }
-
- public enum hb_buffer_type_anon
- {
- AUDIO_BUF,
-
- VIDEO_BUF,
-
- SUBTITLE_BUF,
-
- OTHER_BUF
- }
-
[StructLayout(LayoutKind.Sequential)]
public struct hb_mux_data_s
{
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 44f9e5ba8..a32527132 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs
@@ -169,6 +169,14 @@ namespace HandBrake.Interop.HbLib
/// uint32_t->unsigned int
public uint frames_to_skip;
+ public IntPtr av_qsv_context;
+
+ public int qsv_decode;
+
+ public int qsv_async_depth;
+
+ public qsv_enc_info_s qsv_enc_info;
+
// Padding for the part of the struct we don't care about marshaling.
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MarshalingConstants.JobPaddingBytes, ArraySubType = UnmanagedType.U1)]
public byte[] padding;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs
index 25eb96274..86a42295c 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs
@@ -16,7 +16,7 @@ namespace HandBrake.Interop
using System.Text;
using HandBrake.Interop.HbLib;
- /// <summary>
+ /// <summary>
/// Helper utilities for native interop.
/// </summary>
public static class InteropUtilities
@@ -57,6 +57,25 @@ namespace HandBrake.Interop
}
/// <summary>
+ /// Creates a pointer to a UTF-8 null-terminated string.
+ /// </summary>
+ /// <param name="str">The string to encode.</param>
+ public static IntPtr CreateUtf8Ptr(string str)
+ {
+ byte[] bytes = Encoding.UTF8.GetBytes(str);
+ IntPtr stringPtr = Marshal.AllocHGlobal(bytes.Length + 1);
+ var offset = 0;
+ foreach (byte b in bytes)
+ {
+ Marshal.WriteByte(stringPtr, offset, b);
+ offset++;
+ }
+
+ Marshal.WriteByte(stringPtr, offset, 0);
+ return stringPtr;
+ }
+
+ /// <summary>
/// Converts the given native HandBrake list to a managed list.
/// </summary>
/// <typeparam name="T">The type of structure in the list.</typeparam>
@@ -133,7 +152,7 @@ namespace HandBrake.Interop
hb_list_s nativeListStruct = new hb_list_s { items = nativeListInternal, items_alloc = capacity, items_count = 0 };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
@@ -158,13 +177,13 @@ namespace HandBrake.Interop
}
hb_list_s nativeListStruct = new hb_list_s
- {
- items = nativeListInternal,
- items_alloc = list.Count,
- items_count = list.Count
- };
+ {
+ items = nativeListInternal,
+ items_alloc = list.Count,
+ items_count = list.Count
+ };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
@@ -194,13 +213,13 @@ namespace HandBrake.Interop
}
hb_list_s nativeListStruct = new hb_list_s
- {
- items = nativeListInternal,
- items_alloc = list.Count,
- items_count = list.Count
- };
+ {
+ items = nativeListInternal,
+ items_alloc = list.Count,
+ items_count = list.Count
+ };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
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; }
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs
index 9f0e040c4..571a69b1a 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.47.0.0")]
-[assembly: AssemblyFileVersion("1.47.0.0")]
+[assembly: AssemblyVersion("1.49.0.0")]
+[assembly: AssemblyFileVersion("1.49.0.0")]