nihed-cros-libva: rework UsageHint and drop bitflags dependency
[nihav-player.git] / nihed-cros-libva / src / surface.rs
index d16fedc127f0589abe675acc0c05c36648b037be..ddc1f157d3b591bc7091c087baa647fa94f9e9f3 100644 (file)
@@ -7,7 +7,7 @@ use std::rc::Rc;
 use crate::bindings;
 use crate::display::Display;
 use crate::status::*;
-use crate::UsageHint;
+use crate::UsageHints;
 
 /// An owned VA surface that is tied to the lifetime of a particular VADisplay
 pub struct Surface {
@@ -26,19 +26,19 @@ impl Surface {
         va_fourcc: Option<u32>,
         width: u32,
         height: u32,
-        usage_hint: Option<UsageHint>,
+        usage_hints: Option<UsageHints>,
         num_surfaces: u32,
     ) -> VAResult<Vec<Self>> {
         let mut attrs = vec![];
 
-        if let Some(usage_hint) = usage_hint {
+        if let Some(usage_hints) = usage_hints {
             let attr = bindings::VASurfaceAttrib {
                 type_: bindings::VASurfaceAttribType::VASurfaceAttribUsageHint,
                 flags: bindings::constants::VA_SURFACE_ATTRIB_SETTABLE,
                 value: bindings::VAGenericValue {
                     type_: bindings::VAGenericValueType::VAGenericValueTypeInteger,
                     value: bindings::_VAGenericValue__bindgen_ty_1 {
-                        i: usage_hint.bits() as i32,
+                        i: usage_hints.bits() as i32,
                     },
                 },
             };