SPECS NDK Overview
The SPECS NDK builds native C and C++ libraries for Lenses on SPECS, with C APIs for media, audio, camera, location and logging.
The SPECS NDK is a cross-compilation toolkit for building native C and C++ libraries for Lenses on SPECS (ARMv8-A 64-bit). A Lens uses such a library for code that needs native performance or the SPECS platform APIs, and you can build the same library for the macOS Simulator to run it in Lens Studio. The SPECS NDK provides C APIs for media playback, audio I/O, camera access, encoded camera/AR/audio recording, finalized MP4 capture, GPU texture output of media frames, foreground audio session coordination, location services, system logging, and app directory resolution.
These pages document SPECS NDK v1.3.0.
What's included in the SPECS NDK
- Clang cross-compiler for macOS and Windows hosts (18.1.8 on macOS, 22 on Windows through llvm-mingw)
- CMake toolchain files for immediate project integration, plus a macOS Simulator toolchain (see macOS Simulator)
- Platform APIs:
SpecsPlayer: high-level media playback (video + audio); supports live video device capture, dual-track AR overlay, and display-layer visibility controlSpecsMediaCodec: low-level encode/decode pipelineSpecsMediaExtractor: demux raw samples from media filesSpecsMediaPresenter: timed presentation of decoded media buffers to displaySpecsMediaBuffer: reference-counted hardware buffer managementSpecsMediaGLTexture: zero-copy update of caller-owned OpenGL ES textures fromSpecsMediaBuffervideo framesSpecsRecorder: encoded camera video, AR video, and audio stream recording (H.264 / H.265, AAC)SpecsCapture: one-shot camera+microphone recording finalized to an MP4 file descriptorSpecsAudioPlayback: PCM audio output to speaker/submix, with listener-relative source pose updates for spatial audioSpecsAudioRecord: microphone and audio input captureSpecsForegroundAudioSession: system-managed foreground audio session coordinator (audio content, call, and audio focus sessions)SpecsCamera: camera stream management with ISP controlSpecsLocation: fused location provider (GPS, heading, speed)SpecsLog: system logging (printf-style, per-level macros)SpecsFs: the app's well-known data and library root directories (header-only on the device)
- Permission annotations and tooling:
SpecsPermissions.hdeclares the OS permission each SPECS API requires; the toolchain automatically embeds a.snap.permissionsmanifest into your.so(see Permission Annotations and Manifest Embedding) - Version header:
SpecsNDKVersion.hexposes the NDK release version as compile-time macros (SPECS_NDK_VERSION_MAJOR/MINOR/PATCH,SPECS_NDK_VERSION_STRING) - Open source libraries you can link: OpenSSL 3.5.7 (security and cryptography), libcurl 8.7.1 (networking) and zlib 1.3.1 (compression); see Open Source Libraries
SPECS NDK platform details
| Property | Value |
|---|---|
| Target architecture | ARMv8-A 64-bit (aarch64) |
| Target OS | SPECS (aarch64-snap-linux) |
| Host | macOS (darwin21) or Windows |
| NDK version | 1.3.0 |
| Minimum SPECS OS | SPECS OS 3.0.0 or later on the device |
Get the SPECS NDK
The SPECS NDK ships as a host tarball for each supported build host: macOS and Windows. Both produce identical aarch64 target binaries; only the host tools differ. The packages, and their matching OSS source packages, are on the Downloads page.
Quick start
# Configure your project with the Clang toolchain
cmake -B build \
-DCMAKE_TOOLCHAIN_FILE=/path/to/specsndk-armv8-1.3.0/SpecsNDK-Toolchain-Clang.cmake \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
For a full walkthrough including a minimal project example, start with Prerequisites and NDK Layout.
SPECS NDK API summary
| API | Header | Library | Use case |
|---|---|---|---|
SpecsPlayer | SpecsPlayer.h | -lspecs_player | Play media files with minimal setup |
SpecsMediaCodec | SpecsMediaCodec.h | -lspecs_media | Low-level encode/decode pipeline |
SpecsMediaExtractor | SpecsMediaExtractor.h | -lspecs_media | Demux raw samples from media files |
SpecsMediaPresenter | SpecsMediaPresenter.h | -lspecs_media | Timed presentation of decoded buffers to display |
SpecsMediaBuffer | SpecsMediaBuffer.h | -lspecs_media | Reference-counted hardware buffer management |
SpecsMediaGLTexture | SpecsMediaGLTexture.h | -lspecs_media | Update a caller-owned OpenGL ES texture from a SpecsMediaBuffer video frame without a CPU copy |
SpecsRecorder | SpecsRecorder.h | -lspecs_media | Encoded camera video, AR video, or audio stream recording |
SpecsCapture | SpecsCapture.h | -lspecs_media | One-shot camera+mic recording finalized to an MP4 file descriptor |
SpecsAudioPlayback | SpecsAudioPlayback.h | -lspecs_audio_playback | Output PCM audio to speaker/submix |
SpecsAudioRecord | SpecsAudioRecord.h | -lspecs_audio_record | Capture audio from microphone |
SpecsForegroundAudioSession | SpecsForegroundAudioSessionCoordinator.h | -lspecs_foreground_audio | Register audio content, call, and focus sessions with the system coordinator |
SpecsCamera | SpecsCameraManager.h | -lspecs_camera | Camera stream management |
SpecsLocation | SpecsLocationProvider.h | -lspecs_location | Fused location (GPS, heading, speed) |
SpecsLog | SpecsLog.h | -lspecs_log | System logging (printf-style, per-level macros) |
SpecsFs | SpecsFs.h | None (header-only on the device) | Resolve the app's data and library root directories |