From db5881aaeae77debe4ef2fc71c12900600f991fd Mon Sep 17 00:00:00 2001 From: randomengy Date: Thu, 19 Sep 2013 01:40:05 +0000 Subject: Interop: Removed unused structs and constants and added warnings in libhb code to update the ones that are used. Broke out types for each struct into their own file. Switched all references to hb_handle_s to IntPtr and deleted that non-working struct. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5786 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/common.h | 18 +- .../HandBrakeInterop/Converters.cs | 40 --- .../HandBrakeInterop/HandBrakeInstance.cs | 23 ++ .../HandBrakeInterop/HandBrakeInterop.csproj | 15 +- .../HandBrakeInterop/HbLib/HBDelegates.cs | 17 + .../HandBrakeInterop/HbLib/HbFunctions.cs | 13 +- .../HandBrakeInterop/HbLib/Misc.cs | 389 --------------------- .../HandBrakeInterop/HbLib/NativeConstants.cs | 123 ++----- .../HandBrakeInterop/HbLib/hb_audio.cs | 16 - .../HandBrakeInterop/HbLib/hb_container_s.cs | 26 ++ .../HandBrakeInterop/HbLib/hb_encoder_s.cs | 25 ++ .../HandBrakeInterop/HbLib/hb_filter.cs | 56 --- .../HandBrakeInterop/HbLib/hb_filter_ids.cs | 29 ++ .../HandBrakeInterop/HbLib/hb_filter_object_s.cs | 36 ++ .../HandBrakeInterop/HbLib/hb_job_s.cs | 47 +++ .../HandBrakeInterop/HbLib/hb_list_s.cs | 25 ++ .../HandBrakeInterop/HbLib/hb_mixdown_s.cs | 25 ++ .../HandBrakeInterop/HbLib/hb_rate_s.cs | 22 ++ .../HandBrakeInterop/HbLib/hb_state_s.cs | 96 +++++ .../HandBrakeInterop/HbLib/hb_subtitle.cs | 34 -- .../HandBrakeInterop/HbLib/hb_subtitle_config_s.cs | 42 +++ .../HandBrakeInterop/HbLib/hb_title_s.cs | 13 - .../HandBrakeInterop/HbLib/hb_title_set_s.cs | 22 ++ .../HandBrakeInterop/HbLib/iso639_lang_t.cs | 29 ++ .../Model/Encoding/EncodingProfile.cs | 2 + 25 files changed, 533 insertions(+), 650 deletions(-) create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HBDelegates.cs delete mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_container_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_encoder_s.cs delete mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_ids.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_object_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_list_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_mixdown_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_rate_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_config_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_set_s.cs create mode 100644 win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/iso639_lang_t.cs diff --git a/libhb/common.h b/libhb/common.h index e1985e87a..19c1049cd 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -178,6 +178,7 @@ hb_list_t *hb_chapter_list_copy(const hb_list_t *src); void hb_chapter_close(hb_chapter_t **chapter); void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_rate_s.cs when changing this struct struct hb_rate_s { const char *name; @@ -191,6 +192,7 @@ struct hb_dither_s int method; }; +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_mixdown_s.cs when changing this struct struct hb_mixdown_s { const char *name; @@ -198,6 +200,7 @@ struct hb_mixdown_s int amixdown; }; +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_encoder_s.cs when changing this struct struct hb_encoder_s { const char *name; // note: used in presets @@ -206,6 +209,7 @@ struct hb_encoder_s int muxers; // supported muxers }; +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_container_s.cs when changing this struct struct hb_container_s { const char *name; @@ -214,6 +218,7 @@ struct hb_container_s int format; }; +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_config_s.cs when changing this struct struct hb_subtitle_config_s { enum subdest { RENDERSUB, PASSTHRUSUB } dest; @@ -341,6 +346,7 @@ const char* hb_container_get_default_extension(int format); const char* hb_container_sanitize_name(const char *name); const hb_container_t* hb_container_get_next(const hb_container_t *last); +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_set_s.cs when changing this struct struct hb_title_set_s { hb_list_t * list_title; @@ -349,6 +355,7 @@ struct hb_title_set_s /****************************************************************************** * hb_job_t: settings to be filled by the UI + * Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs when changing this struct *****************************************************************************/ struct hb_job_s { @@ -556,7 +563,7 @@ struct hb_job_s }; /* Audio starts here */ -/* Audio Codecs */ +/* Audio Codecs: Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs when changing these consts */ #define HB_ACODEC_MASK 0x00FFFF00 #define HB_ACODEC_FAAC 0x00000100 #define HB_ACODEC_LAME 0x00000200 @@ -593,6 +600,7 @@ struct hb_job_s /* define an invalid VBR quality compatible with all VBR-capable codecs */ #define HB_INVALID_AUDIO_QUALITY (-3.) +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio_config_s.cs when changing this struct struct hb_audio_config_s { /* Output */ @@ -658,6 +666,7 @@ struct hb_audio_config_s }; #ifdef __LIBHB__ +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio_s.cs when changing this struct struct hb_audio_s { int id; @@ -677,6 +686,7 @@ struct hb_audio_s }; #endif +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_chapter_s.cs when changing this struct struct hb_chapter_s { int index; @@ -727,6 +737,8 @@ struct hb_chapter_s * - may correspond to the type of track (see the 'type' field; ex: "Closed Captions") * > iso639_2 * - language code for the subtitle, or "und" if unknown + * + * Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_s.cs when changing this struct */ struct hb_subtitle_s { @@ -812,6 +824,7 @@ struct hb_metadata_s hb_list_t * list_coverart; }; +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs when changing this struct struct hb_title_s { enum { HB_DVD_TYPE, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE } type; @@ -886,7 +899,7 @@ struct hb_title_s #define HBTF_SCAN_COMPLETE (1 << 0) }; - +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs when changing this struct struct hb_state_s { #define HB_STATE_IDLE 1 @@ -1111,6 +1124,7 @@ struct hb_filter_object_s #endif }; +// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_ids.cs when changing this enum enum { // for QSV - important to have before other filters diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs index 21fb68425..014ecd634 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs @@ -64,46 +64,6 @@ namespace HandBrake.Interop return VideoRates[framerate]; } - /// - /// Gets the native code for the given encoder. - /// - /// The audio encoder to convert. - /// The native code for the encoder. - public static uint AudioEncoderToNative(AudioEncoder encoder) - { - switch (encoder) - { - case AudioEncoder.Passthrough: - return NativeConstants.HB_ACODEC_AUTO_PASS; - case AudioEncoder.Ac3Passthrough: - return NativeConstants.HB_ACODEC_AC3_PASS; - case AudioEncoder.Ac3: - return NativeConstants.HB_ACODEC_AC3; - case AudioEncoder.ffaac: - return NativeConstants.HB_ACODEC_FFAAC; - case AudioEncoder.fdkaac: - return NativeConstants.HB_ACODEC_FDK_AAC; - case AudioEncoder.fdkheaac: - return NativeConstants.HB_ACODEC_FDK_HAAC; - case AudioEncoder.AacPassthru: - return NativeConstants.HB_ACODEC_AAC_PASS; - case AudioEncoder.Lame: - return NativeConstants.HB_ACODEC_LAME; - case AudioEncoder.Mp3Passthru: - return NativeConstants.HB_ACODEC_MP3_PASS; - case AudioEncoder.DtsPassthrough: - return NativeConstants.HB_ACODEC_DCA_PASS; - case AudioEncoder.DtsHDPassthrough: - return NativeConstants.HB_ACODEC_DCA_HD_PASS; - case AudioEncoder.Vorbis: - return NativeConstants.HB_ACODEC_VORBIS; - case AudioEncoder.ffflac: - return NativeConstants.HB_ACODEC_FFFLAC; - } - - return 0; - } - /// /// Convert Native HB Internal Audio int to a AudioCodec model. /// diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index 62b3ea389..9f7c17a79 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -166,6 +166,29 @@ namespace HandBrake.Interop } } + /// + /// Gets the HandBrake version string. + /// + public string Version + { + get + { + var versionPtr = HBFunctions.hb_get_version(this.hbHandle); + return Marshal.PtrToStringAnsi(versionPtr); + } + } + + /// + /// Gets the HandBrake build number. + /// + public int Build + { + get + { + return HBFunctions.hb_get_build(this.hbHandle); + } + } + /// /// Initializes this instance. /// diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj index 26575f285..fa97f477f 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj @@ -130,13 +130,22 @@ + - - + + + + + + + + - + + + diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HBDelegates.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HBDelegates.cs new file mode 100644 index 000000000..6d2adcfeb --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HBDelegates.cs @@ -0,0 +1,17 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Contains delegates for HandBrake interop. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void LoggingCallback(string message); +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index c1a463037..6c3f70357 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -13,6 +13,9 @@ namespace HandBrake.Interop.HbLib using System; using System.Runtime.InteropServices; + /// + /// Contains p-invoke function declarations to hblib. + /// public static class HBFunctions { [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)] @@ -41,20 +44,20 @@ namespace HandBrake.Interop.HbLib /// Return Type: char* ///param0: hb_handle_t* [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_version(ref hb_handle_s param0); + public static extern IntPtr hb_get_version(IntPtr hbHandle); /// Return Type: int ///param0: hb_handle_t* [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_get_build(ref hb_handle_s param0); + public static extern int hb_get_build(IntPtr hbHandle); /// Return Type: int ///h: hb_handle_t* ///version: char** [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_check_update(ref hb_handle_s h, ref IntPtr version); + public static extern int hb_check_update(IntPtr handle, ref IntPtr version); /// Return Type: char* @@ -175,13 +178,13 @@ namespace HandBrake.Interop.HbLib ///param0: hb_handle_t* ///param1: hb_state_t* [DllImport("hb.dll", EntryPoint = "hb_get_state2", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_get_state2(ref hb_handle_s param0, ref hb_state_s param1); + public static extern void hb_get_state2(IntPtr hbHandle, ref hb_state_s param1); /// Return Type: int ///param0: hb_handle_t* [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_get_scancount(ref hb_handle_s param0); + public static extern int hb_get_scancount(IntPtr hbHandle); /// Return Type: void diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs deleted file mode 100644 index 65472372b..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs +++ /dev/null @@ -1,389 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the hb_anamorphic_substruct type. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.HbLib -{ - using System; - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - public struct hb_anamorphic_substruct - { - /// int - public int mode; - - /// int - public int itu_par; - - /// int - public int par_width; - - /// int - public int par_height; - - /// int - public int dar_width; - - /// int - public int dar_height; - - /// int - public int keep_display_aspect; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_list_s - { - /// void** - public IntPtr items; - - /// int - public int items_alloc; - - /// int - public int items_count; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_rate_s - { - /// char* - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - /// int - public int rate; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_mixdown_s - { - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - /// char* - [MarshalAs(UnmanagedType.LPStr)] - public string short_name; - - /// int - public int amixdown; - } - - [StructLayout(LayoutKind.Sequential)] - public struct iso639_lang_t - { - public IntPtr eng_name; - - public IntPtr native_name; - - [MarshalAs(UnmanagedType.LPStr)] - public string iso639_1; - - [MarshalAs(UnmanagedType.LPStr)] - public string iso639_2; - - [MarshalAs(UnmanagedType.LPStr)] - public string iso639_2b; - } - - [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 qsv_s - { - public int decode; - - public int async_depth; - - /// av_qsv_context* - public IntPtr ctx; - - public qsv_enc_info_s enc_info; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_encoder_s - { - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - [MarshalAs(UnmanagedType.LPStr)] - public string short_name; - - public int codec; - - 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 - { - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string artist; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string composer; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string release_date; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string comment; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string album; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string album_artist; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string genre; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string description; - - /// char * - [MarshalAs(UnmanagedType.LPStr)] - public string long_description; - - /// uint8_t* - public IntPtr list_coverart; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_state_scanning_anon - { - public float progress; - - public int preview_cur; - - public int preview_count; - - /// int - public int title_cur; - - /// int - public int title_count; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_state_working_anon - { - /// float - public float progress; - - /// int - public int job_cur; - - /// int - public int job_count; - - /// float - public float rate_cur; - - /// float - public float rate_avg; - - /// int - public int hours; - - /// int - public int minutes; - - /// int - public int seconds; - - /// int - public int sequence_id; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_state_workdone_anon - { - /// int - public int error; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_state_muxing_anon - { - /// float - public float progress; - } - - [StructLayout(LayoutKind.Explicit)] - public struct hb_state_param_u - { - [FieldOffset(0)] - public hb_state_scanning_anon scanning; - - [FieldOffset(0)] - public hb_state_working_anon working; - - [FieldOffset(0)] - public hb_state_workdone_anon workdone; - - [FieldOffset(0)] - public hb_state_muxing_anon muxing; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_state_s - { - /// int - public int state; - public hb_state_param_u param; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_fifo_s - { - /// hb_lock_t* - public IntPtr @lock; - - /// uint32_t->unsigned int - public uint capacity; - - /// uint32_t->unsigned int - public uint size; - - /// uint32_t->unsigned int - public uint buffer_size; - - /// hb_buffer_t* - public IntPtr first; - - /// hb_buffer_t* - public IntPtr last; - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_lock_s - { - } - - [StructLayout(LayoutKind.Sequential)] - public struct hb_mux_data_s - { - /// MP4TrackId->uint32_t->unsigned int - public uint track; - - /// uint8_t->unsigned char - public byte subtitle; - - /// int - public int sub_format; - - /// uint64_t->unsigned int - public ulong sum_dur; - } - - // Not referred to anywhere - [StructLayout(LayoutKind.Sequential)] - public struct hb_interjob_s - { - /// int - public int last_job; - - /// int - public int frame_count; - - public int out_frame_count; - - /// uint64_t->unsigned int - public ulong total_time; - - /// int - public int vrate; - - /// int - public int vrate_base; - - /// hb_subtitle_t* - public IntPtr select_subtitle; - } - - /// Return Type: void - ///param0: void* - public delegate void hb_thread_s_function(IntPtr param0); - - [StructLayout(LayoutKind.Sequential)] - public struct hb_thread_s - { - /// char* - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - /// int - public int priority; - - /// hb_thread_s_function - public hb_thread_s_function AnonymousMember1; - - /// void* - public IntPtr arg; - - /// hb_lock_t* - public IntPtr @lock; - - /// int - public int exited; - - /// pthread_t->ptw32_handle_t->Anonymous_55c509b5_bbf2_4788_a684_ac1bd0056655 - public ptw32_handle_t thread; - } - - [StructLayout(LayoutKind.Sequential)] - public struct ptw32_handle_t - { - /// void* - public IntPtr p; - - /// unsigned int - public uint x; - } - - [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 7d5d12a85..c3b7c28dc 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs @@ -10,62 +10,38 @@ namespace HandBrake.Interop.HbLib { - public partial class NativeConstants + public class NativeConstants { - // Audio Encoders - public const uint HB_ACODEC_MASK = 0x00FFFF00; - public const uint HB_ACODEC_FAAC = 0x00000100; - public const uint HB_ACODEC_LAME = 0x00000200; - public const uint HB_ACODEC_VORBIS = 0x00000400; - public const uint HB_ACODEC_AC3 = 0x00000800; - public const uint HB_ACODEC_LPCM = 0x00001000; - public const uint HB_ACODEC_DCA = 0x00002000; - public const uint HB_ACODEC_CA_AAC = 0x00004000; - public const uint HB_ACODEC_CA_HAAC = 0x00008000; - public const uint HB_ACODEC_FFAAC = 0x00010000; - public const uint HB_ACODEC_FFMPEG = 0x00020000; - 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_FFFLAC24 = 0x00200000; - public const uint HB_ACODEC_FDK_AAC = 0x00400000; - public const uint HB_ACODEC_FDK_HAAC = 0x00800000; - public const uint HB_ACODEC_FF_MASK = 0x00FF2000; - 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); - public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG); - - // Subtitle Types - public const int HB_SUBSTREAM_BD_TRUEHD = 0x72; - public const int HB_SUBSTREAM_BD_AC3 = 0x76; - public const int HB_SUBSTREAM_BD_DTSHD = 0x72; - public const int HB_SUBSTREAM_BD_DTS = 0x71; - - // Video Encoders - public const int HB_VCODEC_MASK = 0x0000FFF; - public const int HB_VCODEC_X264 = 0x000001; - public const int HB_VCODEC_THEORA = 0x000002; - public const int HB_VCODEC_FFMPEG_MPEG4 = 0x000010; - public const int HB_VCODEC_FFMPEG = HB_VCODEC_FFMPEG_MPEG4; - public const int HB_VCODEC_FFMPEG_MPEG2 = 0x000020; - public const int HB_VCODEC_FFMPEG_MASK = 0x0000F0; - public const int HB_VCODEC_QSV_H264 = 0x0000100; - public const int HB_VCODEC_QSV_MASK = 0x0000F00; - public const int HB_VCODEC_H264_MASK = (HB_VCODEC_X264 | HB_VCODEC_QSV_H264); - - // Muxers - public const int HB_MUX_MASK = 0xFF0000; - public const int HB_MUX_MP4 = 0x010000; - public const int HB_MUX_MKV = 0x100000; - - public const int HBTF_NO_IDR = 1 << 0; - + // Audio encoders + public const uint HB_ACODEC_MASK = 0x00FFFF00; + public const uint HB_ACODEC_FAAC = 0x00000100; + public const uint HB_ACODEC_LAME = 0x00000200; + public const uint HB_ACODEC_VORBIS = 0x00000400; + public const uint HB_ACODEC_AC3 = 0x00000800; + public const uint HB_ACODEC_LPCM = 0x00001000; + public const uint HB_ACODEC_DCA = 0x00002000; + public const uint HB_ACODEC_CA_AAC = 0x00004000; + public const uint HB_ACODEC_CA_HAAC = 0x00008000; + public const uint HB_ACODEC_FFAAC = 0x00010000; + public const uint HB_ACODEC_FFMPEG = 0x00020000; + 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_FFFLAC24 = 0x00200000; + public const uint HB_ACODEC_FDK_AAC = 0x00400000; + public const uint HB_ACODEC_FDK_HAAC = 0x00800000; + public const uint HB_ACODEC_FF_MASK = 0x00FF2000; + 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); + public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG); + + // Encode state public const int HB_STATE_IDLE = 1; public const int HB_STATE_SCANNING = 2; public const int HB_STATE_SCANDONE = 4; @@ -73,42 +49,5 @@ namespace HandBrake.Interop.HbLib public const int HB_STATE_PAUSED = 16; public const int HB_STATE_WORKDONE = 32; public const int HB_STATE_MUXING = 64; - - public const int HB_ERROR_NONE = 0; - public const int HB_ERROR_CANCELED = 1; - public const int HB_ERROR_UNKNOWN = 2; - - public const int AUDIO_F_DOLBY = 1 << 31; - - public const int HB_FRAME_IDR = 0x01; - public const int HB_FRAME_I = 0x02; - public const int HB_FRAME_AUDIO = 0x04; - public const int HB_FRAME_P = 0x10; - public const int HB_FRAME_B = 0x20; - public const int HB_FRAME_BREF = 0x40; - public const int HB_FRAME_KEY = 0x0F; - public const int HB_FRAME_REF = 0xF0; - - public const int HB_CONFIG_MAX_SIZE = 8192; - - // 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 - - // hb_title_t.video_decode_support values (bit field) - public const int HB_DECODE_SUPPORT_SW = 0x01; // software (libavcodec or mpeg2dec) - public const int HB_DECODE_SUPPORT_QSV = 0x02; // Intel Quick Sync Video } } diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs index a598ccb80..72ed63483 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs @@ -76,22 +76,6 @@ namespace HandBrake.Interop.HbLib public int delay; } - 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 { diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_container_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_container_s.cs new file mode 100644 index 000000000..bb3a62f4f --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_container_s.cs @@ -0,0 +1,26 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [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; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_encoder_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_encoder_s.cs new file mode 100644 index 000000000..76fe71a42 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_encoder_s.cs @@ -0,0 +1,25 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_encoder_s + { + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + [MarshalAs(UnmanagedType.LPStr)] + public string short_name; + + public int codec; + + public int muxers; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter.cs deleted file mode 100644 index 8dbe88d20..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.HbLib -{ - using System; - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - public struct hb_filter_object_s - { - public int id; - public int enforce_order; - public IntPtr name; - public IntPtr settings; - - // Internal stuff we need to marshal - public IntPtr init; - public IntPtr work; - public IntPtr close; - public IntPtr info; - public IntPtr fifo_in; - public IntPtr fifo_out; - public IntPtr subtitle; - public IntPtr private_data; - public IntPtr thread; - public IntPtr done; - public int status; - public int chapter_val; - public long chapter_time; - } - - public enum hb_filter_ids - { - HB_FILTER_QSV_PRE = 1, // for QSV - important to have before other filters - // First, filters that may change the framerate (drop or dup frames) - HB_FILTER_DETELECINE, - HB_FILTER_DECOMB, - HB_FILTER_DEINTERLACE, - HB_FILTER_VFR, - // Filters that must operate on the original source image are next - HB_FILTER_DEBLOCK, - HB_FILTER_DENOISE, - HB_FILTER_RENDER_SUB, - HB_FILTER_CROP_SCALE, - // Finally filters that don't care what order they are in, - // except that they must be after the above filters - HB_FILTER_ROTATE, - HB_FILTER_QSV_POST, // for QSV - important to have as a last one - HB_FILTER_QSV, // default MSDK VPP filter - } -} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_ids.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_ids.cs new file mode 100644 index 000000000..3c56b7f75 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_ids.cs @@ -0,0 +1,29 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + public enum hb_filter_ids + { + HB_FILTER_QSV_PRE = 1, // for QSV - important to have before other filters + // First, filters that may change the framerate (drop or dup frames) + HB_FILTER_DETELECINE, + HB_FILTER_DECOMB, + HB_FILTER_DEINTERLACE, + HB_FILTER_VFR, + // Filters that must operate on the original source image are next + HB_FILTER_DEBLOCK, + HB_FILTER_DENOISE, + HB_FILTER_RENDER_SUB, + HB_FILTER_CROP_SCALE, + // Finally filters that don't care what order they are in, + // except that they must be after the above filters + HB_FILTER_ROTATE, + HB_FILTER_QSV_POST, // for QSV - important to have as a last one + HB_FILTER_QSV, // default MSDK VPP filter + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_object_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_object_s.cs new file mode 100644 index 000000000..1329b88ec --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_filter_object_s.cs @@ -0,0 +1,36 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_filter_object_s + { + public int id; + public int enforce_order; + public IntPtr name; + public IntPtr settings; + + // Internal stuff we need to marshal + public IntPtr init; + public IntPtr work; + public IntPtr close; + public IntPtr info; + public IntPtr fifo_in; + public IntPtr fifo_out; + public IntPtr subtitle; + public IntPtr private_data; + public IntPtr thread; + public IntPtr done; + public int status; + public int chapter_val; + public long chapter_time; + } +} 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 94aa5a290..6d990dc67 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs @@ -175,4 +175,51 @@ namespace HandBrake.Interop.HbLib [MarshalAs(UnmanagedType.ByValArray, SizeConst = MarshalingConstants.JobPaddingBytes, ArraySubType = UnmanagedType.U1)] public byte[] padding; } + + [StructLayout(LayoutKind.Sequential)] + public struct hb_anamorphic_substruct + { + /// int + public int mode; + + /// int + public int itu_par; + + /// int + public int par_width; + + /// int + public int par_height; + + /// int + public int dar_width; + + /// int + public int dar_height; + + /// int + public int keep_display_aspect; + } + + [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 qsv_s + { + public int decode; + + public int async_depth; + + /// av_qsv_context* + public IntPtr ctx; + + public qsv_enc_info_s enc_info; + } } diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_list_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_list_s.cs new file mode 100644 index 000000000..c7eb2d4ea --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_list_s.cs @@ -0,0 +1,25 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_list_s + { + /// void** + public IntPtr items; + + /// int + public int items_alloc; + + /// int + public int items_count; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_mixdown_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_mixdown_s.cs new file mode 100644 index 000000000..f7e70d0a9 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_mixdown_s.cs @@ -0,0 +1,25 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_mixdown_s + { + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + /// char* + [MarshalAs(UnmanagedType.LPStr)] + public string short_name; + + /// int + public int amixdown; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_rate_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_rate_s.cs new file mode 100644 index 000000000..3c8b23e16 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_rate_s.cs @@ -0,0 +1,22 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_rate_s + { + /// char* + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + /// int + public int rate; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs new file mode 100644 index 000000000..bb82aad2b --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs @@ -0,0 +1,96 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_state_s + { + /// int + public int state; + public hb_state_param_u param; + } + + [StructLayout(LayoutKind.Explicit)] + public struct hb_state_param_u + { + [FieldOffset(0)] + public hb_state_scanning_anon scanning; + + [FieldOffset(0)] + public hb_state_working_anon working; + + [FieldOffset(0)] + public hb_state_workdone_anon workdone; + + [FieldOffset(0)] + public hb_state_muxing_anon muxing; + } + + [StructLayout(LayoutKind.Sequential)] + public struct hb_state_scanning_anon + { + public float progress; + + public int preview_cur; + + public int preview_count; + + /// int + public int title_cur; + + /// int + public int title_count; + } + + [StructLayout(LayoutKind.Sequential)] + public struct hb_state_working_anon + { + /// float + public float progress; + + /// int + public int job_cur; + + /// int + public int job_count; + + /// float + public float rate_cur; + + /// float + public float rate_avg; + + /// int + public int hours; + + /// int + public int minutes; + + /// int + public int seconds; + + /// int + public int sequence_id; + } + + [StructLayout(LayoutKind.Sequential)] + public struct hb_state_workdone_anon + { + /// int + public int error; + } + + [StructLayout(LayoutKind.Sequential)] + public struct hb_state_muxing_anon + { + /// float + public float progress; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs index b3a5af3e8..2821b2d1c 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle.cs @@ -2,9 +2,6 @@ // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // -// -// Defines the hb_subtitle_s type. -// // Disable Stylecop Warnings for this file // -------------------------------------------------------------------------------------------------------------------- @@ -87,37 +84,6 @@ namespace HandBrake.Interop.HbLib public IntPtr mux_data; } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public struct hb_subtitle_config_s - { - /// hb_subtitle_config_s_subdest - public hb_subtitle_config_s_subdest dest; - - /// int - public int force; - - /// int - public int default_track; - - /// char[128] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string src_filename; - - /// char[40] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] - public string src_codeset; - - /// int64_t->int - public long offset; - } - - public enum hb_subtitle_config_s_subdest - { - RENDERSUB, - - PASSTHRUSUB, - } - public enum hb_subtitle_s_subtype { PICTURESUB, diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_config_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_config_s.cs new file mode 100644 index 000000000..2e3502a24 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_config_s.cs @@ -0,0 +1,42 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct hb_subtitle_config_s + { + /// hb_subtitle_config_s_subdest + public hb_subtitle_config_s_subdest dest; + + /// int + public int force; + + /// int + public int default_track; + + /// char[128] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string src_filename; + + /// char[40] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] + public string src_codeset; + + /// int64_t->int + public long offset; + } + + public enum hb_subtitle_config_s_subdest + { + RENDERSUB, + + PASSTHRUSUB, + } +} 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 4852d7044..c20107aa5 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_s.cs @@ -2,9 +2,6 @@ // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // -// -// Defines the hb_title_s type. -// // Disable Stylecop Warnings for this file // -------------------------------------------------------------------------------------------------------------------- @@ -163,16 +160,6 @@ namespace HandBrake.Interop.HbLib public uint flags; } - [StructLayout(LayoutKind.Sequential)] - public struct hb_title_set_s - { - ///hb_list_t * - public IntPtr list_title; - - // int - public int feature; - } - public enum hb_title_type_anon { HB_DVD_TYPE, diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_set_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_set_s.cs new file mode 100644 index 000000000..087e7cde4 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_title_set_s.cs @@ -0,0 +1,22 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct hb_title_set_s + { + ///hb_list_t * + public IntPtr list_title; + + // int + public int feature; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/iso639_lang_t.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/iso639_lang_t.cs new file mode 100644 index 000000000..a1b8efc70 --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/iso639_lang_t.cs @@ -0,0 +1,29 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct iso639_lang_t + { + public IntPtr eng_name; + + public IntPtr native_name; + + [MarshalAs(UnmanagedType.LPStr)] + public string iso639_1; + + [MarshalAs(UnmanagedType.LPStr)] + public string iso639_2; + + [MarshalAs(UnmanagedType.LPStr)] + public string iso639_2b; + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs index bd25944f2..41751a946 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs @@ -79,7 +79,9 @@ namespace HandBrake.Interop.Model.Encoding { var profile = new EncodingProfile { +#pragma warning disable 612, 618 OutputFormat = this.OutputFormat, +#pragma warning restore 612, 618 ContainerName = this.ContainerName, PreferredExtension = this.PreferredExtension, IncludeChapterMarkers = this.IncludeChapterMarkers, -- cgit v1.2.3