libde265_sys/
ffi.rs

1/* automatically generated by rust-bindgen 0.69.2 */
2
3#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6    storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9    #[inline]
10    pub const fn new(storage: Storage) -> Self {
11        Self { storage }
12    }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16    Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18    #[inline]
19    pub fn get_bit(&self, index: usize) -> bool {
20        debug_assert!(index / 8 < self.storage.as_ref().len());
21        let byte_index = index / 8;
22        let byte = self.storage.as_ref()[byte_index];
23        let bit_index = if cfg!(target_endian = "big") {
24            7 - (index % 8)
25        } else {
26            index % 8
27        };
28        let mask = 1 << bit_index;
29        byte & mask == mask
30    }
31    #[inline]
32    pub fn set_bit(&mut self, index: usize, val: bool) {
33        debug_assert!(index / 8 < self.storage.as_ref().len());
34        let byte_index = index / 8;
35        let byte = &mut self.storage.as_mut()[byte_index];
36        let bit_index = if cfg!(target_endian = "big") {
37            7 - (index % 8)
38        } else {
39            index % 8
40        };
41        let mask = 1 << bit_index;
42        if val {
43            *byte |= mask;
44        } else {
45            *byte &= !mask;
46        }
47    }
48    #[inline]
49    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
50        debug_assert!(bit_width <= 64);
51        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
52        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
53        let mut val = 0;
54        for i in 0..(bit_width as usize) {
55            if self.get_bit(i + bit_offset) {
56                let index = if cfg!(target_endian = "big") {
57                    bit_width as usize - 1 - i
58                } else {
59                    i
60                };
61                val |= 1 << index;
62            }
63        }
64        val
65    }
66    #[inline]
67    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
68        debug_assert!(bit_width <= 64);
69        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
70        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
71        for i in 0..(bit_width as usize) {
72            let mask = 1 << i;
73            let val_bit_is_set = val & mask == mask;
74            let index = if cfg!(target_endian = "big") {
75                bit_width as usize - 1 - i
76            } else {
77                i
78            };
79            self.set_bit(index + bit_offset, val_bit_is_set);
80        }
81    }
82}
83extern "C" {
84    pub fn de265_get_version() -> *const ::std::os::raw::c_char;
85}
86extern "C" {
87    pub fn de265_get_version_number() -> u32;
88}
89extern "C" {
90    pub fn de265_get_version_number_major() -> ::std::os::raw::c_int;
91}
92extern "C" {
93    pub fn de265_get_version_number_minor() -> ::std::os::raw::c_int;
94}
95extern "C" {
96    pub fn de265_get_version_number_maintenance() -> ::std::os::raw::c_int;
97}
98pub mod de265_error {
99    pub type Type = ::std::os::raw::c_uint;
100    pub const DE265_OK: Type = 0;
101    pub const DE265_ERROR_NO_SUCH_FILE: Type = 1;
102    pub const DE265_ERROR_COEFFICIENT_OUT_OF_IMAGE_BOUNDS: Type = 4;
103    pub const DE265_ERROR_CHECKSUM_MISMATCH: Type = 5;
104    pub const DE265_ERROR_CTB_OUTSIDE_IMAGE_AREA: Type = 6;
105    pub const DE265_ERROR_OUT_OF_MEMORY: Type = 7;
106    pub const DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE: Type = 8;
107    pub const DE265_ERROR_IMAGE_BUFFER_FULL: Type = 9;
108    pub const DE265_ERROR_CANNOT_START_THREADPOOL: Type = 10;
109    pub const DE265_ERROR_LIBRARY_INITIALIZATION_FAILED: Type = 11;
110    pub const DE265_ERROR_LIBRARY_NOT_INITIALIZED: Type = 12;
111    pub const DE265_ERROR_WAITING_FOR_INPUT_DATA: Type = 13;
112    pub const DE265_ERROR_CANNOT_PROCESS_SEI: Type = 14;
113    pub const DE265_ERROR_PARAMETER_PARSING: Type = 15;
114    pub const DE265_ERROR_NO_INITIAL_SLICE_HEADER: Type = 16;
115    pub const DE265_ERROR_PREMATURE_END_OF_SLICE: Type = 17;
116    pub const DE265_ERROR_UNSPECIFIED_DECODING_ERROR: Type = 18;
117    pub const DE265_ERROR_NOT_IMPLEMENTED_YET: Type = 502;
118    pub const DE265_WARNING_NO_WPP_CANNOT_USE_MULTITHREADING: Type = 1000;
119    pub const DE265_WARNING_WARNING_BUFFER_FULL: Type = 1001;
120    pub const DE265_WARNING_PREMATURE_END_OF_SLICE_SEGMENT: Type = 1002;
121    pub const DE265_WARNING_INCORRECT_ENTRY_POINT_OFFSET: Type = 1003;
122    pub const DE265_WARNING_CTB_OUTSIDE_IMAGE_AREA: Type = 1004;
123    pub const DE265_WARNING_SPS_HEADER_INVALID: Type = 1005;
124    pub const DE265_WARNING_PPS_HEADER_INVALID: Type = 1006;
125    pub const DE265_WARNING_SLICEHEADER_INVALID: Type = 1007;
126    pub const DE265_WARNING_INCORRECT_MOTION_VECTOR_SCALING: Type = 1008;
127    pub const DE265_WARNING_NONEXISTING_PPS_REFERENCED: Type = 1009;
128    pub const DE265_WARNING_NONEXISTING_SPS_REFERENCED: Type = 1010;
129    pub const DE265_WARNING_BOTH_PREDFLAGS_ZERO: Type = 1011;
130    pub const DE265_WARNING_NONEXISTING_REFERENCE_PICTURE_ACCESSED: Type = 1012;
131    pub const DE265_WARNING_NUMMVP_NOT_EQUAL_TO_NUMMVQ: Type = 1013;
132    pub const DE265_WARNING_NUMBER_OF_SHORT_TERM_REF_PIC_SETS_OUT_OF_RANGE: Type = 1014;
133    pub const DE265_WARNING_SHORT_TERM_REF_PIC_SET_OUT_OF_RANGE: Type = 1015;
134    pub const DE265_WARNING_FAULTY_REFERENCE_PICTURE_LIST: Type = 1016;
135    pub const DE265_WARNING_EOSS_BIT_NOT_SET: Type = 1017;
136    pub const DE265_WARNING_MAX_NUM_REF_PICS_EXCEEDED: Type = 1018;
137    pub const DE265_WARNING_INVALID_CHROMA_FORMAT: Type = 1019;
138    pub const DE265_WARNING_SLICE_SEGMENT_ADDRESS_INVALID: Type = 1020;
139    pub const DE265_WARNING_DEPENDENT_SLICE_WITH_ADDRESS_ZERO: Type = 1021;
140    pub const DE265_WARNING_NUMBER_OF_THREADS_LIMITED_TO_MAXIMUM: Type = 1022;
141    pub const DE265_NON_EXISTING_LT_REFERENCE_CANDIDATE_IN_SLICE_HEADER: Type = 1023;
142    pub const DE265_WARNING_CANNOT_APPLY_SAO_OUT_OF_MEMORY: Type = 1024;
143    pub const DE265_WARNING_SPS_MISSING_CANNOT_DECODE_SEI: Type = 1025;
144    pub const DE265_WARNING_COLLOCATED_MOTION_VECTOR_OUTSIDE_IMAGE_AREA: Type = 1026;
145    pub const DE265_WARNING_PCM_BITDEPTH_TOO_LARGE: Type = 1027;
146    pub const DE265_WARNING_REFERENCE_IMAGE_BIT_DEPTH_DOES_NOT_MATCH: Type = 1028;
147    pub const DE265_WARNING_REFERENCE_IMAGE_SIZE_DOES_NOT_MATCH_SPS: Type = 1029;
148    pub const DE265_WARNING_CHROMA_OF_CURRENT_IMAGE_DOES_NOT_MATCH_SPS: Type = 1030;
149    pub const DE265_WARNING_BIT_DEPTH_OF_CURRENT_IMAGE_DOES_NOT_MATCH_SPS: Type = 1031;
150    pub const DE265_WARNING_REFERENCE_IMAGE_CHROMA_FORMAT_DOES_NOT_MATCH: Type = 1032;
151    pub const DE265_WARNING_INVALID_SLICE_HEADER_INDEX_ACCESS: Type = 1033;
152}
153extern "C" {
154    pub fn de265_get_error_text(err: de265_error::Type) -> *const ::std::os::raw::c_char;
155}
156extern "C" {
157    pub fn de265_isOK(err: de265_error::Type) -> ::std::os::raw::c_int;
158}
159extern "C" {
160    pub fn de265_disable_logging();
161}
162extern "C" {
163    pub fn de265_set_verbosity(level: ::std::os::raw::c_int);
164}
165#[repr(C)]
166#[derive(Debug, Copy, Clone)]
167pub struct de265_image {
168    _unused: [u8; 0],
169}
170pub mod de265_chroma {
171    pub type Type = ::std::os::raw::c_uint;
172    pub const de265_chroma_mono: Type = 0;
173    pub const de265_chroma_420: Type = 1;
174    pub const de265_chroma_422: Type = 2;
175    pub const de265_chroma_444: Type = 3;
176}
177pub type de265_PTS = i64;
178extern "C" {
179    pub fn de265_get_image_width(
180        arg1: *const de265_image,
181        channel: ::std::os::raw::c_int,
182    ) -> ::std::os::raw::c_int;
183}
184extern "C" {
185    pub fn de265_get_image_height(
186        arg1: *const de265_image,
187        channel: ::std::os::raw::c_int,
188    ) -> ::std::os::raw::c_int;
189}
190extern "C" {
191    pub fn de265_get_chroma_format(arg1: *const de265_image) -> de265_chroma::Type;
192}
193extern "C" {
194    pub fn de265_get_bits_per_pixel(
195        arg1: *const de265_image,
196        channel: ::std::os::raw::c_int,
197    ) -> ::std::os::raw::c_int;
198}
199extern "C" {
200    pub fn de265_get_image_plane(
201        arg1: *const de265_image,
202        channel: ::std::os::raw::c_int,
203        out_stride: *mut ::std::os::raw::c_int,
204    ) -> *const u8;
205}
206extern "C" {
207    pub fn de265_get_image_plane_user_data(
208        arg1: *const de265_image,
209        channel: ::std::os::raw::c_int,
210    ) -> *mut ::std::os::raw::c_void;
211}
212extern "C" {
213    pub fn de265_get_image_PTS(arg1: *const de265_image) -> de265_PTS;
214}
215extern "C" {
216    pub fn de265_get_image_user_data(arg1: *const de265_image) -> *mut ::std::os::raw::c_void;
217}
218extern "C" {
219    pub fn de265_set_image_user_data(
220        arg1: *mut de265_image,
221        user_data: *mut ::std::os::raw::c_void,
222    );
223}
224extern "C" {
225    pub fn de265_get_image_NAL_header(
226        arg1: *const de265_image,
227        nal_unit_type: *mut ::std::os::raw::c_int,
228        nal_unit_name: *mut *const ::std::os::raw::c_char,
229        nuh_layer_id: *mut ::std::os::raw::c_int,
230        nuh_temporal_id: *mut ::std::os::raw::c_int,
231    );
232}
233extern "C" {
234    pub fn de265_get_image_full_range_flag(arg1: *const de265_image) -> ::std::os::raw::c_int;
235}
236extern "C" {
237    pub fn de265_get_image_colour_primaries(arg1: *const de265_image) -> ::std::os::raw::c_int;
238}
239extern "C" {
240    pub fn de265_get_image_transfer_characteristics(
241        arg1: *const de265_image,
242    ) -> ::std::os::raw::c_int;
243}
244extern "C" {
245    pub fn de265_get_image_matrix_coefficients(arg1: *const de265_image) -> ::std::os::raw::c_int;
246}
247pub type de265_decoder_context = ::std::os::raw::c_void;
248extern "C" {
249    pub fn de265_new_decoder() -> *mut de265_decoder_context;
250}
251extern "C" {
252    pub fn de265_start_worker_threads(
253        arg1: *mut de265_decoder_context,
254        number_of_threads: ::std::os::raw::c_int,
255    ) -> de265_error::Type;
256}
257extern "C" {
258    pub fn de265_free_decoder(arg1: *mut de265_decoder_context) -> de265_error::Type;
259}
260extern "C" {
261    pub fn de265_decode_data(
262        arg1: *mut de265_decoder_context,
263        data: *const ::std::os::raw::c_void,
264        length: ::std::os::raw::c_int,
265    ) -> de265_error::Type;
266}
267extern "C" {
268    pub fn de265_push_data(
269        arg1: *mut de265_decoder_context,
270        data: *const ::std::os::raw::c_void,
271        length: ::std::os::raw::c_int,
272        pts: de265_PTS,
273        user_data: *mut ::std::os::raw::c_void,
274    ) -> de265_error::Type;
275}
276extern "C" {
277    pub fn de265_push_end_of_NAL(arg1: *mut de265_decoder_context);
278}
279extern "C" {
280    pub fn de265_push_end_of_frame(arg1: *mut de265_decoder_context);
281}
282extern "C" {
283    pub fn de265_push_NAL(
284        arg1: *mut de265_decoder_context,
285        data: *const ::std::os::raw::c_void,
286        length: ::std::os::raw::c_int,
287        pts: de265_PTS,
288        user_data: *mut ::std::os::raw::c_void,
289    ) -> de265_error::Type;
290}
291extern "C" {
292    pub fn de265_flush_data(arg1: *mut de265_decoder_context) -> de265_error::Type;
293}
294extern "C" {
295    pub fn de265_get_number_of_input_bytes_pending(
296        arg1: *mut de265_decoder_context,
297    ) -> ::std::os::raw::c_int;
298}
299extern "C" {
300    pub fn de265_get_number_of_NAL_units_pending(
301        arg1: *mut de265_decoder_context,
302    ) -> ::std::os::raw::c_int;
303}
304extern "C" {
305    pub fn de265_decode(
306        arg1: *mut de265_decoder_context,
307        more: *mut ::std::os::raw::c_int,
308    ) -> de265_error::Type;
309}
310extern "C" {
311    pub fn de265_reset(arg1: *mut de265_decoder_context);
312}
313extern "C" {
314    pub fn de265_peek_next_picture(arg1: *mut de265_decoder_context) -> *const de265_image;
315}
316extern "C" {
317    pub fn de265_get_next_picture(arg1: *mut de265_decoder_context) -> *const de265_image;
318}
319extern "C" {
320    pub fn de265_release_next_picture(arg1: *mut de265_decoder_context);
321}
322extern "C" {
323    pub fn de265_get_warning(arg1: *mut de265_decoder_context) -> de265_error::Type;
324}
325pub mod de265_image_format {
326    pub type Type = ::std::os::raw::c_uint;
327    pub const de265_image_format_mono8: Type = 1;
328    pub const de265_image_format_YUV420P8: Type = 2;
329    pub const de265_image_format_YUV422P8: Type = 3;
330    pub const de265_image_format_YUV444P8: Type = 4;
331}
332#[repr(C)]
333#[derive(Debug, Copy, Clone)]
334pub struct de265_image_spec {
335    pub format: de265_image_format::Type,
336    pub width: ::std::os::raw::c_int,
337    pub height: ::std::os::raw::c_int,
338    pub alignment: ::std::os::raw::c_int,
339    pub crop_left: ::std::os::raw::c_int,
340    pub crop_right: ::std::os::raw::c_int,
341    pub crop_top: ::std::os::raw::c_int,
342    pub crop_bottom: ::std::os::raw::c_int,
343    pub visible_width: ::std::os::raw::c_int,
344    pub visible_height: ::std::os::raw::c_int,
345}
346#[repr(C)]
347#[derive(Debug, Copy, Clone)]
348pub struct de265_image_allocation {
349    pub get_buffer: ::std::option::Option<
350        unsafe extern "C" fn(
351            ctx: *mut de265_decoder_context,
352            spec: *mut de265_image_spec,
353            img: *mut de265_image,
354            userdata: *mut ::std::os::raw::c_void,
355        ) -> ::std::os::raw::c_int,
356    >,
357    pub release_buffer: ::std::option::Option<
358        unsafe extern "C" fn(
359            ctx: *mut de265_decoder_context,
360            img: *mut de265_image,
361            userdata: *mut ::std::os::raw::c_void,
362        ),
363    >,
364}
365extern "C" {
366    pub fn de265_set_image_allocation_functions(
367        arg1: *mut de265_decoder_context,
368        arg2: *mut de265_image_allocation,
369        userdata: *mut ::std::os::raw::c_void,
370    );
371}
372extern "C" {
373    pub fn de265_get_default_image_allocation_functions() -> *const de265_image_allocation;
374}
375extern "C" {
376    pub fn de265_set_image_plane(
377        img: *mut de265_image,
378        cIdx: ::std::os::raw::c_int,
379        mem: *mut ::std::os::raw::c_void,
380        stride: ::std::os::raw::c_int,
381        userdata: *mut ::std::os::raw::c_void,
382    );
383}
384extern "C" {
385    pub fn de265_get_highest_TID(arg1: *mut de265_decoder_context) -> ::std::os::raw::c_int;
386}
387extern "C" {
388    pub fn de265_get_current_TID(arg1: *mut de265_decoder_context) -> ::std::os::raw::c_int;
389}
390extern "C" {
391    pub fn de265_set_limit_TID(arg1: *mut de265_decoder_context, max_tid: ::std::os::raw::c_int);
392}
393extern "C" {
394    pub fn de265_set_framerate_ratio(
395        arg1: *mut de265_decoder_context,
396        percent: ::std::os::raw::c_int,
397    );
398}
399extern "C" {
400    pub fn de265_change_framerate(
401        arg1: *mut de265_decoder_context,
402        more_vs_less: ::std::os::raw::c_int,
403    ) -> ::std::os::raw::c_int;
404}
405pub mod de265_param {
406    pub type Type = ::std::os::raw::c_uint;
407    pub const DE265_DECODER_PARAM_BOOL_SEI_CHECK_HASH: Type = 0;
408    pub const DE265_DECODER_PARAM_DUMP_SPS_HEADERS: Type = 1;
409    pub const DE265_DECODER_PARAM_DUMP_VPS_HEADERS: Type = 2;
410    pub const DE265_DECODER_PARAM_DUMP_PPS_HEADERS: Type = 3;
411    pub const DE265_DECODER_PARAM_DUMP_SLICE_HEADERS: Type = 4;
412    pub const DE265_DECODER_PARAM_ACCELERATION_CODE: Type = 5;
413    pub const DE265_DECODER_PARAM_SUPPRESS_FAULTY_PICTURES: Type = 6;
414    pub const DE265_DECODER_PARAM_DISABLE_DEBLOCKING: Type = 7;
415    pub const DE265_DECODER_PARAM_DISABLE_SAO: Type = 8;
416}
417pub mod de265_acceleration {
418    pub type Type = ::std::os::raw::c_uint;
419    pub const de265_acceleration_SCALAR: Type = 0;
420    pub const de265_acceleration_MMX: Type = 10;
421    pub const de265_acceleration_SSE: Type = 20;
422    pub const de265_acceleration_SSE2: Type = 30;
423    pub const de265_acceleration_SSE4: Type = 40;
424    pub const de265_acceleration_AVX: Type = 50;
425    pub const de265_acceleration_AVX2: Type = 60;
426    pub const de265_acceleration_ARM: Type = 70;
427    pub const de265_acceleration_NEON: Type = 80;
428    pub const de265_acceleration_AUTO: Type = 10000;
429}
430extern "C" {
431    pub fn de265_set_parameter_bool(
432        arg1: *mut de265_decoder_context,
433        param: de265_param::Type,
434        value: ::std::os::raw::c_int,
435    );
436}
437extern "C" {
438    pub fn de265_set_parameter_int(
439        arg1: *mut de265_decoder_context,
440        param: de265_param::Type,
441        value: ::std::os::raw::c_int,
442    );
443}
444extern "C" {
445    pub fn de265_get_parameter_bool(
446        arg1: *mut de265_decoder_context,
447        param: de265_param::Type,
448    ) -> ::std::os::raw::c_int;
449}
450extern "C" {
451    pub fn de265_init() -> de265_error::Type;
452}
453extern "C" {
454    pub fn de265_free() -> de265_error::Type;
455}
456#[repr(C)]
457#[derive(Debug, Copy, Clone)]
458pub struct en265_encoder_context {
459    _unused: [u8; 0],
460}
461extern "C" {
462    pub fn en265_new_encoder() -> *mut en265_encoder_context;
463}
464extern "C" {
465    pub fn en265_free_encoder(arg1: *mut en265_encoder_context) -> de265_error::Type;
466}
467extern "C" {
468    pub fn en265_set_parameter_bool(
469        arg1: *mut en265_encoder_context,
470        parametername: *const ::std::os::raw::c_char,
471        value: ::std::os::raw::c_int,
472    ) -> de265_error::Type;
473}
474extern "C" {
475    pub fn en265_set_parameter_int(
476        arg1: *mut en265_encoder_context,
477        parametername: *const ::std::os::raw::c_char,
478        value: ::std::os::raw::c_int,
479    ) -> de265_error::Type;
480}
481extern "C" {
482    pub fn en265_set_parameter_string(
483        arg1: *mut en265_encoder_context,
484        parametername: *const ::std::os::raw::c_char,
485        value: *const ::std::os::raw::c_char,
486    ) -> de265_error::Type;
487}
488extern "C" {
489    pub fn en265_set_parameter_choice(
490        arg1: *mut en265_encoder_context,
491        parametername: *const ::std::os::raw::c_char,
492        value: *const ::std::os::raw::c_char,
493    ) -> de265_error::Type;
494}
495extern "C" {
496    pub fn en265_list_parameters(
497        arg1: *mut en265_encoder_context,
498    ) -> *mut *const ::std::os::raw::c_char;
499}
500pub mod en265_parameter_type {
501    pub type Type = ::std::os::raw::c_uint;
502    pub const en265_parameter_bool: Type = 0;
503    pub const en265_parameter_int: Type = 1;
504    pub const en265_parameter_string: Type = 2;
505    pub const en265_parameter_choice: Type = 3;
506}
507extern "C" {
508    pub fn en265_get_parameter_type(
509        arg1: *mut en265_encoder_context,
510        parametername: *const ::std::os::raw::c_char,
511    ) -> en265_parameter_type::Type;
512}
513extern "C" {
514    pub fn en265_list_parameter_choices(
515        arg1: *mut en265_encoder_context,
516        parametername: *const ::std::os::raw::c_char,
517    ) -> *mut *const ::std::os::raw::c_char;
518}
519extern "C" {
520    pub fn en265_parse_command_line_parameters(
521        arg1: *mut en265_encoder_context,
522        argc: *mut ::std::os::raw::c_int,
523        argv: *mut *mut ::std::os::raw::c_char,
524    ) -> de265_error::Type;
525}
526extern "C" {
527    pub fn en265_show_parameters(arg1: *mut en265_encoder_context);
528}
529extern "C" {
530    pub fn en265_start_encoder(
531        arg1: *mut en265_encoder_context,
532        number_of_threads: ::std::os::raw::c_int,
533    ) -> de265_error::Type;
534}
535extern "C" {
536    pub fn en265_allocate_image(
537        arg1: *mut en265_encoder_context,
538        width: ::std::os::raw::c_int,
539        height: ::std::os::raw::c_int,
540        chroma: de265_chroma::Type,
541        pts: de265_PTS,
542        image_userdata: *mut ::std::os::raw::c_void,
543    ) -> *mut de265_image;
544}
545extern "C" {
546    pub fn de265_alloc_image_plane(
547        img: *mut de265_image,
548        cIdx: ::std::os::raw::c_int,
549        inputdata: *mut ::std::os::raw::c_void,
550        inputstride: ::std::os::raw::c_int,
551        userdata: *mut ::std::os::raw::c_void,
552    ) -> *mut ::std::os::raw::c_void;
553}
554extern "C" {
555    pub fn de265_free_image_plane(img: *mut de265_image, cIdx: ::std::os::raw::c_int);
556}
557extern "C" {
558    pub fn en265_get_image_spec(
559        arg1: *mut en265_encoder_context,
560        width: ::std::os::raw::c_int,
561        height: ::std::os::raw::c_int,
562        chroma: de265_chroma::Type,
563        out_spec: *mut de265_image_spec,
564    );
565}
566extern "C" {
567    pub fn en265_push_image(
568        arg1: *mut en265_encoder_context,
569        arg2: *mut de265_image,
570    ) -> de265_error::Type;
571}
572extern "C" {
573    pub fn en265_push_eof(arg1: *mut en265_encoder_context) -> de265_error::Type;
574}
575extern "C" {
576    pub fn en265_block_on_input_queue_length(
577        arg1: *mut en265_encoder_context,
578        max_pending_images: ::std::os::raw::c_int,
579        timeout_ms: ::std::os::raw::c_int,
580    ) -> de265_error::Type;
581}
582extern "C" {
583    pub fn en265_trim_input_queue(
584        arg1: *mut en265_encoder_context,
585        max_pending_images: ::std::os::raw::c_int,
586    ) -> de265_error::Type;
587}
588extern "C" {
589    pub fn en265_current_input_queue_length(
590        arg1: *mut en265_encoder_context,
591    ) -> ::std::os::raw::c_int;
592}
593extern "C" {
594    pub fn en265_encode(arg1: *mut en265_encoder_context) -> de265_error::Type;
595}
596pub mod en265_encoder_state {
597    pub type Type = ::std::os::raw::c_uint;
598    pub const EN265_STATE_IDLE: Type = 0;
599    pub const EN265_STATE_WAITING_FOR_INPUT: Type = 1;
600    pub const EN265_STATE_WORKING: Type = 2;
601    pub const EN265_STATE_OUTPUT_QUEUE_FULL: Type = 3;
602    pub const EN265_STATE_EOS: Type = 4;
603}
604extern "C" {
605    pub fn en265_get_encoder_state(arg1: *mut en265_encoder_context) -> en265_encoder_state::Type;
606}
607pub mod en265_packet_content_type {
608    pub type Type = ::std::os::raw::c_uint;
609    pub const EN265_PACKET_VPS: Type = 0;
610    pub const EN265_PACKET_SPS: Type = 1;
611    pub const EN265_PACKET_PPS: Type = 2;
612    pub const EN265_PACKET_SEI: Type = 3;
613    pub const EN265_PACKET_SLICE: Type = 4;
614    pub const EN265_PACKET_SKIPPED_IMAGE: Type = 5;
615}
616pub mod en265_nal_unit_type {
617    pub type Type = ::std::os::raw::c_uint;
618    pub const EN265_NUT_TRAIL_N: Type = 0;
619    pub const EN265_NUT_TRAIL_R: Type = 1;
620    pub const EN265_NUT_TSA_N: Type = 2;
621    pub const EN265_NUT_TSA_R: Type = 3;
622    pub const EN265_NUT_STSA_N: Type = 4;
623    pub const EN265_NUT_STSA_R: Type = 5;
624    pub const EN265_NUT_RADL_N: Type = 6;
625    pub const EN265_NUT_RADL_R: Type = 7;
626    pub const EN265_NUT_RASL_N: Type = 8;
627    pub const EN265_NUT_RASL_R: Type = 9;
628    pub const EN265_NUT_BLA_W_LP: Type = 16;
629    pub const EN265_NUT_BLA_W_RADL: Type = 17;
630    pub const EN265_NUT_BLA_N_LP: Type = 18;
631    pub const EN265_NUT_IDR_W_RADL: Type = 19;
632    pub const EN265_NUT_IDR_N_LP: Type = 20;
633    pub const EN265_NUT_CRA: Type = 21;
634    pub const EN265_NUT_VPS: Type = 32;
635    pub const EN265_NUT_SPS: Type = 33;
636    pub const EN265_NUT_PPS: Type = 34;
637    pub const EN265_NUT_AUD: Type = 35;
638    pub const EN265_NUT_EOS: Type = 36;
639    pub const EN265_NUT_EOB: Type = 37;
640    pub const EN265_NUT_FD: Type = 38;
641    pub const EN265_NUT_PREFIX_SEI: Type = 39;
642    pub const EN265_NUT_SUFFIX_SEI: Type = 40;
643}
644#[repr(C)]
645#[derive(Debug, Copy, Clone)]
646pub struct en265_packet {
647    pub version: ::std::os::raw::c_int,
648    pub data: *const u8,
649    pub length: ::std::os::raw::c_int,
650    pub frame_number: ::std::os::raw::c_int,
651    pub content_type: en265_packet_content_type::Type,
652    pub _bitfield_align_1: [u8; 0],
653    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
654    pub nal_unit_type: en265_nal_unit_type::Type,
655    pub nuh_layer_id: ::std::os::raw::c_uchar,
656    pub nuh_temporal_id: ::std::os::raw::c_uchar,
657    pub encoder_context: *mut en265_encoder_context,
658    pub input_image: *const de265_image,
659    pub reconstruction: *const de265_image,
660}
661impl en265_packet {
662    #[inline]
663    pub fn complete_picture(&self) -> ::std::os::raw::c_char {
664        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
665    }
666    #[inline]
667    pub fn set_complete_picture(&mut self, val: ::std::os::raw::c_char) {
668        unsafe {
669            let val: u8 = ::std::mem::transmute(val);
670            self._bitfield_1.set(0usize, 1u8, val as u64)
671        }
672    }
673    #[inline]
674    pub fn final_slice(&self) -> ::std::os::raw::c_char {
675        unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
676    }
677    #[inline]
678    pub fn set_final_slice(&mut self, val: ::std::os::raw::c_char) {
679        unsafe {
680            let val: u8 = ::std::mem::transmute(val);
681            self._bitfield_1.set(1usize, 1u8, val as u64)
682        }
683    }
684    #[inline]
685    pub fn dependent_slice(&self) -> ::std::os::raw::c_char {
686        unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
687    }
688    #[inline]
689    pub fn set_dependent_slice(&mut self, val: ::std::os::raw::c_char) {
690        unsafe {
691            let val: u8 = ::std::mem::transmute(val);
692            self._bitfield_1.set(2usize, 1u8, val as u64)
693        }
694    }
695    #[inline]
696    pub fn new_bitfield_1(
697        complete_picture: ::std::os::raw::c_char,
698        final_slice: ::std::os::raw::c_char,
699        dependent_slice: ::std::os::raw::c_char,
700    ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
701        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
702        __bindgen_bitfield_unit.set(0usize, 1u8, {
703            let complete_picture: u8 = unsafe { ::std::mem::transmute(complete_picture) };
704            complete_picture as u64
705        });
706        __bindgen_bitfield_unit.set(1usize, 1u8, {
707            let final_slice: u8 = unsafe { ::std::mem::transmute(final_slice) };
708            final_slice as u64
709        });
710        __bindgen_bitfield_unit.set(2usize, 1u8, {
711            let dependent_slice: u8 = unsafe { ::std::mem::transmute(dependent_slice) };
712            dependent_slice as u64
713        });
714        __bindgen_bitfield_unit
715    }
716}
717extern "C" {
718    pub fn en265_get_packet(
719        arg1: *mut en265_encoder_context,
720        timeout_ms: ::std::os::raw::c_int,
721    ) -> *mut en265_packet;
722}
723extern "C" {
724    pub fn en265_free_packet(arg1: *mut en265_encoder_context, arg2: *mut en265_packet);
725}
726extern "C" {
727    pub fn en265_number_of_queued_packets(
728        arg1: *mut en265_encoder_context,
729    ) -> ::std::os::raw::c_int;
730}