Interface ITimedDataBuffer
Represents a buffer of data samples ordered by the FrameTime of each sample.
Namespace: Unity.LiveCapture
Syntax
public interface ITimedDataBuffer
Properties
Capacity
The maximum number of elements which can be stored in the collection.
Declaration
int Capacity { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Remarks
If the new size is smaller than the current Count, elements will be truncated from the front.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if the capacity is not greater than zero. |
Count
The number of elements stored in the buffer.
Declaration
int Count { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
FrameRate
The frame rate of the buffered samples.
Declaration
FrameRate FrameRate { get; set; }
Property Value
| Type | Description |
|---|---|
| FrameRate |
Remarks
This will remap the frame time of all samples in the buffer to match the new frame rate.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown if attempting to set an invalid value. |
Methods
Clear()
Removes all samples in the buffer.
Declaration
void Clear()
GetStatus(FrameTime)
Retrieves the status of the buffer at the specified time.
Declaration
TimedSampleStatus GetStatus(FrameTime frameTime)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameTime | frameTime | The time to retrieve the status for, expressed relative to the FrameRate. |
Returns
| Type | Description |
|---|---|
| TimedSampleStatus | The status of the retrieved sample. |
TryGetBufferRange(out FrameTime, out FrameTime)
Gets the frame time of the newest and oldest samples in the buffer.
Declaration
bool TryGetBufferRange(out FrameTime oldestSample, out FrameTime newestSample)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameTime | oldestSample | The frame time of the oldest sample in the buffer, or default if there are no samples in the buffer. |
| FrameTime | newestSample | The frame time of the newest sample in the buffer, or default if there are no samples in the buffer. |
Returns
| Type | Description |
|---|---|
| Boolean | true if there are any samples in the buffer; otherwise, false. |