# ArTrackData

External data track, used by Recording and Playback API.

## Summary

| ### Typedefs ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` | typedef `struct ArTrackData_` Data that has been recorded to an external track. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist` | typedef `struct ArTrackDataList_` A list of `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata`. |

| ### Functions ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist_acquireitem(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist *track_data_list, int32_t index, https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata **out_track_data)` | `void` Acquires a reference to an indexed entry in the list. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist_create(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist **out_track_data_list)` | `void` Creates an `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist` object. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist_destroy(https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist *track_data_list)` | `void` Releases the memory used by the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` list object. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist_getsize(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist *track_data_list, int32_t *out_size)` | `void` Retrieves the number of `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` elements in the list. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata_getdata(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata *track_data, const uint8_t **out_data, int32_t *out_size)` | `void` Retrieves the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` byte data that was recorded by `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_recordtrackdata`. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata_getframetimestamp(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata *track_data, int64_t *out_timestamp_ns)` | `void` Retrieves the timestamp in nanoseconds of the frame the given `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` was recorded on. |
| `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata_release(https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata *track_data)` | `void` Releases a reference to a `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata`. |

## Typedefs

### ArTrackData

```
struct ArTrackData_ ArTrackData
```
Data that has been recorded to an external track.

### ArTrackDataList

```
struct ArTrackDataList_ ArTrackDataList
```
A list of `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata`.

## Functions

### ArTrackDataList_acquireItem

```
void ArTrackDataList_acquireItem(
  const ArSession *session,
  const ArTrackDataList *track_data_list,
  int32_t index,
  ArTrackData **out_track_data
)
```
Acquires a reference to an indexed entry in the list.

This call must eventually be matched with a call to `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata_release`.


Details Parameters `session` The ARCore session `track_data_list` The list being queried `index` The index of the list `out_track_data` The pointer to the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` acquired at the given index in the list

### ArTrackDataList_create

```
void ArTrackDataList_create(
  const ArSession *session,
  ArTrackDataList **out_track_data_list
)
```
Creates an `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist` object.


Details Parameters `session` The ARCore session `out_track_data_list` The pointer to the list to be initialized

### ArTrackDataList_destroy

```
void ArTrackDataList_destroy(
  ArTrackDataList *track_data_list
)
```
Releases the memory used by the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` list object.


Details Parameters `track_data_list` The pointer to the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist` memory being released

### ArTrackDataList_getSize

```
void ArTrackDataList_getSize(
  const ArSession *session,
  const ArTrackDataList *track_data_list,
  int32_t *out_size
)
```
Retrieves the number of `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` elements in the list.


Details Parameters `session` The ARCore session. `track_data_list` The list being checked for size `out_size` The size of the list, 0 if `track_data_list` is empty

### ArTrackData_getData

```
void ArTrackData_getData(
  const ArSession *session,
  const ArTrackData *track_data,
  const uint8_t **out_data,
  int32_t *out_size
)
```
Retrieves the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` byte data that was recorded by `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_recordtrackdata`.

The pointer returned by this function is valid until `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata_release` is called.


Details Parameters `session` The ARCore session `track_data` The `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` to pull the data from `out_data` The pointer to the `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist` byte data being populated. Will point to an empty list if no data present `out_size` The number of bytes that were populated in `out_data`, 0 if list is empty

### ArTrackData_getFrameTimestamp

```
void ArTrackData_getFrameTimestamp(
  const ArSession *session,
  const ArTrackData *track_data,
  int64_t *out_timestamp_ns
)
```
Retrieves the timestamp in nanoseconds of the frame the given `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` was recorded on.

This timestamp is equal to the result of `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_gettimestamp` on the frame during which the track data was written.


Details Parameters `session` The ARCore session `track_data` The `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` to pull the timestamp from `out_timestamp_ns` The `int64_t` timestamp value to be set

### ArTrackData_release

```
void ArTrackData_release(
  ArTrackData *track_data
)
```
Releases a reference to a `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata`.

Acquire a `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` with `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdatalist_acquireitem`.

This function may safely be called with `NULL` - it will do nothing.


Details Parameters `track_data` The `https://developers.google.com/ar/reference/c/group/ar-track-data#artrackdata` being released