1 /* automatically generated by tools/bindgen-all-the-things */ 2 3 #![allow(clippy::missing_safety_doc)] 4 #![allow(clippy::undocumented_unsafe_blocks)] 5 #![allow(clippy::upper_case_acronyms)] 6 #![allow(non_upper_case_globals)] 7 #![allow(non_camel_case_types)] 8 #![allow(non_snake_case)] 9 #![allow(dead_code)] 10 11 pub use crate::bindings::*; 12 13 pub const vda_impl_type_FAKE: vda_impl_type = 0; 14 pub const vda_impl_type_GAVDA: vda_impl_type = 1; 15 pub const vda_impl_type_GAVD: vda_impl_type = 2; 16 pub type vda_impl_type = ::std::os::raw::c_uint; 17 pub use self::vda_impl_type as vda_impl_type_t; 18 pub const vda_result_SUCCESS: vda_result = 0; 19 pub const vda_result_ILLEGAL_STATE: vda_result = 1; 20 pub const vda_result_INVALID_ARGUMENT: vda_result = 2; 21 pub const vda_result_UNREADABLE_INPUT: vda_result = 3; 22 pub const vda_result_PLATFORM_FAILURE: vda_result = 4; 23 pub const vda_result_INSUFFICIENT_RESOURCES: vda_result = 5; 24 pub const vda_result_CANCELLED: vda_result = 6; 25 pub type vda_result = ::std::os::raw::c_uint; 26 pub use self::vda_result as vda_result_t; 27 pub use self::video_codec_profile_t as vda_profile_t; 28 pub use self::video_pixel_format_t as vda_pixel_format_t; 29 pub const vda_event_type_UNKNOWN: vda_event_type = 0; 30 pub const vda_event_type_PROVIDE_PICTURE_BUFFERS: vda_event_type = 1; 31 pub const vda_event_type_PICTURE_READY: vda_event_type = 2; 32 pub const vda_event_type_NOTIFY_END_OF_BITSTREAM_BUFFER: vda_event_type = 3; 33 pub const vda_event_type_NOTIFY_ERROR: vda_event_type = 4; 34 pub const vda_event_type_RESET_RESPONSE: vda_event_type = 5; 35 pub const vda_event_type_FLUSH_RESPONSE: vda_event_type = 6; 36 pub type vda_event_type = ::std::os::raw::c_uint; 37 pub use self::vda_event_type as vda_event_type_t; 38 #[repr(C)] 39 #[derive(Debug, Default, Copy, Clone)] 40 pub struct provide_picture_buffers_event_data { 41 pub min_num_buffers: u32, 42 pub width: i32, 43 pub height: i32, 44 pub visible_rect_left: i32, 45 pub visible_rect_top: i32, 46 pub visible_rect_right: i32, 47 pub visible_rect_bottom: i32, 48 } 49 pub type provide_picture_buffers_event_data_t = provide_picture_buffers_event_data; 50 #[repr(C)] 51 #[derive(Debug, Default, Copy, Clone)] 52 pub struct picture_ready_event_data { 53 pub picture_buffer_id: i32, 54 pub bitstream_id: i32, 55 pub crop_left: i32, 56 pub crop_top: i32, 57 pub crop_right: i32, 58 pub crop_bottom: i32, 59 } 60 pub type picture_ready_event_data_t = picture_ready_event_data; 61 #[repr(C)] 62 #[derive(Copy, Clone)] 63 pub union vda_event_data { 64 pub provide_picture_buffers: provide_picture_buffers_event_data_t, 65 pub picture_ready: picture_ready_event_data_t, 66 pub bitstream_id: i32, 67 pub result: vda_result_t, 68 } 69 impl Default for vda_event_data { default() -> Self70 fn default() -> Self { 71 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 72 unsafe { 73 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 74 s.assume_init() 75 } 76 } 77 } 78 pub type vda_event_data_t = vda_event_data; 79 #[repr(C)] 80 pub struct vda_input_format { 81 pub profile: vda_profile_t, 82 pub min_width: u32, 83 pub min_height: u32, 84 pub max_width: u32, 85 pub max_height: u32, 86 } 87 impl Default for vda_input_format { 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 vda_input_format_t = vda_input_format; 97 #[repr(C)] 98 #[derive(Copy, Clone)] 99 pub struct vda_event { 100 pub event_type: vda_event_type_t, 101 pub event_data: vda_event_data_t, 102 } 103 impl Default for vda_event { default() -> Self104 fn default() -> Self { 105 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 106 unsafe { 107 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 108 s.assume_init() 109 } 110 } 111 } 112 pub type vda_event_t = vda_event; 113 #[repr(C)] 114 #[derive(Debug, Copy, Clone)] 115 pub struct vda_capabilities { 116 pub num_input_formats: usize, 117 pub input_formats: *const vda_input_format_t, 118 pub num_output_formats: usize, 119 pub output_formats: *const vda_pixel_format_t, 120 } 121 impl Default for vda_capabilities { default() -> Self122 fn default() -> Self { 123 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 124 unsafe { 125 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 126 s.assume_init() 127 } 128 } 129 } 130 pub type vda_capabilities_t = vda_capabilities; 131 #[repr(C)] 132 #[derive(Debug, Copy, Clone)] 133 pub struct vda_session_info { 134 pub ctx: *mut ::std::os::raw::c_void, 135 pub event_pipe_fd: ::std::os::raw::c_int, 136 } 137 impl Default for vda_session_info { default() -> Self138 fn default() -> Self { 139 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 140 unsafe { 141 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 142 s.assume_init() 143 } 144 } 145 } 146 pub type vda_session_info_t = vda_session_info; 147 extern "C" { initialize(impl_type: vda_impl_type_t) -> *mut ::std::os::raw::c_void148 pub fn initialize(impl_type: vda_impl_type_t) -> *mut ::std::os::raw::c_void; 149 } 150 extern "C" { deinitialize(impl_: *mut ::std::os::raw::c_void)151 pub fn deinitialize(impl_: *mut ::std::os::raw::c_void); 152 } 153 extern "C" { get_vda_capabilities(impl_: *mut ::std::os::raw::c_void) -> *const vda_capabilities_t154 pub fn get_vda_capabilities(impl_: *mut ::std::os::raw::c_void) -> *const vda_capabilities_t; 155 } 156 extern "C" { init_decode_session( impl_: *mut ::std::os::raw::c_void, profile: vda_profile_t, ) -> *mut vda_session_info_t157 pub fn init_decode_session( 158 impl_: *mut ::std::os::raw::c_void, 159 profile: vda_profile_t, 160 ) -> *mut vda_session_info_t; 161 } 162 extern "C" { close_decode_session( impl_: *mut ::std::os::raw::c_void, session_info: *mut vda_session_info_t, )163 pub fn close_decode_session( 164 impl_: *mut ::std::os::raw::c_void, 165 session_info: *mut vda_session_info_t, 166 ); 167 } 168 extern "C" { vda_decode( ctx: *mut ::std::os::raw::c_void, bitstream_id: i32, fd: ::std::os::raw::c_int, offset: u32, bytes_used: u32, ) -> vda_result_t169 pub fn vda_decode( 170 ctx: *mut ::std::os::raw::c_void, 171 bitstream_id: i32, 172 fd: ::std::os::raw::c_int, 173 offset: u32, 174 bytes_used: u32, 175 ) -> vda_result_t; 176 } 177 extern "C" { vda_set_output_buffer_count( ctx: *mut ::std::os::raw::c_void, num_output_buffers: usize, ) -> vda_result_t178 pub fn vda_set_output_buffer_count( 179 ctx: *mut ::std::os::raw::c_void, 180 num_output_buffers: usize, 181 ) -> vda_result_t; 182 } 183 extern "C" { vda_use_output_buffer( ctx: *mut ::std::os::raw::c_void, picture_buffer_id: i32, format: vda_pixel_format_t, fd: ::std::os::raw::c_int, num_planes: usize, planes: *mut video_frame_plane_t, modifier: u64, ) -> vda_result_t184 pub fn vda_use_output_buffer( 185 ctx: *mut ::std::os::raw::c_void, 186 picture_buffer_id: i32, 187 format: vda_pixel_format_t, 188 fd: ::std::os::raw::c_int, 189 num_planes: usize, 190 planes: *mut video_frame_plane_t, 191 modifier: u64, 192 ) -> vda_result_t; 193 } 194 extern "C" { vda_reuse_output_buffer( ctx: *mut ::std::os::raw::c_void, picture_buffer_id: i32, ) -> vda_result_t195 pub fn vda_reuse_output_buffer( 196 ctx: *mut ::std::os::raw::c_void, 197 picture_buffer_id: i32, 198 ) -> vda_result_t; 199 } 200 extern "C" { vda_flush(ctx: *mut ::std::os::raw::c_void) -> vda_result_t201 pub fn vda_flush(ctx: *mut ::std::os::raw::c_void) -> vda_result_t; 202 } 203 extern "C" { vda_reset(ctx: *mut ::std::os::raw::c_void) -> vda_result_t204 pub fn vda_reset(ctx: *mut ::std::os::raw::c_void) -> vda_result_t; 205 } 206