blob: b790094214d1be0a1e5a0d33d186080ea57d3893 [file] [log] [blame]
/* automatically generated by tools/bindgen-all-the-things */
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
pub use crate::bindings::*;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub const vda_impl_type_FAKE: vda_impl_type = 0;
pub const vda_impl_type_GAVDA: vda_impl_type = 1;
pub const vda_impl_type_GAVD: vda_impl_type = 2;
pub type vda_impl_type = ::std::os::raw::c_uint;
pub use self::vda_impl_type as vda_impl_type_t;
pub const vda_result_SUCCESS: vda_result = 0;
pub const vda_result_ILLEGAL_STATE: vda_result = 1;
pub const vda_result_INVALID_ARGUMENT: vda_result = 2;
pub const vda_result_UNREADABLE_INPUT: vda_result = 3;
pub const vda_result_PLATFORM_FAILURE: vda_result = 4;
pub const vda_result_INSUFFICIENT_RESOURCES: vda_result = 5;
pub const vda_result_CANCELLED: vda_result = 6;
pub type vda_result = ::std::os::raw::c_uint;
pub use self::vda_result as vda_result_t;
pub use self::video_codec_profile_t as vda_profile_t;
pub use self::video_pixel_format_t as vda_pixel_format_t;
pub const vda_event_type_UNKNOWN: vda_event_type = 0;
pub const vda_event_type_PROVIDE_PICTURE_BUFFERS: vda_event_type = 1;
pub const vda_event_type_PICTURE_READY: vda_event_type = 2;
pub const vda_event_type_NOTIFY_END_OF_BITSTREAM_BUFFER: vda_event_type = 3;
pub const vda_event_type_NOTIFY_ERROR: vda_event_type = 4;
pub const vda_event_type_RESET_RESPONSE: vda_event_type = 5;
pub const vda_event_type_FLUSH_RESPONSE: vda_event_type = 6;
pub type vda_event_type = ::std::os::raw::c_uint;
pub use self::vda_event_type as vda_event_type_t;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct provide_picture_buffers_event_data {
pub min_num_buffers: u32,
pub width: i32,
pub height: i32,
pub visible_rect_left: i32,
pub visible_rect_top: i32,
pub visible_rect_right: i32,
pub visible_rect_bottom: i32,
}
pub type provide_picture_buffers_event_data_t = provide_picture_buffers_event_data;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct picture_ready_event_data {
pub picture_buffer_id: i32,
pub bitstream_id: i32,
pub crop_left: i32,
pub crop_top: i32,
pub crop_right: i32,
pub crop_bottom: i32,
}
pub type picture_ready_event_data_t = picture_ready_event_data;
#[repr(C)]
#[derive(Copy, Clone)]
pub union vda_event_data {
pub provide_picture_buffers: provide_picture_buffers_event_data_t,
pub picture_ready: picture_ready_event_data_t,
pub bitstream_id: i32,
pub result: vda_result_t,
}
impl Default for vda_event_data {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type vda_event_data_t = vda_event_data;
#[repr(C)]
pub struct vda_input_format {
pub profile: vda_profile_t,
pub min_width: u32,
pub min_height: u32,
pub max_width: u32,
pub max_height: u32,
}
impl Default for vda_input_format {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type vda_input_format_t = vda_input_format;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct vda_event {
pub event_type: vda_event_type_t,
pub event_data: vda_event_data_t,
}
impl Default for vda_event {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type vda_event_t = vda_event;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct vda_capabilities {
pub num_input_formats: usize,
pub input_formats: *const vda_input_format_t,
pub num_output_formats: usize,
pub output_formats: *const vda_pixel_format_t,
}
impl Default for vda_capabilities {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type vda_capabilities_t = vda_capabilities;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct vda_session_info {
pub ctx: *mut ::std::os::raw::c_void,
pub event_pipe_fd: ::std::os::raw::c_int,
}
impl Default for vda_session_info {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type vda_session_info_t = vda_session_info;
extern "C" {
pub fn initialize(impl_type: vda_impl_type_t) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn deinitialize(impl_: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn get_vda_capabilities(impl_: *mut ::std::os::raw::c_void) -> *const vda_capabilities_t;
}
extern "C" {
pub fn init_decode_session(
impl_: *mut ::std::os::raw::c_void,
profile: vda_profile_t,
) -> *mut vda_session_info_t;
}
extern "C" {
pub fn close_decode_session(
impl_: *mut ::std::os::raw::c_void,
session_info: *mut vda_session_info_t,
);
}
extern "C" {
pub fn 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_t;
}
extern "C" {
pub fn vda_set_output_buffer_count(
ctx: *mut ::std::os::raw::c_void,
num_output_buffers: usize,
) -> vda_result_t;
}
extern "C" {
pub fn 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_t;
}
extern "C" {
pub fn vda_reuse_output_buffer(
ctx: *mut ::std::os::raw::c_void,
picture_buffer_id: i32,
) -> vda_result_t;
}
extern "C" {
pub fn vda_flush(ctx: *mut ::std::os::raw::c_void) -> vda_result_t;
}
extern "C" {
pub fn vda_reset(ctx: *mut ::std::os::raw::c_void) -> vda_result_t;
}