1package { 2 default_applicable_licenses: ["external_rust_crabbyavif_license"], 3} 4 5license { 6 name: "external_rust_crabbyavif_license", 7 visibility: [":__subpackages__"], 8 license_kinds: [ 9 "SPDX-license-identifier-Apache-2.0", 10 ], 11} 12 13rust_bindgen { 14 name: "libcrabbyavif_mediaimage2_bindgen", 15 crate_name: "crabbyavif_mediaimage2_bindgen", 16 wrapper_src: "sys/ndk-sys/mediaimage2_wrapper.hpp", 17 source_stem: "mediaimage2_bindgen", 18 header_libs: [ 19 "media_plugin_headers", 20 ], 21 bindgen_flags: [ 22 "--allowlist-item=android::MediaImage2?", 23 "--no-doc-comments", 24 "--no-layout-tests", 25 "--no-recursive-allowlist", 26 ], 27} 28 29rust_bindgen { 30 name: "libcrabbyavif_ndk_bindgen", 31 crate_name: "crabbyavif_ndk_bindgen", 32 wrapper_src: "sys/ndk-sys/wrapper.h", 33 source_stem: "ndk_media_bindgen", 34 header_libs: [ 35 "libmediandk", 36 ], 37 bindgen_flags: [ 38 "--with-derive-default", 39 ], 40} 41 42rust_library { 43 name: "libndk_sys", 44 crate_name: "ndk_sys", 45 cargo_env_compat: true, 46 cargo_pkg_version: "0.1.0", 47 cfgs: ["android_soong"], 48 srcs: [ 49 "sys/ndk-sys/src/lib.rs", 50 // This comment prevents bpfmt -s from sorting this list as lib.rs 51 // always has to be the first in the source list. 52 ":libcrabbyavif_ndk_bindgen", 53 ], 54 shared_libs: [ 55 "libmediandk", 56 ], 57} 58 59rust_bindgen { 60 name: "libcrabbyavif_yuv_bindgen", 61 crate_name: "crabbyavif_yuv_bindgen", 62 wrapper_src: "sys/libyuv-sys/wrapper.h", 63 source_stem: "libyuv_bindgen", 64 product_available: true, 65 vendor_available: true, 66 header_libs: [ 67 "libyuv", 68 ], 69} 70 71rust_library { 72 name: "liblibyuv_sys", 73 crate_name: "libyuv_sys", 74 cargo_env_compat: true, 75 cargo_pkg_version: "0.1.0", 76 cfgs: ["android_soong"], 77 srcs: [ 78 "sys/libyuv-sys/src/lib.rs", 79 // This comment prevents bpfmt -s from sorting this list as lib.rs 80 // always has to be the first in the source list. 81 ":libcrabbyavif_yuv_bindgen", 82 ], 83 whole_static_libs: [ 84 "libyuv", 85 ], 86 shared_libs: [ 87 "libc++", 88 "libjpeg", 89 ], 90} 91 92rust_ffi_static { 93 name: "libcrabbyavif_ffi", 94 crate_name: "crabbyavif", 95 cargo_env_compat: true, 96 cargo_pkg_version: "0.1.0", 97 srcs: [ 98 "src/lib.rs", 99 // This comment prevents bpfmt -s from sorting this list as lib.rs 100 // always has to be the first in the source list. 101 ":libcrabbyavif_mediaimage2_bindgen", 102 ], 103 cfgs: ["android_soong"], 104 edition: "2021", 105 features: [ 106 "android_mediacodec", 107 "capi", 108 "heic", 109 "libyuv", 110 ], 111 rustlibs: [ 112 "liblibyuv_sys", 113 "liblog_rust", 114 "liblogger", 115 "libndk_sys", 116 "librustutils", 117 ], 118 shared_libs: [ 119 "libmediandk", 120 ], 121 include_dirs: ["include"], 122 apex_available: [ 123 "//apex_available:anyapex", 124 "//apex_available:platform", 125 ], 126} 127