Amazon Kinesis Webrtc C SDK
PeerConnection.c File Reference
#include "../Include_i.h"
Include dependency graph for PeerConnection.c:

Macros

#define LOG_CLASS   "PeerConnection"
 

Functions

PWebRtcClientContext getWebRtcClientInstance ()
 
VOID releaseHoldOnInstance (PWebRtcClientContext pWebRtcClientContext)
 
STATUS createWebRtcClientInstance ()
 
STATUS allocateSrtp (PKvsPeerConnection pKvsPeerConnection)
 
VOID onInboundPacket (UINT64 customData, PBYTE buff, UINT32 buffLen)
 
STATUS sendPacketToRtpReceiver (PKvsPeerConnection pKvsPeerConnection, PBYTE pBuffer, UINT32 bufferLen)
 
STATUS changePeerConnectionState (PKvsPeerConnection pKvsPeerConnection, RTC_PEER_CONNECTION_STATE newState)
 
STATUS onFrameReadyFunc (UINT64 customData, UINT16 startIndex, UINT16 endIndex, UINT32 frameSize)
 
STATUS onFrameDroppedFunc (UINT64 customData, UINT16 startIndex, UINT16 endIndex, UINT32 timestamp)
 
PVOID dtlsSessionStartThread (PVOID args)
 
VOID onIceConnectionStateChange (UINT64 customData, UINT64 connectionState)
 
VOID onNewIceLocalCandidate (UINT64 customData, PCHAR candidateSdpStr)
 
VOID onSctpSessionOutboundPacket (UINT64 customData, PBYTE pPacket, UINT32 packetLen)
 
VOID onSctpSessionDataChannelMessage (UINT64 customData, UINT32 channelId, BOOL isBinary, PBYTE pMessage, UINT32 pMessageLen)
 
VOID onSctpSessionDataChannelOpen (UINT64 customData, UINT32 channelId, PBYTE pName, UINT32 nameLen)
 
VOID onDtlsOutboundPacket (UINT64 customData, PBYTE pBuffer, UINT32 bufferLen)
 
VOID onDtlsStateChange (UINT64 customData, RTC_DTLS_TRANSPORT_STATE newDtlsState)
 
STATUS generateJSONSafeString (PCHAR pDst, UINT32 len)
 
STATUS rtcpReportsCallback (UINT32 timerId, UINT64 currentTime, UINT64 customData)
 
STATUS getStunAddr (PStunIpAddrContext pStunIpAddrCtx)
 
STATUS onSetStunServerIp (UINT64 customData, PCHAR url, PKvsIpAddress pIpAddr)
 
PVOID resolveStunIceServerIp (PVOID args)
 
STATUS createPeerConnection (PRtcConfiguration pConfiguration, PRtcPeerConnection *ppPeerConnection)
 Initialize a RtcPeerConnection with the provided Configuration. More...
 
STATUS freeHashEntry (UINT64 customData, PHashEntry pHashEntry)
 
STATUS freePeerConnection (PRtcPeerConnection *ppPeerConnection)
 Free a RtcPeerConnection. More...
 
STATUS peerConnectionOnIceCandidate (PRtcPeerConnection pRtcPeerConnection, UINT64 customData, RtcOnIceCandidate rtcOnIceCandidate)
 Set a callback when new Ice collects new local candidate. More...
 
STATUS peerConnectionOnDataChannel (PRtcPeerConnection pRtcPeerConnection, UINT64 customData, RtcOnDataChannel rtcOnDataChannel)
 
STATUS peerConnectionOnConnectionStateChange (PRtcPeerConnection pRtcPeerConnection, UINT64 customData, RtcOnConnectionStateChange rtcOnConnectionStateChange)
 
STATUS peerConnectionOnSenderBandwidthEstimation (PRtcPeerConnection pRtcPeerConnection, UINT64 customData, RtcOnSenderBandwidthEstimation rtcOnSenderBandwidthEstimation)
 Set a callback for transport-wide sender bandwidth estimation results. More...
 
STATUS peerConnectionGetLocalDescription (PRtcPeerConnection pRtcPeerConnection, PRtcSessionDescriptionInit pRtcSessionDescriptionInit)
 
STATUS peerConnectionGetCurrentLocalDescription (PRtcPeerConnection pRtcPeerConnection, PRtcSessionDescriptionInit pRtcSessionDescriptionInit)
 
UINT32 parseExtId (PCHAR extmapValue)
 parses string of form "$number $whatever" returns $number as uint32 More...
 
STATUS setRemoteDescription (PRtcPeerConnection pPeerConnection, PRtcSessionDescriptionInit pSessionDescriptionInit)
 Instructs the RtcPeerConnection to apply the supplied RtcSessionDescriptionInit as the remote description. More...
 
STATUS createOffer (PRtcPeerConnection pPeerConnection, PRtcSessionDescriptionInit pSessionDescriptionInit)
 Populate the provided answer that contains an RFC 3264 offer with the supported configurations for the session. More...
 
STATUS createAnswer (PRtcPeerConnection pPeerConnection, PRtcSessionDescriptionInit pSessionDescriptionInit)
 Populate the provided answer that contains an RFC 3264 answer with the supported configurations for the session. More...
 
STATUS setLocalDescription (PRtcPeerConnection pPeerConnection, PRtcSessionDescriptionInit pSessionDescriptionInit)
 Instructs the RtcPeerConnection to apply the supplied RtcSessionDescriptionInit as the local description. More...
 
STATUS addTransceiver (PRtcPeerConnection pPeerConnection, PRtcMediaStreamTrack pRtcMediaStreamTrack, PRtcRtpTransceiverInit pRtcRtpTransceiverInit, PRtcRtpTransceiver *ppRtcRtpTransceiver)
 Create a new RtcRtpTransceiver and add it to the set of transceivers. More...
 
STATUS addSupportedCodec (PRtcPeerConnection pPeerConnection, RTC_CODEC rtcCodec)
 Adds to the list of codecs we support receiving. More...
 
STATUS addIceCandidate (PRtcPeerConnection pPeerConnection, PCHAR pIceCandidate)
 Provides a remote candidate to the ICE Agent. More...
 
STATUS restartIce (PRtcPeerConnection pPeerConnection)
 Instructs the RtcPeerConnection that ICE should be restarted. Subsequent calls to createOffer will create descriptions to restart ICE. More...
 
STATUS closePeerConnection (PRtcPeerConnection pPeerConnection)
 Close the underlying DTLS session and IceAgent connection. Trigger RtcOnConnectionStateChange to RTC_PEER_CONNECTION_STATE_CLOSED. More...
 
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. More...
 
STATUS initKvsWebRtc (VOID)
 Initializes global state needed for all RtcPeerConnections. It must only be called once. More...
 
STATUS cleanupWebRtcClientInstance ()
 
STATUS deinitKvsWebRtc (VOID)
 Deinitializes global state needed for all RtcPeerConnections. It must only be called once. More...
 
STATUS twccManagerOnPacketSent (PKvsPeerConnection pKvsPeerConnection, PRtpPacket pRtpPacket)
 
STATUS peerConnectionGetMetrics (PRtcPeerConnection pPeerConnection, PPeerConnectionMetrics pPeerConnectionMetrics)
 Get peer connection related metrics. More...
 
STATUS iceAgentGetMetrics (PRtcPeerConnection pPeerConnection, PKvsIceAgentMetrics pKvsIceAgentMetrics)
 Get peer connection related metrics. More...
 

Macro Definition Documentation

◆ LOG_CLASS

#define LOG_CLASS   "PeerConnection"

Function Documentation

◆ allocateSrtp()

STATUS allocateSrtp ( PKvsPeerConnection  pKvsPeerConnection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changePeerConnectionState()

STATUS changePeerConnectionState ( PKvsPeerConnection  pKvsPeerConnection,
RTC_PEER_CONNECTION_STATE  newState 
)
Here is the caller graph for this function:

◆ cleanupWebRtcClientInstance()

STATUS cleanupWebRtcClientInstance ( )
Here is the call graph for this function:

◆ createWebRtcClientInstance()

STATUS createWebRtcClientInstance ( )
Here is the call graph for this function:

◆ dtlsSessionStartThread()

PVOID dtlsSessionStartThread ( PVOID  args)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeHashEntry()

STATUS freeHashEntry ( UINT64  customData,
PHashEntry  pHashEntry 
)
Here is the caller graph for this function:

◆ generateJSONSafeString()

STATUS generateJSONSafeString ( PCHAR  pDst,
UINT32  len 
)
Here is the caller graph for this function:

◆ getStunAddr()

STATUS getStunAddr ( PStunIpAddrContext  pStunIpAddrCtx)
Here is the caller graph for this function:

◆ getWebRtcClientInstance()

PWebRtcClientContext getWebRtcClientInstance ( )
Here is the caller graph for this function:

◆ onDtlsOutboundPacket()

VOID onDtlsOutboundPacket ( UINT64  customData,
PBYTE  pBuffer,
UINT32  bufferLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onDtlsStateChange()

VOID onDtlsStateChange ( UINT64  customData,
RTC_DTLS_TRANSPORT_STATE  newDtlsState 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onFrameDroppedFunc()

STATUS onFrameDroppedFunc ( UINT64  customData,
UINT16  startIndex,
UINT16  endIndex,
UINT32  timestamp 
)
Here is the caller graph for this function:

◆ onFrameReadyFunc()

STATUS onFrameReadyFunc ( UINT64  customData,
UINT16  startIndex,
UINT16  endIndex,
UINT32  frameSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onIceConnectionStateChange()

VOID onIceConnectionStateChange ( UINT64  customData,
UINT64  connectionState 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onInboundPacket()

VOID onInboundPacket ( UINT64  customData,
PBYTE  buff,
UINT32  buffLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onNewIceLocalCandidate()

VOID onNewIceLocalCandidate ( UINT64  customData,
PCHAR  candidateSdpStr 
)
Here is the caller graph for this function:

◆ onSctpSessionDataChannelMessage()

VOID onSctpSessionDataChannelMessage ( UINT64  customData,
UINT32  channelId,
BOOL  isBinary,
PBYTE  pMessage,
UINT32  pMessageLen 
)

◆ onSctpSessionDataChannelOpen()

VOID onSctpSessionDataChannelOpen ( UINT64  customData,
UINT32  channelId,
PBYTE  pName,
UINT32  nameLen 
)

◆ onSctpSessionOutboundPacket()

VOID onSctpSessionOutboundPacket ( UINT64  customData,
PBYTE  pPacket,
UINT32  packetLen 
)
Here is the call graph for this function:

◆ onSetStunServerIp()

STATUS onSetStunServerIp ( UINT64  customData,
PCHAR  url,
PKvsIpAddress  pIpAddr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseExtId()

UINT32 parseExtId ( PCHAR  extmapValue)

parses string of form "$number $whatever" returns $number as uint32

Returns
0 if value is not parsable or null
Here is the caller graph for this function:

◆ releaseHoldOnInstance()

VOID releaseHoldOnInstance ( PWebRtcClientContext  pWebRtcClientContext)
Here is the caller graph for this function:

◆ resolveStunIceServerIp()

PVOID resolveStunIceServerIp ( PVOID  args)
Here is the call graph for this function:

◆ rtcpReportsCallback()

STATUS rtcpReportsCallback ( UINT32  timerId,
UINT64  currentTime,
UINT64  customData 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendPacketToRtpReceiver()

STATUS sendPacketToRtpReceiver ( PKvsPeerConnection  pKvsPeerConnection,
PBYTE  pBuffer,
UINT32  bufferLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ twccManagerOnPacketSent()

STATUS twccManagerOnPacketSent ( PKvsPeerConnection  pKvsPeerConnection,
PRtpPacket  pRtpPacket 
)
Here is the caller graph for this function: