stream_info(url) UniFFI suspend fn replaces NewPipeExtractor's StreamInfo.getInfo() for both VideoDetailViewModel and PlayerViewModel. One Rust round-trip drives the detail screen render AND the player's resolve(). The VideoDetailUiState.info field cached on detail load is reused by the Download dialog so we don't refetch. Deferred to U-3.5: - like_count (rustypipe's player() doesn't surface engagement data; a separate query is needed) - related (player() doesn't include 'up next'; comes from a separate endpoint). Kotlin gets empty list for now — RelatedRow handles it. Type quirks vs my initial guesses (caught by cargo check): - details.duration is u32, not Option<u32> - channel is split into channel_id + channel_name, not a struct - like_count doesn't exist at this query depth - VideoFormat::Webm (lowercase mb), VideoCodec::Avc1 (not H264) - video_only is a separate vec (video_only_streams), not a bool flag
48 lines
2.1 KiB
TOML
48 lines
2.1 KiB
TOML
[package]
|
|
name = "strawcore"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
repository.workspace = true
|
|
|
|
[lib]
|
|
# cdylib — the .so that Android loads via System.loadLibrary("strawcore").
|
|
# staticlib — kept in case we ever want to link statically for a benchmark.
|
|
crate-type = ["cdylib", "staticlib"]
|
|
|
|
[dependencies]
|
|
# UniFFI generates the Kotlin bindings + the JNI glue. proc-macro mode
|
|
# (no .udl file) — annotate Rust fns directly with #[uniffi::export].
|
|
# `tokio` feature wires `#[uniffi::export(async_runtime = "tokio")]` so async
|
|
# fns surface as suspend fun on the Kotlin side.
|
|
uniffi = { version = "0.28", features = ["cli", "tokio"] }
|
|
# Tokio multi-thread runtime — rustypipe is async-first.
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync"] }
|
|
# rustypipe — the actual YouTube Innertube client. Phase U-2 wires search.
|
|
# Force rustls + webpki-roots so we don't pull openssl-sys (cross-compiling
|
|
# system OpenSSL to four Android ABIs is a tarpit; rustls is pure-Rust).
|
|
rustypipe = { version = "0.11", default-features = false, features = ["rustls-tls-webpki-roots"] }
|
|
# rquickjs-sys (transitive dep of rustypipe for YT signature decryption JS)
|
|
# doesn't ship prebuilt Android bindings. Direct-depend with `bindgen` feature
|
|
# so it generates them at build time. Crafting-table has libclang preinstalled.
|
|
rquickjs-sys = { version = "0.9", default-features = false, features = ["bindgen"] }
|
|
# Error glue.
|
|
thiserror = "1"
|
|
# Single-threaded init for the runtime + extractor singletons.
|
|
once_cell = "1"
|
|
# URL parsing for the video-id extractor in stream.rs.
|
|
url = { workspace = true }
|
|
# Android log integration — `log::info!()` ends up in `adb logcat -s strawcore`.
|
|
log = "0.4"
|
|
android_logger = { version = "0.14", default-features = false }
|
|
|
|
[build-dependencies]
|
|
uniffi = { version = "0.28", features = ["build"] }
|
|
|
|
[[bin]]
|
|
# Generates Kotlin bindings from the compiled .so:
|
|
# cargo run --bin uniffi-bindgen generate --library target/.../libstrawcore.so \
|
|
# --language kotlin --out-dir ../../strawApp/src/main/kotlin
|
|
name = "uniffi-bindgen"
|
|
path = "src/uniffi-bindgen.rs"
|