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