Stream Engine

The Stream Engine SDK is a low-level SDK intended for advanced users wanting to have tight control over the system resources used by Stream Engine and the least amount of signal latency.


Overview

Stream Engine can be used to connect to almost any Tobii eye tracker, given that you have the correct Tobii Runtime installed, but the documentation in this section focuses on XR eye trackers.

The Stream Engine SDK consists of a dynamic library and several header files, each providing access to a separate set of functionality. To get started with XR development you will have to interface with:

tobii.h

Collects the core API functions of Stream Engine. It contains functions to initialize the API and establish a connection to a tracker, as well as enumerating connected devices and requesting callbacks for subscriptions. There are also functions for querying the current state of a tracker, and to query its capabilities.

Note that even though the header files are available, the type of license you have may restrict your access to certain functions.

The core API functions includes all you need to get started with using eye tracking for interactive use. If you wish to access more detailed eye tracking data streams and advanced functionality, please contact Tobii via https://tech.tobii.com/contact/

tobii_wearable.h

Functionality related to wearable devices, such as VR and AR headsets. It contains data streams unique to XR eye trackers, as well as functions to retrieve and modify the lens configuration of the device.


Usage

The library creates no threads, so in order to drive the message pump inside stream engine, thereby propagating the stream data through to the main application, the tobii_device_process_callbacks must be called at an even interval and at least 10 times per second.

Memory is only allocated when calling the create functions for api, device & engine and are in turn freed when calling their respective destroy functions. In order to gain full control of memory allocation, custom memory allocators can be used which are passed to Stream Engine during initialization. The same goes for logging where a custom logging function can be passed during the same initialization call.

Please note that there can only be one callback registered to a stream at a time. To register a new callback, first unsubscribe from the stream, then resubscribe with the new callback function.

The Tobii Stream Engine API implements full thread safety across all API functions. However, it is up to the user to guarantee thread safety in code injected into Stream Engine, for example inside callbacks or if a custom memory allocator is supplied. It is not allowed to call Stream Engine API functions from within a callback invoked by Stream Engine. Attempting to do so will result in TOBII_ERROR_CALLBACK_IN_PROGRESS. A specific exception to this is tobii_system_clock which specifically is allowed to be called even from within a callback function.


Getting Started

Read how to get started with the Stream Engine SDK

API

A complete reference of the Stream Engine API