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