OSDN Git Service

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