Show / Hide Table of Contents

    Class VideoFrameQueue<T>

    Small queue of video frames received from a source and pending delivery to a sink. Used as temporary buffer between the WebRTC callback (push model) and the video player rendering (pull model). This also handles dropping frames when the source is faster than the sink, by limiting the maximum queue length.

    Inheritance
    Object
    VideoFrameQueue<T>
    Implements
    IVideoFrameQueue
    Namespace: Microsoft.MixedReality.WebRTC
    Assembly: Microsoft.MixedReality.WebRTC.dll
    Syntax
    public class VideoFrameQueue<T> : object, IVideoFrameQueue where T : class, IVideoFrameStorage, new()
    Type Parameters
    Name Description
    T

    The type of video frame storage

    Constructors

    | Improve this Doc View Source

    VideoFrameQueue(Int32)

    Create a new queue with a maximum frame length.

    Declaration
    public VideoFrameQueue(int maxQueueLength)
    Parameters
    Type Name Description
    Int32 maxQueueLength

    Maxmimum number of frames to enqueue before starting to drop incoming frames

    Properties

    | Improve this Doc View Source

    DequeuedFramesPerSecond

    Get the number of frames enqueued per seconds. This is generally an average statistics representing how fast a video sink consumes some video frames, typically to render them.

    Declaration
    public float DequeuedFramesPerSecond { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    DroppedFramesPerSecond

    Get the number of frames dropped per seconds. This is generally an average statistics representing how many frames were enqueued by a video source but not dequeued fast enough by a video sink, meaning the video sink renders at a slower framerate than the source can produce.

    Declaration
    public float DroppedFramesPerSecond { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    QueuedFramesPerSecond

    Get the number of frames enqueued per seconds. This is generally an average statistics representing how fast a video source produces some video frames.

    Declaration
    public float QueuedFramesPerSecond { get; }
    Property Value
    Type Description
    Single

    Methods

    | Improve this Doc View Source

    Clear()

    Clear the queue and drop all frames currently pending.

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Enqueue(ARGBVideoFrame)

    Try to enqueue a new video frame encoded in raw ARGB format. If the internal queue reached its maximum capacity, do nothing and drop the frame.

    Declaration
    public bool Enqueue(ARGBVideoFrame frame)
    Parameters
    Type Name Description
    ARGBVideoFrame frame

    The video frame to enqueue

    Returns
    Type Description
    Boolean

    Return true if the frame was enqueued successfully, or false if it was dropped

    Remarks

    This should only be used if the queue has storage for a compatible video frame encoding.

    | Improve this Doc View Source

    Enqueue(I420AVideoFrame)

    Enqueue a new video frame encoded in I420 format. If the internal queue reached its maximum capacity, do nothing and drop the frame.

    Declaration
    public bool Enqueue(I420AVideoFrame frame)
    Parameters
    Type Name Description
    I420AVideoFrame frame

    The video frame to enqueue

    Returns
    Type Description
    Boolean

    Return true if the frame was enqueued successfully, or false if it was dropped

    Remarks

    This should only be used if the queue has storage for a compatible video frame encoding.

    | Improve this Doc View Source

    RecycleStorage(T)

    Recycle a frame storage, putting it back into the internal pool for later reuse. This prevents deallocation and reallocation of a frame, and decreases pressure on the garbage collector.

    Declaration
    public void RecycleStorage(T frame)
    Parameters
    Type Name Description
    T frame

    The unused frame storage to recycle for a later new frame

    | Improve this Doc View Source

    TryDequeue(out T)

    Try to dequeue a video frame, usually to be consumed by a video sink (video player).

    Declaration
    public bool TryDequeue(out T frame)
    Parameters
    Type Name Description
    T frame

    On success, returns the dequeued frame.

    Returns
    Type Description
    Boolean

    Return true on success or false if the queue is empty.

    Implements

    IVideoFrameQueue
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX