| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 1 | # The AV media plane behind a C ABI: libjoltmoq.so. |
| Let the media plane cross to the phone, camera and all fd0e21a nandi 18d ago | 2 | # |
| 3 | # It cross-compiles now. What moves on the device is the capture end and only |
| 4 | # the capture end: the camera is Camera2 over JNI rather than V4L2, and the |
| 5 | # microphone is cpal's AAudio host rather than PipeWire. MoQ, QUIC, Opus and |
| 6 | # H.264 are the same code on both. The selects below mirror the target sections |
| 7 | # in Cargo.toml — when one changes, the other has to. |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 8 | rust_library( |
| 9 | name = "jolt-moq", |
| 10 | srcs = glob(["src/**/*.rs"]), |
| 11 | crate = "joltmoq", |
| 12 | crate_root = "src/lib.rs", |
| 13 | edition = "2021", |
| 14 | preferred_linkage = "shared", |
| 15 | soname = "libjoltmoq.so", |
| 16 | visibility = ["PUBLIC"], |
| Let the media plane cross to the phone, camera and all fd0e21a nandi 18d ago | 17 | # jni is renamed in third-party/rust/Cargo.toml — cpal wants 0.21 on the |
| 18 | # same platform and two crates cannot share one alias — so the source's |
| 19 | # `jni` has to be spelled out here. Same as jolt-vidya does. |
| 20 | named_deps = select({ |
| 21 | "DEFAULT": {}, |
| 22 | "prelude//os:android": {"jni": "//third-party/rust:jni-0-22"}, |
| 23 | }), |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 24 | deps = [ |
| 25 | "//crates/jolt-abi:jolt-abi", |
| 26 | "//third-party/rust:anyhow", |
| 27 | "//third-party/rust:env_logger", |
| 28 | "//third-party/rust:image", |
| 29 | "//third-party/rust:iroh-live", |
| 30 | "//third-party/rust:libc", |
| 31 | "//third-party/rust:log", |
| 32 | "//third-party/rust:moq-lite", |
| 33 | "//third-party/rust:moq-native", |
| 34 | "//third-party/rust:n0-future", |
| 35 | "//third-party/rust:rand", |
| 36 | "//third-party/rust:rustls", |
| 37 | "//third-party/rust:tokio", |
| 38 | "//third-party/rust:url", |
| 39 | "//third-party/rust:urlencoding", |
| Let the media plane cross to the phone, camera and all fd0e21a nandi 18d ago | 40 | ] + select({ |
| 41 | # The desktop capture stack. cpal is here for the same reason Cargo.toml |
| 42 | # names it — nothing in this crate calls it; moq-media does — and v4l2r |
| 43 | # is the loopback-safe capture path. Neither has anything to say to a |
| 44 | # phone, whose camera is `src/android_camera.rs`. |
| 45 | "DEFAULT": [ |
| 46 | "//third-party/rust/cpal:cpal", |
| 47 | "//third-party/rust:v4l2r", |
| 48 | ], |
| 49 | # ndk-context is cpal's route to the JavaVM, not this crate's; see the |
| 50 | # note in Cargo.toml. |
| 51 | "prelude//os:android": ["//third-party/rust:ndk-context"], |
| 52 | }), |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 53 | ) |