// api
← Back to homeOllo SDK Docs | 11:54 AM

// API Reference

This reference covers the core surface shared across all engine bindings. State is kept internal. All calls are thread-safe unless noted.

start(optional_model_path: const char* = nullptr) -> bool

Initializes SDK.

Auto-resolves model and camera if no path is provided.


stop() -> bool

Stops capture and processing threads.


get_last_error() -> int

Returns last fatal code from start().


get_version() -> const char*

SDK version string.


poll_blink_events()

Drains the queue and invokes your event handlers.
Call exactly once per frame.


Event Struct (engine-specific name varies)

timestamp_ms : uint64
intensity    : float    # 0.0–1.0
side         : int      # 0=both, 1=left, 2=right

Engine Plugins

Each engine integration maps these functions into native engine constructs:

  • Godot → signals + autoload singleton
  • Unity → events + C# wrapper
  • Unreal → Blueprint nodes + native C++ module

Notes

  • Inference runs on CPU by default
  • Capture and inference run on background threads
  • Thread-safe access to blink events
  • Avoid calling start()/stop() repeatedly mid-frame

Design guarantees

Feed-only mode

When camera_index == -1, Ollo SDK processes frames from an external source instead of a webcam.

Given:

  • Identical configuration
  • Identical frame pixel data

Ollo SDK will produce:

  • Identical blink events
  • Identical signal values

Threading model

All detection and signal updates are handled exclusively on a dedicated internal worker thread.

Event callbacks are invoked directly from the worker thread.

Callbacks must:

  • Return quickly
  • Never block
  • Never call Ollo SDK lifecycle APIs (init, shutdown)

Applications requiring main-thread delivery must enqueue events themselves.