Skip to main content

videostream_sys/
ffi.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025 Au-Zone Technologies
3//
4/* automatically generated by rust-bindgen 0.72.1 */
5
6pub const VSL_VERSION: &[u8; 6] = b"2.1.3\0";
7pub const VSL_V4L2_MAX_FORMATS: u32 = 64;
8pub const VSL_V4L2_MAX_RESOLUTIONS: u32 = 32;
9pub const VSL_V4L2_MAX_FRAMERATES: u32 = 16;
10#[repr(C)]
11#[derive(Debug, Copy, Clone)]
12pub struct vsl_host {
13    _unused: [u8; 0],
14}
15#[doc = " @struct VSLHost\n @brief The VSLHost object manages a connection point at the user-defined path\n and allows frames to be registered for client use."]
16pub type VSLHost = vsl_host;
17#[repr(C)]
18#[derive(Debug, Copy, Clone)]
19pub struct vsl_client {
20    _unused: [u8; 0],
21}
22#[doc = " @struct VSLClient\n @brief The VSLClient object manages a single connection to a VSLHost."]
23pub type VSLClient = vsl_client;
24#[repr(C)]
25#[derive(Debug, Copy, Clone)]
26pub struct vsl_frame {
27    _unused: [u8; 0],
28}
29#[doc = " @struct VSLFrame\n @brief The VSLFrame object represents a single video frame from either the\n host or client perspective.  Certain API are only available to the host or\n client."]
30pub type VSLFrame = vsl_frame;
31#[repr(C)]
32#[derive(Debug, Copy, Clone)]
33pub struct vsl_encoder {
34    _unused: [u8; 0],
35}
36#[doc = " @struct VSLEncoder\n @brief The VSLEncoder object represents encoder instance.\n"]
37pub type VSLEncoder = vsl_encoder;
38#[repr(C)]
39#[derive(Debug, Copy, Clone)]
40pub struct vsl_decoder {
41    _unused: [u8; 0],
42}
43#[doc = " @struct VSLDecoder\n @brief The VSLDecoder object represents decoder instance.\n"]
44pub type VSLDecoder = vsl_decoder;
45#[doc = " The VSLRect structure represents a rectangle region of a frame and is used to\n define cropping regions for sub-frames."]
46#[repr(C)]
47#[derive(Debug, Copy, Clone)]
48pub struct vsl_rect {
49    #[doc = " The left-most pixel offset for the rectangle."]
50    pub x: ::std::os::raw::c_int,
51    #[doc = " The top-most pixel offset for the rectangle."]
52    pub y: ::std::os::raw::c_int,
53    #[doc = " The width in pixels of the rectangle.  The end position is x+width."]
54    pub width: ::std::os::raw::c_int,
55    #[doc = " The height in pixels of the rectangle.  The end position is y+height."]
56    pub height: ::std::os::raw::c_int,
57}
58#[allow(clippy::unnecessary_operation, clippy::identity_op)]
59const _: () = {
60    ["Size of vsl_rect"][::std::mem::size_of::<vsl_rect>() - 16usize];
61    ["Alignment of vsl_rect"][::std::mem::align_of::<vsl_rect>() - 4usize];
62    ["Offset of field: vsl_rect::x"][::std::mem::offset_of!(vsl_rect, x) - 0usize];
63    ["Offset of field: vsl_rect::y"][::std::mem::offset_of!(vsl_rect, y) - 4usize];
64    ["Offset of field: vsl_rect::width"][::std::mem::offset_of!(vsl_rect, width) - 8usize];
65    ["Offset of field: vsl_rect::height"][::std::mem::offset_of!(vsl_rect, height) - 12usize];
66};
67#[doc = " The VSLRect structure represents a rectangle region of a frame and is used to\n define cropping regions for sub-frames."]
68pub type VSLRect = vsl_rect;
69#[doc = " Automatic bitrate selection (encoder default).\n\n Platform and version dependent. Testing shows approximately 10000 kbps\n on i.MX8M Plus. Use this for general-purpose encoding when specific\n bitrate control is not required."]
70pub const vsl_encode_profile_VSL_ENCODE_PROFILE_AUTO: vsl_encode_profile = 0;
71#[doc = " 5 Mbps target bitrate.\n\n Suitable for moderate quality 1080p video or high quality 720p."]
72pub const vsl_encode_profile_VSL_ENCODE_PROFILE_5000_KBPS: vsl_encode_profile = 1;
73#[doc = " 25 Mbps target bitrate.\n\n Suitable for high quality 1080p video or moderate quality 4K."]
74pub const vsl_encode_profile_VSL_ENCODE_PROFILE_25000_KBPS: vsl_encode_profile = 2;
75#[doc = " 50 Mbps target bitrate.\n\n Suitable for very high quality 1080p or high quality 4K video."]
76pub const vsl_encode_profile_VSL_ENCODE_PROFILE_50000_KBPS: vsl_encode_profile = 3;
77#[doc = " 100 Mbps target bitrate.\n\n Suitable for maximum quality 4K video or when preserving fine details\n is critical. May stress storage and network bandwidth."]
78pub const vsl_encode_profile_VSL_ENCODE_PROFILE_100000_KBPS: vsl_encode_profile = 4;
79#[doc = " Encoder profile defining target bitrate for video encoding.\n\n These profiles provide a convenient way to specify encoding quality/bitrate\n tradeoffs. Higher bitrates produce better quality at the cost of larger file\n sizes and potentially higher CPU/power consumption.\n\n @note The actual quality-to-bitrate ratio depends on the codec (H.264 vs\n H.265), encoder implementation, and content complexity."]
80pub type vsl_encode_profile = ::std::os::raw::c_uint;
81#[doc = " Encoder profile defining target bitrate for video encoding.\n\n These profiles provide a convenient way to specify encoding quality/bitrate\n tradeoffs. Higher bitrates produce better quality at the cost of larger file\n sizes and potentially higher CPU/power consumption.\n\n @note The actual quality-to-bitrate ratio depends on the codec (H.264 vs\n H.265), encoder implementation, and content complexity."]
82pub use self::vsl_encode_profile as VSLEncoderProfile;
83#[doc = " H.264/AVC (Advanced Video Coding) codec.\n\n Widely supported standard (ISO/IEC 14496-10, ITU-T H.264) with good\n compression and compatibility. Recommended for maximum device\n compatibility."]
84pub const VSLDecoderCodec_VSL_DEC_H264: VSLDecoderCodec = 0;
85#[doc = " H.265/HEVC (High Efficiency Video Coding) codec.\n\n Next-generation standard (ISO/IEC 23008-2, ITU-T H.265) providing\n approximately 50% better compression than H.264 at equivalent quality.\n Recommended when bandwidth/storage are constrained and decoder support\n is confirmed."]
86pub const VSLDecoderCodec_VSL_DEC_HEVC: VSLDecoderCodec = 1;
87#[doc = " Video codec type for hardware decoder.\n\n Specifies which video compression standard to use for decoding.\n Both codecs are supported via Hantro VPU hardware acceleration on i.MX8."]
88pub type VSLDecoderCodec = ::std::os::raw::c_uint;
89#[doc = " Auto-detect best available backend.\n\n Selection priority:\n 1. Check VSL_CODEC_BACKEND environment variable\n 2. Prefer V4L2 if device available and has M2M capability\n 3. Fall back to Hantro if V4L2 unavailable\n 4. Fail if no backend available"]
90pub const VSLCodecBackend_VSL_CODEC_BACKEND_AUTO: VSLCodecBackend = 0;
91#[doc = " Force Hantro/libcodec.so backend.\n\n Uses the proprietary VPU wrapper library. May be needed for:\n - Systems without V4L2 codec driver\n - Testing/debugging Hantro-specific behavior\n - Compatibility with older configurations"]
92pub const VSLCodecBackend_VSL_CODEC_BACKEND_HANTRO: VSLCodecBackend = 1;
93#[doc = " Force V4L2 kernel driver backend.\n\n Uses the vsi_v4l2 mem2mem driver. Provides:\n - 37-56x faster decode performance\n - Stable encoder (vs crashing libcodec.so)\n - Standard Linux API"]
94pub const VSLCodecBackend_VSL_CODEC_BACKEND_V4L2: VSLCodecBackend = 2;
95#[doc = " Codec backend selection for encoder/decoder.\n\n Allows selection between V4L2 kernel driver and Hantro user-space\n library (libcodec.so) backends. Use with vsl_decoder_create_ex() and\n vsl_encoder_create_ex() for explicit backend control.\n\n The VSL_CODEC_BACKEND environment variable can override the AUTO selection:\n - \"hantro\" - Force Hantro backend even if V4L2 available\n - \"v4l2\"   - Force V4L2 backend (fail if unavailable)\n - \"auto\"   - Auto-detect (default)\n\n @since 2.0"]
96pub type VSLCodecBackend = ::std::os::raw::c_uint;
97#[doc = " Function pointer definition which will be called as part of\n @ref vsl_frame_unregister.  This is typically used to free resources\n associated with the frame on either client or host side."]
98pub type vsl_frame_cleanup = ::std::option::Option<unsafe extern "C" fn(frame: *mut VSLFrame)>;
99#[repr(C)]
100#[derive(Debug, Copy, Clone)]
101pub struct vsl_camera_buffer {
102    _unused: [u8; 0],
103}
104#[repr(C)]
105#[derive(Debug, Copy, Clone)]
106pub struct vsl_camera {
107    _unused: [u8; 0],
108}
109pub const VSLDecoderRetCode_VSL_DEC_SUCCESS: VSLDecoderRetCode = 0;
110pub const VSLDecoderRetCode_VSL_DEC_ERR: VSLDecoderRetCode = 1;
111pub const VSLDecoderRetCode_VSL_DEC_INIT_INFO: VSLDecoderRetCode = 2;
112pub const VSLDecoderRetCode_VSL_DEC_FRAME_DEC: VSLDecoderRetCode = 4;
113pub type VSLDecoderRetCode = ::std::os::raw::c_uint;
114#[doc = " Video capture device (camera, frame grabber)"]
115pub const VSLDeviceType_VSL_V4L2_TYPE_CAMERA: VSLDeviceType = 1;
116#[doc = " Video output device (display, transmitter)"]
117pub const VSLDeviceType_VSL_V4L2_TYPE_OUTPUT: VSLDeviceType = 2;
118#[doc = " Video encoder (M2M: raw input → compressed output)"]
119pub const VSLDeviceType_VSL_V4L2_TYPE_ENCODER: VSLDeviceType = 4;
120#[doc = " Video decoder (M2M: compressed input → raw output)"]
121pub const VSLDeviceType_VSL_V4L2_TYPE_DECODER: VSLDeviceType = 8;
122#[doc = " Image/video processor (M2M: raw input → raw output)"]
123pub const VSLDeviceType_VSL_V4L2_TYPE_ISP: VSLDeviceType = 16;
124#[doc = " Memory-to-memory device (generic, type not determined)"]
125pub const VSLDeviceType_VSL_V4L2_TYPE_M2M: VSLDeviceType = 32;
126#[doc = " Any device type"]
127pub const VSLDeviceType_VSL_V4L2_TYPE_ANY: VSLDeviceType = 255;
128#[doc = " V4L2 device type classification\n\n Devices are classified based on their V4L2 capabilities and the types of\n formats they support on their input/output queues."]
129pub type VSLDeviceType = ::std::os::raw::c_uint;
130#[doc = " Memory-mapped buffers (kernel allocates, user mmaps)"]
131pub const VSLMemoryType_VSL_V4L2_MEM_MMAP: VSLMemoryType = 1;
132#[doc = " User pointer buffers (user allocates, passes pointer)"]
133pub const VSLMemoryType_VSL_V4L2_MEM_USERPTR: VSLMemoryType = 2;
134#[doc = " DMA buffer sharing (user passes dmabuf fd)"]
135pub const VSLMemoryType_VSL_V4L2_MEM_DMABUF: VSLMemoryType = 4;
136#[doc = " V4L2 memory type capabilities\n\n Indicates which buffer memory types a device supports for streaming."]
137pub type VSLMemoryType = ::std::os::raw::c_uint;
138#[doc = " Frame rate descriptor"]
139#[repr(C)]
140#[derive(Debug, Copy, Clone)]
141pub struct VSLFrameRate {
142    #[doc = "< Frame interval numerator (e.g., 1)"]
143    pub numerator: u32,
144    #[doc = "< Frame interval denominator (e.g., 30 for 30fps)"]
145    pub denominator: u32,
146}
147#[allow(clippy::unnecessary_operation, clippy::identity_op)]
148const _: () = {
149    ["Size of VSLFrameRate"][::std::mem::size_of::<VSLFrameRate>() - 8usize];
150    ["Alignment of VSLFrameRate"][::std::mem::align_of::<VSLFrameRate>() - 4usize];
151    ["Offset of field: VSLFrameRate::numerator"]
152        [::std::mem::offset_of!(VSLFrameRate, numerator) - 0usize];
153    ["Offset of field: VSLFrameRate::denominator"]
154        [::std::mem::offset_of!(VSLFrameRate, denominator) - 4usize];
155};
156#[doc = " Resolution descriptor with supported frame rates"]
157#[repr(C)]
158#[derive(Debug, Copy, Clone)]
159pub struct VSLResolution {
160    #[doc = "< Width in pixels"]
161    pub width: u32,
162    #[doc = "< Height in pixels"]
163    pub height: u32,
164    #[doc = "< Supported frame rates"]
165    pub frame_rates: [VSLFrameRate; 16usize],
166    #[doc = "< Number of frame rates"]
167    pub num_frame_rates: usize,
168}
169#[allow(clippy::unnecessary_operation, clippy::identity_op)]
170const _: () = {
171    ["Size of VSLResolution"][::std::mem::size_of::<VSLResolution>() - 144usize];
172    ["Alignment of VSLResolution"][::std::mem::align_of::<VSLResolution>() - 8usize];
173    ["Offset of field: VSLResolution::width"]
174        [::std::mem::offset_of!(VSLResolution, width) - 0usize];
175    ["Offset of field: VSLResolution::height"]
176        [::std::mem::offset_of!(VSLResolution, height) - 4usize];
177    ["Offset of field: VSLResolution::frame_rates"]
178        [::std::mem::offset_of!(VSLResolution, frame_rates) - 8usize];
179    ["Offset of field: VSLResolution::num_frame_rates"]
180        [::std::mem::offset_of!(VSLResolution, num_frame_rates) - 136usize];
181};
182#[doc = " Pixel format descriptor"]
183#[repr(C)]
184#[derive(Debug, Copy, Clone)]
185pub struct VSLFormat {
186    #[doc = "< V4L2 pixel format fourcc code"]
187    pub fourcc: u32,
188    #[doc = "< Human-readable description"]
189    pub description: [::std::os::raw::c_char; 32usize],
190    #[doc = "< V4L2_FMT_FLAG_* flags"]
191    pub flags: u32,
192    #[doc = "< True if this is a compressed format"]
193    pub compressed: bool,
194    #[doc = " Supported resolutions (populated by vsl_v4l2_enum_resolutions)"]
195    pub resolutions: *mut VSLResolution,
196    pub num_resolutions: usize,
197}
198#[allow(clippy::unnecessary_operation, clippy::identity_op)]
199const _: () = {
200    ["Size of VSLFormat"][::std::mem::size_of::<VSLFormat>() - 64usize];
201    ["Alignment of VSLFormat"][::std::mem::align_of::<VSLFormat>() - 8usize];
202    ["Offset of field: VSLFormat::fourcc"][::std::mem::offset_of!(VSLFormat, fourcc) - 0usize];
203    ["Offset of field: VSLFormat::description"]
204        [::std::mem::offset_of!(VSLFormat, description) - 4usize];
205    ["Offset of field: VSLFormat::flags"][::std::mem::offset_of!(VSLFormat, flags) - 36usize];
206    ["Offset of field: VSLFormat::compressed"]
207        [::std::mem::offset_of!(VSLFormat, compressed) - 40usize];
208    ["Offset of field: VSLFormat::resolutions"]
209        [::std::mem::offset_of!(VSLFormat, resolutions) - 48usize];
210    ["Offset of field: VSLFormat::num_resolutions"]
211        [::std::mem::offset_of!(VSLFormat, num_resolutions) - 56usize];
212};
213#[doc = " V4L2 device descriptor\n\n Contains all information about a discovered V4L2 device including its\n capabilities, supported formats, and memory types."]
214#[repr(C)]
215#[derive(Debug, Copy, Clone)]
216pub struct VSLDevice {
217    #[doc = "< Device path (e.g., \"/dev/video0\")"]
218    pub path: [::std::os::raw::c_char; 64usize],
219    #[doc = "< Driver name (e.g., \"vsi_v4l2\")"]
220    pub driver: [::std::os::raw::c_char; 32usize],
221    #[doc = "< Card/device name (e.g., \"C&M Wave6 VPU encoder\")"]
222    pub card: [::std::os::raw::c_char; 32usize],
223    #[doc = "< Bus info (e.g., \"platform:vsi_v4l2\")"]
224    pub bus_info: [::std::os::raw::c_char; 64usize],
225    #[doc = "< Raw V4L2 device capabilities"]
226    pub caps: u32,
227    #[doc = "< Classified device type"]
228    pub device_type: VSLDeviceType,
229    #[doc = "< Memory types for capture queue"]
230    pub capture_mem: VSLMemoryType,
231    #[doc = "< Memory types for output queue"]
232    pub output_mem: VSLMemoryType,
233    #[doc = "< True if device uses multiplanar API"]
234    pub multiplanar: bool,
235    #[doc = " Capture queue formats (for cameras/decoders)"]
236    pub capture_formats: *mut VSLFormat,
237    pub num_capture_formats: usize,
238    #[doc = " Output queue formats (for encoders/output devices)"]
239    pub output_formats: *mut VSLFormat,
240    pub num_output_formats: usize,
241}
242#[allow(clippy::unnecessary_operation, clippy::identity_op)]
243const _: () = {
244    ["Size of VSLDevice"][::std::mem::size_of::<VSLDevice>() - 248usize];
245    ["Alignment of VSLDevice"][::std::mem::align_of::<VSLDevice>() - 8usize];
246    ["Offset of field: VSLDevice::path"][::std::mem::offset_of!(VSLDevice, path) - 0usize];
247    ["Offset of field: VSLDevice::driver"][::std::mem::offset_of!(VSLDevice, driver) - 64usize];
248    ["Offset of field: VSLDevice::card"][::std::mem::offset_of!(VSLDevice, card) - 96usize];
249    ["Offset of field: VSLDevice::bus_info"]
250        [::std::mem::offset_of!(VSLDevice, bus_info) - 128usize];
251    ["Offset of field: VSLDevice::caps"][::std::mem::offset_of!(VSLDevice, caps) - 192usize];
252    ["Offset of field: VSLDevice::device_type"]
253        [::std::mem::offset_of!(VSLDevice, device_type) - 196usize];
254    ["Offset of field: VSLDevice::capture_mem"]
255        [::std::mem::offset_of!(VSLDevice, capture_mem) - 200usize];
256    ["Offset of field: VSLDevice::output_mem"]
257        [::std::mem::offset_of!(VSLDevice, output_mem) - 204usize];
258    ["Offset of field: VSLDevice::multiplanar"]
259        [::std::mem::offset_of!(VSLDevice, multiplanar) - 208usize];
260    ["Offset of field: VSLDevice::capture_formats"]
261        [::std::mem::offset_of!(VSLDevice, capture_formats) - 216usize];
262    ["Offset of field: VSLDevice::num_capture_formats"]
263        [::std::mem::offset_of!(VSLDevice, num_capture_formats) - 224usize];
264    ["Offset of field: VSLDevice::output_formats"]
265        [::std::mem::offset_of!(VSLDevice, output_formats) - 232usize];
266    ["Offset of field: VSLDevice::num_output_formats"]
267        [::std::mem::offset_of!(VSLDevice, num_output_formats) - 240usize];
268};
269#[doc = " List of discovered V4L2 devices"]
270#[repr(C)]
271#[derive(Debug, Copy, Clone)]
272pub struct VSLDeviceList {
273    #[doc = "< Array of devices"]
274    pub devices: *mut VSLDevice,
275    #[doc = "< Number of devices"]
276    pub count: usize,
277}
278#[allow(clippy::unnecessary_operation, clippy::identity_op)]
279const _: () = {
280    ["Size of VSLDeviceList"][::std::mem::size_of::<VSLDeviceList>() - 16usize];
281    ["Alignment of VSLDeviceList"][::std::mem::align_of::<VSLDeviceList>() - 8usize];
282    ["Offset of field: VSLDeviceList::devices"]
283        [::std::mem::offset_of!(VSLDeviceList, devices) - 0usize];
284    ["Offset of field: VSLDeviceList::count"]
285        [::std::mem::offset_of!(VSLDeviceList, count) - 8usize];
286};
287pub struct VideoStreamLibrary {
288    __library: ::libloading::Library,
289    pub vsl_version:
290        Result<unsafe extern "C" fn() -> *const ::std::os::raw::c_char, ::libloading::Error>,
291    pub vsl_timestamp: Result<unsafe extern "C" fn() -> i64, ::libloading::Error>,
292    pub vsl_host_init: Result<
293        unsafe extern "C" fn(path: *const ::std::os::raw::c_char) -> *mut VSLHost,
294        ::libloading::Error,
295    >,
296    pub vsl_host_release: Result<unsafe extern "C" fn(host: *mut VSLHost), ::libloading::Error>,
297    pub vsl_host_path: Result<
298        unsafe extern "C" fn(host: *const VSLHost) -> *const ::std::os::raw::c_char,
299        ::libloading::Error,
300    >,
301    pub vsl_host_poll: Result<
302        unsafe extern "C" fn(host: *mut VSLHost, wait: i64) -> ::std::os::raw::c_int,
303        ::libloading::Error,
304    >,
305    pub vsl_host_service: Result<
306        unsafe extern "C" fn(
307            host: *mut VSLHost,
308            sock: ::std::os::raw::c_int,
309        ) -> ::std::os::raw::c_int,
310        ::libloading::Error,
311    >,
312    pub vsl_host_process: Result<
313        unsafe extern "C" fn(host: *mut VSLHost) -> ::std::os::raw::c_int,
314        ::libloading::Error,
315    >,
316    pub vsl_host_sockets: Result<
317        unsafe extern "C" fn(
318            host: *mut VSLHost,
319            n_sockets: usize,
320            sockets: *mut ::std::os::raw::c_int,
321            max_sockets: *mut usize,
322        ) -> ::std::os::raw::c_int,
323        ::libloading::Error,
324    >,
325    pub vsl_host_post: Result<
326        unsafe extern "C" fn(
327            host: *mut VSLHost,
328            frame: *mut VSLFrame,
329            expires: i64,
330            duration: i64,
331            pts: i64,
332            dts: i64,
333        ) -> ::std::os::raw::c_int,
334        ::libloading::Error,
335    >,
336    pub vsl_host_drop: Result<
337        unsafe extern "C" fn(host: *mut VSLHost, frame: *mut VSLFrame) -> ::std::os::raw::c_int,
338        ::libloading::Error,
339    >,
340    pub vsl_client_init: Result<
341        unsafe extern "C" fn(
342            path: *const ::std::os::raw::c_char,
343            userptr: *mut ::std::os::raw::c_void,
344            reconnect: bool,
345        ) -> *mut VSLClient,
346        ::libloading::Error,
347    >,
348    pub vsl_client_release:
349        Result<unsafe extern "C" fn(client: *mut VSLClient), ::libloading::Error>,
350    pub vsl_client_disconnect:
351        Result<unsafe extern "C" fn(client: *mut VSLClient), ::libloading::Error>,
352    pub vsl_client_userptr: Result<
353        unsafe extern "C" fn(client: *mut VSLClient) -> *mut ::std::os::raw::c_void,
354        ::libloading::Error,
355    >,
356    pub vsl_client_path: Result<
357        unsafe extern "C" fn(client: *const VSLClient) -> *const ::std::os::raw::c_char,
358        ::libloading::Error,
359    >,
360    pub vsl_client_set_timeout:
361        Result<unsafe extern "C" fn(client: *mut VSLClient, timeout: f32), ::libloading::Error>,
362    pub vsl_frame_register: Result<
363        unsafe extern "C" fn(
364            host: *mut VSLHost,
365            serial: i64,
366            handle: ::std::os::raw::c_int,
367            width: ::std::os::raw::c_int,
368            height: ::std::os::raw::c_int,
369            fourcc: u32,
370            size: usize,
371            offset: usize,
372            expires: i64,
373            duration: i64,
374            pts: i64,
375            dts: i64,
376            cleanup: vsl_frame_cleanup,
377            userptr: *mut ::std::os::raw::c_void,
378        ) -> *mut VSLFrame,
379        ::libloading::Error,
380    >,
381    pub vsl_frame_init: Result<
382        unsafe extern "C" fn(
383            width: u32,
384            height: u32,
385            stride: u32,
386            fourcc: u32,
387            userptr: *mut ::std::os::raw::c_void,
388            cleanup: vsl_frame_cleanup,
389        ) -> *mut VSLFrame,
390        ::libloading::Error,
391    >,
392    pub vsl_frame_alloc: Result<
393        unsafe extern "C" fn(
394            frame: *mut VSLFrame,
395            path: *const ::std::os::raw::c_char,
396        ) -> ::std::os::raw::c_int,
397        ::libloading::Error,
398    >,
399    pub vsl_frame_unalloc: Result<unsafe extern "C" fn(frame: *mut VSLFrame), ::libloading::Error>,
400    pub vsl_frame_attach: Result<
401        unsafe extern "C" fn(
402            frame: *mut VSLFrame,
403            fd: ::std::os::raw::c_int,
404            size: usize,
405            offset: usize,
406        ) -> ::std::os::raw::c_int,
407        ::libloading::Error,
408    >,
409    pub vsl_frame_path: Result<
410        unsafe extern "C" fn(frame: *const VSLFrame) -> *const ::std::os::raw::c_char,
411        ::libloading::Error,
412    >,
413    pub vsl_frame_unregister:
414        Result<unsafe extern "C" fn(frame: *mut VSLFrame), ::libloading::Error>,
415    pub vsl_frame_copy: Result<
416        unsafe extern "C" fn(
417            target: *mut VSLFrame,
418            source: *mut VSLFrame,
419            crop: *const VSLRect,
420        ) -> ::std::os::raw::c_int,
421        ::libloading::Error,
422    >,
423    pub vsl_frame_userptr: Result<
424        unsafe extern "C" fn(frame: *mut VSLFrame) -> *mut ::std::os::raw::c_void,
425        ::libloading::Error,
426    >,
427    pub vsl_frame_set_userptr: Result<
428        unsafe extern "C" fn(frame: *mut VSLFrame, userptr: *mut ::std::os::raw::c_void),
429        ::libloading::Error,
430    >,
431    pub vsl_frame_wait: Result<
432        unsafe extern "C" fn(client: *mut VSLClient, until: i64) -> *mut VSLFrame,
433        ::libloading::Error,
434    >,
435    pub vsl_frame_release: Result<unsafe extern "C" fn(frame: *mut VSLFrame), ::libloading::Error>,
436    pub vsl_frame_trylock: Result<
437        unsafe extern "C" fn(frame: *mut VSLFrame) -> ::std::os::raw::c_int,
438        ::libloading::Error,
439    >,
440    pub vsl_frame_unlock: Result<
441        unsafe extern "C" fn(frame: *mut VSLFrame) -> ::std::os::raw::c_int,
442        ::libloading::Error,
443    >,
444    pub vsl_frame_serial:
445        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> i64, ::libloading::Error>,
446    pub vsl_frame_timestamp:
447        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> i64, ::libloading::Error>,
448    pub vsl_frame_duration:
449        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> i64, ::libloading::Error>,
450    pub vsl_frame_pts:
451        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> i64, ::libloading::Error>,
452    pub vsl_frame_dts:
453        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> i64, ::libloading::Error>,
454    pub vsl_frame_expires:
455        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> i64, ::libloading::Error>,
456    pub vsl_frame_fourcc:
457        Result<unsafe extern "C" fn(frame: *const VSLFrame) -> u32, ::libloading::Error>,
458    pub vsl_frame_width: Result<
459        unsafe extern "C" fn(frame: *const VSLFrame) -> ::std::os::raw::c_int,
460        ::libloading::Error,
461    >,
462    pub vsl_frame_height: Result<
463        unsafe extern "C" fn(frame: *const VSLFrame) -> ::std::os::raw::c_int,
464        ::libloading::Error,
465    >,
466    pub vsl_frame_stride: Result<
467        unsafe extern "C" fn(frame: *const VSLFrame) -> ::std::os::raw::c_int,
468        ::libloading::Error,
469    >,
470    pub vsl_frame_size: Result<
471        unsafe extern "C" fn(frame: *const VSLFrame) -> ::std::os::raw::c_int,
472        ::libloading::Error,
473    >,
474    pub vsl_frame_handle: Result<
475        unsafe extern "C" fn(frame: *const VSLFrame) -> ::std::os::raw::c_int,
476        ::libloading::Error,
477    >,
478    pub vsl_frame_paddr:
479        Result<unsafe extern "C" fn(frame: *mut VSLFrame) -> isize, ::libloading::Error>,
480    pub vsl_frame_mmap: Result<
481        unsafe extern "C" fn(frame: *mut VSLFrame, size: *mut usize) -> *mut ::std::os::raw::c_void,
482        ::libloading::Error,
483    >,
484    pub vsl_frame_munmap: Result<unsafe extern "C" fn(frame: *mut VSLFrame), ::libloading::Error>,
485    pub vsl_frame_sync: Result<
486        unsafe extern "C" fn(
487            frame: *const VSLFrame,
488            enable: ::std::os::raw::c_int,
489            mode: ::std::os::raw::c_int,
490        ) -> ::std::os::raw::c_int,
491        ::libloading::Error,
492    >,
493    pub vsl_fourcc_from_string: Result<
494        unsafe extern "C" fn(fourcc: *const ::std::os::raw::c_char) -> u32,
495        ::libloading::Error,
496    >,
497    pub vsl_encoder_create: Result<
498        unsafe extern "C" fn(
499            profile: VSLEncoderProfile,
500            outputFourcc: u32,
501            fps: ::std::os::raw::c_int,
502        ) -> *mut VSLEncoder,
503        ::libloading::Error,
504    >,
505    pub vsl_encoder_create_ex: Result<
506        unsafe extern "C" fn(
507            profile: VSLEncoderProfile,
508            outputFourcc: u32,
509            fps: ::std::os::raw::c_int,
510            backend: VSLCodecBackend,
511        ) -> *mut VSLEncoder,
512        ::libloading::Error,
513    >,
514    pub vsl_encoder_release:
515        Result<unsafe extern "C" fn(encoder: *mut VSLEncoder), ::libloading::Error>,
516    pub vsl_encode_frame: Result<
517        unsafe extern "C" fn(
518            encoder: *mut VSLEncoder,
519            source: *mut VSLFrame,
520            destination: *mut VSLFrame,
521            cropRegion: *const VSLRect,
522            keyframe: *mut ::std::os::raw::c_int,
523        ) -> ::std::os::raw::c_int,
524        ::libloading::Error,
525    >,
526    pub vsl_encoder_new_output_frame: Result<
527        unsafe extern "C" fn(
528            encoder: *const VSLEncoder,
529            width: ::std::os::raw::c_int,
530            height: ::std::os::raw::c_int,
531            duration: i64,
532            pts: i64,
533            dts: i64,
534        ) -> *mut VSLFrame,
535        ::libloading::Error,
536    >,
537    pub vsl_camera_open_device: Result<
538        unsafe extern "C" fn(filename: *const ::std::os::raw::c_char) -> *mut vsl_camera,
539        ::libloading::Error,
540    >,
541    pub vsl_camera_init_device: Result<
542        unsafe extern "C" fn(
543            ctx: *mut vsl_camera,
544            width: *mut ::std::os::raw::c_int,
545            height: *mut ::std::os::raw::c_int,
546            buf_count: *mut ::std::os::raw::c_int,
547            fourcc: *mut u32,
548        ) -> ::std::os::raw::c_int,
549        ::libloading::Error,
550    >,
551    pub vsl_camera_mirror: Result<
552        unsafe extern "C" fn(ctx: *const vsl_camera, mirror: bool) -> ::std::os::raw::c_int,
553        ::libloading::Error,
554    >,
555    pub vsl_camera_mirror_v: Result<
556        unsafe extern "C" fn(ctx: *const vsl_camera, mirror: bool) -> ::std::os::raw::c_int,
557        ::libloading::Error,
558    >,
559    pub vsl_camera_start_capturing: Result<
560        unsafe extern "C" fn(ctx: *mut vsl_camera) -> ::std::os::raw::c_int,
561        ::libloading::Error,
562    >,
563    pub vsl_camera_get_data: Result<
564        unsafe extern "C" fn(ctx: *mut vsl_camera) -> *mut vsl_camera_buffer,
565        ::libloading::Error,
566    >,
567    pub vsl_camera_release_buffer: Result<
568        unsafe extern "C" fn(
569            ctx: *mut vsl_camera,
570            buffer: *const vsl_camera_buffer,
571        ) -> ::std::os::raw::c_int,
572        ::libloading::Error,
573    >,
574    pub vsl_camera_stop_capturing: Result<
575        unsafe extern "C" fn(ctx: *const vsl_camera) -> ::std::os::raw::c_int,
576        ::libloading::Error,
577    >,
578    pub vsl_camera_uninit_device:
579        Result<unsafe extern "C" fn(ctx: *mut vsl_camera), ::libloading::Error>,
580    pub vsl_camera_close_device:
581        Result<unsafe extern "C" fn(ctx: *mut vsl_camera), ::libloading::Error>,
582    pub vsl_camera_is_dmabuf_supported: Result<
583        unsafe extern "C" fn(ctx: *const vsl_camera) -> ::std::os::raw::c_int,
584        ::libloading::Error,
585    >,
586    pub vsl_camera_get_queued_buf_count: Result<
587        unsafe extern "C" fn(ctx: *const vsl_camera) -> ::std::os::raw::c_int,
588        ::libloading::Error,
589    >,
590    pub vsl_camera_buffer_mmap: Result<
591        unsafe extern "C" fn(buffer: *mut vsl_camera_buffer) -> *mut ::std::os::raw::c_void,
592        ::libloading::Error,
593    >,
594    pub vsl_camera_buffer_dma_fd: Result<
595        unsafe extern "C" fn(buffer: *const vsl_camera_buffer) -> ::std::os::raw::c_int,
596        ::libloading::Error,
597    >,
598    pub vsl_camera_buffer_phys_addr:
599        Result<unsafe extern "C" fn(buffer: *const vsl_camera_buffer) -> u64, ::libloading::Error>,
600    pub vsl_camera_buffer_length:
601        Result<unsafe extern "C" fn(buffer: *const vsl_camera_buffer) -> u32, ::libloading::Error>,
602    pub vsl_camera_buffer_fourcc:
603        Result<unsafe extern "C" fn(buffer: *const vsl_camera_buffer) -> u32, ::libloading::Error>,
604    pub vsl_camera_buffer_timestamp: Result<
605        unsafe extern "C" fn(
606            buffer: *const vsl_camera_buffer,
607            seconds: *mut i64,
608            nanoseconds: *mut i64,
609        ),
610        ::libloading::Error,
611    >,
612    pub vsl_camera_enum_fmts: Result<
613        unsafe extern "C" fn(
614            ctx: *const vsl_camera,
615            codes: *mut u32,
616            size: ::std::os::raw::c_int,
617        ) -> ::std::os::raw::c_int,
618        ::libloading::Error,
619    >,
620    pub vsl_camera_enum_mplane_fmts: Result<
621        unsafe extern "C" fn(
622            ctx: *const vsl_camera,
623            codes: *mut u32,
624            size: ::std::os::raw::c_int,
625        ) -> ::std::os::raw::c_int,
626        ::libloading::Error,
627    >,
628    pub vsl_decoder_create: Result<
629        unsafe extern "C" fn(codec: VSLDecoderCodec, fps: ::std::os::raw::c_int) -> *mut VSLDecoder,
630        ::libloading::Error,
631    >,
632    pub vsl_decoder_create_ex: Result<
633        unsafe extern "C" fn(
634            codec: u32,
635            fps: ::std::os::raw::c_int,
636            backend: VSLCodecBackend,
637        ) -> *mut VSLDecoder,
638        ::libloading::Error,
639    >,
640    pub vsl_decode_frame: Result<
641        unsafe extern "C" fn(
642            decoder: *mut VSLDecoder,
643            data: *const ::std::os::raw::c_void,
644            data_length: ::std::os::raw::c_uint,
645            bytes_used: *mut usize,
646            output_frame: *mut *mut VSLFrame,
647        ) -> VSLDecoderRetCode,
648        ::libloading::Error,
649    >,
650    pub vsl_decoder_width: Result<
651        unsafe extern "C" fn(decoder: *const VSLDecoder) -> ::std::os::raw::c_int,
652        ::libloading::Error,
653    >,
654    pub vsl_decoder_height: Result<
655        unsafe extern "C" fn(decoder: *const VSLDecoder) -> ::std::os::raw::c_int,
656        ::libloading::Error,
657    >,
658    pub vsl_decoder_crop:
659        Result<unsafe extern "C" fn(decoder: *const VSLDecoder) -> VSLRect, ::libloading::Error>,
660    pub vsl_decoder_release: Result<
661        unsafe extern "C" fn(decoder: *mut VSLDecoder) -> ::std::os::raw::c_int,
662        ::libloading::Error,
663    >,
664    pub vsl_v4l2_enumerate:
665        Result<unsafe extern "C" fn() -> *mut VSLDeviceList, ::libloading::Error>,
666    pub vsl_v4l2_enumerate_type: Result<
667        unsafe extern "C" fn(type_mask: VSLDeviceType) -> *mut VSLDeviceList,
668        ::libloading::Error,
669    >,
670    pub vsl_v4l2_device_list_free:
671        Result<unsafe extern "C" fn(list: *mut VSLDeviceList), ::libloading::Error>,
672    pub vsl_v4l2_find_encoder: Result<
673        unsafe extern "C" fn(codec_fourcc: u32) -> *const ::std::os::raw::c_char,
674        ::libloading::Error,
675    >,
676    pub vsl_v4l2_find_decoder: Result<
677        unsafe extern "C" fn(codec_fourcc: u32) -> *const ::std::os::raw::c_char,
678        ::libloading::Error,
679    >,
680    pub vsl_v4l2_find_camera: Result<
681        unsafe extern "C" fn(format_fourcc: u32) -> *const ::std::os::raw::c_char,
682        ::libloading::Error,
683    >,
684    pub vsl_v4l2_find_camera_with_resolution: Result<
685        unsafe extern "C" fn(
686            format_fourcc: u32,
687            width: u32,
688            height: u32,
689        ) -> *const ::std::os::raw::c_char,
690        ::libloading::Error,
691    >,
692    pub vsl_v4l2_device_enum_formats: Result<
693        unsafe extern "C" fn(device: *mut VSLDevice) -> ::std::os::raw::c_int,
694        ::libloading::Error,
695    >,
696    pub vsl_v4l2_enum_resolutions: Result<
697        unsafe extern "C" fn(
698            device: *const VSLDevice,
699            fourcc: u32,
700            count: *mut usize,
701        ) -> *mut VSLResolution,
702        ::libloading::Error,
703    >,
704    pub vsl_v4l2_device_supports_format: Result<
705        unsafe extern "C" fn(device: *const VSLDevice, fourcc: u32, capture: bool) -> bool,
706        ::libloading::Error,
707    >,
708    pub vsl_v4l2_alloc_userptr: Result<
709        unsafe extern "C" fn(
710            size: usize,
711            dma_fd: *mut ::std::os::raw::c_int,
712        ) -> *mut ::std::os::raw::c_void,
713        ::libloading::Error,
714    >,
715    pub vsl_v4l2_free_userptr: Result<
716        unsafe extern "C" fn(
717            ptr: *mut ::std::os::raw::c_void,
718            size: usize,
719            dma_fd: ::std::os::raw::c_int,
720        ),
721        ::libloading::Error,
722    >,
723    pub vsl_v4l2_device_type_name: Result<
724        unsafe extern "C" fn(type_: VSLDeviceType) -> *const ::std::os::raw::c_char,
725        ::libloading::Error,
726    >,
727    pub vsl_v4l2_is_compressed_format:
728        Result<unsafe extern "C" fn(fourcc: u32) -> bool, ::libloading::Error>,
729    pub vsl_v4l2_fourcc_to_string: Result<
730        unsafe extern "C" fn(
731            fourcc: u32,
732            buf: *mut ::std::os::raw::c_char,
733        ) -> *mut ::std::os::raw::c_char,
734        ::libloading::Error,
735    >,
736}
737impl VideoStreamLibrary {
738    pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
739    where
740        P: ::libloading::AsFilename,
741    {
742        let library = ::libloading::Library::new(path)?;
743        Self::from_library(library)
744    }
745    pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
746    where
747        L: Into<::libloading::Library>,
748    {
749        let __library = library.into();
750        let vsl_version = __library.get(b"vsl_version\0").map(|sym| *sym);
751        let vsl_timestamp = __library.get(b"vsl_timestamp\0").map(|sym| *sym);
752        let vsl_host_init = __library.get(b"vsl_host_init\0").map(|sym| *sym);
753        let vsl_host_release = __library.get(b"vsl_host_release\0").map(|sym| *sym);
754        let vsl_host_path = __library.get(b"vsl_host_path\0").map(|sym| *sym);
755        let vsl_host_poll = __library.get(b"vsl_host_poll\0").map(|sym| *sym);
756        let vsl_host_service = __library.get(b"vsl_host_service\0").map(|sym| *sym);
757        let vsl_host_process = __library.get(b"vsl_host_process\0").map(|sym| *sym);
758        let vsl_host_sockets = __library.get(b"vsl_host_sockets\0").map(|sym| *sym);
759        let vsl_host_post = __library.get(b"vsl_host_post\0").map(|sym| *sym);
760        let vsl_host_drop = __library.get(b"vsl_host_drop\0").map(|sym| *sym);
761        let vsl_client_init = __library.get(b"vsl_client_init\0").map(|sym| *sym);
762        let vsl_client_release = __library.get(b"vsl_client_release\0").map(|sym| *sym);
763        let vsl_client_disconnect = __library.get(b"vsl_client_disconnect\0").map(|sym| *sym);
764        let vsl_client_userptr = __library.get(b"vsl_client_userptr\0").map(|sym| *sym);
765        let vsl_client_path = __library.get(b"vsl_client_path\0").map(|sym| *sym);
766        let vsl_client_set_timeout = __library.get(b"vsl_client_set_timeout\0").map(|sym| *sym);
767        let vsl_frame_register = __library.get(b"vsl_frame_register\0").map(|sym| *sym);
768        let vsl_frame_init = __library.get(b"vsl_frame_init\0").map(|sym| *sym);
769        let vsl_frame_alloc = __library.get(b"vsl_frame_alloc\0").map(|sym| *sym);
770        let vsl_frame_unalloc = __library.get(b"vsl_frame_unalloc\0").map(|sym| *sym);
771        let vsl_frame_attach = __library.get(b"vsl_frame_attach\0").map(|sym| *sym);
772        let vsl_frame_path = __library.get(b"vsl_frame_path\0").map(|sym| *sym);
773        let vsl_frame_unregister = __library.get(b"vsl_frame_unregister\0").map(|sym| *sym);
774        let vsl_frame_copy = __library.get(b"vsl_frame_copy\0").map(|sym| *sym);
775        let vsl_frame_userptr = __library.get(b"vsl_frame_userptr\0").map(|sym| *sym);
776        let vsl_frame_set_userptr = __library.get(b"vsl_frame_set_userptr\0").map(|sym| *sym);
777        let vsl_frame_wait = __library.get(b"vsl_frame_wait\0").map(|sym| *sym);
778        let vsl_frame_release = __library.get(b"vsl_frame_release\0").map(|sym| *sym);
779        let vsl_frame_trylock = __library.get(b"vsl_frame_trylock\0").map(|sym| *sym);
780        let vsl_frame_unlock = __library.get(b"vsl_frame_unlock\0").map(|sym| *sym);
781        let vsl_frame_serial = __library.get(b"vsl_frame_serial\0").map(|sym| *sym);
782        let vsl_frame_timestamp = __library.get(b"vsl_frame_timestamp\0").map(|sym| *sym);
783        let vsl_frame_duration = __library.get(b"vsl_frame_duration\0").map(|sym| *sym);
784        let vsl_frame_pts = __library.get(b"vsl_frame_pts\0").map(|sym| *sym);
785        let vsl_frame_dts = __library.get(b"vsl_frame_dts\0").map(|sym| *sym);
786        let vsl_frame_expires = __library.get(b"vsl_frame_expires\0").map(|sym| *sym);
787        let vsl_frame_fourcc = __library.get(b"vsl_frame_fourcc\0").map(|sym| *sym);
788        let vsl_frame_width = __library.get(b"vsl_frame_width\0").map(|sym| *sym);
789        let vsl_frame_height = __library.get(b"vsl_frame_height\0").map(|sym| *sym);
790        let vsl_frame_stride = __library.get(b"vsl_frame_stride\0").map(|sym| *sym);
791        let vsl_frame_size = __library.get(b"vsl_frame_size\0").map(|sym| *sym);
792        let vsl_frame_handle = __library.get(b"vsl_frame_handle\0").map(|sym| *sym);
793        let vsl_frame_paddr = __library.get(b"vsl_frame_paddr\0").map(|sym| *sym);
794        let vsl_frame_mmap = __library.get(b"vsl_frame_mmap\0").map(|sym| *sym);
795        let vsl_frame_munmap = __library.get(b"vsl_frame_munmap\0").map(|sym| *sym);
796        let vsl_frame_sync = __library.get(b"vsl_frame_sync\0").map(|sym| *sym);
797        let vsl_fourcc_from_string = __library.get(b"vsl_fourcc_from_string\0").map(|sym| *sym);
798        let vsl_encoder_create = __library.get(b"vsl_encoder_create\0").map(|sym| *sym);
799        let vsl_encoder_create_ex = __library.get(b"vsl_encoder_create_ex\0").map(|sym| *sym);
800        let vsl_encoder_release = __library.get(b"vsl_encoder_release\0").map(|sym| *sym);
801        let vsl_encode_frame = __library.get(b"vsl_encode_frame\0").map(|sym| *sym);
802        let vsl_encoder_new_output_frame = __library
803            .get(b"vsl_encoder_new_output_frame\0")
804            .map(|sym| *sym);
805        let vsl_camera_open_device = __library.get(b"vsl_camera_open_device\0").map(|sym| *sym);
806        let vsl_camera_init_device = __library.get(b"vsl_camera_init_device\0").map(|sym| *sym);
807        let vsl_camera_mirror = __library.get(b"vsl_camera_mirror\0").map(|sym| *sym);
808        let vsl_camera_mirror_v = __library.get(b"vsl_camera_mirror_v\0").map(|sym| *sym);
809        let vsl_camera_start_capturing = __library
810            .get(b"vsl_camera_start_capturing\0")
811            .map(|sym| *sym);
812        let vsl_camera_get_data = __library.get(b"vsl_camera_get_data\0").map(|sym| *sym);
813        let vsl_camera_release_buffer = __library
814            .get(b"vsl_camera_release_buffer\0")
815            .map(|sym| *sym);
816        let vsl_camera_stop_capturing = __library
817            .get(b"vsl_camera_stop_capturing\0")
818            .map(|sym| *sym);
819        let vsl_camera_uninit_device = __library.get(b"vsl_camera_uninit_device\0").map(|sym| *sym);
820        let vsl_camera_close_device = __library.get(b"vsl_camera_close_device\0").map(|sym| *sym);
821        let vsl_camera_is_dmabuf_supported = __library
822            .get(b"vsl_camera_is_dmabuf_supported\0")
823            .map(|sym| *sym);
824        let vsl_camera_get_queued_buf_count = __library
825            .get(b"vsl_camera_get_queued_buf_count\0")
826            .map(|sym| *sym);
827        let vsl_camera_buffer_mmap = __library.get(b"vsl_camera_buffer_mmap\0").map(|sym| *sym);
828        let vsl_camera_buffer_dma_fd = __library.get(b"vsl_camera_buffer_dma_fd\0").map(|sym| *sym);
829        let vsl_camera_buffer_phys_addr = __library
830            .get(b"vsl_camera_buffer_phys_addr\0")
831            .map(|sym| *sym);
832        let vsl_camera_buffer_length = __library.get(b"vsl_camera_buffer_length\0").map(|sym| *sym);
833        let vsl_camera_buffer_fourcc = __library.get(b"vsl_camera_buffer_fourcc\0").map(|sym| *sym);
834        let vsl_camera_buffer_timestamp = __library
835            .get(b"vsl_camera_buffer_timestamp\0")
836            .map(|sym| *sym);
837        let vsl_camera_enum_fmts = __library.get(b"vsl_camera_enum_fmts\0").map(|sym| *sym);
838        let vsl_camera_enum_mplane_fmts = __library
839            .get(b"vsl_camera_enum_mplane_fmts\0")
840            .map(|sym| *sym);
841        let vsl_decoder_create = __library.get(b"vsl_decoder_create\0").map(|sym| *sym);
842        let vsl_decoder_create_ex = __library.get(b"vsl_decoder_create_ex\0").map(|sym| *sym);
843        let vsl_decode_frame = __library.get(b"vsl_decode_frame\0").map(|sym| *sym);
844        let vsl_decoder_width = __library.get(b"vsl_decoder_width\0").map(|sym| *sym);
845        let vsl_decoder_height = __library.get(b"vsl_decoder_height\0").map(|sym| *sym);
846        let vsl_decoder_crop = __library.get(b"vsl_decoder_crop\0").map(|sym| *sym);
847        let vsl_decoder_release = __library.get(b"vsl_decoder_release\0").map(|sym| *sym);
848        let vsl_v4l2_enumerate = __library.get(b"vsl_v4l2_enumerate\0").map(|sym| *sym);
849        let vsl_v4l2_enumerate_type = __library.get(b"vsl_v4l2_enumerate_type\0").map(|sym| *sym);
850        let vsl_v4l2_device_list_free = __library
851            .get(b"vsl_v4l2_device_list_free\0")
852            .map(|sym| *sym);
853        let vsl_v4l2_find_encoder = __library.get(b"vsl_v4l2_find_encoder\0").map(|sym| *sym);
854        let vsl_v4l2_find_decoder = __library.get(b"vsl_v4l2_find_decoder\0").map(|sym| *sym);
855        let vsl_v4l2_find_camera = __library.get(b"vsl_v4l2_find_camera\0").map(|sym| *sym);
856        let vsl_v4l2_find_camera_with_resolution = __library
857            .get(b"vsl_v4l2_find_camera_with_resolution\0")
858            .map(|sym| *sym);
859        let vsl_v4l2_device_enum_formats = __library
860            .get(b"vsl_v4l2_device_enum_formats\0")
861            .map(|sym| *sym);
862        let vsl_v4l2_enum_resolutions = __library
863            .get(b"vsl_v4l2_enum_resolutions\0")
864            .map(|sym| *sym);
865        let vsl_v4l2_device_supports_format = __library
866            .get(b"vsl_v4l2_device_supports_format\0")
867            .map(|sym| *sym);
868        let vsl_v4l2_alloc_userptr = __library.get(b"vsl_v4l2_alloc_userptr\0").map(|sym| *sym);
869        let vsl_v4l2_free_userptr = __library.get(b"vsl_v4l2_free_userptr\0").map(|sym| *sym);
870        let vsl_v4l2_device_type_name = __library
871            .get(b"vsl_v4l2_device_type_name\0")
872            .map(|sym| *sym);
873        let vsl_v4l2_is_compressed_format = __library
874            .get(b"vsl_v4l2_is_compressed_format\0")
875            .map(|sym| *sym);
876        let vsl_v4l2_fourcc_to_string = __library
877            .get(b"vsl_v4l2_fourcc_to_string\0")
878            .map(|sym| *sym);
879        Ok(VideoStreamLibrary {
880            __library,
881            vsl_version,
882            vsl_timestamp,
883            vsl_host_init,
884            vsl_host_release,
885            vsl_host_path,
886            vsl_host_poll,
887            vsl_host_service,
888            vsl_host_process,
889            vsl_host_sockets,
890            vsl_host_post,
891            vsl_host_drop,
892            vsl_client_init,
893            vsl_client_release,
894            vsl_client_disconnect,
895            vsl_client_userptr,
896            vsl_client_path,
897            vsl_client_set_timeout,
898            vsl_frame_register,
899            vsl_frame_init,
900            vsl_frame_alloc,
901            vsl_frame_unalloc,
902            vsl_frame_attach,
903            vsl_frame_path,
904            vsl_frame_unregister,
905            vsl_frame_copy,
906            vsl_frame_userptr,
907            vsl_frame_set_userptr,
908            vsl_frame_wait,
909            vsl_frame_release,
910            vsl_frame_trylock,
911            vsl_frame_unlock,
912            vsl_frame_serial,
913            vsl_frame_timestamp,
914            vsl_frame_duration,
915            vsl_frame_pts,
916            vsl_frame_dts,
917            vsl_frame_expires,
918            vsl_frame_fourcc,
919            vsl_frame_width,
920            vsl_frame_height,
921            vsl_frame_stride,
922            vsl_frame_size,
923            vsl_frame_handle,
924            vsl_frame_paddr,
925            vsl_frame_mmap,
926            vsl_frame_munmap,
927            vsl_frame_sync,
928            vsl_fourcc_from_string,
929            vsl_encoder_create,
930            vsl_encoder_create_ex,
931            vsl_encoder_release,
932            vsl_encode_frame,
933            vsl_encoder_new_output_frame,
934            vsl_camera_open_device,
935            vsl_camera_init_device,
936            vsl_camera_mirror,
937            vsl_camera_mirror_v,
938            vsl_camera_start_capturing,
939            vsl_camera_get_data,
940            vsl_camera_release_buffer,
941            vsl_camera_stop_capturing,
942            vsl_camera_uninit_device,
943            vsl_camera_close_device,
944            vsl_camera_is_dmabuf_supported,
945            vsl_camera_get_queued_buf_count,
946            vsl_camera_buffer_mmap,
947            vsl_camera_buffer_dma_fd,
948            vsl_camera_buffer_phys_addr,
949            vsl_camera_buffer_length,
950            vsl_camera_buffer_fourcc,
951            vsl_camera_buffer_timestamp,
952            vsl_camera_enum_fmts,
953            vsl_camera_enum_mplane_fmts,
954            vsl_decoder_create,
955            vsl_decoder_create_ex,
956            vsl_decode_frame,
957            vsl_decoder_width,
958            vsl_decoder_height,
959            vsl_decoder_crop,
960            vsl_decoder_release,
961            vsl_v4l2_enumerate,
962            vsl_v4l2_enumerate_type,
963            vsl_v4l2_device_list_free,
964            vsl_v4l2_find_encoder,
965            vsl_v4l2_find_decoder,
966            vsl_v4l2_find_camera,
967            vsl_v4l2_find_camera_with_resolution,
968            vsl_v4l2_device_enum_formats,
969            vsl_v4l2_enum_resolutions,
970            vsl_v4l2_device_supports_format,
971            vsl_v4l2_alloc_userptr,
972            vsl_v4l2_free_userptr,
973            vsl_v4l2_device_type_name,
974            vsl_v4l2_is_compressed_format,
975            vsl_v4l2_fourcc_to_string,
976        })
977    }
978    #[doc = " Returns the VideoStream Library version string.\n\n @return Version string in \"MAJOR.MINOR.PATCH\" format (e.g., \"1.5.4\")\n @since 1.0"]
979    pub unsafe fn vsl_version(&self) -> *const ::std::os::raw::c_char {
980        (self
981            .vsl_version
982            .as_ref()
983            .expect("Expected function, got error."))()
984    }
985    #[doc = " Returns the current timestamp in nanoseconds.\n\n Uses monotonic clock (CLOCK_MONOTONIC) for consistent timing across the\n system. This timestamp is used for frame timing and synchronization.\n\n @return Current time in nanoseconds since an unspecified starting point\n @since 1.0"]
986    pub unsafe fn vsl_timestamp(&self) -> i64 {
987        (self
988            .vsl_timestamp
989            .as_ref()
990            .expect("Expected function, got error."))()
991    }
992    #[doc = " Creates a host on the requested path for inter-process frame sharing.\n\n The host manages a UNIX domain socket at the specified path and accepts\n connections from clients. Frames posted to the host are broadcast to all\n connected clients.\n\n @param path UNIX socket path (filesystem or abstract). If path starts with\n             '/' it creates a filesystem socket, otherwise an abstract socket.\n @return Pointer to VSLHost object on success, NULL on failure (sets errno)\n @since 1.0\n @memberof VSLHost"]
993    pub unsafe fn vsl_host_init(&self, path: *const ::std::os::raw::c_char) -> *mut VSLHost {
994        (self
995            .vsl_host_init
996            .as_ref()
997            .expect("Expected function, got error."))(path)
998    }
999    #[doc = " Releases the host, disconnecting all clients and releasing any allocated\n memory.\n\n Closes the UNIX socket, disconnects all clients, and frees all resources\n associated with the host. Any posted frames are released.\n\n @param host The host to release\n @since 1.0\n @memberof VSLHost"]
1000    pub unsafe fn vsl_host_release(&self, host: *mut VSLHost) {
1001        (self
1002            .vsl_host_release
1003            .as_ref()
1004            .expect("Expected function, got error."))(host)
1005    }
1006    #[doc = " Returns the bound path of the host.\n\n @param host The host instance\n @return UNIX socket path string (owned by host, do not free)\n @since 1.0\n @memberof VSLHost"]
1007    pub unsafe fn vsl_host_path(&self, host: *const VSLHost) -> *const ::std::os::raw::c_char {
1008        (self
1009            .vsl_host_path
1010            .as_ref()
1011            .expect("Expected function, got error."))(host)
1012    }
1013    #[doc = " Polls the list of available connections for activity.\n\n Waits for socket activity (new connections or client messages) using poll().\n Should be called in a loop before vsl_host_process(). Note frames are only\n expired by vsl_host_process(), so the wait parameter should be no greater\n than the desired frame expiration time to ensure timely cleanup.\n\n @param host The host instance\n @param wait Timeout in milliseconds. If >0, poll waits up to this duration.\n             If 0, returns immediately. If <0, waits indefinitely.\n @return Number of sockets with activity, 0 on timeout, -1 on error (sets\n errno)\n @since 1.0\n @memberof VSLHost"]
1014    pub unsafe fn vsl_host_poll(&self, host: *mut VSLHost, wait: i64) -> ::std::os::raw::c_int {
1015        (self
1016            .vsl_host_poll
1017            .as_ref()
1018            .expect("Expected function, got error."))(host, wait)
1019    }
1020    #[doc = " Services a single client socket.\n\n Processes messages from a specific client socket. Does not accept new\n connections - use vsl_host_process() for that. Useful when you need to\n track errors for individual clients.\n\n @param host The host instance\n @param sock The client socket file descriptor to service\n @return 0 on success, -1 on error (sets errno, EPIPE if client disconnected)\n @since 1.0\n @memberof VSLHost"]
1021    pub unsafe fn vsl_host_service(
1022        &self,
1023        host: *mut VSLHost,
1024        sock: ::std::os::raw::c_int,
1025    ) -> ::std::os::raw::c_int {
1026        (self
1027            .vsl_host_service
1028            .as_ref()
1029            .expect("Expected function, got error."))(host, sock)
1030    }
1031    #[doc = " Process host tasks: expire old frames and service one client connection.\n\n First expires frames past their lifetime, then services the first available\n connection (accepting new clients or processing client messages). Should be\n called in a loop, typically after vsl_host_poll() indicates activity.\n\n @param host The host instance\n @return 0 on success, -1 on error (sets errno, ETIMEDOUT if no activity)\n @since 1.0\n @memberof VSLHost"]
1032    pub unsafe fn vsl_host_process(&self, host: *mut VSLHost) -> ::std::os::raw::c_int {
1033        (self
1034            .vsl_host_process
1035            .as_ref()
1036            .expect("Expected function, got error."))(host)
1037    }
1038    #[doc = " Request a copy of the sockets managed by the host.\n\n Returns socket file descriptors for the host's listening socket and all\n connected client sockets. The first socket is always the listening socket.\n The array should be refreshed frequently as sockets may become stale.\n\n Thread-safe: allows one thread to use sockets for messaging while another\n polls for reads.\n\n @param host The host instance\n @param n_sockets Size of the sockets array buffer\n @param sockets Buffer to receive socket file descriptors\n @param max_sockets If provided, populated with n_clients+1 (total sockets)\n @return 0 on success, -1 on error (sets errno to ENOBUFS if buffer too small)\n @since 1.0\n @memberof VSLHost"]
1039    pub unsafe fn vsl_host_sockets(
1040        &self,
1041        host: *mut VSLHost,
1042        n_sockets: usize,
1043        sockets: *mut ::std::os::raw::c_int,
1044        max_sockets: *mut usize,
1045    ) -> ::std::os::raw::c_int {
1046        (self
1047            .vsl_host_sockets
1048            .as_ref()
1049            .expect("Expected function, got error."))(host, n_sockets, sockets, max_sockets)
1050    }
1051    #[doc = " Registers the frame with the host and publishes it to subscribers.\n\n Transfers ownership of the frame to the host. The frame is broadcast to all\n connected clients and will be automatically released when it expires. Do not\n call vsl_frame_release() on frames posted to the host.\n\n @param host The host instance\n @param frame Frame to post (ownership transferred to host)\n @param expires Expiration time in nanoseconds (absolute, from\n vsl_timestamp())\n @param duration Frame duration in nanoseconds (-1 if unknown)\n @param pts Presentation timestamp in nanoseconds (-1 if unknown)\n @param dts Decode timestamp in nanoseconds (-1 if unknown)\n @return 0 on success, -1 on error (sets errno)\n @since 1.3\n @memberof VSLHost"]
1052    pub unsafe fn vsl_host_post(
1053        &self,
1054        host: *mut VSLHost,
1055        frame: *mut VSLFrame,
1056        expires: i64,
1057        duration: i64,
1058        pts: i64,
1059        dts: i64,
1060    ) -> ::std::os::raw::c_int {
1061        (self
1062            .vsl_host_post
1063            .as_ref()
1064            .expect("Expected function, got error."))(
1065            host, frame, expires, duration, pts, dts
1066        )
1067    }
1068    #[doc = " Drops the frame from the host.\n\n Removes the host association of the frame and returns ownership to the\n caller. Can be used to cancel a previously posted frame before it expires.\n\n @param host The host instance\n @param frame Frame to drop from host\n @return 0 on success, -1 on error (sets errno)\n @since 1.3\n @memberof VSLHost"]
1069    pub unsafe fn vsl_host_drop(
1070        &self,
1071        host: *mut VSLHost,
1072        frame: *mut VSLFrame,
1073    ) -> ::std::os::raw::c_int {
1074        (self
1075            .vsl_host_drop
1076            .as_ref()
1077            .expect("Expected function, got error."))(host, frame)
1078    }
1079    #[doc = " Creates a client and connects to the host at the provided path.\n\n Establishes a connection to a VSLHost via UNIX domain socket. The client\n can receive frames broadcast by the host.\n\n @param path UNIX socket path matching the host's path\n @param userptr Optional user data pointer (retrievable via\n vsl_client_userptr)\n @param reconnect If true, automatically reconnect if connection is lost\n @return Pointer to VSLClient object on success, NULL on failure (sets errno)\n @since 1.0\n @memberof VSLClient"]
1080    pub unsafe fn vsl_client_init(
1081        &self,
1082        path: *const ::std::os::raw::c_char,
1083        userptr: *mut ::std::os::raw::c_void,
1084        reconnect: bool,
1085    ) -> *mut VSLClient {
1086        (self
1087            .vsl_client_init
1088            .as_ref()
1089            .expect("Expected function, got error."))(path, userptr, reconnect)
1090    }
1091    #[doc = " Releases the client, disconnecting from the host and releasing allocated\n memory.\n\n Closes the socket connection, frees all resources, and invalidates any\n pending frames. Not thread-safe - use vsl_client_disconnect() for\n thread-safe disconnection before calling this.\n\n @param client The client to release\n @since 1.0\n @memberof VSLClient"]
1092    pub unsafe fn vsl_client_release(&self, client: *mut VSLClient) {
1093        (self
1094            .vsl_client_release
1095            .as_ref()
1096            .expect("Expected function, got error."))(client)
1097    }
1098    #[doc = " Disconnects from the VSLHost and stops all reconnection attempts.\n\n Thread-safe disconnect operation. Should be called before\n vsl_client_release() when shutting down a client session from a different\n thread.\n\n @param client The client to disconnect\n @since 1.1\n @memberof VSLClient"]
1099    pub unsafe fn vsl_client_disconnect(&self, client: *mut VSLClient) {
1100        (self
1101            .vsl_client_disconnect
1102            .as_ref()
1103            .expect("Expected function, got error."))(client)
1104    }
1105    #[doc = " Returns the optional userptr associated with this client connection.\n\n @param client The client instance\n @return User pointer provided to vsl_client_init(), or NULL if none\n @since 1.0\n @memberof VSLClient"]
1106    pub unsafe fn vsl_client_userptr(&self, client: *mut VSLClient) -> *mut ::std::os::raw::c_void {
1107        (self
1108            .vsl_client_userptr
1109            .as_ref()
1110            .expect("Expected function, got error."))(client)
1111    }
1112    #[doc = " Returns the path on which the client has connected to the host.\n\n @param client The client instance\n @return UNIX socket path string (owned by client, do not free)\n @since 1.0\n @memberof VSLClient"]
1113    pub unsafe fn vsl_client_path(
1114        &self,
1115        client: *const VSLClient,
1116    ) -> *const ::std::os::raw::c_char {
1117        (self
1118            .vsl_client_path
1119            .as_ref()
1120            .expect("Expected function, got error."))(client)
1121    }
1122    #[doc = " Sets the socket timeout for this client.\n\n Configures how long socket operations wait before timing out. Affects\n recv() calls when waiting for frames from the host.\n\n @param client The client instance\n @param timeout Timeout in seconds (e.g., 1.0 for 1 second)\n @since 1.0\n @memberof VSLClient"]
1123    pub unsafe fn vsl_client_set_timeout(&self, client: *mut VSLClient, timeout: f32) {
1124        (self
1125            .vsl_client_set_timeout
1126            .as_ref()
1127            .expect("Expected function, got error."))(client, timeout)
1128    }
1129    #[doc = " Creates and posts the video frame along with optional user pointer to any\n arbitrary data.  Typically it would be used for holding a reference to\n the host's view of the frame handle.\n\n @deprecated The vsl_frame_register function is deprecated in favour of using\n the @ref vsl_frame_init(), @ref vsl_frame_alloc() or @ref vsl_frame_attach(),\n and @ref vsl_host_post() functions which separate frame creation from posting\n to the host for publishing to subscribers.\n\n @note A frame created through this function is owned by the host and should\n not have @ref vsl_frame_release called on it.  This will be managed by the\n host on frame expiry.\n\n @memberof VSLFrame"]
1130    pub unsafe fn vsl_frame_register(
1131        &self,
1132        host: *mut VSLHost,
1133        serial: i64,
1134        handle: ::std::os::raw::c_int,
1135        width: ::std::os::raw::c_int,
1136        height: ::std::os::raw::c_int,
1137        fourcc: u32,
1138        size: usize,
1139        offset: usize,
1140        expires: i64,
1141        duration: i64,
1142        pts: i64,
1143        dts: i64,
1144        cleanup: vsl_frame_cleanup,
1145        userptr: *mut ::std::os::raw::c_void,
1146    ) -> *mut VSLFrame {
1147        (self
1148            .vsl_frame_register
1149            .as_ref()
1150            .expect("Expected function, got error."))(
1151            host, serial, handle, width, height, fourcc, size, offset, expires, duration, pts, dts,
1152            cleanup, userptr,
1153        )
1154    }
1155    #[doc = " Initializes a VSLFrame without underlying frame buffer.\n\n Creates a frame descriptor with specified dimensions and format. To allocate\n backing memory, call vsl_frame_alloc(). To attach existing memory (e.g.,\n DmaBuf from camera), call vsl_frame_attach().\n\n @param width Frame width in pixels\n @param height Frame height in pixels\n @param stride Row stride in bytes (0 to auto-calculate from width)\n @param fourcc Pixel format as FOURCC code (e.g., VSL_FOURCC('N','V','1','2'))\n @param userptr Optional user data pointer\n @param cleanup Optional cleanup callback invoked on vsl_frame_release()\n @return Pointer to VSLFrame object, or NULL on failure\n @since 1.3\n @memberof VSLFrame"]
1156    pub unsafe fn vsl_frame_init(
1157        &self,
1158        width: u32,
1159        height: u32,
1160        stride: u32,
1161        fourcc: u32,
1162        userptr: *mut ::std::os::raw::c_void,
1163        cleanup: vsl_frame_cleanup,
1164    ) -> *mut VSLFrame {
1165        (self
1166            .vsl_frame_init
1167            .as_ref()
1168            .expect("Expected function, got error."))(
1169            width, height, stride, fourcc, userptr, cleanup,
1170        )
1171    }
1172    #[doc = " Allocates the underlying memory for the frame.\n\n Prefers DmaBuf allocation for zero-copy, falling back to POSIX shared memory\n if DmaBuf unavailable. If path is provided, it determines allocation type:\n - NULL: Try DmaBuf first, fallback to shared memory\n - Starts with \"/dev\": Use DmaBuf heap device at this path\n - Other paths: Use shared memory at this path\n\n Allocates height*stride bytes. For compressed formats (JPEG, H.264), the\n actual data size may be smaller. Use vsl_frame_copy() return value to get\n actual compressed size.\n\n @param frame Frame to allocate memory for\n @param path Optional allocation path (NULL for auto, /dev/... for DmaBuf\n heap)\n @return 0 on success, -1 on failure (sets errno)\n @since 1.3\n @memberof VSLFrame"]
1173    pub unsafe fn vsl_frame_alloc(
1174        &self,
1175        frame: *mut VSLFrame,
1176        path: *const ::std::os::raw::c_char,
1177    ) -> ::std::os::raw::c_int {
1178        (self
1179            .vsl_frame_alloc
1180            .as_ref()
1181            .expect("Expected function, got error."))(frame, path)
1182    }
1183    #[doc = " Frees the allocated buffer for this frame.\n\n Releases the underlying memory (DmaBuf or shared memory) but does not\n destroy the frame object. Use vsl_frame_release() to destroy the frame.\n\n @param frame Frame whose buffer should be freed\n @since 1.3\n @memberof VSLFrame"]
1184    pub unsafe fn vsl_frame_unalloc(&self, frame: *mut VSLFrame) {
1185        (self
1186            .vsl_frame_unalloc
1187            .as_ref()
1188            .expect("Expected function, got error."))(frame)
1189    }
1190    #[doc = " Attach the provided file descriptor to the VSLFrame.\n\n Associates an existing buffer (typically DmaBuf from camera or hardware\n accelerator) with the frame. The frame does not take ownership of the FD.\n\n @param frame Frame to attach buffer to\n @param fd File descriptor (typically DmaBuf) to attach\n @param size Buffer size in bytes (0 to use stride*height)\n @param offset Byte offset to frame data start (must provide size if offset>0)\n @return 0 on success, -1 on failure (sets errno)\n @since 1.3\n @memberof VSLFrame"]
1191    pub unsafe fn vsl_frame_attach(
1192        &self,
1193        frame: *mut VSLFrame,
1194        fd: ::std::os::raw::c_int,
1195        size: usize,
1196        offset: usize,
1197    ) -> ::std::os::raw::c_int {
1198        (self
1199            .vsl_frame_attach
1200            .as_ref()
1201            .expect("Expected function, got error."))(frame, fd, size, offset)
1202    }
1203    #[doc = " Returns the path to the underlying VSLFrame buffer.\n\n Returns the filesystem path for shared memory buffers or DmaBuf heap devices.\n Not available for externally created DmaBufs (e.g., from camera driver).\n\n @warning Not thread-safe. Use the returned string immediately.\n\n @param frame The frame instance\n @return Buffer path string (owned by frame), or NULL if unavailable\n @since 1.3\n @memberof VSLFrame"]
1204    pub unsafe fn vsl_frame_path(&self, frame: *const VSLFrame) -> *const ::std::os::raw::c_char {
1205        (self
1206            .vsl_frame_path
1207            .as_ref()
1208            .expect("Expected function, got error."))(frame)
1209    }
1210    #[doc = " Unregisters the frame, removing it from the host pool.\n\n @deprecated Use vsl_frame_release() instead, which handles cleanup properly.\n\n @param frame Frame to unregister\n @since 1.0\n @memberof VSLFrame"]
1211    pub unsafe fn vsl_frame_unregister(&self, frame: *mut VSLFrame) {
1212        (self
1213            .vsl_frame_unregister
1214            .as_ref()
1215            .expect("Expected function, got error."))(frame)
1216    }
1217    #[doc = " Copy the source frame into the target frame, with optional source crop.\n\n Handles format conversion, rescaling, and cropping using hardware\n acceleration when available (G2D on i.MX8). Both frames can be host or client\n frames. Automatically locks frames during copy (safe for free-standing frames\n too).\n\n Copy sequence: 1) Crop source, 2) Convert format, 3) Scale to target size.\n\n @warning Copying to/from a posted frame may cause visual tearing.\n\n @param target Destination frame (receives copied data)\n @param source Source frame to copy from\n @param crop Optional crop region in source coordinates (NULL for full frame)\n @return Number of bytes copied on success, -1 on failure (sets errno)\n @since 1.3\n @memberof VSLFrame"]
1218    pub unsafe fn vsl_frame_copy(
1219        &self,
1220        target: *mut VSLFrame,
1221        source: *mut VSLFrame,
1222        crop: *const VSLRect,
1223    ) -> ::std::os::raw::c_int {
1224        (self
1225            .vsl_frame_copy
1226            .as_ref()
1227            .expect("Expected function, got error."))(target, source, crop)
1228    }
1229    #[doc = " Returns the user pointer associated with this frame.\n\n @param frame The frame instance\n @return User pointer provided to vsl_frame_init(), or NULL if none\n @since 1.0\n @memberof VSLFrame"]
1230    pub unsafe fn vsl_frame_userptr(&self, frame: *mut VSLFrame) -> *mut ::std::os::raw::c_void {
1231        (self
1232            .vsl_frame_userptr
1233            .as_ref()
1234            .expect("Expected function, got error."))(frame)
1235    }
1236    #[doc = " Associate userptr with this frame.\n\n Sets or updates the user data pointer for this frame.\n\n @param frame The frame instance\n @param userptr User data pointer to associate with frame\n @since 1.0\n @memberof VSLFrame"]
1237    pub unsafe fn vsl_frame_set_userptr(
1238        &self,
1239        frame: *mut VSLFrame,
1240        userptr: *mut ::std::os::raw::c_void,
1241    ) {
1242        (self
1243            .vsl_frame_set_userptr
1244            .as_ref()
1245            .expect("Expected function, got error."))(frame, userptr)
1246    }
1247    #[doc = " Waits for a frame to arrive and returns a new frame object.\n\n Blocks until the host broadcasts a new frame. Frames with timestamp less\n than 'until' are ignored (useful for skipping old frames after a pause).\n\n Caller must lock the frame (vsl_frame_trylock) before accessing data,\n then unlock and release when done.\n\n @param client The client instance\n @param until Minimum timestamp in nanoseconds (0 to accept next frame)\n @return Pointer to VSLFrame object, or NULL on error (sets errno)\n @since 1.0\n @memberof VSLFrame"]
1248    pub unsafe fn vsl_frame_wait(&self, client: *mut VSLClient, until: i64) -> *mut VSLFrame {
1249        (self
1250            .vsl_frame_wait
1251            .as_ref()
1252            .expect("Expected function, got error."))(client, until)
1253    }
1254    #[doc = " Releases the frame, performing required cleanup.\n\n Unmaps memory if mapped, unlocks if locked. If frame was posted to a host,\n removes it. If client frame, decrements reference count. Invokes cleanup\n callback if registered.\n\n @param frame Frame to release\n @since 1.0\n @memberof VSLFrame"]
1255    pub unsafe fn vsl_frame_release(&self, frame: *mut VSLFrame) {
1256        (self
1257            .vsl_frame_release
1258            .as_ref()
1259            .expect("Expected function, got error."))(frame)
1260    }
1261    #[doc = " Attempts to lock the video frame.\n\n Locks the frame for exclusive access (prevents host from releasing it).\n Must be called before accessing frame data from a client. Always succeeds\n for host-owned frames.\n\n @param frame Frame to lock\n @return 0 on success, -1 on failure (frame expired or already unlocked)\n @since 1.0\n @memberof VSLFrame"]
1262    pub unsafe fn vsl_frame_trylock(&self, frame: *mut VSLFrame) -> ::std::os::raw::c_int {
1263        (self
1264            .vsl_frame_trylock
1265            .as_ref()
1266            .expect("Expected function, got error."))(frame)
1267    }
1268    #[doc = " Attempts to unlock the video frame.\n\n Releases the lock acquired by vsl_frame_trylock(), allowing the host to\n release the frame when it expires.\n\n @param frame Frame to unlock\n @return 0 on success, -1 on failure (sets errno)\n @since 1.0\n @memberof VSLFrame"]
1269    pub unsafe fn vsl_frame_unlock(&self, frame: *mut VSLFrame) -> ::std::os::raw::c_int {
1270        (self
1271            .vsl_frame_unlock
1272            .as_ref()
1273            .expect("Expected function, got error."))(frame)
1274    }
1275    #[doc = " Returns the serial frame count of the video frame.\n\n Frame serial is a monotonically increasing counter assigned by the host\n when frames are registered. Does not necessarily equal camera frame number.\n\n @param frame The frame instance\n @return Frame serial number (starts at 1)\n @since 1.0\n @memberof VSLFrame"]
1276    pub unsafe fn vsl_frame_serial(&self, frame: *const VSLFrame) -> i64 {
1277        (self
1278            .vsl_frame_serial
1279            .as_ref()
1280            .expect("Expected function, got error."))(frame)
1281    }
1282    #[doc = " Returns the timestamp for this frame in nanoseconds.\n\n Timestamp from vsl_timestamp() when frame was registered with host.\n Uses monotonic clock for consistent timing.\n\n @param frame The frame instance\n @return Frame timestamp in nanoseconds\n @since 1.0\n @memberof VSLFrame"]
1283    pub unsafe fn vsl_frame_timestamp(&self, frame: *const VSLFrame) -> i64 {
1284        (self
1285            .vsl_frame_timestamp
1286            .as_ref()
1287            .expect("Expected function, got error."))(frame)
1288    }
1289    #[doc = " Returns the duration for this frame in nanoseconds.\n\n Frame duration indicates how long this frame should be displayed.\n May be -1 if unknown or not applicable.\n\n @param frame The frame instance\n @return Frame duration in nanoseconds, or -1 if unknown\n @since 1.0\n @memberof VSLFrame"]
1290    pub unsafe fn vsl_frame_duration(&self, frame: *const VSLFrame) -> i64 {
1291        (self
1292            .vsl_frame_duration
1293            .as_ref()
1294            .expect("Expected function, got error."))(frame)
1295    }
1296    #[doc = " Returns the presentation timestamp for this frame in nanoseconds.\n\n PTS indicates when this frame should be presented/displayed in a stream.\n May be -1 if unknown or not applicable.\n\n @param frame The frame instance\n @return Presentation timestamp in nanoseconds, or -1 if unknown\n @since 1.0\n @memberof VSLFrame"]
1297    pub unsafe fn vsl_frame_pts(&self, frame: *const VSLFrame) -> i64 {
1298        (self
1299            .vsl_frame_pts
1300            .as_ref()
1301            .expect("Expected function, got error."))(frame)
1302    }
1303    #[doc = " Returns the decode timestamp for this frame in nanoseconds.\n\n DTS indicates when this frame should be decoded in a stream (important for\n B-frames in video codecs). May be -1 if unknown or not applicable.\n\n @param frame The frame instance\n @return Decode timestamp in nanoseconds, or -1 if unknown\n @since 1.0\n @memberof VSLFrame"]
1304    pub unsafe fn vsl_frame_dts(&self, frame: *const VSLFrame) -> i64 {
1305        (self
1306            .vsl_frame_dts
1307            .as_ref()
1308            .expect("Expected function, got error."))(frame)
1309    }
1310    #[doc = " Returns the expiration time for this frame in nanoseconds.\n\n Absolute timestamp (from vsl_timestamp()) when this frame will be expired\n by the host. Clients should lock frames before this time.\n\n @param frame The frame instance\n @return Expiration timestamp in nanoseconds\n @since 1.0\n @memberof VSLFrame"]
1311    pub unsafe fn vsl_frame_expires(&self, frame: *const VSLFrame) -> i64 {
1312        (self
1313            .vsl_frame_expires
1314            .as_ref()
1315            .expect("Expected function, got error."))(frame)
1316    }
1317    #[doc = " Returns the FOURCC code for the video frame.\n\n FOURCC identifies the pixel format (e.g., NV12, YUY2, JPEG, H264).\n Use VSL_FOURCC() macro to create fourcc codes.\n\n @param frame The frame instance\n @return FOURCC code as uint32_t\n @since 1.0\n @memberof VSLFrame"]
1318    pub unsafe fn vsl_frame_fourcc(&self, frame: *const VSLFrame) -> u32 {
1319        (self
1320            .vsl_frame_fourcc
1321            .as_ref()
1322            .expect("Expected function, got error."))(frame)
1323    }
1324    #[doc = " Returns the width in pixels of the video frame.\n\n @param frame The frame instance\n @return Frame width in pixels\n @since 1.0\n @memberof VSLFrame"]
1325    pub unsafe fn vsl_frame_width(&self, frame: *const VSLFrame) -> ::std::os::raw::c_int {
1326        (self
1327            .vsl_frame_width
1328            .as_ref()
1329            .expect("Expected function, got error."))(frame)
1330    }
1331    #[doc = " Returns the height in pixels of the video frame.\n\n @param frame The frame instance\n @return Frame height in pixels\n @since 1.0\n @memberof VSLFrame"]
1332    pub unsafe fn vsl_frame_height(&self, frame: *const VSLFrame) -> ::std::os::raw::c_int {
1333        (self
1334            .vsl_frame_height
1335            .as_ref()
1336            .expect("Expected function, got error."))(frame)
1337    }
1338    #[doc = " Returns the stride in bytes of the video frame.\n\n Stride is the number of bytes from the start of one row to the next.\n May be larger than width*bytes_per_pixel due to alignment requirements.\n\n @param frame The frame instance\n @return Row stride in bytes\n @since 1.3\n @memberof VSLFrame"]
1339    pub unsafe fn vsl_frame_stride(&self, frame: *const VSLFrame) -> ::std::os::raw::c_int {
1340        (self
1341            .vsl_frame_stride
1342            .as_ref()
1343            .expect("Expected function, got error."))(frame)
1344    }
1345    #[doc = " Returns the size in bytes of the video frame buffer.\n\n For uncompressed formats, this is stride*height. For compressed formats\n (JPEG, H.264), this is the maximum buffer size, not the actual data size.\n\n @param frame The frame instance\n @return Buffer size in bytes\n @since 1.0\n @memberof VSLFrame"]
1346    pub unsafe fn vsl_frame_size(&self, frame: *const VSLFrame) -> ::std::os::raw::c_int {
1347        (self
1348            .vsl_frame_size
1349            .as_ref()
1350            .expect("Expected function, got error."))(frame)
1351    }
1352    #[doc = " Returns the file descriptor for this frame.\n\n Returns the DmaBuf or shared memory file descriptor used for zero-copy\n sharing. Returns -1 if no file descriptor is associated (e.g., CPU-only\n memory).\n\n @param frame The frame instance\n @return File descriptor, or -1 if none\n @since 1.0\n @memberof VSLFrame"]
1353    pub unsafe fn vsl_frame_handle(&self, frame: *const VSLFrame) -> ::std::os::raw::c_int {
1354        (self
1355            .vsl_frame_handle
1356            .as_ref()
1357            .expect("Expected function, got error."))(frame)
1358    }
1359    #[doc = " Returns the physical address of the frame.\n\n Physical address is available for DMA-capable buffers on platforms where\n the kernel provides physical address translation (some i.MX platforms).\n Note: This function caches the physical address internally on first call.\n\n @param frame The frame instance\n @return Physical address, or MMAP_FAILED ((intptr_t)-1) if DMA not supported\n @since 1.0\n @memberof VSLFrame"]
1360    pub unsafe fn vsl_frame_paddr(&self, frame: *mut VSLFrame) -> isize {
1361        (self
1362            .vsl_frame_paddr
1363            .as_ref()
1364            .expect("Expected function, got error."))(frame)
1365    }
1366    #[doc = " Maps the frame into the process memory space.\n\n Creates a memory mapping for CPU access to frame data. Frame must be locked\n (vsl_frame_trylock) for the duration of the mapping. Call vsl_frame_munmap()\n when done.\n\n @param frame The frame instance\n @param size Optional pointer to receive mapped size in bytes (may be NULL)\n @return Pointer to mapped memory, or NULL on failure\n @since 1.0\n @memberof VSLFrame"]
1367    pub unsafe fn vsl_frame_mmap(
1368        &self,
1369        frame: *mut VSLFrame,
1370        size: *mut usize,
1371    ) -> *mut ::std::os::raw::c_void {
1372        (self
1373            .vsl_frame_mmap
1374            .as_ref()
1375            .expect("Expected function, got error."))(frame, size)
1376    }
1377    #[doc = " Unmaps the frame from the process memory space.\n\n Releases the memory mapping created by vsl_frame_mmap(). Should be called\n when done accessing frame data.\n\n @param frame The frame instance to unmap\n @since 1.0\n @memberof VSLFrame"]
1378    pub unsafe fn vsl_frame_munmap(&self, frame: *mut VSLFrame) {
1379        (self
1380            .vsl_frame_munmap
1381            .as_ref()
1382            .expect("Expected function, got error."))(frame)
1383    }
1384    #[doc = " Cache synchronization session control for DMA-backed buffers.\n\n Controls CPU cache coherency for DMA buffers. Automatically called by\n mmap/munmap, but can be used manually for in-place frame updates.\n\n Call with enable=1 before accessing, enable=0 after modifying.\n Mode: DMA_BUF_SYNC_READ (CPU reads), DMA_BUF_SYNC_WRITE (CPU writes),\n       or DMA_BUF_SYNC_RW (both).\n\n @param frame The frame object to synchronize\n @param enable 1 to start sync session, 0 to end it\n @param mode Sync mode: DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or\n DMA_BUF_SYNC_RW\n @return 0 on success, -1 on failure (sets errno)\n @since 1.3\n @memberof VSLFrame"]
1385    pub unsafe fn vsl_frame_sync(
1386        &self,
1387        frame: *const VSLFrame,
1388        enable: ::std::os::raw::c_int,
1389        mode: ::std::os::raw::c_int,
1390    ) -> ::std::os::raw::c_int {
1391        (self
1392            .vsl_frame_sync
1393            .as_ref()
1394            .expect("Expected function, got error."))(frame, enable, mode)
1395    }
1396    #[doc = " Returns a fourcc integer code from the string.\n\n Converts a 4-character string to FOURCC code. Example: \"NV12\" ->\n VSL_FOURCC('N','V','1','2').\n\n @param fourcc String containing exactly 4 characters (e.g., \"NV12\", \"YUY2\")\n @return FOURCC code as uint32_t, or 0 if invalid/unsupported\n @since 1.3"]
1397    pub unsafe fn vsl_fourcc_from_string(&self, fourcc: *const ::std::os::raw::c_char) -> u32 {
1398        (self
1399            .vsl_fourcc_from_string
1400            .as_ref()
1401            .expect("Expected function, got error."))(fourcc)
1402    }
1403    #[doc = " @brief Creates VSLEncoder instance\n\n @param profile VSLEncoderProfile determining encode quality\n @param outputFourcc fourcc code defining the codec\n @param fps output stream fps\n @return VSLEncoder* new encoder instance\n\n Every encoder instance must be released using vsl_encoder_release\n\n For Hantro VC8000e encoder initialization is performed when vsl_encode_frame\n is called for a first time"]
1404    pub unsafe fn vsl_encoder_create(
1405        &self,
1406        profile: VSLEncoderProfile,
1407        outputFourcc: u32,
1408        fps: ::std::os::raw::c_int,
1409    ) -> *mut VSLEncoder {
1410        (self
1411            .vsl_encoder_create
1412            .as_ref()
1413            .expect("Expected function, got error."))(profile, outputFourcc, fps)
1414    }
1415    #[doc = " @brief Creates VSLEncoder instance with explicit backend selection\n\n Extended version of vsl_encoder_create() that allows selecting a specific\n codec backend. Use this when you need to force V4L2 or Hantro backend.\n\n @param profile VSLEncoderProfile determining encode quality\n @param outputFourcc fourcc code defining the codec (H264 or HEVC)\n @param fps output stream fps\n @param backend Which backend to use (VSL_CODEC_BACKEND_AUTO, _V4L2, _HANTRO)\n @return VSLEncoder* new encoder instance, or NULL if backend unavailable\n\n @since 2.0"]
1416    pub unsafe fn vsl_encoder_create_ex(
1417        &self,
1418        profile: VSLEncoderProfile,
1419        outputFourcc: u32,
1420        fps: ::std::os::raw::c_int,
1421        backend: VSLCodecBackend,
1422    ) -> *mut VSLEncoder {
1423        (self
1424            .vsl_encoder_create_ex
1425            .as_ref()
1426            .expect("Expected function, got error."))(profile, outputFourcc, fps, backend)
1427    }
1428    #[doc = " @brief Destroys VSLEncoder instance\n\n Frees all resources associated with the encoder, including hardware\n resources. Do not use the encoder after calling this function.\n\n @param encoder VSLEncoder instance to destroy\n @since 1.3"]
1429    pub unsafe fn vsl_encoder_release(&self, encoder: *mut VSLEncoder) {
1430        (self
1431            .vsl_encoder_release
1432            .as_ref()
1433            .expect("Expected function, got error."))(encoder)
1434    }
1435    #[doc = " @brief Encode frame\n\n Encodes the source frame into the destination frame using hardware\n acceleration (Hantro VPU on i.MX8). First call initializes the encoder with\n the given parameters. Subsequent calls must use identical source/destination\n dimensions, formats, and crop region.\n\n @param encoder VSLEncoder instance\n @param source Source frame (raw video data)\n @param destination Pre-allocated destination frame (receives encoded data)\n @param cropRegion Optional crop region in source coordinates (NULL for no\n crop)\n @param keyframe Optional output: set to 1 if encoded frame is IDR/keyframe,\n                 0 otherwise. Pass NULL to ignore.\n @retval 0 on success\n @retval -1 on failure (check errno for details)\n @since 1.3"]
1436    pub unsafe fn vsl_encode_frame(
1437        &self,
1438        encoder: *mut VSLEncoder,
1439        source: *mut VSLFrame,
1440        destination: *mut VSLFrame,
1441        cropRegion: *const VSLRect,
1442        keyframe: *mut ::std::os::raw::c_int,
1443    ) -> ::std::os::raw::c_int {
1444        (self
1445            .vsl_encode_frame
1446            .as_ref()
1447            .expect("Expected function, got error."))(
1448            encoder,
1449            source,
1450            destination,
1451            cropRegion,
1452            keyframe,
1453        )
1454    }
1455    #[doc = " @brief Creates a new output frame for encoder\n\n Allocates a frame suitable for receiving encoded output from\n vsl_encode_frame(). The frame uses encoder-specific memory (e.g., Hantro VPU\n EWL memory on i.MX8) for efficient hardware encoding.\n\n @param encoder VSLEncoder instance\n @param width Encoded frame width in pixels (should match encoder source)\n @param height Encoded frame height in pixels (should match encoder source)\n @param duration Frame duration in nanoseconds (passed through to output)\n @param pts Presentation timestamp in nanoseconds (passed through to output)\n @param dts Decode timestamp in nanoseconds (passed through to output)\n @return Pointer to VSLFrame for encoded output, or NULL on failure\n @since 1.3"]
1456    pub unsafe fn vsl_encoder_new_output_frame(
1457        &self,
1458        encoder: *const VSLEncoder,
1459        width: ::std::os::raw::c_int,
1460        height: ::std::os::raw::c_int,
1461        duration: i64,
1462        pts: i64,
1463        dts: i64,
1464    ) -> *mut VSLFrame {
1465        (self
1466            .vsl_encoder_new_output_frame
1467            .as_ref()
1468            .expect("Expected function, got error."))(
1469            encoder, width, height, duration, pts, dts
1470        )
1471    }
1472    #[doc = " Opens the camera device specified by filename and allocates device memory.\n\n Opens a V4L2 video capture device (e.g., /dev/video0) and prepares it for\n streaming. The device is not yet configured - call vsl_camera_init_device()\n next.\n\n @param filename V4L2 device path (e.g., \"/dev/video0\")\n @return Pointer to vsl_camera context on success, NULL on failure\n @since 1.3\n @memberof VSLCamera"]
1473    pub unsafe fn vsl_camera_open_device(
1474        &self,
1475        filename: *const ::std::os::raw::c_char,
1476    ) -> *mut vsl_camera {
1477        (self
1478            .vsl_camera_open_device
1479            .as_ref()
1480            .expect("Expected function, got error."))(filename)
1481    }
1482    #[doc = " Initializes the camera device for streaming and allocates camera buffers.\n\n Negotiates format with the V4L2 driver. On entry, width/height/fourcc contain\n desired values (0 for driver default). On success, they're updated with\n actual negotiated values. Allocates buf_count buffers (updated with actual\n count).\n\n Must be called after vsl_camera_open_device() and before\n vsl_camera_start_capturing().\n\n @param ctx Camera context from vsl_camera_open_device()\n @param width Pointer to desired/actual width in pixels (0 for default)\n @param height Pointer to desired/actual height in pixels (0 for default)\n @param buf_count Pointer to desired/actual buffer count (0 for default)\n @param fourcc Pointer to desired/actual fourcc format (0 for default)\n @return 0 on success, -1 on error\n @since 1.3\n @memberof VSLCamera"]
1483    pub unsafe fn vsl_camera_init_device(
1484        &self,
1485        ctx: *mut vsl_camera,
1486        width: *mut ::std::os::raw::c_int,
1487        height: *mut ::std::os::raw::c_int,
1488        buf_count: *mut ::std::os::raw::c_int,
1489        fourcc: *mut u32,
1490    ) -> ::std::os::raw::c_int {
1491        (self
1492            .vsl_camera_init_device
1493            .as_ref()
1494            .expect("Expected function, got error."))(ctx, width, height, buf_count, fourcc)
1495    }
1496    #[doc = " Requests the camera to mirror the image left-to-right.\n\n Uses V4L2_CID_HFLIP control to flip the image horizontally.\n Not all cameras support this feature.\n\n @param ctx Camera context\n @param mirror true to enable horizontal flip, false to disable\n @return 0 on success, -1 if driver refused the request\n @since 1.3\n @memberof VSLCamera"]
1497    pub unsafe fn vsl_camera_mirror(
1498        &self,
1499        ctx: *const vsl_camera,
1500        mirror: bool,
1501    ) -> ::std::os::raw::c_int {
1502        (self
1503            .vsl_camera_mirror
1504            .as_ref()
1505            .expect("Expected function, got error."))(ctx, mirror)
1506    }
1507    #[doc = " Requests the camera to mirror the image top-to-bottom.\n\n Uses V4L2_CID_VFLIP control to flip the image vertically.\n Not all cameras support this feature.\n\n @param ctx Camera context\n @param mirror true to enable vertical flip, false to disable\n @return 0 on success, -1 if driver refused the request\n @since 1.3\n @memberof VSLCamera"]
1508    pub unsafe fn vsl_camera_mirror_v(
1509        &self,
1510        ctx: *const vsl_camera,
1511        mirror: bool,
1512    ) -> ::std::os::raw::c_int {
1513        (self
1514            .vsl_camera_mirror_v
1515            .as_ref()
1516            .expect("Expected function, got error."))(ctx, mirror)
1517    }
1518    #[doc = " Starts the camera stream.\n\n Begins V4L2 streaming (VIDIOC_STREAMON). Frames can now be captured with\n vsl_camera_get_data(). Must be called after vsl_camera_init_device().\n\n @param ctx Camera context\n @return 0 on success, -1 on error\n @since 1.3\n @memberof VSLCamera"]
1519    pub unsafe fn vsl_camera_start_capturing(&self, ctx: *mut vsl_camera) -> ::std::os::raw::c_int {
1520        (self
1521            .vsl_camera_start_capturing
1522            .as_ref()
1523            .expect("Expected function, got error."))(ctx)
1524    }
1525    #[doc = " Attempts to read a frame from the camera.\n\n Dequeues a filled buffer from the camera driver (VIDIOC_DQBUF). Blocks until\n a frame is available. Must be called after vsl_camera_start_capturing().\n\n After processing, call vsl_camera_release_buffer() to return the buffer to\n the driver's queue for reuse.\n\n @param ctx Camera context\n @return Pointer to camera buffer, or NULL on timeout/error\n @since 1.3\n @memberof VSLCamera"]
1526    pub unsafe fn vsl_camera_get_data(&self, ctx: *mut vsl_camera) -> *mut vsl_camera_buffer {
1527        (self
1528            .vsl_camera_get_data
1529            .as_ref()
1530            .expect("Expected function, got error."))(ctx)
1531    }
1532    #[doc = " Enqueues a buffer to be reused for frame capture.\n\n Returns the buffer to the camera driver's queue (VIDIOC_QBUF) so it can be\n filled with new frame data. Must be called after processing each buffer from\n vsl_camera_get_data().\n\n @param ctx Camera context\n @param buffer Buffer to release (from vsl_camera_get_data)\n @return 0 on success, -1 on error\n @since 1.3\n @memberof VSLCamera"]
1533    pub unsafe fn vsl_camera_release_buffer(
1534        &self,
1535        ctx: *mut vsl_camera,
1536        buffer: *const vsl_camera_buffer,
1537    ) -> ::std::os::raw::c_int {
1538        (self
1539            .vsl_camera_release_buffer
1540            .as_ref()
1541            .expect("Expected function, got error."))(ctx, buffer)
1542    }
1543    #[doc = " Stops the camera stream.\n\n Stops V4L2 streaming (VIDIOC_STREAMOFF). No more frames will be captured.\n Call before vsl_camera_uninit_device() and vsl_camera_close_device().\n\n @param ctx Camera context\n @return 0 on success, -1 on error\n @since 1.3\n @memberof VSLCamera"]
1544    pub unsafe fn vsl_camera_stop_capturing(
1545        &self,
1546        ctx: *const vsl_camera,
1547    ) -> ::std::os::raw::c_int {
1548        (self
1549            .vsl_camera_stop_capturing
1550            .as_ref()
1551            .expect("Expected function, got error."))(ctx)
1552    }
1553    #[doc = " Uninitializes the camera buffers and frees the buffer memory.\n\n Releases all allocated camera buffers. Ensure the device is not streaming\n (call vsl_camera_stop_capturing() first).\n\n @param ctx Camera context\n @since 1.3\n @memberof VSLCamera"]
1554    pub unsafe fn vsl_camera_uninit_device(&self, ctx: *mut vsl_camera) {
1555        (self
1556            .vsl_camera_uninit_device
1557            .as_ref()
1558            .expect("Expected function, got error."))(ctx)
1559    }
1560    #[doc = " Closes the camera device and frees the device memory.\n\n Closes the V4L2 device file descriptor and releases all resources.\n Ensure the device is not streaming (call vsl_camera_stop_capturing() and\n vsl_camera_uninit_device() first).\n\n @param ctx Camera context to close\n @since 1.3\n @memberof VSLCamera"]
1561    pub unsafe fn vsl_camera_close_device(&self, ctx: *mut vsl_camera) {
1562        (self
1563            .vsl_camera_close_device
1564            .as_ref()
1565            .expect("Expected function, got error."))(ctx)
1566    }
1567    #[doc = " Checks if DmaBuf export is supported on the camera.\n\n DmaBuf support allows zero-copy frame sharing with hardware accelerators\n (VPU, NPU, GPU). Requires V4L2 driver support for VIDIOC_EXPBUF.\n\n Must be called after vsl_camera_init_device().\n\n @param ctx Camera context\n @return 1 if DmaBuf supported, 0 if not supported\n @since 1.3\n @memberof VSLCamera"]
1568    pub unsafe fn vsl_camera_is_dmabuf_supported(
1569        &self,
1570        ctx: *const vsl_camera,
1571    ) -> ::std::os::raw::c_int {
1572        (self
1573            .vsl_camera_is_dmabuf_supported
1574            .as_ref()
1575            .expect("Expected function, got error."))(ctx)
1576    }
1577    #[doc = " Returns the number of buffers queued in the camera driver.\n\n Queued buffers are available for the driver to fill with new frames.\n If count reaches 0, vsl_camera_get_data() will block/timeout waiting for\n buffers to be released via vsl_camera_release_buffer().\n\n @param ctx Camera context\n @return Number of queued buffers\n @since 1.3\n @memberof VSLCamera"]
1578    pub unsafe fn vsl_camera_get_queued_buf_count(
1579        &self,
1580        ctx: *const vsl_camera,
1581    ) -> ::std::os::raw::c_int {
1582        (self
1583            .vsl_camera_get_queued_buf_count
1584            .as_ref()
1585            .expect("Expected function, got error."))(ctx)
1586    }
1587    #[doc = " Returns the mmap memory pointer of the camera buffer.\n\n Provides CPU access to the camera buffer's memory. The buffer is already\n mapped by the camera driver.\n\n @param buffer Camera buffer from vsl_camera_get_data()\n @return Pointer to mapped memory\n @since 1.3\n @memberof VSLCamera"]
1588    pub unsafe fn vsl_camera_buffer_mmap(
1589        &self,
1590        buffer: *mut vsl_camera_buffer,
1591    ) -> *mut ::std::os::raw::c_void {
1592        (self
1593            .vsl_camera_buffer_mmap
1594            .as_ref()
1595            .expect("Expected function, got error."))(buffer)
1596    }
1597    #[doc = " Returns the DmaBuf file descriptor of the camera buffer.\n\n Returns the DmaBuf FD for zero-copy sharing with hardware accelerators.\n Only available if vsl_camera_is_dmabuf_supported() returns true.\n\n @param buffer Camera buffer from vsl_camera_get_data()\n @return DmaBuf file descriptor, or -1 if DmaBuf not supported\n @since 1.3\n @memberof VSLCamera"]
1598    pub unsafe fn vsl_camera_buffer_dma_fd(
1599        &self,
1600        buffer: *const vsl_camera_buffer,
1601    ) -> ::std::os::raw::c_int {
1602        (self
1603            .vsl_camera_buffer_dma_fd
1604            .as_ref()
1605            .expect("Expected function, got error."))(buffer)
1606    }
1607    #[doc = " Returns the physical address of the camera buffer.\n\n Physical address is available on some platforms (certain i.MX drivers) for\n DMA operations. Not commonly used - prefer DmaBuf FD for portability.\n\n @param buffer Camera buffer from vsl_camera_get_data()\n @return Physical address, or 0 if not supported\n @since 1.3\n @memberof VSLCamera"]
1608    pub unsafe fn vsl_camera_buffer_phys_addr(&self, buffer: *const vsl_camera_buffer) -> u64 {
1609        (self
1610            .vsl_camera_buffer_phys_addr
1611            .as_ref()
1612            .expect("Expected function, got error."))(buffer)
1613    }
1614    #[doc = " Returns the length of the camera buffer in bytes.\n\n Buffer size as reported by the V4L2 driver. For multi-planar formats,\n this is the total size across all planes.\n\n @param buffer Camera buffer from vsl_camera_get_data()\n @return Buffer length in bytes\n @since 1.3\n @memberof VSLCamera"]
1615    pub unsafe fn vsl_camera_buffer_length(&self, buffer: *const vsl_camera_buffer) -> u32 {
1616        (self
1617            .vsl_camera_buffer_length
1618            .as_ref()
1619            .expect("Expected function, got error."))(buffer)
1620    }
1621    #[doc = " Returns the fourcc code of the camera buffer.\n\n Pixel format as negotiated with the driver during vsl_camera_init_device().\n\n @param buffer Camera buffer from vsl_camera_get_data()\n @return FOURCC code\n @since 1.3\n @memberof VSLCamera"]
1622    pub unsafe fn vsl_camera_buffer_fourcc(&self, buffer: *const vsl_camera_buffer) -> u32 {
1623        (self
1624            .vsl_camera_buffer_fourcc
1625            .as_ref()
1626            .expect("Expected function, got error."))(buffer)
1627    }
1628    #[doc = " Reads the timestamp of the camera buffer.\n\n Retrieves the capture timestamp from the V4L2 buffer. Time is relative to\n CLOCK_MONOTONIC when the frame was captured by the camera driver.\n\n @param buffer Camera buffer from vsl_camera_get_data()\n @param seconds Output pointer for timestamp seconds\n @param nanoseconds Output pointer for sub-second nanoseconds\n @since 1.3"]
1629    pub unsafe fn vsl_camera_buffer_timestamp(
1630        &self,
1631        buffer: *const vsl_camera_buffer,
1632        seconds: *mut i64,
1633        nanoseconds: *mut i64,
1634    ) {
1635        (self
1636            .vsl_camera_buffer_timestamp
1637            .as_ref()
1638            .expect("Expected function, got error."))(buffer, seconds, nanoseconds)
1639    }
1640    #[doc = " Lists the supported single-planar formats of the camera.\n\n Queries V4L2 device for available single-planar pixel formats. Call before\n vsl_camera_init_device() to determine what formats to request.\n\n @param ctx Camera context from vsl_camera_open_device()\n @param codes Array to receive fourcc codes\n @param size Size of codes array\n @return Number of formats written to codes array, or -1 on error\n @since 1.3"]
1641    pub unsafe fn vsl_camera_enum_fmts(
1642        &self,
1643        ctx: *const vsl_camera,
1644        codes: *mut u32,
1645        size: ::std::os::raw::c_int,
1646    ) -> ::std::os::raw::c_int {
1647        (self
1648            .vsl_camera_enum_fmts
1649            .as_ref()
1650            .expect("Expected function, got error."))(ctx, codes, size)
1651    }
1652    #[doc = " Lists the supported multi-planar formats of the camera.\n\n Queries V4L2 device for available multi-planar pixel formats (e.g., NV12,\n NV21 with separate Y and UV planes). Call before vsl_camera_init_device().\n\n @param ctx Camera context from vsl_camera_open_device()\n @param codes Array to receive fourcc codes\n @param size Size of codes array\n @return Number of formats written to codes array, or -1 on error\n @since 1.3"]
1653    pub unsafe fn vsl_camera_enum_mplane_fmts(
1654        &self,
1655        ctx: *const vsl_camera,
1656        codes: *mut u32,
1657        size: ::std::os::raw::c_int,
1658    ) -> ::std::os::raw::c_int {
1659        (self
1660            .vsl_camera_enum_mplane_fmts
1661            .as_ref()
1662            .expect("Expected function, got error."))(ctx, codes, size)
1663    }
1664    #[doc = " @brief Creates VSLDecoder instance\n\n Creates a hardware video decoder for H.264/H.265 using the best available\n backend (V4L2 preferred, Hantro fallback). The decoder is initialized on the\n first call to vsl_decode_frame().\n\n @param codec Codec type: VSL_DEC_H264 or VSL_DEC_HEVC\n @param fps Expected frame rate (used for buffer management)\n @return Pointer to VSLDecoder instance, or NULL on failure\n @since 1.4"]
1665    pub unsafe fn vsl_decoder_create(
1666        &self,
1667        codec: VSLDecoderCodec,
1668        fps: ::std::os::raw::c_int,
1669    ) -> *mut VSLDecoder {
1670        (self
1671            .vsl_decoder_create
1672            .as_ref()
1673            .expect("Expected function, got error."))(codec, fps)
1674    }
1675    #[doc = " @brief Creates VSLDecoder instance with explicit backend selection\n\n Creates a hardware video decoder with explicit backend selection. Use this\n when you need to force a specific backend instead of auto-detection.\n\n @param codec Codec fourcc: VSL_FOURCC('H','2','6','4') or\n              VSL_FOURCC('H','E','V','C')\n @param fps Expected frame rate (used for buffer management)\n @param backend Backend to use (AUTO, HANTRO, or V4L2)\n @return Pointer to VSLDecoder instance, or NULL on failure\n @since 2.0"]
1676    pub unsafe fn vsl_decoder_create_ex(
1677        &self,
1678        codec: u32,
1679        fps: ::std::os::raw::c_int,
1680        backend: VSLCodecBackend,
1681    ) -> *mut VSLDecoder {
1682        (self
1683            .vsl_decoder_create_ex
1684            .as_ref()
1685            .expect("Expected function, got error."))(codec, fps, backend)
1686    }
1687    #[doc = " @brief Decode compressed video frame\n\n Decodes H.264/H.265 data into a raw frame using hardware acceleration.\n First call initializes the decoder. May require multiple calls to decode\n one frame (returns VSL_DEC_INIT_INFO or VSL_DEC_FRAME_DEC).\n\n @param decoder VSLDecoder instance from vsl_decoder_create()\n @param data Pointer to compressed video data\n @param data_length Length of compressed data in bytes\n @param bytes_used Output: number of bytes consumed from data\n @param output_frame Output: decoded frame (NULL if frame not yet complete)\n @return VSL_DEC_SUCCESS (frame decoded), VSL_DEC_INIT_INFO (need more calls),\n         VSL_DEC_FRAME_DEC (frame in progress), or VSL_DEC_ERR (error)\n @since 1.4"]
1688    pub unsafe fn vsl_decode_frame(
1689        &self,
1690        decoder: *mut VSLDecoder,
1691        data: *const ::std::os::raw::c_void,
1692        data_length: ::std::os::raw::c_uint,
1693        bytes_used: *mut usize,
1694        output_frame: *mut *mut VSLFrame,
1695    ) -> VSLDecoderRetCode {
1696        (self
1697            .vsl_decode_frame
1698            .as_ref()
1699            .expect("Expected function, got error."))(
1700            decoder,
1701            data,
1702            data_length,
1703            bytes_used,
1704            output_frame,
1705        )
1706    }
1707    #[doc = " @brief Returns the decoded frame width\n\n Returns the width of decoded frames as determined from the stream headers.\n Only valid after decoder initialization (after first vsl_decode_frame()).\n\n @param decoder VSLDecoder instance\n @return Frame width in pixels\n @since 1.4"]
1708    pub unsafe fn vsl_decoder_width(&self, decoder: *const VSLDecoder) -> ::std::os::raw::c_int {
1709        (self
1710            .vsl_decoder_width
1711            .as_ref()
1712            .expect("Expected function, got error."))(decoder)
1713    }
1714    #[doc = " @brief Returns the decoded frame height\n\n Returns the height of decoded frames as determined from the stream headers.\n Only valid after decoder initialization (after first vsl_decode_frame()).\n\n @param decoder VSLDecoder instance\n @return Frame height in pixels\n @since 1.4"]
1715    pub unsafe fn vsl_decoder_height(&self, decoder: *const VSLDecoder) -> ::std::os::raw::c_int {
1716        (self
1717            .vsl_decoder_height
1718            .as_ref()
1719            .expect("Expected function, got error."))(decoder)
1720    }
1721    #[doc = " @brief Returns the decoder crop rectangle\n\n Returns the active video area within decoded frames, as specified in stream\n headers. Some encoded streams have padding that should be cropped.\n\n @param decoder VSLDecoder instance\n @return VSLRect with crop region (x, y, width, height)\n @since 1.4"]
1722    pub unsafe fn vsl_decoder_crop(&self, decoder: *const VSLDecoder) -> VSLRect {
1723        (self
1724            .vsl_decoder_crop
1725            .as_ref()
1726            .expect("Expected function, got error."))(decoder)
1727    }
1728    #[doc = " @brief Destroys VSLDecoder instance\n\n Frees all resources associated with the decoder, including hardware\n resources. Do not use the decoder after calling this function.\n\n @param decoder VSLDecoder instance to destroy\n @return 0 on success, -1 on error\n @since 1.4"]
1729    pub unsafe fn vsl_decoder_release(&self, decoder: *mut VSLDecoder) -> ::std::os::raw::c_int {
1730        (self
1731            .vsl_decoder_release
1732            .as_ref()
1733            .expect("Expected function, got error."))(decoder)
1734    }
1735    #[doc = " Enumerate all V4L2 video devices in the system.\n\n Scans /dev/video* and queries each device's capabilities. Devices are\n classified by type (camera, encoder, decoder, etc.) based on their\n V4L2 capabilities and supported formats.\n\n @return Device list (caller must free with vsl_v4l2_device_list_free),\n         or NULL on error (check errno)\n\n @note This function opens each device briefly to query capabilities.\n       Devices that are busy (EBUSY) are skipped."]
1736    pub unsafe fn vsl_v4l2_enumerate(&self) -> *mut VSLDeviceList {
1737        (self
1738            .vsl_v4l2_enumerate
1739            .as_ref()
1740            .expect("Expected function, got error."))()
1741    }
1742    #[doc = " Enumerate V4L2 devices filtered by type.\n\n @param type_mask Bitmask of VSLDeviceType values to include\n @return Filtered device list, or NULL on error\n\n Example: Find all cameras and encoders:\n @code\n VSLDeviceList* list = vsl_v4l2_enumerate_type(\n     VSL_V4L2_TYPE_CAMERA | VSL_V4L2_TYPE_ENCODER);\n @endcode"]
1743    pub unsafe fn vsl_v4l2_enumerate_type(&self, type_mask: VSLDeviceType) -> *mut VSLDeviceList {
1744        (self
1745            .vsl_v4l2_enumerate_type
1746            .as_ref()
1747            .expect("Expected function, got error."))(type_mask)
1748    }
1749    #[doc = " Free a device list returned by enumeration functions.\n\n @param list Device list to free (NULL is safe)"]
1750    pub unsafe fn vsl_v4l2_device_list_free(&self, list: *mut VSLDeviceList) {
1751        (self
1752            .vsl_v4l2_device_list_free
1753            .as_ref()
1754            .expect("Expected function, got error."))(list)
1755    }
1756    #[doc = " Find the first encoder supporting a specific output codec.\n\n @param codec_fourcc Output codec fourcc (e.g., VSL_FOURCC('H','2','6','4'))\n @return Device path string (static, do not free), or NULL if not found\n\n @note The returned path is valid until the next call to any vsl_v4l2_find_*\n       function. Copy the string if you need to keep it."]
1757    pub unsafe fn vsl_v4l2_find_encoder(&self, codec_fourcc: u32) -> *const ::std::os::raw::c_char {
1758        (self
1759            .vsl_v4l2_find_encoder
1760            .as_ref()
1761            .expect("Expected function, got error."))(codec_fourcc)
1762    }
1763    #[doc = " Find the first decoder supporting a specific input codec.\n\n @param codec_fourcc Input codec fourcc (e.g., VSL_FOURCC('H','E','V','C'))\n @return Device path string (static, do not free), or NULL if not found"]
1764    pub unsafe fn vsl_v4l2_find_decoder(&self, codec_fourcc: u32) -> *const ::std::os::raw::c_char {
1765        (self
1766            .vsl_v4l2_find_decoder
1767            .as_ref()
1768            .expect("Expected function, got error."))(codec_fourcc)
1769    }
1770    #[doc = " Find the first camera supporting a specific pixel format.\n\n @param format_fourcc Pixel format fourcc (e.g., VSL_FOURCC('N','V','1','2'))\n @return Device path string (static, do not free), or NULL if not found"]
1771    pub unsafe fn vsl_v4l2_find_camera(&self, format_fourcc: u32) -> *const ::std::os::raw::c_char {
1772        (self
1773            .vsl_v4l2_find_camera
1774            .as_ref()
1775            .expect("Expected function, got error."))(format_fourcc)
1776    }
1777    #[doc = " Find a camera supporting specific format and resolution.\n\n @param format_fourcc Pixel format fourcc\n @param width         Minimum width in pixels (0 for any)\n @param height        Minimum height in pixels (0 for any)\n @return Device path string, or NULL if not found"]
1778    pub unsafe fn vsl_v4l2_find_camera_with_resolution(
1779        &self,
1780        format_fourcc: u32,
1781        width: u32,
1782        height: u32,
1783    ) -> *const ::std::os::raw::c_char {
1784        (self
1785            .vsl_v4l2_find_camera_with_resolution
1786            .as_ref()
1787            .expect("Expected function, got error."))(format_fourcc, width, height)
1788    }
1789    #[doc = " Enumerate supported formats for a device.\n\n Populates the device's capture_formats and/or output_formats arrays\n based on the device type.\n\n @param device Device to enumerate formats for (modified in place)\n @return 0 on success, -1 on error (check errno)\n\n @note The device must have been returned by vsl_v4l2_enumerate().\n       Format arrays are allocated and must be freed with\n       vsl_v4l2_device_list_free()."]
1790    pub unsafe fn vsl_v4l2_device_enum_formats(
1791        &self,
1792        device: *mut VSLDevice,
1793    ) -> ::std::os::raw::c_int {
1794        (self
1795            .vsl_v4l2_device_enum_formats
1796            .as_ref()
1797            .expect("Expected function, got error."))(device)
1798    }
1799    #[doc = " Enumerate supported resolutions for a format.\n\n @param device Device to query\n @param fourcc Pixel format to enumerate resolutions for\n @param count  Output: number of resolutions found\n @return Array of resolutions (caller must free), or NULL if none/error"]
1800    pub unsafe fn vsl_v4l2_enum_resolutions(
1801        &self,
1802        device: *const VSLDevice,
1803        fourcc: u32,
1804        count: *mut usize,
1805    ) -> *mut VSLResolution {
1806        (self
1807            .vsl_v4l2_enum_resolutions
1808            .as_ref()
1809            .expect("Expected function, got error."))(device, fourcc, count)
1810    }
1811    #[doc = " Check if a device supports a specific pixel format.\n\n @param device Device to check\n @param fourcc Pixel format fourcc to look for\n @param capture True to check capture formats, false for output formats\n @return True if format is supported"]
1812    pub unsafe fn vsl_v4l2_device_supports_format(
1813        &self,
1814        device: *const VSLDevice,
1815        fourcc: u32,
1816        capture: bool,
1817    ) -> bool {
1818        (self
1819            .vsl_v4l2_device_supports_format
1820            .as_ref()
1821            .expect("Expected function, got error."))(device, fourcc, capture)
1822    }
1823    #[doc = " Allocate a buffer backed by DMA heap for use with V4L2 USERPTR.\n\n This is useful for cameras that don't support DMABUF export but do\n support USERPTR. By allocating the userptr buffer from DMA heap,\n the buffer can still be used with downstream components that require\n DMA-capable memory (encoders, display, etc.).\n\n @param size   Size of buffer to allocate\n @param dma_fd Output: DMA buffer file descriptor (for downstream use)\n @return Mapped buffer pointer, or NULL on error (check errno)\n\n @note Caller must free with vsl_v4l2_free_userptr()"]
1824    pub unsafe fn vsl_v4l2_alloc_userptr(
1825        &self,
1826        size: usize,
1827        dma_fd: *mut ::std::os::raw::c_int,
1828    ) -> *mut ::std::os::raw::c_void {
1829        (self
1830            .vsl_v4l2_alloc_userptr
1831            .as_ref()
1832            .expect("Expected function, got error."))(size, dma_fd)
1833    }
1834    #[doc = " Free a buffer allocated by vsl_v4l2_alloc_userptr().\n\n @param ptr    Buffer pointer returned by vsl_v4l2_alloc_userptr()\n @param size   Size that was passed to vsl_v4l2_alloc_userptr()\n @param dma_fd DMA fd that was returned by vsl_v4l2_alloc_userptr()"]
1835    pub unsafe fn vsl_v4l2_free_userptr(
1836        &self,
1837        ptr: *mut ::std::os::raw::c_void,
1838        size: usize,
1839        dma_fd: ::std::os::raw::c_int,
1840    ) {
1841        (self
1842            .vsl_v4l2_free_userptr
1843            .as_ref()
1844            .expect("Expected function, got error."))(ptr, size, dma_fd)
1845    }
1846    #[doc = " Get human-readable name for a device type.\n\n @param type Device type\n @return Static string (e.g., \"Camera\", \"Encoder\", \"Decoder\")"]
1847    pub unsafe fn vsl_v4l2_device_type_name(
1848        &self,
1849        type_: VSLDeviceType,
1850    ) -> *const ::std::os::raw::c_char {
1851        (self
1852            .vsl_v4l2_device_type_name
1853            .as_ref()
1854            .expect("Expected function, got error."))(type_)
1855    }
1856    #[doc = " Check if a fourcc code represents a compressed video format.\n\n @param fourcc Pixel format fourcc\n @return True if compressed (H.264, HEVC, VP8, VP9, MJPEG, etc.)"]
1857    pub unsafe fn vsl_v4l2_is_compressed_format(&self, fourcc: u32) -> bool {
1858        (self
1859            .vsl_v4l2_is_compressed_format
1860            .as_ref()
1861            .expect("Expected function, got error."))(fourcc)
1862    }
1863    #[doc = " Convert a fourcc code to a printable string.\n\n @param fourcc Fourcc code\n @param buf    Output buffer (must be at least 5 bytes)\n @return buf pointer for convenience"]
1864    pub unsafe fn vsl_v4l2_fourcc_to_string(
1865        &self,
1866        fourcc: u32,
1867        buf: *mut ::std::os::raw::c_char,
1868    ) -> *mut ::std::os::raw::c_char {
1869        (self
1870            .vsl_v4l2_fourcc_to_string
1871            .as_ref()
1872            .expect("Expected function, got error."))(fourcc, buf)
1873    }
1874}