OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / interop / HbLib.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Linq;\r
4 using System.Text;\r
5 using System.Runtime.InteropServices;\r
6 \r
7 namespace HandBrake.Interop\r
8 {\r
9 \r
10     public partial class NativeConstants\r
11     {\r
12         public const int HB_ACODEC_MASK =   0x00FF00;\r
13         public const int HB_ACODEC_FAAC =   0x000100;\r
14         public const int HB_ACODEC_LAME =   0x000200;\r
15         public const int HB_ACODEC_VORBIS = 0x000400;\r
16         public const int HB_ACODEC_AC3 =    0x000800;\r
17         public const int HB_ACODEC_MPGA =   0x001000;\r
18         public const int HB_ACODEC_LPCM =   0x002000;\r
19         public const int HB_ACODEC_DCA =    0x004000;\r
20         public const int HB_ACODEC_FFMPEG = 0x008000;\r
21         public const int HB_ACODEC_CA_AAC = 0x010000;\r
22 \r
23         public const int HB_AMIXDOWN_DCA_FORMAT_MASK =              0x00FFF000;\r
24         public const int HB_AMIXDOWN_A52_FORMAT_MASK =              0x00000FF0;\r
25         public const int HB_AMIXDOWN_DISCRETE_CHANNEL_COUNT_MASK =  0x0000000F;\r
26         public const int HB_AMIXDOWN_MONO =                         0x01000001;\r
27         public const int HB_AMIXDOWN_STEREO =                       0x02002022;\r
28         public const int HB_AMIXDOWN_DOLBY =                        0x042070A2;\r
29         public const int HB_AMIXDOWN_DOLBYPLII =                    0x084094A2;\r
30         public const int HB_AMIXDOWN_6CH =                          0x10089176;\r
31 \r
32         public const int HB_VCODEC_MASK =   0x0000FF;\r
33         public const int HB_VCODEC_FFMPEG = 0x000001;\r
34         public const int HB_VCODEC_X264 =   0x000002;\r
35         public const int HB_VCODEC_THEORA = 0x000004;\r
36 \r
37         public const int HB_MUX_MASK =  0xFF0000;\r
38         public const int HB_MUX_MP4 =   0x010000;\r
39         public const int HB_MUX_PSP =   0x020000;\r
40         public const int HB_MUX_AVI =   0x040000;\r
41         public const int HB_MUX_OGM =   0x080000;\r
42         public const int HB_MUX_IPOD =  0x100000;\r
43         public const int HB_MUX_MKV =   0x200000;\r
44 \r
45         public const int HBTF_NO_IDR = 1 << 0;\r
46 \r
47         public const int HB_STATE_IDLE = 1;\r
48         public const int HB_STATE_SCANNING = 2;\r
49         public const int HB_STATE_SCANDONE = 4;\r
50         public const int HB_STATE_WORKING = 8;\r
51         public const int HB_STATE_PAUSED = 16;\r
52         public const int HB_STATE_WORKDONE = 32;\r
53         public const int HB_STATE_MUXING = 64;\r
54 \r
55         public const int HB_ERROR_NONE = 0;\r
56         public const int HB_ERROR_CANCELED = 1;\r
57         public const int HB_ERROR_UNKNOWN = 2;\r
58 \r
59         public const int AUDIO_F_DOLBY = 1 << 31;\r
60 \r
61         public const int HB_FRAME_IDR =     0x01;\r
62         public const int HB_FRAME_I =       0x02;\r
63         public const int HB_FRAME_AUDIO =   0x04;\r
64         public const int HB_FRAME_P =       0x10;\r
65         public const int HB_FRAME_B =       0x20;\r
66         public const int HB_FRAME_BREF =    0x40;\r
67         public const int HB_FRAME_KEY =     0x0F;\r
68         public const int HB_FRAME_REF =     0xF0;\r
69 \r
70         public const int HB_CONFIG_MAX_SIZE = 8192;\r
71 \r
72         public const int HB_FILTER_DETELECINE = 1;\r
73         public const int HB_FILTER_DEINTERLACE = 2;\r
74         public const int HB_FILTER_DEBLOCK = 3;\r
75         public const int HB_FILTER_DENOISE = 4;\r
76         public const int HB_FILTER_DECOMB = 5;\r
77         public const int HB_FILTER_ROTATE = 6;\r
78     }\r
79 \r
80     [StructLayout(LayoutKind.Sequential)]\r
81     public struct hb_anamorphic_substruct\r
82     {\r
83         /// int\r
84         public int mode;\r
85 \r
86         /// int\r
87         public int itu_par;\r
88 \r
89         /// int\r
90         public int par_width;\r
91 \r
92         /// int\r
93         public int par_height;\r
94 \r
95         /// int\r
96         public int dar_width;\r
97 \r
98         /// int\r
99         public int dar_height;\r
100 \r
101         /// int\r
102         public int keep_display_aspect;\r
103     }\r
104 \r
105     [StructLayout(LayoutKind.Sequential)]\r
106     public struct hb_job_s\r
107     {\r
108         /// int\r
109         public int sequence_id;\r
110 \r
111         /// hb_title_t*\r
112         public IntPtr title;\r
113 \r
114         public int feature;\r
115 \r
116         /// int\r
117         public int chapter_start;\r
118 \r
119         /// int\r
120         public int chapter_end;\r
121 \r
122         /// int\r
123         public int chapter_markers;\r
124 \r
125         /// int[4]\r
126         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
127         public int[] crop;\r
128 \r
129         /// int\r
130         public int deinterlace;\r
131 \r
132         /// hb_list_t*\r
133         public IntPtr filters;\r
134 \r
135         /// int\r
136         public int width;\r
137 \r
138         /// int\r
139         public int height;\r
140 \r
141         /// int\r
142         public int keep_ratio;\r
143 \r
144         /// int\r
145         public int grayscale;\r
146 \r
147         public hb_anamorphic_substruct anamorphic;\r
148 \r
149         public int modulus;\r
150 \r
151         /// int\r
152         public int maxWidth;\r
153 \r
154         /// int\r
155         public int maxHeight;\r
156 \r
157         /// int\r
158         public int vcodec;\r
159 \r
160         /// float\r
161         public float vquality;\r
162 \r
163         /// int\r
164         public int vbitrate;\r
165 \r
166         /// int\r
167         public int vrate;\r
168 \r
169         /// int\r
170         public int vrate_base;\r
171 \r
172         /// int\r
173         public int vfr;\r
174 \r
175         /// int\r
176         public int cfr;\r
177 \r
178         /// int\r
179         public int pass;\r
180 \r
181         /// int\r
182         public int h264_13;\r
183 \r
184         /// int\r
185         public int h264_level;\r
186 \r
187         /// char*\r
188         //[MarshalAs(UnmanagedType.LPStr)]\r
189         //public string x264opts;\r
190 \r
191         public IntPtr x264opts;\r
192 \r
193         /// int\r
194         public int areBframes;\r
195 \r
196         /// int\r
197         public int color_matrix;\r
198 \r
199         /// hb_list_t*\r
200         public IntPtr list_audio;\r
201 \r
202         /// hb_list_t*\r
203         public IntPtr list_subtitle;\r
204 \r
205         /// int\r
206         public int mux;\r
207 \r
208         /// char*\r
209         [MarshalAs(UnmanagedType.LPStr)]\r
210         public string file;\r
211 \r
212         /// int\r
213         public int largeFileSize;\r
214 \r
215         /// int\r
216         public int mp4_optimize;\r
217 \r
218         /// int\r
219         public int ipod_atom;\r
220 \r
221         /// int\r
222         public int indepth_scan;\r
223 \r
224         /// hb_subtitle_config_t->hb_subtitle_config_s\r
225         public hb_subtitle_config_s select_subtitle_config;\r
226 \r
227         /// int\r
228         public int angle;\r
229 \r
230         public int frame_to_start;\r
231 \r
232         public long pts_to_start;\r
233 \r
234         /// int\r
235         public int frame_to_stop;\r
236 \r
237         /// int64_t->int\r
238         public long pts_to_stop;\r
239 \r
240         /// int\r
241         public int start_at_preview;\r
242 \r
243         /// int\r
244         public int seek_points;\r
245 \r
246         /// uint32_t->unsigned int\r
247         public uint frames_to_skip;\r
248 \r
249         // Padding for the part of the struct we don't care about marshaling.\r
250         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24644, ArraySubType = UnmanagedType.U1)]\r
251         public byte[] padding;\r
252     }\r
253 \r
254     [StructLayout(LayoutKind.Sequential)]\r
255     public struct hb_list_s\r
256     {\r
257         /// void**\r
258         public IntPtr items;\r
259 \r
260         /// int\r
261         public int items_alloc;\r
262 \r
263         /// int\r
264         public int items_count;\r
265     }\r
266 \r
267     [StructLayout(LayoutKind.Sequential)]\r
268     public struct hb_rate_s\r
269     {\r
270         /// char*\r
271         [MarshalAs(UnmanagedType.LPStr)]\r
272         public string @string;\r
273 \r
274         /// int\r
275         public int rate;\r
276     }\r
277 \r
278     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
279     public struct hb_handle_s\r
280     {\r
281         public int id;\r
282 \r
283         /// int\r
284         public int build;\r
285 \r
286         /// char[32]\r
287         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]\r
288         public string version;\r
289 \r
290         /// hb_thread_t*\r
291         public IntPtr update_thread;\r
292 \r
293         /// int\r
294         public int die;\r
295 \r
296         /// hb_thread_t*\r
297         public IntPtr main_thread;\r
298 \r
299         /// int\r
300         public int pid;\r
301 \r
302         /// hb_list_t*\r
303         public IntPtr list_title;\r
304 \r
305         /// hb_thread_t*\r
306         public IntPtr scan_thread;\r
307 \r
308         /// hb_list_t*\r
309         public IntPtr jobs;\r
310 \r
311         /// hb_job_t*\r
312         public IntPtr current_job;\r
313 \r
314         /// int\r
315         public int job_count;\r
316 \r
317         /// int\r
318         public int job_count_permanent;\r
319 \r
320         /// int\r
321         public int work_die;\r
322 \r
323         /// int\r
324         public int work_error;\r
325 \r
326         /// hb_thread_t*\r
327         public IntPtr work_thread;\r
328 \r
329         /// int\r
330         public int cpu_count;\r
331 \r
332         /// hb_lock_t*\r
333         public IntPtr state_lock;\r
334 \r
335         /// hb_state_t->hb_state_s\r
336         public hb_state_s state;\r
337 \r
338         /// int\r
339         public int paused;\r
340 \r
341         /// hb_lock_t*\r
342         public IntPtr pause_lock;\r
343 \r
344         /// int\r
345         public int scanCount;\r
346 \r
347         /// hb_interjob_t*\r
348         public IntPtr interjob;\r
349     }\r
350 \r
351     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
352     public struct hb_chapter_s\r
353     {\r
354         /// int\r
355         public int index;\r
356 \r
357         /// int\r
358         public int pgcn;\r
359 \r
360         /// int\r
361         public int pgn;\r
362 \r
363         /// int\r
364         public int cell_start;\r
365 \r
366         /// int\r
367         public int cell_end;\r
368 \r
369         /// int\r
370         public int block_start;\r
371 \r
372         /// int\r
373         public int block_end;\r
374 \r
375         /// int\r
376         public int block_count;\r
377 \r
378         /// int\r
379         public int hours;\r
380 \r
381         /// int\r
382         public int minutes;\r
383 \r
384         /// int\r
385         public int seconds;\r
386 \r
387         /// uint64_t->unsigned int\r
388         public ulong duration;\r
389 \r
390         /// char[1024]\r
391         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
392         public string title;\r
393     }\r
394 \r
395     public enum hb_subtitle_s_subtype\r
396     {\r
397         PICTURESUB,\r
398 \r
399         TEXTSUB,\r
400     }\r
401 \r
402     public enum hb_subtitle_s_subsource\r
403     {\r
404         VOBSUB,\r
405 \r
406         SRTSUB,\r
407 \r
408         CC608SUB,\r
409 \r
410         CC708SUB,\r
411 \r
412         UTF8SUB,\r
413 \r
414         TX3GSUB,\r
415 \r
416         SSASUB\r
417     }\r
418 \r
419     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
420     public struct hb_subtitle_s\r
421     {\r
422         /// int\r
423         public int id;\r
424 \r
425         /// int\r
426         public int track;\r
427 \r
428         /// hb_subtitle_config_t->hb_subtitle_config_s\r
429         public hb_subtitle_config_s config;\r
430 \r
431         /// hb_subtitle_s_subtype\r
432         public hb_subtitle_s_subtype format;\r
433 \r
434         /// hb_subtitle_s_subsource\r
435         public hb_subtitle_s_subsource source;\r
436 \r
437         /// char[1024]\r
438         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
439         public string lang;\r
440 \r
441         /// char[4]\r
442         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
443         public string iso639_2;\r
444 \r
445         /// uint8_t->unsigned char\r
446         public byte type;\r
447 \r
448         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)]\r
449         public uint[] palette;\r
450 \r
451         public int width;\r
452 \r
453         public int height;\r
454 \r
455         /// int\r
456         public int hits;\r
457 \r
458         /// int\r
459         public int forced_hits;\r
460 \r
461         /// hb_fifo_t*\r
462         public IntPtr fifo_in;\r
463 \r
464         /// hb_fifo_t*\r
465         public IntPtr fifo_raw;\r
466 \r
467         /// hb_fifo_t*\r
468         public IntPtr fifo_sync;\r
469 \r
470         /// hb_fifo_t*\r
471         public IntPtr fifo_out;\r
472 \r
473         /// hb_mux_data_t*\r
474         public IntPtr mux_data;\r
475     }\r
476 \r
477     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
478     public struct hb_metadata_s\r
479     {\r
480         /// char[255]\r
481         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
482         public string name;\r
483 \r
484         /// char[255]\r
485         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
486         public string artist;\r
487 \r
488         /// char[255]\r
489         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
490         public string composer;\r
491 \r
492         /// char[255]\r
493         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
494         public string release_date;\r
495 \r
496         /// char[1024]\r
497         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
498         public string comment;\r
499 \r
500         /// char[255]\r
501         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
502         public string album;\r
503 \r
504         /// char[255]\r
505         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
506         public string genre;\r
507 \r
508         /// uint32_t->unsigned int\r
509         public uint coverart_size;\r
510 \r
511         /// uint8_t*\r
512         public IntPtr coverart;\r
513     }\r
514 \r
515     public enum Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
516     {\r
517         HB_DVD_TYPE,\r
518 \r
519         HB_STREAM_TYPE,\r
520     }\r
521 \r
522     public enum Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
523     {\r
524         /// HB_MPEG2_PS_DEMUXER -> 0\r
525         HB_MPEG2_PS_DEMUXER = 0,\r
526 \r
527         HB_MPEG2_TS_DEMUXER,\r
528 \r
529         HB_NULL_DEMUXER,\r
530     }\r
531 \r
532     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
533     public struct hb_title_s\r
534     {\r
535         /// Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
536         public Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550 type;\r
537 \r
538         /// char[1024]\r
539         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
540         public string dvd;\r
541 \r
542         /// char[1024]\r
543         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
544         public string name;\r
545 \r
546         //public fixed byte dvd[1024];\r
547 \r
548         //public fixed byte name[1024];\r
549 \r
550         /// int\r
551         public int index;\r
552 \r
553         /// int\r
554         public int vts;\r
555 \r
556         /// int\r
557         public int ttn;\r
558 \r
559         /// int\r
560         public int cell_start;\r
561 \r
562         /// int\r
563         public int cell_end;\r
564 \r
565         /// int\r
566         public int block_start;\r
567 \r
568         /// int\r
569         public int block_end;\r
570 \r
571         /// int\r
572         public int block_count;\r
573 \r
574         /// int\r
575         public int angle_count;\r
576 \r
577         /// int\r
578         public int hours;\r
579 \r
580         /// int\r
581         public int minutes;\r
582 \r
583         /// int\r
584         public int seconds;\r
585 \r
586         /// uint64_t->unsigned int\r
587         public ulong duration;\r
588 \r
589         /// double\r
590         public double aspect;\r
591 \r
592         /// double\r
593         public double container_aspect;\r
594 \r
595         /// int\r
596         public int width;\r
597 \r
598         /// int\r
599         public int height;\r
600 \r
601         /// int\r
602         public int pixel_aspect_width;\r
603 \r
604         /// int\r
605         public int pixel_aspect_height;\r
606 \r
607         /// int\r
608         public int rate;\r
609 \r
610         /// int\r
611         public int rate_base;\r
612 \r
613         /// int[4]\r
614         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
615         public int[] crop;\r
616 \r
617         //public fixed int crop[4];\r
618 \r
619         /// Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
620         public Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db demuxer;\r
621 \r
622         /// int\r
623         public int detected_interlacing;\r
624 \r
625         /// int\r
626         public int video_id;\r
627 \r
628         /// int\r
629         public int video_codec;\r
630 \r
631         /// int\r
632         public int video_codec_param;\r
633 \r
634         /// char*\r
635         public IntPtr video_codec_name;\r
636 \r
637         /// int\r
638         public int video_bitrate;\r
639 \r
640         /// char*\r
641         public IntPtr container_name;\r
642 \r
643         /// int\r
644         public int data_rate;\r
645 \r
646         /// hb_metadata_t*\r
647         public IntPtr metadata;\r
648 \r
649         /// hb_list_t*\r
650         public IntPtr list_chapter;\r
651 \r
652         /// hb_list_t*\r
653         public IntPtr list_audio;\r
654 \r
655         /// hb_list_t*\r
656         public IntPtr list_subtitle;\r
657 \r
658         /// hb_job_t*\r
659         public IntPtr job;\r
660 \r
661         /// uint32_t->unsigned int\r
662         public uint flags;\r
663     }\r
664 \r
665     [StructLayout(LayoutKind.Sequential)]\r
666     public struct hb_state_scanning_s\r
667     {\r
668         /// int\r
669         public int title_cur;\r
670 \r
671         /// int\r
672         public int title_count;\r
673     }\r
674 \r
675     [StructLayout(LayoutKind.Sequential)]\r
676     public struct hb_state_working_s\r
677     {\r
678         /// float\r
679         public float progress;\r
680 \r
681         /// int\r
682         public int job_cur;\r
683 \r
684         /// int\r
685         public int job_count;\r
686 \r
687         /// float\r
688         public float rate_cur;\r
689 \r
690         /// float\r
691         public float rate_avg;\r
692 \r
693         /// int\r
694         public int hours;\r
695 \r
696         /// int\r
697         public int minutes;\r
698 \r
699         /// int\r
700         public int seconds;\r
701 \r
702         /// int\r
703         public int sequence_id;\r
704     }\r
705 \r
706     [StructLayout(LayoutKind.Sequential)]\r
707     public struct hb_state_workdone_s\r
708     {\r
709         /// int\r
710         public int error;\r
711     }\r
712 \r
713     [StructLayout(LayoutKind.Sequential)]\r
714     public struct hb_state_muxing_s\r
715     {\r
716         /// float\r
717         public float progress;\r
718     }\r
719 \r
720     [StructLayout(LayoutKind.Explicit)]\r
721     public struct hb_state_param_u\r
722     {\r
723         [FieldOffset(0)]\r
724         public hb_state_scanning_s scanning;\r
725 \r
726         [FieldOffset(0)]\r
727         public hb_state_working_s working;\r
728 \r
729         [FieldOffset(0)]\r
730         public hb_state_workdone_s workdone;\r
731 \r
732         [FieldOffset(0)]\r
733         public hb_state_muxing_s muxing;\r
734     }\r
735 \r
736     [StructLayout(LayoutKind.Sequential)]\r
737     public struct hb_state_s\r
738     {\r
739 \r
740         /// int\r
741         public int state;\r
742         public hb_state_param_u param;\r
743     }\r
744 \r
745     [StructLayout(LayoutKind.Sequential)]\r
746     public struct hb_audio_s\r
747     {\r
748         /// int\r
749         public int id;\r
750 \r
751         /// hb_audio_config_t->hb_audio_config_s\r
752         public hb_audio_config_s config;\r
753 \r
754         // Padding for the part of the struct we don't care about marshaling.\r
755         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24600, ArraySubType = UnmanagedType.U1)]\r
756         public byte[] padding;\r
757 \r
758         /// Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545\r
759         //public Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545 priv;\r
760     }\r
761 \r
762     [StructLayout(LayoutKind.Sequential)]\r
763     public struct hb_audio_config_s\r
764     {\r
765         public hb_audio_config_output_s output;\r
766         public hb_audio_config_input_s input;\r
767 \r
768         /// Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
769         public Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d flags;\r
770 \r
771         public hb_audio_config_lang_s lang;\r
772     }\r
773 \r
774     [StructLayout(LayoutKind.Sequential)]\r
775     public struct hb_audio_config_output_s\r
776     {\r
777         /// int\r
778         public int track;\r
779 \r
780         /// uint32_t->unsigned int\r
781         public uint codec;\r
782 \r
783         /// int\r
784         public int samplerate;\r
785 \r
786         /// int\r
787         public int bitrate;\r
788 \r
789         /// int\r
790         public int mixdown;\r
791 \r
792         /// double\r
793         public double dynamic_range_compression;\r
794 \r
795         /// char*\r
796         [MarshalAs(UnmanagedType.LPStr)]\r
797         public string name;\r
798     }\r
799 \r
800     [StructLayout(LayoutKind.Sequential)]\r
801     public struct hb_audio_config_input_s\r
802     {\r
803         /// int\r
804         public int track;\r
805 \r
806         /// uint32_t->unsigned int\r
807         public uint codec;\r
808 \r
809         /// uint32_t->unsigned int\r
810         public uint codec_param;\r
811 \r
812         /// uint32_t->unsigned int\r
813         public uint version;\r
814 \r
815         /// uint32_t->unsigned int\r
816         public uint mode;\r
817 \r
818         /// int\r
819         public int samplerate;\r
820 \r
821         /// int\r
822         public int bitrate;\r
823 \r
824         /// int\r
825         public int channel_layout;\r
826     }\r
827 \r
828     [StructLayout(LayoutKind.Explicit)]\r
829     public struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
830     {\r
831         /// int\r
832         [FieldOffset(0)]\r
833         public int ac3;\r
834 \r
835         /// int\r
836         [FieldOffset(0)]\r
837         public int dca;\r
838     }\r
839 \r
840     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
841     public struct hb_audio_config_lang_s\r
842     {\r
843         /// char[1024]\r
844         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
845         public string description;\r
846 \r
847         /// char[1024]\r
848         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
849         public string simple;\r
850 \r
851         /// char[4]\r
852         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
853         public string iso639_2;\r
854 \r
855         /// uint8_t->unsigned char\r
856         public byte type;\r
857     }\r
858 \r
859     [StructLayout(LayoutKind.Sequential)]\r
860     public struct hb_mixdown_s\r
861     {\r
862         /// char*\r
863         [MarshalAs(UnmanagedType.LPStr)]\r
864         public string human_readable_name;\r
865 \r
866         /// char*\r
867         [MarshalAs(UnmanagedType.LPStr)]\r
868         public string internal_name;\r
869 \r
870         /// char*\r
871         [MarshalAs(UnmanagedType.LPStr)]\r
872         public string short_name;\r
873 \r
874         /// int\r
875         public int amixdown;\r
876     }\r
877 \r
878     public enum hb_subtitle_config_s_subdest\r
879     {\r
880         RENDERSUB,\r
881 \r
882         PASSTHRUSUB,\r
883     }\r
884 \r
885     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
886     public struct hb_subtitle_config_s\r
887     {\r
888         /// hb_subtitle_config_s_subdest\r
889         public hb_subtitle_config_s_subdest dest;\r
890 \r
891         /// int\r
892         public int force;\r
893 \r
894         /// int\r
895         public int default_track;\r
896 \r
897         /// char[128]\r
898         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]\r
899         public string src_filename;\r
900 \r
901         /// char[40]\r
902         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]\r
903         public string src_codeset;\r
904 \r
905         /// int64_t->int\r
906         public long offset;\r
907     }\r
908 \r
909     [StructLayout(LayoutKind.Sequential)]\r
910     public struct hb_fifo_s\r
911     {\r
912         /// hb_lock_t*\r
913         public IntPtr @lock;\r
914 \r
915         /// uint32_t->unsigned int\r
916         public uint capacity;\r
917 \r
918         /// uint32_t->unsigned int\r
919         public uint size;\r
920 \r
921         /// uint32_t->unsigned int\r
922         public uint buffer_size;\r
923 \r
924         /// hb_buffer_t*\r
925         public IntPtr first;\r
926 \r
927         /// hb_buffer_t*\r
928         public IntPtr last;\r
929     }\r
930 \r
931     [StructLayout(LayoutKind.Sequential)]\r
932     public struct hb_lock_s\r
933     {\r
934     }\r
935 \r
936     [StructLayout(LayoutKind.Sequential)]\r
937     public struct hb_buffer_s\r
938     {\r
939         /// int\r
940         public int size;\r
941 \r
942         /// int\r
943         public int alloc;\r
944 \r
945         /// uint8_t*\r
946         [MarshalAs(UnmanagedType.LPStr)]\r
947         public string data;\r
948 \r
949         /// int\r
950         public int cur;\r
951 \r
952         /// int64_t->int\r
953         public long sequence;\r
954 \r
955         /// int\r
956         public int id;\r
957 \r
958         /// int64_t->int\r
959         public long start;\r
960 \r
961         /// int64_t->int\r
962         public long stop;\r
963 \r
964         /// int\r
965         public int new_chap;\r
966 \r
967         /// uint8_t->unsigned char\r
968         public byte frametype;\r
969 \r
970         /// uint16_t->unsigned int\r
971         public uint flags;\r
972 \r
973         /// int64_t->int\r
974         public long renderOffset;\r
975 \r
976         /// int\r
977         public int x;\r
978 \r
979         /// int\r
980         public int y;\r
981 \r
982         /// int\r
983         public int width;\r
984 \r
985         /// int\r
986         public int height;\r
987 \r
988         /// hb_buffer_t*\r
989         public IntPtr sub;\r
990 \r
991         /// hb_buffer_t*\r
992         public IntPtr next;\r
993     }\r
994 \r
995     [StructLayout(LayoutKind.Sequential)]\r
996     public struct hb_mux_data_s\r
997     {\r
998         /// MP4TrackId->uint32_t->unsigned int\r
999         public uint track;\r
1000 \r
1001         /// uint8_t->unsigned char\r
1002         public byte subtitle;\r
1003 \r
1004         /// int\r
1005         public int sub_format;\r
1006 \r
1007         /// uint64_t->unsigned int\r
1008         public ulong sum_dur;\r
1009     }\r
1010 \r
1011     [StructLayout(LayoutKind.Sequential)]\r
1012     public struct hb_interjob_s\r
1013     {\r
1014         /// int\r
1015         public int last_job;\r
1016 \r
1017         /// int\r
1018         public int frame_count;\r
1019 \r
1020         /// uint64_t->unsigned int\r
1021         public ulong total_time;\r
1022 \r
1023         /// int\r
1024         public int render_dropped;\r
1025 \r
1026         /// int\r
1027         public int vrate;\r
1028 \r
1029         /// int\r
1030         public int vrate_base;\r
1031 \r
1032         /// hb_subtitle_t*\r
1033         public IntPtr select_subtitle;\r
1034     }\r
1035 \r
1036     /// Return Type: void\r
1037     ///param0: void*\r
1038     public delegate void hb_thread_s_function(IntPtr param0);\r
1039 \r
1040     [StructLayout(LayoutKind.Sequential)]\r
1041     public struct hb_thread_s\r
1042     {\r
1043         /// char*\r
1044         [MarshalAs(UnmanagedType.LPStr)]\r
1045         public string name;\r
1046 \r
1047         /// int\r
1048         public int priority;\r
1049 \r
1050         /// hb_thread_s_function\r
1051         public hb_thread_s_function AnonymousMember1;\r
1052 \r
1053         /// void*\r
1054         public IntPtr arg;\r
1055 \r
1056         /// hb_lock_t*\r
1057         public IntPtr @lock;\r
1058 \r
1059         /// int\r
1060         public int exited;\r
1061 \r
1062         /// pthread_t->ptw32_handle_t->Anonymous_55c509b5_bbf2_4788_a684_ac1bd0056655\r
1063         public ptw32_handle_t thread;\r
1064     }\r
1065 \r
1066     [StructLayout(LayoutKind.Sequential)]\r
1067     public struct ptw32_handle_t\r
1068     {\r
1069         /// void*\r
1070         public IntPtr p;\r
1071 \r
1072         /// unsigned int\r
1073         public uint x;\r
1074     }\r
1075 \r
1076     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\r
1077     public delegate void LoggingCallback(string message);\r
1078 \r
1079     public partial class HbLib\r
1080     {\r
1081         [DllImport("hb.dll", EntryPoint = "hb_calc_bitrate", CallingConvention = CallingConvention.Cdecl)]\r
1082         public static extern int hb_calc_bitrate(ref hb_job_s job, int size);\r
1083 \r
1084         [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]\r
1085         public static extern void hb_register_logger(LoggingCallback callback);\r
1086 \r
1087         [DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]\r
1088         public static extern void hb_register_error_handler(LoggingCallback callback);\r
1089 \r
1090         /// Return Type: hb_handle_t*\r
1091         ///verbose: int\r
1092         ///update_check: int\r
1093         [DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]\r
1094         public static extern IntPtr hb_init(int verbose, int update_check);\r
1095 \r
1096 \r
1097         /// Return Type: hb_handle_t*\r
1098         ///verbose: int\r
1099         ///update_check: int\r
1100         [DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]\r
1101         public static extern IntPtr hb_init_dl(int verbose, int update_check);\r
1102 \r
1103 \r
1104         /// Return Type: char*\r
1105         ///param0: hb_handle_t*\r
1106         [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]\r
1107         public static extern IntPtr hb_get_version(ref hb_handle_s param0);\r
1108 \r
1109 \r
1110         /// Return Type: int\r
1111         ///param0: hb_handle_t*\r
1112         [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]\r
1113         public static extern int hb_get_build(ref hb_handle_s param0);\r
1114 \r
1115 \r
1116         /// Return Type: int\r
1117         ///h: hb_handle_t*\r
1118         ///version: char**\r
1119         [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]\r
1120         public static extern int hb_check_update(ref hb_handle_s h, ref IntPtr version);\r
1121 \r
1122 \r
1123         /// Return Type: void\r
1124         ///param0: hb_handle_t*\r
1125         ///param1: int\r
1126         [DllImport("hb.dll", EntryPoint = "hb_set_cpu_count", CallingConvention = CallingConvention.Cdecl)]\r
1127         public static extern void hb_set_cpu_count(ref hb_handle_s param0, int param1);\r
1128 \r
1129 \r
1130         /// Return Type: char*\r
1131         ///path: char*\r
1132         [DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]\r
1133         public static extern IntPtr hb_dvd_name(IntPtr path);\r
1134 \r
1135 \r
1136         /// Return Type: void\r
1137         ///enable: int\r
1138         [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]\r
1139         public static extern void hb_dvd_set_dvdnav(int enable);\r
1140 \r
1141 \r
1142         /// Return Type: void\r
1143         ///param0: hb_handle_t*\r
1144         ///path: char*\r
1145         ///title_index: int\r
1146         ///preview_count: int\r
1147         ///store_previews: int\r
1148         [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]\r
1149         public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path, int title_index, int preview_count, int store_previews);\r
1150 \r
1151 \r
1152         /// Return Type: hb_list_t*\r
1153         ///param0: hb_handle_t*\r
1154         [DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]\r
1155         public static extern IntPtr hb_get_titles(IntPtr hbHandle);\r
1156 \r
1157 \r
1158         /// Return Type: int\r
1159         ///buf: hb_buffer_t*\r
1160         ///width: int\r
1161         ///height: int\r
1162         ///color_equal: int\r
1163         ///color_diff: int\r
1164         ///threshold: int\r
1165         ///prog_equal: int\r
1166         ///prog_diff: int\r
1167         ///prog_threshold: int\r
1168         [DllImport("hb.dll", EntryPoint = "hb_detect_comb", CallingConvention = CallingConvention.Cdecl)]\r
1169         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
1170 \r
1171         [DllImport("hb.dll", EntryPoint = "hb_get_preview_by_index", CallingConvention = CallingConvention.Cdecl)]\r
1172         public static extern void hb_get_preview_by_index(IntPtr hbHandle, int title_index, int picture, IntPtr buffer);\r
1173 \r
1174         /// Return Type: void\r
1175         ///param0: hb_handle_t*\r
1176         ///param1: hb_title_t*\r
1177         ///param2: int\r
1178         ///param3: uint8_t*\r
1179         [DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]\r
1180         public static extern void hb_get_preview(IntPtr hbHandle, ref hb_title_s title, int preview, IntPtr buffer);\r
1181 \r
1182 \r
1183         /// Return Type: void\r
1184         ///param0: hb_job_t*\r
1185         ///ratio: double\r
1186         ///pixels: int\r
1187         [DllImport("hb.dll", EntryPoint = "hb_set_size", CallingConvention = CallingConvention.Cdecl)]\r
1188         public static extern void hb_set_size(ref hb_job_s param0, double ratio, int pixels);\r
1189 \r
1190         [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size_by_index", CallingConvention = CallingConvention.Cdecl)]\r
1191         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
1192 \r
1193         /// Return Type: void\r
1194         ///param0: hb_job_t*\r
1195         ///output_width: int*\r
1196         ///output_height: int*\r
1197         ///output_par_width: int*\r
1198         ///output_par_height: int*\r
1199         [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size", CallingConvention = CallingConvention.Cdecl)]\r
1200         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
1201 \r
1202 \r
1203         /// Return Type: int\r
1204         ///param0: hb_handle_t*\r
1205         [DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]\r
1206         public static extern int hb_count(IntPtr hbHandle);\r
1207 \r
1208 \r
1209         /// Return Type: hb_job_t*\r
1210         ///param0: hb_handle_t*\r
1211         ///param1: int\r
1212         [DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]\r
1213         public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);\r
1214 \r
1215         [DllImport("hb.dll", EntryPoint = "hb_set_chapter_name", CallingConvention = CallingConvention.Cdecl)]\r
1216         public static extern void hb_set_chapter_name(IntPtr hbHandle, int title_index, int chapter_index, [In] [MarshalAs(UnmanagedType.LPStr)] string chapter_name);\r
1217 \r
1218         [DllImport("hb.dll", EntryPoint = "hb_set_job", CallingConvention = CallingConvention.Cdecl)]\r
1219         public static extern void hb_set_job(IntPtr hbHandle, int title_index, ref hb_job_s job);\r
1220 \r
1221         /// Return Type: void\r
1222         ///param0: hb_handle_t*\r
1223         ///param1: hb_job_t*\r
1224         [DllImport("hb.dll", EntryPoint = "hb_add", CallingConvention = CallingConvention.Cdecl)]\r
1225         public static extern void hb_add(IntPtr hbHandle, ref hb_job_s job);\r
1226 \r
1227 \r
1228         /// Return Type: void\r
1229         ///param0: hb_handle_t*\r
1230         ///param1: hb_job_t*\r
1231         [DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]\r
1232         public static extern void hb_rem(IntPtr hbHandle, IntPtr job);\r
1233 \r
1234 \r
1235         /// Return Type: void\r
1236         ///param0: hb_handle_t*\r
1237         [DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]\r
1238         public static extern void hb_start(IntPtr hbHandle);\r
1239 \r
1240 \r
1241         /// Return Type: void\r
1242         ///param0: hb_handle_t*\r
1243         [DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]\r
1244         public static extern void hb_pause(IntPtr hbHandle);\r
1245 \r
1246 \r
1247         /// Return Type: void\r
1248         ///param0: hb_handle_t*\r
1249         [DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]\r
1250         public static extern void hb_resume(IntPtr hbHandle);\r
1251 \r
1252 \r
1253         /// Return Type: void\r
1254         ///param0: hb_handle_t*\r
1255         [DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]\r
1256         public static extern void hb_stop(IntPtr hbHandle);\r
1257 \r
1258         [DllImport("hb.dll", EntryPoint = "hb_get_filter_object", CallingConvention = CallingConvention.Cdecl)]\r
1259         //public static extern IntPtr hb_get_filter_object(int filter_id, [In] [MarshalAs(UnmanagedType.LPStr)] string settings);\r
1260         public static extern IntPtr hb_get_filter_object(int filter_id, IntPtr settings);\r
1261 \r
1262         /// Return Type: void\r
1263         ///param0: hb_handle_t*\r
1264         ///param1: hb_state_t*\r
1265         [DllImport("hb.dll", EntryPoint = "hb_get_state", CallingConvention = CallingConvention.Cdecl)]\r
1266         public static extern void hb_get_state(IntPtr hbHandle, ref hb_state_s state);\r
1267 \r
1268 \r
1269         /// Return Type: void\r
1270         ///param0: hb_handle_t*\r
1271         ///param1: hb_state_t*\r
1272         [DllImport("hb.dll", EntryPoint = "hb_get_state2", CallingConvention = CallingConvention.Cdecl)]\r
1273         public static extern void hb_get_state2(ref hb_handle_s param0, ref hb_state_s param1);\r
1274 \r
1275 \r
1276         /// Return Type: int\r
1277         ///param0: hb_handle_t*\r
1278         [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]\r
1279         public static extern int hb_get_scancount(ref hb_handle_s param0);\r
1280 \r
1281 \r
1282         /// Return Type: void\r
1283         ///param0: hb_handle_t**\r
1284         [DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]\r
1285         public static extern void hb_close(IntPtr hbHandle);\r
1286 \r
1287         [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]\r
1288         public static extern void hb_global_close();\r
1289     }\r
1290 }\r