1#[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 fn extract_bit(byte: u8, index: usize) -> bool {
20 let bit_index = if cfg!(target_endian = "big") {
21 7 - (index % 8)
22 } else {
23 index % 8
24 };
25 let mask = 1 << bit_index;
26 byte & mask == mask
27 }
28 #[inline]
29 pub fn get_bit(&self, index: usize) -> bool {
30 debug_assert!(index / 8 < self.storage.as_ref().len());
31 let byte_index = index / 8;
32 let byte = self.storage.as_ref()[byte_index];
33 Self::extract_bit(byte, index)
34 }
35 #[inline]
36 pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
37 debug_assert!(index / 8 < core::mem::size_of::<Storage>());
38 let byte_index = index / 8;
39 let byte = unsafe {
40 *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
41 };
42 Self::extract_bit(byte, index)
43 }
44 #[inline]
45 fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
46 let bit_index = if cfg!(target_endian = "big") {
47 7 - (index % 8)
48 } else {
49 index % 8
50 };
51 let mask = 1 << bit_index;
52 if val { byte | mask } else { byte & !mask }
53 }
54 #[inline]
55 pub fn set_bit(&mut self, index: usize, val: bool) {
56 debug_assert!(index / 8 < self.storage.as_ref().len());
57 let byte_index = index / 8;
58 let byte = &mut self.storage.as_mut()[byte_index];
59 *byte = Self::change_bit(*byte, index, val);
60 }
61 #[inline]
62 pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
63 debug_assert!(index / 8 < core::mem::size_of::<Storage>());
64 let byte_index = index / 8;
65 let byte = unsafe {
66 (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
67 };
68 unsafe { *byte = Self::change_bit(*byte, index, val) };
69 }
70 #[inline]
71 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
72 debug_assert!(bit_width <= 64);
73 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
74 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),);
75 let mut val = 0;
76 for i in 0..(bit_width as usize) {
77 if self.get_bit(i + bit_offset) {
78 let index = if cfg!(target_endian = "big") {
79 bit_width as usize - 1 - i
80 } else {
81 i
82 };
83 val |= 1 << index;
84 }
85 }
86 val
87 }
88 #[inline]
89 pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
90 debug_assert!(bit_width <= 64);
91 debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
92 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),);
93 let mut val = 0;
94 for i in 0..(bit_width as usize) {
95 if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
96 let index = if cfg!(target_endian = "big") {
97 bit_width as usize - 1 - i
98 } else {
99 i
100 };
101 val |= 1 << index;
102 }
103 }
104 val
105 }
106 #[inline]
107 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
108 debug_assert!(bit_width <= 64);
109 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
110 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),);
111 for i in 0..(bit_width as usize) {
112 let mask = 1 << i;
113 let val_bit_is_set = val & mask == mask;
114 let index = if cfg!(target_endian = "big") {
115 bit_width as usize - 1 - i
116 } else {
117 i
118 };
119 self.set_bit(index + bit_offset, val_bit_is_set);
120 }
121 }
122 #[inline]
123 pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
124 debug_assert!(bit_width <= 64);
125 debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
126 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>(),);
127 for i in 0..(bit_width as usize) {
128 let mask = 1 << i;
129 let val_bit_is_set = val & mask == mask;
130 let index = if cfg!(target_endian = "big") {
131 bit_width as usize - 1 - i
132 } else {
133 i
134 };
135 unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
136 }
137 }
138}
139pub const LIBDE265_NUMERIC_VERSION: u32 = 16782848;
140pub const LIBDE265_VERSION: &::std::ffi::CStr = c"1.0.16";
141unsafe extern "C" {
142 pub fn de265_get_version() -> *const ::std::os::raw::c_char;
144}
145unsafe extern "C" {
146 pub fn de265_get_version_number() -> u32;
150}
151unsafe extern "C" {
152 pub fn de265_get_version_number_major() -> ::std::os::raw::c_int;
153}
154unsafe extern "C" {
155 pub fn de265_get_version_number_minor() -> ::std::os::raw::c_int;
156}
157unsafe extern "C" {
158 pub fn de265_get_version_number_maintenance() -> ::std::os::raw::c_int;
159}
160pub mod de265_error {
161 pub type Type = ::std::os::raw::c_uint;
162 pub const DE265_OK: Type = 0;
163 pub const DE265_ERROR_NO_SUCH_FILE: Type = 1;
164 pub const DE265_ERROR_COEFFICIENT_OUT_OF_IMAGE_BOUNDS: Type = 4;
165 pub const DE265_ERROR_CHECKSUM_MISMATCH: Type = 5;
166 pub const DE265_ERROR_CTB_OUTSIDE_IMAGE_AREA: Type = 6;
167 pub const DE265_ERROR_OUT_OF_MEMORY: Type = 7;
168 pub const DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE: Type = 8;
169 pub const DE265_ERROR_IMAGE_BUFFER_FULL: Type = 9;
170 pub const DE265_ERROR_CANNOT_START_THREADPOOL: Type = 10;
171 pub const DE265_ERROR_LIBRARY_INITIALIZATION_FAILED: Type = 11;
172 pub const DE265_ERROR_LIBRARY_NOT_INITIALIZED: Type = 12;
173 pub const DE265_ERROR_WAITING_FOR_INPUT_DATA: Type = 13;
174 pub const DE265_ERROR_CANNOT_PROCESS_SEI: Type = 14;
175 pub const DE265_ERROR_PARAMETER_PARSING: Type = 15;
176 pub const DE265_ERROR_NO_INITIAL_SLICE_HEADER: Type = 16;
177 pub const DE265_ERROR_PREMATURE_END_OF_SLICE: Type = 17;
178 pub const DE265_ERROR_UNSPECIFIED_DECODING_ERROR: Type = 18;
179 pub const DE265_ERROR_NOT_IMPLEMENTED_YET: Type = 502;
180 pub const DE265_WARNING_NO_WPP_CANNOT_USE_MULTITHREADING: Type = 1000;
181 pub const DE265_WARNING_WARNING_BUFFER_FULL: Type = 1001;
182 pub const DE265_WARNING_PREMATURE_END_OF_SLICE_SEGMENT: Type = 1002;
183 pub const DE265_WARNING_INCORRECT_ENTRY_POINT_OFFSET: Type = 1003;
184 pub const DE265_WARNING_CTB_OUTSIDE_IMAGE_AREA: Type = 1004;
185 pub const DE265_WARNING_SPS_HEADER_INVALID: Type = 1005;
186 pub const DE265_WARNING_PPS_HEADER_INVALID: Type = 1006;
187 pub const DE265_WARNING_SLICEHEADER_INVALID: Type = 1007;
188 pub const DE265_WARNING_INCORRECT_MOTION_VECTOR_SCALING: Type = 1008;
189 pub const DE265_WARNING_NONEXISTING_PPS_REFERENCED: Type = 1009;
190 pub const DE265_WARNING_NONEXISTING_SPS_REFERENCED: Type = 1010;
191 pub const DE265_WARNING_BOTH_PREDFLAGS_ZERO: Type = 1011;
192 pub const DE265_WARNING_NONEXISTING_REFERENCE_PICTURE_ACCESSED: Type = 1012;
193 pub const DE265_WARNING_NUMMVP_NOT_EQUAL_TO_NUMMVQ: Type = 1013;
194 pub const DE265_WARNING_NUMBER_OF_SHORT_TERM_REF_PIC_SETS_OUT_OF_RANGE: Type = 1014;
195 pub const DE265_WARNING_SHORT_TERM_REF_PIC_SET_OUT_OF_RANGE: Type = 1015;
196 pub const DE265_WARNING_FAULTY_REFERENCE_PICTURE_LIST: Type = 1016;
197 pub const DE265_WARNING_EOSS_BIT_NOT_SET: Type = 1017;
198 pub const DE265_WARNING_MAX_NUM_REF_PICS_EXCEEDED: Type = 1018;
199 pub const DE265_WARNING_INVALID_CHROMA_FORMAT: Type = 1019;
200 pub const DE265_WARNING_SLICE_SEGMENT_ADDRESS_INVALID: Type = 1020;
201 pub const DE265_WARNING_DEPENDENT_SLICE_WITH_ADDRESS_ZERO: Type = 1021;
202 pub const DE265_WARNING_NUMBER_OF_THREADS_LIMITED_TO_MAXIMUM: Type = 1022;
203 pub const DE265_NON_EXISTING_LT_REFERENCE_CANDIDATE_IN_SLICE_HEADER: Type = 1023;
204 pub const DE265_WARNING_CANNOT_APPLY_SAO_OUT_OF_MEMORY: Type = 1024;
205 pub const DE265_WARNING_SPS_MISSING_CANNOT_DECODE_SEI: Type = 1025;
206 pub const DE265_WARNING_COLLOCATED_MOTION_VECTOR_OUTSIDE_IMAGE_AREA: Type = 1026;
207 pub const DE265_WARNING_PCM_BITDEPTH_TOO_LARGE: Type = 1027;
208 pub const DE265_WARNING_REFERENCE_IMAGE_BIT_DEPTH_DOES_NOT_MATCH: Type = 1028;
209 pub const DE265_WARNING_REFERENCE_IMAGE_SIZE_DOES_NOT_MATCH_SPS: Type = 1029;
210 pub const DE265_WARNING_CHROMA_OF_CURRENT_IMAGE_DOES_NOT_MATCH_SPS: Type = 1030;
211 pub const DE265_WARNING_BIT_DEPTH_OF_CURRENT_IMAGE_DOES_NOT_MATCH_SPS: Type = 1031;
212 pub const DE265_WARNING_REFERENCE_IMAGE_CHROMA_FORMAT_DOES_NOT_MATCH: Type = 1032;
213 pub const DE265_WARNING_INVALID_SLICE_HEADER_INDEX_ACCESS: Type = 1033;
214}
215unsafe extern "C" {
216 pub fn de265_get_error_text(err: de265_error::Type) -> *const ::std::os::raw::c_char;
217}
218unsafe extern "C" {
219 pub fn de265_isOK(err: de265_error::Type) -> ::std::os::raw::c_int;
221}
222unsafe extern "C" {
223 pub fn de265_disable_logging();
224}
225unsafe extern "C" {
226 pub fn de265_set_verbosity(level: ::std::os::raw::c_int);
227}
228#[repr(C)]
231#[derive(Debug)]
232pub struct de265_image {
233 _unused: [u8; 0],
234}
235pub mod de265_chroma {
236 pub type Type = ::std::os::raw::c_uint;
237 pub const de265_chroma_mono: Type = 0;
238 pub const de265_chroma_420: Type = 1;
239 pub const de265_chroma_422: Type = 2;
240 pub const de265_chroma_444: Type = 3;
241}
242pub type de265_PTS = i64;
243unsafe extern "C" {
244 pub fn de265_get_image_width(
245 arg1: *const de265_image,
246 channel: ::std::os::raw::c_int,
247 ) -> ::std::os::raw::c_int;
248}
249unsafe extern "C" {
250 pub fn de265_get_image_height(
251 arg1: *const de265_image,
252 channel: ::std::os::raw::c_int,
253 ) -> ::std::os::raw::c_int;
254}
255unsafe extern "C" {
256 pub fn de265_get_chroma_format(arg1: *const de265_image) -> de265_chroma::Type;
257}
258unsafe extern "C" {
259 pub fn de265_get_bits_per_pixel(
260 arg1: *const de265_image,
261 channel: ::std::os::raw::c_int,
262 ) -> ::std::os::raw::c_int;
263}
264unsafe extern "C" {
265 pub fn de265_get_image_plane(
267 arg1: *const de265_image,
268 channel: ::std::os::raw::c_int,
269 out_stride: *mut ::std::os::raw::c_int,
270 ) -> *const u8;
271}
272unsafe extern "C" {
273 pub fn de265_get_image_plane_user_data(
274 arg1: *const de265_image,
275 channel: ::std::os::raw::c_int,
276 ) -> *mut ::std::os::raw::c_void;
277}
278unsafe extern "C" {
279 pub fn de265_get_image_PTS(arg1: *const de265_image) -> de265_PTS;
280}
281unsafe extern "C" {
282 pub fn de265_get_image_user_data(arg1: *const de265_image) -> *mut ::std::os::raw::c_void;
283}
284unsafe extern "C" {
285 pub fn de265_set_image_user_data(
286 arg1: *mut de265_image,
287 user_data: *mut ::std::os::raw::c_void,
288 );
289}
290unsafe extern "C" {
291 pub fn de265_get_image_NAL_header(
294 arg1: *const de265_image,
295 nal_unit_type: *mut ::std::os::raw::c_int,
296 nal_unit_name: *mut *const ::std::os::raw::c_char,
297 nuh_layer_id: *mut ::std::os::raw::c_int,
298 nuh_temporal_id: *mut ::std::os::raw::c_int,
299 );
300}
301unsafe extern "C" {
302 pub fn de265_get_image_full_range_flag(arg1: *const de265_image) -> ::std::os::raw::c_int;
303}
304unsafe extern "C" {
305 pub fn de265_get_image_colour_primaries(arg1: *const de265_image) -> ::std::os::raw::c_int;
306}
307unsafe extern "C" {
308 pub fn de265_get_image_transfer_characteristics(
309 arg1: *const de265_image,
310 ) -> ::std::os::raw::c_int;
311}
312unsafe extern "C" {
313 pub fn de265_get_image_matrix_coefficients(arg1: *const de265_image) -> ::std::os::raw::c_int;
314}
315pub type de265_decoder_context = ::std::os::raw::c_void;
317unsafe extern "C" {
318 pub fn de265_new_decoder() -> *mut de265_decoder_context;
320}
321unsafe extern "C" {
322 pub fn de265_start_worker_threads(
325 arg1: *mut de265_decoder_context,
326 number_of_threads: ::std::os::raw::c_int,
327 ) -> de265_error::Type;
328}
329unsafe extern "C" {
330 pub fn de265_free_decoder(arg1: *mut de265_decoder_context) -> de265_error::Type;
332}
333unsafe extern "C" {
334 pub fn de265_decode_data(
346 arg1: *mut de265_decoder_context,
347 data: *const ::std::os::raw::c_void,
348 length: ::std::os::raw::c_int,
349 ) -> de265_error::Type;
350}
351unsafe extern "C" {
352 pub fn de265_push_data(
357 arg1: *mut de265_decoder_context,
358 data: *const ::std::os::raw::c_void,
359 length: ::std::os::raw::c_int,
360 pts: de265_PTS,
361 user_data: *mut ::std::os::raw::c_void,
362 ) -> de265_error::Type;
363}
364unsafe extern "C" {
365 pub fn de265_push_end_of_NAL(arg1: *mut de265_decoder_context);
368}
369unsafe extern "C" {
370 pub fn de265_push_end_of_frame(arg1: *mut de265_decoder_context);
374}
375unsafe extern "C" {
376 pub fn de265_push_NAL(
380 arg1: *mut de265_decoder_context,
381 data: *const ::std::os::raw::c_void,
382 length: ::std::os::raw::c_int,
383 pts: de265_PTS,
384 user_data: *mut ::std::os::raw::c_void,
385 ) -> de265_error::Type;
386}
387unsafe extern "C" {
388 pub fn de265_flush_data(arg1: *mut de265_decoder_context) -> de265_error::Type;
391}
392unsafe extern "C" {
393 pub fn de265_get_number_of_input_bytes_pending(
396 arg1: *mut de265_decoder_context,
397 ) -> ::std::os::raw::c_int;
398}
399unsafe extern "C" {
400 pub fn de265_get_number_of_NAL_units_pending(
403 arg1: *mut de265_decoder_context,
404 ) -> ::std::os::raw::c_int;
405}
406unsafe extern "C" {
407 pub fn de265_decode(
420 arg1: *mut de265_decoder_context,
421 more: *mut ::std::os::raw::c_int,
422 ) -> de265_error::Type;
423}
424unsafe extern "C" {
425 pub fn de265_reset(arg1: *mut de265_decoder_context);
427}
428unsafe extern "C" {
429 pub fn de265_peek_next_picture(arg1: *mut de265_decoder_context) -> *const de265_image;
433}
434unsafe extern "C" {
435 pub fn de265_get_next_picture(arg1: *mut de265_decoder_context) -> *const de265_image;
439}
440unsafe extern "C" {
441 pub fn de265_release_next_picture(arg1: *mut de265_decoder_context);
444}
445unsafe extern "C" {
446 pub fn de265_get_warning(arg1: *mut de265_decoder_context) -> de265_error::Type;
447}
448pub mod de265_image_format {
449 pub type Type = ::std::os::raw::c_uint;
450 pub const de265_image_format_mono8: Type = 1;
451 pub const de265_image_format_YUV420P8: Type = 2;
452 pub const de265_image_format_YUV422P8: Type = 3;
453 pub const de265_image_format_YUV444P8: Type = 4;
454}
455#[repr(C)]
456#[derive(Debug, Copy, Clone)]
457pub struct de265_image_spec {
458 pub format: de265_image_format::Type,
459 pub width: ::std::os::raw::c_int,
460 pub height: ::std::os::raw::c_int,
461 pub alignment: ::std::os::raw::c_int,
462 pub crop_left: ::std::os::raw::c_int,
464 pub crop_right: ::std::os::raw::c_int,
465 pub crop_top: ::std::os::raw::c_int,
466 pub crop_bottom: ::std::os::raw::c_int,
467 pub visible_width: ::std::os::raw::c_int,
469 pub visible_height: ::std::os::raw::c_int,
471}
472#[repr(C)]
473#[derive(Debug, Copy, Clone)]
474pub struct de265_image_allocation {
475 pub get_buffer: ::std::option::Option<
477 unsafe extern "C" fn(
478 ctx: *mut de265_decoder_context,
479 spec: *mut de265_image_spec,
480 img: *mut de265_image,
481 userdata: *mut ::std::os::raw::c_void,
482 ) -> ::std::os::raw::c_int,
483 >,
484 pub release_buffer: ::std::option::Option<
486 unsafe extern "C" fn(
487 ctx: *mut de265_decoder_context,
488 img: *mut de265_image,
489 userdata: *mut ::std::os::raw::c_void,
490 ),
491 >,
492}
493unsafe extern "C" {
494 pub fn de265_set_image_allocation_functions(
497 arg1: *mut de265_decoder_context,
498 arg2: *mut de265_image_allocation,
499 userdata: *mut ::std::os::raw::c_void,
500 );
501}
502unsafe extern "C" {
503 pub fn de265_get_default_image_allocation_functions() -> *const de265_image_allocation;
504}
505unsafe extern "C" {
506 pub fn de265_set_image_plane(
507 img: *mut de265_image,
508 cIdx: ::std::os::raw::c_int,
509 mem: *mut ::std::os::raw::c_void,
510 stride: ::std::os::raw::c_int,
511 userdata: *mut ::std::os::raw::c_void,
512 );
513}
514unsafe extern "C" {
515 pub fn de265_get_highest_TID(arg1: *mut de265_decoder_context) -> ::std::os::raw::c_int;
533}
534unsafe extern "C" {
535 pub fn de265_get_current_TID(arg1: *mut de265_decoder_context) -> ::std::os::raw::c_int;
536}
537unsafe extern "C" {
538 pub fn de265_set_limit_TID(arg1: *mut de265_decoder_context, max_tid: ::std::os::raw::c_int);
539}
540unsafe extern "C" {
541 pub fn de265_set_framerate_ratio(
542 arg1: *mut de265_decoder_context,
543 percent: ::std::os::raw::c_int,
544 );
545}
546unsafe extern "C" {
547 pub fn de265_change_framerate(
548 arg1: *mut de265_decoder_context,
549 more_vs_less: ::std::os::raw::c_int,
550 ) -> ::std::os::raw::c_int;
551}
552pub mod de265_param {
553 pub type Type = ::std::os::raw::c_uint;
555 pub const DE265_DECODER_PARAM_BOOL_SEI_CHECK_HASH: Type = 0;
557 pub const DE265_DECODER_PARAM_DUMP_SPS_HEADERS: Type = 1;
559 pub const DE265_DECODER_PARAM_DUMP_VPS_HEADERS: Type = 2;
560 pub const DE265_DECODER_PARAM_DUMP_PPS_HEADERS: Type = 3;
561 pub const DE265_DECODER_PARAM_DUMP_SLICE_HEADERS: Type = 4;
562 pub const DE265_DECODER_PARAM_ACCELERATION_CODE: Type = 5;
564 pub const DE265_DECODER_PARAM_SUPPRESS_FAULTY_PICTURES: Type = 6;
566 pub const DE265_DECODER_PARAM_DISABLE_DEBLOCKING: Type = 7;
568 pub const DE265_DECODER_PARAM_DISABLE_SAO: Type = 8;
570}
571pub mod de265_acceleration {
572 pub type Type = ::std::os::raw::c_uint;
574 pub const de265_acceleration_SCALAR: Type = 0;
576 pub const de265_acceleration_MMX: Type = 10;
577 pub const de265_acceleration_SSE: Type = 20;
578 pub const de265_acceleration_SSE2: Type = 30;
579 pub const de265_acceleration_SSE4: Type = 40;
580 pub const de265_acceleration_AVX: Type = 50;
582 pub const de265_acceleration_AVX2: Type = 60;
584 pub const de265_acceleration_ARM: Type = 70;
585 pub const de265_acceleration_NEON: Type = 80;
586 pub const de265_acceleration_AUTO: Type = 10000;
587}
588unsafe extern "C" {
589 pub fn de265_set_parameter_bool(
591 arg1: *mut de265_decoder_context,
592 param: de265_param::Type,
593 value: ::std::os::raw::c_int,
594 );
595}
596unsafe extern "C" {
597 pub fn de265_set_parameter_int(
598 arg1: *mut de265_decoder_context,
599 param: de265_param::Type,
600 value: ::std::os::raw::c_int,
601 );
602}
603unsafe extern "C" {
604 pub fn de265_get_parameter_bool(
606 arg1: *mut de265_decoder_context,
607 param: de265_param::Type,
608 ) -> ::std::os::raw::c_int;
609}
610unsafe extern "C" {
611 pub fn de265_init() -> de265_error::Type;
617}
618unsafe extern "C" {
619 pub fn de265_free() -> de265_error::Type;
624}
625#[repr(C)]
627#[derive(Debug, Copy, Clone)]
628pub struct en265_encoder_context {
629 _unused: [u8; 0],
630}
631unsafe extern "C" {
632 pub fn en265_new_encoder() -> *mut en265_encoder_context;
634}
635unsafe extern "C" {
636 pub fn en265_free_encoder(arg1: *mut en265_encoder_context) -> de265_error::Type;
638}
639unsafe extern "C" {
640 pub fn en265_set_parameter_bool(
642 arg1: *mut en265_encoder_context,
643 parametername: *const ::std::os::raw::c_char,
644 value: ::std::os::raw::c_int,
645 ) -> de265_error::Type;
646}
647unsafe extern "C" {
648 pub fn en265_set_parameter_int(
649 arg1: *mut en265_encoder_context,
650 parametername: *const ::std::os::raw::c_char,
651 value: ::std::os::raw::c_int,
652 ) -> de265_error::Type;
653}
654unsafe extern "C" {
655 pub fn en265_set_parameter_string(
656 arg1: *mut en265_encoder_context,
657 parametername: *const ::std::os::raw::c_char,
658 value: *const ::std::os::raw::c_char,
659 ) -> de265_error::Type;
660}
661unsafe extern "C" {
662 pub fn en265_set_parameter_choice(
663 arg1: *mut en265_encoder_context,
664 parametername: *const ::std::os::raw::c_char,
665 value: *const ::std::os::raw::c_char,
666 ) -> de265_error::Type;
667}
668unsafe extern "C" {
669 pub fn en265_list_parameters(
670 arg1: *mut en265_encoder_context,
671 ) -> *mut *const ::std::os::raw::c_char;
672}
673pub mod en265_parameter_type {
674 pub type Type = ::std::os::raw::c_uint;
675 pub const en265_parameter_bool: Type = 0;
676 pub const en265_parameter_int: Type = 1;
677 pub const en265_parameter_string: Type = 2;
678 pub const en265_parameter_choice: Type = 3;
679}
680unsafe extern "C" {
681 pub fn en265_get_parameter_type(
682 arg1: *mut en265_encoder_context,
683 parametername: *const ::std::os::raw::c_char,
684 ) -> en265_parameter_type::Type;
685}
686unsafe extern "C" {
687 pub fn en265_list_parameter_choices(
688 arg1: *mut en265_encoder_context,
689 parametername: *const ::std::os::raw::c_char,
690 ) -> *mut *const ::std::os::raw::c_char;
691}
692unsafe extern "C" {
693 pub fn en265_parse_command_line_parameters(
695 arg1: *mut en265_encoder_context,
696 argc: *mut ::std::os::raw::c_int,
697 argv: *mut *mut ::std::os::raw::c_char,
698 ) -> de265_error::Type;
699}
700unsafe extern "C" {
701 pub fn en265_show_parameters(arg1: *mut en265_encoder_context);
702}
703unsafe extern "C" {
704 pub fn en265_start_encoder(
706 arg1: *mut en265_encoder_context,
707 number_of_threads: ::std::os::raw::c_int,
708 ) -> de265_error::Type;
709}
710unsafe extern "C" {
711 pub fn en265_allocate_image(
713 arg1: *mut en265_encoder_context,
714 width: ::std::os::raw::c_int,
715 height: ::std::os::raw::c_int,
716 chroma: de265_chroma::Type,
717 pts: de265_PTS,
718 image_userdata: *mut ::std::os::raw::c_void,
719 ) -> *mut de265_image;
720}
721unsafe extern "C" {
722 pub fn de265_alloc_image_plane(
723 img: *mut de265_image,
724 cIdx: ::std::os::raw::c_int,
725 inputdata: *mut ::std::os::raw::c_void,
726 inputstride: ::std::os::raw::c_int,
727 userdata: *mut ::std::os::raw::c_void,
728 ) -> *mut ::std::os::raw::c_void;
729}
730unsafe extern "C" {
731 pub fn de265_free_image_plane(img: *mut de265_image, cIdx: ::std::os::raw::c_int);
732}
733unsafe extern "C" {
734 pub fn en265_get_image_spec(
736 arg1: *mut en265_encoder_context,
737 width: ::std::os::raw::c_int,
738 height: ::std::os::raw::c_int,
739 chroma: de265_chroma::Type,
740 out_spec: *mut de265_image_spec,
741 );
742}
743unsafe extern "C" {
744 pub fn en265_push_image(
749 arg1: *mut en265_encoder_context,
750 arg2: *mut de265_image,
751 ) -> de265_error::Type;
752}
753unsafe extern "C" {
754 pub fn en265_push_eof(arg1: *mut en265_encoder_context) -> de265_error::Type;
755}
756unsafe extern "C" {
757 pub fn en265_block_on_input_queue_length(
759 arg1: *mut en265_encoder_context,
760 max_pending_images: ::std::os::raw::c_int,
761 timeout_ms: ::std::os::raw::c_int,
762 ) -> de265_error::Type;
763}
764unsafe extern "C" {
765 pub fn en265_trim_input_queue(
766 arg1: *mut en265_encoder_context,
767 max_pending_images: ::std::os::raw::c_int,
768 ) -> de265_error::Type;
769}
770unsafe extern "C" {
771 pub fn en265_current_input_queue_length(
772 arg1: *mut en265_encoder_context,
773 ) -> ::std::os::raw::c_int;
774}
775unsafe extern "C" {
776 pub fn en265_encode(arg1: *mut en265_encoder_context) -> de265_error::Type;
778}
779pub mod en265_encoder_state {
780 pub type Type = ::std::os::raw::c_uint;
781 pub const EN265_STATE_IDLE: Type = 0;
782 pub const EN265_STATE_WAITING_FOR_INPUT: Type = 1;
783 pub const EN265_STATE_WORKING: Type = 2;
784 pub const EN265_STATE_OUTPUT_QUEUE_FULL: Type = 3;
785 pub const EN265_STATE_EOS: Type = 4;
786}
787unsafe extern "C" {
788 pub fn en265_get_encoder_state(arg1: *mut en265_encoder_context) -> en265_encoder_state::Type;
789}
790pub mod en265_packet_content_type {
791 pub type Type = ::std::os::raw::c_uint;
792 pub const EN265_PACKET_VPS: Type = 0;
793 pub const EN265_PACKET_SPS: Type = 1;
794 pub const EN265_PACKET_PPS: Type = 2;
795 pub const EN265_PACKET_SEI: Type = 3;
796 pub const EN265_PACKET_SLICE: Type = 4;
797 pub const EN265_PACKET_SKIPPED_IMAGE: Type = 5;
798}
799pub mod en265_nal_unit_type {
800 pub type Type = ::std::os::raw::c_uint;
801 pub const EN265_NUT_TRAIL_N: Type = 0;
802 pub const EN265_NUT_TRAIL_R: Type = 1;
803 pub const EN265_NUT_TSA_N: Type = 2;
804 pub const EN265_NUT_TSA_R: Type = 3;
805 pub const EN265_NUT_STSA_N: Type = 4;
806 pub const EN265_NUT_STSA_R: Type = 5;
807 pub const EN265_NUT_RADL_N: Type = 6;
808 pub const EN265_NUT_RADL_R: Type = 7;
809 pub const EN265_NUT_RASL_N: Type = 8;
810 pub const EN265_NUT_RASL_R: Type = 9;
811 pub const EN265_NUT_BLA_W_LP: Type = 16;
812 pub const EN265_NUT_BLA_W_RADL: Type = 17;
813 pub const EN265_NUT_BLA_N_LP: Type = 18;
814 pub const EN265_NUT_IDR_W_RADL: Type = 19;
815 pub const EN265_NUT_IDR_N_LP: Type = 20;
816 pub const EN265_NUT_CRA: Type = 21;
817 pub const EN265_NUT_VPS: Type = 32;
818 pub const EN265_NUT_SPS: Type = 33;
819 pub const EN265_NUT_PPS: Type = 34;
820 pub const EN265_NUT_AUD: Type = 35;
821 pub const EN265_NUT_EOS: Type = 36;
822 pub const EN265_NUT_EOB: Type = 37;
823 pub const EN265_NUT_FD: Type = 38;
824 pub const EN265_NUT_PREFIX_SEI: Type = 39;
825 pub const EN265_NUT_SUFFIX_SEI: Type = 40;
826}
827#[repr(C)]
828#[derive(Debug)]
829pub struct en265_packet {
830 pub version: ::std::os::raw::c_int,
831 pub data: *const u8,
832 pub length: ::std::os::raw::c_int,
833 pub frame_number: ::std::os::raw::c_int,
834 pub content_type: en265_packet_content_type::Type,
835 pub _bitfield_align_1: [u8; 0],
836 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
837 pub nal_unit_type: en265_nal_unit_type::Type,
838 pub nuh_layer_id: ::std::os::raw::c_uchar,
839 pub nuh_temporal_id: ::std::os::raw::c_uchar,
840 pub encoder_context: *mut en265_encoder_context,
841 pub input_image: *const de265_image,
842 pub reconstruction: *const de265_image,
843}
844impl en265_packet {
845 #[inline]
846 pub fn complete_picture(&self) -> ::std::os::raw::c_char {
847 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
848 }
849 #[inline]
850 pub fn set_complete_picture(&mut self, val: ::std::os::raw::c_char) {
851 unsafe {
852 let val: u8 = ::std::mem::transmute(val);
853 self._bitfield_1.set(0usize, 1u8, val as u64)
854 }
855 }
856 #[inline]
857 pub unsafe fn complete_picture_raw(this: *const Self) -> ::std::os::raw::c_char {
858 unsafe {
859 ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
860 ::std::ptr::addr_of!((*this)._bitfield_1),
861 0usize,
862 1u8,
863 ) as u8)
864 }
865 }
866 #[inline]
867 pub unsafe fn set_complete_picture_raw(this: *mut Self, val: ::std::os::raw::c_char) {
868 unsafe {
869 let val: u8 = ::std::mem::transmute(val);
870 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
871 ::std::ptr::addr_of_mut!((*this)._bitfield_1),
872 0usize,
873 1u8,
874 val as u64,
875 )
876 }
877 }
878 #[inline]
879 pub fn final_slice(&self) -> ::std::os::raw::c_char {
880 unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
881 }
882 #[inline]
883 pub fn set_final_slice(&mut self, val: ::std::os::raw::c_char) {
884 unsafe {
885 let val: u8 = ::std::mem::transmute(val);
886 self._bitfield_1.set(1usize, 1u8, val as u64)
887 }
888 }
889 #[inline]
890 pub unsafe fn final_slice_raw(this: *const Self) -> ::std::os::raw::c_char {
891 unsafe {
892 ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
893 ::std::ptr::addr_of!((*this)._bitfield_1),
894 1usize,
895 1u8,
896 ) as u8)
897 }
898 }
899 #[inline]
900 pub unsafe fn set_final_slice_raw(this: *mut Self, val: ::std::os::raw::c_char) {
901 unsafe {
902 let val: u8 = ::std::mem::transmute(val);
903 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
904 ::std::ptr::addr_of_mut!((*this)._bitfield_1),
905 1usize,
906 1u8,
907 val as u64,
908 )
909 }
910 }
911 #[inline]
912 pub fn dependent_slice(&self) -> ::std::os::raw::c_char {
913 unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
914 }
915 #[inline]
916 pub fn set_dependent_slice(&mut self, val: ::std::os::raw::c_char) {
917 unsafe {
918 let val: u8 = ::std::mem::transmute(val);
919 self._bitfield_1.set(2usize, 1u8, val as u64)
920 }
921 }
922 #[inline]
923 pub unsafe fn dependent_slice_raw(this: *const Self) -> ::std::os::raw::c_char {
924 unsafe {
925 ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
926 ::std::ptr::addr_of!((*this)._bitfield_1),
927 2usize,
928 1u8,
929 ) as u8)
930 }
931 }
932 #[inline]
933 pub unsafe fn set_dependent_slice_raw(this: *mut Self, val: ::std::os::raw::c_char) {
934 unsafe {
935 let val: u8 = ::std::mem::transmute(val);
936 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
937 ::std::ptr::addr_of_mut!((*this)._bitfield_1),
938 2usize,
939 1u8,
940 val as u64,
941 )
942 }
943 }
944 #[inline]
945 pub fn new_bitfield_1(
946 complete_picture: ::std::os::raw::c_char,
947 final_slice: ::std::os::raw::c_char,
948 dependent_slice: ::std::os::raw::c_char,
949 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
950 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
951 __bindgen_bitfield_unit.set(0usize, 1u8, {
952 let complete_picture: u8 = unsafe { ::std::mem::transmute(complete_picture) };
953 complete_picture as u64
954 });
955 __bindgen_bitfield_unit.set(1usize, 1u8, {
956 let final_slice: u8 = unsafe { ::std::mem::transmute(final_slice) };
957 final_slice as u64
958 });
959 __bindgen_bitfield_unit.set(2usize, 1u8, {
960 let dependent_slice: u8 = unsafe { ::std::mem::transmute(dependent_slice) };
961 dependent_slice as u64
962 });
963 __bindgen_bitfield_unit
964 }
965}
966unsafe extern "C" {
967 pub fn en265_get_packet(
969 arg1: *mut en265_encoder_context,
970 timeout_ms: ::std::os::raw::c_int,
971 ) -> *mut en265_packet;
972}
973unsafe extern "C" {
974 pub fn en265_free_packet(arg1: *mut en265_encoder_context, arg2: *mut en265_packet);
975}
976unsafe extern "C" {
977 pub fn en265_number_of_queued_packets(
978 arg1: *mut en265_encoder_context,
979 ) -> ::std::os::raw::c_int;
980}