OSDN Git Service

import original 0.9.5 release
[handbrake-jp/handbrake-jp.git] / win / C# / interop / HbLib.cs
diff --git a/win/C#/interop/HbLib.cs b/win/C#/interop/HbLib.cs
new file mode 100644 (file)
index 0000000..9d22207
--- /dev/null
@@ -0,0 +1,1290 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace HandBrake.Interop\r
+{\r
+\r
+    public partial class NativeConstants\r
+    {\r
+        public const int HB_ACODEC_MASK =   0x00FF00;\r
+        public const int HB_ACODEC_FAAC =   0x000100;\r
+        public const int HB_ACODEC_LAME =   0x000200;\r
+        public const int HB_ACODEC_VORBIS = 0x000400;\r
+        public const int HB_ACODEC_AC3 =    0x000800;\r
+        public const int HB_ACODEC_MPGA =   0x001000;\r
+        public const int HB_ACODEC_LPCM =   0x002000;\r
+        public const int HB_ACODEC_DCA =    0x004000;\r
+        public const int HB_ACODEC_FFMPEG = 0x008000;\r
+        public const int HB_ACODEC_CA_AAC = 0x010000;\r
+\r
+        public const int HB_AMIXDOWN_DCA_FORMAT_MASK =              0x00FFF000;\r
+        public const int HB_AMIXDOWN_A52_FORMAT_MASK =              0x00000FF0;\r
+        public const int HB_AMIXDOWN_DISCRETE_CHANNEL_COUNT_MASK =  0x0000000F;\r
+        public const int HB_AMIXDOWN_MONO =                         0x01000001;\r
+        public const int HB_AMIXDOWN_STEREO =                       0x02002022;\r
+        public const int HB_AMIXDOWN_DOLBY =                        0x042070A2;\r
+        public const int HB_AMIXDOWN_DOLBYPLII =                    0x084094A2;\r
+        public const int HB_AMIXDOWN_6CH =                          0x10089176;\r
+\r
+        public const int HB_VCODEC_MASK =   0x0000FF;\r
+        public const int HB_VCODEC_FFMPEG = 0x000001;\r
+        public const int HB_VCODEC_X264 =   0x000002;\r
+        public const int HB_VCODEC_THEORA = 0x000004;\r
+\r
+        public const int HB_MUX_MASK =  0xFF0000;\r
+        public const int HB_MUX_MP4 =   0x010000;\r
+        public const int HB_MUX_PSP =   0x020000;\r
+        public const int HB_MUX_AVI =   0x040000;\r
+        public const int HB_MUX_OGM =   0x080000;\r
+        public const int HB_MUX_IPOD =  0x100000;\r
+        public const int HB_MUX_MKV =   0x200000;\r
+\r
+        public const int HBTF_NO_IDR = 1 << 0;\r
+\r
+        public const int HB_STATE_IDLE = 1;\r
+        public const int HB_STATE_SCANNING = 2;\r
+        public const int HB_STATE_SCANDONE = 4;\r
+        public const int HB_STATE_WORKING = 8;\r
+        public const int HB_STATE_PAUSED = 16;\r
+        public const int HB_STATE_WORKDONE = 32;\r
+        public const int HB_STATE_MUXING = 64;\r
+\r
+        public const int HB_ERROR_NONE = 0;\r
+        public const int HB_ERROR_CANCELED = 1;\r
+        public const int HB_ERROR_UNKNOWN = 2;\r
+\r
+        public const int AUDIO_F_DOLBY = 1 << 31;\r
+\r
+        public const int HB_FRAME_IDR =     0x01;\r
+        public const int HB_FRAME_I =       0x02;\r
+        public const int HB_FRAME_AUDIO =   0x04;\r
+        public const int HB_FRAME_P =       0x10;\r
+        public const int HB_FRAME_B =       0x20;\r
+        public const int HB_FRAME_BREF =    0x40;\r
+        public const int HB_FRAME_KEY =     0x0F;\r
+        public const int HB_FRAME_REF =     0xF0;\r
+\r
+        public const int HB_CONFIG_MAX_SIZE = 8192;\r
+\r
+        public const int HB_FILTER_DETELECINE = 1;\r
+        public const int HB_FILTER_DEINTERLACE = 2;\r
+        public const int HB_FILTER_DEBLOCK = 3;\r
+        public const int HB_FILTER_DENOISE = 4;\r
+        public const int HB_FILTER_DECOMB = 5;\r
+        public const int HB_FILTER_ROTATE = 6;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_anamorphic_substruct\r
+    {\r
+        /// int\r
+        public int mode;\r
+\r
+        /// int\r
+        public int itu_par;\r
+\r
+        /// int\r
+        public int par_width;\r
+\r
+        /// int\r
+        public int par_height;\r
+\r
+        /// int\r
+        public int dar_width;\r
+\r
+        /// int\r
+        public int dar_height;\r
+\r
+        /// int\r
+        public int keep_display_aspect;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_job_s\r
+    {\r
+        /// int\r
+        public int sequence_id;\r
+\r
+        /// hb_title_t*\r
+        public IntPtr title;\r
+\r
+        public int feature;\r
+\r
+        /// int\r
+        public int chapter_start;\r
+\r
+        /// int\r
+        public int chapter_end;\r
+\r
+        /// int\r
+        public int chapter_markers;\r
+\r
+        /// int[4]\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
+        public int[] crop;\r
+\r
+        /// int\r
+        public int deinterlace;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr filters;\r
+\r
+        /// int\r
+        public int width;\r
+\r
+        /// int\r
+        public int height;\r
+\r
+        /// int\r
+        public int keep_ratio;\r
+\r
+        /// int\r
+        public int grayscale;\r
+\r
+        public hb_anamorphic_substruct anamorphic;\r
+\r
+        public int modulus;\r
+\r
+        /// int\r
+        public int maxWidth;\r
+\r
+        /// int\r
+        public int maxHeight;\r
+\r
+        /// int\r
+        public int vcodec;\r
+\r
+        /// float\r
+        public float vquality;\r
+\r
+        /// int\r
+        public int vbitrate;\r
+\r
+        /// int\r
+        public int vrate;\r
+\r
+        /// int\r
+        public int vrate_base;\r
+\r
+        /// int\r
+        public int vfr;\r
+\r
+        /// int\r
+        public int cfr;\r
+\r
+        /// int\r
+        public int pass;\r
+\r
+        /// int\r
+        public int h264_13;\r
+\r
+        /// int\r
+        public int h264_level;\r
+\r
+        /// char*\r
+        //[MarshalAs(UnmanagedType.LPStr)]\r
+        //public string x264opts;\r
+\r
+        public IntPtr x264opts;\r
+\r
+        /// int\r
+        public int areBframes;\r
+\r
+        /// int\r
+        public int color_matrix;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr list_audio;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr list_subtitle;\r
+\r
+        /// int\r
+        public int mux;\r
+\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string file;\r
+\r
+        /// int\r
+        public int largeFileSize;\r
+\r
+        /// int\r
+        public int mp4_optimize;\r
+\r
+        /// int\r
+        public int ipod_atom;\r
+\r
+        /// int\r
+        public int indepth_scan;\r
+\r
+        /// hb_subtitle_config_t->hb_subtitle_config_s\r
+        public hb_subtitle_config_s select_subtitle_config;\r
+\r
+        /// int\r
+        public int angle;\r
+\r
+        public int frame_to_start;\r
+\r
+        public long pts_to_start;\r
+\r
+        /// int\r
+        public int frame_to_stop;\r
+\r
+        /// int64_t->int\r
+        public long pts_to_stop;\r
+\r
+        /// int\r
+        public int start_at_preview;\r
+\r
+        /// int\r
+        public int seek_points;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint frames_to_skip;\r
+\r
+        // Padding for the part of the struct we don't care about marshaling.\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24644, ArraySubType = UnmanagedType.U1)]\r
+        public byte[] padding;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_list_s\r
+    {\r
+        /// void**\r
+        public IntPtr items;\r
+\r
+        /// int\r
+        public int items_alloc;\r
+\r
+        /// int\r
+        public int items_count;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_rate_s\r
+    {\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string @string;\r
+\r
+        /// int\r
+        public int rate;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_handle_s\r
+    {\r
+        public int id;\r
+\r
+        /// int\r
+        public int build;\r
+\r
+        /// char[32]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]\r
+        public string version;\r
+\r
+        /// hb_thread_t*\r
+        public IntPtr update_thread;\r
+\r
+        /// int\r
+        public int die;\r
+\r
+        /// hb_thread_t*\r
+        public IntPtr main_thread;\r
+\r
+        /// int\r
+        public int pid;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr list_title;\r
+\r
+        /// hb_thread_t*\r
+        public IntPtr scan_thread;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr jobs;\r
+\r
+        /// hb_job_t*\r
+        public IntPtr current_job;\r
+\r
+        /// int\r
+        public int job_count;\r
+\r
+        /// int\r
+        public int job_count_permanent;\r
+\r
+        /// int\r
+        public int work_die;\r
+\r
+        /// int\r
+        public int work_error;\r
+\r
+        /// hb_thread_t*\r
+        public IntPtr work_thread;\r
+\r
+        /// int\r
+        public int cpu_count;\r
+\r
+        /// hb_lock_t*\r
+        public IntPtr state_lock;\r
+\r
+        /// hb_state_t->hb_state_s\r
+        public hb_state_s state;\r
+\r
+        /// int\r
+        public int paused;\r
+\r
+        /// hb_lock_t*\r
+        public IntPtr pause_lock;\r
+\r
+        /// int\r
+        public int scanCount;\r
+\r
+        /// hb_interjob_t*\r
+        public IntPtr interjob;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_chapter_s\r
+    {\r
+        /// int\r
+        public int index;\r
+\r
+        /// int\r
+        public int pgcn;\r
+\r
+        /// int\r
+        public int pgn;\r
+\r
+        /// int\r
+        public int cell_start;\r
+\r
+        /// int\r
+        public int cell_end;\r
+\r
+        /// int\r
+        public int block_start;\r
+\r
+        /// int\r
+        public int block_end;\r
+\r
+        /// int\r
+        public int block_count;\r
+\r
+        /// int\r
+        public int hours;\r
+\r
+        /// int\r
+        public int minutes;\r
+\r
+        /// int\r
+        public int seconds;\r
+\r
+        /// uint64_t->unsigned int\r
+        public ulong duration;\r
+\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string title;\r
+    }\r
+\r
+    public enum hb_subtitle_s_subtype\r
+    {\r
+        PICTURESUB,\r
+\r
+        TEXTSUB,\r
+    }\r
+\r
+    public enum hb_subtitle_s_subsource\r
+    {\r
+        VOBSUB,\r
+\r
+        SRTSUB,\r
+\r
+        CC608SUB,\r
+\r
+        CC708SUB,\r
+\r
+        UTF8SUB,\r
+\r
+        TX3GSUB,\r
+\r
+        SSASUB\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_subtitle_s\r
+    {\r
+        /// int\r
+        public int id;\r
+\r
+        /// int\r
+        public int track;\r
+\r
+        /// hb_subtitle_config_t->hb_subtitle_config_s\r
+        public hb_subtitle_config_s config;\r
+\r
+        /// hb_subtitle_s_subtype\r
+        public hb_subtitle_s_subtype format;\r
+\r
+        /// hb_subtitle_s_subsource\r
+        public hb_subtitle_s_subsource source;\r
+\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string lang;\r
+\r
+        /// char[4]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
+        public string iso639_2;\r
+\r
+        /// uint8_t->unsigned char\r
+        public byte type;\r
+\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)]\r
+        public uint[] palette;\r
+\r
+        public int width;\r
+\r
+        public int height;\r
+\r
+        /// int\r
+        public int hits;\r
+\r
+        /// int\r
+        public int forced_hits;\r
+\r
+        /// hb_fifo_t*\r
+        public IntPtr fifo_in;\r
+\r
+        /// hb_fifo_t*\r
+        public IntPtr fifo_raw;\r
+\r
+        /// hb_fifo_t*\r
+        public IntPtr fifo_sync;\r
+\r
+        /// hb_fifo_t*\r
+        public IntPtr fifo_out;\r
+\r
+        /// hb_mux_data_t*\r
+        public IntPtr mux_data;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_metadata_s\r
+    {\r
+        /// char[255]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string name;\r
+\r
+        /// char[255]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string artist;\r
+\r
+        /// char[255]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string composer;\r
+\r
+        /// char[255]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string release_date;\r
+\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string comment;\r
+\r
+        /// char[255]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string album;\r
+\r
+        /// char[255]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
+        public string genre;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint coverart_size;\r
+\r
+        /// uint8_t*\r
+        public IntPtr coverart;\r
+    }\r
+\r
+    public enum Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
+    {\r
+        HB_DVD_TYPE,\r
+\r
+        HB_STREAM_TYPE,\r
+    }\r
+\r
+    public enum Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
+    {\r
+        /// HB_MPEG2_PS_DEMUXER -> 0\r
+        HB_MPEG2_PS_DEMUXER = 0,\r
+\r
+        HB_MPEG2_TS_DEMUXER,\r
+\r
+        HB_NULL_DEMUXER,\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_title_s\r
+    {\r
+        /// Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
+        public Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550 type;\r
+\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string dvd;\r
+\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string name;\r
+\r
+        //public fixed byte dvd[1024];\r
+\r
+        //public fixed byte name[1024];\r
+\r
+        /// int\r
+        public int index;\r
+\r
+        /// int\r
+        public int vts;\r
+\r
+        /// int\r
+        public int ttn;\r
+\r
+        /// int\r
+        public int cell_start;\r
+\r
+        /// int\r
+        public int cell_end;\r
+\r
+        /// int\r
+        public int block_start;\r
+\r
+        /// int\r
+        public int block_end;\r
+\r
+        /// int\r
+        public int block_count;\r
+\r
+        /// int\r
+        public int angle_count;\r
+\r
+        /// int\r
+        public int hours;\r
+\r
+        /// int\r
+        public int minutes;\r
+\r
+        /// int\r
+        public int seconds;\r
+\r
+        /// uint64_t->unsigned int\r
+        public ulong duration;\r
+\r
+        /// double\r
+        public double aspect;\r
+\r
+        /// double\r
+        public double container_aspect;\r
+\r
+        /// int\r
+        public int width;\r
+\r
+        /// int\r
+        public int height;\r
+\r
+        /// int\r
+        public int pixel_aspect_width;\r
+\r
+        /// int\r
+        public int pixel_aspect_height;\r
+\r
+        /// int\r
+        public int rate;\r
+\r
+        /// int\r
+        public int rate_base;\r
+\r
+        /// int[4]\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
+        public int[] crop;\r
+\r
+        //public fixed int crop[4];\r
+\r
+        /// Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
+        public Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db demuxer;\r
+\r
+        /// int\r
+        public int detected_interlacing;\r
+\r
+        /// int\r
+        public int video_id;\r
+\r
+        /// int\r
+        public int video_codec;\r
+\r
+        /// int\r
+        public int video_codec_param;\r
+\r
+        /// char*\r
+        public IntPtr video_codec_name;\r
+\r
+        /// int\r
+        public int video_bitrate;\r
+\r
+        /// char*\r
+        public IntPtr container_name;\r
+\r
+        /// int\r
+        public int data_rate;\r
+\r
+        /// hb_metadata_t*\r
+        public IntPtr metadata;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr list_chapter;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr list_audio;\r
+\r
+        /// hb_list_t*\r
+        public IntPtr list_subtitle;\r
+\r
+        /// hb_job_t*\r
+        public IntPtr job;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint flags;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_state_scanning_s\r
+    {\r
+        /// int\r
+        public int title_cur;\r
+\r
+        /// int\r
+        public int title_count;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_state_working_s\r
+    {\r
+        /// float\r
+        public float progress;\r
+\r
+        /// int\r
+        public int job_cur;\r
+\r
+        /// int\r
+        public int job_count;\r
+\r
+        /// float\r
+        public float rate_cur;\r
+\r
+        /// float\r
+        public float rate_avg;\r
+\r
+        /// int\r
+        public int hours;\r
+\r
+        /// int\r
+        public int minutes;\r
+\r
+        /// int\r
+        public int seconds;\r
+\r
+        /// int\r
+        public int sequence_id;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_state_workdone_s\r
+    {\r
+        /// int\r
+        public int error;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_state_muxing_s\r
+    {\r
+        /// float\r
+        public float progress;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Explicit)]\r
+    public struct hb_state_param_u\r
+    {\r
+        [FieldOffset(0)]\r
+        public hb_state_scanning_s scanning;\r
+\r
+        [FieldOffset(0)]\r
+        public hb_state_working_s working;\r
+\r
+        [FieldOffset(0)]\r
+        public hb_state_workdone_s workdone;\r
+\r
+        [FieldOffset(0)]\r
+        public hb_state_muxing_s muxing;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_state_s\r
+    {\r
+\r
+        /// int\r
+        public int state;\r
+        public hb_state_param_u param;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_audio_s\r
+    {\r
+        /// int\r
+        public int id;\r
+\r
+        /// hb_audio_config_t->hb_audio_config_s\r
+        public hb_audio_config_s config;\r
+\r
+        // Padding for the part of the struct we don't care about marshaling.\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24600, ArraySubType = UnmanagedType.U1)]\r
+        public byte[] padding;\r
+\r
+        /// Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545\r
+        //public Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545 priv;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_audio_config_s\r
+    {\r
+        public hb_audio_config_output_s output;\r
+        public hb_audio_config_input_s input;\r
+\r
+        /// Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
+        public Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d flags;\r
+\r
+        public hb_audio_config_lang_s lang;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_audio_config_output_s\r
+    {\r
+        /// int\r
+        public int track;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint codec;\r
+\r
+        /// int\r
+        public int samplerate;\r
+\r
+        /// int\r
+        public int bitrate;\r
+\r
+        /// int\r
+        public int mixdown;\r
+\r
+        /// double\r
+        public double dynamic_range_compression;\r
+\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string name;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_audio_config_input_s\r
+    {\r
+        /// int\r
+        public int track;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint codec;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint codec_param;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint version;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint mode;\r
+\r
+        /// int\r
+        public int samplerate;\r
+\r
+        /// int\r
+        public int bitrate;\r
+\r
+        /// int\r
+        public int channel_layout;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Explicit)]\r
+    public struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
+    {\r
+        /// int\r
+        [FieldOffset(0)]\r
+        public int ac3;\r
+\r
+        /// int\r
+        [FieldOffset(0)]\r
+        public int dca;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_audio_config_lang_s\r
+    {\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string description;\r
+\r
+        /// char[1024]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
+        public string simple;\r
+\r
+        /// char[4]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
+        public string iso639_2;\r
+\r
+        /// uint8_t->unsigned char\r
+        public byte type;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_mixdown_s\r
+    {\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string human_readable_name;\r
+\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string internal_name;\r
+\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string short_name;\r
+\r
+        /// int\r
+        public int amixdown;\r
+    }\r
+\r
+    public enum hb_subtitle_config_s_subdest\r
+    {\r
+        RENDERSUB,\r
+\r
+        PASSTHRUSUB,\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
+    public struct hb_subtitle_config_s\r
+    {\r
+        /// hb_subtitle_config_s_subdest\r
+        public hb_subtitle_config_s_subdest dest;\r
+\r
+        /// int\r
+        public int force;\r
+\r
+        /// int\r
+        public int default_track;\r
+\r
+        /// char[128]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]\r
+        public string src_filename;\r
+\r
+        /// char[40]\r
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]\r
+        public string src_codeset;\r
+\r
+        /// int64_t->int\r
+        public long offset;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_fifo_s\r
+    {\r
+        /// hb_lock_t*\r
+        public IntPtr @lock;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint capacity;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint size;\r
+\r
+        /// uint32_t->unsigned int\r
+        public uint buffer_size;\r
+\r
+        /// hb_buffer_t*\r
+        public IntPtr first;\r
+\r
+        /// hb_buffer_t*\r
+        public IntPtr last;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_lock_s\r
+    {\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_buffer_s\r
+    {\r
+        /// int\r
+        public int size;\r
+\r
+        /// int\r
+        public int alloc;\r
+\r
+        /// uint8_t*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string data;\r
+\r
+        /// int\r
+        public int cur;\r
+\r
+        /// int64_t->int\r
+        public long sequence;\r
+\r
+        /// int\r
+        public int id;\r
+\r
+        /// int64_t->int\r
+        public long start;\r
+\r
+        /// int64_t->int\r
+        public long stop;\r
+\r
+        /// int\r
+        public int new_chap;\r
+\r
+        /// uint8_t->unsigned char\r
+        public byte frametype;\r
+\r
+        /// uint16_t->unsigned int\r
+        public uint flags;\r
+\r
+        /// int64_t->int\r
+        public long renderOffset;\r
+\r
+        /// int\r
+        public int x;\r
+\r
+        /// int\r
+        public int y;\r
+\r
+        /// int\r
+        public int width;\r
+\r
+        /// int\r
+        public int height;\r
+\r
+        /// hb_buffer_t*\r
+        public IntPtr sub;\r
+\r
+        /// hb_buffer_t*\r
+        public IntPtr next;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_mux_data_s\r
+    {\r
+        /// MP4TrackId->uint32_t->unsigned int\r
+        public uint track;\r
+\r
+        /// uint8_t->unsigned char\r
+        public byte subtitle;\r
+\r
+        /// int\r
+        public int sub_format;\r
+\r
+        /// uint64_t->unsigned int\r
+        public ulong sum_dur;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_interjob_s\r
+    {\r
+        /// int\r
+        public int last_job;\r
+\r
+        /// int\r
+        public int frame_count;\r
+\r
+        /// uint64_t->unsigned int\r
+        public ulong total_time;\r
+\r
+        /// int\r
+        public int render_dropped;\r
+\r
+        /// int\r
+        public int vrate;\r
+\r
+        /// int\r
+        public int vrate_base;\r
+\r
+        /// hb_subtitle_t*\r
+        public IntPtr select_subtitle;\r
+    }\r
+\r
+    /// Return Type: void\r
+    ///param0: void*\r
+    public delegate void hb_thread_s_function(IntPtr param0);\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct hb_thread_s\r
+    {\r
+        /// char*\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        public string name;\r
+\r
+        /// int\r
+        public int priority;\r
+\r
+        /// hb_thread_s_function\r
+        public hb_thread_s_function AnonymousMember1;\r
+\r
+        /// void*\r
+        public IntPtr arg;\r
+\r
+        /// hb_lock_t*\r
+        public IntPtr @lock;\r
+\r
+        /// int\r
+        public int exited;\r
+\r
+        /// pthread_t->ptw32_handle_t->Anonymous_55c509b5_bbf2_4788_a684_ac1bd0056655\r
+        public ptw32_handle_t thread;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public struct ptw32_handle_t\r
+    {\r
+        /// void*\r
+        public IntPtr p;\r
+\r
+        /// unsigned int\r
+        public uint x;\r
+    }\r
+\r
+    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\r
+    public delegate void LoggingCallback(string message);\r
+\r
+    public partial class HbLib\r
+    {\r
+        [DllImport("hb.dll", EntryPoint = "hb_calc_bitrate", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern int hb_calc_bitrate(ref hb_job_s job, int size);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_register_logger(LoggingCallback callback);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_register_error_handler(LoggingCallback callback);\r
+\r
+        /// Return Type: hb_handle_t*\r
+        ///verbose: int\r
+        ///update_check: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern IntPtr hb_init(int verbose, int update_check);\r
+\r
+\r
+        /// Return Type: hb_handle_t*\r
+        ///verbose: int\r
+        ///update_check: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern IntPtr hb_init_dl(int verbose, int update_check);\r
+\r
+\r
+        /// Return Type: char*\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern IntPtr hb_get_version(ref hb_handle_s param0);\r
+\r
+\r
+        /// Return Type: int\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern int hb_get_build(ref hb_handle_s param0);\r
+\r
+\r
+        /// Return Type: int\r
+        ///h: hb_handle_t*\r
+        ///version: char**\r
+        [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern int hb_check_update(ref hb_handle_s h, ref IntPtr version);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///param1: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_cpu_count", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_cpu_count(ref hb_handle_s param0, int param1);\r
+\r
+\r
+        /// Return Type: char*\r
+        ///path: char*\r
+        [DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern IntPtr hb_dvd_name(IntPtr path);\r
+\r
+\r
+        /// Return Type: void\r
+        ///enable: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_dvd_set_dvdnav(int enable);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///path: char*\r
+        ///title_index: int\r
+        ///preview_count: int\r
+        ///store_previews: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path, int title_index, int preview_count, int store_previews);\r
+\r
+\r
+        /// Return Type: hb_list_t*\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern IntPtr hb_get_titles(IntPtr hbHandle);\r
+\r
+\r
+        /// Return Type: int\r
+        ///buf: hb_buffer_t*\r
+        ///width: int\r
+        ///height: int\r
+        ///color_equal: int\r
+        ///color_diff: int\r
+        ///threshold: int\r
+        ///prog_equal: int\r
+        ///prog_diff: int\r
+        ///prog_threshold: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_detect_comb", CallingConvention = CallingConvention.Cdecl)]\r
+        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);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_preview_by_index", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_get_preview_by_index(IntPtr hbHandle, int title_index, int picture, IntPtr buffer);\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///param1: hb_title_t*\r
+        ///param2: int\r
+        ///param3: uint8_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_get_preview(IntPtr hbHandle, ref hb_title_s title, int preview, IntPtr buffer);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_job_t*\r
+        ///ratio: double\r
+        ///pixels: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_size", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_size(ref hb_job_s param0, double ratio, int pixels);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size_by_index", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_anamorphic_size_by_index(IntPtr hbHandle, int title_index, ref int output_width, ref int output_height, ref int output_par_width, ref int output_par_height);\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_job_t*\r
+        ///output_width: int*\r
+        ///output_height: int*\r
+        ///output_par_width: int*\r
+        ///output_par_height: int*\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_anamorphic_size(ref hb_job_s job, ref int output_width, ref int output_height, ref int output_par_width, ref int output_par_height);\r
+\r
+\r
+        /// Return Type: int\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern int hb_count(IntPtr hbHandle);\r
+\r
+\r
+        /// Return Type: hb_job_t*\r
+        ///param0: hb_handle_t*\r
+        ///param1: int\r
+        [DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_chapter_name", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_chapter_name(IntPtr hbHandle, int title_index, int chapter_index, [In] [MarshalAs(UnmanagedType.LPStr)] string chapter_name);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_set_job", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_set_job(IntPtr hbHandle, int title_index, ref hb_job_s job);\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///param1: hb_job_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_add", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_add(IntPtr hbHandle, ref hb_job_s job);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///param1: hb_job_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_rem(IntPtr hbHandle, IntPtr job);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_start(IntPtr hbHandle);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_pause(IntPtr hbHandle);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_resume(IntPtr hbHandle);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_stop(IntPtr hbHandle);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_filter_object", CallingConvention = CallingConvention.Cdecl)]\r
+        //public static extern IntPtr hb_get_filter_object(int filter_id, [In] [MarshalAs(UnmanagedType.LPStr)] string settings);\r
+        public static extern IntPtr hb_get_filter_object(int filter_id, IntPtr settings);\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///param1: hb_state_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_state", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_get_state(IntPtr hbHandle, ref hb_state_s state);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t*\r
+        ///param1: hb_state_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_state2", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_get_state2(ref hb_handle_s param0, ref hb_state_s param1);\r
+\r
+\r
+        /// Return Type: int\r
+        ///param0: hb_handle_t*\r
+        [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern int hb_get_scancount(ref hb_handle_s param0);\r
+\r
+\r
+        /// Return Type: void\r
+        ///param0: hb_handle_t**\r
+        [DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_close(IntPtr hbHandle);\r
+\r
+        [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]\r
+        public static extern void hb_global_close();\r
+    }\r
+}\r