start work on nihed-cros-libva
[nihav-player.git] / nihed-cros-libva / bindgen.sh
diff --git a/nihed-cros-libva/bindgen.sh b/nihed-cros-libva/bindgen.sh
new file mode 100755 (executable)
index 0000000..be9fdf3
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Copyright 2022 The ChromiumOS Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Regenerate libva bindgen bindings.
+
+set -euo pipefail
+bindgen \
+    --raw-line "pub mod constants;" \
+    --with-derive-eq \
+    --constified-enum-module "VA.*" \
+    --allowlist-function "va.*" \
+    --allowlist-type ".*MPEG2.*|.*VP8.*|.*VP9.*|.*H264.*" \
+    "libva-wrapper.h" \
+    > src/bindings/va.rs
+
+bindgen \
+    --allowlist-var "VA.*" \
+    "libva-wrapper.h" \
+    > src/bindings/va/constants.rs