Show / Hide Table of Contents

    Class MediaPlatform

    This class represents the Skype Bots Media Platform.

    Inheritance
    Object
    MediaPlatform
    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 static class MediaPlatform

    Fields

    DefaultMaxMediaPort

    The default maximum media port.

    Declaration
    public const uint DefaultMaxMediaPort = 65535U
    Field Value
    Type Description
    UInt32

    DefaultMinMediaPort

    The default minimum media port.

    Declaration
    public const uint DefaultMinMediaPort = 49152U
    Field Value
    Type Description
    UInt32

    MaxNumberOfConcurrentSendVideoSocketsPerPlatform

    The maximum number of send video/vbss sockets allowed by the media plaform.

    Declaration
    public const int MaxNumberOfConcurrentSendVideoSocketsPerPlatform = 1000
    Field Value
    Type Description
    Int32

    MaxNumberOfVideoSocketsPerCall

    The maximum number of video sockets that can be passed to the CreateMediaConfiguration API.

    Declaration
    public const int MaxNumberOfVideoSocketsPerCall = 10
    Field Value
    Type Description
    Int32

    MinNumberOfCoresRequired

    The minimum number of cores that the Media Platform requires.

    Declaration
    public const int MinNumberOfCoresRequired = 2
    Field Value
    Type Description
    Int32

    Name

    Name of the Bots Media Platform

    Declaration
    public const string Name = "SkypeBotsMediaPlatform"
    Field Value
    Type Description
    String

    Properties

    CurrentHealth

    The current health status of the media platform.

    Declaration
    public static MediaPlatformHealthStatus CurrentHealth { get; }
    Property Value
    Type Description
    MediaPlatformHealthStatus

    Methods

    CreateMediaConfiguration(IAudioSocket)

    Returns a serialized mediaConfiguration object, containing MP URI and render/source contexts for the audio modality.

    Declaration
    public static JObject CreateMediaConfiguration(IAudioSocket audioSocket)
    Parameters
    Type Name Description
    IAudioSocket audioSocket

    Socket that handles audio.

    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject

    Serialized MediaConfiguration object.

    Exceptions
    Type Condition
    InvalidOperationException

    MediaPlatform is not initialized.

    SkypeMediaException

    The media platform is currently overloaded and cannot handle new calls.

    CreateMediaConfiguration(IAudioSocket, IDataSocket)

    Reserved for the internal use.

    Declaration
    public static JObject CreateMediaConfiguration(IAudioSocket audioSocket, IDataSocket dataSocket)
    Parameters
    Type Name Description
    IAudioSocket audioSocket
    IDataSocket dataSocket
    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject

    CreateMediaConfiguration(IAudioSocket, IVideoSocket)

    Returns a serialized mediaConfiguration object, containing MP URI and render/source contexts for each modality.

    Declaration
    public static JObject CreateMediaConfiguration(IAudioSocket audioSocket, IVideoSocket videoSocket)
    Parameters
    Type Name Description
    IAudioSocket audioSocket

    Socket that handles audio.

    IVideoSocket videoSocket

    Socket that handles video.

    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject

    Serialized MediaConfiguration object.

    Exceptions
    Type Condition
    ArgumentException

    A VideoSocket is not configured correctly.

    InvalidOperationException

    MediaPlatform is not initialized.

    SkypeMediaException

    The media platform is currently overloaded and cannot handle new calls.

    CreateMediaConfiguration(IAudioSocket, IList<IVideoSocket>)

    Returns a serialized mediaConfiguration object, containing MP URI and render/source contexts for each modality.

    Declaration
    public static JObject CreateMediaConfiguration(IAudioSocket audioSocket, IList<IVideoSocket> videoSockets)
    Parameters
    Type Name Description
    IAudioSocket audioSocket

    Socket that handles audio.

    IList<IVideoSocket> videoSockets

    Ordered list of video sockets. The order in which the sockets are provided maps to the order of the streams exposed by MediaPaaS (eg. the first video socket in the list will correspond to the first video stream exposed in the list of MediaStreams in MediaPaaS' MediaFlow resource). If multiview sockets are provided, only the first one can have a send direction (ie. send only or send receive) and all the sockets should have a receive direction.

    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject

    Serialized MediaConfiguration object.

    Exceptions
    Type Condition
    ArgumentException

    A VideoSocket is not configured correctly.

    InvalidOperationException

    MediaPlatform is not initialized.

    SkypeMediaException

    The media platform is currently overloaded and cannot handle new calls.

    CreateMediaConfiguration(IAudioSocket, IList<IVideoSocket>, IVideoSocket)

    Returns a serialized mediaConfiguration object, containing MP URI and render/source contexts for each modality.

    Declaration
    public static JObject CreateMediaConfiguration(IAudioSocket audioSocket, IList<IVideoSocket> videoSockets, IVideoSocket vbssSocket)
    Parameters
    Type Name Description
    IAudioSocket audioSocket
    IList<IVideoSocket> videoSockets

    Ordered list of video sockets. The order in which the sockets are provided maps to the order of the streams exposed by MediaPaaS (eg. the first video socket in the list will correspond to the first video stream exposed in the list of MediaStreams in MediaPaaS' MediaFlow resource). If multiview sockets are provided, only the first one can have a send direction (ie. send only or send receive) and all the sockets should have a receive direction.

    IVideoSocket vbssSocket

    Video socket for the video-based screen sharing (VBSS) modality. Socket must be configured as RecvOnly.

    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject
    Exceptions
    Type Condition
    ArgumentException

    A VideoSocket is not configured correctly.

    InvalidOperationException

    MediaPlatform is not initialized, or a vbssSocket is configured to be sendonly or sendrecv.

    SkypeMediaException

    The media platform is currently overloaded and cannot handle new calls.

    CreateMediaConfiguration(IAudioSocket, IList<IVideoSocket>, IVideoSocket, IDataSocket)

    Reserved for the internal use.

    Declaration
    public static JObject CreateMediaConfiguration(IAudioSocket audioSocket, IList<IVideoSocket> videoSockets, IVideoSocket vbssSocket, IDataSocket dataSocket)
    Parameters
    Type Name Description
    IAudioSocket audioSocket
    IList<IVideoSocket> videoSockets
    IVideoSocket vbssSocket
    IDataSocket dataSocket
    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject

    CreateMediaConfiguration(IVideoSocket)

    Returns a serialized mediaConfiguration object, containing MP URI and render/source contexts for each modality.

    Declaration
    public static JObject CreateMediaConfiguration(IVideoSocket vbssSocket)
    Parameters
    Type Name Description
    IVideoSocket vbssSocket

    Video socket for the video-based screen sharing (VBSS) modality. Socket must be configured as RecvOnly.

    Returns
    Type Description
    Newtonsoft.Json.Linq.JObject
    Exceptions
    Type Condition
    ArgumentException

    A VideoSocket is not configured correctly.

    InvalidOperationException

    MediaPlatform is not initialized, or a vbssSocket is configured to be sendonly or sendrecv.

    SkypeMediaException

    The media platform is currently overloaded and cannot handle new calls.

    GetCurrentTimestamp()

    Get a current timestamp, in 100-ns units. To be used when sourcing media buffers.

    Declaration
    public static long GetCurrentTimestamp()
    Returns
    Type Description
    Int64

    Initialize(MediaPlatformSettings)

    Initializes the Media Platform for Bot.

    Declaration
    public static void Initialize(MediaPlatformSettings settings)
    Parameters
    Type Name Description
    MediaPlatformSettings settings

    Settings to initialize the Bot Media Platform.

    Shutdown()

    Shuts down the Bot Media Platform.

    Declaration
    public static void Shutdown()

    Events

    MediaPlatformHealthChanged

    Raised when there is a change in the media platform's health status. The event arguments report the current and previous platform health conditions.

    Declaration
    public static event EventHandler<MediaPlatformHealthChangedEventArgs> MediaPlatformHealthChanged
    Event Type
    Type Description
    EventHandler<MediaPlatformHealthChangedEventArgs>
    Remarks

    A bot application which may handle very high call volumes or perform complex real-time media processing should monitor this event for changes in the media platform health status. When the event reports the platform health status has become HeavilyLoaded, the application should avoid starting new bot calls on the machine instance until the health status returns back to Normal.

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