Interface ITimedDataSource
An interface for a collection of timecoded data samples. Represents a data source that can be synchronized.
Namespace: Unity.LiveCapture
Syntax
public interface ITimedDataSource : IRegistrable
Properties
BufferSize
Gets or sets the current buffer size.
Declaration
int BufferSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
FrameRate
The number of data samples per second.
Declaration
FrameRate FrameRate { get; }
Property Value
Type | Description |
---|---|
FrameRate |
IsSynchronized
Signal to the data source whether it is being synchronized via PresentAt(Timecode, FrameRate).
Declaration
bool IsSynchronized { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
When true
, the data source should disable its own update mechanism.
MaxBufferSize
Get the maximum size of the sample buffer, if limited.
Declaration
int? MaxBufferSize { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
MinBufferSize
Get the minimum size of the sample buffer, if limited.
Declaration
int? MinBufferSize { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
PresentationOffset
The offset in frames applied when invoking PresentAt(Timecode, FrameRate).
Declaration
FrameTime PresentationOffset { get; set; }
Property Value
Type | Description |
---|---|
FrameTime |
Remarks
The frame duration corresponds to the FrameRate of this source.
Set this to non-zero if the captured data's timecodes are "off" from the true values.
For example, if you determined that the samples and timecodes as mismatched such that
each sample lags its timecode by 2 frames, you would set this property to
new FrameTime(2)
.
Synchronizer
Gets or sets the ISynchronizer controlling this source.
Declaration
ISynchronizer Synchronizer { get; set; }
Property Value
Type | Description |
---|---|
ISynchronizer |
Remarks
In most cases you can simply implement this as an auto-property. The default synchronizer implementation automatically assigns this property when you call AddDataSource(ITimedDataSource).
Methods
PresentAt(Timecode, FrameRate)
Set the currently active timecode for presentation.
Declaration
TimedSampleStatus PresentAt(Timecode timecode, FrameRate frameRate)
Parameters
Type | Name | Description |
---|---|---|
Timecode | timecode | The timecode that we wish to present |
FrameRate | frameRate | The underlying framerate of the timecode value |
Returns
Type | Description |
---|---|
TimedSampleStatus | A status representing the ability of the source to present at the requested timecode. |
TryGetBufferRange(out FrameTime, out FrameTime)
Gets the frame time of the newest and oldest samples buffered by the data source.
Declaration
bool TryGetBufferRange(out FrameTime oldestSample, out FrameTime newestSample)
Parameters
Type | Name | Description |
---|---|---|
FrameTime | oldestSample | The frame time of the oldest buffered sample, or langword_csharp_default if there are no buffered samples. |
FrameTime | newestSample | The frame time of the newest buffered sample, or langword_csharp_default if there are no buffered samples. |
Returns
Type | Description |
---|---|
Boolean |
Remarks
> The frame duration corresponds to the FrameRate of this source. The sample times are returned without the PresentationOffset applied.