]> git.nihav.org Git - nihav-player.git/blobdiff - nihed-cros-libva/src/lib.rs
nihed-cros-libva: update test to the current interface
[nihav-player.git] / nihed-cros-libva / src / lib.rs
index 83b459a5fbb0a83d262ad0bd78ca7c7190f44407..a095c1c35e69b268195251c003417a989106672f 100644 (file)
@@ -14,6 +14,7 @@ pub mod buffer;
 mod config;
 mod context;
 mod display;
+mod formats;
 mod generic_value;
 mod image;
 mod picture;
@@ -29,11 +30,11 @@ pub use bindings::VAImageFormat;
 pub use bindings::VAProfile;
 pub use bindings::VASurfaceAttribType;
 pub use bindings::VASurfaceID;
-pub use bindings::VASurfaceStatus;
 pub use buffer::*;
 pub use config::*;
 pub use context::*;
 pub use display::*;
+pub use formats::*;
 pub use generic_value::*;
 pub use image::*;
 pub use picture::*;
@@ -41,6 +42,8 @@ pub use status::*;
 pub use surface::*;
 pub use usage_hint::*;
 
+pub use bindings::constants::VA_INVALID_ID;
+
 #[cfg(test)]
 mod tests {
     use std::rc::Rc;
@@ -57,7 +60,7 @@ mod tests {
         let height = va_image.height as usize;
 
         // We only support NV12 images
-        assert_eq!(va_image.format.fourcc, u32::from_ne_bytes(*b"NV12"));
+        assert_eq!(va_image.format.fourcc(), Ok(VAFourcc::NV12));
         // Consistency check
         assert_eq!(va_image.num_planes, 2);
 
@@ -100,7 +103,7 @@ mod tests {
             .iter()
             .any(|e| *e == bindings::VAEntrypoint::VAEntrypointVLD));
 
-        let format = bindings::constants::VA_RT_FORMAT_YUV420;
+        let format = RTFormat::YUV420;
         let width = 16;
         let height = 16;
 
@@ -124,7 +127,7 @@ mod tests {
                 None,
                 width,
                 height,
-                Some(UsageHint::USAGE_HINT_DECODER),
+                Some(UsageHint::Decoder.into()),
                 1,
             )
             .unwrap();