docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface ITimedDataSource

    An interface for a collection of timecoded data samples. Represents a data source that can be synchronized.

    Inherited Members
    IRegistrable.Id
    IRegistrable.FriendlyName
    Namespace: Unity.LiveCapture
    Assembly: Unity.LiveCapture.dll
    Syntax
    public interface ITimedDataSource : IRegistrable

    Properties

    BufferSize

    Gets or sets the current buffer size.

    Declaration
    int BufferSize { get; set; }
    Property Value
    Type Description
    int

    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
    bool
    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
    int?

    MinBufferSize

    Get the minimum size of the sample buffer, if limited.

    Declaration
    int? MinBufferSize { get; }
    Property Value
    Type Description
    int?

    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 default if there are no buffered samples.

    FrameTime newestSample

    The frame time of the newest buffered sample, or default if there are no buffered samples.

    Returns
    Type Description
    bool

    true if there are any buffered samples; otherwise, false.

    Remarks
    The frame duration corresponds to the <xref href="Unity.LiveCapture.ITimedDataSource.FrameRate" data-throw-if-not-resolved="false"></xref> of this source.
    The sample times are returned without the <xref href="Unity.LiveCapture.ITimedDataSource.PresentationOffset" data-throw-if-not-resolved="false"></xref> applied.
    
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)