From 2b4c8e9739630f6db5d7ff5c4df166d441a8bec2 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 20 Oct 2023 18:33:27 +0200 Subject: [PATCH] nihed-cros-libva: make VAImage export VAFourcc for convenience --- nihed-cros-libva/src/bindings/va.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nihed-cros-libva/src/bindings/va.rs b/nihed-cros-libva/src/bindings/va.rs index fd887c7..540ef7d 100644 --- a/nihed-cros-libva/src/bindings/va.rs +++ b/nihed-cros-libva/src/bindings/va.rs @@ -1625,6 +1625,13 @@ pub struct VAImageFormat { pub alpha_mask: u32, pub va_reserved: [u32; 4usize], } + +impl VAImageFormat { + pub fn fourcc(&self) -> crate::status::VAResult { + self.fourcc.try_into().map_err(|_| crate::status::VAError::InvalidImage) + } +} + pub type VAImageID = VAGenericID; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] -- 2.39.5