Show / Hide Table of Contents

    Class VideoMediaBuffer

    Represents an unmanaged buffer containing video media data.

    Inheritance
    Object
    VideoMediaBuffer
    Implements
    IDisposable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.Skype.Bots.Media
    Assembly: Microsoft.Skype.Bots.Media.dll
    Syntax
    public abstract class VideoMediaBuffer : IDisposable

    Constructors

    VideoMediaBuffer()

    Declaration
    protected VideoMediaBuffer()

    Properties

    Data

    Pointer to the unmanaged media buffer.

    Declaration
    public IntPtr Data { get; protected set; }
    Property Value
    Type Description
    IntPtr
    Remarks

    For the H264 video format, Data points to the start code of the first NALU of the frame and the whole buffer contains all the NALUs of the frame in sequence separated by their start codes. The frame data is an unencrypted depacketized H.264 elementary stream. B frames and SEI messages are not supported.

    Supported NALU types are 7 (SPS), 8 (PPS), 5 (IDR), and 1 (non-IDR). NALU start code prefixes can be either 0x000001 (3 bytes) or 0x00000001 (4 bytes). Fragmentation and packetization of NALUs is automatically handled by the platform.

    When receiving video in the H264 format, the platform ensures the application always receives decodable, full frames.

    Length

    The length of data in the media buffer.

    Declaration
    public long Length { get; protected set; }
    Property Value
    Type Description
    Int64

    MediaSourceId

    MediaSourceId (MSI) of the video buffer. Within group or conference video calls, the MSI value identifies the video media source. This property is populated by the Real-Time Media Platform for Bots on received video buffers. When sending buffers via the IVideoSocket.Send API, this property is unused.

    Declaration
    public uint MediaSourceId { get; protected set; }
    Property Value
    Type Description
    UInt32

    OriginalVideoFormat

    Original VideoFormat of the buffer when it was sourced. It is only used when receiving video buffers via the IVideoSocket.VideoMediaReceived event handler, in which case the VideoMediaBuffer.VideoFormat property may have different Width and Height values than the OriginalVideoFormat property, which represents the original format of the buffer. The reason is that the buffer may have been resized before being transmitted, so the original Width and Height may have been resized. If the Width and Height properties of OriginalVideoFormat differ from the VideoFormat property, the consumer of the VideoMediaBuffer raised in the VideoMediaReceived event should resize the buffer to fit the OriginalVideoFormat size. When sending buffers via the IVideoSocket.Send API, this property should always be null.

    Declaration
    public VideoFormat OriginalVideoFormat { get; protected set; }
    Property Value
    Type Description
    VideoFormat

    Stride

    Stride of the video buffer. This property is optional when sourcing video buffers that are sent via the IVideoSocket.Send API. Stride (also called pitch) represents the number of bytes it takes to read one row of pixels in memory. It may differ from the width depending on the color format.

    Declaration
    public int Stride { get; protected set; }
    Property Value
    Type Description
    Int32

    Timestamp

    Timestamp of when the media content was sourced, in 100-ns units. When sourcing media buffers, this property should be set using the value from the MediaPlatform.GetCurrentTimestamp() API.

    Declaration
    public long Timestamp { get; protected set; }
    Property Value
    Type Description
    Int64

    VideoFormat

    VideoFormat of the video media buffer.

    Declaration
    public VideoFormat VideoFormat { get; protected set; }
    Property Value
    Type Description
    VideoFormat

    Methods

    Dispose()

    Disposes the object.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Releases unmanaged resources held by the buffer object. Must be implemented in the derived class.

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    If true, both managed and unmanaged resources can be disposed. If false, only unmanaged resources can be disposed.

    Implements

    System.IDisposable
    Back to top Copyright (c) Microsoft Corporation. All rights reserved.