1 /* automatically generated by tools/bindgen-all-the-things */ 2 3 #![allow(non_upper_case_globals)] 4 #![allow(non_camel_case_types)] 5 #![allow(non_snake_case)] 6 #![allow(dead_code)] 7 8 pub use crate::bindings::*; 9 10 pub type __uint8_t = ::std::os::raw::c_uchar; 11 pub type __int32_t = ::std::os::raw::c_int; 12 pub type __uint32_t = ::std::os::raw::c_uint; 13 pub type __int64_t = ::std::os::raw::c_long; 14 pub const vea_impl_type_VEA_FAKE: vea_impl_type = 0; 15 pub const vea_impl_type_GAVEA: vea_impl_type = 1; 16 pub type vea_impl_type = ::std::os::raw::c_uint; 17 pub use self::vea_impl_type as vea_impl_type_t; 18 #[repr(C)] 19 pub struct vea_profile { 20 pub profile: video_codec_profile_t, 21 pub max_width: u32, 22 pub max_height: u32, 23 pub max_framerate_numerator: u32, 24 pub max_framerate_denominator: u32, 25 } 26 impl Default for vea_profile { default() -> Self27 fn default() -> Self { 28 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 29 unsafe { 30 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 31 s.assume_init() 32 } 33 } 34 } 35 pub type vea_profile_t = vea_profile; 36 #[repr(C)] 37 #[derive(Debug, Copy, Clone)] 38 pub struct vea_capabilities { 39 pub num_input_formats: usize, 40 pub input_formats: *const video_pixel_format_t, 41 pub num_output_formats: usize, 42 pub output_formats: *const vea_profile_t, 43 } 44 impl Default for vea_capabilities { default() -> Self45 fn default() -> Self { 46 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 47 unsafe { 48 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 49 s.assume_init() 50 } 51 } 52 } 53 pub type vea_capabilities_t = vea_capabilities; 54 pub const vea_bitrate_mode_VBR: vea_bitrate_mode = 0; 55 pub const vea_bitrate_mode_CBR: vea_bitrate_mode = 1; 56 pub type vea_bitrate_mode = ::std::os::raw::c_uint; 57 pub use self::vea_bitrate_mode as vea_bitrate_mode_t; 58 #[repr(C)] 59 #[derive(Debug, Copy, Clone)] 60 pub struct vea_bitrate { 61 pub mode: vea_bitrate_mode_t, 62 pub target: u32, 63 pub peak: u32, 64 } 65 impl Default for vea_bitrate { default() -> Self66 fn default() -> Self { 67 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 68 unsafe { 69 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 70 s.assume_init() 71 } 72 } 73 } 74 pub type vea_bitrate_t = vea_bitrate; 75 #[repr(C)] 76 pub struct vea_config { 77 pub input_format: video_pixel_format_t, 78 pub input_visible_width: u32, 79 pub input_visible_height: u32, 80 pub output_profile: video_codec_profile_t, 81 pub bitrate: vea_bitrate_t, 82 pub initial_framerate: u32, 83 pub has_initial_framerate: u8, 84 pub h264_output_level: u8, 85 pub has_h264_output_level: u8, 86 } 87 impl Default for vea_config { default() -> Self88 fn default() -> Self { 89 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 90 unsafe { 91 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 92 s.assume_init() 93 } 94 } 95 } 96 pub type vea_config_t = vea_config; 97 pub const vea_error_ILLEGAL_STATE_ERROR: vea_error = 0; 98 pub const vea_error_INVALID_ARGUMENT_ERROR: vea_error = 1; 99 pub const vea_error_PLATFORM_FAILURE_ERROR: vea_error = 2; 100 pub type vea_error = ::std::os::raw::c_uint; 101 pub use self::vea_error as vea_error_t; 102 #[repr(C)] 103 #[derive(Debug, Copy, Clone)] 104 pub struct vea_session_info { 105 pub ctx: *mut ::std::os::raw::c_void, 106 pub event_pipe_fd: ::std::os::raw::c_int, 107 } 108 impl Default for vea_session_info { default() -> Self109 fn default() -> Self { 110 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 111 unsafe { 112 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 113 s.assume_init() 114 } 115 } 116 } 117 pub type vea_session_info_t = vea_session_info; 118 pub type vea_input_buffer_id_t = i32; 119 pub type vea_output_buffer_id_t = i32; 120 pub const vea_event_type_REQUIRE_INPUT_BUFFERS: vea_event_type = 0; 121 pub const vea_event_type_PROCESSED_INPUT_BUFFER: vea_event_type = 1; 122 pub const vea_event_type_PROCESSED_OUTPUT_BUFFER: vea_event_type = 2; 123 pub const vea_event_type_VEA_FLUSH_RESPONSE: vea_event_type = 3; 124 pub const vea_event_type_VEA_NOTIFY_ERROR: vea_event_type = 4; 125 pub type vea_event_type = ::std::os::raw::c_uint; 126 pub use self::vea_event_type as vea_event_type_t; 127 #[repr(C)] 128 #[derive(Debug, Default, Copy, Clone)] 129 pub struct vea_require_input_buffers_event_data { 130 pub input_count: u32, 131 pub input_frame_width: u32, 132 pub input_frame_height: u32, 133 pub output_buffer_size: u32, 134 } 135 pub type vea_require_input_buffers_event_data_t = vea_require_input_buffers_event_data; 136 #[repr(C)] 137 #[derive(Debug, Default, Copy, Clone)] 138 pub struct vea_processed_output_buffer_event_data { 139 pub output_buffer_id: vea_output_buffer_id_t, 140 pub payload_size: u32, 141 pub key_frame: u8, 142 pub timestamp: i64, 143 } 144 pub type vea_processed_output_buffer_event_data_t = vea_processed_output_buffer_event_data; 145 #[repr(C)] 146 #[derive(Copy, Clone)] 147 pub union vea_event_data { 148 pub require_input_buffers: vea_require_input_buffers_event_data_t, 149 pub processed_input_buffer_id: vea_input_buffer_id_t, 150 pub processed_output_buffer: vea_processed_output_buffer_event_data_t, 151 pub flush_done: u8, 152 pub error: vea_error_t, 153 } 154 impl Default for vea_event_data { default() -> Self155 fn default() -> Self { 156 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 157 unsafe { 158 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 159 s.assume_init() 160 } 161 } 162 } 163 pub type vea_event_data_t = vea_event_data; 164 #[repr(C)] 165 #[derive(Copy, Clone)] 166 pub struct vea_event { 167 pub event_type: vea_event_type_t, 168 pub event_data: vea_event_data_t, 169 } 170 impl Default for vea_event { default() -> Self171 fn default() -> Self { 172 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 173 unsafe { 174 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 175 s.assume_init() 176 } 177 } 178 } 179 pub type vea_event_t = vea_event; 180 extern "C" { initialize_encode(type_: vea_impl_type_t) -> *mut ::std::os::raw::c_void181 pub fn initialize_encode(type_: vea_impl_type_t) -> *mut ::std::os::raw::c_void; 182 } 183 extern "C" { deinitialize_encode(impl_: *mut ::std::os::raw::c_void)184 pub fn deinitialize_encode(impl_: *mut ::std::os::raw::c_void); 185 } 186 extern "C" { get_vea_capabilities(impl_: *mut ::std::os::raw::c_void) -> *const vea_capabilities_t187 pub fn get_vea_capabilities(impl_: *mut ::std::os::raw::c_void) -> *const vea_capabilities_t; 188 } 189 extern "C" { init_encode_session( impl_: *mut ::std::os::raw::c_void, config: *mut vea_config_t, ) -> *mut vea_session_info_t190 pub fn init_encode_session( 191 impl_: *mut ::std::os::raw::c_void, 192 config: *mut vea_config_t, 193 ) -> *mut vea_session_info_t; 194 } 195 extern "C" { close_encode_session( impl_: *mut ::std::os::raw::c_void, session_info: *mut vea_session_info_t, )196 pub fn close_encode_session( 197 impl_: *mut ::std::os::raw::c_void, 198 session_info: *mut vea_session_info_t, 199 ); 200 } 201 extern "C" { vea_encode( ctx: *mut ::std::os::raw::c_void, input_buffer_id: vea_input_buffer_id_t, fd: ::std::os::raw::c_int, num_planes: usize, planes: *mut video_frame_plane_t, timestamp: i64, force_keyframe: u8, ) -> ::std::os::raw::c_int202 pub fn vea_encode( 203 ctx: *mut ::std::os::raw::c_void, 204 input_buffer_id: vea_input_buffer_id_t, 205 fd: ::std::os::raw::c_int, 206 num_planes: usize, 207 planes: *mut video_frame_plane_t, 208 timestamp: i64, 209 force_keyframe: u8, 210 ) -> ::std::os::raw::c_int; 211 } 212 extern "C" { vea_use_output_buffer( ctx: *mut ::std::os::raw::c_void, output_buffer_id: vea_output_buffer_id_t, fd: ::std::os::raw::c_int, offset: u32, size: u32, ) -> ::std::os::raw::c_int213 pub fn vea_use_output_buffer( 214 ctx: *mut ::std::os::raw::c_void, 215 output_buffer_id: vea_output_buffer_id_t, 216 fd: ::std::os::raw::c_int, 217 offset: u32, 218 size: u32, 219 ) -> ::std::os::raw::c_int; 220 } 221 extern "C" { vea_request_encoding_params_change( ctx: *mut ::std::os::raw::c_void, bitrate: vea_bitrate_t, framerate: u32, ) -> ::std::os::raw::c_int222 pub fn vea_request_encoding_params_change( 223 ctx: *mut ::std::os::raw::c_void, 224 bitrate: vea_bitrate_t, 225 framerate: u32, 226 ) -> ::std::os::raw::c_int; 227 } 228 extern "C" { vea_flush(ctx: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int229 pub fn vea_flush(ctx: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; 230 } 231