Skip to content

Commit

Permalink
ioctl: remove unneeded as_raw_v4l2_buffer method
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed May 7, 2024
1 parent 33b6a2a commit 056fdc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ffi/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
);
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions lib/src/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 056fdc7

Please sign in to comment.