| package { |
| default_applicable_licenses: ["system_cros-codecs_license"], |
| // TODO(b/374841646): This is a temporary assignment. |
| default_team: "trendy_team_arc_next", |
| } |
| |
| license { |
| name: "system_cros-codecs_license", |
| visibility: [":__subpackages__"], |
| license_kinds: ["SPDX-license-identifier-BSD-3-Clause"], |
| license_text: ["LICENSE"], |
| } |
| |
| rust_defaults { |
| name: "libcros_codecs_defaults", |
| crate_name: "cros_codecs", |
| cargo_env_compat: true, |
| cargo_pkg_version: "0.0.5", |
| crate_root: "src/lib.rs", |
| edition: "2021", |
| rustlibs: [ |
| "libanyhow", |
| "libcrc32fast", |
| "libbyteorder", |
| "libthiserror", |
| "liblog_rust", |
| "libgbm_rust", |
| "libdrm_rust", |
| "libdrm_fourcc", |
| "libgbm_sys", |
| "libnix", |
| "libzerocopy", |
| ], |
| aliases: ["cros_libva:libva"], |
| apex_available: [ |
| "//apex_available:platform", |
| "//apex_available:anyapex", |
| ], |
| // TODO(b/382119688): Remove this. |
| lints: "none", |
| |
| product_available: true, |
| vendor_available: true, |
| } |
| |
| rust_library { |
| name: "libcros_codecs", |
| defaults: ["libcros_codecs_defaults"], |
| enabled: false, |
| arch: { |
| x86_64: { |
| enabled: true, |
| features: [ |
| "vaapi", |
| "backend", |
| ], |
| rustlibs: ["libcros_libva"], |
| }, |
| arm64: { |
| enabled: true, |
| features: [ |
| "v4l2", |
| "backend", |
| ], |
| rustlibs: ["libv4l2r"], |
| }, |
| }, |
| } |
| |
| rust_test_host { |
| name: "libcros_codecs_test", |
| defaults: ["libcros_codecs_defaults"], |
| rustlibs: ["libenv_logger"], |
| } |
| |
| rust_defaults { |
| name: "libcros_codecs_tests_defaults", |
| rustlibs: [ |
| "libandroid_logger", |
| "libargh", |
| "libcros_codecs", |
| "libenv_logger", |
| "liblog_rust", |
| ], |
| enabled: false, |
| arch: { |
| x86_64: { |
| enabled: true, |
| features: [ |
| "android", |
| "vaapi", |
| "backend", |
| ], |
| }, |
| arm64: { |
| enabled: true, |
| features: [ |
| "android", |
| "v4l2", |
| "backend", |
| ], |
| }, |
| }, |
| } |
| |
| // Base case cros-codecs decoding tests. |
| rust_test { |
| name: "ccdec_test", |
| srcs: ["tests/ccdec_test.rs"], |
| defaults: ["libcros_codecs_tests_defaults"], |
| test_suites: ["general-tests"], |
| test_config: "tests/AndroidTest.xml", |
| data: [":ccdec_test_data"], |
| data_bins: ["ccdec"], |
| } |
| |
| rust_binary { |
| name: "ccdec", |
| srcs: ["examples/ccdec/main.rs"], |
| defaults: ["libcros_codecs_tests_defaults"], |
| rustlibs: [ |
| "libserde_json", |
| ], |
| // This has the binary deployed to the same place as its dependencies by adb sync, |
| // which is /system/vendor/bin/ on the device. |
| vendor: true, |
| prefer_rlib: true, |
| } |
| |
| rust_binary { |
| name: "ccenc", |
| srcs: ["examples/ccenc/main.rs"], |
| defaults: ["libcros_codecs_tests_defaults"], |
| // This has the binary deployed to the same place as its dependencies by adb sync, |
| // which is /system/vendor/bin/ on the device. |
| vendor: true, |
| } |
| |
| rust_binary { |
| name: "image_processor_perf_test", |
| srcs: ["examples/perf_test.rs"], |
| defaults: ["libcros_codecs_tests_defaults"], |
| // This has the binary deployed to the same place as its dependencies by adb sync, |
| // which is /system/vendor/bin/ on the device. |
| vendor: true, |
| } |
| |
| filegroup { |
| name: "ccdec_test_data", |
| srcs: [ |
| "src/codec/av1/test_data/test-25fps.av1.ivf", |
| "src/codec/av1/test_data/test-25fps.av1.ivf.json", |
| "src/codec/h264/test_data/test-25fps.h264", |
| "src/codec/h264/test_data/test-25fps.h264.json", |
| "src/codec/h265/test_data/test-25fps.h265", |
| "src/codec/h265/test_data/test-25fps.h265.json", |
| "src/codec/vp8/test_data/test-25fps.vp8", |
| "src/codec/vp8/test_data/test-25fps.vp8.json", |
| "src/codec/vp9/test_data/test-25fps.vp9", |
| "src/codec/vp9/test_data/test-25fps.vp9.json", |
| ], |
| } |