From 056fdc7a63d28ba8d46ffbc213cd9db00d956674 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Sun, 5 May 2024 23:48:49 +0900 Subject: [PATCH] ioctl: remove unneeded as_raw_v4l2_buffer method --- ffi/src/decoder.rs | 4 ++-- lib/src/ioctl.rs | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ffi/src/decoder.rs b/ffi/src/decoder.rs index adb0c1e..c462b57 100644 --- a/ffi/src/decoder.rs +++ b/ffi/src/decoder.rs @@ -225,7 +225,7 @@ fn frame_decoded_cb( event_cb( cb_data, &mut v4l2r_decoder_event::FrameDecoded(v4l2r_decoder_frame_decoded_event { - buffer: v4l2_data.as_raw_v4l2_buffer(), + buffer: v4l2_data.v4l2_buffer() as *const bindings::v4l2_buffer, frame, }), ); @@ -331,7 +331,7 @@ fn v4l2r_decoder_new_safe( CompletedInputBuffer::Dequeued(dqbuf) => { debug!("Input buffer {} done", dqbuf.data.index()); // TODO check return value? - input_done_cb(cb_data.0, dqbuf.data.as_raw_v4l2_buffer()); + input_done_cb(cb_data.0, dqbuf.data.v4l2_buffer() as *const bindings::v4l2_buffer); } // Just drop canceled buffers for now - the client will remove // them on its side as well. diff --git a/lib/src/ioctl.rs b/lib/src/ioctl.rs index c26aeac..ae478ab 100644 --- a/lib/src/ioctl.rs +++ b/lib/src/ioctl.rs @@ -341,12 +341,6 @@ impl V4l2Buffer { } } - /// Returns the raw v4l2_buffer as a pointer. Useful to pass to unsafe - /// non-Rust code. - pub fn as_raw_v4l2_buffer(&self) -> *const bindings::v4l2_buffer { - &self.buffer - } - /// Returns a reference to the internal `v4l2_buffer`. All pointers in this /// structure are invalid. pub fn v4l2_buffer(&self) -> &bindings::v4l2_buffer {