Tobii Pro SDK C API
tobii_research_streams.h File Reference

Functionality for eye tracker streams. More...

Go to the source code of this file.

Data Structures

struct  TobiiResearchGazeOrigin
 
struct  TobiiResearchPupilData
 
struct  TobiiResearchGazePoint
 
struct  TobiiResearchEyeData
 
struct  TobiiResearchGazeData
 
struct  TobiiResearchHMDPupilPosition
 
struct  TobiiResearchHMDGazeOrigin
 
struct  TobiiResearchHMDGazeDirection
 
struct  TobiiResearchHMDEyeData
 
struct  TobiiResearchHMDGazeData
 
struct  TobiiResearchTimeSynchronizationData
 
struct  TobiiResearchExternalSignalData
 
struct  TobiiResearchNotification
 
struct  TobiiResearchStreamErrorData
 
struct  TobiiResearchEyeImage
 
struct  TobiiResearchEyeImageGif
 

Typedefs

typedef void(* tobii_research_gaze_data_callback) (TobiiResearchGazeData *gaze_data, void *user_data)
 Gaze data callback. More...
 
typedef void(* tobii_research_hmd_gaze_data_callback) (TobiiResearchHMDGazeData *hmd_gaze_data, void *user_data)
 HMD gaze data callback. More...
 
typedef void(* tobii_research_external_signal_data_callback) (TobiiResearchExternalSignalData *external_signal_data, void *user_data)
 External signal callback. More...
 
typedef void(* tobii_research_time_synchronization_data_callback) (TobiiResearchTimeSynchronizationData *time_synchronization_data, void *user_data)
 Time synchronization callback. More...
 
typedef void(* tobii_research_stream_error_callback) (TobiiResearchStreamErrorData *stream_error, void *user_data)
 Stream error callback. More...
 
typedef void(* tobii_research_notification_callback) (TobiiResearchNotification *notification, void *user_data)
 Notification callback. More...
 
typedef void(* tobii_research_eye_image_callback) (TobiiResearchEyeImage *frame, void *user_data)
 Eye image callback. More...
 
typedef void(* tobii_research_eye_image_as_gif_callback) (TobiiResearchEyeImageGif *frame, void *user_data)
 Eye image gif callback. More...
 

Enumerations

Functions

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_gaze_data (TobiiResearchEyeTracker *eyetracker, tobii_research_gaze_data_callback callback, void *user_data)
 Subscribes to gaze data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_gaze_data (TobiiResearchEyeTracker *eyetracker, tobii_research_gaze_data_callback callback)
 Unsubscribes from gaze data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_hmd_gaze_data (TobiiResearchEyeTracker *eyetracker, tobii_research_hmd_gaze_data_callback callback, void *user_data)
 Subscribes to gaze data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_hmd_gaze_data (TobiiResearchEyeTracker *eyetracker, tobii_research_hmd_gaze_data_callback callback)
 Unsubscribes from HMD gaze data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_external_signal_data (TobiiResearchEyeTracker *eyetracker, tobii_research_external_signal_data_callback callback, void *user_data)
 Subscribes to external signal data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_external_signal_data (TobiiResearchEyeTracker *eyetracker, tobii_research_external_signal_data_callback callback)
 Unsubscribes from external signal data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_time_synchronization_data (TobiiResearchEyeTracker *eyetracker, tobii_research_time_synchronization_data_callback callback, void *user_data)
 Subscribes to time synchronization data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_time_synchronization_data (TobiiResearchEyeTracker *eyetracker, tobii_research_time_synchronization_data_callback callback)
 Unsubscribes from time synchronization data for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_stream_errors (TobiiResearchEyeTracker *eyetracker, tobii_research_stream_error_callback callback, void *user_data)
 Subscribes to stream errors for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_stream_errors (TobiiResearchEyeTracker *eyetracker, tobii_research_stream_error_callback callback)
 Unsubscribes from stream errors for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_notifications (TobiiResearchEyeTracker *eyetracker, tobii_research_notification_callback callback, void *user_data)
 Subscribes to notifications for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_notifications (TobiiResearchEyeTracker *eyetracker, tobii_research_notification_callback callback)
 Unsubscribes from notifications for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_eye_image (TobiiResearchEyeTracker *eyetracker, tobii_research_eye_image_callback callback, void *user_data)
 Subscribes to eye image for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_eye_image_as_gif (TobiiResearchEyeTracker *eyetracker, tobii_research_eye_image_as_gif_callback callback, void *user_data)
 Subscribes to eye image for the eye tracker with the image delivered in gif format. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_eye_image (TobiiResearchEyeTracker *eyetracker, tobii_research_eye_image_callback callback)
 Unsubscribes from eye image for the eye tracker. More...
 
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_eye_image_as_gif (TobiiResearchEyeTracker *eyetracker, tobii_research_eye_image_as_gif_callback callback)
 Unsubscribes from eye image for the eye tracker. More...
 

Detailed Description

Functionality for eye tracker streams.

Typedef Documentation

typedef void(* tobii_research_external_signal_data_callback) (TobiiResearchExternalSignalData *external_signal_data, void *user_data)

External signal callback.

Implement this and send as a parameter to tobii_research_subscribe_to_external_signal_data.

Parameters
external_signal_dataExternal signal data received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_external_signal_data.
typedef void(* tobii_research_eye_image_as_gif_callback) (TobiiResearchEyeImageGif *frame, void *user_data)

Eye image gif callback.

Implement this and send as a parameter to tobii_research_subscribe_to_eye_image_as_gif.

Parameters
frameEye image gif frame received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_eye_image_as_gif.
typedef void(* tobii_research_eye_image_callback) (TobiiResearchEyeImage *frame, void *user_data)

Eye image callback.

Implement this and send as a parameter to tobii_research_subscribe_to_eye_image.

Parameters
frameEye image frame received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_eye_image.
typedef void(* tobii_research_gaze_data_callback) (TobiiResearchGazeData *gaze_data, void *user_data)

Gaze data callback.

Implement this and send as a parameter to tobii_research_subscribe_to_gaze_data.

Parameters
gaze_dataGaze data received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_gaze_data.
typedef void(* tobii_research_hmd_gaze_data_callback) (TobiiResearchHMDGazeData *hmd_gaze_data, void *user_data)

HMD gaze data callback.

Implement this and send as a parameter to tobii_research_subscribe_to_hmd_gaze_data.

Parameters
hmd_gaze_dataHMD gaze data received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_hmd_gaze_data.
typedef void(* tobii_research_notification_callback) (TobiiResearchNotification *notification, void *user_data)

Notification callback.

Implement this and send as a parameter to tobii_research_subscribe_to_notifications.

Parameters
notificationNotification received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_notifications.
typedef void(* tobii_research_stream_error_callback) (TobiiResearchStreamErrorData *stream_error, void *user_data)

Stream error callback.

Implement this and send as a parameter to tobii_research_subscribe_to_stream_errors.

Parameters
stream_errorTobiiResearchStreamErrorData object.
user_dataCaller specific data sent in with tobii_research_subscribe_to_stream_errors.
typedef void(* tobii_research_time_synchronization_data_callback) (TobiiResearchTimeSynchronizationData *time_synchronization_data, void *user_data)

Time synchronization callback.

Implement this and send as a parameter to tobii_research_subscribe_to_time_synchronization_data.

Parameters
gaze_dataTime synchronization data received from the eye tracker.
user_dataCaller specific data sent in with tobii_research_subscribe_to_time_synchronization_data.

Enumeration Type Documentation

Defines external signal change type.

Enumerator
TOBII_RESEARCH_EXTERNAL_SIGNAL_VALUE_CHANGED 

Indicates that the value sent to the eye tracker has changed.

TOBII_RESEARCH_EXTERNAL_SIGNAL_INITIAL_VALUE 

Indicates that the value is the initial value, and is received when starting a subscription.

TOBII_RESEARCH_EXTERNAL_SIGNAL_CONNECTION_RESTORED 

Indicates that there has been a connection lost and now it is restored and the value is the current value.

Defines eye image type.

Enumerator
TOBII_RESEARCH_EYE_IMAGE_TYPE_FULL 

Indicates that the eye tracker could not identify the eyes, and the image is the full image.

TOBII_RESEARCH_EYE_IMAGE_TYPE_CROPPED 

Indicates that the image is cropped and shows the eyes.

TOBII_RESEARCH_EYE_IMAGE_TYPE_UNKNOWN 

The eye image has an unexpected type.

Defines notification types

Enumerator
TOBII_RESEARCH_NOTIFICATION_CONNECTION_LOST 

Indicates that the connection to the eye tracker is lost

TOBII_RESEARCH_NOTIFICATION_CONNECTION_RESTORED 

Indicates that the connection to the eye tracker is restored

TOBII_RESEARCH_NOTIFICATION_CALIBRATION_MODE_ENTERED 

Indicates that the calibration mode is entered.

TOBII_RESEARCH_NOTIFICATION_CALIBRATION_MODE_LEFT 

Indicates that the calibration mode is left.

TOBII_RESEARCH_NOTIFICATION_TRACK_BOX_CHANGED 

Indicates that the track box is changed.

TOBII_RESEARCH_NOTIFICATION_DISPLAY_AREA_CHANGED 

Indicates that the display area is changed.

TOBII_RESEARCH_NOTIFICATION_GAZE_OUTPUT_FREQUENCY_CHANGED 

Indicates that the gaze output frequency is changed

TOBII_RESEARCH_NOTIFICATION_UNKNOWN 

Defines error types

Enumerator
TOBII_RESEARCH_STREAM_ERROR_CONNECTION_LOST 

Indicates that the connection to the eye tracker was lost.

TOBII_RESEARCH_STREAM_ERROR_INSUFFICIENT_LICENSE 

Indicates that the license is insufficient for subscribing to the stream.

TOBII_RESEARCH_STREAM_ERROR_NOT_SUPPORTED 

Indicates that the stream isn't supported by the eye tracker.

TOBII_RESEARCH_STREAM_ERROR_INTERNAL_ERROR 

Indicates that an internal error occurred.

TOBII_RESEARCH_STREAM_ERROR_USER_ERROR 

Indicates that the user threw an exception in the callback.

Defines error sources

Enumerator
TOBII_RESEARCH_STREAM_ERROR_SOURCE_USER 

User callback failed.

TOBII_RESEARCH_STREAM_ERROR_SOURCE_STREAM_PUMP 

Error when pumping event.

TOBII_RESEARCH_STREAM_ERROR_SOURCE_SUBSCRIPTION_GAZE_DATA 

Error when subscribing to event for gaze data.

TOBII_RESEARCH_STREAM_ERROR_SOURCE_SUBSCRIPTION_EXTERNAL_SIGNAL 

Error when subscribing to event for external signal.

TOBII_RESEARCH_STREAM_ERROR_SOURCE_SUBSCRIPTION_TIME_SYNCHRONIZATION_DATA 

Error when subscribing to event for time synchronization data.

TOBII_RESEARCH_STREAM_ERROR_SOURCE_SUBSCRIPTION_EYE_IMAGE 

Error when subscribing to event for eye images.

TOBII_RESEARCH_STREAM_ERROR_SOURCE_SUBSCRIPTION_NOTIFICATION 

Error when subscribing to notification event.

Specifies the validity.

Enumerator
TOBII_RESEARCH_VALIDITY_INVALID 

Indicates invalid.

TOBII_RESEARCH_VALIDITY_VALID 

Indicates valid.

Function Documentation

TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_external_signal_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_external_signal_data_callback  callback,
void *  user_data 
)

Subscribes to external signal data for the eye tracker.

You will get a callback when the value of the external signal port (TTL input) on the eye tracker device changes. Not all eye trackers have an output trigger port. The output feature could be used to synchronize the eye tracker data with data from other devices. The output data contains a time reference that matches the time reference on the time synchronized gaze data.

void external_signal_callback(TobiiResearchExternalSignalData* external_signal_data, void* user_data) {
(void)(user_data); // Is NULL, see subscription call
printf("External signal: device time stamp %" PRId64 ", value %i \n",
external_signal_data->device_time_stamp, external_signal_data->value);
}
void external_signal_example(TobiiResearchEyeTracker* eyetracker) {
char* serial_number;
tobii_research_get_serial_number(eyetracker, &serial_number);
printf("Subscribing to external signal for eye tracker with serial number %s.\n", serial_number);
tobii_research_subscribe_to_external_signal_data(eyetracker, external_signal_callback, NULL);
/* Wait for external signal. */
sleep_ms(2000);
tobii_research_unsubscribe_from_external_signal_data(eyetracker, external_signal_callback);
printf("Unsubscribed from external signal.");
}
Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the external signal data.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
Examples:
external_signal.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_eye_image ( TobiiResearchEyeTracker eyetracker,
tobii_research_eye_image_callback  callback,
void *  user_data 
)

Subscribes to eye image for the eye tracker.

You will get a callback when a new eye image is received, and the occurrence depends on the eye tracker model. Not all eye tracker models support this feature. If no one is listening to gaze data, the eye tracker will only deliver full images, otherwise either cropped or full images will be delivered depending on whether or not the eye tracker has detected eyes.

void eye_image_callback(TobiiResearchEyeImage* frame, void* user_data) {
const char* dir_path = (const char*)user_data;
char img_path[256];
FILE* fd;
TiffHeader header = {
.id=0x4949, // II little endian
.version = 42, // Image version
.offset_first_ifd = sizeof(header) + (int32_t)frame->data_size // Offset to first IFD from start of file
};
TiffIFDEntry img_lenght = {.tag=257, .type=3, .N=1, .value=frame->height}; // Image length (height)
TiffIFDEntry img_width = {.tag=256, .type=3, .N=1, .value=frame->width}; // Image width
TiffIFDEntry compression = {.tag=259, .type=3, .N=1, .value=1}; // Compression 1 = no compression
TiffIFDEntry bits_per_sample = {.tag=258, .type=3, .N=1, .value=8}; // BitsPerSample
TiffIFDEntry strip_offsets = {.tag=273, .type=3, .N=1, .value=8}; // StripOffsets
TiffIFDEntry samples_per_pixels = {.tag=277, .type=3, .N=1, .value=1}; // SamplesPerPixel
TiffIFDEntry photometric_interpretation = {.tag=262, .type=3, .N=1, .value=1}; // PhotometricInterpretation
int16_t number_of_ifd_entries = 7;
int16_t next_ifd_offset = 0; // 0, hence no more IFD in this file
sprintf(img_path, "%s/eye_image_%" PRId64 ".tif", dir_path, frame->device_time_stamp); // Create image name
printf("Received image %s\n", img_path);
fd = fopen(img_path, "wb");
fwrite(&header, sizeof(header), 1, fd); // Writing header
fwrite(frame->data, frame->data_size, 1, fd); // Writing image data to file
// Writing IFD entries, starts with number of entries
fwrite(&number_of_ifd_entries, 1, sizeof(number_of_ifd_entries), fd);
fwrite(&img_lenght, 1, sizeof(img_lenght), fd);
fwrite(&img_width, 1, sizeof(img_width), fd);
fwrite(&compression, 1, sizeof(compression), fd);
fwrite(&bits_per_sample, 1, sizeof(bits_per_sample), fd);
fwrite(&strip_offsets, 1, sizeof(strip_offsets), fd);
fwrite(&samples_per_pixels, 1, sizeof(samples_per_pixels), fd);
fwrite(&photometric_interpretation, 1, sizeof(photometric_interpretation), fd);
fwrite(&next_ifd_offset, 1, sizeof(next_ifd_offset), fd);
fclose(fd);
}
void eye_images_example(TobiiResearchEyeTracker* eyetracker, const char* dir_path) {
/* Subscribe to eye images */
tobii_research_subscribe_to_eye_image(eyetracker, eye_image_callback, (void*)dir_path);
/* Wait for eye images. */
sleep_ms(2000);
/* Unsubscribe to eye images */
tobii_research_unsubscribe_from_eye_image(eyetracker, eye_image_callback);
}
Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the frames.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
Examples:
eye_images.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_eye_image_as_gif ( TobiiResearchEyeTracker eyetracker,
tobii_research_eye_image_as_gif_callback  callback,
void *  user_data 
)

Subscribes to eye image for the eye tracker with the image delivered in gif format.

You will get a callback when a new eye image is received, and the occurrence depends on the eye tracker model. Not all eye tracker models support this feature. If no one is listening to gaze data, the eye tracker will only deliver full images, otherwise either cropped or full images will be delivered depending on whether or not the eye tracker has detected eyes.

void eye_image_as_gif_callback(TobiiResearchEyeImageGif* frame, void* user_data) {
const char* dir_path = (const char*)user_data;
char img_path[256];
FILE* fd;
sprintf(img_path, "%s/eye_image_%" PRId64 ".gif", dir_path, frame->device_time_stamp);
printf("Received image %s\n", img_path);
fd = fopen(img_path, "wb");
fwrite(frame->image_data, frame->image_size, 1, fd);
fclose(fd);
}
void eye_images_as_gif_example(TobiiResearchEyeTracker* eyetracker, const char* dir_path) {
/* Subscribe to eye images */
eyetracker,
eye_image_as_gif_callback, (void*)dir_path);
/* Wait for eye images. */
sleep_ms(2000);
/* Unsubscribe to eye images */
eyetracker,
eye_image_as_gif_callback);
}
Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the frames.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
Examples:
eye_images_as_gif.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_gaze_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_gaze_data_callback  callback,
void *  user_data 
)

Subscribes to gaze data for the eye tracker.

You will get a callback when time synchronized gaze is received.Time synchronized gaze is not supported on all eye trackers, other eye trackers need additional license to activate this support.

void gaze_data_callback(TobiiResearchGazeData* gaze_data, void* user_data) {
memcpy(user_data, gaze_data, sizeof(*gaze_data));
}
void gaze_data_example(TobiiResearchEyeTracker* eyetracker) {
char* serial_number;
tobii_research_get_serial_number(eyetracker, &serial_number);
printf("Subscribing to gaze data for eye tracker with serial number %s.\n", serial_number);
TobiiResearchStatus status = tobii_research_subscribe_to_gaze_data(eyetracker, gaze_data_callback, &gaze_data);
if (status != TOBII_RESEARCH_STATUS_OK)
return;
/* Wait while some gaze data is collected. */
sleep_ms(2000);
status = tobii_research_unsubscribe_from_gaze_data(eyetracker, gaze_data_callback);
printf("Unsubscribed from gaze data with status %i.\n", status);
printf("Last received gaze package:\n");
printf("System time stamp: %" PRId64 "\n", gaze_data.system_time_stamp);
printf("Device time stamp: %" PRId64 "\n", gaze_data.device_time_stamp);
printf("Left eye 2D gaze point on display area: (%f, %f)\n",
printf("Right eye 3d gaze origin in user coordinates (%f, %f, %f)\n",
/* Wait while some gaze data is collected. */
sleep_ms(2000);
}
Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the gaze data.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
Examples:
gaze_data.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_hmd_gaze_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_hmd_gaze_data_callback  callback,
void *  user_data 
)

Subscribes to gaze data for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the gaze data.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_notifications ( TobiiResearchEyeTracker eyetracker,
tobii_research_notification_callback  callback,
void *  user_data 
)

Subscribes to notifications for the eye tracker.

You will get a callback when notification is received.

void notification_callback(TobiiResearchNotification* notification, void* user_data) {
printf("Enter calibration mode notification received at time stamp %" PRId64 ".\n", notification->system_time_stamp);
}
printf("Left calibration mode notification received at time stamp %" PRId64 ".\n", notification-> system_time_stamp);
}
(void)(user_data); // Is NULL, see subscription call
}
void notifications_example(TobiiResearchEyeTracker* eyetracker) {
tobii_research_subscribe_to_notifications(eyetracker, notification_callback, NULL);
/* Trigger some notifications */
/* Unsubscribe from notifications. */
tobii_research_unsubscribe_from_notifications(eyetracker, notification_callback);
}
Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the notifications.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
Examples:
notifications.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_stream_errors ( TobiiResearchEyeTracker eyetracker,
tobii_research_stream_error_callback  callback,
void *  user_data 
)

Subscribes to stream errors for the eye tracker.

You will get a callback when an error occurs on other streams. You can get errors when subscribing, when something happened to the connection in the stream pump or when an error was raised in a callback.

Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the stream errors.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_subscribe_to_time_synchronization_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_time_synchronization_data_callback  callback,
void *  user_data 
)

Subscribes to time synchronization data for the eye tracker.

You will get a callback when the computer and the eye trackers clocks gets synchronized. To handle normal drifts between clocks the clocks are checked on regular basis, and this results in that the time stamps are adjusted for the drifts in the data streams. This drift handling is done in real time. The data received from this event could be used for an even more accurate drift adjustment in the post processing.

void time_synchronization_data_callback(TobiiResearchTimeSynchronizationData* time_synchronization_data,
void* user_data){
(void)(user_data); // Is NULL, see subscribing call
printf("Device time stamp: %" PRId64 "\n", time_synchronization_data->device_time_stamp);
printf("System request time stamp: %" PRId64 "\n", time_synchronization_data->system_request_time_stamp);
printf("System response time stamp: %" PRId64 "\n", time_synchronization_data->system_response_time_stamp);
}
void time_synchronization_data_example(TobiiResearchEyeTracker* eyetracker) {
char* serial_number;
tobii_research_get_serial_number(eyetracker, &serial_number);
printf("Subscribing to time synchronization data for eye tracker with serial number %s.\n", serial_number);
tobii_research_subscribe_to_time_synchronization_data(eyetracker, time_synchronization_data_callback, NULL);
/* Wait while some time synchronization data is collected. */
sleep_ms(2000);
tobii_research_unsubscribe_from_time_synchronization_data(eyetracker, time_synchronization_data_callback);
printf("Unsubscribed from time synchronization data.\n");
}
Parameters
eyetrackerEye tracker object.
callbackCallback that will receive the time synchronization data.
user_dataCaller specific data that will be sent to the callback.
Returns
A TobiiResearchStatus code.
Examples:
time_synchronization_data.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_external_signal_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_external_signal_data_callback  callback 
)

Unsubscribes from external signal data for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_external_signal_data
Returns
A TobiiResearchStatus code.
Examples:
external_signal.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_eye_image ( TobiiResearchEyeTracker eyetracker,
tobii_research_eye_image_callback  callback 
)

Unsubscribes from eye image for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_eye_image.
Returns
A TobiiResearchStatus code.
Examples:
eye_images.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_eye_image_as_gif ( TobiiResearchEyeTracker eyetracker,
tobii_research_eye_image_as_gif_callback  callback 
)

Unsubscribes from eye image for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_eye_image_as_gif.
Returns
A TobiiResearchStatus code.
Examples:
eye_images_as_gif.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_gaze_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_gaze_data_callback  callback 
)

Unsubscribes from gaze data for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_gaze_data.
Returns
A TobiiResearchStatus code.
Examples:
gaze_data.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_hmd_gaze_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_hmd_gaze_data_callback  callback 
)

Unsubscribes from HMD gaze data for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_hmd_gaze_data.
Returns
A TobiiResearchStatus code.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_notifications ( TobiiResearchEyeTracker eyetracker,
tobii_research_notification_callback  callback 
)

Unsubscribes from notifications for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_notifications.
Returns
A TobiiResearchStatus code.
Examples:
notifications.c.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_stream_errors ( TobiiResearchEyeTracker eyetracker,
tobii_research_stream_error_callback  callback 
)

Unsubscribes from stream errors for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_stream_errors.
Returns
A TobiiResearchStatus code.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_unsubscribe_from_time_synchronization_data ( TobiiResearchEyeTracker eyetracker,
tobii_research_time_synchronization_data_callback  callback 
)

Unsubscribes from time synchronization data for the eye tracker.

Parameters
eyetrackerEye tracker object.
callbackCallback sent to tobii_research_subscribe_to_time_synchronization_data.
Returns
A TobiiResearchStatus code.
Examples:
time_synchronization_data.c.