1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Copyright 2020 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

mod bindings;
mod event;
mod format;
mod session;
mod vda_instance;

pub use event::*;
pub use format::*;
pub use session::*;
pub use vda_instance::*;

/// libvda only exists on ChromeOS, so we cannot link against it in a regular environment, which
/// limits our build coverage. These stubs are built if the "chromeos" feature is not specified,
/// which allows build to complete successfully, although the video device will just badly crash if
/// it is ever used.
#[cfg(feature = "libvda-stub")]
mod native_stubs {
    use super::bindings::*;

    #[no_mangle]
    extern "C" fn initialize(_impl_type: vda_impl_type_t) -> *mut ::std::os::raw::c_void {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn deinitialize(_impl_: *mut ::std::os::raw::c_void) {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn get_vda_capabilities(
        _impl_: *mut ::std::os::raw::c_void,
    ) -> *const vda_capabilities_t {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn init_decode_session(
        _impl_: *mut ::std::os::raw::c_void,
        _profile: vda_profile_t,
    ) -> *mut vda_session_info_t {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn close_decode_session(
        _impl_: *mut ::std::os::raw::c_void,
        _session_info: *mut vda_session_info_t,
    ) {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" 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 {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn vda_set_output_buffer_count(
        _ctx: *mut ::std::os::raw::c_void,
        _num_output_buffers: usize,
    ) -> vda_result_t {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" 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 {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn vda_reuse_output_buffer(
        _ctx: *mut ::std::os::raw::c_void,
        _picture_buffer_id: i32,
    ) -> vda_result_t {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn vda_flush(_ctx: *mut ::std::os::raw::c_void) -> vda_result_t {
        unimplemented!()
    }

    #[no_mangle]
    extern "C" fn vda_reset(_ctx: *mut ::std::os::raw::c_void) -> vda_result_t {
        unimplemented!()
    }
}