diff options
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/HbLib')
7 files changed, 125 insertions, 130 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index 8fa46453d..428a58304 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -213,11 +213,20 @@ namespace HandBrake.Interop.HbLib public static extern int hb_srt_add(ref hb_job_s job, ref hb_subtitle_config_s subtitleConfig, string lang);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_is_supported", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout);
+
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_has_remix_support", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_has_remix_support(int mixdown, ulong layout);
+
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_has_codec_support", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_has_codec_support(int mixdown, uint codec);
+
[DllImport("hb.dll", EntryPoint = "hb_get_default_mixdown", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_get_default_mixdown(uint codec, int layout);
+ public static extern int hb_get_default_mixdown(uint codec, ulong layout);
[DllImport("hb.dll", EntryPoint = "hb_get_best_mixdown", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_get_best_mixdown(uint codec, int layout, int mixdown);
+ public static extern int hb_get_best_mixdown(uint codec, ulong layout, int mixdown);
[DllImport("hb.dll", EntryPoint = "hb_get_best_audio_bitrate", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_get_best_audio_bitrate(uint codec, int bitrate, int samplerate, int mixdown);
@@ -281,48 +290,51 @@ namespace HandBrake.Interop.HbLib public static extern int hb_get_audio_encoders_count();
- /// void hb_autopassthru_apply_settings( hb_job_t * job )
- [DllImport("hb.dll", EntryPoint = "hb_autopassthru_apply_settings", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_autopassthru_apply_settings(ref hb_job_s job);
+ /// void hb_autopassthru_apply_settings( hb_job_t * job )
+ [DllImport("hb.dll", EntryPoint = "hb_autopassthru_apply_settings", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_autopassthru_apply_settings(ref hb_job_s job);
+
+ ///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);
- ///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);
+ ///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);
- ///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);
+ ///hb_job_t * hb_job_init( hb_title_t * title );
+ [DllImport("hb.dll", EntryPoint = "hb_job_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern hb_job_s hb_job_init(ref hb_title_s title);
- ///hb_job_t * hb_job_init( hb_title_t * title );
- [DllImport("hb.dll", EntryPoint = "hb_job_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern hb_job_s hb_job_init(ref hb_title_s title);
+ ///void hb_job_reset( hb_job_t * job );
+ [DllImport("hb.dll", EntryPoint = "hb_job_reset", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_job_reset(ref hb_job_s job);
- ///void hb_job_reset( hb_job_t * job );
- [DllImport("hb.dll", EntryPoint = "hb_job_reset", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_job_reset(ref hb_job_s job);
+ ///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);
- ///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);
+ ///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)]
+ public static extern void hb_job_set_advanced_opts(ref hb_job_s job, IntPtr advanced_opts);
- ///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)]
- public static extern void hb_job_set_advanced_opts(ref hb_job_s job, IntPtr advanced_opts);
+ ///void hb_job_set_file( hb_job_t *job, const char *file );
+ [DllImport("hb.dll", EntryPoint = "hb_job_set_file", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_job_set_file(ref hb_job_s job, IntPtr file);
- ///void hb_job_set_file( hb_job_t *job, const char *file );
- [DllImport("hb.dll", EntryPoint = "hb_job_set_file", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_job_set_file(ref hb_job_s job, IntPtr file);
+ ///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(ref hb_chapter_s chapter, IntPtr 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(ref hb_chapter_s 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);
- /// 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, hb_filter_object_s filter, IntPtr settings);
+ /// hb_filter_object_t * hb_filter_init( int filter_id );
+ [DllImport("hb.dll", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_filter_init(int filter_id);
- /// hb_filter_object_t * hb_filter_init( int filter_id );
- [DllImport("hb.dll", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern hb_filter_object_s hb_filter_init(int filter_id);
+ [DllImport("hb.dll", EntryPoint = "hb_x264_encopt_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_x264_encopt_name(IntPtr name);
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs index 81c80ab13..36820c0c4 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs @@ -212,18 +212,6 @@ namespace HandBrake.Interop.HbLib public hb_state_param_u param;
}
- [StructLayout(LayoutKind.Explicit)]
- public struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d
- {
- /// int
- [FieldOffset(0)]
- public int ac3;
-
- /// int
- [FieldOffset(0)]
- public int dca;
- }
-
[StructLayout(LayoutKind.Sequential)]
public struct hb_fifo_s
{
@@ -420,15 +408,6 @@ namespace HandBrake.Interop.HbLib public int feature;
}
- [StructLayout(LayoutKind.Sequential)]
- public struct hb_filter_object_s
- {
- public int id;
- public int enforce_order;
- public IntPtr name;
- public IntPtr settings;
- }
-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LoggingCallback(string message);
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs index c9f4f9aeb..e7a841251 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs @@ -26,7 +26,7 @@ namespace HandBrake.Interop.HbLib public const uint HB_ACODEC_DCA_HD = 0x00040000;
public const uint HB_ACODEC_MP3 = 0x00080000;
public const uint HB_ACODEC_FFFLAC = 0x00100000;
- public const uint HB_ACODEC_FF_MASK = 0x001f0000;
+ public const uint HB_ACODEC_FF_MASK = 0x001f2000;
public const uint HB_ACODEC_PASS_FLAG = 0x40000000;
public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_MP3 | HB_ACODEC_FFAAC | HB_ACODEC_DCA_HD | HB_ACODEC_AC3 | HB_ACODEC_DCA);
public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG);
@@ -42,34 +42,6 @@ namespace HandBrake.Interop.HbLib public const int HB_SUBSTREAM_BD_DTSHD = 0x72;
public const int HB_SUBSTREAM_BD_DTS = 0x71;
- public const int HB_AMIXDOWN_DCA_FORMAT_MASK = 0x00FFF000;
- public const int HB_AMIXDOWN_A52_FORMAT_MASK = 0x00000FF0;
- public const int HB_AMIXDOWN_DISCRETE_CHANNEL_COUNT_MASK = 0x0000000F;
- public const int HB_AMIXDOWN_NONE = 0x00000000;
- public const int HB_AMIXDOWN_MONO = 0x01000011;
- public const int HB_AMIXDOWN_STEREO = 0x02002022;
- public const int HB_AMIXDOWN_DOLBY = 0x042070A2;
- public const int HB_AMIXDOWN_DOLBYPLII = 0x084094A2;
- public const int HB_AMIXDOWN_6CH = 0x10089176;
-
- public const int HB_INPUT_CH_LAYOUT_MONO = 0x0110010;
- public const int HB_INPUT_CH_LAYOUT_STEREO = 0x0220020;
- public const int HB_INPUT_CH_LAYOUT_DOLBY = 0x0320031;
- public const int HB_INPUT_CH_LAYOUT_3F = 0x0430030;
- public const int HB_INPUT_CH_LAYOUT_2F1R = 0x0521021;
- public const int HB_INPUT_CH_LAYOUT_3F1R = 0x0631031;
- public const int HB_INPUT_CH_LAYOUT_2F2R = 0x0722022;
- public const int HB_INPUT_CH_LAYOUT_3F2R = 0x0832032;
- public const int HB_INPUT_CH_LAYOUT_4F2R = 0x0942042;
- public const int HB_INPUT_CH_LAYOUT_3F4R = 0x0a34034;
- public const int HB_INPUT_CH_LAYOUT_HAS_LFE = 0x0000100;
- public const int HB_INPUT_CH_LAYOUT_DISCRETE_FRONT_MASK = 0x00F0000;
- public const int HB_INPUT_CH_LAYOUT_DISCRETE_REAR_MASK = 0x000F000;
- public const int HB_INPUT_CH_LAYOUT_DISCRETE_LFE_MASK = 0x0000F00;
- public const int HB_INPUT_CH_LAYOUT_DISCRETE_NO_LFE_MASK = 0xFFFF0FF;
- public const int HB_INPUT_CH_LAYOUT_ENCODED_FRONT_MASK = 0x00000F0;
- public const int HB_INPUT_CH_LAYOUT_ENCODED_REAR_MASK = 0x000000F;
-
public const int HB_VCODEC_MASK = 0x0000FF;
public const int HB_VCODEC_X264 = 0x000001;
public const int HB_VCODEC_THEORA = 0x000002;
@@ -109,20 +81,20 @@ namespace HandBrake.Interop.HbLib public const int HB_CONFIG_MAX_SIZE = 8192;
- // First, filters that may change the framerate (drop or dup frames)
- public const int HB_FILTER_DETELECINE = 1;
- public const int HB_FILTER_DECOMB = 2;
- public const int HB_FILTER_DEINTERLACE = 3;
- public const int HB_FILTER_VFR = 4;
-
- // Filters that must operate on the original source image are next
- public const int HB_FILTER_DEBLOCK = 5;
- public const int HB_FILTER_DENOISE = 6;
- public const int HB_FILTER_RENDER_SUB = 7;
- public const int HB_FILTER_CROP_SCALE = 8;
-
- // Finally filters that don't care what order they are in,
- // except that they must be after the above filters
- public const int HB_FILTER_ROTATE = 9;
+ // see https://developer.apple.com/quicktime/icefloe/dispatch019.html#colr
+ public const int HB_COLR_PRI_BT709 = 1;
+ public const int HB_COLR_PRI_UNDEF = 2;
+ public const int HB_COLR_PRI_EBUTECH = 5; // use for bt470bg
+ public const int HB_COLR_PRI_SMPTEC = 6; // smpte170m; also use for bt470m and smpte240m
+ // 0, 3-4, 7-65535: reserved
+ public const int HB_COLR_TRA_BT709 = 1; // also use for bt470m, bt470bg and smpte170m
+ public const int HB_COLR_TRA_UNDEF = 2;
+ public const int HB_COLR_TRA_SMPTE240M = 7;
+ // 0, 3-6, 8-65535: reserved
+ public const int HB_COLR_MAT_BT709 = 1;
+ public const int HB_COLR_MAT_UNDEF = 2;
+ public const int HB_COLR_MAT_SMPTE170M = 6; // also use for fcc and bt470bg
+ public const int HB_COLR_MAT_SMPTE240M = 7;
+ // 0, 3-5, 8-65535: reserved
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs index 6decf10d0..26b836094 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs @@ -36,15 +36,14 @@ namespace HandBrake.Interop.HbLib public hb_audio_config_output_s output;
public hb_audio_config_input_s input;
- /// Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d
- public Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d flags;
-
public hb_audio_config_lang_s lang;
}
[StructLayout(LayoutKind.Sequential)]
public struct hb_audio_config_output_s
{
+ public int mixdown;
+
/// int
public int track;
@@ -63,57 +62,76 @@ namespace HandBrake.Interop.HbLib public float compression_level;
- /// int
- public int mixdown;
-
/// double
public double dynamic_range_compression;
public double gain;
- /// char*
- //[MarshalAs(UnmanagedType.LPStr)]
- //public string name;
+ public int normalize_mix_level;
public IntPtr name;
}
+ public enum hb_mixdown
+ {
+ HB_INVALID_AMIXDOWN = -1,
+ HB_AMIXDOWN_NONE = 0,
+ HB_AMIXDOWN_MONO,
+ HB_AMIXDOWN_LEFT,
+ HB_AMIXDOWN_RIGHT,
+ HB_AMIXDOWN_STEREO,
+ HB_AMIXDOWN_DOLBY,
+ HB_AMIXDOWN_DOLBYPLII,
+ HB_AMIXDOWN_5POINT1,
+ HB_AMIXDOWN_6POINT1,
+ HB_AMIXDOWN_7POINT1,
+ HB_AMIXDOWN_5_2_LFE,
+ }
+
[StructLayout(LayoutKind.Sequential)]
public struct hb_audio_config_input_s
{
/// int
public int track;
- /// uint32_t->unsigned int
+ /* Input audio codec */
public uint codec;
+ /* Per-codec config info */
+ public uint codec_param;
+
+ /* Registration descriptor of source */
public uint reg_desc;
+ /* Stream type from source stream */
public uint stream_type;
+ /* Substream type for multiplexed streams */
public uint substream_type;
- /// uint32_t->unsigned int
- public uint codec_param;
-
- /// uint32_t->unsigned int
+ /* Bitsream version */
public uint version;
- /// uint32_t->unsigned int
+ /* Bitstream flags, codec-specific */
+ public uint flags;
+
+ /* Bitstream mode, codec-specific */
public uint mode;
- /// int
+ /* Input sample rate (Hz) */
public int samplerate;
+ /* Number of samples per frame */
public int samples_per_frame;
- /// int
+ /* Input bitrate (bps) */
public int bitrate;
- /// int
- public int channel_layout;
+ /* Source channel layout, set by the audio decoder */
+ public ulong channel_layout;
- // hb_chan_map_t *
+ /* Source channel map, set by the audio decoder */
+ // hb_chan_map_t
public IntPtr channel_map;
}
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 ab333ce50..cb70f83ef 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs @@ -41,7 +41,7 @@ namespace HandBrake.Interop.HbLib public int deinterlace;
/// hb_list_t*
- public IntPtr filters;
+ public IntPtr list_filter;
/// int
public int width;
@@ -90,7 +90,7 @@ namespace HandBrake.Interop.HbLib /// int
public int pass;
- public int fastfirstpass;
+ public int fastfirstpass;
public IntPtr advanced_opts;
@@ -100,7 +100,7 @@ namespace HandBrake.Interop.HbLib public IntPtr x264_tune;
- public IntPtr h264_level;
+ public IntPtr h264_level;
/// int
public int areBframes;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs index 5365e2ebe..b3a5af3e8 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs @@ -10,10 +10,10 @@ namespace HandBrake.Interop.HbLib
{
- using System;
- using System.Runtime.InteropServices;
+ using System;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct hb_subtitle_s
{
/// int
@@ -22,6 +22,8 @@ namespace HandBrake.Interop.HbLib /// int
public int track;
+ public int out_track;
+
/// hb_subtitle_config_t->hb_subtitle_config_s
public hb_subtitle_config_s config;
@@ -45,6 +47,8 @@ namespace HandBrake.Interop.HbLib [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)]
public uint[] palette;
+ public byte palette_set;
+
public int width;
public int height;
@@ -59,6 +63,14 @@ namespace HandBrake.Interop.HbLib /// int
public int forced_hits;
+ public uint codec;
+
+ public uint reg_desc;
+
+ public uint stream_type;
+
+ public uint substream_type;
+
/// hb_fifo_t*
public IntPtr fifo_in;
@@ -127,6 +139,8 @@ namespace HandBrake.Interop.HbLib TX3GSUB,
- SSASUB
+ SSASUB,
+
+ PGSSUB
}
}
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 a67a9e3b1..f6d9c0ffd 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs @@ -92,9 +92,9 @@ namespace HandBrake.Interop.HbLib /// int
public int pixel_aspect_height;
- public int color_prim;
- public int color_transfer;
- public int color_matrix;
+ public int color_prim;
+ public int color_transfer;
+ public int color_matrix;
/// int
public int rate;
|