Skip to content

Commit

Permalink
lib: add is_multiplanar method to QueueType
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Sep 6, 2023
1 parent 9fd5ae3 commit 7cddcdc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ pub enum QueueType {
MetaOutput = bindings::v4l2_buf_type_V4L2_BUF_TYPE_META_OUTPUT as isize,
}

impl QueueType {
/// Returns whether the queue type is multiplanar.
pub fn is_multiplanar(&self) -> bool {
matches!(
self,
QueueType::VideoCaptureMplane | QueueType::VideoOutputMplane
)
}
}

impl Display for QueueType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Debug::fmt(self, f)
Expand Down

0 comments on commit 7cddcdc

Please sign in to comment.