1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="HBFunctions.cs" company="HandBrake Project (http://handbrake.fr)">
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
// <summary>
// Defines the HBFunctions type.
// </summary>
// <auto-generated> Disable Stylecop Warnings for this file </auto-generated>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.HbLib
{
using System;
using System.Runtime.InteropServices;
public static class HBFunctions
{
[DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_register_logger(LoggingCallback callback);
[DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_register_error_handler(LoggingCallback callback);
[DllImport("hb.dll", EntryPoint = "hb_global_init", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_global_init();
/// Return Type: hb_handle_t*
///verbose: int
///update_check: int
[DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_init(int verbose, int update_check);
/// Return Type: hb_handle_t*
///verbose: int
///update_check: int
[DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_init_dl(int verbose, int update_check);
/// Return Type: char*
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_get_version(ref hb_handle_s param0);
/// Return Type: int
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_get_build(ref hb_handle_s param0);
/// Return Type: int
///h: hb_handle_t*
///version: char**
[DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_check_update(ref hb_handle_s h, ref IntPtr version);
/// Return Type: char*
///path: char*
[DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_dvd_name(IntPtr path);
/// Return Type: void
///enable: int
[DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_dvd_set_dvdnav(int enable);
/// Return Type: void
///param0: hb_handle_t*
///path: char*
///title_index: int
///preview_count: int
///store_previews: int
[DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_scan(IntPtr hbHandle, [In] [MarshalAs(UnmanagedType.LPStr)] string path, int title_index, int preview_count, int store_previews, ulong min_duration);
[DllImport("hb.dll", EntryPoint = "hb_scan_stop", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_scan_stop(IntPtr hbHandle);
/// Return Type: hb_list_t*
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_get_titles(IntPtr hbHandle);
/// Return Type: void
///param0: hb_handle_t*
///param1: hb_title_t*
///param2: int
///param3: uint8_t*
[DllImport("hb.dll", EntryPoint = "hb_get_preview", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_get_preview(IntPtr hbHandle, ref hb_job_s title, int preview, IntPtr buffer);
/// Return Type: void
///param0: hb_job_t*
///ratio: double
///pixels: int
[DllImport("hb.dll", EntryPoint = "hb_set_size", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_set_size(ref hb_job_s param0, double ratio, int pixels);
/// Return Type: void
///param0: hb_job_t*
///output_width: int*
///output_height: int*
///output_par_width: int*
///output_par_height: int*
[DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size", CallingConvention = CallingConvention.Cdecl)]
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);
/// Return Type: int
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_count(IntPtr hbHandle);
/// Return Type: hb_job_t*
///param0: hb_handle_t*
///param1: int
[DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);
[DllImport("hb.dll", EntryPoint = "hb_set_job", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_set_job(IntPtr hbHandle, int title_index, ref hb_job_s job);
/// Return Type: void
///param0: hb_handle_t*
///param1: hb_job_t*
[DllImport("hb.dll", EntryPoint = "hb_add", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_add(IntPtr hbHandle, ref hb_job_s job);
/// Return Type: void
///param0: hb_handle_t*
///param1: hb_job_t*
[DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_rem(IntPtr hbHandle, IntPtr job);
/// Return Type: void
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_start(IntPtr hbHandle);
/// Return Type: void
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_pause(IntPtr hbHandle);
/// Return Type: void
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_resume(IntPtr hbHandle);
/// Return Type: void
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_stop(IntPtr hbHandle);
/// Return Type: void
///param0: hb_handle_t*
///param1: hb_state_t*
[DllImport("hb.dll", EntryPoint = "hb_get_state", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_get_state(IntPtr hbHandle, ref hb_state_s state);
/// Return Type: void
///param0: hb_handle_t*
///param1: hb_state_t*
[DllImport("hb.dll", EntryPoint = "hb_get_state2", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_get_state2(ref hb_handle_s param0, ref hb_state_s param1);
/// Return Type: int
///param0: hb_handle_t*
[DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_get_scancount(ref hb_handle_s param0);
/// Return Type: void
///param0: hb_handle_t**
[DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_close(IntPtr hbHandle);
[DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_global_close();
[DllImport("hb.dll", EntryPoint = "hb_subtitle_add", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_subtitle_add(ref hb_job_s job, ref hb_subtitle_config_s subtitleConfig, int track);
[DllImport("hb.dll", EntryPoint = "hb_srt_add", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_srt_add(ref hb_job_s job, ref hb_subtitle_config_s subtitleConfig, string lang);
//int hb_video_framerate_get_from_name(const char *name);
//const char* hb_video_framerate_get_name(int framerate);
//const char* hb_video_framerate_sanitize_name(const char *name);
// returns hb_rate_s
[DllImport("hb.dll", EntryPoint = "hb_video_framerate_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_video_framerate_get_next(IntPtr last);
//int hb_audio_samplerate_get_best(uint32_t codec, int samplerate, int *sr_shift);
//int hb_audio_samplerate_get_from_name(const char *name);
//const char* hb_audio_samplerate_get_name(int samplerate);
// returns hb_rate_s
[DllImport("hb.dll", EntryPoint = "hb_audio_samplerate_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_samplerate_get_next(IntPtr last);
[DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_best", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown);
[DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_default", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown);
[DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_limits", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high);
[DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last);
[DllImport("hb.dll", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
[DllImport("hb.dll", EntryPoint = "hb_video_quality_get_name", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_video_quality_get_name(uint codec);
[DllImport("hb.dll", EntryPoint = "hb_audio_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
//float hb_audio_quality_get_best(uint32_t codec, float quality);
[DllImport("hb.dll", EntryPoint = "hb_audio_quality_get_default", CallingConvention = CallingConvention.Cdecl)]
public static extern float hb_audio_quality_get_default(uint codec);
[DllImport("hb.dll", EntryPoint = "hb_audio_compression_get_limits", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
//float hb_audio_compression_get_best(uint32_t codec, float compression);
[DllImport("hb.dll", EntryPoint = "hb_audio_compression_get_default", CallingConvention = CallingConvention.Cdecl)]
public static extern float hb_audio_compression_get_default(uint codec);
//int hb_audio_dither_get_default();
//int hb_audio_dither_get_default_method(); // default method, if enabled && supported
//int hb_audio_dither_is_supported(uint32_t codec);
//int hb_audio_dither_get_from_name(const char *name);
//const char* hb_audio_dither_get_description(int method);
//const hb_dither_t* hb_audio_dither_get_next(const hb_dither_t *last);
[DllImport("hb.dll", EntryPoint = "hb_mixdown_is_supported", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout);
[DllImport("hb.dll", EntryPoint = "hb_mixdown_has_codec_support", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_mixdown_has_codec_support(int mixdown, uint codec);
[DllImport("hb.dll", EntryPoint = "hb_mixdown_has_remix_support", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_mixdown_has_remix_support(int mixdown, ulong layout);
//int hb_mixdown_get_discrete_channel_count(int mixdown);
//int hb_mixdown_get_low_freq_channel_count(int mixdown);
[DllImport("hb.dll", EntryPoint = "hb_mixdown_get_best", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_mixdown_get_best(uint codec, ulong layout, int mixdown);
[DllImport("hb.dll", EntryPoint = "hb_mixdown_get_default", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_mixdown_get_default(uint codec, ulong layout);
//int hb_mixdown_get_from_name(const char *name);
//const char* hb_mixdown_get_name(int mixdown);
//const char* hb_mixdown_get_short_name(int mixdown);
//const char* hb_mixdown_sanitize_name(const char *name);
[DllImport("hb.dll", EntryPoint = "hb_mixdown_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_mixdown_get_next(IntPtr last);
//int hb_video_encoder_get_default(int muxer);
//int hb_video_encoder_get_from_name(const char *name);
//const char* hb_video_encoder_get_name(int encoder);
//const char* hb_video_encoder_get_short_name(int encoder);
//const char* hb_video_encoder_sanitize_name(const char *name);
[DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_video_encoder_get_next(IntPtr last);
/*
* hb_audio_encoder_get_fallback_for_passthru() will sanitize a passthru codec
* to the matching audio encoder (if any is available).
*
* hb_audio_encoder_get_from_name(), hb_audio_encoder_sanitize_name() will
* sanitize legacy encoder names, but won't convert passthru to an encoder.
*/
//int hb_audio_encoder_get_fallback_for_passthru(int passthru);
//int hb_audio_encoder_get_default(int muxer);
//int hb_audio_encoder_get_from_name(const char *name);
//const char* hb_audio_encoder_get_name(int encoder);
//const char* hb_audio_encoder_get_short_name(int encoder);
//const char* hb_audio_encoder_sanitize_name(const char *name);
[DllImport("hb.dll", EntryPoint = "hb_audio_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_encoder_get_next(IntPtr last);
//int hb_container_get_from_name(const char *name);
//int hb_container_get_from_extension(const char *extension); // not really a container name
//const char* hb_container_get_name(int format);
//const char* hb_container_get_short_name(int format);
//const char* hb_container_get_default_extension(int format);
//const char* hb_container_sanitize_name(const char *name);
[DllImport("hb.dll", EntryPoint = "hb_container_get_from_name", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_container_get_from_name([In] [MarshalAs(UnmanagedType.LPStr)] string name);
[DllImport("hb.dll", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_container_get_next(IntPtr last);
[DllImport("hb.dll", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr lang_get_next(IntPtr last);
[DllImport("hb.dll", EntryPoint = "lang_for_code2", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2);
/// void hb_autopassthru_apply_settings( hb_job_t * job )
[DllImport("hb.dll", EntryPoint = "hb_autopassthru_apply_settings", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_autopassthru_apply_settings(ref hb_job_s job);
///hb_title_set_t * hb_get_title_set( hb_handle_t * );
[DllImport("hb.dll", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_get_title_set(IntPtr hbHandle);
///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index );
[DllImport("hb.dll", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index);
///hb_job_t * hb_job_init( hb_title_t * title );
[DllImport("hb.dll", EntryPoint = "hb_job_init", CallingConvention = CallingConvention.Cdecl)]
public static extern hb_job_s hb_job_init(ref hb_title_s title);
///void hb_job_reset( hb_job_t * job );
[DllImport("hb.dll", EntryPoint = "hb_job_reset", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_job_reset(ref hb_job_s job);
///void hb_job_close( hb_job_t ** job );
[DllImport("hb.dll", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_job_close(IntPtr job);
///void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts );
[DllImport("hb.dll", EntryPoint = "hb_job_set_advanced_opts", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_job_set_advanced_opts(ref hb_job_s job, IntPtr advanced_opts);
///void hb_job_set_file( hb_job_t *job, const char *file );
[DllImport("hb.dll", EntryPoint = "hb_job_set_file", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_job_set_file(ref hb_job_s job, IntPtr file);
///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
[DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_chapter_set_title(IntPtr chapter, [In] [MarshalAs(UnmanagedType.LPStr)] string title);
///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
[DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_chapter_set_title__ptr(IntPtr chapter, IntPtr title);
/// void hb_add_filter( hb_job_t * job, hb_filter_object_t * filter, const char * settings );
[DllImport("hb.dll", EntryPoint = "hb_add_filter", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_add_filter(ref hb_job_s job, ref hb_filter_object_s filter, IntPtr settings);
/// hb_filter_object_t * hb_filter_init( int filter_id );
[DllImport("hb.dll", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_filter_init(int filter_id);
[DllImport("hb.dll", EntryPoint = "hb_x264_encopt_name", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_x264_encopt_name(IntPtr name);
[DllImport("hb.dll", EntryPoint = "hb_check_h264_level", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced);
[DllImport("hb.dll", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_x264_param_unparse(
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile,
[In] [MarshalAs(UnmanagedType.LPStr)] string h264_level,
int width,
int height);
[DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_qsv_available();
[DllImport("hb.dll", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_qsv_info_init();
}
}
|