fix(wzp-video): cfg-gate dav1d + svt-av1 off Android target

shiguredo_dav1d and shiguredo_svt_av1 build scripts panic with
'unsupported target: os=android, arch=aarch64'. The AV1 SW fallback
is only needed on macOS / Linux desktop — Android uses MediaCodec
for AV1 anyway.

- Cargo.toml: AV1 SW deps moved under cfg(not(target_os = "android"))
- lib.rs: cfg-gate the dav1d and svt_av1 modules and re-exports
- factory.rs: on Android, Av1Main paths return NotInitialized when
  HW MediaCodec is also unavailable (only path on Android)
- factory tests: assert NotInitialized on Android, Ok elsewhere

Unblocks T4.3.1.1 (Android target-compile of wzp-video / mediacodec).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-05-12 19:58:37 +04:00
parent f28f39d814
commit f3e3ee5ed0
3 changed files with 46 additions and 13 deletions

View File

@@ -6,6 +6,7 @@
pub mod av1_obu;
pub mod controller;
#[cfg(not(target_os = "android"))]
pub mod dav1d;
pub mod decoder;
pub mod depacketizer;
@@ -16,11 +17,13 @@ pub mod framer;
pub mod mediacodec;
pub mod nack;
pub mod simulcast;
#[cfg(not(target_os = "android"))]
pub mod svt_av1;
pub mod videotoolbox;
pub use av1_obu::{Av1Depacketizer, Av1ObuFramer, is_keyframe_obu};
pub use controller::{VideoQualityController, VideoTarget};
#[cfg(not(target_os = "android"))]
pub use dav1d::Dav1dDecoder;
pub use decoder::VideoDecoder;
pub use depacketizer::H264Depacketizer;
@@ -34,6 +37,7 @@ pub use mediacodec::{
};
pub use nack::{CachedPacket, NackAction, NackReceiver, NackSender};
pub use simulcast::{LayerPacket, LayerTarget, SimulcastEncoder, SimulcastLayer};
#[cfg(not(target_os = "android"))]
pub use svt_av1::SvtAv1Encoder;
pub use videotoolbox::{
VideoToolboxAv1Decoder, VideoToolboxDecoder, VideoToolboxEncoder, VideoToolboxHevcDecoder,