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     internal 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     internal 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     internal 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     internal 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     internal 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     internal 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     internal 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     internal enum hb_subtitle_s_subtype\r
396     {\r
397         PICTURESUB,\r
398 \r
399         TEXTSUB,\r
400     }\r
401 \r
402     internal 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 \r
417     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
418     internal struct hb_subtitle_s\r
419     {\r
420         /// int\r
421         public int id;\r
422 \r
423         /// int\r
424         public int track;\r
425 \r
426         /// hb_subtitle_config_t->hb_subtitle_config_s\r
427         public hb_subtitle_config_s config;\r
428 \r
429         /// hb_subtitle_s_subtype\r
430         public hb_subtitle_s_subtype format;\r
431 \r
432         /// hb_subtitle_s_subsource\r
433         public hb_subtitle_s_subsource source;\r
434 \r
435         /// char[1024]\r
436         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
437         public string lang;\r
438 \r
439         /// char[4]\r
440         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
441         public string iso639_2;\r
442 \r
443         /// uint8_t->unsigned char\r
444         public byte type;\r
445 \r
446         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)]\r
447         public uint[] palette;\r
448 \r
449         public int width;\r
450 \r
451         public int height;\r
452 \r
453         /// int\r
454         public int hits;\r
455 \r
456         /// int\r
457         public int forced_hits;\r
458 \r
459         /// hb_fifo_t*\r
460         public IntPtr fifo_in;\r
461 \r
462         /// hb_fifo_t*\r
463         public IntPtr fifo_raw;\r
464 \r
465         /// hb_fifo_t*\r
466         public IntPtr fifo_sync;\r
467 \r
468         /// hb_fifo_t*\r
469         public IntPtr fifo_out;\r
470 \r
471         /// hb_mux_data_t*\r
472         public IntPtr mux_data;\r
473     }\r
474 \r
475     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
476     internal struct hb_metadata_s\r
477     {\r
478         /// char[255]\r
479         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
480         public string name;\r
481 \r
482         /// char[255]\r
483         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
484         public string artist;\r
485 \r
486         /// char[255]\r
487         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
488         public string composer;\r
489 \r
490         /// char[255]\r
491         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
492         public string release_date;\r
493 \r
494         /// char[1024]\r
495         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
496         public string comment;\r
497 \r
498         /// char[255]\r
499         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
500         public string album;\r
501 \r
502         /// char[255]\r
503         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]\r
504         public string genre;\r
505 \r
506         /// uint32_t->unsigned int\r
507         public uint coverart_size;\r
508 \r
509         /// uint8_t*\r
510         public IntPtr coverart;\r
511     }\r
512 \r
513     internal enum Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
514     {\r
515         HB_DVD_TYPE,\r
516 \r
517         HB_STREAM_TYPE,\r
518     }\r
519 \r
520     internal enum Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
521     {\r
522         /// HB_MPEG2_PS_DEMUXER -> 0\r
523         HB_MPEG2_PS_DEMUXER = 0,\r
524 \r
525         HB_MPEG2_TS_DEMUXER,\r
526 \r
527         HB_NULL_DEMUXER,\r
528     }\r
529 \r
530     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
531     internal struct hb_title_s\r
532     {\r
533         /// Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550\r
534         public Anonymous_990d28ea_6cf3_4fbc_8143_4df9513e9550 type;\r
535 \r
536         /// char[1024]\r
537         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
538         public string dvd;\r
539 \r
540         /// char[1024]\r
541         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
542         public string name;\r
543 \r
544         //public fixed byte dvd[1024];\r
545 \r
546         //public fixed byte name[1024];\r
547 \r
548         /// int\r
549         public int index;\r
550 \r
551         /// int\r
552         public int vts;\r
553 \r
554         /// int\r
555         public int ttn;\r
556 \r
557         /// int\r
558         public int cell_start;\r
559 \r
560         /// int\r
561         public int cell_end;\r
562 \r
563         /// int\r
564         public int block_start;\r
565 \r
566         /// int\r
567         public int block_end;\r
568 \r
569         /// int\r
570         public int block_count;\r
571 \r
572         /// int\r
573         public int angle_count;\r
574 \r
575         /// int\r
576         public int hours;\r
577 \r
578         /// int\r
579         public int minutes;\r
580 \r
581         /// int\r
582         public int seconds;\r
583 \r
584         /// uint64_t->unsigned int\r
585         public ulong duration;\r
586 \r
587         /// double\r
588         public double aspect;\r
589 \r
590         /// double\r
591         public double container_aspect;\r
592 \r
593         /// int\r
594         public int width;\r
595 \r
596         /// int\r
597         public int height;\r
598 \r
599         /// int\r
600         public int pixel_aspect_width;\r
601 \r
602         /// int\r
603         public int pixel_aspect_height;\r
604 \r
605         /// int\r
606         public int rate;\r
607 \r
608         /// int\r
609         public int rate_base;\r
610 \r
611         /// int[4]\r
612         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]\r
613         public int[] crop;\r
614 \r
615         //public fixed int crop[4];\r
616 \r
617         /// Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db\r
618         public Anonymous_618ebeca_0ad9_4a71_9a49_18e50ac2e9db demuxer;\r
619 \r
620         /// int\r
621         public int detected_interlacing;\r
622 \r
623         /// int\r
624         public int video_id;\r
625 \r
626         /// int\r
627         public int video_codec;\r
628 \r
629         /// int\r
630         public int video_codec_param;\r
631 \r
632         /// char*\r
633         public IntPtr video_codec_name;\r
634 \r
635         /// int\r
636         public int video_bitrate;\r
637 \r
638         /// char*\r
639         public IntPtr container_name;\r
640 \r
641         /// int\r
642         public int data_rate;\r
643 \r
644         /// hb_metadata_t*\r
645         public IntPtr metadata;\r
646 \r
647         /// hb_list_t*\r
648         public IntPtr list_chapter;\r
649 \r
650         /// hb_list_t*\r
651         public IntPtr list_audio;\r
652 \r
653         /// hb_list_t*\r
654         public IntPtr list_subtitle;\r
655 \r
656         /// hb_job_t*\r
657         public IntPtr job;\r
658 \r
659         /// uint32_t->unsigned int\r
660         public uint flags;\r
661     }\r
662 \r
663     [StructLayout(LayoutKind.Sequential)]\r
664     internal struct hb_state_scanning_s\r
665     {\r
666         /// int\r
667         public int title_cur;\r
668 \r
669         /// int\r
670         public int title_count;\r
671     }\r
672 \r
673     [StructLayout(LayoutKind.Sequential)]\r
674     internal struct hb_state_working_s\r
675     {\r
676         /// float\r
677         public float progress;\r
678 \r
679         /// int\r
680         public int job_cur;\r
681 \r
682         /// int\r
683         public int job_count;\r
684 \r
685         /// float\r
686         public float rate_cur;\r
687 \r
688         /// float\r
689         public float rate_avg;\r
690 \r
691         /// int\r
692         public int hours;\r
693 \r
694         /// int\r
695         public int minutes;\r
696 \r
697         /// int\r
698         public int seconds;\r
699 \r
700         /// int\r
701         public int sequence_id;\r
702     }\r
703 \r
704     [StructLayout(LayoutKind.Sequential)]\r
705     internal struct hb_state_workdone_s\r
706     {\r
707         /// int\r
708         public int error;\r
709     }\r
710 \r
711     [StructLayout(LayoutKind.Sequential)]\r
712     internal struct hb_state_muxing_s\r
713     {\r
714         /// float\r
715         public float progress;\r
716     }\r
717 \r
718     [StructLayout(LayoutKind.Explicit)]\r
719     internal struct hb_state_param_u\r
720     {\r
721         [FieldOffset(0)]\r
722         public hb_state_scanning_s scanning;\r
723 \r
724         [FieldOffset(0)]\r
725         public hb_state_working_s working;\r
726 \r
727         [FieldOffset(0)]\r
728         public hb_state_workdone_s workdone;\r
729 \r
730         [FieldOffset(0)]\r
731         public hb_state_muxing_s muxing;\r
732     }\r
733 \r
734     [StructLayout(LayoutKind.Sequential)]\r
735     internal struct hb_state_s\r
736     {\r
737 \r
738         /// int\r
739         public int state;\r
740         public hb_state_param_u param;\r
741     }\r
742 \r
743     [StructLayout(LayoutKind.Sequential)]\r
744     internal struct hb_audio_s\r
745     {\r
746         /// int\r
747         public int id;\r
748 \r
749         /// hb_audio_config_t->hb_audio_config_s\r
750         public hb_audio_config_s config;\r
751 \r
752         // Padding for the part of the struct we don't care about marshaling.\r
753         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24600, ArraySubType = UnmanagedType.U1)]\r
754         public byte[] padding;\r
755 \r
756         /// Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545\r
757         //public Anonymous_e6c7b779_b5a3_4e80_9fa8_13619d14f545 priv;\r
758     }\r
759 \r
760     [StructLayout(LayoutKind.Sequential)]\r
761     internal struct hb_audio_config_s\r
762     {\r
763         public hb_audio_config_output_s output;\r
764         public hb_audio_config_input_s input;\r
765 \r
766         /// Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
767         public Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d flags;\r
768 \r
769         public hb_audio_config_lang_s lang;\r
770     }\r
771 \r
772     [StructLayout(LayoutKind.Sequential)]\r
773     internal struct hb_audio_config_output_s\r
774     {\r
775         /// int\r
776         public int track;\r
777 \r
778         /// uint32_t->unsigned int\r
779         public uint codec;\r
780 \r
781         /// int\r
782         public int samplerate;\r
783 \r
784         /// int\r
785         public int bitrate;\r
786 \r
787         /// int\r
788         public int mixdown;\r
789 \r
790         /// double\r
791         public double dynamic_range_compression;\r
792 \r
793         /// char*\r
794         [MarshalAs(UnmanagedType.LPStr)]\r
795         public string name;\r
796     }\r
797 \r
798     [StructLayout(LayoutKind.Sequential)]\r
799     internal struct hb_audio_config_input_s\r
800     {\r
801         /// int\r
802         public int track;\r
803 \r
804         /// uint32_t->unsigned int\r
805         public uint codec;\r
806 \r
807         /// uint32_t->unsigned int\r
808         public uint codec_param;\r
809 \r
810         /// uint32_t->unsigned int\r
811         public uint version;\r
812 \r
813         /// uint32_t->unsigned int\r
814         public uint mode;\r
815 \r
816         /// int\r
817         public int samplerate;\r
818 \r
819         /// int\r
820         public int bitrate;\r
821 \r
822         /// int\r
823         public int channel_layout;\r
824     }\r
825 \r
826     [StructLayout(LayoutKind.Explicit)]\r
827     internal struct Anonymous_a0a59d69_d9a4_4003_a198_f7c51511e31d\r
828     {\r
829         /// int\r
830         [FieldOffset(0)]\r
831         public int ac3;\r
832 \r
833         /// int\r
834         [FieldOffset(0)]\r
835         public int dca;\r
836     }\r
837 \r
838     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
839     internal struct hb_audio_config_lang_s\r
840     {\r
841         /// char[1024]\r
842         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
843         public string description;\r
844 \r
845         /// char[1024]\r
846         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]\r
847         public string simple;\r
848 \r
849         /// char[4]\r
850         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]\r
851         public string iso639_2;\r
852 \r
853         /// uint8_t->unsigned char\r
854         public byte type;\r
855     }\r
856 \r
857     [StructLayout(LayoutKind.Sequential)]\r
858     internal struct hb_mixdown_s\r
859     {\r
860         /// char*\r
861         [MarshalAs(UnmanagedType.LPStr)]\r
862         public string human_readable_name;\r
863 \r
864         /// char*\r
865         [MarshalAs(UnmanagedType.LPStr)]\r
866         public string internal_name;\r
867 \r
868         /// char*\r
869         [MarshalAs(UnmanagedType.LPStr)]\r
870         public string short_name;\r
871 \r
872         /// int\r
873         public int amixdown;\r
874     }\r
875 \r
876     internal enum hb_subtitle_config_s_subdest\r
877     {\r
878         RENDERSUB,\r
879 \r
880         PASSTHRUSUB,\r
881     }\r
882 \r
883     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]\r
884     internal struct hb_subtitle_config_s\r
885     {\r
886         /// hb_subtitle_config_s_subdest\r
887         public hb_subtitle_config_s_subdest dest;\r
888 \r
889         /// int\r
890         public int force;\r
891 \r
892         /// int\r
893         public int default_track;\r
894 \r
895         /// char[128]\r
896         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]\r
897         public string src_filename;\r
898 \r
899         /// char[40]\r
900         [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]\r
901         public string src_codeset;\r
902 \r
903         /// int64_t->int\r
904         public long offset;\r
905     }\r
906 \r
907     [StructLayout(LayoutKind.Sequential)]\r
908     internal struct hb_fifo_s\r
909     {\r
910         /// hb_lock_t*\r
911         public IntPtr @lock;\r
912 \r
913         /// uint32_t->unsigned int\r
914         public uint capacity;\r
915 \r
916         /// uint32_t->unsigned int\r
917         public uint size;\r
918 \r
919         /// uint32_t->unsigned int\r
920         public uint buffer_size;\r
921 \r
922         /// hb_buffer_t*\r
923         public IntPtr first;\r
924 \r
925         /// hb_buffer_t*\r
926         public IntPtr last;\r
927     }\r
928 \r
929     [StructLayout(LayoutKind.Sequential)]\r
930     internal struct hb_lock_s\r
931     {\r
932     }\r
933 \r
934     [StructLayout(LayoutKind.Sequential)]\r
935     internal struct hb_buffer_s\r
936     {\r
937         /// int\r
938         public int size;\r
939 \r
940         /// int\r
941         public int alloc;\r
942 \r
943         /// uint8_t*\r
944         [MarshalAs(UnmanagedType.LPStr)]\r
945         public string data;\r
946 \r
947         /// int\r
948         public int cur;\r
949 \r
950         /// int64_t->int\r
951         public long sequence;\r
952 \r
953         /// int\r
954         public int id;\r
955 \r
956         /// int64_t->int\r
957         public long start;\r
958 \r
959         /// int64_t->int\r
960         public long stop;\r
961 \r
962         /// int\r
963         public int new_chap;\r
964 \r
965         /// uint8_t->unsigned char\r
966         public byte frametype;\r
967 \r
968         /// uint16_t->unsigned int\r
969         public uint flags;\r
970 \r
971         /// int64_t->int\r
972         public long renderOffset;\r
973 \r
974         /// int\r
975         public int x;\r
976 \r
977         /// int\r
978         public int y;\r
979 \r
980         /// int\r
981         public int width;\r
982 \r
983         /// int\r
984         public int height;\r
985 \r
986         /// hb_buffer_t*\r
987         public IntPtr sub;\r
988 \r
989         /// hb_buffer_t*\r
990         public IntPtr next;\r
991     }\r
992 \r
993     [StructLayout(LayoutKind.Sequential)]\r
994     internal struct hb_mux_data_s\r
995     {\r
996         /// MP4TrackId->uint32_t->unsigned int\r
997         public uint track;\r
998 \r
999         /// uint8_t->unsigned char\r
1000         public byte subtitle;\r
1001 \r
1002         /// int\r
1003         public int sub_format;\r
1004 \r
1005         /// uint64_t->unsigned int\r
1006         public ulong sum_dur;\r
1007     }\r
1008 \r
1009     [StructLayout(LayoutKind.Sequential)]\r
1010     internal struct hb_interjob_s\r
1011     {\r
1012         /// int\r
1013         public int last_job;\r
1014 \r
1015         /// int\r
1016         public int frame_count;\r
1017 \r
1018         /// uint64_t->unsigned int\r
1019         public ulong total_time;\r
1020 \r
1021         /// int\r
1022         public int render_dropped;\r
1023 \r
1024         /// int\r
1025         public int vrate;\r
1026 \r
1027         /// int\r
1028         public int vrate_base;\r
1029 \r
1030         /// hb_subtitle_t*\r
1031         public IntPtr select_subtitle;\r
1032     }\r
1033 \r
1034     /// Return Type: void\r
1035     ///param0: void*\r
1036     internal delegate void hb_thread_s_function(IntPtr param0);\r
1037 \r
1038     [StructLayout(LayoutKind.Sequential)]\r
1039     internal struct hb_thread_s\r
1040     {\r
1041         /// char*\r
1042         [MarshalAs(UnmanagedType.LPStr)]\r
1043         public string name;\r
1044 \r
1045         /// int\r
1046         public int priority;\r
1047 \r
1048         /// hb_thread_s_function\r
1049         public hb_thread_s_function AnonymousMember1;\r
1050 \r
1051         /// void*\r
1052         public IntPtr arg;\r
1053 \r
1054         /// hb_lock_t*\r
1055         public IntPtr @lock;\r
1056 \r
1057         /// int\r
1058         public int exited;\r
1059 \r
1060         /// pthread_t->ptw32_handle_t->Anonymous_55c509b5_bbf2_4788_a684_ac1bd0056655\r
1061         public ptw32_handle_t thread;\r
1062     }\r
1063 \r
1064     [StructLayout(LayoutKind.Sequential)]\r
1065     internal struct ptw32_handle_t\r
1066     {\r
1067         /// void*\r
1068         public IntPtr p;\r
1069 \r
1070         /// unsigned int\r
1071         public uint x;\r
1072     }\r
1073 \r
1074     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\r
1075     internal delegate void LoggingCallback(string message);\r
1076 \r
1077     internal partial class HbLib\r
1078     {\r
1079         [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]\r
1080         public static extern void hb_register_logger(LoggingCallback callback);\r
1081 \r
1082         [DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]\r
1083         public static extern void hb_register_error_handler(LoggingCallback callback);\r
1084 \r
1085         /// Return Type: hb_handle_t*\r
1086         ///verbose: int\r
1087         ///update_check: int\r
1088         [DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]\r
1089         public static extern IntPtr hb_init(int verbose, int update_check);\r
1090 \r
1091 \r
1092         /// Return Type: hb_handle_t*\r
1093         ///verbose: int\r
1094         ///update_check: int\r
1095         [DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]\r
1096         public static extern IntPtr hb_init_dl(int verbose, int update_check);\r
1097 \r
1098 \r
1099         /// Return Type: char*\r
1100         ///param0: hb_handle_t*\r
1101         [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]\r
1102         public static extern IntPtr hb_get_version(ref hb_handle_s param0);\r
1103 \r
1104 \r
1105         /// Return Type: int\r
1106         ///param0: hb_handle_t*\r
1107         [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]\r
1108         public static extern int hb_get_build(ref hb_handle_s param0);\r
1109 \r
1110 \r
1111         /// Return Type: int\r
1112         ///h: hb_handle_t*\r
1113         ///version: char**\r
1114         [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]\r
1115         public static extern int hb_check_update(ref hb_handle_s h, ref IntPtr version);\r
1116 \r
1117 \r
1118         /// Return Type: void\r
1119         ///param0: hb_handle_t*\r
1120         ///param1: int\r
1121         [DllImport("hb.dll", EntryPoint = "hb_set_cpu_count", CallingConvention = CallingConvention.Cdecl)]\r
1122         public static extern void hb_set_cpu_count(ref hb_handle_s param0, int param1);\r
1123 \r
1124 \r
1125         /// Return Type: char*\r
1126         ///path: char*\r
1127         [DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]\r
1128         public static extern IntPtr hb_dvd_name(IntPtr path);\r
1129 \r
1130 \r
1131         /// Return Type: void\r
1132         ///enable: int\r
1133         [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]\r
1134         public static extern void hb_dvd_set_dvdnav(int enable);\r
1135 \r
1136 \r
1137         /// Return Type: void\r
1138         ///param0: hb_handle_t*\r
1139         ///path: char*\r
1140         ///title_index: int\r
1141         ///preview_count: int\r
1142         ///store_previews: int\r
1143         [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]\r
1144         public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path, int title_index, int preview_count, int store_previews);\r
1145 \r
1146 \r
1147         /// Return Type: hb_list_t*\r
1148         ///param0: hb_handle_t*\r
1149         [DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]\r
1150         public static extern IntPtr hb_get_titles(IntPtr hbHandle);\r
1151 \r
1152 \r
1153         /// Return Type: int\r
1154         ///buf: hb_buffer_t*\r
1155         ///width: int\r
1156         ///height: int\r
1157         ///color_equal: int\r
1158         ///color_diff: int\r
1159         ///threshold: int\r
1160         ///prog_equal: int\r
1161         ///prog_diff: int\r
1162         ///prog_threshold: int\r
1163         [DllImport("hb.dll", EntryPoint = "hb_detect_comb", CallingConvention = CallingConvention.Cdecl)]\r
1164         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
1165 \r
1166         [DllImport("hb.dll", EntryPoint = "hb_get_preview_by_index", CallingConvention = CallingConvention.Cdecl)]\r
1167         public static extern void hb_get_preview_by_index(IntPtr hbHandle, int title_index, int picture, IntPtr buffer);\r
1168 \r
1169         /// Return Type: void\r
1170         ///param0: hb_handle_t*\r
1171         ///param1: hb_title_t*\r
1172         ///param2: int\r
1173         ///param3: uint8_t*\r
1174         [DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]\r
1175         public static extern void hb_get_preview(IntPtr hbHandle, ref hb_title_s title, int preview, IntPtr buffer);\r
1176 \r
1177 \r
1178         /// Return Type: void\r
1179         ///param0: hb_job_t*\r
1180         ///ratio: double\r
1181         ///pixels: int\r
1182         [DllImport("hb.dll", EntryPoint = "hb_set_size", CallingConvention = CallingConvention.Cdecl)]\r
1183         public static extern void hb_set_size(ref hb_job_s param0, double ratio, int pixels);\r
1184 \r
1185         [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size_by_index", CallingConvention = CallingConvention.Cdecl)]\r
1186         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
1187 \r
1188         /// Return Type: void\r
1189         ///param0: hb_job_t*\r
1190         ///output_width: int*\r
1191         ///output_height: int*\r
1192         ///output_par_width: int*\r
1193         ///output_par_height: int*\r
1194         [DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size", CallingConvention = CallingConvention.Cdecl)]\r
1195         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
1196 \r
1197 \r
1198         /// Return Type: int\r
1199         ///param0: hb_handle_t*\r
1200         [DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]\r
1201         public static extern int hb_count(IntPtr hbHandle);\r
1202 \r
1203 \r
1204         /// Return Type: hb_job_t*\r
1205         ///param0: hb_handle_t*\r
1206         ///param1: int\r
1207         [DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]\r
1208         public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);\r
1209 \r
1210         [DllImport("hb.dll", EntryPoint = "hb_set_chapter_name", CallingConvention = CallingConvention.Cdecl)]\r
1211         public static extern void hb_set_chapter_name(IntPtr hbHandle, int title_index, int chapter_index, [In] [MarshalAs(UnmanagedType.LPStr)] string chapter_name);\r
1212 \r
1213         [DllImport("hb.dll", EntryPoint = "hb_set_job", CallingConvention = CallingConvention.Cdecl)]\r
1214         public static extern void hb_set_job(IntPtr hbHandle, int title_index, ref hb_job_s job);\r
1215 \r
1216         /// Return Type: void\r
1217         ///param0: hb_handle_t*\r
1218         ///param1: hb_job_t*\r
1219         [DllImport("hb.dll", EntryPoint = "hb_add", CallingConvention = CallingConvention.Cdecl)]\r
1220         public static extern void hb_add(IntPtr hbHandle, ref hb_job_s job);\r
1221 \r
1222 \r
1223         /// Return Type: void\r
1224         ///param0: hb_handle_t*\r
1225         ///param1: hb_job_t*\r
1226         [DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]\r
1227         public static extern void hb_rem(IntPtr hbHandle, IntPtr job);\r
1228 \r
1229 \r
1230         /// Return Type: void\r
1231         ///param0: hb_handle_t*\r
1232         [DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]\r
1233         public static extern void hb_start(IntPtr hbHandle);\r
1234 \r
1235 \r
1236         /// Return Type: void\r
1237         ///param0: hb_handle_t*\r
1238         [DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]\r
1239         public static extern void hb_pause(IntPtr hbHandle);\r
1240 \r
1241 \r
1242         /// Return Type: void\r
1243         ///param0: hb_handle_t*\r
1244         [DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]\r
1245         public static extern void hb_resume(IntPtr hbHandle);\r
1246 \r
1247 \r
1248         /// Return Type: void\r
1249         ///param0: hb_handle_t*\r
1250         [DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]\r
1251         public static extern void hb_stop(IntPtr hbHandle);\r
1252 \r
1253         [DllImport("hb.dll", EntryPoint = "hb_get_filter_object", CallingConvention = CallingConvention.Cdecl)]\r
1254         //public static extern IntPtr hb_get_filter_object(int filter_id, [In] [MarshalAs(UnmanagedType.LPStr)] string settings);\r
1255         public static extern IntPtr hb_get_filter_object(int filter_id, IntPtr settings);\r
1256 \r
1257         /// Return Type: void\r
1258         ///param0: hb_handle_t*\r
1259         ///param1: hb_state_t*\r
1260         [DllImport("hb.dll", EntryPoint = "hb_get_state", CallingConvention = CallingConvention.Cdecl)]\r
1261         public static extern void hb_get_state(IntPtr hbHandle, ref hb_state_s state);\r
1262 \r
1263 \r
1264         /// Return Type: void\r
1265         ///param0: hb_handle_t*\r
1266         ///param1: hb_state_t*\r
1267         [DllImport("hb.dll", EntryPoint = "hb_get_state2", CallingConvention = CallingConvention.Cdecl)]\r
1268         public static extern void hb_get_state2(ref hb_handle_s param0, ref hb_state_s param1);\r
1269 \r
1270 \r
1271         /// Return Type: int\r
1272         ///param0: hb_handle_t*\r
1273         [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]\r
1274         public static extern int hb_get_scancount(ref hb_handle_s param0);\r
1275 \r
1276 \r
1277         /// Return Type: void\r
1278         ///param0: hb_handle_t**\r
1279         [DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]\r
1280         public static extern void hb_close(IntPtr hbHandle);\r
1281 \r
1282         [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]\r
1283         public static extern void hb_global_close();\r
1284     }\r
1285 }\r