mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
libvda: regenerate bindings
BUG=b:218388029 TEST=tools/presubmit --quick Change-Id: I37112713dca5e8fef1299fcff72933cfcf06eafd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339810 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
4da1409c03
commit
ce0d8c51e9
5 changed files with 167 additions and 1097 deletions
46
libvda/bindgen.sh
Executable file
46
libvda/bindgen.sh
Executable file
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2022 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
#
|
||||
# Regenerate libvda bindgen bindings.
|
||||
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
||||
|
||||
source tools/impl/bindgen-common.sh
|
||||
|
||||
bindgen_generate \
|
||||
--allowlist-type='video_.*' \
|
||||
"${BINDGEN_PLATFORM2}/arc/vm/libvda/libvda_common.h" \
|
||||
> libvda/src/bindings.rs
|
||||
|
||||
bindgen_generate \
|
||||
--raw-line 'pub use crate::bindings::*;' \
|
||||
--allowlist-function 'initialize' \
|
||||
--allowlist-function 'deinitialize' \
|
||||
--allowlist-function 'get_vda_capabilities' \
|
||||
--allowlist-function 'init_decode_session' \
|
||||
--allowlist-function 'close_decode_session' \
|
||||
--allowlist-function 'vda_.*' \
|
||||
--allowlist-type 'vda_.*' \
|
||||
--blocklist-type 'video_.*' \
|
||||
"${BINDGEN_PLATFORM2}/arc/vm/libvda/libvda_decode.h" \
|
||||
-- \
|
||||
-I "${BINDGEN_PLATFORM2}" \
|
||||
> libvda/src/decode/bindings.rs
|
||||
|
||||
bindgen_generate \
|
||||
--raw-line 'pub use crate::bindings::*;' \
|
||||
--allowlist-function 'initialize_encode' \
|
||||
--allowlist-function 'deinitialize_encode' \
|
||||
--allowlist-function 'get_vea_capabilities' \
|
||||
--allowlist-function 'init_encode_session' \
|
||||
--allowlist-function 'close_encode_session' \
|
||||
--allowlist-function 'vea_.*' \
|
||||
--allowlist-type 'vea_.*' \
|
||||
--blocklist-type 'video_.*' \
|
||||
"${BINDGEN_PLATFORM2}/arc/vm/libvda/libvda_encode.h" \
|
||||
-- \
|
||||
-I "${BINDGEN_PLATFORM2}" \
|
||||
> libvda/src/encode/bindings.rs
|
|
@ -1,65 +1,17 @@
|
|||
// Copyright 2020 The Chromium OS Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
/* automatically generated by tools/bindgen-all-the-things */
|
||||
|
||||
#![allow(
|
||||
dead_code,
|
||||
non_camel_case_types,
|
||||
non_snake_case,
|
||||
non_upper_case_globals,
|
||||
warnings
|
||||
)]
|
||||
|
||||
/*
|
||||
automatically generated by rust-bindgen
|
||||
|
||||
generated with the command:
|
||||
cd ${CHROMEOS_DIR}/src/platform2 && \
|
||||
bindgen arc/vm/libvda/libvda_common.h \
|
||||
-o ../platform/crosvm/libvda/src/common/bindings.rs \
|
||||
--allowlist-type "video_.*"
|
||||
*/
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
pub type __int32_t = ::std::os::raw::c_int;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Default, Copy, Clone)]
|
||||
pub struct video_frame_plane {
|
||||
pub offset: i32,
|
||||
pub stride: i32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_video_frame_plane() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<video_frame_plane>(),
|
||||
8usize,
|
||||
concat!("Size of: ", stringify!(video_frame_plane))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<video_frame_plane>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(video_frame_plane))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<video_frame_plane>())).offset as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(video_frame_plane),
|
||||
"::",
|
||||
stringify!(offset)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<video_frame_plane>())).stride as *const _ as usize },
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(video_frame_plane),
|
||||
"::",
|
||||
stringify!(stride)
|
||||
)
|
||||
);
|
||||
}
|
||||
pub type video_frame_plane_t = video_frame_plane;
|
||||
pub const video_codec_profile_VIDEO_CODEC_PROFILE_UNKNOWN: video_codec_profile = -1;
|
||||
pub const video_codec_profile_VIDEO_CODEC_PROFILE_MIN: video_codec_profile = -1;
|
||||
|
@ -105,10 +57,10 @@ pub const video_codec_profile_AV1PROFILE_PROFILE_HIGH: video_codec_profile = 25;
|
|||
pub const video_codec_profile_AV1PROFILE_PROFILE_PRO: video_codec_profile = 26;
|
||||
pub const video_codec_profile_AV1PROFILE_MAX: video_codec_profile = 26;
|
||||
pub const video_codec_profile_VIDEO_CODEC_PROFILE_MAX: video_codec_profile = 26;
|
||||
pub type video_codec_profile = i32;
|
||||
pub type video_codec_profile = ::std::os::raw::c_int;
|
||||
pub use self::video_codec_profile as video_codec_profile_t;
|
||||
pub const video_pixel_format_YV12: video_pixel_format = 0;
|
||||
pub const video_pixel_format_NV12: video_pixel_format = 1;
|
||||
pub const video_pixel_format_PIXEL_FORMAT_MAX: video_pixel_format = 1;
|
||||
pub type video_pixel_format = u32;
|
||||
pub type video_pixel_format = ::std::os::raw::c_uint;
|
||||
pub use self::video_pixel_format as video_pixel_format_t;
|
||||
|
|
|
@ -1,43 +1,19 @@
|
|||
// Copyright 2020 The Chromium OS Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
/* automatically generated by tools/bindgen-all-the-things */
|
||||
|
||||
#![allow(
|
||||
dead_code,
|
||||
non_camel_case_types,
|
||||
non_snake_case,
|
||||
non_upper_case_globals,
|
||||
warnings
|
||||
)]
|
||||
|
||||
/*
|
||||
automatically generated by rust-bindgen
|
||||
|
||||
generated with the command:
|
||||
cd ${CHROMEOS_DIR}/src/platform2/ && \
|
||||
bindgen arc/vm/libvda/libvda_decode.h \
|
||||
-o ../platform/crosvm/libvda/src/decode/bindings.rs \
|
||||
--raw-line 'pub use crate::bindings::*;' \
|
||||
--allowlist-function "initialize" \
|
||||
--allowlist-function "deinitialize" \
|
||||
--allowlist-function "get_vda_capabilities" \
|
||||
--allowlist-function "init_decode_session" \
|
||||
--allowlist-function "close_decode_session" \
|
||||
--allowlist-function "vda_.*" \
|
||||
--allowlist-type "vda_.*" \
|
||||
--blocklist-type "video_.*" \
|
||||
-- \
|
||||
-I .
|
||||
*/
|
||||
#![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 = u32;
|
||||
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;
|
||||
|
@ -46,7 +22,7 @@ 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 = u32;
|
||||
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;
|
||||
|
@ -57,10 +33,10 @@ 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 = u32;
|
||||
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, Copy, Clone)]
|
||||
#[derive(Debug, Default, Copy, Clone)]
|
||||
pub struct provide_picture_buffers_event_data {
|
||||
pub min_num_buffers: u32,
|
||||
pub width: i32,
|
||||
|
@ -70,116 +46,9 @@ pub struct provide_picture_buffers_event_data {
|
|||
pub visible_rect_right: i32,
|
||||
pub visible_rect_bottom: i32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_provide_picture_buffers_event_data() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<provide_picture_buffers_event_data>(),
|
||||
28usize,
|
||||
concat!("Size of: ", stringify!(provide_picture_buffers_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<provide_picture_buffers_event_data>(),
|
||||
4usize,
|
||||
concat!(
|
||||
"Alignment of ",
|
||||
stringify!(provide_picture_buffers_event_data)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).min_num_buffers
|
||||
as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(min_num_buffers)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).width as *const _
|
||||
as usize
|
||||
},
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(width)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).height as *const _
|
||||
as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(height)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).visible_rect_left
|
||||
as *const _ as usize
|
||||
},
|
||||
12usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(visible_rect_left)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).visible_rect_top
|
||||
as *const _ as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(visible_rect_top)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).visible_rect_right
|
||||
as *const _ as usize
|
||||
},
|
||||
20usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(visible_rect_right)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<provide_picture_buffers_event_data>())).visible_rect_bottom
|
||||
as *const _ as usize
|
||||
},
|
||||
24usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(provide_picture_buffers_event_data),
|
||||
"::",
|
||||
stringify!(visible_rect_bottom)
|
||||
)
|
||||
);
|
||||
}
|
||||
pub type provide_picture_buffers_event_data_t = provide_picture_buffers_event_data;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Default, Copy, Clone)]
|
||||
pub struct picture_ready_event_data {
|
||||
pub picture_buffer_id: i32,
|
||||
pub bitstream_id: i32,
|
||||
|
@ -188,92 +57,6 @@ pub struct picture_ready_event_data {
|
|||
pub crop_right: i32,
|
||||
pub crop_bottom: i32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_picture_ready_event_data() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<picture_ready_event_data>(),
|
||||
24usize,
|
||||
concat!("Size of: ", stringify!(picture_ready_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<picture_ready_event_data>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(picture_ready_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<picture_ready_event_data>())).picture_buffer_id as *const _
|
||||
as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(picture_ready_event_data),
|
||||
"::",
|
||||
stringify!(picture_buffer_id)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<picture_ready_event_data>())).bitstream_id as *const _ as usize
|
||||
},
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(picture_ready_event_data),
|
||||
"::",
|
||||
stringify!(bitstream_id)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<picture_ready_event_data>())).crop_left as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(picture_ready_event_data),
|
||||
"::",
|
||||
stringify!(crop_left)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<picture_ready_event_data>())).crop_top as *const _ as usize
|
||||
},
|
||||
12usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(picture_ready_event_data),
|
||||
"::",
|
||||
stringify!(crop_top)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<picture_ready_event_data>())).crop_right as *const _ as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(picture_ready_event_data),
|
||||
"::",
|
||||
stringify!(crop_right)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<picture_ready_event_data>())).crop_bottom as *const _ as usize
|
||||
},
|
||||
20usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(picture_ready_event_data),
|
||||
"::",
|
||||
stringify!(crop_bottom)
|
||||
)
|
||||
);
|
||||
}
|
||||
pub type picture_ready_event_data_t = picture_ready_event_data;
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
|
@ -282,62 +65,15 @@ pub union vda_event_data {
|
|||
pub picture_ready: picture_ready_event_data_t,
|
||||
pub bitstream_id: i32,
|
||||
pub result: vda_result_t,
|
||||
_bindgen_union_align: [u32; 7usize],
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vda_event_data() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vda_event_data>(),
|
||||
28usize,
|
||||
concat!("Size of: ", stringify!(vda_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vda_event_data>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(vda_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
impl Default for vda_event_data {
|
||||
fn default() -> Self {
|
||||
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vda_event_data>())).provide_picture_buffers as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_event_data),
|
||||
"::",
|
||||
stringify!(provide_picture_buffers)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_event_data>())).picture_ready as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_event_data),
|
||||
"::",
|
||||
stringify!(picture_ready)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_event_data>())).bitstream_id as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_event_data),
|
||||
"::",
|
||||
stringify!(bitstream_id)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_event_data>())).result as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_event_data),
|
||||
"::",
|
||||
stringify!(result)
|
||||
)
|
||||
);
|
||||
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
|
||||
s.assume_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type vda_event_data_t = vda_event_data;
|
||||
#[repr(C)]
|
||||
|
@ -348,68 +84,14 @@ pub struct vda_input_format {
|
|||
pub max_width: u32,
|
||||
pub max_height: u32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vda_input_format() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vda_input_format>(),
|
||||
20usize,
|
||||
concat!("Size of: ", stringify!(vda_input_format))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vda_input_format>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(vda_input_format))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_input_format>())).profile as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_input_format),
|
||||
"::",
|
||||
stringify!(profile)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_input_format>())).min_width as *const _ as usize },
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_input_format),
|
||||
"::",
|
||||
stringify!(min_width)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_input_format>())).min_height as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_input_format),
|
||||
"::",
|
||||
stringify!(min_height)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_input_format>())).max_width as *const _ as usize },
|
||||
12usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_input_format),
|
||||
"::",
|
||||
stringify!(max_width)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_input_format>())).max_height as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_input_format),
|
||||
"::",
|
||||
stringify!(max_height)
|
||||
)
|
||||
);
|
||||
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)]
|
||||
|
@ -418,38 +100,14 @@ pub struct vda_event {
|
|||
pub event_type: vda_event_type_t,
|
||||
pub event_data: vda_event_data_t,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vda_event() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vda_event>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(vda_event))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vda_event>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(vda_event))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_event>())).event_type as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_event),
|
||||
"::",
|
||||
stringify!(event_type)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_event>())).event_data as *const _ as usize },
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_event),
|
||||
"::",
|
||||
stringify!(event_data)
|
||||
)
|
||||
);
|
||||
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)]
|
||||
|
@ -460,62 +118,14 @@ pub struct vda_capabilities {
|
|||
pub num_output_formats: usize,
|
||||
pub output_formats: *const vda_pixel_format_t,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vda_capabilities() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vda_capabilities>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(vda_capabilities))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vda_capabilities>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(vda_capabilities))
|
||||
);
|
||||
assert_eq!(
|
||||
impl Default for vda_capabilities {
|
||||
fn default() -> Self {
|
||||
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vda_capabilities>())).num_input_formats as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_capabilities),
|
||||
"::",
|
||||
stringify!(num_input_formats)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_capabilities>())).input_formats as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_capabilities),
|
||||
"::",
|
||||
stringify!(input_formats)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vda_capabilities>())).num_output_formats as *const _ as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_capabilities),
|
||||
"::",
|
||||
stringify!(num_output_formats)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_capabilities>())).output_formats as *const _ as usize },
|
||||
24usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_capabilities),
|
||||
"::",
|
||||
stringify!(output_formats)
|
||||
)
|
||||
);
|
||||
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
|
||||
s.assume_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type vda_capabilities_t = vda_capabilities;
|
||||
#[repr(C)]
|
||||
|
@ -524,38 +134,14 @@ pub struct vda_session_info {
|
|||
pub ctx: *mut ::std::os::raw::c_void,
|
||||
pub event_pipe_fd: ::std::os::raw::c_int,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vda_session_info() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vda_session_info>(),
|
||||
16usize,
|
||||
concat!("Size of: ", stringify!(vda_session_info))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vda_session_info>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(vda_session_info))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_session_info>())).ctx as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_session_info),
|
||||
"::",
|
||||
stringify!(ctx)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vda_session_info>())).event_pipe_fd as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vda_session_info),
|
||||
"::",
|
||||
stringify!(event_pipe_fd)
|
||||
)
|
||||
);
|
||||
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" {
|
||||
|
|
|
@ -1,34 +1,9 @@
|
|||
// Copyright 2020 The Chromium OS Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
/* automatically generated by tools/bindgen-all-the-things */
|
||||
|
||||
/*
|
||||
automatically generated by rust-bindgen
|
||||
|
||||
generated with the command:
|
||||
cd ${CHROMEOS_DIR}/src/platform2/ && \
|
||||
bindgen arc/vm/libvda/libvda_encode.h \
|
||||
-o ../platform/crosvm/libvda/src/encode/bindings.rs \
|
||||
--raw-line 'pub use crate::bindings::*;' \
|
||||
--allowlist-function "initialize_encode" \
|
||||
--allowlist-function "deinitialize_encode" \
|
||||
--allowlist-function "get_vea_capabilities" \
|
||||
--allowlist-function "init_encode_session" \
|
||||
--allowlist-function "close_encode_session" \
|
||||
--allowlist-function "vea_.*" \
|
||||
--allowlist-type "vea_.*" \
|
||||
--blocklist-type "video_.*" \
|
||||
-- \
|
||||
-I .
|
||||
*/
|
||||
|
||||
#![allow(
|
||||
dead_code,
|
||||
non_camel_case_types,
|
||||
non_snake_case,
|
||||
non_upper_case_globals,
|
||||
warnings
|
||||
)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
pub use crate::bindings::*;
|
||||
|
||||
|
@ -38,7 +13,7 @@ pub type __uint32_t = ::std::os::raw::c_uint;
|
|||
pub type __int64_t = ::std::os::raw::c_long;
|
||||
pub const vea_impl_type_VEA_FAKE: vea_impl_type = 0;
|
||||
pub const vea_impl_type_GAVEA: vea_impl_type = 1;
|
||||
pub type vea_impl_type = u32;
|
||||
pub type vea_impl_type = ::std::os::raw::c_uint;
|
||||
pub use self::vea_impl_type as vea_impl_type_t;
|
||||
#[repr(C)]
|
||||
pub struct vea_profile {
|
||||
|
@ -48,72 +23,14 @@ pub struct vea_profile {
|
|||
pub max_framerate_numerator: u32,
|
||||
pub max_framerate_denominator: u32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_profile() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_profile>(),
|
||||
20usize,
|
||||
concat!("Size of: ", stringify!(vea_profile))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_profile>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(vea_profile))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_profile>())).profile as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_profile),
|
||||
"::",
|
||||
stringify!(profile)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_profile>())).max_width as *const _ as usize },
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_profile),
|
||||
"::",
|
||||
stringify!(max_width)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_profile>())).max_height as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_profile),
|
||||
"::",
|
||||
stringify!(max_height)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
impl Default for vea_profile {
|
||||
fn default() -> Self {
|
||||
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_profile>())).max_framerate_numerator as *const _ as usize
|
||||
},
|
||||
12usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_profile),
|
||||
"::",
|
||||
stringify!(max_framerate_numerator)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_profile>())).max_framerate_denominator as *const _ as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_profile),
|
||||
"::",
|
||||
stringify!(max_framerate_denominator)
|
||||
)
|
||||
);
|
||||
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
|
||||
s.assume_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type vea_profile_t = vea_profile;
|
||||
#[repr(C)]
|
||||
|
@ -124,67 +41,19 @@ pub struct vea_capabilities {
|
|||
pub num_output_formats: usize,
|
||||
pub output_formats: *const vea_profile_t,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_capabilities() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_capabilities>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(vea_capabilities))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_capabilities>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(vea_capabilities))
|
||||
);
|
||||
assert_eq!(
|
||||
impl Default for vea_capabilities {
|
||||
fn default() -> Self {
|
||||
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_capabilities>())).num_input_formats as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_capabilities),
|
||||
"::",
|
||||
stringify!(num_input_formats)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_capabilities>())).input_formats as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_capabilities),
|
||||
"::",
|
||||
stringify!(input_formats)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_capabilities>())).num_output_formats as *const _ as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_capabilities),
|
||||
"::",
|
||||
stringify!(num_output_formats)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_capabilities>())).output_formats as *const _ as usize },
|
||||
24usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_capabilities),
|
||||
"::",
|
||||
stringify!(output_formats)
|
||||
)
|
||||
);
|
||||
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
|
||||
s.assume_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type vea_capabilities_t = vea_capabilities;
|
||||
pub const vea_bitrate_mode_VBR: vea_bitrate_mode = 0;
|
||||
pub const vea_bitrate_mode_CBR: vea_bitrate_mode = 1;
|
||||
pub type vea_bitrate_mode = u32;
|
||||
pub type vea_bitrate_mode = ::std::os::raw::c_uint;
|
||||
pub use self::vea_bitrate_mode as vea_bitrate_mode_t;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
@ -193,48 +62,14 @@ pub struct vea_bitrate {
|
|||
pub target: u32,
|
||||
pub peak: u32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_bitrate() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_bitrate>(),
|
||||
12usize,
|
||||
concat!("Size of: ", stringify!(vea_bitrate))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_bitrate>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(vea_bitrate))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_bitrate>())).mode as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_bitrate),
|
||||
"::",
|
||||
stringify!(mode)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_bitrate>())).target as *const _ as usize },
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_bitrate),
|
||||
"::",
|
||||
stringify!(target)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_bitrate>())).peak as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_bitrate),
|
||||
"::",
|
||||
stringify!(peak)
|
||||
)
|
||||
);
|
||||
impl Default for vea_bitrate {
|
||||
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 vea_bitrate_t = vea_bitrate;
|
||||
#[repr(C)]
|
||||
|
@ -249,118 +84,20 @@ pub struct vea_config {
|
|||
pub h264_output_level: u8,
|
||||
pub has_h264_output_level: u8,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_config() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_config>(),
|
||||
36usize,
|
||||
concat!("Size of: ", stringify!(vea_config))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_config>(),
|
||||
4usize,
|
||||
concat!("Alignment of ", stringify!(vea_config))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).input_format as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(input_format)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).input_visible_width as *const _ as usize },
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(input_visible_width)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).input_visible_height as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(input_visible_height)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).output_profile as *const _ as usize },
|
||||
12usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(output_profile)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).bitrate as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(bitrate)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).initial_framerate as *const _ as usize },
|
||||
28usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(initial_framerate)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
impl Default for vea_config {
|
||||
fn default() -> Self {
|
||||
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_config>())).has_initial_framerate as *const _ as usize
|
||||
},
|
||||
32usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(has_initial_framerate)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_config>())).h264_output_level as *const _ as usize },
|
||||
33usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(h264_output_level)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_config>())).has_h264_output_level as *const _ as usize
|
||||
},
|
||||
34usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_config),
|
||||
"::",
|
||||
stringify!(has_h264_output_level)
|
||||
)
|
||||
);
|
||||
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
|
||||
s.assume_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type vea_config_t = vea_config;
|
||||
pub const vea_error_ILLEGAL_STATE_ERROR: vea_error = 0;
|
||||
pub const vea_error_INVALID_ARGUMENT_ERROR: vea_error = 1;
|
||||
pub const vea_error_PLATFORM_FAILURE_ERROR: vea_error = 2;
|
||||
pub type vea_error = u32;
|
||||
pub type vea_error = ::std::os::raw::c_uint;
|
||||
pub use self::vea_error as vea_error_t;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
@ -368,38 +105,14 @@ pub struct vea_session_info {
|
|||
pub ctx: *mut ::std::os::raw::c_void,
|
||||
pub event_pipe_fd: ::std::os::raw::c_int,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_session_info() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_session_info>(),
|
||||
16usize,
|
||||
concat!("Size of: ", stringify!(vea_session_info))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_session_info>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(vea_session_info))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_session_info>())).ctx as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_session_info),
|
||||
"::",
|
||||
stringify!(ctx)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_session_info>())).event_pipe_fd as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_session_info),
|
||||
"::",
|
||||
stringify!(event_pipe_fd)
|
||||
)
|
||||
);
|
||||
impl Default for vea_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 vea_session_info_t = vea_session_info;
|
||||
pub type vea_input_buffer_id_t = i32;
|
||||
|
@ -409,167 +122,25 @@ pub const vea_event_type_PROCESSED_INPUT_BUFFER: vea_event_type = 1;
|
|||
pub const vea_event_type_PROCESSED_OUTPUT_BUFFER: vea_event_type = 2;
|
||||
pub const vea_event_type_VEA_FLUSH_RESPONSE: vea_event_type = 3;
|
||||
pub const vea_event_type_VEA_NOTIFY_ERROR: vea_event_type = 4;
|
||||
pub type vea_event_type = u32;
|
||||
pub type vea_event_type = ::std::os::raw::c_uint;
|
||||
pub use self::vea_event_type as vea_event_type_t;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Default, Copy, Clone)]
|
||||
pub struct vea_require_input_buffers_event_data {
|
||||
pub input_count: u32,
|
||||
pub input_frame_width: u32,
|
||||
pub input_frame_height: u32,
|
||||
pub output_buffer_size: u32,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_require_input_buffers_event_data() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_require_input_buffers_event_data>(),
|
||||
16usize,
|
||||
concat!(
|
||||
"Size of: ",
|
||||
stringify!(vea_require_input_buffers_event_data)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_require_input_buffers_event_data>(),
|
||||
4usize,
|
||||
concat!(
|
||||
"Alignment of ",
|
||||
stringify!(vea_require_input_buffers_event_data)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_require_input_buffers_event_data>())).input_count as *const _
|
||||
as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_require_input_buffers_event_data),
|
||||
"::",
|
||||
stringify!(input_count)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_require_input_buffers_event_data>())).input_frame_width
|
||||
as *const _ as usize
|
||||
},
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_require_input_buffers_event_data),
|
||||
"::",
|
||||
stringify!(input_frame_width)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_require_input_buffers_event_data>())).input_frame_height
|
||||
as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_require_input_buffers_event_data),
|
||||
"::",
|
||||
stringify!(input_frame_height)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_require_input_buffers_event_data>())).output_buffer_size
|
||||
as *const _ as usize
|
||||
},
|
||||
12usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_require_input_buffers_event_data),
|
||||
"::",
|
||||
stringify!(output_buffer_size)
|
||||
)
|
||||
);
|
||||
}
|
||||
pub type vea_require_input_buffers_event_data_t = vea_require_input_buffers_event_data;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Default, Copy, Clone)]
|
||||
pub struct vea_processed_output_buffer_event_data {
|
||||
pub output_buffer_id: vea_output_buffer_id_t,
|
||||
pub payload_size: u32,
|
||||
pub key_frame: u8,
|
||||
pub timestamp: i64,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_processed_output_buffer_event_data() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_processed_output_buffer_event_data>(),
|
||||
24usize,
|
||||
concat!(
|
||||
"Size of: ",
|
||||
stringify!(vea_processed_output_buffer_event_data)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_processed_output_buffer_event_data>(),
|
||||
8usize,
|
||||
concat!(
|
||||
"Alignment of ",
|
||||
stringify!(vea_processed_output_buffer_event_data)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_processed_output_buffer_event_data>())).output_buffer_id
|
||||
as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_processed_output_buffer_event_data),
|
||||
"::",
|
||||
stringify!(output_buffer_id)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_processed_output_buffer_event_data>())).payload_size
|
||||
as *const _ as usize
|
||||
},
|
||||
4usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_processed_output_buffer_event_data),
|
||||
"::",
|
||||
stringify!(payload_size)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_processed_output_buffer_event_data>())).key_frame as *const _
|
||||
as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_processed_output_buffer_event_data),
|
||||
"::",
|
||||
stringify!(key_frame)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_processed_output_buffer_event_data>())).timestamp as *const _
|
||||
as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_processed_output_buffer_event_data),
|
||||
"::",
|
||||
stringify!(timestamp)
|
||||
)
|
||||
);
|
||||
}
|
||||
pub type vea_processed_output_buffer_event_data_t = vea_processed_output_buffer_event_data;
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
|
@ -579,77 +150,15 @@ pub union vea_event_data {
|
|||
pub processed_output_buffer: vea_processed_output_buffer_event_data_t,
|
||||
pub flush_done: u8,
|
||||
pub error: vea_error_t,
|
||||
_bindgen_union_align: [u64; 3usize],
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_event_data() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_event_data>(),
|
||||
24usize,
|
||||
concat!("Size of: ", stringify!(vea_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_event_data>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(vea_event_data))
|
||||
);
|
||||
assert_eq!(
|
||||
impl Default for vea_event_data {
|
||||
fn default() -> Self {
|
||||
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_event_data>())).require_input_buffers as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event_data),
|
||||
"::",
|
||||
stringify!(require_input_buffers)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_event_data>())).processed_input_buffer_id as *const _
|
||||
as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event_data),
|
||||
"::",
|
||||
stringify!(processed_input_buffer_id)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<vea_event_data>())).processed_output_buffer as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event_data),
|
||||
"::",
|
||||
stringify!(processed_output_buffer)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_event_data>())).flush_done as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event_data),
|
||||
"::",
|
||||
stringify!(flush_done)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_event_data>())).error as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event_data),
|
||||
"::",
|
||||
stringify!(error)
|
||||
)
|
||||
);
|
||||
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
|
||||
s.assume_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type vea_event_data_t = vea_event_data;
|
||||
#[repr(C)]
|
||||
|
@ -658,38 +167,14 @@ pub struct vea_event {
|
|||
pub event_type: vea_event_type_t,
|
||||
pub event_data: vea_event_data_t,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_vea_event() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<vea_event>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(vea_event))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<vea_event>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(vea_event))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_event>())).event_type as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event),
|
||||
"::",
|
||||
stringify!(event_type)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<vea_event>())).event_data as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(vea_event),
|
||||
"::",
|
||||
stringify!(event_data)
|
||||
)
|
||||
);
|
||||
impl Default for vea_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 vea_event_t = vea_event;
|
||||
extern "C" {
|
||||
|
|
|
@ -23,6 +23,7 @@ dirs=(
|
|||
devices/src/virtio/gpu
|
||||
kernel_loader
|
||||
kvm_sys
|
||||
libvda
|
||||
)
|
||||
|
||||
for d in "${dirs[@]}"; do
|
||||
|
|
Loading…
Reference in a new issue