Amazon Kinesis Webrtc C SDK
PublicMemberFunctions

Public functions. More...

Collaboration diagram for PublicMemberFunctions:

Functions

PUBLIC_API STATUS configureTransceiverRollingBuffer (PRtcRtpTransceiver, PRtcMediaStreamTrack, DOUBLE, DOUBLE)
 Set up rolling buffer configuration - max duration of media to store (sec) and expected max bitrate (bips) of the encoded media. More...
 
PUBLIC_API STATUS createPeerConnection (PRtcConfiguration, PRtcPeerConnection *)
 Initialize a RtcPeerConnection with the provided Configuration. More...
 
PUBLIC_API STATUS freePeerConnection (PRtcPeerConnection *)
 Free a RtcPeerConnection. More...
 
PUBLIC_API STATUS peerConnectionOnIceCandidate (PRtcPeerConnection, UINT64, RtcOnIceCandidate)
 Set a callback when new Ice collects new local candidate. More...
 
PUBLIC_API STATUS peerConnectionOnSenderBandwidthEstimation (PRtcPeerConnection, UINT64, RtcOnSenderBandwidthEstimation)
 Set a callback for transport-wide sender bandwidth estimation results. More...
 
PUBLIC_API STATUS peerConnectionOnDataChannel (PRtcPeerConnection, UINT64, RtcOnDataChannel)
 
PUBLIC_API STATUS peerConnectionOnConnectionStateChange (PRtcPeerConnection, UINT64, RtcOnConnectionStateChange)
 
PUBLIC_API STATUS peerConnectionGetLocalDescription (PRtcPeerConnection, PRtcSessionDescriptionInit)
 
PUBLIC_API STATUS peerConnectionGetCurrentLocalDescription (PRtcPeerConnection, PRtcSessionDescriptionInit)
 
PUBLIC_API STATUS createOffer (PRtcPeerConnection, PRtcSessionDescriptionInit)
 Populate the provided answer that contains an RFC 3264 offer with the supported configurations for the session. More...
 
PUBLIC_API NullableBool canTrickleIceCandidates (PRtcPeerConnection)
 The canTrickleIceCandidates attribute indicates whether the remote peer is able to accept trickled ICE candidates. The value is determined based on whether a remote description indicates support for trickle ICE. Prior to the completion of setRemoteDescription, this value is null. More...
 
PUBLIC_API STATUS createAnswer (PRtcPeerConnection, PRtcSessionDescriptionInit)
 Populate the provided answer that contains an RFC 3264 answer with the supported configurations for the session. More...
 
PUBLIC_API STATUS serializeSessionDescriptionInit (PRtcSessionDescriptionInit, PCHAR, PUINT32)
 Create a JSON string from RtcSessionDescriptionInit. More...
 
PUBLIC_API STATUS deserializeSessionDescriptionInit (PCHAR, UINT32, PRtcSessionDescriptionInit)
 Parses a JSON string and returns an allocated PSessionDescriptionInit. More...
 
PUBLIC_API STATUS deserializeRtcIceCandidateInit (PCHAR, UINT32, PRtcIceCandidateInit)
 Parses a JSON string and populates a PRtcIceCandidateInit. More...
 
PUBLIC_API STATUS setLocalDescription (PRtcPeerConnection, PRtcSessionDescriptionInit)
 Instructs the RtcPeerConnection to apply the supplied RtcSessionDescriptionInit as the local description. More...
 
PUBLIC_API STATUS setRemoteDescription (PRtcPeerConnection, PRtcSessionDescriptionInit)
 Instructs the RtcPeerConnection to apply the supplied RtcSessionDescriptionInit as the remote description. More...
 
PUBLIC_API STATUS restartIce (PRtcPeerConnection)
 Instructs the RtcPeerConnection that ICE should be restarted. Subsequent calls to createOffer will create descriptions to restart ICE. More...
 
PUBLIC_API STATUS closePeerConnection (PRtcPeerConnection)
 Close the underlying DTLS session and IceAgent connection. Trigger RtcOnConnectionStateChange to RTC_PEER_CONNECTION_STATE_CLOSED. More...
 
PUBLIC_API STATUS addTransceiver (PRtcPeerConnection, PRtcMediaStreamTrack, PRtcRtpTransceiverInit, PRtcRtpTransceiver *)
 Create a new RtcRtpTransceiver and add it to the set of transceivers. More...
 
PUBLIC_API STATUS transceiverOnFrame (PRtcRtpTransceiver, UINT64, RtcOnFrame)
 Set a callback for transceiver frame. More...
 
PUBLIC_API STATUS transceiverOnBandwidthEstimation (PRtcRtpTransceiver, UINT64, RtcOnBandwidthEstimation)
 Set a callback for bandwidth estimation results. More...
 
PUBLIC_API STATUS transceiverOnPictureLoss (PRtcRtpTransceiver, UINT64, RtcOnPictureLoss)
 Set a callback for picture loss packet (PLI) More...
 
PUBLIC_API STATUS freeTransceiver (PRtcRtpTransceiver *)
 Frees the previously created transceiver object. More...
 
PUBLIC_API STATUS initKvsWebRtc (VOID)
 Initializes global state needed for all RtcPeerConnections. It must only be called once. More...
 
PUBLIC_API STATUS deinitKvsWebRtc (VOID)
 Deinitializes global state needed for all RtcPeerConnections. It must only be called once. More...
 
PUBLIC_API STATUS addSupportedCodec (PRtcPeerConnection, RTC_CODEC)
 Adds to the list of codecs we support receiving. More...
 
PUBLIC_API STATUS writeFrame (PRtcRtpTransceiver, PFrame)
 Packetizes and sends media via the configuration specified by the RtcRtpTransceiver. More...
 
PUBLIC_API STATUS updateEncoderStats (PRtcRtpTransceiver, PRtcEncoderStats)
 call this function to update stats which depend on external encoder More...
 
PUBLIC_API STATUS addIceCandidate (PRtcPeerConnection, PCHAR)
 Provides a remote candidate to the ICE Agent. More...
 
PUBLIC_API STATUS createDataChannel (PRtcPeerConnection, PCHAR, PRtcDataChannelInit, PRtcDataChannel *)
 createDataChannel creates a new RtcDataChannel object with the given label. More...
 
PUBLIC_API STATUS dataChannelOnMessage (PRtcDataChannel, UINT64, RtcOnMessage)
 Set a callback for data channel message. More...
 
PUBLIC_API STATUS dataChannelOnOpen (PRtcDataChannel, UINT64, RtcOnOpen)
 Set a callback for data channel open. More...
 
PUBLIC_API STATUS dataChannelSend (PRtcDataChannel, BOOL, PBYTE, UINT32)
 Send data via the PRtcDataChannel. More...
 
PUBLIC_API STATUS discoverNatBehavior (PCHAR, NAT_BEHAVIOR *, NAT_BEHAVIOR *, IceSetInterfaceFilterFunc, UINT64)
 Use the process described in https://tools.ietf.org/html/rfc5780#section-4.3 to discover NAT behavior. More...
 
PUBLIC_API PCHAR getNatBehaviorStr (NAT_BEHAVIOR natBehavior)
 Return the string representation for each NAT_BEHAVIOR enum. More...
 
PUBLIC_API STATUS createSignalingClientSync (PSignalingClientInfo, PChannelInfo, PSignalingClientCallbacks, PAwsCredentialProvider, PSIGNALING_CLIENT_HANDLE)
 Creates a Signaling client and returns a handle to it. More...
 
PUBLIC_API STATUS freeSignalingClient (PSIGNALING_CLIENT_HANDLE)
 Frees the Signaling client object. More...
 
PUBLIC_API STATUS signalingClientSendMessageSync (SIGNALING_CLIENT_HANDLE, PSignalingMessage)
 Send a message through a Signaling client. More...
 
PUBLIC_API STATUS signalingClientGetIceConfigInfoCount (SIGNALING_CLIENT_HANDLE, PUINT32)
 Gets the retrieved ICE configuration information object count. More...
 
PUBLIC_API STATUS signalingClientGetIceConfigInfo (SIGNALING_CLIENT_HANDLE, UINT32, PIceConfigInfo *)
 Gets the ICE configuration information object given its index. More...
 
PUBLIC_API STATUS signalingClientFetchSync (SIGNALING_CLIENT_HANDLE)
 Fetches all assets needed to ready the state machine before attempting to connect. Can also be used to reallocate missing / expired assets before reconnecting. More...
 
PUBLIC_API STATUS signalingClientConnectSync (SIGNALING_CLIENT_HANDLE)
 Connects the signaling client to the web socket in order to send/receive messages. More...
 
PUBLIC_API STATUS signalingClientDisconnectSync (SIGNALING_CLIENT_HANDLE)
 Disconnects the signaling client. More...
 
PUBLIC_API STATUS signalingClientGetCurrentState (SIGNALING_CLIENT_HANDLE, PSIGNALING_CLIENT_STATE)
 Gets the Signaling client current state. More...
 
PUBLIC_API STATUS signalingClientGetStateString (SIGNALING_CLIENT_STATE, PCHAR *)
 
PUBLIC_API STATUS signalingClientDeleteSync (SIGNALING_CLIENT_HANDLE)
 Deletes the signaling channel referenced by SIGNALING_CLIENT_HANDLE. More...
 
PUBLIC_API STATUS signalingClientGetMetrics (SIGNALING_CLIENT_HANDLE, PSignalingClientMetrics)
 Get signaling related metrics. More...
 
PUBLIC_API STATUS peerConnectionGetMetrics (PRtcPeerConnection, PPeerConnectionMetrics)
 Get peer connection related metrics. More...
 
PUBLIC_API STATUS iceAgentGetMetrics (PRtcPeerConnection, PKvsIceAgentMetrics)
 Get peer connection related metrics. More...
 
PUBLIC_API STATUS rtcPeerConnectionGetMetrics (PRtcPeerConnection, PRtcRtpTransceiver, PRtcStats)
 Get the relevant/all metrics based on the RTCStatsType field. This does not include any signaling related metrics. The caller of the API is expected to populate requestedTypeOfStats member of PRtcStats object with one of the values in RTC_STATS_TYPE. More...
 
PUBLIC_API STATUS createRtcCertificate (PRtcCertificate *)
 Creates an RtcCertificate object. More...
 
PUBLIC_API STATUS freeRtcCertificate (PRtcCertificate)
 Frees previously generated RtcCertificate object. More...
 

Detailed Description

Public functions.

Function Documentation

◆ addIceCandidate()

PUBLIC_API STATUS addIceCandidate ( PRtcPeerConnection  pPeerConnection,
PCHAR  pIceCandidate 
)

Provides a remote candidate to the ICE Agent.

This method can also be used to indicate the end of remote candidates when called with an empty string for the candidate member.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-addicecandidate

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]PCHARNew remote ICE candidate to add
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ addSupportedCodec()

PUBLIC_API STATUS addSupportedCodec ( PRtcPeerConnection  pPeerConnection,
RTC_CODEC  rtcCodec 
)

Adds to the list of codecs we support receiving.

NOTE: The remote MUST only send codecs we declare

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]RTC_CODECCodec that we support receiving.
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ addTransceiver()

PUBLIC_API STATUS addTransceiver ( PRtcPeerConnection  pPeerConnection,
PRtcMediaStreamTrack  pRtcMediaStreamTrack,
PRtcRtpTransceiverInit  pRtcRtpTransceiverInit,
PRtcRtpTransceiver ppRtcRtpTransceiver 
)

Create a new RtcRtpTransceiver and add it to the set of transceivers.

Reference https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-addtransceiver

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]PRtcMediaStreamTrackStream track information for the codec appropriate codec, or NULL for RECVONLY
[in]PRtcRtpTransceiverInitPRtcRtpTransceiverInit that may configure our new Transceiver
[in,out]PRtcRtpTransceiver*IN/Initialized and configured RtcRtpTransceiver
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ canTrickleIceCandidates()

PUBLIC_API NullableBool canTrickleIceCandidates ( PRtcPeerConnection  pPeerConnection)

The canTrickleIceCandidates attribute indicates whether the remote peer is able to accept trickled ICE candidates. The value is determined based on whether a remote description indicates support for trickle ICE. Prior to the completion of setRemoteDescription, this value is null.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-cantrickleicecandidates

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
Returns
NullableBool if not null, indicate whether remote support trickle ICE.

◆ closePeerConnection()

PUBLIC_API STATUS closePeerConnection ( PRtcPeerConnection  pPeerConnection)

Close the underlying DTLS session and IceAgent connection. Trigger RtcOnConnectionStateChange to RTC_PEER_CONNECTION_STATE_CLOSED.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
Returns
- STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ configureTransceiverRollingBuffer()

PUBLIC_API STATUS configureTransceiverRollingBuffer ( PRtcRtpTransceiver  pRtcRtpTransceiver,
PRtcMediaStreamTrack  pRtcMediaStreamTrack,
DOUBLE  rollingBufferDurationSec,
DOUBLE  rollingBufferBitratebps 
)

Set up rolling buffer configuration - max duration of media to store (sec) and expected max bitrate (bips) of the encoded media.

Parameters
[in]PRtcRtpTransceiverIN/Initialized and configured RtcRtpTransceiver
[in]PRtcMediaStreamTrackIN/Initialized media stream track information
[in]DOUBLEIN/Rolling buffer duration in seconds
[in]DOUBLEIN/Rolling buffer bitrate in bits/second
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ createAnswer()

PUBLIC_API STATUS createAnswer ( PRtcPeerConnection  pPeerConnection,
PRtcSessionDescriptionInit  pSessionDescriptionInit 
)

Populate the provided answer that contains an RFC 3264 answer with the supported configurations for the session.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-createanswer

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in,out]PRtcSessionDescriptionInitIN/answer that describes the supported configurations of the RtcPeerConnection
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ createDataChannel()

PUBLIC_API STATUS createDataChannel ( PRtcPeerConnection  pPeerConnection,
PCHAR  pDataChannelName,
PRtcDataChannelInit  pRtcDataChannelInit,
PRtcDataChannel ppRtcDataChannel 
)

createDataChannel creates a new RtcDataChannel object with the given label.

NOTE: The RtcDataChannelInit dictionary can be used to configure properties of the underlying channel such as data reliability. NOTE: Data channel can be created only after signaling for now

Reference: https://www.w3.org/TR/webrtc/#methods-11

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]PCHARData channel Name
[in]PRtcDataChannelInitAllowed to be NULL/defines underlying channel properties
[out]PRtcDataChannel*Created data channel with supplied channel name
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ createOffer()

PUBLIC_API STATUS createOffer ( PRtcPeerConnection  pPeerConnection,
PRtcSessionDescriptionInit  pSessionDescriptionInit 
)

Populate the provided answer that contains an RFC 3264 offer with the supported configurations for the session.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-createoffer

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in,out]PRtcSessionDescriptionInitIN/answer that describes the supported configurations of the RtcPeerConnection
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ createPeerConnection()

PUBLIC_API STATUS createPeerConnection ( PRtcConfiguration  pConfiguration,
PRtcPeerConnection ppPeerConnection 
)

Initialize a RtcPeerConnection with the provided Configuration.

Reference: https://www.w3.org/TR/webrtc/#constructor

Parameters
[in]PConfigurationConfiguration to initialize provided RtcPeerConnection
[in,out]PRtcPeerConnectionUninitialized RtcPeerConnection
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ createRtcCertificate()

PUBLIC_API STATUS createRtcCertificate ( PRtcCertificate ppRtcCertificate)

Creates an RtcCertificate object.

Parameters
[in,out]RtcCertificateobject that will be generated and returned.
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ createSignalingClientSync()

PUBLIC_API STATUS createSignalingClientSync ( PSignalingClientInfo  pClientInfo,
PChannelInfo  pChannelInfo,
PSignalingClientCallbacks  pCallbacks,
PAwsCredentialProvider  pCredentialProvider,
PSIGNALING_CLIENT_HANDLE  pSignalingHandle 
)

Creates a Signaling client and returns a handle to it.

Parameters
[in]PSignalingClientInfoSignaling client info
[in]PChannelInfoSignaling channel info to use/create a channel
[in]PSignalingClientCallbacksSignaling callbacks for event notifications
[in]PAwsCredentialProviderCredential provider for auth integration
[out]PSIGNALING_CLIENT_HANDLEReturned signaling client handle
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ dataChannelOnMessage()

PUBLIC_API STATUS dataChannelOnMessage ( PRtcDataChannel  pRtcDataChannel,
UINT64  customData,
RtcOnMessage  rtcOnMessage 
)

Set a callback for data channel message.

Parameters
[in]PRtcDataChannelData channel struct created by createDataChannel()
[in]UINT64User customData that will be passed along when RtcOnMessage is called
[in]RtcOnMessageUser RtcOnMessage callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ dataChannelOnOpen()

PUBLIC_API STATUS dataChannelOnOpen ( PRtcDataChannel  pRtcDataChannel,
UINT64  customData,
RtcOnOpen  rtcOnOpen 
)

Set a callback for data channel open.

Parameters
[in]PRtcDataChannelData channel struct created by createDataChannel()
[in]UINT64User customData that will be passed along when RtcOnOpen is called
[in]RtcOnOpenUser RtcOnOpen callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ dataChannelSend()

PUBLIC_API STATUS dataChannelSend ( PRtcDataChannel  pRtcDataChannel,
BOOL  isBinary,
PBYTE  pMessage,
UINT32  pMessageLen 
)

Send data via the PRtcDataChannel.

Reference: https://www.w3.org/TR/webrtc/#dfn-send

Parameters
[in]PRtcDataChannelConfigured and connected PRtcDataChannel
[in]BOOLIs message binary, if false will be delivered as a string
[in]PBYTEData that you wish to send
[in]UINT32Length of the PBYTE you wish to send
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ deinitKvsWebRtc()

PUBLIC_API STATUS deinitKvsWebRtc ( VOID  )

Deinitializes global state needed for all RtcPeerConnections. It must only be called once.

Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ deserializeRtcIceCandidateInit()

PUBLIC_API STATUS deserializeRtcIceCandidateInit ( PCHAR  pJson,
UINT32  jsonLen,
PRtcIceCandidateInit  pRtcIceCandidateInit 
)

Parses a JSON string and populates a PRtcIceCandidateInit.

Parameters
[in]PCHARJSON String of a PRtcIceCandidateInit
[in]UINT32Length of JSON String
[out]PRtcIceCandidateInitPRtcIceCandidateInit populated from JSON String
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ deserializeSessionDescriptionInit()

PUBLIC_API STATUS deserializeSessionDescriptionInit ( PCHAR  sessionDescriptionJSON,
UINT32  sessionDescriptionJSONLen,
PRtcSessionDescriptionInit  pSessionDescriptionInit 
)

Parses a JSON string and returns an allocated PSessionDescriptionInit.

Parameters
[in]PCHARJSON String of a RtcSessionDescriptionInit
[in]UINT32Length of JSON String
[out]PRtcSessionDescriptionInitRtcSessionDescriptionInit populated from JSON String
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ discoverNatBehavior()

PUBLIC_API STATUS discoverNatBehavior ( PCHAR  stunServer,
NAT_BEHAVIOR pNatMappingBehavior,
NAT_BEHAVIOR pNatFilteringBehavior,
IceSetInterfaceFilterFunc  filterFunc,
UINT64  filterFuncCustomData 
)

Use the process described in https://tools.ietf.org/html/rfc5780#section-4.3 to discover NAT behavior.

Parameters
[in]PCHARSTUN hostname. Need to in form of stun:hostname:port
[out]NAT_BEHAVIOR*detected NAT mapping behavior
[out]NAT_BEHAVIOR*detected NAT filtering behavior
[in]IceSetInterfaceFilterFuncfilter function for selecting local network interface to create socket. Optional.
[in]UINT64User data for filter function
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ freePeerConnection()

PUBLIC_API STATUS freePeerConnection ( PRtcPeerConnection ppPeerConnection)

Free a RtcPeerConnection.

Parameters
[in]PRtcPeerConnection*RtcPeerConnection that is to be freed
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeRtcCertificate()

PUBLIC_API STATUS freeRtcCertificate ( PRtcCertificate  pRtcCertificate)

Frees previously generated RtcCertificate object.

Parameters
[in,out]RtcCertificateobject that will be freed if not NULL.
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the caller graph for this function:

◆ freeSignalingClient()

PUBLIC_API STATUS freeSignalingClient ( PSIGNALING_CLIENT_HANDLE  pSignalingHandle)

Frees the Signaling client object.

NOTE: The call is idempotent.

Parameters
[in,out/opt]PSIGNALING_CLIENT_HANDLE Signaling client handle to free
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ freeTransceiver()

PUBLIC_API STATUS freeTransceiver ( PRtcRtpTransceiver pRtcRtpTransceiver)

Frees the previously created transceiver object.

This method is currently a no-op as Transceivers are freed when freePeerConnection is called in the future when renegotiation is supported this will be useful to remove Transceivers at anytime

Parameters
[in,out/opt]PRtcRtpTransceiver* in,out/OPT RtcRtpTransceiver to be freed
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ getNatBehaviorStr()

PUBLIC_API PCHAR getNatBehaviorStr ( NAT_BEHAVIOR  natBehavior)

Return the string representation for each NAT_BEHAVIOR enum.

Parameters
[in]natBehaviorthe NAT_BEHAVIOR enum
Returns
PCHAR string representation for the NAT_BEHAVIOR enum

◆ iceAgentGetMetrics()

PUBLIC_API STATUS iceAgentGetMetrics ( PRtcPeerConnection  pPeerConnection,
PKvsIceAgentMetrics  pKvsIceAgentMetrics 
)

Get peer connection related metrics.

Parameters
[in]PRtcPeerConnectionPeer connection object
[in,out]PKvsIceAgentMetricsKVS ICE agent stats object
Here is the call graph for this function:

◆ initKvsWebRtc()

PUBLIC_API STATUS initKvsWebRtc ( VOID  )

Initializes global state needed for all RtcPeerConnections. It must only be called once.

Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ peerConnectionGetCurrentLocalDescription()

PUBLIC_API STATUS peerConnectionGetCurrentLocalDescription ( PRtcPeerConnection  pRtcPeerConnection,
PRtcSessionDescriptionInit  pRtcSessionDescriptionInit 
)

Load the sdp field of PRtcSessionDescriptionInit with current local session description

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in,out]PRtcSessionDescriptionInitIN/PRtcSessionDescriptionInit whose sdp field will be modified.
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ peerConnectionGetLocalDescription()

PUBLIC_API STATUS peerConnectionGetLocalDescription ( PRtcPeerConnection  pRtcPeerConnection,
PRtcSessionDescriptionInit  pRtcSessionDescriptionInit 
)

Load the sdp field of PRtcSessionDescriptionInit with pending or current local session description

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in,out]PRtcSessionDescriptionInitIN/PRtcSessionDescriptionInit whose sdp field will be modified.
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ peerConnectionGetMetrics()

PUBLIC_API STATUS peerConnectionGetMetrics ( PRtcPeerConnection  pPeerConnection,
PPeerConnectionMetrics  pPeerConnectionMetrics 
)

Get peer connection related metrics.

Parameters
[in]PRtcPeerConnectionPeer connection object
[in,out]PPeerConnectionMetricsPeer connection stats object
Here is the call graph for this function:

◆ peerConnectionOnConnectionStateChange()

PUBLIC_API STATUS peerConnectionOnConnectionStateChange ( PRtcPeerConnection  pRtcPeerConnection,
UINT64  customData,
RtcOnConnectionStateChange  rtcOnConnectionStateChange 
)

Set a callback for connection state change

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]UINT64User customData that will be passed along when RtcOnDataChannel is called
[in]RtcOnIceCandidateUser RtcOnConnectionStateChange callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ peerConnectionOnDataChannel()

PUBLIC_API STATUS peerConnectionOnDataChannel ( PRtcPeerConnection  pRtcPeerConnection,
UINT64  customData,
RtcOnDataChannel  rtcOnDataChannel 
)

Set a callback for data channel

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]UINT64User customData that will be passed along when RtcOnDataChannel is called
[in]RtcOnDataChannelUser RtcOnDataChannel callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ peerConnectionOnIceCandidate()

PUBLIC_API STATUS peerConnectionOnIceCandidate ( PRtcPeerConnection  pRtcPeerConnection,
UINT64  customData,
RtcOnIceCandidate  rtcOnIceCandidate 
)

Set a callback when new Ice collects new local candidate.

NOTE: When IceAgent is done with collecting candidates, RtcOnIceCandidate will be called with NULL.

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]UINT64User customData that will be passed along when RtcOnIceCandidate is called
[in]RtcOnIceCandidateUser callback when new local candidate is found
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ peerConnectionOnSenderBandwidthEstimation()

PUBLIC_API STATUS peerConnectionOnSenderBandwidthEstimation ( PRtcPeerConnection  pRtcPeerConnection,
UINT64  customData,
RtcOnSenderBandwidthEstimation  rtcOnSenderBandwidthEstimation 
)

Set a callback for transport-wide sender bandwidth estimation results.

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in]UINT64User customData that will be passed along when RtcOnSenderBandwidthEstimation is called
[in]RtcOnSenderBandwidthEstimationUser RtcOnSenderBandwidthEstimation callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ restartIce()

PUBLIC_API STATUS restartIce ( PRtcPeerConnection  pPeerConnection)

Instructs the RtcPeerConnection that ICE should be restarted. Subsequent calls to createOffer will create descriptions to restart ICE.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-restartice

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
Returns
- STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ rtcPeerConnectionGetMetrics()

PUBLIC_API STATUS rtcPeerConnectionGetMetrics ( PRtcPeerConnection  pRtcPeerConnection,
PRtcRtpTransceiver  pRtcRtpTransceiver,
PRtcStats  pRtcMetrics 
)

Get the relevant/all metrics based on the RTCStatsType field. This does not include any signaling related metrics. The caller of the API is expected to populate requestedTypeOfStats member of PRtcStats object with one of the values in RTC_STATS_TYPE.

Stats specific expectations: IceServerStats: This return stats for a specific ICE server. In a multi server configuration, it is upto to the application to get Stats for every server being supported / desired server. The application is expected to pass in the specific iceServerIndex for which the stats are desired

Parameters
[in]PRtcPeerConnectionPeer connection for which the stats need to be collected
[in]PRtcRtpTransceiverset to desired transceiver for RTP stats, NULL otherwise If set to NULL for RTP stats, the stats for the first transceiver are returned.
[in,out]PRtcStatsThe stats object with the RTCStatsType field populated

Reference: https://www.w3.org/TR/webrtc/#rtcpeerconnection-interface-extensions-1

Here is the call graph for this function:

◆ serializeSessionDescriptionInit()

PUBLIC_API STATUS serializeSessionDescriptionInit ( PRtcSessionDescriptionInit  pSessionDescriptionInit,
PCHAR  sessionDescriptionJSON,
PUINT32  sessionDescriptionJSONLen 
)

Create a JSON string from RtcSessionDescriptionInit.

Parameters
[in]PRtcSessionDescriptionInitSource RtcSessionDescriptionInit that will become JSON string
[out]PCHARJSON string generated from PRtcSessionDescriptionInit
[out]PUINT32If PCHAR is null this is the required buffer size. If PCHAR is non-NULL this is the length of the output
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ setLocalDescription()

PUBLIC_API STATUS setLocalDescription ( PRtcPeerConnection  pPeerConnection,
PRtcSessionDescriptionInit  pSessionDescriptionInit 
)

Instructs the RtcPeerConnection to apply the supplied RtcSessionDescriptionInit as the local description.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-setlocaldescription

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in,out]
Here is the call graph for this function:

◆ setRemoteDescription()

PUBLIC_API STATUS setRemoteDescription ( PRtcPeerConnection  pPeerConnection,
PRtcSessionDescriptionInit  pSessionDescriptionInit 
)

Instructs the RtcPeerConnection to apply the supplied RtcSessionDescriptionInit as the remote description.

Reference: https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-setremotedescription

Parameters
[in]PRtcPeerConnectionInitialized RtcPeerConnection
[in,out]PRtcSessionDescriptionInitIN/RtcSessionDescriptionInit that becomes our new remote description
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientConnectSync()

PUBLIC_API STATUS signalingClientConnectSync ( SIGNALING_CLIENT_HANDLE  signalingClientHandle)

Connects the signaling client to the web socket in order to send/receive messages.

NOTE: The call will succeed only when the signaling client is in a ready state.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientDeleteSync()

PUBLIC_API STATUS signalingClientDeleteSync ( SIGNALING_CLIENT_HANDLE  signalingClientHandle)

Deletes the signaling channel referenced by SIGNALING_CLIENT_HANDLE.

NOTE: The function is intended to be used to clean up the backend resources and as such should be called at the end of the lifecycle of the signaling channel resource. Attempting to connect to the channel or send a message will result in an error or an unpredictable results after this call.

NOTE: The call transitions the signaling client state machine to a terminal state even if the call fails. The proper handling on success and on an error is to free the signaling client.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientDisconnectSync()

PUBLIC_API STATUS signalingClientDisconnectSync ( SIGNALING_CLIENT_HANDLE  signalingClientHandle)

Disconnects the signaling client.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientFetchSync()

PUBLIC_API STATUS signalingClientFetchSync ( SIGNALING_CLIENT_HANDLE  signalingClientHandle)

Fetches all assets needed to ready the state machine before attempting to connect. Can also be used to reallocate missing / expired assets before reconnecting.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientGetCurrentState()

PUBLIC_API STATUS signalingClientGetCurrentState ( SIGNALING_CLIENT_HANDLE  signalingClientHandle,
PSIGNALING_CLIENT_STATE  pState 
)

Gets the Signaling client current state.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
[out]PSIGNALING_CLIENT_STATECurrent state of the signaling client as an UINT32 enum
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientGetIceConfigInfo()

PUBLIC_API STATUS signalingClientGetIceConfigInfo ( SIGNALING_CLIENT_HANDLE  signalingClientHandle,
UINT32  index,
PIceConfigInfo ppIceConfigInfo 
)

Gets the ICE configuration information object given its index.

NOTE: The call will fail if the client is not in the CONNECTED state. IMPORTANT: The returned pointer to the ICE configuration information object points to internal structures and its contents should not be modified.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
[in]UINT32Index of the ICE configuration information object to retrieve
[out]PIceConfigInfoThe pointer to the ICE configuration information object
Returns
STATUS code of execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientGetIceConfigInfoCount()

PUBLIC_API STATUS signalingClientGetIceConfigInfoCount ( SIGNALING_CLIENT_HANDLE  signalingClientHandle,
PUINT32  pIceConfigCount 
)

Gets the retrieved ICE configuration information object count.

NOTE: The call will fail if the client is not in the CONNECTED state.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
[out]PUINT32The count of the ICE configuration information objects
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ signalingClientGetMetrics()

PUBLIC_API STATUS signalingClientGetMetrics ( SIGNALING_CLIENT_HANDLE  signalingClientHandle,
PSignalingClientMetrics  pSignalingClientMetrics 
)

Get signaling related metrics.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
[in,out]PSignalingClientMetricsSignaling stats
Here is the call graph for this function:

◆ signalingClientGetStateString()

PUBLIC_API STATUS signalingClientGetStateString ( SIGNALING_CLIENT_STATE  state,
PCHAR *  ppStateStr 
)

Gets a literal string representing a Signaling client state.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
[out]PCHAR*Read only string representing the state
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ signalingClientSendMessageSync()

PUBLIC_API STATUS signalingClientSendMessageSync ( SIGNALING_CLIENT_HANDLE  signalingClientHandle,
PSignalingMessage  pSignalingMessage 
)

Send a message through a Signaling client.

NOTE: The call will fail if the client is not in the CONNECTED state. NOTE: This is a synchronous call. It will block and wait for sending the data and await for the ACK from the service.

Parameters
[in]SIGNALING_CLIENT_HANDLESignaling client handle
[in]PSignalingMessageMessage to send.
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function:

◆ transceiverOnBandwidthEstimation()

PUBLIC_API STATUS transceiverOnBandwidthEstimation ( PRtcRtpTransceiver  pRtcRtpTransceiver,
UINT64  customData,
RtcOnBandwidthEstimation  rtcOnBandwidthEstimation 
)

Set a callback for bandwidth estimation results.

Parameters
[in]PRtcRtpTransceiverPopulated RtcRtpTransceiver struct
[in]UINT64User customData that will be passed along when RtcOnBandwidthEstimation is called
[in]RtcOnBandwidthEstimationUser RtcOnBandwidthEstimation callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ transceiverOnFrame()

PUBLIC_API STATUS transceiverOnFrame ( PRtcRtpTransceiver  pRtcRtpTransceiver,
UINT64  customData,
RtcOnFrame  rtcOnFrame 
)

Set a callback for transceiver frame.

Parameters
[in]PRtcRtpTransceiverPopulated RtcRtpTransceiver struct
[in]UINT64User customData that will be passed along when RtcOnFrame is called
[in]RtcOnFrameUser RtcOnFrame callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ transceiverOnPictureLoss()

PUBLIC_API STATUS transceiverOnPictureLoss ( PRtcRtpTransceiver  pRtcRtpTransceiver,
UINT64  customData,
RtcOnPictureLoss  onPictureLoss 
)

Set a callback for picture loss packet (PLI)

Parameters
[in]PRtcRtpTransceiverPopulated RtcRtpTransceiver struct
[in]UINT64User customData that will be passed along when RtcOnPictureLoss is called
[in]RtcOnPictureLossUser RtcOnPictureLoss callback
Returns
STATUS code of the execution. STATUS_SUCCESS on success

◆ updateEncoderStats()

PUBLIC_API STATUS updateEncoderStats ( PRtcRtpTransceiver  pRtcRtpTransceiver,
PRtcEncoderStats  encoderStats 
)

call this function to update stats which depend on external encoder

Parameters
[in]PRtcRtpTransceivertransceiver for which encoder stats will be updated
[in]PRtcEncoderStatspopulated in the application layer which is then consumed as part of outgoingRtpStats

◆ writeFrame()

PUBLIC_API STATUS writeFrame ( PRtcRtpTransceiver  pRtcRtpTransceiver,
PFrame  pFrame 
)

Packetizes and sends media via the configuration specified by the RtcRtpTransceiver.

Parameters
[in]PRtcRtpTransceiverConfigured and connected RtcRtpTransceiver to send media
[in]PFrameFrame of media that will be sent
Returns
STATUS code of the execution. STATUS_SUCCESS on success
Here is the call graph for this function: