OSDN Git Service

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