-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fda656e
commit d9de934
Showing
31 changed files
with
234 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 The ChromiumOS Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
license { | ||
name: "external_rust_crates_cros-libva_license", | ||
visibility: [":__subpackages__"], | ||
license_kinds: ["SPDX-license-identifier-BSD-3-Clause"], | ||
license_text: ["LICENSE"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
[package] | ||
name = "cros-libva" | ||
version = "0.0.8" | ||
license = "BSD-3-Clause" | ||
description = "Safe bindings over libva" | ||
repository = "https://github.com/chromeos/cros-libva" | ||
authors = ["The Chromium OS Authors"] | ||
edition = "2021" | ||
[workspace] | ||
resolver = "2" | ||
members = ["lib"] | ||
|
||
[dependencies] | ||
thiserror = "1" | ||
bitflags = "2.5" | ||
log = { version = "0", features = ["release_max_level_debug"] } | ||
|
||
[build-dependencies] | ||
bindgen = "0.70.1" | ||
pkg-config = "0.3.26" | ||
|
||
[dev-dependencies] | ||
crc32fast = "1.2.1" | ||
[workspace.package] | ||
readme = "README.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2024 The ChromiumOS Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package { | ||
default_applicable_licenses: ["external_rust_crates_cros-libva_license"], | ||
} | ||
|
||
rust_binary_host { | ||
name: "cros_libva_bindgen_build", | ||
srcs: ["build.rs"], | ||
rustlibs: [ | ||
"libbindgen", | ||
"libbindgen_cmd", | ||
], | ||
lints: "android", | ||
clippy_lints: "android", | ||
|
||
vendor: true, | ||
} | ||
|
||
rust_bindgen { | ||
name: "libcros_libva_bindgen", | ||
crate_name: "cros_libva_bindgen", | ||
custom_bindgen: "cros_libva_bindgen_build", | ||
wrapper_src: "android_wrapper.h", | ||
source_stem: "bindings", | ||
cflags: ["-I external/rust/crates/cros-libva/lib"], | ||
visibility: ["//external/rust/crates/cros-libva/lib"], | ||
|
||
vendor: true, | ||
enabled: false, | ||
arch: { | ||
x86_64: { | ||
enabled: true, | ||
// Libva headers that bindings source is generated from. | ||
header_libs: ["libva_headers"], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright 2024 The ChromiumOS Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// This is lib/vaapi-wrapper.h. | ||
#include "libva-wrapper.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2024 The ChromiumOS Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
//! cros-libva bindings generator in Android. | ||
#[path = "../lib/bindgen_gen.rs"] | ||
mod bindgen_gen; | ||
|
||
fn main() { | ||
bindgen_cmd::build(bindgen_gen::vaapi_gen_builder); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright 2024 The ChromiumOS Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Bindgen-generated bindings of our local libva headers. | ||
srcs: [":libcros_libva_bindgen"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"package": { | ||
"cros_libva": { | ||
"host_supported": false, | ||
"add_module_block": "android/srcs.bp" | ||
} | ||
}, | ||
"run_cargo": false, | ||
"tests": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright 2024 The ChromiumOS Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// This file is generated by cargo_embargo. | ||
// Do not modify this file because the changes will be overridden on upgrade. | ||
|
||
package { | ||
default_applicable_licenses: ["external_rust_crates_cros-libva_license"], | ||
} | ||
|
||
rust_test { | ||
name: "cros-libva_test_src_lib", | ||
crate_name: "cros_libva", | ||
cargo_env_compat: true, | ||
cargo_pkg_version: "0.0.8", | ||
crate_root: "src/lib.rs", | ||
test_suites: ["general-tests"], | ||
auto_gen_config: true, | ||
test_options: { | ||
unit_test: true, | ||
}, | ||
edition: "2021", | ||
rustlibs: [ | ||
"libbitflags", | ||
"libcrc32fast", | ||
"liblog_rust", | ||
"libthiserror", | ||
], | ||
|
||
vendor: true, | ||
enabled: false, | ||
arch: { | ||
x86_64: { | ||
enabled: true, | ||
// Bindgen-generated bindings of our local libva headers. | ||
srcs: [":libcros_libva_bindgen"], | ||
}, | ||
}, | ||
} | ||
|
||
rust_library { | ||
name: "libcros_libva", | ||
crate_name: "cros_libva", | ||
cargo_env_compat: true, | ||
cargo_pkg_version: "0.0.8", | ||
crate_root: "src/lib.rs", | ||
edition: "2021", | ||
rustlibs: [ | ||
"libbitflags", | ||
"liblog_rust", | ||
"libthiserror", | ||
], | ||
apex_available: [ | ||
"//apex_available:platform", | ||
"//apex_available:anyapex", | ||
], | ||
|
||
vendor: true, | ||
enabled: false, | ||
arch: { | ||
x86_64: { | ||
enabled: true, | ||
// Bindgen-generated bindings of our local libva headers. | ||
srcs: [":libcros_libva_bindgen"], | ||
shared_libs: [ "libva" ], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "cros-libva" | ||
version = "0.0.8" | ||
license = "BSD-3-Clause" | ||
description = "Safe bindings over libva" | ||
repository = "https://github.com/chromeos/cros-libva" | ||
authors = ["The Chromium OS Authors"] | ||
edition = "2021" | ||
|
||
[dependencies] | ||
thiserror = "1" | ||
bitflags = "2.5" | ||
log = { version = "0", features = ["release_max_level_debug"] } | ||
|
||
[build-dependencies] | ||
bindgen = "0.70.1" | ||
pkg-config = "0.3.26" | ||
|
||
[dev-dependencies] | ||
crc32fast = "1.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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. | ||
|
||
/// The allow list of VA functions, structures and enum values. | ||
const ALLOW_LIST_TYPE : &str = ".*ExternalBuffers.*|.*PRIME.*|.*MPEG2.*|.*VP8.*|.*VP9.*|.*H264.*|.*HEVC.*|VACodedBufferSegment|.*AV1.*|VAEncMisc.*|VASurfaceDecodeMBErrors|VADecodeErrorType"; | ||
|
||
// The common bindgen builder for VA-API. | ||
pub fn vaapi_gen_builder(builder: bindgen::Builder) -> bindgen::Builder { | ||
builder | ||
.derive_default(true) | ||
.derive_eq(true) | ||
.layout_tests(false) | ||
.constified_enum_module("VA.*") | ||
.allowlist_var("VA.*") | ||
.allowlist_function("va.*") | ||
.allowlist_type(ALLOW_LIST_TYPE) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.