1 // --------------------------------------------------------------------------------------------------------------------
\r
2 // <copyright file="HbLib.cs" company="HandBrake Project (http://handbrake.fr)">
\r
3 // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
\r
6 // Defines the NativeConstants type.
\r
8 // --------------------------------------------------------------------------------------------------------------------
\r
10 namespace HandBrake.Interop
\r
13 using System.Runtime.InteropServices;
\r
15 internal partial class NativeConstants
\r
17 public const int HB_ACODEC_MASK = 0x00FF00;
\r
18 public const int HB_ACODEC_FAAC = 0x000100;
\r
19 public const int HB_ACODEC_LAME = 0x000200;
\r
20 public const int HB_ACODEC_VORBIS = 0x000400;
\r
21 public const int HB_ACODEC_AC3 = 0x000800;
\r
22 public const int HB_ACODEC_MPGA = 0x001000;
\r
23 public const int HB_ACODEC_LPCM = 0x002000;
\r
24 public const int HB_ACODEC_DCA = 0x004000;
\r
25 public const int HB_ACODEC_FFMPEG = 0x008000;
\r
26 public const int HB_ACODEC_CA_AAC = 0x010000;
\r
28 public const int HB_AMIXDOWN_DCA_FORMAT_MASK = 0x00FFF000;
\r
29 public const int HB_AMIXDOWN_A52_FORMAT_MASK = 0x00000FF0;
\r
30 public const int HB_AMIXDOWN_DISCRETE_CHANNEL_COUNT_MASK = 0x0000000F;
\r
31 public const int HB_AMIXDOWN_MONO = 0x01000001;
\r
32 public const int HB_AMIXDOWN_STEREO = 0x02002022;
\r
33 public const int HB_AMIXDOWN_DOLBY = 0x042070A2;
\r
34 public const int HB_AMIXDOWN_DOLBYPLII = 0x084094A2;
\r
35 public const int HB_AMIXDOWN_6CH = 0x10089176;
\r
37 public const int HB_VCODEC_MASK = 0x0000FF;
\r
38 public const int HB_VCODEC_FFMPEG = 0x000001;
\r
39 public const int HB_VCODEC_X264 = 0x000002;
\r
40 public const int HB_VCODEC_THEORA = 0x000004;
\r
42 public const int HB_MUX_MASK = 0xFF0000;
\r
43 public const int HB_MUX_MP4 = 0x010000;
\r
44 public const int HB_MUX_PSP = 0x020000;
\r
45 public const int HB_MUX_AVI = 0x040000;
\r
46 public const int HB_MUX_OGM = 0x080000;
\r
47 public const int HB_MUX_IPOD = 0x100000;
\r
48 public const int HB_MUX_MKV = 0x200000;
\r
50 public const int HBTF_NO_IDR = 1 << 0;
\r
52 public const int HB_STATE_IDLE = 1;
\r
53 public const int HB_STATE_SCANNING = 2;
\r
54 public const int HB_STATE_SCANDONE = 4;
\r
55 public const int HB_STATE_WORKING = 8;
\r
56 public const int HB_STATE_PAUSED = 16;
\r
57 public const int HB_STATE_WORKDONE = 32;
\r
58 public const int HB_STATE_MUXING = 64;
\r
60 public const int HB_ERROR_NONE = 0;
\r
61 public const int HB_ERROR_CANCELED = 1;
\r
62 public const int HB_ERROR_UNKNOWN = 2;
\r
64 public const int AUDIO_F_DOLBY = 1 << 31;
\r
66 public const int HB_FRAME_IDR = 0x01;
\r
67 public const int HB_FRAME_I = 0x02;
\r
68 public const int HB_FRAME_AUDIO = 0x04;
\r
69 public const int HB_FRAME_P = 0x10;
\r
70 public const int HB_FRAME_B = 0x20;
\r
71 public const int HB_FRAME_BREF = 0x40;
\r
72 public const int HB_FRAME_KEY = 0x0F;
\r
73 public const int HB_FRAME_REF = 0xF0;
\r
75 public const int HB_CONFIG_MAX_SIZE = 8192;
\r
77 public const int HB_FILTER_DETELECINE = 1;
\r
78 public const int HB_FILTER_DEINTERLACE = 2;
\r
79 public const int HB_FILTER_DEBLOCK = 3;
\r
80 public const int HB_FILTER_DENOISE = 4;
\r
81 public const int HB_FILTER_DECOMB = 5;
\r
82 public const int HB_FILTER_ROTATE = 6;
\r
85 [StructLayout(LayoutKind.Sequential)]
\r
86 internal struct hb_anamorphic_substruct
\r
95 public int par_width;
\r
98 public int par_height;
\r
101 public int dar_width;
\r
104 public int dar_height;
\r
107 public int keep_display_aspect;
\r
110 [StructLayout(LayoutKind.Sequential)]
\r
111 internal struct hb_job_s
\r
114 public int sequence_id;
\r
117 public IntPtr title;
\r
119 public int feature;
\r
122 public int chapter_start;
\r
125 public int chapter_end;
\r
128 public int chapter_markers;
\r
131 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] public int[] crop;
\r
134 public int deinterlace;
\r
137 public IntPtr filters;
\r
146 public int keep_ratio;
\r
149 public int grayscale;
\r
151 public hb_anamorphic_substruct anamorphic;
\r
153 public int modulus;
\r
156 public int maxWidth;
\r
159 public int maxHeight;
\r
165 public float vquality;
\r
168 public int vbitrate;
\r
174 public int vrate_base;
\r
186 public int h264_13;
\r
189 public int h264_level;
\r
192 //[MarshalAs(UnmanagedType.LPStr)]
\r
193 //public string x264opts;
\r
194 public IntPtr x264opts;
\r
197 public int areBframes;
\r
200 public int color_matrix;
\r
203 public IntPtr list_audio;
\r
206 public IntPtr list_subtitle;
\r
212 [MarshalAs(UnmanagedType.LPStr)] public string file;
\r
215 public int largeFileSize;
\r
218 public int mp4_optimize;
\r
221 public int ipod_atom;
\r
224 public int indepth_scan;
\r
226 /// hb_subtitle_config_t->hb_subtitle_config_s
\r
227 public hb_subtitle_config_s select_subtitle_config;
\r
232 public int frame_to_start;
\r
234 public long pts_to_start;
\r
237 public int frame_to_stop;
\r
240 public long pts_to_stop;
\r
243 public int start_at_preview;
\r
246 public int seek_points;
\r
248 /// uint32_t->unsigned int
\r
249 public uint frames_to_skip;
\r
251 // Padding for the part of the struct we don't care about marshaling.
\r
252 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24644, ArraySubType = UnmanagedType.U1)] public byte[] padding;
\r
255 [StructLayout(LayoutKind.Sequential)]
\r
256 internal struct hb_list_s
\r
259 public IntPtr items;
\r
262 public int items_alloc;
\r
265 public int items_count;
\r
268 [StructLayout(LayoutKind.Sequential)]
\r
269 internal struct hb_rate_s
\r
272 [MarshalAs(UnmanagedType.LPStr)] public string @string;
\r
278 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
279 internal struct hb_handle_s
\r
287 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string version;
\r
290 public IntPtr update_thread;
\r
296 public IntPtr main_thread;
\r
302 public IntPtr list_title;
\r
305 public IntPtr scan_thread;
\r
308 public IntPtr jobs;
\r
311 public IntPtr current_job;
\r
314 public int job_count;
\r
317 public int job_count_permanent;
\r
320 public int work_die;
\r
323 public int work_error;
\r
326 public IntPtr work_thread;
\r
329 public int cpu_count;
\r
332 public IntPtr state_lock;
\r
334 /// hb_state_t->hb_state_s
\r
335 public hb_state_s state;
\r
341 public IntPtr pause_lock;
\r
344 public int scanCount;
\r
347 public IntPtr interjob;
\r
350 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
351 internal struct hb_chapter_s
\r
363 public int cell_start;
\r
366 public int cell_end;
\r
369 public int block_start;
\r
372 public int block_end;
\r
375 public int block_count;
\r
381 public int minutes;
\r
384 public int seconds;
\r
386 /// uint64_t->unsigned int
\r
387 public ulong duration;
\r
390 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string title;
\r
393 internal enum hb_subtitle_s_subtype
\r
400 internal enum hb_subtitle_s_subsource
\r
415 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
416 internal struct hb_subtitle_s
\r
424 /// hb_subtitle_config_t->hb_subtitle_config_s
\r
425 public hb_subtitle_config_s config;
\r
427 /// hb_subtitle_s_subtype
\r
428 public hb_subtitle_s_subtype format;
\r
430 /// hb_subtitle_s_subsource
\r
431 public hb_subtitle_s_subsource source;
\r
434 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string lang;
\r
437 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string iso639_2;
\r
439 /// uint8_t->unsigned char
\r
442 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)] public uint[] palette;
\r
452 public int forced_hits;
\r
455 public IntPtr fifo_in;
\r
458 public IntPtr fifo_raw;
\r
461 public IntPtr fifo_sync;
\r
464 public IntPtr fifo_out;
\r
467 public IntPtr mux_data;
\r
470 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
471 internal struct hb_metadata_s
\r
474 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string name;
\r
477 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string artist;
\r
480 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string composer;
\r
483 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string release_date;
\r
486 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string comment;
\r
489 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string album;
\r
492 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)] public string genre;
\r
494 /// uint32_t->unsigned int
\r
495 public uint coverart_size;
\r
498 public IntPtr coverart;
\r
501 internal enum Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550
\r
508 internal enum Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db
\r
510 /// HB_MPEG2_PS_DEMUXER -> 0
\r
511 HB_MPEG2_PS_DEMUXER = 0,
\r
513 HB_MPEG2_TS_DEMUXER,
\r
518 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
519 internal struct hb_title_s
\r
521 /// Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550
\r
522 public Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550 type;
\r
525 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string dvd;
\r
528 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string name;
\r
530 //public fixed byte dvd[1024];
\r
532 //public fixed byte name[1024];
\r
544 public int cell_start;
\r
547 public int cell_end;
\r
550 public int block_start;
\r
553 public int block_end;
\r
556 public int block_count;
\r
559 public int angle_count;
\r
565 public int minutes;
\r
568 public int seconds;
\r
570 /// uint64_t->unsigned int
\r
571 public ulong duration;
\r
574 public double aspect;
\r
577 public double container_aspect;
\r
586 public int pixel_aspect_width;
\r
589 public int pixel_aspect_height;
\r
595 public int rate_base;
\r
598 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] public int[] crop;
\r
600 //public fixed int crop[4];
\r
602 /// Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db
\r
603 public Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db demuxer;
\r
606 public int detected_interlacing;
\r
609 public int video_id;
\r
612 public int video_codec;
\r
615 public int video_codec_param;
\r
618 public IntPtr video_codec_name;
\r
621 public int video_bitrate;
\r
624 public IntPtr container_name;
\r
627 public int data_rate;
\r
630 public IntPtr metadata;
\r
633 public IntPtr list_chapter;
\r
636 public IntPtr list_audio;
\r
639 public IntPtr list_subtitle;
\r
644 /// uint32_t->unsigned int
\r
648 [StructLayout(LayoutKind.Sequential)]
\r
649 internal struct hb_state_scanning_s
\r
652 public int title_cur;
\r
655 public int title_count;
\r
658 [StructLayout(LayoutKind.Sequential)]
\r
659 internal struct hb_state_working_s
\r
662 public float progress;
\r
665 public int job_cur;
\r
668 public int job_count;
\r
671 public float rate_cur;
\r
674 public float rate_avg;
\r
680 public int minutes;
\r
683 public int seconds;
\r
686 public int sequence_id;
\r
689 [StructLayout(LayoutKind.Sequential)]
\r
690 internal struct hb_state_workdone_s
\r
696 [StructLayout(LayoutKind.Sequential)]
\r
697 internal struct hb_state_muxing_s
\r
700 public float progress;
\r
703 [StructLayout(LayoutKind.Explicit)]
\r
704 internal struct hb_state_param_u
\r
706 [FieldOffset(0)] public hb_state_scanning_s scanning;
\r
708 [FieldOffset(0)] public hb_state_working_s working;
\r
710 [FieldOffset(0)] public hb_state_workdone_s workdone;
\r
712 [FieldOffset(0)] public hb_state_muxing_s muxing;
\r
715 [StructLayout(LayoutKind.Sequential)]
\r
716 internal struct hb_state_s
\r
721 public hb_state_param_u param;
\r
724 [StructLayout(LayoutKind.Sequential)]
\r
725 internal struct hb_audio_s
\r
730 /// hb_audio_config_t->hb_audio_config_s
\r
731 public hb_audio_config_s config;
\r
733 // Padding for the part of the struct we don't care about marshaling.
\r
734 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24600, ArraySubType = UnmanagedType.U1)] public byte[] padding;
\r
736 /// Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545
\r
737 //public Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545 priv;
\r
740 [StructLayout(LayoutKind.Sequential)]
\r
741 internal struct hb_audio_config_s
\r
743 public hb_audio_config_output_s output;
\r
744 public hb_audio_config_input_s input;
\r
746 /// Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d
\r
747 public Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d flags;
\r
749 public hb_audio_config_lang_s lang;
\r
752 [StructLayout(LayoutKind.Sequential)]
\r
753 internal struct hb_audio_config_output_s
\r
758 /// uint32_t->unsigned int
\r
762 public int samplerate;
\r
765 public int bitrate;
\r
768 public int mixdown;
\r
771 public double dynamic_range_compression;
\r
774 [MarshalAs(UnmanagedType.LPStr)] public string name;
\r
777 [StructLayout(LayoutKind.Sequential)]
\r
778 internal struct hb_audio_config_input_s
\r
783 /// uint32_t->unsigned int
\r
786 /// uint32_t->unsigned int
\r
787 public uint codec_param;
\r
789 /// uint32_t->unsigned int
\r
790 public uint version;
\r
792 /// uint32_t->unsigned int
\r
796 public int samplerate;
\r
799 public int bitrate;
\r
802 public int channel_layout;
\r
805 [StructLayout(LayoutKind.Explicit)]
\r
806 internal struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d
\r
809 [FieldOffset(0)] public int ac3;
\r
812 [FieldOffset(0)] public int dca;
\r
815 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
816 internal struct hb_audio_config_lang_s
\r
819 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string description;
\r
822 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string simple;
\r
825 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string iso639_2;
\r
827 /// uint8_t->unsigned char
\r
831 [StructLayout(LayoutKind.Sequential)]
\r
832 internal struct hb_mixdown_s
\r
835 [MarshalAs(UnmanagedType.LPStr)] public string human_readable_name;
\r
838 [MarshalAs(UnmanagedType.LPStr)] public string internal_name;
\r
841 [MarshalAs(UnmanagedType.LPStr)] public string short_name;
\r
844 public int amixdown;
\r
847 internal enum hb_subtitle_config_s_subdest
\r
854 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
\r
855 internal struct hb_subtitle_config_s
\r
857 /// hb_subtitle_config_s_subdest
\r
858 public hb_subtitle_config_s_subdest dest;
\r
864 public int default_track;
\r
867 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string src_filename;
\r
870 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string src_codeset;
\r
873 public long offset;
\r
876 [StructLayout(LayoutKind.Sequential)]
\r
877 internal struct hb_fifo_s
\r
880 public IntPtr @lock;
\r
882 /// uint32_t->unsigned int
\r
883 public uint capacity;
\r
885 /// uint32_t->unsigned int
\r
888 /// uint32_t->unsigned int
\r
889 public uint buffer_size;
\r
892 public IntPtr first;
\r
895 public IntPtr last;
\r
898 [StructLayout(LayoutKind.Sequential)]
\r
899 internal struct hb_lock_s
\r
903 [StructLayout(LayoutKind.Sequential)]
\r
904 internal struct hb_buffer_s
\r
913 [MarshalAs(UnmanagedType.LPStr)] public string data;
\r
919 public long sequence;
\r
931 public int new_chap;
\r
933 /// uint8_t->unsigned char
\r
934 public byte frametype;
\r
936 /// uint16_t->unsigned int
\r
940 public long renderOffset;
\r
958 public IntPtr next;
\r
961 [StructLayout(LayoutKind.Sequential)]
\r
962 internal struct hb_mux_data_s
\r
964 /// MP4TrackId->uint32_t->unsigned int
\r
967 /// uint8_t->unsigned char
\r
968 public byte subtitle;
\r
971 public int sub_format;
\r
973 /// uint64_t->unsigned int
\r
974 public ulong sum_dur;
\r
977 [StructLayout(LayoutKind.Sequential)]
\r
978 internal struct hb_interjob_s
\r
981 public int last_job;
\r
984 public int frame_count;
\r
986 /// uint64_t->unsigned int
\r
987 public ulong total_time;
\r
990 public int render_dropped;
\r
996 public int vrate_base;
\r
999 public IntPtr select_subtitle;
\r
1002 /// Return Type: void
\r
1004 internal delegate void hb_thread_s_function(IntPtr param0);
\r
1006 [StructLayout(LayoutKind.Sequential)]
\r
1007 internal struct hb_thread_s
\r
1010 [MarshalAs(UnmanagedType.LPStr)] public string name;
\r
1013 public int priority;
\r
1015 /// hb_thread_s_function
\r
1016 public hb_thread_s_function AnonymousMember1;
\r
1019 public IntPtr arg;
\r
1022 public IntPtr @lock;
\r
1025 public int exited;
\r
1027 /// pthread_t->ptw32_handle_t->Anonymous_55c509b5_bbf2_4788_a684_ac1bd0056655
\r
1028 public ptw32_handle_t thread;
\r
1031 [StructLayout(LayoutKind.Sequential)]
\r
1032 internal struct ptw32_handle_t
\r
1041 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
\r
1042 internal delegate void LoggingCallback(string message);
\r
1044 internal partial class HbLib
\r
1046 [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]
\r
1047 public static extern void hb_register_logger(LoggingCallback callback);
\r
1049 [DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]
\r
1050 public static extern void hb_register_error_handler(LoggingCallback callback);
\r
1052 /// Return Type: hb_handle_t*
\r
1054 ///update_check: int
\r
1055 [DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]
\r
1056 public static extern IntPtr hb_init(int verbose, int update_check);
\r
1059 /// Return Type: hb_handle_t*
\r
1061 ///update_check: int
\r
1062 [DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]
\r
1063 public static extern IntPtr hb_init_dl(int verbose, int update_check);
\r
1066 /// Return Type: char*
\r
1067 ///param0: hb_handle_t*
\r
1068 [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]
\r
1069 public static extern IntPtr hb_get_version(ref hb_handle_s param0);
\r
1072 /// Return Type: int
\r
1073 ///param0: hb_handle_t*
\r
1074 [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]
\r
1075 public static extern int hb_get_build(ref hb_handle_s param0);
\r
1078 /// Return Type: int
\r
1079 ///h: hb_handle_t*
\r
1080 ///version: char**
\r
1081 [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]
\r
1082 public static extern int hb_check_update(ref hb_handle_s h, ref IntPtr version);
\r
1085 /// Return Type: void
\r
1086 ///param0: hb_handle_t*
\r
1088 [DllImport("hb.dll", EntryPoint = "hb_set_cpu_count", CallingConvention = CallingConvention.Cdecl)]
\r
1089 public static extern void hb_set_cpu_count(ref hb_handle_s param0, int param1);
\r
1092 /// Return Type: char*
\r
1094 [DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]
\r
1095 public static extern IntPtr hb_dvd_name(IntPtr path);
\r
1098 /// Return Type: void
\r
1100 [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]
\r
1101 public static extern void hb_dvd_set_dvdnav(int enable);
\r
1104 /// Return Type: void
\r
1105 ///param0: hb_handle_t*
\r
1107 ///title_index: int
\r
1108 ///preview_count: int
\r
1109 ///store_previews: int
\r
1110 [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]
\r
1111 public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path,
\r
1112 int title_index, int preview_count, int store_previews);
\r
1115 /// Return Type: hb_list_t*
\r
1116 ///param0: hb_handle_t*
\r
1117 [DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]
\r
1118 public static extern IntPtr hb_get_titles(IntPtr hbHandle);
\r
1121 /// Return Type: int
\r
1122 ///buf: hb_buffer_t*
\r
1125 ///color_equal: int
\r
1126 ///color_diff: int
\r
1128 ///prog_equal: int
\r
1130 ///prog_threshold: int
\r
1131 [DllImport("hb.dll", EntryPoint = "hb_detect_comb", CallingConvention = CallingConvention.Cdecl)]
\r
1132 public static extern int hb_detect_comb(ref hb_buffer_s buf, int width, int height, int color_equal,
\r
1133 int color_diff, int threshold, int prog_equal, int prog_diff,
\r
1134 int prog_threshold);
\r
1136 [DllImport("hb.dll", EntryPoint = "hb_get_preview_by_index", CallingConvention = CallingConvention.Cdecl)]
\r
1137 public static extern void hb_get_preview_by_index(IntPtr hbHandle, int title_index, int picture, IntPtr buffer);
\r
1139 /// Return Type: void
\r
1140 ///param0: hb_handle_t*
\r
1141 ///param1: hb_title_t*
\r
1143 ///param3: uint8_t*
\r
1144 [DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]
\r
1145 public static extern void hb_get_preview(IntPtr hbHandle, ref hb_title_s title, int preview, IntPtr buffer);
\r
1148 /// Return Type: void
\r
1149 ///param0: hb_job_t*
\r
1152 [DllImport("hb.dll", EntryPoint = "hb_set_size", CallingConvention = CallingConvention.Cdecl)]
\r
1153 public static extern void hb_set_size(ref hb_job_s param0, double ratio, int pixels);
\r
1155 [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size_by_index", CallingConvention = CallingConvention.Cdecl
\r
1157 public static extern void hb_set_anamorphic_size_by_index(IntPtr hbHandle, int title_index, ref int output_width,
\r
1158 ref int output_height, ref int output_par_width,
\r
1159 ref int output_par_height);
\r
1161 /// Return Type: void
\r
1162 ///param0: hb_job_t*
\r
1163 ///output_width: int*
\r
1164 ///output_height: int*
\r
1165 ///output_par_width: int*
\r
1166 ///output_par_height: int*
\r
1167 [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size", CallingConvention = CallingConvention.Cdecl)]
\r
1168 public static extern void hb_set_anamorphic_size(ref hb_job_s job, ref int output_width, ref int output_height,
\r
1169 ref int output_par_width, ref int output_par_height);
\r
1172 /// Return Type: int
\r
1173 ///param0: hb_handle_t*
\r
1174 [DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]
\r
1175 public static extern int hb_count(IntPtr hbHandle);
\r
1178 /// Return Type: hb_job_t*
\r
1179 ///param0: hb_handle_t*
\r
1181 [DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]
\r
1182 public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);
\r
1184 [DllImport("hb.dll", EntryPoint = "hb_set_chapter_name", CallingConvention = CallingConvention.Cdecl)]
\r
1185 public static extern void hb_set_chapter_name(IntPtr hbHandle, int title_index, int chapter_index,
\r
1186 [In] [MarshalAs(UnmanagedType.LPStr)] string chapter_name);
\r
1188 [DllImport("hb.dll", EntryPoint = "hb_set_job", CallingConvention = CallingConvention.Cdecl)]
\r
1189 public static extern void hb_set_job(IntPtr hbHandle, int title_index, ref hb_job_s job);
\r
1191 /// Return Type: void
\r
1192 ///param0: hb_handle_t*
\r
1193 ///param1: hb_job_t*
\r
1194 [DllImport("hb.dll", EntryPoint = "hb_add", CallingConvention = CallingConvention.Cdecl)]
\r
1195 public static extern void hb_add(IntPtr hbHandle, ref hb_job_s job);
\r
1198 /// Return Type: void
\r
1199 ///param0: hb_handle_t*
\r
1200 ///param1: hb_job_t*
\r
1201 [DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]
\r
1202 public static extern void hb_rem(IntPtr hbHandle, IntPtr job);
\r
1205 /// Return Type: void
\r
1206 ///param0: hb_handle_t*
\r
1207 [DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]
\r
1208 public static extern void hb_start(IntPtr hbHandle);
\r
1211 /// Return Type: void
\r
1212 ///param0: hb_handle_t*
\r
1213 [DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]
\r
1214 public static extern void hb_pause(IntPtr hbHandle);
\r
1217 /// Return Type: void
\r
1218 ///param0: hb_handle_t*
\r
1219 [DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]
\r
1220 public static extern void hb_resume(IntPtr hbHandle);
\r
1223 /// Return Type: void
\r
1224 ///param0: hb_handle_t*
\r
1225 [DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]
\r
1226 public static extern void hb_stop(IntPtr hbHandle);
\r
1228 [DllImport("hb.dll", EntryPoint = "hb_get_filter_object", CallingConvention = CallingConvention.Cdecl)]
\r
1229 //public static extern IntPtr hb_get_filter_object(int filter_id, [In] [MarshalAs(UnmanagedType.LPStr)] string settings);
\r
1230 public static extern IntPtr hb_get_filter_object(int filter_id, IntPtr settings);
\r
1232 /// Return Type: void
\r
1233 ///param0: hb_handle_t*
\r
1234 ///param1: hb_state_t*
\r
1235 [DllImport("hb.dll", EntryPoint = "hb_get_state", CallingConvention = CallingConvention.Cdecl)]
\r
1236 public static extern void hb_get_state(IntPtr hbHandle, ref hb_state_s state);
\r
1239 /// Return Type: void
\r
1240 ///param0: hb_handle_t*
\r
1241 ///param1: hb_state_t*
\r
1242 [DllImport("hb.dll", EntryPoint = "hb_get_state2", CallingConvention = CallingConvention.Cdecl)]
\r
1243 public static extern void hb_get_state2(ref hb_handle_s param0, ref hb_state_s param1);
\r
1246 /// Return Type: int
\r
1247 ///param0: hb_handle_t*
\r
1248 [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]
\r
1249 public static extern int hb_get_scancount(ref hb_handle_s param0);
\r
1252 /// Return Type: void
\r
1253 ///param0: hb_handle_t**
\r
1254 [DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]
\r
1255 public static extern void hb_close(IntPtr hbHandle);
\r
1257 [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]
\r
1258 public static extern void hb_global_close();
\r