Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# camera_pro — Technical Architecture

> **Project status (v0.0.1):** The engine works. The Dart control-plane, shared
> **Project status (v0.0.2):** The engine works. The Dart control-plane, shared
> C core (SIMD kernels, lock-free pool, DNG writer), and build pipeline are
> implemented and verified. The **Apple AVFoundation backend** is live-verified
> on real Mac cameras (preview, PNG/RAW capture, H.264 recording, burst,
Expand Down Expand Up @@ -221,7 +221,7 @@ The `StubCameraBackend` implements every method as a safe no-op that returns emp

`NativeCore` is a static façade over the `@Native` externals auto-generated by ffigen from `camera_pro_core.h`. It exposes typed helpers:

- `NativeCore.versionString` — real FFI call, verified to return `"0.0.1"`
- `NativeCore.versionString` — real FFI call, verified to return `"0.0.2"`
- `NativeCore.simdName` — returns the active kernel name (`"NEON"` on arm64)
- `NativeCore.errorString(code)` — maps a native `camera_error_t` to a human string
- `NativeCore.histogramFromRgba(...)` — copies a `Uint8List` into native memory, calls the SIMD histogram kernel, copies the 4 × 256-bin result back to Dart
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.2] - 2026-07-07

### Changed

- **FFI:** marked the O(1) native calls `isLeaf: true` — the introspection
Expand All @@ -21,6 +23,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a pub.dev version badge, CI badge, and install line to the README.
- Refreshed `ROADMAP.md` stats (80 VM + 65 browser tests; ~375 KB archive;
marked pub.dev **published**; noted web `MediaRecorder` video recording).
- Ten animated architecture diagrams (dark / monospace house style) woven
through the README, with a `doc/diagrams/` gallery.

### CI

- **Automated pub.dev publishing**: `release.yml` cuts a GitHub Release + tag on
every version bump merged to `main` and dispatches `publish.yml`, which uses
pub.dev trusted publishing (OIDC — no stored credentials).

## [0.0.1] - 2026-07-04

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for your interest in contributing to `camera_pro`. This document expla

## Project status

This is an early release (v0.0.1). The shared C core and Dart control-plane are implemented and verified. The Apple AVFoundation backend (macOS/iOS) is live-verified on real Mac cameras — preview, capture, RAW DNG, H.264 recording, burst, bracketing, multi-camera — with a Metal GPU compute path cross-checked bit-exact against the C kernels. The Web backend (getUserMedia) is live-verified in Chrome, including all six manual controls via a pure-Dart digital pipeline and pure-Dart DNG/visual-aid kernels byte-identical to the C core. The Linux (V4L2) and Windows (Media Foundation) C HALs implement the full 44-function contract and pass the lifecycle harness on real CI runners every push, but are not yet exposed through a Dart `CameraBackend` (desktop Dart currently falls back to the stub) and have never run against real camera hardware. The Android backend is not started. iOS sensor controls compile but have not yet run on a physical iPhone. Please read the status markers throughout the codebase before claiming a feature works:
This is an early release (v0.0.2). The shared C core and Dart control-plane are implemented and verified. The Apple AVFoundation backend (macOS/iOS) is live-verified on real Mac cameras — preview, capture, RAW DNG, H.264 recording, burst, bracketing, multi-camera — with a Metal GPU compute path cross-checked bit-exact against the C kernels. The Web backend (getUserMedia) is live-verified in Chrome, including all six manual controls via a pure-Dart digital pipeline and pure-Dart DNG/visual-aid kernels byte-identical to the C core. The Linux (V4L2) and Windows (Media Foundation) C HALs implement the full 44-function contract and pass the lifecycle harness on real CI runners every push, but are not yet exposed through a Dart `CameraBackend` (desktop Dart currently falls back to the stub) and have never run against real camera hardware. The Android backend is not started. iOS sensor controls compile but have not yet run on a physical iPhone. Please read the status markers throughout the codebase before claiming a feature works:

- ✅ implemented and verified
- 🚧 API/interface scaffolded; native side not connected
Expand Down
8 changes: 4 additions & 4 deletions COOKBOOK.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# camera_pro Cookbook

Practical recipes for working with `camera_pro` v0.0.1. This file is split into two clear sections:
Practical recipes for working with `camera_pro` v0.0.2. This file is split into two clear sections:

- **Works today** — recipes that are fully implemented, tested, and runnable against the current codebase.
- **Roadmap recipes** — intended future API shown for design reference. Each is marked 🚧 with an honest status of what exists versus what is still to build.
Expand All @@ -9,7 +9,7 @@ Practical recipes for working with `camera_pro` v0.0.1. This file is split into

## Project status

`camera_pro` v0.0.1 is a **working camera engine**. The shared C core (SIMD histogram, lock-free buffer pool, YUV→RGBA conversion, focus peaking, zebra, false color, waveform, digital adjust/zoom/blur, linear-DNG writer) and the full Dart control-plane (capability passport, state machine, typed errors, tier selection, controller, burst/bracket, `FrameProcessor` API) are implemented and verified.
`camera_pro` v0.0.2 is a **working camera engine**. The shared C core (SIMD histogram, lock-free buffer pool, YUV→RGBA conversion, focus peaking, zebra, false color, waveform, digital adjust/zoom/blur, linear-DNG writer) and the full Dart control-plane (capability passport, state machine, typed errors, tier selection, controller, burst/bracket, `FrameProcessor` API) are implemented and verified.

Platform backends: the **Apple AVFoundation backend** (macOS/iOS) is live-verified on real Mac cameras — preview, PNG/RAW capture, H.264 recording, burst, bracketing, multi-camera — with a **Metal GPU** overlay path bit-exact against the C kernels; the **Web backend** (getUserMedia) is live-verified in Chrome with all six manual controls (pure-Dart digital pipeline), RAW/DNG, and MediaRecorder video. The **Linux V4L2** and **Windows Media Foundation** C HALs implement the full 44-function contract and pass a lifecycle harness on CI, but are not yet exposed through a Dart backend (desktop Dart falls back to the conformant stub). **Android** is not started. Recipes below are labelled accordingly.

Expand All @@ -26,12 +26,12 @@ import 'package:camera_pro/camera_pro.dart';

void printCoreInfo() {
// Static helpers on CameraPro delegate to NativeCore internally.
print(CameraPro.nativeCoreVersion); // e.g. "0.0.1"
print(CameraPro.nativeCoreVersion); // e.g. "0.0.2"
print(CameraPro.simdKernel); // e.g. "NEON" on Apple Silicon

// Or use NativeCore directly for more detail.
final core = NativeCore();
print(core.versionString); // "0.0.1"
print(core.versionString); // "0.0.2"
print(core.simdName); // "NEON" | "SSE4.1" | "AVX2" | "SCALAR"
}
```
Expand Down
6 changes: 3 additions & 3 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migration Guide: `camera` and `camerawesome` → `camera_pro`

> **Project status (v0.0.1):** The shared C core, Dart control-plane, capability passport, typed errors, and tier system are implemented and verified. Live backends ship for **Apple AVFoundation** (macOS/iOS — live-verified on real Mac cameras) and **Web** (`getUserMedia`, live-verified in Chrome). The **Linux V4L2** and **Windows Media Foundation** C HALs are fully implemented and CI-verified, but are not yet exposed through a Dart backend — desktop Dart on those platforms falls back to the stub. **Android** is 🚧 roadmap. On live platforms this guide describes the **shipping API**; on stub platforms you can structure your migration now and drop in a live backend when it ships. See [Not yet available](#not-yet-available) for the honest gap list.
> **Project status (v0.0.2):** The shared C core, Dart control-plane, capability passport, typed errors, and tier system are implemented and verified. Live backends ship for **Apple AVFoundation** (macOS/iOS — live-verified on real Mac cameras) and **Web** (`getUserMedia`, live-verified in Chrome). The **Linux V4L2** and **Windows Media Foundation** C HALs are fully implemented and CI-verified, but are not yet exposed through a Dart backend — desktop Dart on those platforms falls back to the stub. **Android** is 🚧 roadmap. On live platforms this guide describes the **shipping API**; on stub platforms you can structure your migration now and drop in a live backend when it ships. See [Not yet available](#not-yet-available) for the honest gap list.

---

Expand Down Expand Up @@ -474,7 +474,7 @@ StreamBuilder<CameraState>(

## Not yet available

> **Important:** In v0.0.1 `CameraPro.create()` returns a **live, verified backend** on macOS/iOS (AVFoundation) and web (`WebCameraBackend` over `getUserMedia`). On **Linux and Windows desktop** the Dart layer still falls back to the **stub HAL** — the C HALs for both platforms are fully implemented and CI-verified, but not yet wired to a Dart `CameraBackend` — and **Android** is not started. The stub:
> **Important:** In v0.0.2 `CameraPro.create()` returns a **live, verified backend** on macOS/iOS (AVFoundation) and web (`WebCameraBackend` over `getUserMedia`). On **Linux and Windows desktop** the Dart layer still falls back to the **stub HAL** — the C HALs for both platforms are fully implemented and CI-verified, but not yet wired to a Dart `CameraBackend` — and **Android** is not started. The stub:
>
> - Returns `CameraCapabilities.unsupported()` for all features.
> - Reports `CameraTier.basic`.
Expand All @@ -500,7 +500,7 @@ StreamBuilder<CameraState>(
| Burst / bracket / HDR | ✅ burst (5 shots ~1.2 s) and EV bracketing (measured luminance at −2/0/+2) verified; HDR fusion 🚧 roadmap |
| Frame processors | ✅ `FrameProcessor` plugin API implemented |

**Already implemented and verified** in v0.0.1:
**Already implemented and verified** in v0.0.2:

- Shared C core: SIMD histogram (NEON + SSSE3 + scalar, bit-exact; x86 verified under Rosetta 2 and on CI), lock-free buffer pool, YUV420P/NV12/NV21→RGBA with NEON fast path (bit-exact), Sobel focus peaking, zebra, false color, waveform, digital adjust/zoom/blur, dependency-free linear-DNG writer with EXIF; 60-check C harness passing on arm64 and x86_64-under-Rosetta.
- Apple AVFoundation backend, live-verified on real Mac cameras: enumeration, capabilities, live preview over FFI, PNG capture, RAW linear-DNG capture (ffmpeg-verified), H.264 video recording (ffprobe-verified), burst, EV bracketing, multi-camera concurrent open, permission flow. All six manual controls run on macOS through the C digital pipeline → `CameraTier.full`; real iOS sensor controls compile but have not yet run on a physical iPhone.
Expand Down
2 changes: 1 addition & 1 deletion PLATFORM_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# camera_pro — Platform Guide

This document describes the per-platform capabilities, native API mappings, and current implementation status for `camera_pro` v0.0.1. The shared C core and Dart control-plane are complete and verified; the Apple (macOS/iOS) and Web backends are implemented and live-verified; the Linux and Windows C HALs are fully implemented and CI-verified (Dart wiring pending); Android has not been started.
This document describes the per-platform capabilities, native API mappings, and current implementation status for `camera_pro` v0.0.2. The shared C core and Dart control-plane are complete and verified; the Apple (macOS/iOS) and Web backends are implemented and live-verified; the Linux and Windows C HALs are fully implemented and CI-verified (Dart wiring pending); Android has not been started.

---

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A Flutter camera package built on a shared C/C++ core with a crash-proof Dart AP

---

> **Project status: working camera engine (v0.0.1, pre-release)**
> **Project status: working camera engine (v0.0.2, pre-release)**
>
> On macOS the example app opens the real camera and does live preview, all six manual controls, five live visual-aid overlays (histogram, focus peaking, zebra, false color, waveform — GPU-accelerated via Metal where available), PNG + RAW/DNG capture with EXIF, burst, EV bracketing, and H.264 video recording — every one of those verified live against real hardware. The same AVFoundation backend compiles for iOS with sensor-level manual controls. **Web** runs in the browser too: a getUserMedia backend with live preview, capture, and the visual aids reimplemented in pure Dart — verified in Chrome with screenshots ([see below](#web)). Linux (V4L2) and Windows (Media Foundation) backends implement the full HAL contract and pass CI on real ubuntu/windows runners (camera-hardware runtime pending machines with cameras). Android is not started — see [ROADMAP.md](ROADMAP.md) for the honest gate on every remaining item.

Expand Down Expand Up @@ -210,7 +210,7 @@ import 'package:camera_pro/camera_pro.dart';

Future<void> main() async {
// nativeCoreVersion is a real FFI call into the compiled C core.
print(CameraPro.nativeCoreVersion); // "0.0.1"
print(CameraPro.nativeCoreVersion); // "0.0.2"
print(CameraPro.simdKernel); // "NEON" on arm64, "scalar" otherwise

// create() returns a controller backed by the stub HAL until a platform HAL lands.
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Dart suite (80 VM tests + 65 browser tests), the GPU cross-check harness, CI
runners (ubuntu/windows/macos/web), Rosetta x86 runs, ffprobe/ffmpeg inspection
of produced files, or live operation of the example app against real cameras.

**Published:** [pub.dev/packages/camera_pro](https://pub.dev/packages/camera_pro) — v0.0.1.
**Published:** [pub.dev/packages/camera_pro](https://pub.dev/packages/camera_pro) — v0.0.2.

---

Expand Down Expand Up @@ -97,7 +97,7 @@ unverifiable device code).
| dartdoc | ✅ 0 warnings / 0 errors |
| `dart pub publish --dry-run` | ✅ 0 warnings (~375 KB archive) |
| CI (macos/ubuntu/windows/web, every push) | ✅ green |
| pub.dev publication | ✅ published as **v0.0.1** |
| pub.dev publication | ✅ published as **v0.0.2** |
| Localization of error strings | ❌ (English only; messages centralised in `errors.dart` / `camera_pro_error_string`) |

---
Expand Down
14 changes: 7 additions & 7 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Troubleshooting — camera_pro

This guide covers known issues, their root causes, and concrete fixes for the
`camera_pro` package (v0.0.1). Issues are presented as **Problem → Cause → Fix**.
`camera_pro` package (v0.0.2). Issues are presented as **Problem → Cause → Fix**.

---

Expand Down Expand Up @@ -148,10 +148,10 @@ regardless of the device, and all `Capability` fields come back as

**Cause**

Whether this is expected depends on the platform. In v0.0.1 the default backend
Whether this is expected depends on the platform. In v0.0.2 the default backend
is selected per target:

| Platform | Default backend in v0.0.1 |
| Platform | Default backend in v0.0.2 |
|----------|---------------------------|
| Apple AVFoundation (macOS/iOS) | ✅ `AppleCameraBackend` — wired, live-verified on real Mac cameras; all six manual controls reach `CameraTier.full` (via the digital pipeline where the sensor exposes no controls) |
| Web | ✅ `WebCameraBackend` (getUserMedia) — wired, live-verified in Chrome; all six manual controls reach `CameraTier.full` via the pure-Dart digital pipeline |
Expand All @@ -167,7 +167,7 @@ supported, which is the correct result for the stub.
**Fix**

- **On Linux desktop, Windows desktop, or Android** there is nothing to fix;
the behavior is correct for v0.0.1. Use `CameraTier.basic` as the trigger to
the behavior is correct for v0.0.2. Use `CameraTier.basic` as the trigger to
display a "limited functionality" banner in your UI, and watch the repository
for the Dart backend wiring for these platforms (the Linux/Windows C HALs
already exist and pass the portable lifecycle harness on CI).
Expand Down Expand Up @@ -267,7 +267,7 @@ library to be installed separately from the C compiler itself.
`ffigen.yaml` or as an environment variable.

**Note**: Running `ffigen` is entirely optional. The bindings shipped in
v0.0.1 (`lib/src/ffi/camera_pro_bindings.dart`) are hand-maintained `@Native`
v0.0.2 (`lib/src/ffi/camera_pro_bindings.dart`) are hand-maintained `@Native`
bindings kept 1:1 with `camera_pro_core.h` and regression-tested per symbol, so
the package builds and works out of the box without libclang. Regeneration via
`ffigen.yaml` is only relevant if you modify `camera_pro_core.h` and prefer
Expand Down Expand Up @@ -323,7 +323,7 @@ try {
```

**Tip**: On the stub backend — the fallback on Linux desktop, Windows desktop,
and Android in v0.0.1 — *all* setters will throw this error because the stub
and Android in v0.0.2 — *all* setters will throw this error because the stub
reports no capabilities as supported. This is expected there until the Dart
backends for those platforms land. On macOS, iOS, and web the wired backends
report all six manual controls (ISO, shutter, EV, white balance, focus, zoom)
Expand Down Expand Up @@ -402,4 +402,4 @@ try {

---

*Last updated: 2026-07-04 — camera_pro v0.0.1*
*Last updated: 2026-07-04 — camera_pro v0.0.2*
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: camera_pro_example
description: Demonstrates the camera_pro capability passport and crash-proof API.
publish_to: none
version: 0.0.1
version: 0.0.2

environment:
sdk: ^3.9.0
Expand Down
2 changes: 1 addition & 1 deletion lib/src/camera_pro_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'platform/default_backend.dart';
class CameraPro {
const CameraPro._();

/// Version of the bundled native core (e.g. "0.0.1"). Reads the FFI core.
/// Version of the bundled native core (e.g. "0.0.2"). Reads the FFI core.
static String get nativeCoreVersion => NativeCore.versionString;

/// The active SIMD kernel in the native core ("NEON", "SSE2", ...).
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ffi/native_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NativeCore {
/// Encoded core version `(major << 16) | (minor << 8) | patch`.
static int get versionCode => bindings.camera_pro_core_version();

/// Core version as a string, e.g. "0.0.1".
/// Core version as a string, e.g. "0.0.2".
static String get versionString =>
bindings.camera_pro_core_version_string().cast<pkg_ffi.Utf8>().toDartString();

Expand Down
4 changes: 2 additions & 2 deletions lib/src/web/native_core_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int _clampRound(double v) => v < 0 ? 0 : (v > 255 ? 255 : (v + 0.5).toInt());
class NativeCore {
const NativeCore._();

static String get versionString => '0.0.1';
static int get versionCode => (0 << 16) | (0 << 8) | 1;
static String get versionString => '0.0.2';
static int get versionCode => (0 << 16) | (0 << 8) | 2;

/// There is no SIMD/C path on web; kernels run in Dart.
static String get simdName => 'dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/web/web_dng.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Uint8List encodeLinearDng({
String datetime = '2026:01:01 00:00:00',
}) {
if (stride <= 0) stride = width * 4;
const software = 'camera_pro 0.0.1';
const software = 'camera_pro 0.0.2';
final pixelBytes = width * height * 3;

// ── Layout (identical to the C writer) ────────────────────────────────────
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_pro
description: >-
DSLR-grade camera controls with a native C/C++ core over Dart FFI. Capability-
aware, crash-proof API with manual exposure, focus, and white balance.
version: 0.0.1
version: 0.0.2
repository: https://github.com/sayed3li97/camera_pro
issue_tracker: https://github.com/sayed3li97/camera_pro/issues
topics:
Expand Down
2 changes: 1 addition & 1 deletion src/core/camera_pro_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int32_t camera_pro_core_version(void) {
}

const char* camera_pro_core_version_string(void) {
return "0.0.1";
return "0.0.2";
}

const char* camera_pro_error_string(int32_t error) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/camera_pro_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern "C" {
/* Encoded as (major << 16) | (minor << 8) | patch. */
#define CAMERA_PRO_CORE_VERSION_MAJOR 0
#define CAMERA_PRO_CORE_VERSION_MINOR 0
#define CAMERA_PRO_CORE_VERSION_PATCH 1
#define CAMERA_PRO_CORE_VERSION_PATCH 2

/* ── Version / build introspection ─────────────────────────────────────── */
CAMERA_PRO_EXPORT int32_t camera_pro_core_version(void);
Expand Down
Loading
Loading