Skip to content

Commit

Permalink
ioctl: add accessors to internal structures of V4l2Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Sep 6, 2023
1 parent f5f8c34 commit af2099a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,16 @@ impl V4l2Buffer {
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 {
&self.buffer
}

/// Returns an iterator to the internal `v4l2_plane`s. All pointers in the
/// planes are invalid.
pub fn v4l2_plane_iter(&self) -> impl Iterator<Item = &bindings::v4l2_plane> {
self.planes.iter()
}
}

0 comments on commit af2099a

Please sign in to comment.