1 // Copyright 2020 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 mod bindings; 6 mod event; 7 mod format; 8 mod session; 9 mod vda_instance; 10 11 pub use event::*; 12 pub use format::*; 13 pub use session::*; 14 pub use vda_instance::*; 15 16 /// libvda only exists on ChromeOS, so we cannot link against it in a regular environment, which 17 /// limits our build coverage. These stubs are built if the "chromeos" feature is not specified, 18 /// which allows build to complete successfully, although the video device will just badly crash if 19 /// it is ever used. 20 #[cfg(feature = "libvda-stub")] 21 mod native_stubs { 22 use super::bindings::*; 23 24 #[no_mangle] initialize(_impl_type: vda_impl_type_t) -> *mut ::std::os::raw::c_void25 extern "C" fn initialize(_impl_type: vda_impl_type_t) -> *mut ::std::os::raw::c_void { 26 unimplemented!() 27 } 28 29 #[no_mangle] deinitialize(_impl_: *mut ::std::os::raw::c_void)30 extern "C" fn deinitialize(_impl_: *mut ::std::os::raw::c_void) { 31 unimplemented!() 32 } 33 34 #[no_mangle] get_vda_capabilities( _impl_: *mut ::std::os::raw::c_void, ) -> *const vda_capabilities_t35 extern "C" fn get_vda_capabilities( 36 _impl_: *mut ::std::os::raw::c_void, 37 ) -> *const vda_capabilities_t { 38 unimplemented!() 39 } 40 41 #[no_mangle] init_decode_session( _impl_: *mut ::std::os::raw::c_void, _profile: vda_profile_t, ) -> *mut vda_session_info_t42 extern "C" fn init_decode_session( 43 _impl_: *mut ::std::os::raw::c_void, 44 _profile: vda_profile_t, 45 ) -> *mut vda_session_info_t { 46 unimplemented!() 47 } 48 49 #[no_mangle] close_decode_session( _impl_: *mut ::std::os::raw::c_void, _session_info: *mut vda_session_info_t, )50 extern "C" fn close_decode_session( 51 _impl_: *mut ::std::os::raw::c_void, 52 _session_info: *mut vda_session_info_t, 53 ) { 54 unimplemented!() 55 } 56 57 #[no_mangle] 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_t58 extern "C" fn vda_decode( 59 _ctx: *mut ::std::os::raw::c_void, 60 _bitstream_id: i32, 61 _fd: ::std::os::raw::c_int, 62 _offset: u32, 63 _bytes_used: u32, 64 ) -> vda_result_t { 65 unimplemented!() 66 } 67 68 #[no_mangle] vda_set_output_buffer_count( _ctx: *mut ::std::os::raw::c_void, _num_output_buffers: usize, ) -> vda_result_t69 extern "C" fn vda_set_output_buffer_count( 70 _ctx: *mut ::std::os::raw::c_void, 71 _num_output_buffers: usize, 72 ) -> vda_result_t { 73 unimplemented!() 74 } 75 76 #[no_mangle] 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_t77 extern "C" fn vda_use_output_buffer( 78 _ctx: *mut ::std::os::raw::c_void, 79 _picture_buffer_id: i32, 80 _format: vda_pixel_format_t, 81 _fd: ::std::os::raw::c_int, 82 _num_planes: usize, 83 _planes: *mut video_frame_plane_t, 84 _modifier: u64, 85 ) -> vda_result_t { 86 unimplemented!() 87 } 88 89 #[no_mangle] vda_reuse_output_buffer( _ctx: *mut ::std::os::raw::c_void, _picture_buffer_id: i32, ) -> vda_result_t90 extern "C" fn vda_reuse_output_buffer( 91 _ctx: *mut ::std::os::raw::c_void, 92 _picture_buffer_id: i32, 93 ) -> vda_result_t { 94 unimplemented!() 95 } 96 97 #[no_mangle] vda_flush(_ctx: *mut ::std::os::raw::c_void) -> vda_result_t98 extern "C" fn vda_flush(_ctx: *mut ::std::os::raw::c_void) -> vda_result_t { 99 unimplemented!() 100 } 101 102 #[no_mangle] vda_reset(_ctx: *mut ::std::os::raw::c_void) -> vda_result_t103 extern "C" fn vda_reset(_ctx: *mut ::std::os::raw::c_void) -> vda_result_t { 104 unimplemented!() 105 } 106 } 107