Fifth incremental variable — and the first genuinely heavy one. Adds:
- cpp/oboe_bridge.{h,cpp} (copied verbatim from crates/wzp-android/cpp/)
- cpp/oboe_stub.cpp (fallback if Oboe can't be fetched)
- build.rs now clones google/oboe@1.8.1 into OUT_DIR and compiles
oboe_bridge.cpp + every .cpp file under oboe/src/ as a single
static library via cc::Build, using shared libc++. Same logic as
the legacy wzp-android build.rs.
- libc++_shared.so gets copied from the NDK sysroot into the Tauri
gen/android jniLibs directory so the runtime linker can find it.
- rustc-link-lib=log / OpenSLES emitted for Oboe's Android backends.
Deliberately NOT called from Rust yet — no extern "C" FFI declarations,
no oboe_audio.rs module, the `wzp_oboe_*` symbols from the static lib
are simply present but unreferenced.
Goal: isolate whether the Oboe C++ compile + static lib link alone
(with its libc++ dependency and log/OpenSLES bindings) regresses the
working baseline. If the build still launches and renders the home
screen, we know the C++ side is clean and the actual regression is
caused by calling into Oboe at runtime (next step).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
44 lines
934 B
C++
44 lines
934 B
C++
#ifndef WZP_OBOE_BRIDGE_H
|
|
#define WZP_OBOE_BRIDGE_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
#include <atomic>
|
|
typedef std::atomic<int32_t> wzp_atomic_int;
|
|
extern "C" {
|
|
#else
|
|
#include <stdatomic.h>
|
|
typedef atomic_int wzp_atomic_int;
|
|
#endif
|
|
|
|
typedef struct {
|
|
int32_t sample_rate;
|
|
int32_t frames_per_burst;
|
|
int32_t channel_count;
|
|
} WzpOboeConfig;
|
|
|
|
typedef struct {
|
|
int16_t* capture_buf;
|
|
int32_t capture_capacity;
|
|
wzp_atomic_int* capture_write_idx;
|
|
wzp_atomic_int* capture_read_idx;
|
|
|
|
int16_t* playout_buf;
|
|
int32_t playout_capacity;
|
|
wzp_atomic_int* playout_write_idx;
|
|
wzp_atomic_int* playout_read_idx;
|
|
} WzpOboeRings;
|
|
|
|
int wzp_oboe_start(const WzpOboeConfig* config, const WzpOboeRings* rings);
|
|
void wzp_oboe_stop(void);
|
|
float wzp_oboe_capture_latency_ms(void);
|
|
float wzp_oboe_playout_latency_ms(void);
|
|
int wzp_oboe_is_running(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // WZP_OBOE_BRIDGE_H
|