# The AV media plane behind a C ABI: libjoltmoq.so. # # It cross-compiles now. What moves on the device is the capture end and only # the capture end: the camera is Camera2 over JNI rather than V4L2, and the # microphone is cpal's AAudio host rather than PipeWire. MoQ, QUIC, Opus and # H.264 are the same code on both. The selects below mirror the target sections # in Cargo.toml — when one changes, the other has to. rust_library( name = "jolt-moq", srcs = glob(["src/**/*.rs"]), crate = "joltmoq", crate_root = "src/lib.rs", edition = "2021", preferred_linkage = "shared", soname = "libjoltmoq.so", visibility = ["PUBLIC"], # jni is renamed in third-party/rust/Cargo.toml — cpal wants 0.21 on the # same platform and two crates cannot share one alias — so the source's # `jni` has to be spelled out here. Same as jolt-vidya does. named_deps = select({ "DEFAULT": {}, "prelude//os:android": {"jni": "//third-party/rust:jni-0-22"}, }), deps = [ "//crates/jolt-abi:jolt-abi", "//third-party/rust:anyhow", "//third-party/rust:env_logger", "//third-party/rust:image", "//third-party/rust:iroh-live", "//third-party/rust:libc", "//third-party/rust:log", "//third-party/rust:moq-lite", "//third-party/rust:moq-native", "//third-party/rust:n0-future", "//third-party/rust:rand", "//third-party/rust:rustls", "//third-party/rust:tokio", "//third-party/rust:url", "//third-party/rust:urlencoding", ] + select({ # The desktop capture stack. cpal is here for the same reason Cargo.toml # names it — nothing in this crate calls it; moq-media does — and v4l2r # is the loopback-safe capture path. Neither has anything to say to a # phone, whose camera is `src/android_camera.rs`. "DEFAULT": [ "//third-party/rust/cpal:cpal", "//third-party/rust:v4l2r", ], # ndk-context is cpal's route to the JavaVM, not this crate's; see the # note in Cargo.toml. "prelude//os:android": ["//third-party/rust:ndk-context"], }), )