nihed-cros-libva: convert surface query status to enum
[nihav-player.git] / nihed-cros-libva / src / status.rs
index 0cf3f5b0596767d44812d12e0905ddd53533691b..5dac0bf84765f312d6bb6a56e5d994215294738e 100644 (file)
@@ -132,3 +132,25 @@ impl ConvertStatus for bindings::VAStatus {
         }
     }
 }
+
+/// Surface status.
+#[repr(u32)]
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum VASurfaceStatus {
+    /// Rendering in progress.
+    Rendering = 1,
+    /// Displaying in progress (not safe to render into it).
+    ///
+    /// This status is useful if surface is used as the source of an overlay.
+    Displaying = 2,
+    /// Not being rendered or displayed.
+    Ready = 3,
+    /// Indicate a skipped frame during encode.
+    Skipped = 8,
+}
+
+impl std::fmt::Display for VASurfaceStatus {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{:?}", self)
+    }
+}